Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(600)

Unified Diff: sky/shell/ui/engine.cc

Issue 1187503003: Refactor SkyShell to allow multiple SkyViews (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: s/instance/sky_shell/ Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/shell/ui/engine.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/ui/engine.cc
diff --git a/sky/shell/ui/engine.cc b/sky/shell/ui/engine.cc
index f82922b8fcdcdaa1c4c65982a34df8d65e45b5cc..944142cb4272027e7a0df2aabb0d54c2fd500d58 100644
--- a/sky/shell/ui/engine.cc
+++ b/sky/shell/ui/engine.cc
@@ -33,6 +33,8 @@ void ConfigureSettings(blink::WebSettings* settings) {
settings->setLoadsImagesAutomatically(true);
}
+PlatformImpl* g_platform_impl = nullptr;
+
}
Engine::Engine(const Config& config)
@@ -53,15 +55,17 @@ base::WeakPtr<Engine> Engine::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
-void Engine::Init() {
+void Engine::Init(ServiceProviderContext* service_provider_context) {
TRACE_EVENT0("sky", "Engine::Init");
- service_provider_ = CreateServiceProvider(config_.service_provider_context);
+ mojo::ServiceProviderPtr service_provider =
+ CreateServiceProvider(service_provider_context);
mojo::NetworkServicePtr network_service;
- mojo::ConnectToService(service_provider_.get(), &network_service);
- platform_impl_.reset(new PlatformImpl(network_service.Pass()));
+ mojo::ConnectToService(service_provider.get(), &network_service);
- blink::initialize(platform_impl_.get());
+ DCHECK(!g_platform_impl);
+ g_platform_impl = new PlatformImpl(network_service.Pass());
+ blink::initialize(g_platform_impl);
}
void Engine::BeginFrame(base::TimeTicks frame_time) {
« no previous file with comments | « sky/shell/ui/engine.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698