OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/app/android/browser_process_main.h" |
| 6 |
| 7 #include "base/android/jni_string.h" |
| 8 #include "base/debug/debugger.h" |
| 9 #include "base/logging.h" |
| 10 #if !defined(ANDROID_UPSTREAM_BRINGUP) |
| 11 #include "content/browser/android/content_startup_flags.h" |
| 12 #include "content/common/android/command_line.h" |
| 13 #endif |
| 14 #include "content/common/android/process_main.h" |
| 15 #include "content/public/common/content_constants.h" |
| 16 #include "jni/browser_process_main_jni.h" |
| 17 |
| 18 using base::android::ConvertJavaStringToUTF8; |
| 19 |
| 20 static void InitBrowserProcess(JNIEnv* env, |
| 21 jclass clazz, |
| 22 jobject context) { |
| 23 // TODO(michaelbai): This is the common code for all processes, and it |
| 24 // should be moved to content/app/android/content_main.cc once we split |
| 25 // the process specific initialization code out of the |
| 26 // sandboxed_process_service.cc. |
| 27 content::InitProcess(env, context); |
| 28 } |
| 29 |
| 30 static void SetCommandLineFlags(JNIEnv*env, |
| 31 jclass clazz, |
| 32 jint max_render_process_count, |
| 33 jstring plugin_descriptor) { |
| 34 std::string plugin_str = ConvertJavaStringToUTF8(env, plugin_descriptor); |
| 35 #if !defined(ANDROID_UPSTREAM_BRINGUP) |
| 36 SetContentCommandLineFlags(max_render_process_count, plugin_str); |
| 37 #endif |
| 38 } |
| 39 |
| 40 static jboolean IsOfficialBuild(JNIEnv* env, jclass clazz) { |
| 41 #if defined(OFFICIAL_BUILD) |
| 42 return true; |
| 43 #else |
| 44 return false; |
| 45 #endif |
| 46 } |
| 47 |
| 48 namespace content { |
| 49 |
| 50 bool RegisterBrowserProcessMain(JNIEnv* env) { |
| 51 return RegisterNativesImpl(env); |
| 52 } |
| 53 |
| 54 } // namespace |
OLD | NEW |