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

Unified Diff: chrome/browser/chromeos/settings/cros_settings.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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: chrome/browser/chromeos/settings/cros_settings.cc
diff --git a/chrome/browser/chromeos/settings/cros_settings.cc b/chrome/browser/chromeos/settings/cros_settings.cc
index 0e3c7ea000934bdf649df134a6858b6947246923..9484c4ed4f070055889099a7d1ea0c0516e5b9f0 100644
--- a/chrome/browser/chromeos/settings/cros_settings.cc
+++ b/chrome/browser/chromeos/settings/cros_settings.cc
@@ -150,8 +150,8 @@ void CrosSettings::AppendToList(const std::string& path,
const base::Value* value) {
DCHECK(CalledOnValidThread());
const base::Value* old_value = GetPref(path);
- scoped_ptr<base::Value> new_value(
- old_value ? old_value->DeepCopy() : new base::ListValue());
+ std::unique_ptr<base::Value> new_value(old_value ? old_value->DeepCopy()
+ : new base::ListValue());
static_cast<base::ListValue*>(new_value.get())->Append(value->DeepCopy());
Set(path, *new_value);
}
@@ -160,8 +160,8 @@ void CrosSettings::RemoveFromList(const std::string& path,
const base::Value* value) {
DCHECK(CalledOnValidThread());
const base::Value* old_value = GetPref(path);
- scoped_ptr<base::Value> new_value(
- old_value ? old_value->DeepCopy() : new base::ListValue());
+ std::unique_ptr<base::Value> new_value(old_value ? old_value->DeepCopy()
+ : new base::ListValue());
static_cast<base::ListValue*>(new_value.get())->Remove(*value, NULL);
Set(path, *new_value);
}
@@ -295,7 +295,7 @@ bool CrosSettings::RemoveSettingsProvider(CrosSettingsProvider* provider) {
return false;
}
-scoped_ptr<CrosSettings::ObserverSubscription>
+std::unique_ptr<CrosSettings::ObserverSubscription>
CrosSettings::AddSettingsObserver(const std::string& path,
const base::Closure& callback) {
DCHECK(!path.empty());
@@ -305,7 +305,7 @@ CrosSettings::AddSettingsObserver(const std::string& path,
if (!GetProvider(path)) {
NOTREACHED() << "Trying to add an observer for an unregistered setting: "
<< path;
- return scoped_ptr<CrosSettings::ObserverSubscription>();
+ return std::unique_ptr<CrosSettings::ObserverSubscription>();
}
// Get the callback registry associated with the path.
« no previous file with comments | « chrome/browser/chromeos/settings/cros_settings.h ('k') | chrome/browser/chromeos/settings/cros_settings_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698