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

Unified Diff: components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc

Issue 1918083002: Convert //components/[f-n]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: … 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
Index: components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc
diff --git a/components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc b/components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc
index 6ab90ddb8de4c396dedeff5cb306686fcf99e36a..280e99320ebd0a547956d7bd2466fbce9a5d3ba3 100644
--- a/components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc
+++ b/components/filesystem/public/cpp/prefs/filesystem_json_pref_store.cc
@@ -33,7 +33,7 @@ struct FilesystemJsonPrefStore::ReadResult {
ReadResult();
~ReadResult();
- scoped_ptr<base::Value> value;
+ std::unique_ptr<base::Value> value;
PrefReadError error;
private:
@@ -58,7 +58,7 @@ PersistentPrefStore::PrefReadError HandleReadErrors(const base::Value* value) {
FilesystemJsonPrefStore::FilesystemJsonPrefStore(
const std::string& pref_filename,
filesystem::FileSystemPtr filesystem,
- scoped_ptr<PrefFilter> pref_filter)
+ std::unique_ptr<PrefFilter> pref_filter)
: path_(pref_filename),
binding_(this),
filesystem_(std::move(filesystem)),
@@ -117,7 +117,7 @@ bool FilesystemJsonPrefStore::GetMutableValue(const std::string& key,
}
void FilesystemJsonPrefStore::SetValue(const std::string& key,
- scoped_ptr<base::Value> value,
+ std::unique_ptr<base::Value> value,
uint32_t flags) {
DCHECK(CalledOnValidThread());
@@ -130,9 +130,10 @@ void FilesystemJsonPrefStore::SetValue(const std::string& key,
}
}
-void FilesystemJsonPrefStore::SetValueSilently(const std::string& key,
- scoped_ptr<base::Value> value,
- uint32_t flags) {
+void FilesystemJsonPrefStore::SetValueSilently(
+ const std::string& key,
+ std::unique_ptr<base::Value> value,
+ uint32_t flags) {
DCHECK(CalledOnValidThread());
DCHECK(value);
@@ -235,12 +236,14 @@ void FilesystemJsonPrefStore::ReportValueChanged(const std::string& key,
void FilesystemJsonPrefStore::OnFileSystemShutdown() {}
-void FilesystemJsonPrefStore::OnFileRead(scoped_ptr<ReadResult> read_result) {
+void FilesystemJsonPrefStore::OnFileRead(
+ std::unique_ptr<ReadResult> read_result) {
DCHECK(CalledOnValidThread());
DCHECK(read_result);
- scoped_ptr<base::DictionaryValue> unfiltered_prefs(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> unfiltered_prefs(
+ new base::DictionaryValue);
read_error_ = read_result->error;
@@ -289,7 +292,7 @@ FilesystemJsonPrefStore::~FilesystemJsonPrefStore() {
}
void FilesystemJsonPrefStore::FinalizeFileRead(
- scoped_ptr<base::DictionaryValue> prefs,
+ std::unique_ptr<base::DictionaryValue> prefs,
bool schedule_write) {
DCHECK(CalledOnValidThread());
@@ -391,7 +394,7 @@ void FilesystemJsonPrefStore::OnPreferencesReadStart() {
void FilesystemJsonPrefStore::OnPreferencesFileRead(
FileError err,
mojo::Array<uint8_t> contents) {
- scoped_ptr<FilesystemJsonPrefStore::ReadResult> read_result(
+ std::unique_ptr<FilesystemJsonPrefStore::ReadResult> read_result(
new FilesystemJsonPrefStore::ReadResult);
// TODO(erg): Needs even better error handling.
switch (err) {

Powered by Google App Engine
This is Rietveld 408576698