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

Side by Side Diff: chrome/browser/caps/generate_state_json.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
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | chrome/browser/chromeos/app_mode/kiosk_app_data.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/caps/generate_state_json.h" 5 #include "chrome/browser/caps/generate_state_json.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 void OnDataReadyDelayed() { 83 void OnDataReadyDelayed() {
84 model_->StopListening(); 84 model_->StopListening();
85 // Task manager finally computed (most) values. Lets generate the JSON 85 // Task manager finally computed (most) values. Lets generate the JSON
86 // data and send it over the pipe. 86 // data and send it over the pipe.
87 base::DictionaryValue dict; 87 base::DictionaryValue dict;
88 GatherComputerValues(&dict); 88 GatherComputerValues(&dict);
89 GatherChromeValues(&dict); 89 GatherChromeValues(&dict);
90 90
91 std::string json; 91 std::string json;
92 auto options = base::JSONWriter::OPTIONS_PRETTY_PRINT; 92 auto options = base::JSONWriter::OPTIONS_PRETTY_PRINT;
93 if (!base::JSONWriter::WriteWithOptions(&dict, options, &json)) 93 if (!base::JSONWriter::WriteWithOptions(dict, options, &json))
94 return; 94 return;
95 95
96 file_.WriteAtCurrentPos(json.c_str(), json.size()); 96 file_.WriteAtCurrentPos(json.c_str(), json.size());
97 file_.Close(); 97 file_.Close();
98 // this Release() causes our destruction. 98 // this Release() causes our destruction.
99 Release(); 99 Release();
100 } 100 }
101 101
102 private: 102 private:
103 // TODO(cpu): split the key names below into a separate header that both 103 // TODO(cpu): split the key names below into a separate header that both
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 } // namespace 195 } // namespace
196 196
197 namespace caps { 197 namespace caps {
198 198
199 void GenerateStateJSON( 199 void GenerateStateJSON(
200 scoped_refptr<TaskManagerModel> model, base::File file) { 200 scoped_refptr<TaskManagerModel> model, base::File file) {
201 new TaskManagerDataDumper(model, file.Pass()); 201 new TaskManagerDataDumper(model, file.Pass());
202 } 202 }
203 203
204 } 204 }
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | chrome/browser/chromeos/app_mode/kiosk_app_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698