diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-04 06:56:46 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-04 06:56:46 -0700 |
commit | ed40e9fb9b29c948cbe94b704eb1b5daa8e93b5e (patch) | |
tree | 22635c9a473909325946d0c840f43c9068558623 | |
parent | cddddebe75a1ffe2900a3fff994f5b5f74609a0c (diff) | |
parent | 4abe833d66929ee0f0363cf63dfe35ffe3d5a0a2 (diff) | |
download | external_webkit-ed40e9fb9b29c948cbe94b704eb1b5daa8e93b5e.zip external_webkit-ed40e9fb9b29c948cbe94b704eb1b5daa8e93b5e.tar.gz external_webkit-ed40e9fb9b29c948cbe94b704eb1b5daa8e93b5e.tar.bz2 |
Merge change 23954 into eclair
* changes:
Makes Geolocation error callback asynchronous when service fails to start.
-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")); } } |