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

Unified Diff: content/test/web_contents_observer_sanity_checker.cc

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/test/web_contents_observer_sanity_checker.h ('k') | gin/modules/module_registry.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/test/web_contents_observer_sanity_checker.cc
diff --git a/content/test/web_contents_observer_sanity_checker.cc b/content/test/web_contents_observer_sanity_checker.cc
index eedbb8909b13d36e920c1661630ae08ec19da275..0389fbf07ed758ca94d282c61a4f1e696ed46288 100644
--- a/content/test/web_contents_observer_sanity_checker.cc
+++ b/content/test/web_contents_observer_sanity_checker.cc
@@ -4,6 +4,7 @@
#include "content/test/web_contents_observer_sanity_checker.h"
+#include "base/memory/ptr_util.h"
#include "base/strings/stringprintf.h"
#include "build/build_config.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
@@ -35,8 +36,9 @@ GlobalRoutingID GetRoutingPair(RenderFrameHost* host) {
void WebContentsObserverSanityChecker::Enable(WebContents* web_contents) {
if (web_contents->GetUserData(&kWebContentsObserverSanityCheckerKey))
return;
- web_contents->SetUserData(&kWebContentsObserverSanityCheckerKey,
- new WebContentsObserverSanityChecker(web_contents));
+ web_contents->SetUserData(
+ &kWebContentsObserverSanityCheckerKey,
+ base::WrapUnique(new WebContentsObserverSanityChecker(web_contents)));
}
void WebContentsObserverSanityChecker::RenderFrameCreated(
« no previous file with comments | « content/test/web_contents_observer_sanity_checker.h ('k') | gin/modules/module_registry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698