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/async/default.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 "flutter/fml/message_loop.h"
#include "flutter/shell/platform/fuchsia/flutter/logging.h"
#include "flutter/shell/platform/fuchsia/flutter/runner.h"
#include "flutter/shell/platform/fuchsia/runtime/dart/utils/build_info.h"
#include "flutter/shell/platform/fuchsia/runtime/dart/utils/root_inspect_node.h"
#include "platform/utils.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 21 of file main.cc.

21 {
23
24 // Set up logging.
25 fuchsia_logging::LogSettingsBuilder()
26 .WithTags({LOG_TAG})
27 .WithDispatcher(async_get_default_dispatcher())
28 .BuildAndInitialize();
29
30 // Create our component context which is served later.
31 auto context = sys::ComponentContext::Create();
33 auto build_info = dart_utils::RootInspectNode::CreateRootChild("build_info");
35
36 // We inject the 'vm' node into the dart vm so that it can add any inspect
37 // data that it needs to the inspect tree.
38 dart::SetDartVmNode(std::make_unique<inspect::Node>(
40
41 std::unique_ptr<trace::TraceProviderWithFdio> provider;
42 {
43 bool already_started;
44 // Use CreateSynchronously to prevent loss of early events.
45 trace::TraceProviderWithFdio::CreateSynchronously(
46 async_get_default_dispatcher(), "flutter_runner", &provider,
47 &already_started);
48 }
49
51 flutter_runner::Runner runner(loop.GetTaskRunner(), context.get());
52
53 // Wait to serve until we have finished all of our setup.
54 context->outgoing()->ServeFromStartupInfo();
55
56 loop.Run();
57
58 return EXIT_SUCCESS;
59}
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().