| 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_recorder.h" | 5 #include "chrome/browser/chromeos/boot_times_recorder.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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 std::string BootTimesRecorder::Stats::SerializeToString() const { | 147 std::string BootTimesRecorder::Stats::SerializeToString() const { |
| 148 if (uptime_.empty() && disk_.empty()) | 148 if (uptime_.empty() && disk_.empty()) |
| 149 return std::string(); | 149 return std::string(); |
| 150 base::DictionaryValue dictionary; | 150 base::DictionaryValue dictionary; |
| 151 dictionary.SetString(kUptime, uptime_); | 151 dictionary.SetString(kUptime, uptime_); |
| 152 dictionary.SetString(kDisk, disk_); | 152 dictionary.SetString(kDisk, disk_); |
| 153 | 153 |
| 154 std::string result; | 154 std::string result; |
| 155 if (!base::JSONWriter::Write(&dictionary, &result)) { | 155 if (!base::JSONWriter::Write(dictionary, &result)) { |
| 156 LOG(WARNING) << "BootTimesRecorder::Stats::SerializeToString(): failed."; | 156 LOG(WARNING) << "BootTimesRecorder::Stats::SerializeToString(): failed."; |
| 157 return std::string(); | 157 return std::string(); |
| 158 } | 158 } |
| 159 | 159 |
| 160 return result; | 160 return result; |
| 161 } | 161 } |
| 162 | 162 |
| 163 // static | 163 // static |
| 164 BootTimesRecorder::Stats BootTimesRecorder::Stats::DeserializeFromString( | 164 BootTimesRecorder::Stats BootTimesRecorder::Stats::DeserializeFromString( |
| 165 const std::string& source) { | 165 const std::string& source) { |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 GetRenderWidgetHost(&web_contents->GetController()); | 516 GetRenderWidgetHost(&web_contents->GetController()); |
| 517 render_widget_hosts_loading_.erase(render_widget_host); | 517 render_widget_hosts_loading_.erase(render_widget_host); |
| 518 break; | 518 break; |
| 519 } | 519 } |
| 520 default: | 520 default: |
| 521 break; | 521 break; |
| 522 } | 522 } |
| 523 } | 523 } |
| 524 | 524 |
| 525 } // namespace chromeos | 525 } // namespace chromeos |
| OLD | NEW |