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

Side by Side Diff: base/prefs/pref_service_builder.cc

Issue 15984016: Call scoped_refptr<T>::get() rather than relying on implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 6 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 | « base/prefs/json_pref_store_unittest.cc ('k') | base/prefs/testing_pref_service.h » ('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 "base/prefs/pref_service_builder.h" 5 #include "base/prefs/pref_service_builder.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/prefs/default_pref_store.h" 8 #include "base/prefs/default_pref_store.h"
9 #include "base/prefs/json_pref_store.h" 9 #include "base/prefs/json_pref_store.h"
10 #include "base/prefs/pref_notifier_impl.h" 10 #include "base/prefs/pref_notifier_impl.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 return *this; 67 return *this;
68 } 68 }
69 69
70 PrefServiceBuilder& PrefServiceBuilder::WithAsync(bool async) { 70 PrefServiceBuilder& PrefServiceBuilder::WithAsync(bool async) {
71 async_ = async; 71 async_ = async;
72 return *this; 72 return *this;
73 } 73 }
74 74
75 PrefService* PrefServiceBuilder::Create(PrefRegistry* pref_registry) { 75 PrefService* PrefServiceBuilder::Create(PrefRegistry* pref_registry) {
76 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl(); 76 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl();
77 PrefService* pref_service = new PrefService( 77 PrefService* pref_service =
78 pref_notifier, 78 new PrefService(pref_notifier,
79 new PrefValueStore( 79 new PrefValueStore(managed_prefs_.get(),
80 managed_prefs_.get(), 80 extension_prefs_.get(),
81 extension_prefs_.get(), 81 command_line_prefs_.get(),
82 command_line_prefs_.get(), 82 user_prefs_.get(),
83 user_prefs_.get(), 83 recommended_prefs_.get(),
84 recommended_prefs_.get(), 84 pref_registry->defaults().get(),
85 pref_registry->defaults(), 85 pref_notifier),
86 pref_notifier), 86 user_prefs_.get(),
87 user_prefs_.get(), 87 pref_registry,
88 pref_registry, 88 read_error_callback_,
89 read_error_callback_, 89 async_);
90 async_);
91 ResetDefaultState(); 90 ResetDefaultState();
92 return pref_service; 91 return pref_service;
93 } 92 }
94 93
95 void PrefServiceBuilder::ResetDefaultState() { 94 void PrefServiceBuilder::ResetDefaultState() {
96 managed_prefs_ = NULL; 95 managed_prefs_ = NULL;
97 extension_prefs_ = NULL; 96 extension_prefs_ = NULL;
98 command_line_prefs_ = NULL; 97 command_line_prefs_ = NULL;
99 user_prefs_ = NULL; 98 user_prefs_ = NULL;
100 recommended_prefs_ = NULL; 99 recommended_prefs_ = NULL;
101 read_error_callback_ = base::Bind(&DoNothingHandleReadError); 100 read_error_callback_ = base::Bind(&DoNothingHandleReadError);
102 async_ = false; 101 async_ = false;
103 } 102 }
OLDNEW
« no previous file with comments | « base/prefs/json_pref_store_unittest.cc ('k') | base/prefs/testing_pref_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698