Changeset 47152 in webkit
- Timestamp:
- Aug 12, 2009 3:08:55 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r47151 r47152 1 2009-08-12 Steve Block <steveblock@google.com> 2 3 Reviewed by Eric Seidel. 4 5 Bug 26993 : Geolocation::requestPermission() 6 https://bugs.webkit.org/show_bug.cgi?id=26993 7 8 Second patch to allow the Geolocation permission request to chrome to be asynchronous 9 or synchronous. Fixes a bug where callbacks were called twice when permissions 10 are granted synchronously. 11 12 No new tests required. 13 14 * page/Geolocation.cpp: 15 (WebCore::Geolocation::setIsAllowed): Modified. Calls makeSuccessCallbacks() rather than geolocationServicePositionChanged(). 16 (WebCore::Geolocation::geolocationServicePositionChanged): Modified. Updated logic to avoid repeated callbacks when permissions are granted synchronously. 17 (WebCore::Geolocation::makeSuccessCallbacks): Added. Calls success callbacks. 18 * page/Geolocation.h: Modified. Adds makeSuccessCallbacks(). 19 1 20 2009-08-12 Anders Carlsson <andersca@apple.com> 2 21 -
trunk/WebCore/page/Geolocation.cpp
r46663 r47152 140 140 if (isAllowed()) { 141 141 startTimers(); 142 geolocationServicePositionChanged(m_service.get());142 makeSuccessCallbacks(); 143 143 } else { 144 144 WTF::RefPtr<WebCore::PositionError> error = WebCore::PositionError::create(PositionError::PERMISSION_DENIED, "User disallowed GeoLocation"); … … 271 271 void Geolocation::geolocationServicePositionChanged(GeolocationService* service) 272 272 { 273 ASSERT(service->lastPosition()); 274 275 requestPermission(); 276 if (!isAllowed()) 277 return; 278 279 sendPositionToOneShots(service->lastPosition()); 280 sendPositionToWatchers(service->lastPosition()); 273 ASSERT_UNUSED(service, service == m_service); 274 ASSERT(m_service->lastPosition()); 275 276 if (!isAllowed()) { 277 // requestPermission() will ask the chrome for permission. This may be 278 // implemented synchronously or asynchronously. In both cases, 279 // makeSuccessCallbacks() will be called if permission is granted, so 280 // there's nothing more to do here. 281 requestPermission(); 282 return; 283 } 284 285 makeSuccessCallbacks(); 286 } 287 288 void Geolocation::makeSuccessCallbacks() 289 { 290 ASSERT(m_service->lastPosition()); 291 ASSERT(isAllowed()); 292 293 sendPositionToOneShots(m_service->lastPosition()); 294 sendPositionToWatchers(m_service->lastPosition()); 281 295 282 296 m_oneShots.clear(); -
trunk/WebCore/page/Geolocation.h
r46633 r47152 103 103 void startTimers(); 104 104 105 void makeSuccessCallbacks(); 105 106 void handleError(PositionError*); 106 107
Note: See TracChangeset
for help on using the changeset viewer.