Changeset 54079 in webkit
- Timestamp:
- Jan 29, 2010 2:08:05 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r54078 r54079 1 2010-01-29 Steve Falkenburg <sfalken@apple.com> 2 3 Reviewed by Darin Adler. 4 5 Client-based Geolocation starts updating before getting consent from the user 6 https://bugs.webkit.org/show_bug.cgi?id=34343 7 8 * page/Geolocation.cpp: 9 (WebCore::Geolocation::startRequest): Pass notifier instead of options to startUpdating. 10 (WebCore::Geolocation::setIsAllowed): Add the observer or notify of error for deferred startUpdating. 11 (WebCore::Geolocation::startUpdating): Pass notifier instead of options, since we may need to call it if we fail to get user consent. 12 Defer adding the observer if we don't yet have user consent, since this could kick off 13 server-based wifi Geolocation requests. 14 * page/Geolocation.h: 15 1 16 2010-01-28 Jon Honeycutt <jhoneycutt@apple.com> 2 17 -
trunk/WebCore/page/Geolocation.cpp
r53708 r54079 246 246 notifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage)); 247 247 else { 248 if (notifier->hasZeroTimeout() || startUpdating(notifier ->m_options.get()))248 if (notifier->hasZeroTimeout() || startUpdating(notifier.get())) 249 249 notifier->startTimerIfNeeded(); 250 250 else … … 301 301 { 302 302 m_allowGeolocation = allowed ? Yes : No; 303 304 #if ENABLE(CLIENT_BASED_GEOLOCATION) 305 if (m_startRequestPermissionNotifier) { 306 if (isAllowed()) { 307 // Permission request was made during the startUpdating process 308 m_startRequestPermissionNotifier = 0; 309 if (!m_frame) 310 return; 311 Page* page = m_frame->page(); 312 if (!page) 313 return; 314 page->geolocationController()->addObserver(this); 315 } else { 316 m_startRequestPermissionNotifier->setFatalError(PositionError::create(PositionError::PERMISSION_DENIED, permissionDeniedErrorMessage)); 317 m_oneShots.add(m_startRequestPermissionNotifier); 318 m_startRequestPermissionNotifier = 0; 319 } 320 return; 321 } 322 #endif 303 323 304 324 if (isAllowed()) … … 480 500 #endif 481 501 482 bool Geolocation::startUpdating( PositionOptions* options)502 bool Geolocation::startUpdating(GeoNotifier* notifier) 483 503 { 484 504 #if ENABLE(CLIENT_BASED_GEOLOCATION) 485 505 // FIXME: Pass options to client. 486 UNUSED_PARAM(options); 487 506 507 if (!isAllowed()) { 508 m_startRequestPermissionNotifier = notifier; 509 requestPermission(); 510 return true; 511 } 512 488 513 if (!m_frame) 489 514 return false; … … 496 521 return true; 497 522 #else 498 return m_service->startUpdating( options);523 return m_service->startUpdating(notifier->options); 499 524 #endif 500 525 } -
trunk/WebCore/page/Geolocation.h
r53342 r54079 139 139 void requestPermission(); 140 140 141 bool startUpdating( PositionOptions*);141 bool startUpdating(GeoNotifier*); 142 142 void stopUpdating(); 143 143 … … 160 160 #if !ENABLE(CLIENT_BASED_GEOLOCATION) 161 161 OwnPtr<GeolocationService> m_service; 162 #else 163 RefPtr<GeoNotifier> m_startRequestPermissionNotifier; 162 164 #endif 163 165 RefPtr<Geoposition> m_lastPosition;
Note: See TracChangeset
for help on using the changeset viewer.