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

steveblock at google.com steveblock at google.com
Wed Dec 22 11:29:53 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 4873cce8106dd5ba4ab380cf640c5480b090f798
Author: steveblock at google.com <steveblock at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 27 14:12:25 2010 +0000

    2010-07-27  Steve Block  <steveblock at google.com>
    
            Reviewed by Jeremy Orlow.
    
            Client-based Geolocation does not pass enableHighAccuracy option to controller and client
            https://bugs.webkit.org/show_bug.cgi?id=40374
    
            This change passes the enableHighAccuracy request option to the GeolocationController.
            The GeolocationController tracks whether this should be used by the client.
    
            No new tests possible as the mock provider doesn't support this feature.
    
            * page/Geolocation.cpp:
            (WebCore::Geolocation::setIsAllowed):
            (WebCore::Geolocation::startUpdating):
            * page/GeolocationController.cpp:
            (WebCore::GeolocationController::addObserver):
            (WebCore::GeolocationController::removeObserver):
            * page/GeolocationController.h:
            * page/GeolocationControllerClient.h:
    2010-07-27  Steve Block  <steveblock at google.com>
    
            Reviewed by Jeremy Orlow.
    
            Client-based Geolocation does not pass enableHighAccuracy option to controller and client
            https://bugs.webkit.org/show_bug.cgi?id=40374
    
            Stub out setEnableHighAccuracy method for the Mac port.
    
            * WebCoreSupport/WebGeolocationControllerClient.h:
            (WebGeolocationControllerClient::setEnableHighAccuracy):
    2010-07-27  Steve Block  <steveblock at google.com>
    
            Reviewed by Alexey Proskuryakov.
    
            Client-based Geolocation does not pass enableHighAccuracy option to controller and client
            https://bugs.webkit.org/show_bug.cgi?id=40374
    
            Stub out setEnableHighAccuracy method for the Win port.
    
            * WebCoreSupport/WebGeolocationControllerClient.h:
            (WebGeolocationControllerClient::setEnableHighAccuracy):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@64126 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 6c3d000..1304201 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-07-27  Steve Block  <steveblock at google.com>
+
+        Reviewed by Jeremy Orlow.
+
+        Client-based Geolocation does not pass enableHighAccuracy option to controller and client
+        https://bugs.webkit.org/show_bug.cgi?id=40374
+
+        This change passes the enableHighAccuracy request option to the GeolocationController.
+        The GeolocationController tracks whether this should be used by the client.
+
+        No new tests possible as the mock provider doesn't support this feature.
+
+        * page/Geolocation.cpp:
+        (WebCore::Geolocation::setIsAllowed):
+        (WebCore::Geolocation::startUpdating):
+        * page/GeolocationController.cpp:
+        (WebCore::GeolocationController::addObserver):
+        (WebCore::GeolocationController::removeObserver):
+        * page/GeolocationController.h:
+        * page/GeolocationControllerClient.h:
+
 2010-07-27  Ilya Tikhonovsky  <loislo at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index 8532901..20db4bf 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -405,6 +405,8 @@ void Geolocation::setIsAllowed(bool allowed)
         if (isAllowed()) {
             // Permission request was made during the startUpdating process
             m_startRequestPermissionNotifier->startTimerIfNeeded();
+            // The notifier is always ref'ed by m_oneShots or m_watchers.
+            GeoNotifier* notifier = m_startRequestPermissionNotifier.get();
             m_startRequestPermissionNotifier = 0;
 #if ENABLE(CLIENT_BASED_GEOLOCATION)
             if (!m_frame)
@@ -412,7 +414,7 @@ void Geolocation::setIsAllowed(bool allowed)
             Page* page = m_frame->page();
             if (!page)
                 return;
-            page->geolocationController()->addObserver(this);
+            page->geolocationController()->addObserver(this, notifier->m_options->enableHighAccuracy());
 #else
             // TODO: Handle startUpdate() for non-client based implementations using pre-emptive policy
 #endif
@@ -632,8 +634,7 @@ bool Geolocation::startUpdating(GeoNotifier* notifier)
     if (!page)
         return false;
 
-    // FIXME: Pass options to client.
-    page->geolocationController()->addObserver(this);
+    page->geolocationController()->addObserver(this, notifier->m_options->enableHighAccuracy());
     return true;
 #else
     return m_service->startUpdating(notifier->m_options.get());
diff --git a/WebCore/page/GeolocationController.cpp b/WebCore/page/GeolocationController.cpp
index 40f01ba..08932a9 100644
--- a/WebCore/page/GeolocationController.cpp
+++ b/WebCore/page/GeolocationController.cpp
@@ -45,17 +45,21 @@ GeolocationController::~GeolocationController()
         m_client->geolocationDestroyed();
 }
 
-void GeolocationController::addObserver(Geolocation* observer)
+void GeolocationController::addObserver(Geolocation* observer, bool enableHighAccuracy)
 {
     // This may be called multiple times with the same observer, though removeObserver()
     // is called only once with each.
-    if (m_observers.contains(observer))
-        return;
-
     bool wasEmpty = m_observers.isEmpty();
     m_observers.add(observer);
-    if (wasEmpty && m_client)
-        m_client->startUpdating();
+    if (enableHighAccuracy)
+        m_highAccuracyObservers.add(observer);
+
+    if (m_client) {        
+        if (enableHighAccuracy)
+            m_client->setEnableHighAccuracy(true);
+        if (wasEmpty)
+            m_client->startUpdating();
+    }
 }
 
 void GeolocationController::removeObserver(Geolocation* observer)
