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

Side by Side Diff: content/browser/android/browser_startup_controller.cc

Issue 22691002: Allow overlapping sync and async startup requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow multiple overlapping startup requests - update to merge with nyquist@'s patch Created 7 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/android/browser_startup_controller.h" 5 #include "content/browser/android/browser_startup_controller.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h"
9 #include "base/debug/debugger.h"
nyquist 2013/08/23 06:28:32 unused import?
aberent 2013/08/23 11:40:21 Done. Sorry, copied from old android_browser_proc
10 #include "base/logging.h"
nyquist 2013/08/23 06:28:32 unused import?
aberent 2013/08/23 11:40:21 Done.
11 #include "content/browser/android/content_startup_flags.h"
12 #include "content/public/common/content_constants.h"
nyquist 2013/08/23 06:28:32 unused import?
aberent 2013/08/23 11:40:21 Done.
13
8 #include "jni/BrowserStartupController_jni.h" 14 #include "jni/BrowserStartupController_jni.h"
9 15
10 namespace content { 16 namespace content {
11 17
12 bool BrowserMayStartAsynchronously() { 18 bool BrowserMayStartAsynchronously() {
13 JNIEnv* env = base::android::AttachCurrentThread(); 19 JNIEnv* env = base::android::AttachCurrentThread();
14 return Java_BrowserStartupController_browserMayStartAsynchonously(env); 20 return Java_BrowserStartupController_browserMayStartAsynchonously(env);
15 } 21 }
16 22
17 void BrowserStartupComplete(int result) { 23 void BrowserStartupComplete(int result) {
18 JNIEnv* env = base::android::AttachCurrentThread(); 24 JNIEnv* env = base::android::AttachCurrentThread();
19 Java_BrowserStartupController_browserStartupComplete(env, result); 25 Java_BrowserStartupController_browserStartupComplete(env, result);
20 } 26 }
21 27
22 bool RegisterBrowserStartupController(JNIEnv* env) { 28 bool RegisterBrowserStartupController(JNIEnv* env) {
23 return RegisterNativesImpl(env); 29 return RegisterNativesImpl(env);
24 } 30 }
31
32 static void SetCommandLineFlags(JNIEnv* env,
33 jclass clazz,
34 jint max_render_process_count,
35 jstring plugin_descriptor) {
36 std::string plugin_str =
37 (plugin_descriptor == NULL
38 ? std::string()
39 : base::android::ConvertJavaStringToUTF8(env, plugin_descriptor));
40 SetContentCommandLineFlags(max_render_process_count, plugin_str);
41 }
42
43 static jboolean IsOfficialBuild(JNIEnv* env, jclass clazz) {
44 #if defined(OFFICIAL_BUILD)
45 return true;
46 #else
47 return false;
48 #endif
49 }
50
51 static jboolean IsPluginEnabled(JNIEnv* env, jclass clazz) {
52 #if defined(ENABLE_PLUGINS)
53 return true;
54 #else
55 return false;
56 #endif
57 }
58
25 } // namespace content 59 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698