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

Side by Side Diff: blimp/client/android/blimp_library_loader.cc

Issue 1407233017: Define a Java-side global application context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Undo changes to ApplicationStatus Created 5 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "blimp/client/android/blimp_library_loader.h" 5 #include "blimp/client/android/blimp_library_loader.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/android/base_jni_onload.h" 9 #include "base/android/base_jni_onload.h"
10 #include "base/android/base_jni_registrar.h" 10 #include "base/android/base_jni_registrar.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 return false; 53 return false;
54 54
55 return true; 55 return true;
56 } 56 }
57 57
58 } // namespace 58 } // namespace
59 59
60 namespace blimp { 60 namespace blimp {
61 61
62 static jboolean InitializeBlimp(JNIEnv* env, 62 static jboolean InitializeBlimp(JNIEnv* env,
63 const JavaParamRef<jclass>& clazz, 63 const JavaParamRef<jclass>& clazz) {
64 const JavaParamRef<jobject>& jcontext) {
65 base::android::InitApplicationContext(env, jcontext);
66
67 // TODO(dtrainor): Start the runner? 64 // TODO(dtrainor): Start the runner?
Yaron 2015/11/23 20:35:16 this is a pretty awesome function now :)
Torne 2015/11/24 10:22:34 Well if it's not needed dtrainor can remove it ;)
68 return true; 65 return true;
69 } 66 }
70 67
71 static jboolean StartBlimp(JNIEnv* env, const JavaParamRef<jclass>& clazz) { 68 static jboolean StartBlimp(JNIEnv* env, const JavaParamRef<jclass>& clazz) {
72 // TODO(dtrainor): Initialize ICU? 69 // TODO(dtrainor): Initialize ICU?
73 70
74 if (!gfx::GLSurface::InitializeOneOff()) 71 if (!gfx::GLSurface::InitializeOneOff())
75 return false; 72 return false;
76 73
77 g_main_message_loop.Get().reset(new base::MessageLoopForUI); 74 g_main_message_loop.Get().reset(new base::MessageLoopForUI);
(...skipping 18 matching lines...) Expand all
96 // Although we only need to register JNI for base/ and blimp/, this follows 93 // Although we only need to register JNI for base/ and blimp/, this follows
97 // the general Chrome for Android pattern, to be future-proof against future 94 // the general Chrome for Android pattern, to be future-proof against future
98 // changes to JNI. 95 // changes to JNI.
99 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) || 96 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) ||
100 !base::android::OnJNIOnLoadInit(init_callbacks)) { 97 !base::android::OnJNIOnLoadInit(init_callbacks)) {
101 return -1; 98 return -1;
102 } 99 }
103 100
104 return JNI_VERSION_1_4; 101 return JNI_VERSION_1_4;
105 } 102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698