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

Side by Side Diff: chrome/browser/chromeos/boot_times_recorder.cc

Issue 1131113004: Convert JsonWriter::Write to taking a const ref for the in-param (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: another rebase Created 5 years, 7 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/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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698