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

Unified Diff: ios/web/public/web_state/web_state_user_data.h

Issue 2853443002: Switch SupportsUserData uses to use unique_ptr. (Closed)
Patch Set: 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: ios/web/public/web_state/web_state_user_data.h
diff --git a/ios/web/public/web_state/web_state_user_data.h b/ios/web/public/web_state/web_state_user_data.h
index 49bb98cba36ddd48d9a75128c10700bc79af9531..0c02bda8a61d694fc3c2b2a153c10efc375037a0 100644
--- a/ios/web/public/web_state/web_state_user_data.h
+++ b/ios/web/public/web_state/web_state_user_data.h
@@ -6,6 +6,7 @@
#define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_USER_DATA_H_
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/supports_user_data.h"
#import "ios/web/public/web_state/web_state.h"
@@ -35,7 +36,7 @@ class WebStateUserData : public base::SupportsUserData::Data {
static void CreateForWebState(WebState* web_state) {
DCHECK(web_state);
if (!FromWebState(web_state))
- web_state->SetUserData(UserDataKey(), new T(web_state));
+ web_state->SetUserData(UserDataKey(), base::WrapUnique(new T(web_state)));
}
// Retrieves the instance of type T that was attached to the specified

Powered by Google App Engine
This is Rietveld 408576698