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

Unified Diff: base/prefs/default_pref_store.cc

Issue 1479473002: base: Use std::move() instead of Pass() for real movable types. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: basepass: missing-include Created 5 years, 1 month 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 | « base/power_monitor/power_monitor.cc ('k') | base/prefs/json_pref_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/default_pref_store.cc
diff --git a/base/prefs/default_pref_store.cc b/base/prefs/default_pref_store.cc
index efb4a754f4599dacaccf7d9de710817c0f565d96..b08ef7a52866d221ec89a98adef2d8864605b625 100644
--- a/base/prefs/default_pref_store.cc
+++ b/base/prefs/default_pref_store.cc
@@ -3,6 +3,9 @@
// found in the LICENSE file.
#include "base/prefs/default_pref_store.h"
+
+#include <utility>
+
#include "base/logging.h"
using base::Value;
@@ -29,7 +32,7 @@ bool DefaultPrefStore::HasObservers() const {
void DefaultPrefStore::SetDefaultValue(const std::string& key,
scoped_ptr<Value> value) {
DCHECK(!GetValue(key, NULL));
- prefs_.SetValue(key, value.Pass());
+ prefs_.SetValue(key, std::move(value));
}
void DefaultPrefStore::ReplaceDefaultValue(const std::string& key,
@@ -37,7 +40,7 @@ void DefaultPrefStore::ReplaceDefaultValue(const std::string& key,
const Value* old_value = NULL;
GetValue(key, &old_value);
bool notify = !old_value->Equals(value.get());
- prefs_.SetValue(key, value.Pass());
+ prefs_.SetValue(key, std::move(value));
if (notify)
FOR_EACH_OBSERVER(Observer, observers_, OnPrefValueChanged(key));
}
« no previous file with comments | « base/power_monitor/power_monitor.cc ('k') | base/prefs/json_pref_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698