@@ -64,8 +68,14 @@ void GeolocationController::removeObserver(Geolocation* observer)
         return;
 
     m_observers.remove(observer);
-    if (m_observers.isEmpty() && m_client)
-        m_client->stopUpdating();
+    m_highAccuracyObservers.remove(observer);
+
+    if (m_client) {
+        if (m_observers.isEmpty())
+            m_client->stopUpdating();
+        else if (m_highAccuracyObservers.isEmpty())
+            m_client->setEnableHighAccuracy(false);
+    }
 }
 
 void GeolocationController::positionChanged(GeolocationPosition* position)
diff --git a/WebCore/page/GeolocationController.h b/WebCore/page/GeolocationController.h
index bb36101..57f6e32 100644
--- a/WebCore/page/GeolocationController.h
+++ b/WebCore/page/GeolocationController.h
@@ -45,7 +45,7 @@ public:
     GeolocationController(Page*, GeolocationControllerClient*);
     ~GeolocationController();
 
-    void addObserver(Geolocation*);
+    void addObserver(Geolocation*, bool enableHighAccuracy);
     void removeObserver(Geolocation*);
 
     void positionChanged(GeolocationPosition*);
@@ -58,7 +58,10 @@ private:
     GeolocationControllerClient* m_client;
 
     RefPtr<GeolocationPosition> m_lastPosition;
-    HashSet<RefPtr<Geolocation> > m_observers;
+    typedef HashSet<RefPtr<Geolocation> > ObserversSet;
+    // All observers; both those requesting high accuracy and those not.
+    ObserversSet m_observers;
+    ObserversSet m_highAccuracyObservers;
 };
 
 } // namespace WebCore
diff --git a/WebCore/page/GeolocationControllerClient.h b/WebCore/page/GeolocationControllerClient.h
index cc0e1e4..4648cf8 100644
--- a/WebCore/page/GeolocationControllerClient.h
+++ b/WebCore/page/GeolocationControllerClient.h
@@ -36,6 +36,11 @@ public:
 
     virtual void startUpdating() = 0;
     virtual void stopUpdating() = 0;
+    // FIXME: The V2 Geolocation specification proposes that this property is
+    // renamed. See http://www.w3.org/2008/geolocation/track/issues/6
+    // We should update WebKit to reflect this if and when the V2 specification
+    // is published.
+    virtual void setEnableHighAccuracy(bool) = 0;
     virtual GeolocationPosition* lastPosition() = 0;
 
 protected:
diff --git a/WebKit/mac/ChangeLog b/WebKit/mac/ChangeLog
index 7bd6b47..3477b17 100644
--- a/WebKit/mac/ChangeLog
+++ b/WebKit/mac/ChangeLog
@@ -1,3 +1,15 @@
+2010-07-27  Steve Block  <steveblock at google.com>
+
+        Reviewed by Jeremy Orlow.
+
+        Client-based Geolocation does not pass enableHighAccuracy option to controller and client
+        https://bugs.webkit.org/show_bug.cgi?id=40374
+
+        Stub out setEnableHighAccuracy method for the Mac port.
+
+        * WebCoreSupport/WebGeolocationControllerClient.h:
+        (WebGeolocationControllerClient::setEnableHighAccuracy):
+
 2010-07-22  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebKit/mac/WebCoreSupport/WebGeolocationControllerClient.h b/WebKit/mac/WebCoreSupport/WebGeolocationControllerClient.h
index 3965210..34d6a29 100644
--- a/WebKit/mac/WebCoreSupport/WebGeolocationControllerClient.h
+++ b/WebKit/mac/WebCoreSupport/WebGeolocationControllerClient.h
@@ -39,6 +39,7 @@ public:
     void geolocationDestroyed();
     void startUpdating();
     void stopUpdating();
+    void setEnableHighAccuracy(bool) { }
 
     WebCore::GeolocationPosition* lastPosition();
 
diff --git a/WebKit/win/ChangeLog b/WebKit/win/ChangeLog
index cec41c7..8670e26 100644
--- a/WebKit/win/ChangeLog
+++ b/WebKit/win/ChangeLog
@@ -1,3 +1,15 @@
+2010-07-27  Steve Block  <steveblock at google.com>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Client-based Geolocation does not pass enableHighAccuracy option to controller and client
+        https://bugs.webkit.org/show_bug.cgi?id=40374
+
+        Stub out setEnableHighAccuracy method for the Win port.
+
+        * WebCoreSupport/WebGeolocationControllerClient.h:
+        (WebGeolocationControllerClient::setEnableHighAccuracy):
+
 2010-07-22  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Maciej Stachowiak.
diff --git a/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h b/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h
index ec0bef7..ed73454 100644
--- a/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h
+++ b/WebKit/win/WebCoreSupport/WebGeolocationControllerClient.h
@@ -42,6 +42,7 @@ public:
     virtual void geolocationDestroyed();
     virtual void startUpdating();
     virtual void stopUpdating();
+    virtual void setEnableHighAccuracy(bool) { }
     virtual WebCore::GeolocationPosition* lastPosition();
 
 private:

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list