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

Unified Diff: content/public/browser/web_contents_user_data.h

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 | « content/browser/websockets/websocket_manager.cc ('k') | content/renderer/internal_document_state_data.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/web_contents_user_data.h
diff --git a/content/public/browser/web_contents_user_data.h b/content/public/browser/web_contents_user_data.h
index 6d84595af724bc2a1b89e004b67cea9204d4b445..99e114b961ae51021fa2cec762604160edac0bbb 100644
--- a/content/public/browser/web_contents_user_data.h
+++ b/content/public/browser/web_contents_user_data.h
@@ -6,6 +6,7 @@
#define CONTENT_PUBLIC_BROWSER_WEB_CONTENTS_USER_DATA_H_
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/supports_user_data.h"
#include "content/public/browser/web_contents.h"
@@ -35,7 +36,7 @@ class WebContentsUserData : public base::SupportsUserData::Data {
static void CreateForWebContents(WebContents* contents) {
DCHECK(contents);
if (!FromWebContents(contents))
- contents->SetUserData(UserDataKey(), new T(contents));
+ contents->SetUserData(UserDataKey(), base::WrapUnique(new T(contents)));
}
// Retrieves the instance of type T that was attached to the specified
« no previous file with comments | « content/browser/websockets/websocket_manager.cc ('k') | content/renderer/internal_document_state_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698