Flutter Engine
dart_runner.h
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 #ifndef FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_RUNNER_DART_RUNNER_H_
6 #define FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_RUNNER_DART_RUNNER_H_
7 
8 #include <fuchsia/component/runner/cpp/fidl.h>
9 #include <fuchsia/sys/cpp/fidl.h>
10 #include <lib/fidl/cpp/binding_set.h>
11 #include <lib/sys/cpp/component_context.h>
12 
14 
15 namespace dart_runner {
16 
17 class DartRunner : public fuchsia::sys::Runner,
18  public fuchsia::component::runner::ComponentRunner {
19  public:
20  explicit DartRunner(sys::ComponentContext* context);
21  ~DartRunner() override;
22 
23  private:
24  // |fuchsia::sys::Runner| implementation:
25  void StartComponent(fuchsia::sys::Package package,
26  fuchsia::sys::StartupInfo startup_info,
27  fidl::InterfaceRequest<fuchsia::sys::ComponentController>
28  controller) override;
29 
30  // |fuchsia::component::runner::ComponentRunner| implementation:
31  void Start(
32  fuchsia::component::runner::ComponentStartInfo start_info,
33  fidl::InterfaceRequest<fuchsia::component::runner::ComponentController>
34  controller) override;
35 
36  // Not owned by DartRunner.
37  sys::ComponentContext* context_;
38  fidl::BindingSet<fuchsia::sys::Runner> bindings_;
39  fidl::BindingSet<fuchsia::component::runner::ComponentRunner>
40  component_runner_bindings_;
41 
42 #if !defined(AOT_RUNTIME)
43  dart_utils::MappedResource vm_snapshot_data_;
44  dart_utils::MappedResource vm_snapshot_instructions_;
45 #endif
46 
47  // Disallow copy and assignment.
48  DartRunner(const DartRunner&) = delete;
49  DartRunner& operator=(const DartRunner&) = delete;
50 };
51 
52 } // namespace dart_runner
53 
54 #endif // FLUTTER_SHELL_PLATFORM_FUCHSIA_DART_RUNNER_DART_RUNNER_H_
DartRunner(sys::ComponentContext *context)
Definition: dart_runner.cc:162