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

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

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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/memory/singleton.h" 7 #include "base/memory/singleton.h"
8 #include "base/process/process_iterator.h" 8 #include "base/process/process_iterator.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 23 matching lines...) Expand all
34 namespace performance_monitor { 34 namespace performance_monitor {
35 35
36 PerformanceMonitor::PerformanceMonitor() { 36 PerformanceMonitor::PerformanceMonitor() {
37 } 37 }
38 38
39 PerformanceMonitor::~PerformanceMonitor() { 39 PerformanceMonitor::~PerformanceMonitor() {
40 } 40 }
41 41
42 // static 42 // static
43 PerformanceMonitor* PerformanceMonitor::GetInstance() { 43 PerformanceMonitor* PerformanceMonitor::GetInstance() {
44 return Singleton<PerformanceMonitor>::get(); 44 return base::Singleton<PerformanceMonitor>::get();
45 } 45 }
46 46
47 void PerformanceMonitor::StartGatherCycle() { 47 void PerformanceMonitor::StartGatherCycle() {
48 DCHECK_CURRENTLY_ON(BrowserThread::UI); 48 DCHECK_CURRENTLY_ON(BrowserThread::UI);
49 repeating_timer_.Start(FROM_HERE, 49 repeating_timer_.Start(FROM_HERE,
50 base::TimeDelta::FromSeconds(kGatherIntervalInSeconds), 50 base::TimeDelta::FromSeconds(kGatherIntervalInSeconds),
51 this, &PerformanceMonitor::GatherMetricsMapOnUIThread); 51 this, &PerformanceMonitor::GatherMetricsMapOnUIThread);
52 } 52 }
53 53
54 namespace { 54 namespace {
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 void PerformanceMonitor::RunTriggersUIThread() { 208 void PerformanceMonitor::RunTriggersUIThread() {
209 DCHECK_CURRENTLY_ON(BrowserThread::UI); 209 DCHECK_CURRENTLY_ON(BrowserThread::UI);
210 for (auto it = metrics_map_.begin(); it != metrics_map_.end(); ++it) { 210 for (auto it = metrics_map_.begin(); it != metrics_map_.end(); ++it) {
211 it->second.RunPerformanceTriggers(); 211 it->second.RunPerformanceTriggers();
212 } 212 }
213 213
214 StartGatherCycle(); 214 StartGatherCycle();
215 } 215 }
216 216
217 } // namespace performance_monitor 217 } // namespace performance_monitor
OLDNEW
« no previous file with comments | « chrome/browser/performance_monitor/performance_monitor.h ('k') | chrome/browser/permissions/permission_manager_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698