[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.19-706-ge5415e9

sfalken at apple.com sfalken at apple.com
Thu Feb 4 21:32:44 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit 626ceb8c21cb782269687e32f486c13e511c082a
Author: sfalken at apple.com <sfalken at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jan 29 22:08:05 2010 +0000

    2010-01-29  Steve Falkenburg  <sfalken at apple.com>
    
            Reviewed by Darin Adler.
    
            Client-based Geolocation starts updating before getting consent from the user
            https://bugs.webkit.org/show_bug.cgi?id=34343
    
            * page/Geolocation.cpp:
            (WebCore::Geolocation::startRequest): Pass notifier instead of options to startUpdating.
            (WebCore::Geolocation::setIsAllowed): Add the observer or notify of error for deferred startUpdating.
            (WebCore::Geolocation::startUpdating): Pass notifier instead of options, since we may need to call it if we fail to get user consent.
            Defer adding the observer if we don't yet have user consent, since this could kick off
            server-based wifi Geolocation requests.
            * page/Geolocation.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54079 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index a4388b3..9fdb61e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-01-29  Steve Falkenburg  <sfalken at apple.com>
+
+        Reviewed by Darin Adler.
+
+        Client-based Geolocation starts updating before getting consent from the user
+        https://bugs.webkit.org/show_bug.cgi?id=34343
+
+        * page/Geolocation.cpp:
+        (WebCore::Geolocation::startRequest): Pass notifier instead of options to startUpdating.
+        (WebCore::Geolocation::setIsAllowed): Add the observer or notify of error for deferred startUpdating.
+        (WebCore::Geolocation::startUpdating): Pass notifier instead of options, since we may need to call it if we fail to get user consent.
+        Defer adding the observer if we don't yet have user consent, since this could kick off
+        server-based wifi Geolocation requests.
+        * page/Geolocation.h:
+
 2010-01-28  Jon Honeycutt  <jhoneycutt at apple.com>
 
         MSAA: Crash when posting a notification for a detached object
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index a267b5f..f6b52fd 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -245,7 +245,7 @@ PassRefPtr<Geolocation::GeoNotifier> Geolocation::startRequest(PassRefPtr<Positi
     if (isDenied())
         notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
     else {
-        if (notifier->hasZeroTimeout() || startUpdating(notifier->m_options.get()))
+        if (notifier->hasZeroTimeout() || startUpdating(notifier.get()))
             notifier->startTimerIfNeeded();
         else
             notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, "Failed to start Geolocation service"));
@@ -301,6 +301,26 @@ void Geolocation::setIsAllowed(bool allowed)
 {
     m_allowGeolocation = allowed ? Yes : No;
     
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+    if (m_startRequestPermissionNotifier) {
+        if (isAllowed()) {
+            // Permission request was made during the startUpdating process
+            m_startRequestPermissionNotifier = 0;
+            if (!m_frame)
+                return;
+            Page* page = m_frame->page();
+            if (!page)
+                return;
+            page->geolocationController()->addObserver(this);
+        } else {
+            m_startRequestPermissionNotifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
+            m_oneShots.add(m_startRequestPermissionNotifier);
+            m_startRequestPermissionNotifier = 0;
+        }
+        return;
+    }
+#endif
+    
     if (isAllowed())
         makeSuccessCallbacks();
     else {
@@ -479,12 +499,17 @@ void Geolocation::geolocationServiceErrorOccurred(GeolocationService* service)
 
 #endif
 
-bool Geolocation::startUpdating(PositionOptions* options)
+bool Geolocation::startUpdating(GeoNotifier* notifier)
 {
 #if ENABLE(CLIENT_BASED_GEOLOCATION)
     // FIXME: Pass options to client.
-    UNUSED_PARAM(options);
 
+    if (!isAllowed()) {
+        m_startRequestPermissionNotifier = notifier;
+        requestPermission();
+        return true;
+    }
+    
     if (!m_frame)
         return false;
 
@@ -495,7 +520,7 @@ bool Geolocation::startUpdating(PositionOptions* options)
     page->geolocationController()->addObserver(this);
     return true;
 #else
-    return m_service->startUpdating(options);
+    return m_service->startUpdating(notifier->options);
 #endif
 }
 
diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h
index a5381d8..dd8c0b8 100644
--- a/WebCore/page/Geolocation.h
+++ b/WebCore/page/Geolocation.h
@@ -138,7 +138,7 @@ private:
 
     void requestPermission();
 
-    bool startUpdating(PositionOptions*);
+    bool startUpdating(GeoNotifier*);
     void stopUpdating();
 
 #if !ENABLE(CLIENT_BASED_GEOLOCATION)
@@ -159,6 +159,8 @@ private:
     Frame* m_frame;
 #if !ENABLE(CLIENT_BASED_GEOLOCATION)
     OwnPtr<GeolocationService> m_service;
+#else
+    RefPtr<GeoNotifier> m_startRequestPermissionNotifier;
 #endif
     RefPtr<Geoposition> m_lastPosition;
     RefPtr<Geoposition> m_currentPosition;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list