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

Side by Side Diff: chrome/common/json_pref_store.cc

Issue 7477008: Remove explicit keyword from multi-argument constructors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 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
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 "chrome/common/json_pref_store.h" 5 #include "chrome/common/json_pref_store.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/message_loop_proxy.h" 13 #include "base/message_loop_proxy.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "content/common/json_value_serializer.h" 15 #include "content/common/json_value_serializer.h"
16 16
17 namespace { 17 namespace {
18 18
19 // Some extensions we'll tack on to copies of the Preferences files. 19 // Some extensions we'll tack on to copies of the Preferences files.
20 const FilePath::CharType* kBadExtension = FILE_PATH_LITERAL("bad"); 20 const FilePath::CharType* kBadExtension = FILE_PATH_LITERAL("bad");
21 21
22 // Differentiates file loading between origin thread and passed 22 // Differentiates file loading between origin thread and passed
23 // (aka file) thread. 23 // (aka file) thread.
24 class FileThreadDeserializer 24 class FileThreadDeserializer
25 : public base::RefCountedThreadSafe<FileThreadDeserializer> { 25 : public base::RefCountedThreadSafe<FileThreadDeserializer> {
26 public: 26 public:
27 explicit FileThreadDeserializer(JsonPrefStore* delegate, 27 FileThreadDeserializer(JsonPrefStore* delegate,
28 base::MessageLoopProxy* file_loop_proxy) 28 base::MessageLoopProxy* file_loop_proxy)
29 : no_dir_(false), 29 : no_dir_(false),
30 error_(PersistentPrefStore::PREF_READ_ERROR_NONE), 30 error_(PersistentPrefStore::PREF_READ_ERROR_NONE),
31 delegate_(delegate), 31 delegate_(delegate),
32 file_loop_proxy_(file_loop_proxy), 32 file_loop_proxy_(file_loop_proxy),
33 origin_loop_proxy_(base::MessageLoopProxy::CreateForCurrentThread()) { 33 origin_loop_proxy_(base::MessageLoopProxy::CreateForCurrentThread()) {
34 } 34 }
35 35
36 void Start(const FilePath& path) { 36 void Start(const FilePath& path) {
37 DCHECK(origin_loop_proxy_->BelongsToCurrentThread()); 37 DCHECK(origin_loop_proxy_->BelongsToCurrentThread());
38 file_loop_proxy_->PostTask( 38 file_loop_proxy_->PostTask(
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 } 311 }
312 312
313 bool JsonPrefStore::SerializeData(std::string* output) { 313 bool JsonPrefStore::SerializeData(std::string* output) {
314 // TODO(tc): Do we want to prune webkit preferences that match the default 314 // TODO(tc): Do we want to prune webkit preferences that match the default
315 // value? 315 // value?
316 JSONStringValueSerializer serializer(output); 316 JSONStringValueSerializer serializer(output);
317 serializer.set_pretty_print(true); 317 serializer.set_pretty_print(true);
318 scoped_ptr<DictionaryValue> copy(prefs_->DeepCopyWithoutEmptyChildren()); 318 scoped_ptr<DictionaryValue> copy(prefs_->DeepCopyWithoutEmptyChildren());
319 return serializer.Serialize(*(copy.get())); 319 return serializer.Serialize(*(copy.get()));
320 } 320 }
OLDNEW
« no previous file with comments | « chrome/browser/webdata/web_database_table.h ('k') | chrome/service/cloud_print/cloud_print_proxy_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698