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

Side by Side Diff: components/invalidation/invalidation_util.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/invalidation/invalidation_util.h" 5 #include "components/invalidation/invalidation_util.h"
6 6
7 #include <ostream> 7 #include <ostream>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 std::string name; 54 std::string name;
55 int source = 0; 55 int source = 0;
56 if (!value.GetInteger("source", &source) || !value.GetString("name", &name)) { 56 if (!value.GetInteger("source", &source) || !value.GetString("name", &name)) {
57 return false; 57 return false;
58 } 58 }
59 *out = invalidation::ObjectId(source, name); 59 *out = invalidation::ObjectId(source, name);
60 return true; 60 return true;
61 } 61 }
62 62
63 std::string ObjectIdToString(const invalidation::ObjectId& object_id) { 63 std::string ObjectIdToString(const invalidation::ObjectId& object_id) {
64 scoped_ptr<base::DictionaryValue> value(ObjectIdToValue(object_id));
65 std::string str; 64 std::string str;
66 base::JSONWriter::Write(value.get(), &str); 65 base::JSONWriter::Write(*ObjectIdToValue(object_id), &str);
67 return str; 66 return str;
68 } 67 }
69 68
70 } // namespace syncer 69 } // namespace syncer
OLDNEW
« no previous file with comments | « components/invalidation/invalidation_test_util.cc ('k') | components/invalidation/p2p_invalidator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698