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

Unified Diff: sky/shell/sky_main.cc

Issue 936883002: Connect Sky and Ganesh in SkyShell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Address review comments Created 5 years, 10 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/shell.cc ('k') | sky/shell/sky_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/shell/sky_main.cc
diff --git a/sky/shell/sky_main.cc b/sky/shell/sky_main.cc
index 4ae0b940be6b917be21e07fc786750b3a69212ae..4a10ab0df3f30fa1a575c62db55b7bb00e1d116f 100644
--- a/sky/shell/sky_main.cc
+++ b/sky/shell/sky_main.cc
@@ -31,11 +31,6 @@ namespace {
LazyInstance<scoped_ptr<base::MessageLoop>> g_java_message_loop =
LAZY_INSTANCE_INITIALIZER;
-LazyInstance<base::android::ScopedJavaGlobalRef<jobject>> g_main_activiy =
- LAZY_INSTANCE_INITIALIZER;
-
-LazyInstance<scoped_ptr<Shell>> g_shell = LAZY_INSTANCE_INITIALIZER;
-
void InitializeLogging() {
logging::LoggingSettings settings;
settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
@@ -49,16 +44,11 @@ void InitializeLogging() {
} // namespace
-static void Init(JNIEnv* env,
- jclass clazz,
- jobject activity) {
- g_main_activiy.Get().Reset(env, activity);
-
- base::android::ScopedJavaLocalRef<jobject> scoped_activity(env, activity);
- base::android::InitApplicationContext(env, scoped_activity);
+static void Init(JNIEnv* env, jclass clazz, jobject context) {
+ base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context);
+ base::android::InitApplicationContext(env, scoped_context);
base::CommandLine::Init(0, nullptr);
-
InitializeLogging();
g_java_message_loop.Get().reset(new base::MessageLoopForUI);
@@ -67,16 +57,7 @@ static void Init(JNIEnv* env,
base::i18n::InitializeICU();
gfx::GLSurface::InitializeOneOff();
- g_shell.Get().reset(new Shell(g_java_message_loop.Get()->task_runner()));
-
- g_java_message_loop.Get()->PostTask(
- FROM_HERE,
- base::Bind(&Shell::Init, base::Unretained(g_shell.Get().get())));
-}
-
-static jboolean Start(JNIEnv* env, jclass clazz) {
- LOG(INFO) << "Native code started!";
- return true;
+ Shell::Init(g_java_message_loop.Get()->task_runner());
}
bool RegisterSkyMain(JNIEnv* env) {
« no previous file with comments | « sky/shell/shell.cc ('k') | sky/shell/sky_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698