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

Unified Diff: components/history/content/browser/web_contents_top_sites_observer.cc

Issue 2847013003: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: rev 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
Index: components/history/content/browser/web_contents_top_sites_observer.cc
diff --git a/components/history/content/browser/web_contents_top_sites_observer.cc b/components/history/content/browser/web_contents_top_sites_observer.cc
index 83ab57e9bad507cefab7fdc5d9b65590f9cf2f9a..2e7f10bc91cd98d69e63f1bf7340a4b3829f50e7 100644
--- a/components/history/content/browser/web_contents_top_sites_observer.cc
+++ b/components/history/content/browser/web_contents_top_sites_observer.cc
@@ -5,6 +5,7 @@
#include "components/history/content/browser/web_contents_top_sites_observer.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "components/history/core/browser/top_sites.h"
#include "content/public/browser/navigation_details.h"
#include "content/public/browser/navigation_entry.h"
@@ -19,8 +20,9 @@ void WebContentsTopSitesObserver::CreateForWebContents(
TopSites* top_sites) {
DCHECK(web_contents);
if (!FromWebContents(web_contents)) {
- web_contents->SetUserData(UserDataKey(), new WebContentsTopSitesObserver(
- web_contents, top_sites));
+ web_contents->SetUserData(UserDataKey(),
+ base::WrapUnique(new WebContentsTopSitesObserver(
+ web_contents, top_sites)));
}
}

Powered by Google App Engine
This is Rietveld 408576698