diff options
-rw-r--r-- | base/callback_internal.cc | 2 | ||||
-rw-r--r-- | base/files/file_util_proxy.cc | 4 | ||||
-rw-r--r-- | base/memory/weak_ptr.cc | 8 | ||||
-rw-r--r-- | base/memory/weak_ptr.h | 3 | ||||
-rw-r--r-- | base/message_loop_unittest.cc | 5 | ||||
-rw-r--r-- | base/message_pump_libevent_unittest.cc | 4 | ||||
-rw-r--r-- | base/observer_list_unittest.cc | 2 | ||||
-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 | ||||
-rw-r--r-- | base/synchronization/waitable_event_watcher_posix.cc | 2 |
14 files changed, 34 insertions, 41 deletions
diff --git a/base/callback_internal.cc b/base/callback_internal.cc index 2dde402..5acade0 100644 --- a/base/callback_internal.cc +++ b/base/callback_internal.cc @@ -28,7 +28,7 @@ bool CallbackBase::Equals(const CallbackBase& other) const { CallbackBase::CallbackBase(BindStateBase* bind_state) : bind_state_(bind_state), polymorphic_invoke_(NULL) { - DCHECK(!bind_state_ || bind_state_->HasOneRef()); + DCHECK(!bind_state_.get() || bind_state_->HasOneRef()); } CallbackBase::~CallbackBase() { diff --git a/base/files/file_util_proxy.cc b/base/files/file_util_proxy.cc index f18d52b..ead5a38 100644 --- a/base/files/file_util_proxy.cc +++ b/base/files/file_util_proxy.cc @@ -68,8 +68,8 @@ class CreateTemporaryHelper { ~CreateTemporaryHelper() { if (file_handle_ != kInvalidPlatformFileValue) { - FileUtilProxy::Close(task_runner_, file_handle_, - FileUtilProxy::StatusCallback()); + FileUtilProxy::Close( + task_runner_.get(), file_handle_, FileUtilProxy::StatusCallback()); } } diff --git a/base/memory/weak_ptr.cc b/base/memory/weak_ptr.cc index 321b057..a22f61a 100644 --- a/base/memory/weak_ptr.cc +++ b/base/memory/weak_ptr.cc @@ -40,9 +40,7 @@ WeakReference::WeakReference(const Flag* flag) : flag_(flag) { WeakReference::~WeakReference() { } -bool WeakReference::is_valid() const { - return flag_ && flag_->IsValid(); -} +bool WeakReference::is_valid() const { return flag_.get() && flag_->IsValid(); } WeakReferenceOwner::WeakReferenceOwner() { } @@ -56,11 +54,11 @@ WeakReference WeakReferenceOwner::GetRef() const { if (!HasRefs()) flag_ = new WeakReference::Flag(); - return WeakReference(flag_); + return WeakReference(flag_.get()); } void WeakReferenceOwner::Invalidate() { - if (flag_) { + if (flag_.get()) { flag_->Invalidate(); flag_ = NULL; } diff --git a/base/memory/weak_ptr.h b/base/memory/weak_ptr.h index 8c2220f..9839db2 100644 --- a/base/memory/weak_ptr.h +++ b/base/memory/weak_ptr.h @@ -127,7 +127,8 @@ class BASE_EXPORT WeakReferenceOwner { // Remove this when crbug.com/234964 is addressed. void DetachFromThreadHack() { - if (flag_) flag_->DetachFromThreadHack(); + if (flag_.get()) + flag_->DetachFromThreadHack(); } private: diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc index 93996e6..5189241 100644 --- a/base/message_loop_unittest.cc +++ b/base/message_loop_unittest.cc @@ -436,10 +436,9 @@ class RecordDeletionProbe : public RefCounted<RecordDeletionProbe> { ~RecordDeletionProbe() { *was_deleted_ = true; - if (post_on_delete_) + if (post_on_delete_.get()) MessageLoop::current()->PostTask( - FROM_HERE, - Bind(&RecordDeletionProbe::Run, post_on_delete_.get())); + FROM_HERE, Bind(&RecordDeletionProbe::Run, post_on_delete_.get())); } scoped_refptr<RecordDeletionProbe> post_on_delete_; diff --git a/base/message_pump_libevent_unittest.cc b/base/message_pump_libevent_unittest.cc index c7d908e..cd423af 100644 --- a/base/message_pump_libevent_unittest.cc +++ b/base/message_pump_libevent_unittest.cc @@ -130,7 +130,7 @@ TEST_F(MessagePumpLibeventTest, DeleteWatcher) { false, MessagePumpLibevent::WATCH_READ_WRITE, watcher, &delegate); // Spoof a libevent notification. - OnLibeventNotification(pump, watcher); + OnLibeventNotification(pump.get(), watcher); } class StopWatcher : public BaseWatcher { @@ -154,7 +154,7 @@ TEST_F(MessagePumpLibeventTest, StopWatcher) { false, MessagePumpLibevent::WATCH_READ_WRITE, &watcher, &delegate); // Spoof a libevent notification. - OnLibeventNotification(pump, &watcher); + OnLibeventNotification(pump.get(), &watcher); } } // namespace diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc index 99c9e5f..8c6f9f6 100644 --- a/base/observer_list_unittest.cc +++ b/base/observer_list_unittest.cc @@ -348,7 +348,7 @@ TEST(ObserverListThreadSafeTest, RemoveMultipleObservers) { scoped_refptr<ObserverListThreadSafe<Foo> > observer_list( new ObserverListThreadSafe<Foo>); - FooRemover a(observer_list); + FooRemover a(observer_list.get()); Adder b(1); observer_list->AddObserver(&a); 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> diff --git a/base/synchronization/waitable_event_watcher_posix.cc b/base/synchronization/waitable_event_watcher_posix.cc index cc2fbc3..a8821b3 100644 --- a/base/synchronization/waitable_event_watcher_posix.cc +++ b/base/synchronization/waitable_event_watcher_posix.cc @@ -168,7 +168,7 @@ bool WaitableEventWatcher::StartWatching( current_ml->AddDestructionObserver(this); kernel_ = kernel; - waiter_ = new AsyncWaiter(current_ml, internal_callback_, cancel_flag_); + waiter_ = new AsyncWaiter(current_ml, internal_callback_, cancel_flag_.get()); event->Enqueue(waiter_); return true; |