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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 949293002: Implement a poor man's PostAfterStartupTask() function. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/browser/after_startup_task_utils_unittest.cc ('k') | chrome/browser/chrome_content_browser_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 7d3a50ab0d12fa222c7320cf54230e8b9040b01a..f42f31f81775896ce7b7e1ae874bfdfdfc203334 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -39,6 +39,7 @@
#include "build/build_config.h"
#include "cc/base/switches.h"
#include "chrome/browser/about_flags.h"
+#include "chrome/browser/after_startup_task_utils.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_process_impl.h"
#include "chrome/browser/browser_process_platform_part.h"
@@ -1127,6 +1128,13 @@ void ChromeBrowserMainParts::PostBrowserStart() {
base::Bind(&WebRtcLogUtil::DeleteOldWebRtcLogFilesForAllProfiles),
base::TimeDelta::FromMinutes(1));
#endif // defined(ENABLE_WEBRTC)
+
+ // At this point, StartupBrowserCreator::Start has run creating initial
+ // browser windows and tabs, but no progress has been made in loading
+ // content as the main message loop hasn't started processing tasks yet.
+ // We setup to observe to the initial page load here to defer running
+ // task posted via PostAfterStartupTask until its complete.
+ AfterStartupTaskUtils::StartMonitoringStartup();
}
int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
« no previous file with comments | « chrome/browser/after_startup_task_utils_unittest.cc ('k') | chrome/browser/chrome_content_browser_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698