| OLD | NEW |
| 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_jni_registrar.h" |
| 16 #include "blimp/client/app/blimp_startup.h" | 16 #include "blimp/client/app/blimp_startup.h" |
| 17 #include "jni/BlimpLibraryLoader_jni.h" | 17 #include "jni/BlimpLibraryLoader_jni.h" |
| 18 #include "net/android/net_jni_registrar.h" |
| 18 #include "ui/gl/gl_surface.h" | 19 #include "ui/gl/gl_surface.h" |
| 19 | 20 |
| 20 namespace { | 21 namespace { |
| 21 | 22 |
| 22 bool OnLibrariesLoaded(JNIEnv* env, jclass clazz) { | 23 bool OnLibrariesLoaded(JNIEnv* env, jclass clazz) { |
| 23 blimp::client::InitializeLogging(); | 24 blimp::client::InitializeLogging(); |
| 24 return true; | 25 return true; |
| 25 } | 26 } |
| 26 | 27 |
| 27 bool OnJniInitializationComplete() { | 28 bool OnJniInitializationComplete() { |
| 28 base::android::SetLibraryLoadedHook(&OnLibrariesLoaded); | 29 base::android::SetLibraryLoadedHook(&OnLibrariesLoaded); |
| 29 return true; | 30 return true; |
| 30 } | 31 } |
| 31 | 32 |
| 32 bool RegisterJni(JNIEnv* env) { | 33 bool RegisterJni(JNIEnv* env) { |
| 33 if (!base::android::RegisterJni(env)) | 34 if (!base::android::RegisterJni(env)) |
| 34 return false; | 35 return false; |
| 35 | 36 |
| 37 if (!net::android::RegisterJni(env)) |
| 38 return false; |
| 39 |
| 36 if (!blimp::client::RegisterBlimpJni(env)) | 40 if (!blimp::client::RegisterBlimpJni(env)) |
| 37 return false; | 41 return false; |
| 38 | 42 |
| 39 return true; | 43 return true; |
| 40 } | 44 } |
| 41 | 45 |
| 42 } // namespace | 46 } // namespace |
| 43 | 47 |
| 44 namespace blimp { | 48 namespace blimp { |
| 45 namespace client { | 49 namespace client { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 70 // Although we only need to register JNI for base/ and blimp/, this follows | 74 // Although we only need to register JNI for base/ and blimp/, this follows |
| 71 // the general Chrome for Android pattern, to be future-proof against future | 75 // the general Chrome for Android pattern, to be future-proof against future |
| 72 // changes to JNI. | 76 // changes to JNI. |
| 73 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) || | 77 if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) || |
| 74 !base::android::OnJNIOnLoadInit(init_callbacks)) { | 78 !base::android::OnJNIOnLoadInit(init_callbacks)) { |
| 75 return -1; | 79 return -1; |
| 76 } | 80 } |
| 77 | 81 |
| 78 return JNI_VERSION_1_4; | 82 return JNI_VERSION_1_4; |
| 79 } | 83 } |
| OLD | NEW |