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

Unified Diff: content/shell/android/shell_library_loader.cc

Issue 10444121: Added android_browser_process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Init Created 8 years, 7 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: 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;
}
-

Powered by Google App Engine
This is Rietveld 408576698