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

Unified Diff: components/user_prefs/tracked/pref_hash_filter_unittest.cc

Issue 1908143002: Convert //components/user_prefs from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore the rightful glory of <windows.h> Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/user_prefs/tracked/pref_hash_filter.cc ('k') | components/user_prefs/tracked/pref_hash_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/user_prefs/tracked/pref_hash_filter_unittest.cc
diff --git a/components/user_prefs/tracked/pref_hash_filter_unittest.cc b/components/user_prefs/tracked/pref_hash_filter_unittest.cc
index adf2bf3613eb89db42dcbd858085f57c62362a0b..97201b5a1e618fa85ecca089bd38e578e71522d2 100644
--- a/components/user_prefs/tracked/pref_hash_filter_unittest.cc
+++ b/components/user_prefs/tracked/pref_hash_filter_unittest.cc
@@ -7,6 +7,7 @@
#include <stddef.h>
#include <map>
+#include <memory>
#include <set>
#include <string>
#include <utility>
@@ -18,7 +19,6 @@
#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/metrics/histogram_base.h"
#include "base/metrics/histogram_samples.h"
#include "base/metrics/statistics_recorder.h"
@@ -156,8 +156,8 @@ class MockPrefHashStore : public PrefHashStore {
}
// PrefHashStore implementation.
- scoped_ptr<PrefHashStoreTransaction> BeginTransaction(
- scoped_ptr<HashStoreContents> storage) override;
+ std::unique_ptr<PrefHashStoreTransaction> BeginTransaction(
+ std::unique_ptr<HashStoreContents> storage) override;
private:
// A MockPrefHashStoreTransaction is handed to the caller on
@@ -246,10 +246,10 @@ void MockPrefHashStore::SetInvalidKeysResult(
invalid_keys_results_.insert(std::make_pair(path, invalid_keys_result));
}
-scoped_ptr<PrefHashStoreTransaction> MockPrefHashStore::BeginTransaction(
- scoped_ptr<HashStoreContents> storage) {
+std::unique_ptr<PrefHashStoreTransaction> MockPrefHashStore::BeginTransaction(
+ std::unique_ptr<HashStoreContents> storage) {
EXPECT_FALSE(transaction_active_);
- return scoped_ptr<PrefHashStoreTransaction>(
+ return std::unique_ptr<PrefHashStoreTransaction>(
new MockPrefHashStoreTransaction(this));
}
@@ -384,7 +384,7 @@ class PrefHashFilterTest
// PrefHashFilter) is stored in |mock_pref_hash_store_|.
void InitializePrefHashFilter(const std::vector<
PrefHashFilter::TrackedPreferenceMetadata>& configuration) {
- scoped_ptr<MockPrefHashStore> temp_mock_pref_hash_store(
+ std::unique_ptr<MockPrefHashStore> temp_mock_pref_hash_store(
new MockPrefHashStore);
mock_pref_hash_store_ = temp_mock_pref_hash_store.get();
pref_hash_filter_.reset(new PrefHashFilter(
@@ -414,15 +414,15 @@ class PrefHashFilterTest
}
MockPrefHashStore* mock_pref_hash_store_;
- scoped_ptr<base::DictionaryValue> pref_store_contents_;
+ std::unique_ptr<base::DictionaryValue> pref_store_contents_;
MockValidationDelegate mock_validation_delegate_;
- scoped_ptr<PrefHashFilter> pref_hash_filter_;
+ std::unique_ptr<PrefHashFilter> pref_hash_filter_;
private:
// Stores |prefs| back in |pref_store_contents| and ensure
// |expected_schedule_write| matches the reported |schedule_write|.
void GetPrefsBack(bool expected_schedule_write,
- scoped_ptr<base::DictionaryValue> prefs,
+ std::unique_ptr<base::DictionaryValue> prefs,
bool schedule_write) {
pref_store_contents_ = std::move(prefs);
EXPECT_TRUE(pref_store_contents_);
« no previous file with comments | « components/user_prefs/tracked/pref_hash_filter.cc ('k') | components/user_prefs/tracked/pref_hash_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698