Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
main.cc File Reference
#include <lib/async-loop/cpp/loop.h>
#include <lib/inspect/component/cpp/component.h>
#include <lib/syslog/cpp/log_settings.h>
#include <lib/trace-provider/provider.h>
#include <lib/trace/event.h>
#include <cstdlib>
#include "fml/message_loop.h"
#include "lib/async/default.h"
#include "logging.h"
#include "platform/utils.h"
#include "runner.h"
#include "runtime/dart/utils/build_info.h"
#include "runtime/dart/utils/root_inspect_node.h"
#include "runtime/dart/utils/tempfs.h"

Go to the source code of this file.

Functions

int main (int argc, char const *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char const *  argv[] 
)

Definition at line 22 of file main.cc.

22 {
24
25 // Set up logging.
26 fuchsia_logging::LogSettingsBuilder()
27 .WithTags({LOG_TAG})
28 .WithDispatcher(async_get_default_dispatcher())
29 .BuildAndInitialize();
30
31 // Create our component context which is served later.
32 auto context = sys::ComponentContext::Create();
34 auto build_info = dart_utils::RootInspectNode::CreateRootChild("build_info");
36
37 // We inject the 'vm' node into the dart vm so that it can add any inspect
38 // data that it needs to the inspect tree.
39 dart::SetDartVmNode(std::make_unique<inspect::Node>(
41
42 std::unique_ptr<trace::TraceProviderWithFdio> provider;
43 {
44 bool already_started;
45 // Use CreateSynchronously to prevent loss of early events.
46 trace::TraceProviderWithFdio::CreateSynchronously(
47 async_get_default_dispatcher(), "flutter_runner", &provider,
48 &already_started);
49 }
50
52 flutter_runner::Runner runner(loop.GetTaskRunner(), context.get());
53
54 // Wait to serve until we have finished all of our setup.
55 context->outgoing()->ServeFromStartupInfo();
56
57 loop.Run();
58
59 return EXIT_SUCCESS;
60}
static void Dump(inspect::Node &node)
static void Initialize(sys::ComponentContext *context)
static inspect::Node CreateRootChild(const std::string &name)
static void EnsureInitializedForCurrentThread()
fml::RefPtr< fml::TaskRunner > GetTaskRunner() const
static FML_EMBEDDER_ONLY MessageLoop & GetCurrent()
T * get() const
Definition ref_ptr.h:117
#define LOG_TAG
Definition logging.h:11

References dart_utils::RootInspectNode::CreateRootChild(), dart_utils::BuildInfo::Dump(), fml::MessageLoop::EnsureInitializedForCurrentThread(), fml::RefPtr< T >::get(), fml::MessageLoop::GetCurrent(), fml::MessageLoop::GetTaskRunner(), dart_utils::RootInspectNode::Initialize(), LOG_TAG, and fml::MessageLoop::Run().