Chromium Code Reviews| Index: content/shell/android/shell_library_loader.cc |
| diff --git a/content/shell/android/shell_library_loader.cc b/content/shell/android/shell_library_loader.cc |
| index 39a84ceb434891e84fba90dfe1038212f8e1bc92..933931d6fae6824aaccbb375704b12b309869d43 100644 |
| --- a/content/shell/android/shell_library_loader.cc |
| +++ b/content/shell/android/shell_library_loader.cc |
| @@ -7,35 +7,19 @@ |
| #include "base/logging.h" |
| #include "base/android/jni_android.h" |
| #include "base/android/jni_registrar.h" |
| +#include "content/common/android/process_main.h" |
|
Yaron
2012/06/01 20:20:37
Does this have to in public because you're referen
jam
2012/06/01 22:04:55
exactly, you'll get a checkdeps failure in the try
michaelbai
2012/06/01 23:27:20
Done.
|
| #include "content/public/app/android_library_loader_hooks.h" |
| -#include "content/public/app/content_main_runner.h" |
| -#include "content/shell/shell_main_delegate.h" |
| #include "content/shell/android/shell_manager.h" |
| #include "content/shell/android/shell_view.h" |
| +#include "content/shell/shell_main_delegate.h" |
| static base::android::RegistrationMethod kRegistrationMethods[] = { |
| { "ShellManager", content::RegisterShellManager }, |
| { "ShellView", content::ShellView::Register }, |
| }; |
| -namespace { |
| - content::ContentMainRunner* g_content_main_runner = NULL; |
| -} |
| - |
| // This is called by the VM when the shared library is first loaded. |
| JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
| - |
| - // Don't call anything in base without initializing it. |
| - // ContentMainRunner will do what we need. |
| - g_content_main_runner = content::ContentMainRunner::Create(); |
| - |
| - // TODO(tedchoc): Set this to the main delegate once the Android specific |
| - // browser process initialization gets checked in. |
| - ShellMainDelegate* delegate = new ShellMainDelegate(); |
| - |
| - // TODO(jrg): find command line info from java; pass down in here. |
| - g_content_main_runner->Initialize(0, NULL, delegate); |
| - |
| base::android::InitVM(vm); |
| JNIEnv* env = base::android::AttachCurrentThread(); |
| if (!content::RegisterLibraryLoaderEntryHook(env)) { |
| @@ -48,12 +32,14 @@ JNI_EXPORT jint JNI_OnLoad(JavaVM* vm, void* reserved) { |
| arraysize(kRegistrationMethods))) |
| return -1; |
| + content::g_content_main_delegate = new ShellMainDelegate(); |
| + |
| return JNI_VERSION_1_4; |
| } |
| JNI_EXPORT void JNI_OnUnload(JavaVM* vm, void* reserved) { |
| - delete g_content_main_runner; |
| - g_content_main_runner = NULL; |
| + if (content::g_content_main_delegate) |
| + delete content::g_content_main_delegate; |
| + content::g_content_main_delegate = NULL; |
| } |
| - |