diff options
author | Steve Block <steveblock@google.com> | 2009-08-25 12:13:41 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2009-09-04 14:27:31 +0100 |
commit | 4abe833d66929ee0f0363cf63dfe35ffe3d5a0a2 (patch) | |
tree | 435e8f06a789e51f141bf2404a5653b00ab366de | |
parent | 3ae77a67311f7f1a6a072ccb81b5f502b09e4fb2 (diff) | |
download | external_webkit-4abe833d66929ee0f0363cf63dfe35ffe3d5a0a2.zip external_webkit-4abe833d66929ee0f0363cf63dfe35ffe3d5a0a2.tar.gz external_webkit-4abe833d66929ee0f0363cf63dfe35ffe3d5a0a2.tar.bz2 |
Makes Geolocation error callback asynchronous when service fails to start.
This fixes http://b/issue?id=2054361.
Change-Id: I83ff2618fb49bb126c7cd4c318914c6a0c68d69d
-rw-r--r-- | WebCore/page/Geolocation.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/WebCore/page/Geolocation.cpp b/WebCore/page/Geolocation.cpp index 5d908a3..a419b0b 100644 --- a/WebCore/page/Geolocation.cpp +++ b/WebCore/page/Geolocation.cpp @@ -106,8 +106,7 @@ void Geolocation::disconnectFrame() void Geolocation::getCurrentPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options) { RefPtr<GeoNotifier> notifier = makeRequest(successCallback, errorCallback, options); - if (!notifier) - return; + ASSERT(notifier); m_oneShots.add(notifier); } @@ -115,8 +114,7 @@ void Geolocation::getCurrentPosition(PassRefPtr<PositionCallback> successCallbac int Geolocation::watchPosition(PassRefPtr<PositionCallback> successCallback, PassRefPtr<PositionErrorCallback> errorCallback, PassRefPtr<PositionOptions> options) { RefPtr<GeoNotifier> notifier = makeRequest(successCallback, errorCallback, options); - if (!notifier) - return 0; + ASSERT(notifier); static int sIdentifier = 0; m_watchers.set(++sIdentifier, notifier); @@ -136,11 +134,7 @@ PassRefPtr<Geolocation::GeoNotifier> Geolocation::makeRequest(PassRefPtr<Positio if (m_service->startUpdating(notifier->m_options.get())) notifier->startTimerIfNeeded(); else { - if (notifier->m_errorCallback) { - RefPtr<PositionError> error = PositionError::create(PositionError::PERMISSION_DENIED, "Unable to Start"); - notifier->m_errorCallback->handleEvent(error.get()); - } - return 0; + notifier->setFatalError(PositionError::create(PositionError::UNKNOWN_ERROR, "Failed to start Geolocation service")); } } |