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

Unified Diff: chrome/app/android/chrome_main_delegate_android.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: chrome/app/android/chrome_main_delegate_android.cc
diff --git a/chrome/app/android/chrome_main_delegate_android.cc b/chrome/app/android/chrome_main_delegate_android.cc
index 81f402936423b81d476b4374b57b0c7181c80c94..6b726c6147f63599fa024b026a7a59b86540dd56 100644
--- a/chrome/app/android/chrome_main_delegate_android.cc
+++ b/chrome/app/android/chrome_main_delegate_android.cc
@@ -32,7 +32,13 @@ int ChromeMainDelegateAndroid::RunProcess(
JNIEnv* env = base::android::AttachCurrentThread();
RegisterApplicationNativeMethods(env);
- browser_runner_.reset(content::BrowserMainRunner::Create());
+ // Because the browser process can be started asynchronously as a series of
+ // of UI thread tasks a second request to start it can come in while the
+ // first request is still being processed. We must keep the same
+ // browser runner for the second request.
+ if (!browser_runner_.get()) {
+ browser_runner_.reset(content::BrowserMainRunner::Create());
+ }
return browser_runner_->Initialize(main_function_params);
}
« no previous file with comments | « android_webview/java/src/org/chromium/android_webview/AwBrowserProcess.java ('k') | content/app/android/content_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698