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

Side by Side Diff: remoting/host/json_host_config.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 | « remoting/client/plugin/chromoting_instance.cc ('k') | sync/engine/model_safe_worker.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "remoting/host/json_host_config.h" 5 #include "remoting/host/json_host_config.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 } 43 }
44 44
45 void JsonHostConfig::Save() { 45 void JsonHostConfig::Save() {
46 message_loop_proxy_->PostTask( 46 message_loop_proxy_->PostTask(
47 FROM_HERE, base::Bind(&JsonHostConfig::DoWrite, this)); 47 FROM_HERE, base::Bind(&JsonHostConfig::DoWrite, this));
48 } 48 }
49 49
50 void JsonHostConfig::DoWrite() { 50 void JsonHostConfig::DoWrite() {
51 std::string file_content; 51 std::string file_content;
52 base::AutoLock auto_lock(lock_); 52 base::AutoLock auto_lock(lock_);
53 base::JSONWriter::Write(values_.get(), true, &file_content); 53 base::JSONWriter::WriteWithOptions(values_.get(),
54 base::JSONWriter::OPTIONS_PRETTY_PRINT,
55 &file_content);
54 // TODO(sergeyu): Move ImportantFileWriter to base and use it here. 56 // TODO(sergeyu): Move ImportantFileWriter to base and use it here.
55 file_util::WriteFile(filename_, file_content.c_str(), file_content.size()); 57 file_util::WriteFile(filename_, file_content.c_str(), file_content.size());
56 } 58 }
57 59
58 } // namespace remoting 60 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/plugin/chromoting_instance.cc ('k') | sync/engine/model_safe_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698