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

Side by Side Diff: components/policy/core/common/policy_test_utils.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "components/policy/core/common/policy_test_utils.h" 5 #include "components/policy/core/common/policy_test_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 for (policy::PolicyMap::const_iterator iter = policies.begin(); 215 for (policy::PolicyMap::const_iterator iter = policies.begin();
216 iter != policies.end(); ++iter) { 216 iter != policies.end(); ++iter) {
217 os << " \"" << iter->first << "\": " << iter->second << "," << std::endl; 217 os << " \"" << iter->first << "\": " << iter->second << "," << std::endl;
218 } 218 }
219 os << "}"; 219 os << "}";
220 return os; 220 return os;
221 } 221 }
222 222
223 std::ostream& operator<<(std::ostream& os, const policy::PolicyMap::Entry& e) { 223 std::ostream& operator<<(std::ostream& os, const policy::PolicyMap::Entry& e) {
224 std::string value; 224 std::string value;
225 base::JSONWriter::WriteWithOptions(e.value, 225 base::JSONWriter::WriteWithOptions(
226 base::JSONWriter::OPTIONS_PRETTY_PRINT, 226 *e.value, base::JSONWriter::OPTIONS_PRETTY_PRINT, &value);
227 &value);
228 os << "{" << std::endl 227 os << "{" << std::endl
229 << " \"level\": " << e.level << "," << std::endl 228 << " \"level\": " << e.level << "," << std::endl
230 << " \"scope\": " << e.scope << "," << std::endl 229 << " \"scope\": " << e.scope << "," << std::endl
231 << " \"value\": " << value 230 << " \"value\": " << value
232 << "}"; 231 << "}";
233 return os; 232 return os;
234 } 233 }
235 234
236 std::ostream& operator<<(std::ostream& os, const policy::PolicyNamespace& ns) { 235 std::ostream& operator<<(std::ostream& os, const policy::PolicyNamespace& ns) {
237 os << ns.domain << "/" << ns.component_id; 236 os << ns.domain << "/" << ns.component_id;
238 return os; 237 return os;
239 } 238 }
OLDNEW
« no previous file with comments | « components/policy/core/common/policy_loader_win_unittest.cc ('k') | components/printing/renderer/print_web_view_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698