Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
main.cc File Reference
#include <lib/async-loop/cpp/loop.h>
#include <lib/inspect/component/cpp/component.h>
#include <lib/trace-provider/provider.h>
#include <lib/trace/event.h>
#include <cstdlib>
#include "fml/message_loop.h"
#include "fml/platform/fuchsia/log_interest_listener.h"
#include "fml/platform/fuchsia/log_state.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 23 of file main.cc.

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