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

Side by Side Diff: sync/sessions/session_state.cc

Issue 9590002: JSONWriter cleanup: integrate pretty print into write options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict 7. Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « sync/js/js_event_details.cc ('k') | sync/syncable/model_type_payload_map.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 (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 "sync/sessions/session_state.h" 5 #include "sync/sessions/session_state.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 num_server_conflicts); 169 num_server_conflicts);
170 value->SetBoolean("didCommitItems", did_commit_items); 170 value->SetBoolean("didCommitItems", did_commit_items);
171 value->SetInteger("numEntries", num_entries); 171 value->SetInteger("numEntries", num_entries);
172 value->Set("source", source.ToValue()); 172 value->Set("source", source.ToValue());
173 return value; 173 return value;
174 } 174 }
175 175
176 std::string SyncSessionSnapshot::ToString() const { 176 std::string SyncSessionSnapshot::ToString() const {
177 scoped_ptr<DictionaryValue> value(ToValue()); 177 scoped_ptr<DictionaryValue> value(ToValue());
178 std::string json; 178 std::string json;
179 base::JSONWriter::Write(value.get(), true, &json); 179 base::JSONWriter::WriteWithOptions(value.get(),
180 base::JSONWriter::OPTIONS_PRETTY_PRINT,
181 &json);
180 return json; 182 return json;
181 } 183 }
182 184
183 ConflictProgress::ConflictProgress(bool* dirty_flag) 185 ConflictProgress::ConflictProgress(bool* dirty_flag)
184 : num_server_conflicting_items(0), num_hierarchy_conflicting_items(0), 186 : num_server_conflicting_items(0), num_hierarchy_conflicting_items(0),
185 num_encryption_conflicting_items(0), dirty_(dirty_flag) { 187 num_encryption_conflicting_items(0), dirty_(dirty_flag) {
186 } 188 }
187 189
188 ConflictProgress::~ConflictProgress() { 190 ConflictProgress::~ConflictProgress() {
189 } 191 }
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 317
316 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag) 318 PerModelSafeGroupState::PerModelSafeGroupState(bool* dirty_flag)
317 : conflict_progress(dirty_flag) { 319 : conflict_progress(dirty_flag) {
318 } 320 }
319 321
320 PerModelSafeGroupState::~PerModelSafeGroupState() { 322 PerModelSafeGroupState::~PerModelSafeGroupState() {
321 } 323 }
322 324
323 } // namespace sessions 325 } // namespace sessions
324 } // namespace browser_sync 326 } // namespace browser_sync
OLDNEW
« no previous file with comments | « sync/js/js_event_details.cc ('k') | sync/syncable/model_type_payload_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698