forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
application_controller_impl.h
68 lines (49 loc) · 2.03 KB
/
application_controller_impl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_
#define FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_
#include <memory>
#include "application/lib/svc/service_provider_bridge.h"
#include "application/services/application_controller.fidl.h"
#include "application/services/application_runner.fidl.h"
#include "application/services/service_provider.fidl.h"
#include "apps/mozart/services/views/view_provider.fidl.h"
#include "dart/runtime/include/dart_api.h"
#include "lib/fidl/cpp/bindings/binding.h"
#include "lib/fidl/cpp/bindings/binding_set.h"
#include "lib/ftl/macros.h"
#include "lib/ftl/synchronization/waitable_event.h"
namespace flutter_runner {
class App;
class RuntimeHolder;
class ApplicationControllerImpl : public app::ApplicationController,
public mozart::ViewProvider {
public:
ApplicationControllerImpl(
App* app,
app::ApplicationPackagePtr application,
app::ApplicationStartupInfoPtr startup_info,
fidl::InterfaceRequest<app::ApplicationController> controller);
~ApplicationControllerImpl() override;
// |app::ApplicationController| implementation
void Kill() override;
void Detach() override;
// |mozart::ViewProvider| implementation
void CreateView(
fidl::InterfaceRequest<mozart::ViewOwner> view_owner_request,
fidl::InterfaceRequest<app::ServiceProvider> services) override;
Dart_Port GetUIIsolateMainPort();
std::string GetUIIsolateName();
private:
void StartRuntimeIfReady();
App* app_;
fidl::Binding<app::ApplicationController> binding_;
app::ServiceProviderBridge service_provider_bridge_;
fidl::BindingSet<mozart::ViewProvider> view_provider_bindings_;
std::string url_;
std::unique_ptr<RuntimeHolder> runtime_holder_;
FTL_DISALLOW_COPY_AND_ASSIGN(ApplicationControllerImpl);
};
} // namespace flutter_runner
#endif // FLUTTER_CONTENT_HANDLER_APPLICATION_IMPL_H_