Changeset 136164 in webkit
- Timestamp:
- Nov 29, 2012, 2:18:32 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/Geolocation/cached-position-iframe-expected.txt (added)
-
LayoutTests/fast/dom/Geolocation/cached-position-iframe.html (added)
-
LayoutTests/fast/dom/Geolocation/resources/cached-position-iframe-inner.html (added)
-
LayoutTests/fast/dom/Geolocation/script-tests/cached-position-iframe.js (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/geolocation/Geolocation.cpp (modified) (4 diffs)
-
Source/WebCore/Modules/geolocation/Geolocation.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r136161 r136164 1 2012-11-29 John Knottenbelt <jknotten@chromium.org> 2 3 Use GeolocationController's last geoposition as cached position. 4 https://bugs.webkit.org/show_bug.cgi?id=103540 5 6 Reviewed by Benjamin Poulain. 7 8 The page's GeolocationController mediates access to the 9 GeolocationClient for multiple frames' Geolocation instances. This 10 patch changes the position cache to be on the GeolocationController 11 rather than on the Geolocation instance. 12 13 This fixes a bug where if one frame has has received a fresh 14 position, then a request for a cached position from a second frame 15 does not succeed because the Geolocation instance in the second 16 frame's position cache hasn't received the position update that 17 went to the first frame. 18 19 * fast/dom/Geolocation/cached-position-iframe-expected.txt: Added. 20 * fast/dom/Geolocation/cached-position-iframe.html: Added. 21 * fast/dom/Geolocation/resources/cached-position-iframe-inner.html: Added. 22 * fast/dom/Geolocation/script-tests/cached-position-iframe.js: Added. 23 (window.onmessage): 24 1 25 2012-11-29 Zhenyao Mo <zmo@google.com> 2 26 -
trunk/Source/WebCore/ChangeLog
r136163 r136164 1 2012-11-29 John Knottenbelt <jknotten@chromium.org> 2 3 Use GeolocationController's last geoposition as cached position. 4 https://bugs.webkit.org/show_bug.cgi?id=103540 5 6 Reviewed by Benjamin Poulain. 7 8 The page's GeolocationController mediates access to the 9 GeolocationClient for multiple frames' Geolocation instances. This 10 patch changes the position cache to be on the GeolocationController 11 rather than on the Geolocation instance. 12 13 This fixes a bug where if one frame has has received a fresh 14 position, then a request for a cached position from a second frame 15 does not succeed because the Geolocation instance in the second 16 frame's position cache hasn't received the position update that 17 went to the first frame. 18 19 Test: fast/dom/Geolocation/cached-position-iframe.html 20 21 * Modules/geolocation/Geolocation.cpp: 22 (WebCore::Geolocation::makeCachedPositionCallbacks): 23 (WebCore::Geolocation::haveSuitableCachedPosition): 24 (WebCore::Geolocation::positionChanged): 25 * Modules/geolocation/Geolocation.h: 26 * Modules/geolocation/GeolocationController.h: 27 (GeolocationController): 28 1 29 2012-11-29 Alexei Filippov <alph@chromium.org> 2 30 -
trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp
r135478 r136164 374 374 for (GeoNotifierSet::const_iterator iter = m_requestsAwaitingCachedPosition.begin(); iter != end; ++iter) { 375 375 GeoNotifier* notifier = iter->get(); 376 notifier->runSuccessCallback( m_cachedPosition.get());376 notifier->runSuccessCallback(lastPosition()); 377 377 378 378 // If this is a one-shot request, stop it. Otherwise, if the watch still … … 405 405 bool Geolocation::haveSuitableCachedPosition(PositionOptions* options) 406 406 { 407 if (!m_cachedPosition) 407 Geoposition* cachedPosition = lastPosition(); 408 if (!cachedPosition) 408 409 return false; 409 410 if (!options->hasMaximumAge()) … … 412 413 return false; 413 414 DOMTimeStamp currentTimeMillis = convertSecondsToDOMTimeStamp(currentTime()); 414 return m_cachedPosition->timestamp() > currentTimeMillis - options->maximumAge();415 return cachedPosition->timestamp() > currentTimeMillis - options->maximumAge(); 415 416 } 416 417 … … 625 626 ASSERT(isAllowed()); 626 627 627 m_cachedPosition = lastPosition();628 629 628 // Stop all currently running timers. 630 629 stopTimers(); -
trunk/Source/WebCore/Modules/geolocation/Geolocation.h
r135478 r136164 174 174 } m_allowGeolocation; 175 175 176 RefPtr<Geoposition> m_cachedPosition;177 176 GeoNotifierSet m_requestsAwaitingCachedPosition; 178 177 };
Note:
See TracChangeset
for help on using the changeset viewer.