diff --git a/sky/shell/android/sky_main.cc b/sky/shell/android/sky_main.cc index 98118282dbd1e2f1d6bc78df400496de3caa426a..0712c369e1d62b049fa8e2f91355be83e6b16f30 100644 --- a/sky/shell/android/sky_main.cc +++ b/sky/shell/android/sky_main.cc @@ -10,7 +10,6 @@ #include "base/at_exit.h" #include "base/bind.h" #include "base/command_line.h" -#include "base/i18n/icu_util.h" #include "base/lazy_instance.h" #include "base/logging.h" #include "base/macros.h" @@ -20,7 +19,6 @@ #include "jni/SkyMain_jni.h" #include "sky/shell/service_provider.h" #include "sky/shell/shell.h" -#include "ui/gl/gl_surface_egl.h" using base::LazyInstance; @@ -55,9 +53,6 @@ static void Init(JNIEnv* env, jclass clazz, jobject context) { g_java_message_loop.Get().reset(new base::MessageLoopForUI); base::MessageLoopForUI::current()->Start(); - base::i18n::InitializeICU(); - gfx::GLSurface::InitializeOneOff(); - Shell::Init(make_scoped_ptr(new ServiceProviderContext( g_java_message_loop.Get()->task_runner()))); } diff --git a/sky/shell/linux/main.cc b/sky/shell/linux/main.cc index 06759977a7325284f636ba28099011bf10ce5e16..66446c99aafea775e8eba8bf4636f1026dbf765f 100644 --- a/sky/shell/linux/main.cc +++ b/sky/shell/linux/main.cc @@ -36,8 +36,6 @@ void Init() { blink::WebRuntimeFeatures::enableObservatory( !command_line.HasSwitch(switches::kNonInteractive)); - Shell::Init(make_scoped_ptr(new ServiceProviderContext( - base::MessageLoop::current()->task_runner()))); // Explicitly boot the shared test runner. TestRunner& runner = TestRunner::Shared(); @@ -80,7 +78,8 @@ int main(int argc, const char* argv[]) { base::MessageLoop message_loop; - base::i18n::InitializeICU(); + sky::shell::Shell::Init(make_scoped_ptr( + new sky::shell::ServiceProviderContext(message_loop.task_runner()))); message_loop.PostTask(FROM_HERE, base::Bind(&sky::shell::Init)); message_loop.Run(); diff --git a/sky/shell/mac/platform_mac.mm b/sky/shell/mac/platform_mac.mm index 2b6d6e897a5226b830de6b891a393fde26b4cba8..47bf328b24fe95fb3927c1ebe27496224027d6d8 100644 --- a/sky/shell/mac/platform_mac.mm +++ b/sky/shell/mac/platform_mac.mm @@ -45,38 +45,29 @@ int PlatformMacMain(int argc, RedirectIOConnectionsToSyslog(); - auto result = false; + bool result = false; result = base::CommandLine::Init(argc, argv); DLOG_ASSERT(result); InitializeLogging(); - result = base::i18n::InitializeICU(); - DLOG_ASSERT(result); - - result = gfx::GLSurface::InitializeOneOff(); - DLOG_ASSERT(result); - - scoped_ptr main_message_loop( - new base::MessageLoopForUI()); + scoped_ptr message_loop(new base::MessageLoopForUI()); #if TARGET_OS_IPHONE // One cannot start the message loop on the platform main thread. Instead, // we attach to the CFRunLoop - main_message_loop->Attach(); + message_loop->Attach(); #endif - auto service_provider_context = make_scoped_ptr( - new sky::shell::ServiceProviderContext(main_message_loop->task_runner())); - - sky::shell::Shell::Init(service_provider_context.Pass()); + sky::shell::Shell::Init(make_scoped_ptr( + new sky::shell::ServiceProviderContext(message_loop->task_runner())); result = callback(); #if !TARGET_OS_IPHONE if (result == EXIT_SUCCESS) { - main_message_loop->QuitNow(); + message_loop->QuitNow(); } #endif diff --git a/sky/shell/shell.cc b/sky/shell/shell.cc index 1147b3ee1416a80cc4f7502a2397402a97ed6c6f..45db55a65e83c1d80afc8fde55f1776ab980bf94 100644 --- a/sky/shell/shell.cc +++ b/sky/shell/shell.cc @@ -5,11 +5,13 @@ #include "sky/shell/shell.h" #include "base/bind.h" +#include "base/i18n/icu_util.h" #include "base/single_thread_task_runner.h" #include "mojo/common/message_pump_mojo.h" #include "mojo/edk/embedder/embedder.h" #include "mojo/edk/embedder/simple_platform_support.h" #include "sky/shell/ui/engine.h" +#include "ui/gl/gl_surface.h" namespace sky { namespace shell { @@ -45,6 +47,10 @@ Shell::~Shell() { } void Shell::Init(scoped_ptr service_provider_context) { + CHECK(base::i18n::InitializeICU()); +#if !defined(OS_LINUX) + CHECK(gfx::GLSurface::InitializeOneOff()); +#endif g_shell = new Shell(service_provider_context.Pass()); }