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

Side by Side Diff: android_webview/lib/main/webview_entry_point.cc

Issue 147533004: Remove unneeded JNI registrations. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Fix android webview build issues. Created 6 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "android_webview/lib/main/aw_main_delegate.h" 5 #include "android_webview/lib/main/aw_main_delegate.h"
6 #include "android_webview/native/android_webview_jni_registrar.h" 6 #include "android_webview/native/android_webview_jni_registrar.h"
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_registrar.h" 8 #include "base/android/jni_registrar.h"
9 #include "base/android/library_loader/library_loader_hooks.h" 9 #include "base/android/library_loader/library_loader_hooks.h"
10 #include "components/navigation_interception/component_jni_registrar.h" 10 #include "components/navigation_interception/component_jni_registrar.h"
(...skipping 11 matching lines...) Expand all
22 }; 22 };
23 23
24 // This is called by the VM when the shared library is first loaded. 24 // This is called by the VM when the shared library is first loaded.
25 // Most of the initialization is done in LibraryLoadedOnMainThread(), not here. 25 // Most of the initialization is done in LibraryLoadedOnMainThread(), not here.
26 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { 26 JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) {
27 27
28 base::android::SetLibraryLoadedHook(&content::LibraryLoaded); 28 base::android::SetLibraryLoadedHook(&content::LibraryLoaded);
29 29
30 base::android::InitVM(vm); 30 base::android::InitVM(vm);
31 JNIEnv* env = base::android::AttachCurrentThread(); 31 JNIEnv* env = base::android::AttachCurrentThread();
32 if (!base::android::RegisterLibraryLoaderEntryHook(env))
33 return -1;
34 32
35 // Register content JNI functions now, rather than waiting until 33 // Register content JNI functions now, rather than waiting until
36 // LibraryLoadedOnMainThread, so that we can call into native code early. 34 // LibraryLoadedOnMainThread, so that we can call into native code early.
37 if (!content::EnsureJniRegistered(env)) 35 if (!content::EnsureJniRegistered(env))
38 return -1; 36 return -1;
39 37
40 // Register JNI for components we depend on. 38 // Register JNI for components we depend on.
41 if (!RegisterNativeMethods( 39 if (!RegisterNativeMethods(
42 env, 40 env,
43 kWebViewDependencyRegisteredMethods, 41 kWebViewDependencyRegisteredMethods,
44 arraysize(kWebViewDependencyRegisteredMethods))) 42 arraysize(kWebViewDependencyRegisteredMethods)))
45 return -1; 43 return -1;
46 44
47 if (!android_webview::RegisterJni(env)) 45 if (!android_webview::RegisterJni(env))
48 return -1; 46 return -1;
49 47
50 content::SetContentMainDelegate(new android_webview::AwMainDelegate()); 48 content::SetContentMainDelegate(new android_webview::AwMainDelegate());
51 49
52 // Initialize url_util here while we are still single-threaded, in case we use 50 // Initialize url_util here while we are still single-threaded, in case we use
53 // CookieManager before initializing Chromium (which would normally have done 51 // CookieManager before initializing Chromium (which would normally have done
54 // this). It's safe to call this multiple times. 52 // this). It's safe to call this multiple times.
55 url_util::Initialize(); 53 url_util::Initialize();
56 54
57 return JNI_VERSION_1_4; 55 return JNI_VERSION_1_4;
58 } 56 }
OLDNEW
« no previous file with comments | « no previous file | android_webview/native/android_webview_jni_registrar.cc » ('j') | build/android/android_exports.lst » ('J')

Powered by Google App Engine
This is Rietveld 408576698