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

Side by Side Diff: chrome/browser/performance_monitor/performance_monitor.cc

Issue 10702117: Chrome Performance Monitor: Metric API Functions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Missed a rename. Created 8 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/performance_monitor/performance_monitor.h" 5 #include "chrome/browser/performance_monitor/performance_monitor.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/threading/worker_pool.h" 9 #include "base/threading/worker_pool.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 base::Bind(&PerformanceMonitor::CheckForVersionUpdateOnBackgroundThread, 69 base::Bind(&PerformanceMonitor::CheckForVersionUpdateOnBackgroundThread,
70 base::Unretained(this))); 70 base::Unretained(this)));
71 71
72 // Post a task to the background thread to a function which does nothing. 72 // Post a task to the background thread to a function which does nothing.
73 // This will force any tasks the database is performing to finish prior to 73 // This will force any tasks the database is performing to finish prior to
74 // the reply being sent, since they use the same thread. 74 // the reply being sent, since they use the same thread.
75 // 75 //
76 // Important! Make sure that methods in FinishInit() only rely on posting 76 // Important! Make sure that methods in FinishInit() only rely on posting
77 // to the background thread, and do not rely upon a reply from the background 77 // to the background thread, and do not rely upon a reply from the background
78 // thread; this is necessary for this notification to be valid. 78 // thread; this is necessary for this notification to be valid.
79 util::PostTaskToDatabaseAndReply( 79 util::PostTaskToDatabaseThreadAndReply(
80 base::Bind(&base::DoNothing), 80 base::Bind(&base::DoNothing),
81 base::Bind(&PerformanceMonitor::NotifyInitialized, 81 base::Bind(&PerformanceMonitor::NotifyInitialized,
82 base::Unretained(this))); 82 base::Unretained(this)));
83 } 83 }
84 84
85 void PerformanceMonitor::RegisterForNotifications() { 85 void PerformanceMonitor::RegisterForNotifications() {
86 // Extensions 86 // Extensions
87 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED, 87 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_INSTALLED,
88 content::NotificationService::AllSources()); 88 content::NotificationService::AllSources());
89 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED, 89 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_ENABLED,
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 extension->description())); 210 extension->description()));
211 break; 211 break;
212 } 212 }
213 default: { 213 default: {
214 NOTREACHED(); 214 NOTREACHED();
215 } 215 }
216 } 216 }
217 } 217 }
218 218
219 } // namespace performance_monitor 219 } // namespace performance_monitor
OLDNEW
« no previous file with comments | « chrome/browser/performance_monitor/metric_details.cc ('k') | chrome/browser/performance_monitor/performance_monitor_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698