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

Unified Diff: content/browser/browser_main_runner.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, 10 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/browser/browser_main_runner.cc
diff --git a/content/browser/browser_main_runner.cc b/content/browser/browser_main_runner.cc
index b12ccd6da25c855ea0f831d2373e63d9ff04261f..38c235521828c49a1730ae81f1b170967cafed1e 100644
--- a/content/browser/browser_main_runner.cc
+++ b/content/browser/browser_main_runner.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/metrics/statistics_recorder.h"
+#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "content/browser/browser_main_loop.h"
#include "content/browser/browser_shutdown_profile_dumper.h"
@@ -111,6 +112,8 @@ void InstallSha256LegacyHooks() {
#endif // _WIN64
}
+base::TimeTicks g_process_startup_ticks;
+
} // namespace
#endif // OS_WIN
@@ -134,6 +137,8 @@ class BrowserMainRunnerImpl : public BrowserMainRunner {
if (!initialization_started_) {
initialization_started_ = true;
+ g_process_startup_ticks = base::TimeTicks::Now();
+
#if !defined(OS_IOS)
if (parameters.command_line.HasSwitch(switches::kWaitForDebugger))
base::debug::WaitForDebugger(60, true);
@@ -283,4 +288,10 @@ BrowserMainRunner* BrowserMainRunner::Create() {
return new BrowserMainRunnerImpl();
}
+// TODO(michaeln): Where should this go and what signal should be used?
+bool IsBrowserStartingUp() {
michaeln 2015/02/24 23:07:11 The startup metrics component tracks some stats li
+ return base::TimeTicks::Now() - g_process_startup_ticks <
+ base::TimeDelta::FromSeconds(15);
+}
+
} // namespace content
« no previous file with comments | « content/browser/appcache/appcache_update_job.cc ('k') | content/browser/service_worker/service_worker_register_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698