[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

commit-queue at webkit.org commit-queue at webkit.org
Wed Dec 22 16:11:36 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 37b13017c3d4427027e2c9ea7f89ebf51759aef9
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 19 15:06:41 2010 +0000

    2010-11-19  John Knottenbelt  <jknotten at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            Reentrant Geolocation tests crash with an assertion.
            https://bugs.webkit.org/show_bug.cgi?id=39908
    
            PositionErrors should not be sent to Geolocation watches or one
            shots that are due to receive a valid cached position. Re-enable
            fast/dom/Geolocation/maximum-age.html on Mac WebKit.
    
            * platform/mac/Skipped:
    2010-11-19  John Knottenbelt  <jknotten at chromium.org>
    
            Reviewed by Jeremy Orlow.
    
            Reentrant Geolocation tests crash with an assertion.
            https://bugs.webkit.org/show_bug.cgi?id=39908
    
            PositionErrors should not be sent to Geolocation watches or one shots
            that are due to receive a valid cached position.
    
            Test: fast/dom/Geolocation/maximum-age.html
    
            * page/Geolocation.cpp:
            (WebCore::Geolocation::sendError):
            (WebCore::Geolocation::copyCachedNotifiers):
            (WebCore::Geolocation::handleError):
            * page/Geolocation.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72396 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 92974fa..eba3e92 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-19  John Knottenbelt  <jknotten at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Reentrant Geolocation tests crash with an assertion.
+        https://bugs.webkit.org/show_bug.cgi?id=39908
+
+        PositionErrors should not be sent to Geolocation watches or one
+        shots that are due to receive a valid cached position. Re-enable
+        fast/dom/Geolocation/maximum-age.html on Mac WebKit.
+
+        * platform/mac/Skipped:
+
 2010-11-19  Anton Muhin  <antonm at chromium.org>
 
         Not reviewed, next batch of Chromium suppressions for layout test failures after
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index 25ed52d..5a72d3b 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -181,9 +181,6 @@ fast/dom/Window/window-properties-device-orientation.html
 fast/dom/HTMLLinkElement/prefetch.html
 http/tests/misc/prefetch-purpose.html
 
-# https://bugs.webkit.org/show_bug.cgi?id=39908
-fast/dom/Geolocation/maximum-age.html
-
 # Filenames aren't filtered out from edit drags yet, see https://bugs.wekit.org/show_bug.cgi?id=38826
 editing/pasteboard/file-drag-to-editable.html
 
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f3bd953..fd2aa1a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-11-19  John Knottenbelt  <jknotten at chromium.org>
+
+        Reviewed by Jeremy Orlow.
+
+        Reentrant Geolocation tests crash with an assertion.
+        https://bugs.webkit.org/show_bug.cgi?id=39908
+
+        PositionErrors should not be sent to Geolocation watches or one shots
+        that are due to receive a valid cached position.
+
+        Test: fast/dom/Geolocation/maximum-age.html
+
+        * page/Geolocation.cpp:
+        (WebCore::Geolocation::sendError):
+        (WebCore::Geolocation::copyCachedNotifiers):
+        (WebCore::Geolocation::handleError):
+        * page/Geolocation.h:
+
 2010-11-19  Sam Magnuson  <smagnuso at gmail.com>
 
         Reviewed by Laszlo Gombos.
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index 7686ca9..9135049 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -522,6 +522,30 @@ void Geolocation::cancelAllRequests()
     cancelRequests(copy);
 }
 
+void Geolocation::extractNotifiersWithCachedPosition(GeoNotifierVector& notifiers, GeoNotifierVector* cached)
+{
+    GeoNotifierVector nonCached;
+    GeoNotifierVector::iterator end = notifiers.end();
+    for (GeoNotifierVector::const_iterator it = notifiers.begin(); it != end; ++it) {
+        GeoNotifier* notifier = it->get();
+        if (notifier->m_useCachedPosition) {
+            if (cached)
+                cached->append(notifier);
+        } else
+            nonCached.append(notifier);
+    }
+    notifiers.swap(nonCached);
+}
+
+void Geolocation::copyToSet(const GeoNotifierVector& src, GeoNotifierSet& dest)
+{
+     GeoNotifierVector::const_iterator end = src.end();
+     for (GeoNotifierVector::const_iterator it = src.begin(); it != end; ++it) {
+         GeoNotifier* notifier = it->get();
+         dest.add(notifier);
+     }
+}
+
 void Geolocation::handleError(PositionError* error)
 {
     ASSERT(error);
@@ -535,15 +559,27 @@ void Geolocation::handleError(PositionError* error)
     // Clear the lists before we make the callbacks, to avoid clearing notifiers
     // added by calls to Geolocation methods from the callbacks, and to prevent
     // further callbacks to these notifiers.
+    GeoNotifierVector oneShotsWithCachedPosition;
     m_oneShots.clear();
     if (error->isFatal())
         m_watchers.clear();
+    else {
+        // Don't send non-fatal errors to notifiers due to receive a cached position.
+        extractNotifiersWithCachedPosition(oneShotsCopy, &oneShotsWithCachedPosition);
+        extractNotifiersWithCachedPosition(watchersCopy, 0);
+    }
 
     sendError(oneShotsCopy, error);
     sendError(watchersCopy, error);
 
+    // hasListeners() doesn't distinguish between notifiers due to receive a
+    // cached position and those requiring a fresh position. Perform the check
+    // before restoring the notifiers below.
     if (!hasListeners())
         stopUpdating();
+
+    // Maintain a reference to the cached notifiers until their timer fires.
+    copyToSet(oneShotsWithCachedPosition, m_oneShots);
 }
 
 void Geolocation::requestPermission()
diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h
index a3a79f9..306214b 100644
--- a/WebCore/page/Geolocation.h
+++ b/WebCore/page/Geolocation.h
@@ -133,6 +133,9 @@ private:
     void sendError(GeoNotifierVector&, PositionError*);
     void sendPosition(GeoNotifierVector&, Geoposition*);
 
+    static void extractNotifiersWithCachedPosition(GeoNotifierVector& notifiers, GeoNotifierVector* cached);
+    static void copyToSet(const GeoNotifierVector&, GeoNotifierSet&);
+
     static void stopTimer(GeoNotifierVector&);
     void stopTimersForOneShots();
     void stopTimersForWatchers();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list