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

Side by Side Diff: rlz/chromeos/lib/rlz_value_store_chromeos.cc

Issue 1150863002: Make DictionaryValue::DeepCopyWithoutEmptyChildren return a scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove semicolons 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 | « chrome/browser/ui/zoom/chrome_zoom_level_prefs.cc ('k') | no next file » | 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 "rlz/chromeos/lib/rlz_value_store_chromeos.h" 5 #include "rlz/chromeos/lib/rlz_value_store_chromeos.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/important_file_writer.h" 9 #include "base/files/important_file_writer.h"
10 #include "base/json/json_file_value_serializer.h" 10 #include "base/json/json_file_value_serializer.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 break; 224 break;
225 default: 225 default:
226 LOG(ERROR) << "Error reading RLZ store: " << error_msg; 226 LOG(ERROR) << "Error reading RLZ store: " << error_msg;
227 } 227 }
228 } 228 }
229 229
230 void RlzValueStoreChromeOS::WriteStore() { 230 void RlzValueStoreChromeOS::WriteStore() {
231 std::string json_data; 231 std::string json_data;
232 JSONStringValueSerializer serializer(&json_data); 232 JSONStringValueSerializer serializer(&json_data);
233 serializer.set_pretty_print(true); 233 serializer.set_pretty_print(true);
234 scoped_ptr<base::DictionaryValue> copy( 234 scoped_ptr<base::DictionaryValue> copy =
235 rlz_store_->DeepCopyWithoutEmptyChildren()); 235 rlz_store_->DeepCopyWithoutEmptyChildren();
236 if (!serializer.Serialize(*copy.get())) { 236 if (!serializer.Serialize(*copy.get())) {
237 LOG(ERROR) << "Failed to serialize RLZ data"; 237 LOG(ERROR) << "Failed to serialize RLZ data";
238 NOTREACHED(); 238 NOTREACHED();
239 return; 239 return;
240 } 240 }
241 if (!base::ImportantFileWriter::WriteFileAtomically(store_path_, json_data)) 241 if (!base::ImportantFileWriter::WriteFileAtomically(store_path_, json_data))
242 LOG(ERROR) << "Error writing RLZ store"; 242 LOG(ERROR) << "Error writing RLZ store";
243 } 243 }
244 244
245 bool RlzValueStoreChromeOS::AddValueToList(std::string list_name, 245 bool RlzValueStoreChromeOS::AddValueToList(std::string list_name,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 g_testing_rlz_store_path_ = directory; 333 g_testing_rlz_store_path_ = directory;
334 } 334 }
335 335
336 std::string RlzStoreFilenameStr() { 336 std::string RlzStoreFilenameStr() {
337 return GetRlzStorePath().value(); 337 return GetRlzStorePath().value();
338 } 338 }
339 339
340 } // namespace testing 340 } // namespace testing
341 341
342 } // namespace rlz_lib 342 } // namespace rlz_lib
OLDNEW
« no previous file with comments | « chrome/browser/ui/zoom/chrome_zoom_level_prefs.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698