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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 return result; | 168 return result; |
169 } | 169 } |
170 | 170 |
171 // static | 171 // static |
172 BootTimesRecorder::Stats BootTimesRecorder::Stats::DeserializeFromString( | 172 BootTimesRecorder::Stats BootTimesRecorder::Stats::DeserializeFromString( |
173 const std::string& source) { | 173 const std::string& source) { |
174 if (source.empty()) | 174 if (source.empty()) |
175 return Stats(); | 175 return Stats(); |
176 | 176 |
177 scoped_ptr<base::Value> value = base::JSONReader::Read(source); | 177 std::unique_ptr<base::Value> value = base::JSONReader::Read(source); |
178 base::DictionaryValue* dictionary; | 178 base::DictionaryValue* dictionary; |
179 if (!value || !value->GetAsDictionary(&dictionary)) { | 179 if (!value || !value->GetAsDictionary(&dictionary)) { |
180 LOG(ERROR) << "BootTimesRecorder::Stats::DeserializeFromString(): not a " | 180 LOG(ERROR) << "BootTimesRecorder::Stats::DeserializeFromString(): not a " |
181 "dictionary: '" << source << "'"; | 181 "dictionary: '" << source << "'"; |
182 return Stats(); | 182 return Stats(); |
183 } | 183 } |
184 | 184 |
185 Stats result; | 185 Stats result; |
186 if (!dictionary->GetString(kUptime, &result.uptime_) || | 186 if (!dictionary->GetString(kUptime, &result.uptime_) || |
187 !dictionary->GetString(kDisk, &result.disk_)) { | 187 !dictionary->GetString(kDisk, &result.disk_)) { |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 GetRenderWidgetHost(&web_contents->GetController()); | 524 GetRenderWidgetHost(&web_contents->GetController()); |
525 render_widget_hosts_loading_.erase(render_widget_host); | 525 render_widget_hosts_loading_.erase(render_widget_host); |
526 break; | 526 break; |
527 } | 527 } |
528 default: | 528 default: |
529 break; | 529 break; |
530 } | 530 } |
531 } | 531 } |
532 | 532 |
533 } // namespace chromeos | 533 } // namespace chromeos |
OLD | NEW |