diff options
Diffstat (limited to 'WebCore/page/Geolocation.h')
-rw-r--r-- | WebCore/page/Geolocation.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h index 306214b..d53c827 100644 --- a/WebCore/page/Geolocation.h +++ b/WebCore/page/Geolocation.h @@ -128,6 +128,23 @@ private: NotifierToIdMap m_notifierToIdMap; }; + class PositionCacheWrapper { + public: + PositionCacheWrapper() + : m_cache(GeolocationPositionCache::instance()) + { + m_cache->addUser(); + } + ~PositionCacheWrapper() + { + m_cache->removeUser(); + } + void setCachedPosition(Geoposition* cachedPosition) { m_cache->setCachedPosition(cachedPosition); } + Geoposition* cachedPosition() { return m_cache->cachedPosition(); } + private: + GeolocationPositionCache* m_cache; + }; + bool hasListeners() const { return !m_oneShots.isEmpty() || !m_watchers.isEmpty(); } void sendError(GeoNotifierVector&, PositionError*); @@ -190,7 +207,7 @@ private: } m_allowGeolocation; #if ENABLE(GEOLOCATION) - OwnPtr<GeolocationPositionCache> m_positionCache; + PositionCacheWrapper m_positionCache; #endif GeoNotifierSet m_requestsAwaitingCachedPosition; }; |