Commit 2dd8f82e authored by sfalken@apple.com's avatar sfalken@apple.com

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.


git-svn-id: svn://svn.chromium.org/blink/trunk@54096 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent fd3fca5b
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 Chris Marrin <cmarrin@apple.com> 2010-01-29 Chris Marrin <cmarrin@apple.com>
Reviewed by Simon Fraser. Reviewed by Simon Fraser.
...@@ -245,9 +245,13 @@ PassRefPtr<Geolocation::GeoNotifier> Geolocation::startRequest(PassRefPtr<Positi ...@@ -245,9 +245,13 @@ PassRefPtr<Geolocation::GeoNotifier> Geolocation::startRequest(PassRefPtr<Positi
if (isDenied()) if (isDenied())
notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage)); notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage));
else { else {
if (notifier->hasZeroTimeout() || startUpdating(notifier.get())) if (notifier->hasZeroTimeout() || startUpdating(notifier.get())) {
notifier->startTimerIfNeeded(); #if ENABLE(CLIENT_BASED_GEOLOCATION)
else // 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")); notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, "Failed to start Geolocation service"));
} }
...@@ -305,6 +309,7 @@ void Geolocation::setIsAllowed(bool allowed) ...@@ -305,6 +309,7 @@ void Geolocation::setIsAllowed(bool allowed)
if (m_startRequestPermissionNotifier) { if (m_startRequestPermissionNotifier) {
if (isAllowed()) { if (isAllowed()) {
// Permission request was made during the startUpdating process // Permission request was made during the startUpdating process
m_startRequestPermissionNotifier->startTimerIfNeeded();
m_startRequestPermissionNotifier = 0; m_startRequestPermissionNotifier = 0;
if (!m_frame) if (!m_frame)
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment