Changeset 63742 in webkit


Ignore:
Timestamp:
Jul 20, 2010 7:24:47 AM (14 years ago)
Author:
abecsi@webkit.org
Message:

Need to be able to configure Geolocation policy regarding user permissions
https://bugs.webkit.org/show_bug.cgi?id=42068

Patch by Mahesh Kulkarni <mahesh.kulkarni@nokia.com> on 2010-07-20
Reviewed by Steve Block.

JavaScriptCore:

If CLIENT_BASED_GEOLOCATION is enabled, enable preemtive permission policy
by default

  • wtf/Platform.h:

WebCore:

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:
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r63721 r63742  
     12010-07-20  Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
     2
     3        Reviewed by Steve Block.
     4
     5        Need to be able to configure Geolocation policy regarding user permissions
     6        https://bugs.webkit.org/show_bug.cgi?id=42068
     7
     8        If CLIENT_BASED_GEOLOCATION is enabled, enable preemtive permission policy
     9        by default
     10
     11        * wtf/Platform.h:
     12       
    1132010-07-19  Dirk Schulze  <krit@webkit.org>
    214
  • trunk/JavaScriptCore/wtf/Platform.h

    r63348 r63742  
    11171117#endif
    11181118
     1119/* Geolocation request policy. pre-emptive policy is to acquire user permission before acquiring location.
     1120   Client based implementations will have option to choose between pre-emptive and nonpre-emptive permission policy.
     1121   pre-emptive permission policy is enabled by default for all client-based implementations. */
     1122#if ENABLE(CLIENT_BASED_GEOLOCATION)
     1123#define WTF_USE_PREEMPT_GEOLOCATION_PERMISSION
     1124#endif
     1125
    11191126#endif /* WTF_Platform_h */
  • trunk/WebCore/ChangeLog

    r63741 r63742  
     12010-07-20  Mahesh Kulkarni  <mahesh.kulkarni@nokia.com>
     2
     3        Reviewed by Steve Block.
     4
     5        Need to be able to configure Geolocation policy regarding user permissions
     6        https://bugs.webkit.org/show_bug.cgi?id=42068
     7
     8        Introducing new USE() flag PREEMPT_GEOLOCATION_PREMISSION using which
     9        acquires user permission first before starting location service
     10
     11        This change does not introduce any change in behavior for any platform. So there are no new tests
     12        added.
     13
     14        * WebCore.pro:
     15        * page/Geolocation.cpp:
     16        (WebCore::Geolocation::startRequest):
     17        (WebCore::Geolocation::setIsAllowed):
     18        (WebCore::Geolocation::startUpdating):
     19        * page/Geolocation.h:
     20
    1212010-07-20  Alexander Pavlov  <apavlov@chromium.org>
    222
  • trunk/WebCore/WebCore.pro

    r63735 r63742  
    27082708
    27092709contains(DEFINES, ENABLE_GEOLOCATION=1) {
     2710    # if geolocation is enabled, enable pre-request for permission policy
     2711    DEFINES += WTF_USE_PREEMPT_GEOLOCATION_PERMISSION
     2712
    27102713    HEADERS += \
    27112714        platform/qt/GeolocationServiceQt.h
  • trunk/WebCore/page/Geolocation.cpp

    r60441 r63742  
    280280        notifier->setUseCachedPosition();
    281281    else if (notifier->hasZeroTimeout() || startUpdating(notifier.get())) {
    282 #if ENABLE(CLIENT_BASED_GEOLOCATION)
     282#if USE(PREEMPT_GEOLOCATION_PERMISSION)
    283283        // Only start timer if we're not waiting for user permission.
    284284        if (!m_startRequestPermissionNotifier)
     
    401401    m_allowGeolocation = allowed ? Yes : No;
    402402   
    403 #if ENABLE(CLIENT_BASED_GEOLOCATION)
     403#if USE(PREEMPT_GEOLOCATION_PERMISSION)
    404404    if (m_startRequestPermissionNotifier) {
    405405        if (isAllowed()) {
     
    407407            m_startRequestPermissionNotifier->startTimerIfNeeded();
    408408            m_startRequestPermissionNotifier = 0;
     409#if ENABLE(CLIENT_BASED_GEOLOCATION)
    409410            if (!m_frame)
    410411                return;
     
    413414                return;
    414415            page->geolocationController()->addObserver(this);
     416#else
     417            // TODO: Handle startUpdate() for non-client based implementations using pre-emptive policy
     418#endif
    415419        } else {
    416420            m_startRequestPermissionNotifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
     
    613617bool Geolocation::startUpdating(GeoNotifier* notifier)
    614618{
    615 #if ENABLE(CLIENT_BASED_GEOLOCATION)
    616     // FIXME: Pass options to client.
    617 
     619#if USE(PREEMPT_GEOLOCATION_PERMISSION)
    618620    if (!isAllowed()) {
    619621        m_startRequestPermissionNotifier = notifier;
     
    621623        return true;
    622624    }
    623    
     625#endif
     626
     627#if ENABLE(CLIENT_BASED_GEOLOCATION)
    624628    if (!m_frame)
    625629        return false;
     
    629633        return false;
    630634
     635    // FIXME: Pass options to client.
    631636    page->geolocationController()->addObserver(this);
    632637    return true;
  • trunk/WebCore/page/Geolocation.h

    r60488 r63742  
    166166#if !ENABLE(CLIENT_BASED_GEOLOCATION)
    167167    OwnPtr<GeolocationService> m_service;
    168 #else
     168#endif
     169#if USE(PREEMPT_GEOLOCATION_PERMISSION)
    169170    RefPtr<GeoNotifier> m_startRequestPermissionNotifier;
    170171#endif
Note: See TracChangeset for help on using the changeset viewer.