Index: content/app/android/browser_process_main.cc |
diff --git a/content/app/android/browser_process_main.cc b/content/app/android/browser_process_main.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..de411478c6ed0c9180d34f2df897a4379a0aa92b |
--- /dev/null |
+++ b/content/app/android/browser_process_main.cc |
@@ -0,0 +1,54 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/app/android/browser_process_main.h" |
+ |
+#include "base/android/jni_string.h" |
+#include "base/debug/debugger.h" |
+#include "base/logging.h" |
+#if !defined(ANDROID_UPSTREAM_BRINGUP) |
+#include "content/browser/android/content_startup_flags.h" |
+#include "content/common/android/command_line.h" |
+#endif |
+#include "content/common/android/process_main.h" |
+#include "content/public/common/content_constants.h" |
+#include "jni/browser_process_main_jni.h" |
+ |
+using base::android::ConvertJavaStringToUTF8; |
+ |
+static void InitBrowserProcess(JNIEnv* env, |
+ jclass clazz, |
+ jobject context) { |
+ // TODO(michaelbai): This is the common code for all processes, and it |
+ // should be moved to content/app/android/content_main.cc once we split |
+ // the process specific initialization code out of the |
+ // sandboxed_process_service.cc. |
+ content::InitProcess(env, context); |
+} |
+ |
+static void SetCommandLineFlags(JNIEnv*env, |
+ jclass clazz, |
+ jint max_render_process_count, |
+ jstring plugin_descriptor) { |
+ std::string plugin_str = ConvertJavaStringToUTF8(env, plugin_descriptor); |
+#if !defined(ANDROID_UPSTREAM_BRINGUP) |
+ SetContentCommandLineFlags(max_render_process_count, plugin_str); |
+#endif |
+} |
+ |
+static jboolean IsOfficialBuild(JNIEnv* env, jclass clazz) { |
+#if defined(OFFICIAL_BUILD) |
+ return true; |
+#else |
+ return false; |
+#endif |
+} |
+ |
+namespace content { |
+ |
+bool RegisterBrowserProcessMain(JNIEnv* env) { |
+ return RegisterNativesImpl(env); |
+} |
+ |
+} // namespace |