Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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, | |
|
Evan Stade
2012/07/23 23:09:50
the FROM_HERE part should remain here or it loses
Matt Tytel
2012/07/24 20:44:16
Done.
| |
| 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 Loading... | |
| 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 |
| OLD | NEW |