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

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

Issue 16160015: Update base/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/pref_member.h ('k') | base/prefs/pref_value_store.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) 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_member.h" 5 #include "base/prefs/pref_member.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 } 93 }
94 94
95 PrefMemberBase::Internal::Internal() 95 PrefMemberBase::Internal::Internal()
96 : thread_loop_(MessageLoopProxy::current()), 96 : thread_loop_(MessageLoopProxy::current()),
97 is_managed_(false) { 97 is_managed_(false) {
98 } 98 }
99 PrefMemberBase::Internal::~Internal() { } 99 PrefMemberBase::Internal::~Internal() { }
100 100
101 bool PrefMemberBase::Internal::IsOnCorrectThread() const { 101 bool PrefMemberBase::Internal::IsOnCorrectThread() const {
102 // In unit tests, there may not be a message loop. 102 // In unit tests, there may not be a message loop.
103 return thread_loop_ == NULL || thread_loop_->BelongsToCurrentThread(); 103 return thread_loop_.get() == NULL || thread_loop_->BelongsToCurrentThread();
104 } 104 }
105 105
106 void PrefMemberBase::Internal::UpdateValue( 106 void PrefMemberBase::Internal::UpdateValue(
107 base::Value* v, 107 base::Value* v,
108 bool is_managed, 108 bool is_managed,
109 bool is_user_modifiable, 109 bool is_user_modifiable,
110 const base::Closure& callback) const { 110 const base::Closure& callback) const {
111 scoped_ptr<base::Value> value(v); 111 scoped_ptr<base::Value> value(v);
112 base::ScopedClosureRunner closure_runner(callback); 112 base::ScopedClosureRunner closure_runner(callback);
113 if (IsOnCorrectThread()) { 113 if (IsOnCorrectThread()) {
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 ListValue list_value; 215 ListValue list_value;
216 list_value.AppendStrings(value); 216 list_value.AppendStrings(value);
217 prefs()->Set(pref_name().c_str(), list_value); 217 prefs()->Set(pref_name().c_str(), list_value);
218 } 218 }
219 219
220 template <> 220 template <>
221 bool PrefMember<std::vector<std::string> >::Internal::UpdateValueInternal( 221 bool PrefMember<std::vector<std::string> >::Internal::UpdateValueInternal(
222 const base::Value& value) const { 222 const base::Value& value) const {
223 return subtle::PrefMemberVectorStringUpdate(value, &value_); 223 return subtle::PrefMemberVectorStringUpdate(value, &value_);
224 } 224 }
OLDNEW
« no previous file with comments | « base/prefs/pref_member.h ('k') | base/prefs/pref_value_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698