summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-02-01 13:28:26 +0000
committerSteve Block <steveblock@google.com>2010-02-01 13:39:57 +0000
commite8494e25fdde6a0c52c612fe28eddca35c0e5ce8 (patch)
tree051bc35f9138a0bba319718b47973ca8e7638f06
parentdb42c078ffb0f6a679e3853cb4ebb39e09c1f815 (diff)
downloadexternal_webkit-e8494e25fdde6a0c52c612fe28eddca35c0e5ce8.zip
external_webkit-e8494e25fdde6a0c52c612fe28eddca35c0e5ce8.tar.gz
external_webkit-e8494e25fdde6a0c52c612fe28eddca35c0e5ce8.tar.bz2
Cherry-pick WebKit change 54096 for client-based Geolocation
See http://trac.webkit.org/changeset/54096 This is required to bring Geolocation up-to-date with webkit.org to allow upstreaming of maximumAge code. Change-Id: Ic4f06aa2cf4ef8655bd05cd30746d9548f7e0d33
-rw-r--r--WebCore/ChangeLog11
-rw-r--r--WebCore/page/Geolocation.cpp11
2 files changed, 19 insertions, 3 deletions
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c6906ab..4156ead 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,5 +1,16 @@
2010-01-29 Steve Falkenburg <sfalken@apple.com>
+ Reviewed by Darin Adler.
+
+ Timeout for client-based Geolocation shouldn't start until user gives consent
+ https://bugs.webkit.org/show_bug.cgi?id=34352
+
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::startRequest): Don't start timer if we're blocked on user consent.
+ (WebCore::Geolocation::setIsAllowed): Start timer after user gives consent.
+
+2010-01-29 Steve Falkenburg <sfalken@apple.com>
+
Build fix.
* page/Geolocation.cpp:
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index 89897e1..237ceaf 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -283,9 +283,13 @@ PassRefPtr<Geolocation::GeoNotifier> Geolocation::startRequest(PassRefPtr<Positi
if (haveSuitableCachedPosition(notifier->m_options.get()))
notifier->setUseCachedPosition();
else {
- if (notifier->hasZeroTimeout() || startUpdating(notifier.get()))
- notifier->startTimerIfNeeded();
- else
+ if (notifier->hasZeroTimeout() || startUpdating(notifier.get())) {
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+ // Only start timer if we're not waiting for user permission.
+ if (!m_startRequestPermissionNotifier)
+#endif
+ notifier->startTimerIfNeeded();
+ } else
notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, "Failed to start Geolocation service"));
}
}
@@ -407,6 +411,7 @@ void Geolocation::setIsAllowed(bool allowed)
if (m_startRequestPermissionNotifier) {
if (isAllowed()) {
// Permission request was made during the startUpdating process
+ m_startRequestPermissionNotifier->startTimerIfNeeded();
m_startRequestPermissionNotifier = 0;
if (!m_frame)
return;