diff options
author | dcheng <dcheng@chromium.org> | 2014-08-27 19:25:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-28 02:27:21 +0000 |
commit | 2accd77663cbadc40245be1fce280c76756e6eca (patch) | |
tree | 46939cbafe21bd0359975c555c314bfdc3e4022d | |
parent | b6272ef2f62c82478c53f93eb42f2cabed2a21d0 (diff) | |
download | chromium_src-2accd77663cbadc40245be1fce280c76756e6eca.zip chromium_src-2accd77663cbadc40245be1fce280c76756e6eca.tar.gz chromium_src-2accd77663cbadc40245be1fce280c76756e6eca.tar.bz2 |
Remove implicit conversions from scoped_refptr to T* in chrome/browser/prefs/
This patch was generated by running the rewrite_scoped_refptr clang tool
on a Linux build.
BUG=110610
Review URL: https://codereview.chromium.org/506153002
Cr-Commit-Position: refs/heads/master@{#292297}
4 files changed, 18 insertions, 16 deletions
diff --git a/chrome/browser/prefs/leveldb_pref_store.cc b/chrome/browser/prefs/leveldb_pref_store.cc index cc5a0c0..7409f95 100644 --- a/chrome/browser/prefs/leveldb_pref_store.cc +++ b/chrome/browser/prefs/leveldb_pref_store.cc @@ -339,7 +339,7 @@ void LevelDBPrefStore::ReadPrefsAsync(ReadErrorDelegate* error_delegate) { OnStorageRead(reading_results.Pass()); return; } - PostTaskAndReplyWithResult(sequenced_task_runner_, + PostTaskAndReplyWithResult(sequenced_task_runner_.get(), FROM_HERE, base::Bind(&LevelDBPrefStore::DoReading, path_), base::Bind(&LevelDBPrefStore::OnStorageRead, diff --git a/chrome/browser/prefs/profile_pref_store_manager.cc b/chrome/browser/prefs/profile_pref_store_manager.cc index 4747e16..6cf987c 100644 --- a/chrome/browser/prefs/profile_pref_store_manager.cc +++ b/chrome/browser/prefs/profile_pref_store_manager.cc @@ -87,7 +87,7 @@ PersistentPrefStore* ProfilePrefStoreManager::CreateProfilePrefStore( scoped_ptr<PrefFilter> pref_filter; if (!kPlatformSupportsPreferenceTracking) { return new JsonPrefStore(GetPrefFilePathFromProfilePath(profile_path_), - io_task_runner, + io_task_runner.get(), scoped_ptr<PrefFilter>()); } @@ -132,14 +132,14 @@ PersistentPrefStore* ProfilePrefStoreManager::CreateProfilePrefStore( scoped_refptr<JsonPrefStore> unprotected_pref_store( new JsonPrefStore(GetPrefFilePathFromProfilePath(profile_path_), - io_task_runner, + io_task_runner.get(), unprotected_pref_hash_filter.PassAs<PrefFilter>())); // TODO(gab): Remove kDeprecatedProtectedPreferencesFilename as an alternate // file in M40+. scoped_refptr<JsonPrefStore> protected_pref_store(new JsonPrefStore( profile_path_.Append(chrome::kSecurePreferencesFilename), profile_path_.Append(chrome::kProtectedPreferencesFilenameDeprecated), - io_task_runner, + io_task_runner.get(), protected_pref_hash_filter.PassAs<PrefFilter>())); SetupTrackedPreferencesMigration( @@ -220,7 +220,7 @@ ProfilePrefStoreManager::CreateDeprecatedCombinedProfilePrefStore( false)); } return new JsonPrefStore(GetPrefFilePathFromProfilePath(profile_path_), - io_task_runner, + io_task_runner.get(), pref_filter.Pass()); } diff --git a/chrome/browser/prefs/profile_pref_store_manager_unittest.cc b/chrome/browser/prefs/profile_pref_store_manager_unittest.cc index 345987d..9f26fd3 100644 --- a/chrome/browser/prefs/profile_pref_store_manager_unittest.cc +++ b/chrome/browser/prefs/profile_pref_store_manager_unittest.cc @@ -91,13 +91,13 @@ class ProfilePrefStoreManagerTest : public testing::Test { : configuration_(kConfiguration, kConfiguration + arraysize(kConfiguration)), profile_pref_registry_(new user_prefs::PrefRegistrySyncable), - registry_verifier_(profile_pref_registry_), + registry_verifier_(profile_pref_registry_.get()), seed_("seed"), reset_recorded_(false) {} virtual void SetUp() OVERRIDE { ProfilePrefStoreManager::RegisterPrefs(local_state_.registry()); - ProfilePrefStoreManager::RegisterProfilePrefs(profile_pref_registry_); + ProfilePrefStoreManager::RegisterProfilePrefs(profile_pref_registry_.get()); for (const PrefHashFilter::TrackedPreferenceMetadata* it = kConfiguration; it != kConfiguration + arraysize(kConfiguration); ++it) { @@ -152,7 +152,7 @@ class ProfilePrefStoreManagerTest : public testing::Test { pref_service_factory.set_user_prefs(pref_store_); scoped_ptr<PrefService> pref_service( - pref_service_factory.Create(profile_pref_registry_)); + pref_service_factory.Create(profile_pref_registry_.get())); EXPECT_EQ( reset_expected, @@ -166,7 +166,7 @@ class ProfilePrefStoreManagerTest : public testing::Test { pref_service_factory.set_user_prefs(pref_store_); scoped_ptr<PrefService> pref_service( - pref_service_factory.Create(profile_pref_registry_)); + pref_service_factory.Create(profile_pref_registry_.get())); ProfilePrefStoreManager::ClearResetTime(pref_service.get()); } @@ -180,13 +180,13 @@ class ProfilePrefStoreManagerTest : public testing::Test { base::Bind(&ProfilePrefStoreManagerTest::RecordReset, base::Unretained(this)), &mock_validation_delegate_); - InitializePrefStore(pref_store); + InitializePrefStore(pref_store.get()); pref_store = NULL; base::RunLoop().RunUntilIdle(); } void DestroyPrefStore() { - if (pref_store_) { + if (pref_store_.get()) { ClearResetRecorded(); // Force everything to be written to disk, triggering the PrefHashFilter // while our RegistryVerifier is watching. @@ -205,7 +205,7 @@ class ProfilePrefStoreManagerTest : public testing::Test { scoped_refptr<PersistentPrefStore> pref_store = manager_->CreateDeprecatedCombinedProfilePrefStore( main_message_loop_.message_loop_proxy()); - InitializePrefStore(pref_store); + InitializePrefStore(pref_store.get()); pref_store = NULL; base::RunLoop().RunUntilIdle(); } diff --git a/chrome/browser/prefs/tracked/segregated_pref_store.cc b/chrome/browser/prefs/tracked/segregated_pref_store.cc index 3a50b40..2b41830 100644 --- a/chrome/browser/prefs/tracked/segregated_pref_store.cc +++ b/chrome/browser/prefs/tracked/segregated_pref_store.cc @@ -152,12 +152,14 @@ SegregatedPrefStore::~SegregatedPrefStore() { } PersistentPrefStore* SegregatedPrefStore::StoreForKey(const std::string& key) { - return ContainsKey(selected_preference_names_, key) ? selected_pref_store_ - : default_pref_store_; + return (ContainsKey(selected_preference_names_, key) + ? selected_pref_store_ + : default_pref_store_).get(); } const PersistentPrefStore* SegregatedPrefStore::StoreForKey( const std::string& key) const { - return ContainsKey(selected_preference_names_, key) ? selected_pref_store_ - : default_pref_store_; + return (ContainsKey(selected_preference_names_, key) + ? selected_pref_store_ + : default_pref_store_).get(); } |