diff options
author | Steve Block <steveblock@google.com> | 2009-10-13 11:46:22 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-10-20 00:45:08 +0100 |
commit | 8e465e3d03d149943a3e592c3d2af395d50917eb (patch) | |
tree | f6f5ac0b6a2d0387250dbf9c06950cd028ef1637 | |
parent | 74e159b4f10c313c2347259bd2af0a9f81eb40c6 (diff) | |
download | external_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
-rw-r--r-- | WebCore/dom/EventListener.h | 3 | ||||
-rw-r--r-- | WebCore/page/Geolocation.cpp | 25 | ||||
-rw-r--r-- | WebCore/page/Geolocation.h | 3 |
3 files changed, 21 insertions, 10 deletions
diff --git a/WebCore/dom/EventListener.h b/WebCore/dom/EventListener.h index f834b31..da9d179 100644 --- a/WebCore/dom/EventListener.h +++ b/WebCore/dom/EventListener.h @@ -41,7 +41,8 @@ namespace WebCore { InspectorDOMAgentType, InspectorDOMStorageResourceType, ObjCEventListenerType, - ConditionEventListenerType }; + ConditionEventListenerType, + GeolocationEventListenerType }; virtual ~EventListener() { } virtual bool operator==(const EventListener&) = 0; 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) diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h index 9b3b43f..401189b 100644 --- a/WebCore/page/Geolocation.h +++ b/WebCore/page/Geolocation.h @@ -120,7 +120,8 @@ private: virtual void geolocationServiceErrorOccurred(GeolocationService*); // EventListener - virtual void handleEvent(Event*, bool isWindowEvent); + virtual bool operator==(const EventListener&); + virtual void handleEvent(ScriptExecutionContext*, Event*); void fatalErrorOccurred(GeoNotifier* notifier); void requestTimedOut(GeoNotifier* notifier); |