| 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/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 Loading... |
| 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? |
| 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 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 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 } |
| OLD | NEW |