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

Unified Diff: content/app/android/content_main.cc

Issue 22691002: Allow overlapping sync and async startup requests (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Allow overlapping sync and async startup requests - fix code review Nits 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 side-by-side diff with in-line comments
Download patch
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..bfc372f71f392468c5b0083de7dd6bdccf0f01cc 100644
--- a/content/app/android/content_main.cc
+++ b/content/app/android/content_main.cc
@@ -38,10 +38,15 @@ static void InitApplicationContext(JNIEnv* env, jclass clazz, jobject context) {
static jint Start(JNIEnv* env, jclass clazz) {
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());
+ // 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());
+ }
return g_content_runner.Get()->Run();
}
« no previous file with comments | « chrome/app/android/chrome_main_delegate_android.cc ('k') | content/browser/android/android_browser_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698