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

Unified Diff: Source/modules/donottrack/NavigatorDoNotTrack.cpp

Issue 171333003: Pass implementation object to supplemental classes by reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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: Source/modules/donottrack/NavigatorDoNotTrack.cpp
diff --git a/Source/modules/donottrack/NavigatorDoNotTrack.cpp b/Source/modules/donottrack/NavigatorDoNotTrack.cpp
index 5358b2c93a8768056b2cce2eb724d53891cd339e..f8869dd31e0f20e5219d5e54a2812c066b3de9c7 100644
--- a/Source/modules/donottrack/NavigatorDoNotTrack.cpp
+++ b/Source/modules/donottrack/NavigatorDoNotTrack.cpp
@@ -51,19 +51,19 @@ const char* NavigatorDoNotTrack::supplementName()
return "NavigatorDoNotTrack";
}
-NavigatorDoNotTrack* NavigatorDoNotTrack::from(Navigator* navigator)
+NavigatorDoNotTrack& NavigatorDoNotTrack::from(Navigator& navigator)
{
NavigatorDoNotTrack* supplement = static_cast<NavigatorDoNotTrack*>(Supplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
- supplement = new NavigatorDoNotTrack(navigator->frame());
+ supplement = new NavigatorDoNotTrack(navigator.frame());
provideTo(navigator, supplementName(), adoptPtr(supplement));
}
- return supplement;
+ return *supplement;
}
-String NavigatorDoNotTrack::doNotTrack(Navigator* navigator)
+String NavigatorDoNotTrack::doNotTrack(Navigator& navigator)
{
- return NavigatorDoNotTrack::from(navigator)->doNotTrack();
+ return NavigatorDoNotTrack::from(navigator).doNotTrack();
}
String NavigatorDoNotTrack::doNotTrack()

Powered by Google App Engine
This is Rietveld 408576698