Index: components/zoom/zoom_event_manager.cc |
diff --git a/components/zoom/zoom_event_manager.cc b/components/zoom/zoom_event_manager.cc |
index c1fd61cdd7315b9a55fa8dc24d51cc96f4469221..cdb88db6401f6eb2a60e92ea7fb53ee58c493872 100644 |
--- a/components/zoom/zoom_event_manager.cc |
+++ b/components/zoom/zoom_event_manager.cc |
@@ -4,6 +4,7 @@ |
#include "components/zoom/zoom_event_manager.h" |
+#include "base/memory/ptr_util.h" |
#include "components/zoom/zoom_event_manager_observer.h" |
#include "content/public/browser/browser_context.h" |
@@ -15,8 +16,10 @@ namespace zoom { |
ZoomEventManager* ZoomEventManager::GetForBrowserContext( |
content::BrowserContext* context) { |
- if (!context->GetUserData(kBrowserZoomEventManager)) |
- context->SetUserData(kBrowserZoomEventManager, new ZoomEventManager); |
+ if (!context->GetUserData(kBrowserZoomEventManager)) { |
+ context->SetUserData(kBrowserZoomEventManager, |
+ base::MakeUnique<ZoomEventManager>()); |
+ } |
return static_cast<ZoomEventManager*>( |
context->GetUserData(kBrowserZoomEventManager)); |
} |