Skip to content

Commit

Permalink
[flutter_runner] Move from runner context to component context (flutt…
Browse files Browse the repository at this point in the history
…er#12346)

* [flutter_runner] Move from runner context to component context

* remove the file references
  • Loading branch information
iskakaushik authored Sep 19, 2019
1 parent 33ad675 commit 725dc25
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 121 deletions.
2 changes: 0 additions & 2 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -955,8 +955,6 @@ FILE: ../../../flutter/shell/platform/fuchsia/flutter/platform_view.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/platform_view.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/runner.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/runner.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/runner_context.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/runner_context.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/sample_unittests.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/session_connection.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/session_connection.h
Expand Down
2 changes: 0 additions & 2 deletions shell/platform/fuchsia/flutter/engine_flutter_runner.gni
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ template("flutter_runner") {
"platform_view.h",
"runner.cc",
"runner.h",
"runner_context.cc",
"runner_context.h",
"session_connection.cc",
"session_connection.h",
"surface.cc",
Expand Down
11 changes: 6 additions & 5 deletions shell/platform/fuchsia/flutter/runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include "flutter/fml/make_copyable.h"
#include "flutter/lib/ui/text/font_collection.h"
#include "flutter/runtime/dart_vm.h"
#include "lib/sys/cpp/component_context.h"
#include "runtime/dart/utils/files.h"
#include "runtime/dart/utils/vmo.h"
#include "runtime/dart/utils/vmservice_object.h"
Expand Down Expand Up @@ -102,12 +103,12 @@ static void RegisterProfilerSymbols(const char* symbols_path,
#endif // !defined(DART_PRODUCT)

Runner::Runner(async::Loop* loop)
: loop_(loop), runner_context_(RunnerContext::CreateFromStartupInfo()) {
: loop_(loop), context_(sys::ComponentContext::Create()) {
#if !defined(DART_PRODUCT)
// The VM service isolate uses the process-wide namespace. It writes the
// vm service protocol port under /tmp. The VMServiceObject exposes that
// port number to The Hub.
runner_context_->debug_dir()->AddEntry(
context_->outgoing()->debug_dir()->AddEntry(
dart_utils::VMServiceObject::kPortDirName,
std::make_unique<dart_utils::VMServiceObject>());

Expand All @@ -122,7 +123,7 @@ Runner::Runner(async::Loop* loop)

SetThreadName("io.flutter.runner.main");

runner_context_->AddPublicService<fuchsia::sys::Runner>(
context_->outgoing()->AddPublicService<fuchsia::sys::Runner>(
std::bind(&Runner::RegisterApplication, this, std::placeholders::_1));

#if !defined(DART_PRODUCT)
Expand All @@ -137,7 +138,7 @@ Runner::Runner(async::Loop* loop)
}

Runner::~Runner() {
runner_context_->RemovePublicService<fuchsia::sys::Runner>();
context_->outgoing()->RemovePublicService<fuchsia::sys::Runner>();

#if !defined(DART_PRODUCT)
trace_observer_->Stop();
Expand Down Expand Up @@ -181,7 +182,7 @@ void Runner::StartComponent(
std::move(termination_callback), // termination callback
std::move(package), // application package
std::move(startup_info), // startup info
runner_context_->svc(), // runner incoming services
context_->svc(), // runner incoming services
std::move(controller) // controller request
);

Expand Down
3 changes: 1 addition & 2 deletions shell/platform/fuchsia/flutter/runner.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include "component.h"
#include "flutter/fml/macros.h"
#include "lib/fidl/cpp/binding_set.h"
#include "runner_context.h"
#include "runtime/dart/utils/vmservice_object.h"
#include "thread.h"

Expand Down Expand Up @@ -45,7 +44,7 @@ class Runner final : public fuchsia::sys::Runner {
ActiveApplication() = default;
};

std::unique_ptr<RunnerContext> runner_context_;
std::unique_ptr<sys::ComponentContext> context_;
fidl::BindingSet<fuchsia::sys::Runner> active_applications_bindings_;
std::unordered_map<const Application*, ActiveApplication>
active_applications_;
Expand Down
40 changes: 0 additions & 40 deletions shell/platform/fuchsia/flutter/runner_context.cc

This file was deleted.

70 changes: 0 additions & 70 deletions shell/platform/fuchsia/flutter/runner_context.h

This file was deleted.

0 comments on commit 725dc25

Please sign in to comment.