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

Side by Side Diff: chrome/browser/prefs/tracked/segregated_pref_store.cc

Issue 506153002: Remove implicit conversions from scoped_refptr to T* in chrome/browser/prefs/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/browser/prefs/tracked/segregated_pref_store.h" 5 #include "chrome/browser/prefs/tracked/segregated_pref_store.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 10
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 default_pref_store_->CommitPendingWrite(); 145 default_pref_store_->CommitPendingWrite();
146 selected_pref_store_->CommitPendingWrite(); 146 selected_pref_store_->CommitPendingWrite();
147 } 147 }
148 148
149 SegregatedPrefStore::~SegregatedPrefStore() { 149 SegregatedPrefStore::~SegregatedPrefStore() {
150 default_pref_store_->RemoveObserver(&aggregating_observer_); 150 default_pref_store_->RemoveObserver(&aggregating_observer_);
151 selected_pref_store_->RemoveObserver(&aggregating_observer_); 151 selected_pref_store_->RemoveObserver(&aggregating_observer_);
152 } 152 }
153 153
154 PersistentPrefStore* SegregatedPrefStore::StoreForKey(const std::string& key) { 154 PersistentPrefStore* SegregatedPrefStore::StoreForKey(const std::string& key) {
155 return ContainsKey(selected_preference_names_, key) ? selected_pref_store_ 155 return (ContainsKey(selected_preference_names_, key)
156 : default_pref_store_; 156 ? selected_pref_store_
157 : default_pref_store_).get();
157 } 158 }
158 159
159 const PersistentPrefStore* SegregatedPrefStore::StoreForKey( 160 const PersistentPrefStore* SegregatedPrefStore::StoreForKey(
160 const std::string& key) const { 161 const std::string& key) const {
161 return ContainsKey(selected_preference_names_, key) ? selected_pref_store_ 162 return (ContainsKey(selected_preference_names_, key)
162 : default_pref_store_; 163 ? selected_pref_store_
164 : default_pref_store_).get();
163 } 165 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698