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

Unified Diff: remoting/client/jni/remoting_jni_onload.cc

Issue 2620303004: Remove JNI onload callback vector construction in favour of direct calls. (Closed)
Patch Set: rebase compile errors Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/test/android/net_test_jni_onload.cc ('k') | testing/android/native_test/native_test_jni_onload.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/jni/remoting_jni_onload.cc
diff --git a/remoting/client/jni/remoting_jni_onload.cc b/remoting/client/jni/remoting_jni_onload.cc
index 2140e4a186da5bf012445f478349526612fef205..b4fa7c07707113e6baa8df60e9248edf76021c7e 100644
--- a/remoting/client/jni/remoting_jni_onload.cc
+++ b/remoting/client/jni/remoting_jni_onload.cc
@@ -23,18 +23,17 @@ base::android::RegistrationMethod kRemotingRegisteredMethods[] = {
};
bool RegisterJNI(JNIEnv* env) {
- return base::android::RegisterNativeMethods(env,
- kRemotingRegisteredMethods, arraysize(kRemotingRegisteredMethods));
+ return base::android::RegisterNativeMethods(
+ env, kRemotingRegisteredMethods, arraysize(kRemotingRegisteredMethods));
}
} // namespace
JNIEXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
- std::vector<base::android::RegisterCallback> register_callbacks;
- register_callbacks.push_back(base::Bind(&RegisterJNI));
- std::vector<base::android::InitCallback> init_callbacks;
- if (!base::android::OnJNIOnLoadRegisterJNI(vm, register_callbacks) ||
- !base::android::OnJNIOnLoadInit(init_callbacks)) {
+ base::android::InitVM(vm);
+ JNIEnv* env = base::android::AttachCurrentThread();
+ if (!base::android::OnJNIOnLoadRegisterJNI(env) || !RegisterJNI(env) ||
+ !base::android::OnJNIOnLoadInit()) {
return -1;
}
return JNI_VERSION_1_4;
« no previous file with comments | « net/test/android/net_test_jni_onload.cc ('k') | testing/android/native_test/native_test_jni_onload.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698