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

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

Issue 2132163002: Add BlimpClientContext and factory with real and dummy implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-blimp-client-core-public-to-blimp-client
Patch Set: git merge origin/master before CQ for good measure Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « blimp/client/app/android/blimp_jni_registrar.cc ('k') | blimp/client/core/BUILD.gn » ('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 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/app/android/blimp_library_loader.h" 5 #include "blimp/client/app/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"
11 #include "base/android/jni_android.h" 11 #include "base/android/jni_android.h"
12 #include "base/android/library_loader/library_loader_hooks.h" 12 #include "base/android/library_loader/library_loader_hooks.h"
13 #include "base/bind.h" 13 #include "base/bind.h"
14 #include "base/message_loop/message_loop.h" 14 #include "base/message_loop/message_loop.h"
15 #include "blimp/client/app/android/blimp_jni_registrar.h" 15 #include "blimp/client/app/android/blimp_app_jni_registrar.h"
16 #include "blimp/client/app/blimp_startup.h" 16 #include "blimp/client/app/blimp_startup.h"
17 #include "blimp/client/public/android/blimp_jni_registrar.h"
17 #include "jni/BlimpLibraryLoader_jni.h" 18 #include "jni/BlimpLibraryLoader_jni.h"
18 #include "net/android/net_jni_registrar.h" 19 #include "net/android/net_jni_registrar.h"
19 #include "ui/gl/gl_surface.h" 20 #include "ui/gl/gl_surface.h"
20 21
21 namespace { 22 namespace {
22 23
23 bool OnLibrariesLoaded(JNIEnv* env, jclass clazz) { 24 bool OnLibrariesLoaded(JNIEnv* env, jclass clazz) {
24 blimp::client::InitializeLogging(); 25 blimp::client::InitializeLogging();
25 return true; 26 return true;
26 } 27 }
27 28
28 bool OnJniInitializationComplete() { 29 bool OnJniInitializationComplete() {
29 base::android::SetLibraryLoadedHook(&OnLibrariesLoaded); 30 base::android::SetLibraryLoadedHook(&OnLibrariesLoaded);
30 return true; 31 return true;
31 } 32 }
32 33
33 bool RegisterJni(JNIEnv* env) { 34 bool RegisterJni(JNIEnv* env) {
34 if (!base::android::RegisterJni(env)) 35 if (!base::android::RegisterJni(env))
35 return false; 36 return false;
36 37
37 if (!net::android::RegisterJni(env)) 38 if (!net::android::RegisterJni(env))
38 return false; 39 return false;
39 40
40 if (!blimp::client::RegisterBlimpJni(env)) 41 if (!blimp::client::RegisterBlimpJni(env))
41 return false; 42 return false;
42 43
44 if (!blimp::client::RegisterBlimpAppJni(env))
45 return false;
46
43 return true; 47 return true;
44 } 48 }
45 49
46 } // namespace 50 } // namespace
47 51
48 namespace blimp { 52 namespace blimp {
49 namespace client { 53 namespace client {
50 54
51 static jboolean StartBlimp(JNIEnv* env, const JavaParamRef<jclass>& clazz) { 55 static jboolean StartBlimp(JNIEnv* env, const JavaParamRef<jclass>& clazz) {
52 if (!InitializeMainMessageLoop()) 56 if (!InitializeMainMessageLoop())
(...skipping 21 matching lines...) Expand all
74 // Although we only need to register JNI for base/ and blimp/, this follows 78 // Although we only need to register JNI for base/ and blimp/, this follows
75 // the general Chrome for Android pattern, to be future-proof against future 79 // the general Chrome for Android pattern, to be future-proof against future
76 // changes to JNI. 80 // changes to JNI.
77 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) || 81 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) ||
78 !base::android::OnJNIOnLoadInit(init_callbacks)) { 82 !base::android::OnJNIOnLoadInit(init_callbacks)) {
79 return -1; 83 return -1;
80 } 84 }
81 85
82 return JNI_VERSION_1_4; 86 return JNI_VERSION_1_4;
83 } 87 }
OLDNEW
« no previous file with comments | « blimp/client/app/android/blimp_jni_registrar.cc ('k') | blimp/client/core/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698