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

Side by Side Diff: remoting/client/jni/chromoting_jni_runtime.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
« no previous file with comments | « mojo/shell/android/mojo_main.cc ('k') | testing/android/native_test_launcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "remoting/client/jni/chromoting_jni_runtime.h" 5 #include "remoting/client/jni/chromoting_jni_runtime.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 22 matching lines...) Expand all
33 33
34 bool RegisterJni(JNIEnv* env) { 34 bool RegisterJni(JNIEnv* env) {
35 return remoting::RegisterNativesImpl(env); 35 return remoting::RegisterNativesImpl(env);
36 } 36 }
37 37
38 // Implementation of stubs defined in JniInterface_jni.h. These are the entry 38 // Implementation of stubs defined in JniInterface_jni.h. These are the entry
39 // points for JNI calls from Java into C++. 39 // points for JNI calls from Java into C++.
40 40
41 static void LoadNative(JNIEnv* env, jclass clazz, jobject context) { 41 static void LoadNative(JNIEnv* env, jclass clazz, jobject context) {
42 base::android::ScopedJavaLocalRef<jobject> context_activity(env, context); 42 base::android::ScopedJavaLocalRef<jobject> context_activity(env, context);
43 base::android::InitApplicationContext(context_activity); 43 base::android::InitApplicationContext(env, context_activity);
44 44
45 // The google_apis functions check the command-line arguments to make sure no 45 // The google_apis functions check the command-line arguments to make sure no
46 // runtime API keys have been specified by the environment. Unfortunately, we 46 // runtime API keys have been specified by the environment. Unfortunately, we
47 // neither launch Chromium nor have a command line, so we need to prevent 47 // neither launch Chromium nor have a command line, so we need to prevent
48 // them from DCHECKing out when they go looking. 48 // them from DCHECKing out when they go looking.
49 CommandLine::Init(0, NULL); 49 CommandLine::Init(0, NULL);
50 50
51 // Create the singleton now so that the Chromoting threads will be set up. 51 // Create the singleton now so that the Chromoting threads will be set up.
52 remoting::ChromotingJniRuntime::GetInstance(); 52 remoting::ChromotingJniRuntime::GetInstance();
53 } 53 }
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 JNIEnv* env = base::android::AttachCurrentThread(); 281 JNIEnv* env = base::android::AttachCurrentThread();
282 Java_JniInterface_redrawGraphicsInternal(env); 282 Java_JniInterface_redrawGraphicsInternal(env);
283 } 283 }
284 284
285 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) { 285 void ChromotingJniRuntime::DetachFromVmAndSignal(base::WaitableEvent* waiter) {
286 base::android::DetachFromVM(); 286 base::android::DetachFromVM();
287 waiter->Signal(); 287 waiter->Signal();
288 } 288 }
289 289
290 } // namespace remoting 290 } // namespace remoting
OLDNEW
« no previous file with comments | « mojo/shell/android/mojo_main.cc ('k') | testing/android/native_test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698