diff options
author | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-31 21:37:53 +0000 |
---|---|---|
committer | rsleevi@chromium.org <rsleevi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-31 21:37:53 +0000 |
commit | 3703e9260cef44019d0ff36a28eb43edde664edd (patch) | |
tree | b96c13afed26f1b5e6a6f366f448a348ab8dfaa1 /base/prefs | |
parent | 87f7ab4c5f2f608b1abbab78fd9d524c51e79d83 (diff) | |
download | chromium_src-3703e9260cef44019d0ff36a28eb43edde664edd.zip chromium_src-3703e9260cef44019d0ff36a28eb43edde664edd.tar.gz chromium_src-3703e9260cef44019d0ff36a28eb43edde664edd.tar.bz2 |
Update base/ to use scoped_refptr<T>::get() rather than implicit "operator T*"
Linux fixes
BUG=110610
TBR=darin
Review URL: https://chromiumcodereview.appspot.com/16160015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203483 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/prefs')
-rw-r--r-- | base/prefs/json_pref_store_unittest.cc | 10 | ||||
-rw-r--r-- | base/prefs/pref_member.cc | 2 | ||||
-rw-r--r-- | base/prefs/pref_member.h | 6 | ||||
-rw-r--r-- | base/prefs/pref_value_store.cc | 2 | ||||
-rw-r--r-- | base/prefs/pref_value_store_unittest.cc | 15 | ||||
-rw-r--r-- | base/prefs/testing_pref_service.h | 10 |
6 files changed, 20 insertions, 25 deletions
diff --git a/base/prefs/json_pref_store_unittest.cc b/base/prefs/json_pref_store_unittest.cc index 1368b3f..ac6a187 100644 --- a/base/prefs/json_pref_store_unittest.cc +++ b/base/prefs/json_pref_store_unittest.cc @@ -176,9 +176,8 @@ TEST_F(JsonPrefStoreTest, Basic) { // } // } - RunBasicJsonPrefStoreTest(pref_store, - input_file, - data_dir_.AppendASCII("write.golden.json")); + RunBasicJsonPrefStoreTest( + pref_store.get(), input_file, data_dir_.AppendASCII("write.golden.json")); } TEST_F(JsonPrefStoreTest, BasicAsync) { @@ -218,9 +217,8 @@ TEST_F(JsonPrefStoreTest, BasicAsync) { // } // } - RunBasicJsonPrefStoreTest(pref_store, - input_file, - data_dir_.AppendASCII("write.golden.json")); + RunBasicJsonPrefStoreTest( + pref_store.get(), input_file, data_dir_.AppendASCII("write.golden.json")); } // Tests asynchronous reading of the file when there is no file. diff --git a/base/prefs/pref_member.cc b/base/prefs/pref_member.cc index 8a97818..a772243 100644 --- a/base/prefs/pref_member.cc +++ b/base/prefs/pref_member.cc @@ -100,7 +100,7 @@ PrefMemberBase::Internal::~Internal() { } bool PrefMemberBase::Internal::IsOnCorrectThread() const { // In unit tests, there may not be a message loop. - return thread_loop_ == NULL || thread_loop_->BelongsToCurrentThread(); + return thread_loop_.get() == NULL || thread_loop_->BelongsToCurrentThread(); } void PrefMemberBase::Internal::UpdateValue( diff --git a/base/prefs/pref_member.h b/base/prefs/pref_member.h index e0e88f5..6aeb5f9 100644 --- a/base/prefs/pref_member.h +++ b/base/prefs/pref_member.h @@ -271,10 +271,8 @@ class PrefMember : public subtle::PrefMemberBase { DISALLOW_COPY_AND_ASSIGN(Internal); }; - virtual Internal* internal() const OVERRIDE { return internal_; } - virtual void CreateInternal() const OVERRIDE { - internal_ = new Internal(); - } + virtual Internal* internal() const OVERRIDE { return internal_.get(); } + virtual void CreateInternal() const OVERRIDE { internal_ = new Internal(); } // This method is used to do the actual sync with pref of the specified type. void BASE_PREFS_EXPORT UpdatePref(const ValueType& value); diff --git a/base/prefs/pref_value_store.cc b/base/prefs/pref_value_store.cc index 1ebcb72..f3742c4 100644 --- a/base/prefs/pref_value_store.cc +++ b/base/prefs/pref_value_store.cc @@ -269,7 +269,7 @@ void PrefValueStore::CheckInitializationCompleted() { for (size_t i = 0; i <= PREF_STORE_TYPE_MAX; ++i) { scoped_refptr<PrefStore> store = GetPrefStore(static_cast<PrefStoreType>(i)); - if (store && !store->IsInitializationComplete()) + if (store.get() && !store->IsInitializationComplete()) return; } pref_notifier_->OnInitializationCompleted(true); diff --git a/base/prefs/pref_value_store_unittest.cc b/base/prefs/pref_value_store_unittest.cc index cb047ba..cc11520 100644 --- a/base/prefs/pref_value_store_unittest.cc +++ b/base/prefs/pref_value_store_unittest.cc @@ -98,14 +98,13 @@ class PrefValueStoreTest : public testing::Test { sync_associator_.reset(new MockPrefModelAssociator()); // Create a fresh PrefValueStore. - pref_value_store_.reset(new PrefValueStore( - managed_pref_store_, - extension_pref_store_, - command_line_pref_store_, - user_pref_store_, - recommended_pref_store_, - default_pref_store_, - &pref_notifier_)); + pref_value_store_.reset(new PrefValueStore(managed_pref_store_.get(), + extension_pref_store_.get(), + command_line_pref_store_.get(), + user_pref_store_.get(), + recommended_pref_store_.get(), + default_pref_store_.get(), + &pref_notifier_)); pref_value_store_->set_callback( base::Bind(&MockPrefModelAssociator::ProcessPrefChange, diff --git a/base/prefs/testing_pref_service.h b/base/prefs/testing_pref_service.h index 9d290fe..fee1981 100644 --- a/base/prefs/testing_pref_service.h +++ b/base/prefs/testing_pref_service.h @@ -119,14 +119,14 @@ template<class SuperPrefService, class ConstructionPrefRegistry> void TestingPrefServiceBase< SuperPrefService, ConstructionPrefRegistry>::SetManagedPref( const char* path, Value* value) { - SetPref(managed_prefs_, path, value); + SetPref(managed_prefs_.get(), path, value); } template<class SuperPrefService, class ConstructionPrefRegistry> void TestingPrefServiceBase< SuperPrefService, ConstructionPrefRegistry>::RemoveManagedPref( const char* path) { - RemovePref(managed_prefs_, path); + RemovePref(managed_prefs_.get(), path); } template<class SuperPrefService, class ConstructionPrefRegistry> @@ -140,14 +140,14 @@ template<class SuperPrefService, class ConstructionPrefRegistry> void TestingPrefServiceBase< SuperPrefService, ConstructionPrefRegistry>::SetUserPref( const char* path, Value* value) { - SetPref(user_prefs_, path, value); + SetPref(user_prefs_.get(), path, value); } template<class SuperPrefService, class ConstructionPrefRegistry> void TestingPrefServiceBase< SuperPrefService, ConstructionPrefRegistry>::RemoveUserPref( const char* path) { - RemovePref(user_prefs_, path); + RemovePref(user_prefs_.get(), path); } template<class SuperPrefService, class ConstructionPrefRegistry> @@ -161,7 +161,7 @@ template<class SuperPrefService, class ConstructionPrefRegistry> void TestingPrefServiceBase< SuperPrefService, ConstructionPrefRegistry>::SetRecommendedPref( const char* path, Value* value) { - SetPref(recommended_prefs_, path, value); + SetPref(recommended_prefs_.get(), path, value); } template<class SuperPrefService, class ConstructionPrefRegistry> |