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

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
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index dc203f9f5a3b19882d8bc06da28263a5d32704f1..c041720ec2ee29b71f4c902e7562a3d42302f635 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"
@@ -1111,6 +1112,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() {

Powered by Google App Engine
This is Rietveld 408576698