summaryrefslogtreecommitdiffstats
path: root/WebCore/page/Geolocation.cpp
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2009-10-13 11:46:22 +0100
committerSteve Block <steveblock@google.com>2009-10-20 00:45:08 +0100
commit8e465e3d03d149943a3e592c3d2af395d50917eb (patch)
treef6f5ac0b6a2d0387250dbf9c06950cd028ef1637 /WebCore/page/Geolocation.cpp
parent74e159b4f10c313c2347259bd2af0a9f81eb40c6 (diff)
downloadexternal_webkit-8e465e3d03d149943a3e592c3d2af395d50917eb.zip
external_webkit-8e465e3d03d149943a3e592c3d2af395d50917eb.tar.gz
external_webkit-8e465e3d03d149943a3e592c3d2af395d50917eb.tar.bz2
Merge webkit.org at R49305 : Update Geolocation to use new EventListener methods.
See http://trac.webkit.org/changeset/48402, http://trac.webkit.org/changeset/48701 and http://trac.webkit.org/changeset/48767 Change-Id: Id32d80c62f71c98c6677d7cbe11ee2ffbdaeeff1
Diffstat (limited to 'WebCore/page/Geolocation.cpp')
-rw-r--r--WebCore/page/Geolocation.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index bf877e6..fd38614 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -241,7 +241,8 @@ String CachedPositionManager::s_databaseFile;
Geolocation::Geolocation(Frame* frame)
- : m_frame(frame)
+ : EventListener(GeolocationEventListenerType)
+ , m_frame(frame)
, m_service(GeolocationService::create(this))
, m_allowGeolocation(Unknown)
, m_shouldClearCache(false)
@@ -563,14 +564,22 @@ void Geolocation::geolocationServiceErrorOccurred(GeolocationService* service)
handleError(service->lastError());
}
-void Geolocation::handleEvent(Event* event, bool)
+bool Geolocation::operator==(const EventListener& listener)
{
- ASSERT_UNUSED(event, event->type() == eventTypes().unloadEvent);
- // Cancel any ongoing requests on page unload. This is required to release
- // references to JS callbacks in the page, to allow the frame to be cleaned up
- // by WebKit.
- m_oneShots.clear();
- m_watchers.clear();
+ if (listener.type() != GeolocationEventListenerType)
+ return false;
+ const Geolocation* geolocation = static_cast<const Geolocation*>(&listener);
+ return m_frame == geolocation->m_frame;
+}
+
+void Geolocation::handleEvent(ScriptExecutionContext*, Event* event)
+{
+ ASSERT_UNUSED(event, event->type() == eventTypes().unloadEvent);
+ // Cancel any ongoing requests on page unload. This is required to release
+ // references to JS callbacks in the page, to allow the frame to be cleaned up
+ // by WebKit.
+ m_oneShots.clear();
+ m_watchers.clear();
}
void Geolocation::setDatabasePath(String databasePath)