Index: content/app/android/content_main.cc |
diff --git a/content/app/android/content_main.cc b/content/app/android/content_main.cc |
index d89d4f21c6959e6ea172d98fe0d488b2b5a112d8..08a21bfa562cb0a969e74fed0c082d7422a7c9e6 100644 |
--- a/content/app/android/content_main.cc |
+++ b/content/app/android/content_main.cc |
@@ -35,14 +35,19 @@ static void InitApplicationContext(JNIEnv* env, jclass clazz, jobject context) { |
base::android::InitApplicationContext(scoped_context); |
} |
-static jint Start(JNIEnv* env, jclass clazz) { |
+static void Start(JNIEnv* env, jclass clazz) { |
Yaron
2013/08/22 06:00:26
Doesn't this hide potential errors? I thought we h
aberent
2013/08/23 11:40:21
Not any more. The only places such errors can come
|
TRACE_EVENT0("startup", "content::Start"); |
- DCHECK(!g_content_runner.Get().get()); |
- g_content_runner.Get().reset(ContentMainRunner::Create()); |
- g_content_runner.Get()->Initialize(0, NULL, |
- g_content_main_delegate.Get().get()); |
- return g_content_runner.Get()->Run(); |
+ // On Android we can have multiple requests to start the browser in process |
+ // simultaneously. If we get an asynchonous request followed by a synchronous |
+ // request then we have to call this a second time to finish starting the |
+ // browser synchronously. |
+ if (!g_content_runner.Get().get()) { |
+ g_content_runner.Get().reset(ContentMainRunner::Create()); |
+ g_content_runner.Get()->Initialize( |
+ 0, NULL, g_content_main_delegate.Get().get()); |
+ } |
+ g_content_runner.Get()->Run(); |
} |
void SetContentMainDelegate(ContentMainDelegate* delegate) { |