[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 11:22:02 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit c801b03a36fd29157b3c61777609686271d54b8a
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Jul 20 18:59:10 2010 +0000
2010-07-20 Mahesh Kulkarni <mahesh.kulkarni at nokia.com>
Reviewed by Steve Block.
Need to be able to configure Geolocation policy regarding user permissions
https://bugs.webkit.org/show_bug.cgi?id=42068
If CLIENT_BASED_GEOLOCATION is enabled, enable preemtive permission policy
by default
* wtf/Platform.h:
2010-07-20 Mahesh Kulkarni <mahesh.kulkarni at nokia.com>
Reviewed by Steve Block.
Need to be able to configure Geolocation policy regarding user permissions
https://bugs.webkit.org/show_bug.cgi?id=42068
Introducing new USE() flag PREEMPT_GEOLOCATION_PREMISSION using which
acquires user permission first before starting location service
This change does not introduce any change in behavior for any platform. So there are no new tests
added.
* WebCore.pro:
* page/Geolocation.cpp:
(WebCore::Geolocation::startRequest):
(WebCore::Geolocation::setIsAllowed):
(WebCore::Geolocation::startUpdating):
* page/Geolocation.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63761 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 185ad77..8b7b551 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-07-20 Mahesh Kulkarni <mahesh.kulkarni at nokia.com>
+
+ Reviewed by Steve Block.
+
+ Need to be able to configure Geolocation policy regarding user permissions
+ https://bugs.webkit.org/show_bug.cgi?id=42068
+
+ If CLIENT_BASED_GEOLOCATION is enabled, enable preemtive permission policy
+ by default
+
+ * wtf/Platform.h:
+
2010-07-20 Sheriff Bot <webkit.review.bot at gmail.com>
Unreviewed, rolling out r63742.
diff --git a/JavaScriptCore/wtf/Platform.h b/JavaScriptCore/wtf/Platform.h
index c62a274..c6a991f 100644
--- a/JavaScriptCore/wtf/Platform.h
+++ b/JavaScriptCore/wtf/Platform.h
@@ -1116,4 +1116,11 @@ on MinGW. See https://bugs.webkit.org/show_bug.cgi?id=29268 */
#define WTF_USE_PLATFORM_STRATEGIES 1
#endif
+/* Geolocation request policy. pre-emptive policy is to acquire user permission before acquiring location.
+ Client based implementations will have option to choose between pre-emptive and nonpre-emptive permission policy.
+ pre-emptive permission policy is enabled by default for all client-based implementations. */
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
+#define WTF_USE_PREEMPT_GEOLOCATION_PERMISSION 1
+#endif
+
#endif /* WTF_Platform_h */
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index e85a728..16beb7a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-07-20 Mahesh Kulkarni <mahesh.kulkarni at nokia.com>
+
+ Reviewed by Steve Block.
+
+ Need to be able to configure Geolocation policy regarding user permissions
+ https://bugs.webkit.org/show_bug.cgi?id=42068
+
+ Introducing new USE() flag PREEMPT_GEOLOCATION_PREMISSION using which
+ acquires user permission first before starting location service
+
+ This change does not introduce any change in behavior for any platform. So there are no new tests
+ added.
+
+ * WebCore.pro:
+ * page/Geolocation.cpp:
+ (WebCore::Geolocation::startRequest):
+ (WebCore::Geolocation::setIsAllowed):
+ (WebCore::Geolocation::startUpdating):
+ * page/Geolocation.h:
+
2010-07-20 Adam Barth <abarth at webkit.org>
Reviewed by Darin Adler.
diff --git a/WebCore/WebCore.pro b/WebCore/WebCore.pro
index f342dba..18042ea 100644
--- a/WebCore/WebCore.pro
+++ b/WebCore/WebCore.pro
@@ -2707,6 +2707,9 @@ contains(DEFINES, ENABLE_QT_BEARER=1) {
}
contains(DEFINES, ENABLE_GEOLOCATION=1) {
+ # if geolocation is enabled, enable pre-request for permission policy
+ DEFINES += WTF_USE_PREEMPT_GEOLOCATION_PERMISSION
+
HEADERS += \
platform/qt/GeolocationServiceQt.h
SOURCES += \
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp
index 10e5d3b..8532901 100644
--- a/WebCore/page/Geolocation.cpp
+++ b/WebCore/page/Geolocation.cpp
@@ -279,7 +279,7 @@ PassRefPtr<Geolocation::GeoNotifier> Geolocation::startRequest(PassRefPtr<Positi
else if (haveSuitableCachedPosition(notifier->m_options.get()))
notifier->setUseCachedPosition();
else if (notifier->hasZeroTimeout() || startUpdating(notifier.get())) {
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
// Only start timer if we're not waiting for user permission.
if (!m_startRequestPermissionNotifier)
#endif
@@ -400,18 +400,22 @@ void Geolocation::setIsAllowed(bool allowed)
// position.
m_allowGeolocation = allowed ? Yes : No;
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
if (m_startRequestPermissionNotifier) {
if (isAllowed()) {
// Permission request was made during the startUpdating process
m_startRequestPermissionNotifier->startTimerIfNeeded();
m_startRequestPermissionNotifier = 0;
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
if (!m_frame)
return;
Page* page = m_frame->page();
if (!page)
return;
page->geolocationController()->addObserver(this);
+#else
+ // TODO: Handle startUpdate() for non-client based implementations using pre-emptive policy
+#endif
} else {
m_startRequestPermissionNotifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
m_oneShots.add(m_startRequestPermissionNotifier);
@@ -612,15 +616,15 @@ void Geolocation::geolocationServiceErrorOccurred(GeolocationService* service)
bool Geolocation::startUpdating(GeoNotifier* notifier)
{
-#if ENABLE(CLIENT_BASED_GEOLOCATION)
- // FIXME: Pass options to client.
-
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
if (!isAllowed()) {
m_startRequestPermissionNotifier = notifier;
requestPermission();
return true;
}
-
+#endif
+
+#if ENABLE(CLIENT_BASED_GEOLOCATION)
if (!m_frame)
return false;
@@ -628,6 +632,7 @@ bool Geolocation::startUpdating(GeoNotifier* notifier)
if (!page)
return false;
+ // FIXME: Pass options to client.
page->geolocationController()->addObserver(this);
return true;
#else
diff --git a/WebCore/page/Geolocation.h b/WebCore/page/Geolocation.h
index 4132bfe..8c47d9c 100644
--- a/WebCore/page/Geolocation.h
+++ b/WebCore/page/Geolocation.h
@@ -165,7 +165,8 @@ private:
Frame* m_frame;
#if !ENABLE(CLIENT_BASED_GEOLOCATION)
OwnPtr<GeolocationService> m_service;
-#else
+#endif
+#if USE(PREEMPT_GEOLOCATION_PERMISSION)
RefPtr<GeoNotifier> m_startRequestPermissionNotifier;
#endif
RefPtr<Geoposition> m_lastPosition;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list