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

Unified Diff: components/user_prefs/user_prefs.cc

Issue 2842833003: Update SupportsUserData uses with unique_ptr. (Closed)
Patch Set: rebase Created 3 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/user_prefs.h ('k') | components/zoom/zoom_event_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/user_prefs/user_prefs.cc
diff --git a/components/user_prefs/user_prefs.cc b/components/user_prefs/user_prefs.cc
index 493c50eac77d10e846f80a779bf55bbb39cdf36a..a752c8f8acc56d46895d857a37a2b785147d4088 100644
--- a/components/user_prefs/user_prefs.cc
+++ b/components/user_prefs/user_prefs.cc
@@ -5,6 +5,7 @@
#include "components/user_prefs/user_prefs.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/singleton.h"
#include "components/prefs/pref_service.h"
@@ -34,7 +35,7 @@ void UserPrefs::Set(base::SupportsUserData* context, PrefService* prefs) {
DCHECK(context);
DCHECK(prefs);
DCHECK(!context->GetUserData(UserDataKey()));
- context->SetUserData(UserDataKey(), new UserPrefs(prefs));
+ context->SetUserData(UserDataKey(), base::WrapUnique(new UserPrefs(prefs)));
}
UserPrefs::UserPrefs(PrefService* prefs) : prefs_(prefs) {
« no previous file with comments | « components/user_prefs/user_prefs.h ('k') | components/zoom/zoom_event_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698