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

Unified Diff: Source/modules/geolocation/NavigatorGeolocation.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/geolocation/NavigatorGeolocation.cpp
diff --git a/Source/modules/geolocation/NavigatorGeolocation.cpp b/Source/modules/geolocation/NavigatorGeolocation.cpp
index 72429741aa9aa2e3a94e1fd45fb6b6a5bda0a225..cdb90599ab3fce6433f3419d31b2a9eafb24d635 100644
--- a/Source/modules/geolocation/NavigatorGeolocation.cpp
+++ b/Source/modules/geolocation/NavigatorGeolocation.cpp
@@ -44,19 +44,19 @@ const char* NavigatorGeolocation::supplementName()
return "NavigatorGeolocation";
}
-NavigatorGeolocation* NavigatorGeolocation::from(Navigator* navigator)
+NavigatorGeolocation& NavigatorGeolocation::from(Navigator& navigator)
{
NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
- supplement = new NavigatorGeolocation(navigator->frame());
+ supplement = new NavigatorGeolocation(navigator.frame());
provideTo(navigator, supplementName(), adoptPtr(supplement));
}
- return supplement;
+ return *supplement;
}
-Geolocation* NavigatorGeolocation::geolocation(Navigator* navigator)
+Geolocation* NavigatorGeolocation::geolocation(Navigator& navigator)
{
- return NavigatorGeolocation::from(navigator)->geolocation();
+ return NavigatorGeolocation::from(navigator).geolocation();
}
Geolocation* NavigatorGeolocation::geolocation() const

Powered by Google App Engine
This is Rietveld 408576698