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 |