| 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/chromeos/boot_times_loader.h" | 5 #include "chrome/browser/chromeos/boot_times_loader.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 BrowserThread::PostTask( | 254 BrowserThread::PostTask( |
| 255 BrowserThread::FILE, FROM_HERE, | 255 BrowserThread::FILE, FROM_HERE, |
| 256 base::Bind(&RecordStatsDelayed, name, stats.uptime, stats.disk)); | 256 base::Bind(&RecordStatsDelayed, name, stats.uptime, stats.disk)); |
| 257 } | 257 } |
| 258 | 258 |
| 259 BootTimesLoader::Stats BootTimesLoader::GetCurrentStats() { | 259 BootTimesLoader::Stats BootTimesLoader::GetCurrentStats() { |
| 260 const base::FilePath kProcUptime(FPL("/proc/uptime")); | 260 const base::FilePath kProcUptime(FPL("/proc/uptime")); |
| 261 const base::FilePath kDiskStat(FPL("/sys/block/sda/stat")); | 261 const base::FilePath kDiskStat(FPL("/sys/block/sda/stat")); |
| 262 Stats stats; | 262 Stats stats; |
| 263 base::ThreadRestrictions::ScopedAllowIO allow_io; | 263 base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 264 file_util::ReadFileToString(kProcUptime, &stats.uptime); | 264 base::ReadFileToString(kProcUptime, &stats.uptime); |
| 265 file_util::ReadFileToString(kDiskStat, &stats.disk); | 265 base::ReadFileToString(kDiskStat, &stats.disk); |
| 266 return stats; | 266 return stats; |
| 267 } | 267 } |
| 268 | 268 |
| 269 void BootTimesLoader::RecordCurrentStats(const std::string& name) { | 269 void BootTimesLoader::RecordCurrentStats(const std::string& name) { |
| 270 RecordStats(name, GetCurrentStats()); | 270 RecordStats(name, GetCurrentStats()); |
| 271 } | 271 } |
| 272 | 272 |
| 273 void BootTimesLoader::SaveChromeMainStats() { | 273 void BootTimesLoader::SaveChromeMainStats() { |
| 274 chrome_main_stats_ = GetCurrentStats(); | 274 chrome_main_stats_ = GetCurrentStats(); |
| 275 } | 275 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 GetRenderWidgetHost(&web_contents->GetController()); | 380 GetRenderWidgetHost(&web_contents->GetController()); |
| 381 render_widget_hosts_loading_.erase(render_widget_host); | 381 render_widget_hosts_loading_.erase(render_widget_host); |
| 382 break; | 382 break; |
| 383 } | 383 } |
| 384 default: | 384 default: |
| 385 break; | 385 break; |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 | 388 |
| 389 } // namespace chromeos | 389 } // namespace chromeos |
| OLD | NEW |