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

Unified Diff: chrome/android/sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc

Issue 970243003: Refactoring chrome JNI registration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
Index: chrome/android/sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc
diff --git a/chrome/android/sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc b/chrome/android/sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc
index 5016dc886573885b9b3e71ed3558704ea7452800..bcf45e527ea546911adc6d5e0fc3025c8f8576b1 100644
--- a/chrome/android/sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc
+++ b/chrome/android/sync_shell/chrome_main_delegate_chrome_sync_shell_android.cc
@@ -20,15 +20,20 @@ ChromeMainDelegateChromeSyncShellAndroid::
~ChromeMainDelegateChromeSyncShellAndroid() {
}
-bool
-ChromeMainDelegateChromeSyncShellAndroid::RegisterApplicationNativeMethods(
- JNIEnv* env) {
- return ChromeMainDelegateAndroid::RegisterApplicationNativeMethods(env) &&
- FakeServerHelperAndroid::Register(env);
-}
-
bool ChromeMainDelegateChromeSyncShellAndroid::BasicStartupComplete(
int* exit_code) {
return ChromeMainDelegateAndroid::BasicStartupComplete(exit_code);
}
+int ChromeMainDelegateChromeSyncShellAndroid::RunProcess(
+ const std::string& process_type,
+ const content::MainFunctionParams& main_function_params) {
+ if (process_type.empty()) {
+ // This JNI registration can not be moved to JNI_OnLoad because
+ // FakeServerHelper seems not known by class loader when shared library
+ // is loaded.
+ FakeServerHelperAndroid::Register(base::android::AttachCurrentThread());
+ }
+ return ChromeMainDelegateAndroid::RunProcess(process_type,
+ main_function_params);
+}
« no previous file with comments | « chrome/android/sync_shell/chrome_main_delegate_chrome_sync_shell_android.h ('k') | chrome/app/android/chrome_jni_onload.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698