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

Unified Diff: chrome/browser/performance_monitor/startup_timer.cc

Issue 23812010: Implement first part of supporting global extension commands. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: No change, just reuploading (last attempt was incomplete) Created 7 years, 2 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/performance_monitor/startup_timer.cc
diff --git a/chrome/browser/performance_monitor/startup_timer.cc b/chrome/browser/performance_monitor/startup_timer.cc
index 175ab6d49c922d7c67d95287bfe03161a1354c6b..226ea78ca9e35683da140d041e34db296fa0e2f1 100644
--- a/chrome/browser/performance_monitor/startup_timer.cc
+++ b/chrome/browser/performance_monitor/startup_timer.cc
@@ -110,12 +110,19 @@ void StartupTimer::SetElapsedSessionRestoreTime(
}
void StartupTimer::InsertElapsedStartupTime() {
+ performance_monitor::Database* database =
Yoyo Zhou 2013/10/03 22:08:50 You should be able to remove this now.
Finnur 2013/10/04 17:57:02 Indeed.
+ PerformanceMonitor::GetInstance()->database();
+ // TODO(finnur): This is temporary to work around bug 303719 where the
+ // startup timer is taking requests to log without the performance monitor
+ // having created a database to store it.
+ if (!database)
+ return;
content::BrowserThread::PostBlockingPoolSequencedTask(
Database::kDatabaseSequenceToken,
FROM_HERE,
base::Bind(
&AddMetricToDatabaseOnBackgroundThread,
- base::Unretained(PerformanceMonitor::GetInstance()->database()),
+ base::Unretained(database),
Metric(startup_type_ == STARTUP_NORMAL ? METRIC_STARTUP_TIME
: METRIC_TEST_STARTUP_TIME,
base::Time::Now(),
@@ -127,12 +134,19 @@ void StartupTimer::InsertElapsedSessionRestoreTime() {
for (std::vector<base::TimeDelta>::const_iterator iter =
elapsed_session_restore_times_.begin();
iter != elapsed_session_restore_times_.end(); ++iter) {
+ performance_monitor::Database* database =
+ PerformanceMonitor::GetInstance()->database();
+ // TODO(finnur): This is temporary to work around bug 303719 where the
+ // startup timer is taking requests to log without the performance monitor
+ // having created a database to store it.
+ if (!database)
+ return;
content::BrowserThread::PostBlockingPoolSequencedTask(
Database::kDatabaseSequenceToken,
FROM_HERE,
base::Bind(
&AddMetricToDatabaseOnBackgroundThread,
- base::Unretained(PerformanceMonitor::GetInstance()->database()),
+ base::Unretained(database),
Metric(METRIC_SESSION_RESTORE_TIME,
base::Time::Now(),
static_cast<double>(iter->ToInternalValue()))));

Powered by Google App Engine
This is Rietveld 408576698