summaryrefslogtreecommitdiffstats
path: root/chromium/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.cpp')
-rw-r--r--chromium/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/chromium/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.cpp b/chromium/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.cpp
index 72429741aa9..b30bc7480e8 100644
--- a/chromium/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.cpp
+++ b/chromium/third_party/WebKit/Source/modules/geolocation/NavigatorGeolocation.cpp
@@ -24,13 +24,13 @@
#include "modules/geolocation/NavigatorGeolocation.h"
#include "core/dom/Document.h"
-#include "core/frame/Frame.h"
+#include "core/frame/LocalFrame.h"
#include "core/frame/Navigator.h"
#include "modules/geolocation/Geolocation.h"
namespace WebCore {
-NavigatorGeolocation::NavigatorGeolocation(Frame* frame)
+NavigatorGeolocation::NavigatorGeolocation(LocalFrame* frame)
: DOMWindowProperty(frame)
{
}
@@ -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()));
+ NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(WillBeHeapSupplement<Navigator>::from(navigator, supplementName()));
if (!supplement) {
- supplement = new NavigatorGeolocation(navigator->frame());
- provideTo(navigator, supplementName(), adoptPtr(supplement));
+ supplement = new NavigatorGeolocation(navigator.frame());
+ provideTo(navigator, supplementName(), adoptPtrWillBeNoop(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
@@ -66,4 +66,10 @@ Geolocation* NavigatorGeolocation::geolocation() const
return m_geolocation.get();
}
+void NavigatorGeolocation::trace(Visitor* visitor)
+{
+ visitor->trace(m_geolocation);
+ WillBeHeapSupplement<Navigator>::trace(visitor);
+}
+
} // namespace WebCore