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

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

Issue 10797056: CPM: API changes for API/UI integration. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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/process_util.h" 9 #include "base/process_util.h"
10 #include "base/threading/worker_pool.h" 10 #include "base/threading/worker_pool.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 // PerformanceMonitor already initialized with another path. 44 // PerformanceMonitor already initialized with another path.
45 return false; 45 return false;
46 } 46 }
47 47
48 // static 48 // static
49 PerformanceMonitor* PerformanceMonitor::GetInstance() { 49 PerformanceMonitor* PerformanceMonitor::GetInstance() {
50 return Singleton<PerformanceMonitor>::get(); 50 return Singleton<PerformanceMonitor>::get();
51 } 51 }
52 52
53 void PerformanceMonitor::Start() { 53 void PerformanceMonitor::Start() {
54 BrowserThread::PostBlockingPoolTaskAndReply( 54 util::PostTaskToDatabaseThreadAndReply(
55 FROM_HERE,
56 base::Bind(&PerformanceMonitor::InitOnBackgroundThread, 55 base::Bind(&PerformanceMonitor::InitOnBackgroundThread,
57 base::Unretained(this)), 56 base::Unretained(this)),
58 base::Bind(&PerformanceMonitor::FinishInit, 57 base::Bind(&PerformanceMonitor::FinishInit,
59 base::Unretained(this))); 58 base::Unretained(this)));
60 } 59 }
61 60
62 void PerformanceMonitor::InitOnBackgroundThread() { 61 void PerformanceMonitor::InitOnBackgroundThread() {
63 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI)); 62 DCHECK(!BrowserThread::CurrentlyOn(BrowserThread::UI));
64 database_ = Database::Create(database_path_); 63 database_ = Database::Create(database_path_);
65 } 64 }
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 break; 259 break;
261 } 260 }
262 default: { 261 default: {
263 NOTREACHED(); 262 NOTREACHED();
264 break; 263 break;
265 } 264 }
266 } 265 }
267 } 266 }
268 267
269 } // namespace performance_monitor 268 } // namespace performance_monitor
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698