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

Side by Side Diff: mojo/shell/android/mojo_main.cc

Issue 54923002: Android: Allow duplicate calls to InitApplicationContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "mojo/shell/android/mojo_main.h" 5 #include "mojo/shell/android/mojo_main.h"
6 6
7 #include "base/android/jni_string.h" 7 #include "base/android/jni_string.h"
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 void StartOnShellThread() { 45 void StartOnShellThread() {
46 g_context.Get().reset(new shell::Context()); 46 g_context.Get().reset(new shell::Context());
47 shell::Run(g_context.Get().get()); 47 shell::Run(g_context.Get().get());
48 } 48 }
49 49
50 } // namspace 50 } // namspace
51 51
52 static void Init(JNIEnv* env, jclass clazz, jobject context) { 52 static void Init(JNIEnv* env, jclass clazz, jobject context) {
53 base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context); 53 base::android::ScopedJavaLocalRef<jobject> scoped_context(env, context);
54 54
55 base::android::InitApplicationContext(scoped_context); 55 base::android::InitApplicationContext(env, scoped_context);
56 56
57 if (g_at_exit) 57 if (g_at_exit)
58 return; 58 return;
59 g_at_exit = new base::AtExitManager(); 59 g_at_exit = new base::AtExitManager();
60 // TODO(abarth): Currently we leak g_at_exit. 60 // TODO(abarth): Currently we leak g_at_exit.
61 61
62 CommandLine::Init(0, 0); 62 CommandLine::Init(0, 0);
63 InitializeLogging(); 63 InitializeLogging();
64 64
65 // TODO(abarth): At which point should we switch to cross-platform 65 // TODO(abarth): At which point should we switch to cross-platform
(...skipping 17 matching lines...) Expand all
83 base::Bind(StartOnShellThread)); 83 base::Bind(StartOnShellThread));
84 84
85 // TODO(abarth): Currently we leak g_shell_thread. 85 // TODO(abarth): Currently we leak g_shell_thread.
86 } 86 }
87 87
88 bool RegisterMojoMain(JNIEnv* env) { 88 bool RegisterMojoMain(JNIEnv* env) {
89 return RegisterNativesImpl(env); 89 return RegisterNativesImpl(env);
90 } 90 }
91 91
92 } // namespace mojo 92 } // namespace mojo
OLDNEW
« no previous file with comments | « content/shell/android/browsertests_apk/content_browser_tests_android.cc ('k') | remoting/client/jni/chromoting_jni_runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698