Flutter Engine
main.cc
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include <lib/async-loop/cpp/loop.h>
6 #include <lib/trace-provider/provider.h>
7 #include <lib/trace/event.h>
8 
9 #include <cstdlib>
10 
11 #include "loop.h"
12 #include "platform/utils.h"
13 #include "runner.h"
15 
16 int main(int argc, char const* argv[]) {
17  std::unique_ptr<async::Loop> loop(flutter_runner::MakeObservableLoop(true));
18 
19  std::unique_ptr<trace::TraceProviderWithFdio> provider;
20  {
21  bool already_started;
22  // Use CreateSynchronously to prevent loss of early events.
23  trace::TraceProviderWithFdio::CreateSynchronously(
24  loop->dispatcher(), "flutter_runner", &provider, &already_started);
25  }
26 
27  // Set up the process-wide /tmp memfs.
28  dart_utils::RunnerTemp runner_temp;
29 
30  FML_DLOG(INFO) << "Flutter application services initialized.";
31 
32  flutter_runner::Runner runner(loop.get(), dart::ComponentContext());
33 
34  loop->Run();
35  FML_DLOG(INFO) << "Flutter application services terminated.";
36 
37  return EXIT_SUCCESS;
38 }
int main(int argc, const char **argv)
Definition: main.cc:34
async::Loop * MakeObservableLoop(bool attachToThread)
Definition: loop.cc:42
#define FML_DLOG(severity)
Definition: logging.h:85