Title: [97594] trunk/Source/WebCore
Revision
97594
Author
[email protected]
Date
2011-10-17 02:02:19 -0700 (Mon, 17 Oct 2011)

Log Message

Avoid leaking document when leaving google.com due to geolocation
permission request.
https://bugs.webkit.org/show_bug.cgi?id=58027

Reviewed by Kenneth Rohde Christiansen.

* page/Geolocation.cpp:
(WebCore::Geolocation::Watchers::find): added
(WebCore::Geolocation::reset): cleared all pending notifiers.
(WebCore::Geolocation::clearWatch): removed from pending notifier set.
* page/Geolocation.h:
(WebCore::Geolocation::Watchers::find): added

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (97593 => 97594)


--- trunk/Source/WebCore/ChangeLog	2011-10-17 09:01:14 UTC (rev 97593)
+++ trunk/Source/WebCore/ChangeLog	2011-10-17 09:02:19 UTC (rev 97594)
@@ -1,3 +1,18 @@
+2011-10-17  Satish Sampath  <[email protected]>
+
+        Avoid leaking document when leaving google.com due to geolocation
+        permission request.
+        https://bugs.webkit.org/show_bug.cgi?id=58027
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * page/Geolocation.cpp:
+        (WebCore::Geolocation::Watchers::find): added
+        (WebCore::Geolocation::reset): cleared all pending notifiers.
+        (WebCore::Geolocation::clearWatch): removed from pending notifier set.
+        * page/Geolocation.h:
+        (WebCore::Geolocation::Watchers::find): added
+
 2011-10-17  Andrei Lavreniyuk  <[email protected]>
 
         Fix clang WebKitGTK+ build.

Modified: trunk/Source/WebCore/page/Geolocation.cpp (97593 => 97594)


--- trunk/Source/WebCore/page/Geolocation.cpp	2011-10-17 09:01:14 UTC (rev 97593)
+++ trunk/Source/WebCore/page/Geolocation.cpp	2011-10-17 09:02:19 UTC (rev 97594)
@@ -175,6 +175,15 @@
     m_notifierToIdMap.set(notifier.release(), id);
 }
 
+Geolocation::GeoNotifier* Geolocation::Watchers::find(int id)
+{
+    ASSERT(id > 0);
+    IdToNotifierMap::iterator iter = m_idToNotifierMap.find(id);
+    if (iter == m_idToNotifierMap.end())
+        return 0;
+    return iter->second.get();
+}
+
 void Geolocation::Watchers::remove(int id)
 {
     ASSERT(id > 0);
@@ -253,6 +262,9 @@
     m_allowGeolocation = Unknown;
     cancelAllRequests();
     stopUpdating();
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
+    m_pendingForPermissionNotifiers.clear();
+#endif
 }
 
 void Geolocation::disconnectFrame()
@@ -418,6 +430,10 @@
     if (watchId < firstAvailableWatchId)
         return;
 
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
+    if (GeoNotifier* notifier = m_watchers.find(watchId))
+        m_pendingForPermissionNotifiers.remove(notifier);
+#endif
     m_watchers.remove(watchId);
     
     if (!hasListeners())

Modified: trunk/Source/WebCore/page/Geolocation.h (97593 => 97594)


--- trunk/Source/WebCore/page/Geolocation.h	2011-10-17 09:01:14 UTC (rev 97593)
+++ trunk/Source/WebCore/page/Geolocation.h	2011-10-17 09:02:19 UTC (rev 97594)
@@ -113,6 +113,7 @@
     class Watchers {
     public:
         void set(int id, PassRefPtr<GeoNotifier>);
+        GeoNotifier* find(int id);
         void remove(int id);
         void remove(GeoNotifier*);
         bool contains(GeoNotifier*) const;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to