Changeset 195075 in webkit
- Timestamp:
- Jan 14, 2016, 1:42:35 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 15 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt (added)
-
LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition.html (added)
-
LayoutTests/fast/dom/Geolocation/dataURL-watchPosition-expected.txt (added)
-
LayoutTests/fast/dom/Geolocation/dataURL-watchPosition.html (added)
-
LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt (added)
-
LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition.html (added)
-
LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition-expected.txt (added)
-
LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition.html (added)
-
LayoutTests/http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js (added)
-
LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html (added)
-
LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html (added)
-
LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt (added)
-
LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html (added)
-
LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt (added)
-
LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/geolocation/Geolocation.cpp (modified) (4 diffs)
-
Source/WebCore/Modules/geolocation/Geolocation.h (modified) (2 diffs)
-
Source/WebCore/page/SecurityOrigin.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r195073 r195075 1 2016-01-14 Daniel Bates <dabates@apple.com> 2 3 Disallow use of Geolocation service from unique origins 4 https://bugs.webkit.org/show_bug.cgi?id=153102 5 <rdar://problem/23055645> 6 7 Reviewed by Alexey Proskuryakov. 8 9 * fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt: Added. 10 * fast/dom/Geolocation/dataURL-getCurrentPosition.html: Added. 11 * fast/dom/Geolocation/dataURL-watchPosition-expected.txt: Added. 12 * fast/dom/Geolocation/dataURL-watchPosition.html: Added. 13 * fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt: Added. 14 * fast/dom/Geolocation/srcdoc-getCurrentPosition.html: Added. 15 * fast/dom/Geolocation/srcdoc-watchPosition-expected.txt: Added. 16 * fast/dom/Geolocation/srcdoc-watchPosition.html: Added. 17 * http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js: Added. 18 (done): 19 (logMessage): 20 (didReceivePosition): 21 (didReceiveError): 22 (checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod): 23 (markupToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod): 24 (dataURLToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod): 25 * http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html: Added. 26 * http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html: Added. 27 * http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt: Added. 28 * http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html: Added. 29 * http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt: Added. 30 * http/tests/security/sandboxed-iframe-geolocation-watchPosition.html: Added. 31 1 32 2016-01-14 Daniel Bates <dabates@apple.com> 2 33 -
trunk/Source/WebCore/ChangeLog
r195074 r195075 1 2016-01-14 Daniel Bates <dabates@apple.com> 2 3 Disallow use of Geolocation service from unique origins 4 https://bugs.webkit.org/show_bug.cgi?id=153102 5 <rdar://problem/23055645> 6 7 Reviewed by Alexey Proskuryakov. 8 9 Tests: fast/dom/Geolocation/dataURL-getCurrentPosition.html 10 fast/dom/Geolocation/dataURL-watchPosition.html 11 fast/dom/Geolocation/srcdoc-getCurrentPosition.html 12 fast/dom/Geolocation/srcdoc-watchPosition.html 13 http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html 14 http/tests/security/sandboxed-iframe-geolocation-watchPosition.html 15 16 * Modules/geolocation/Geolocation.cpp: 17 (WebCore::Geolocation::securityOrigin): Convenience function to get the SecurityOrigin object 18 associated with this script execution context. 19 (WebCore::Geolocation::startRequest): Notify requester POSITION_UNAVAILABLE when requested 20 from a document with a unique origin. 21 * Modules/geolocation/Geolocation.h: 22 * page/SecurityOrigin.h: 23 (WebCore::SecurityOrigin::canRequestGeolocation): Added. 24 1 25 2016-01-14 Daniel Bates <dabates@apple.com> 2 26 -
trunk/Source/WebCore/Modules/geolocation/Geolocation.cpp
r194496 r195075 41 41 #include "Page.h" 42 42 #include "PositionError.h" 43 #include "SecurityOrigin.h" 43 44 #include <wtf/CurrentTime.h> 44 45 #include <wtf/Ref.h> … … 49 50 static const char failedToStartServiceErrorMessage[] = "Failed to start Geolocation service"; 50 51 static const char framelessDocumentErrorMessage[] = "Geolocation cannot be used in frameless documents"; 52 static const char originCannotRequestGeolocationErrorMessage[] = "Origin does not have permission to use Geolocation service"; 51 53 52 54 static RefPtr<Geoposition> createGeoposition(GeolocationPosition* position) … … 150 152 { 151 153 return downcast<Document>(scriptExecutionContext()); 154 } 155 156 SecurityOrigin* Geolocation::securityOrigin() const 157 { 158 return scriptExecutionContext()->securityOrigin(); 152 159 } 153 160 … … 333 340 void Geolocation::startRequest(GeoNotifier* notifier) 334 341 { 342 if (!securityOrigin()->canRequestGeolocation()) { 343 notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(originCannotRequestGeolocationErrorMessage))); 344 return; 345 } 346 335 347 // Check whether permissions have already been denied. Note that if this is the case, 336 348 // the permission state can not change again in the lifetime of this page. -
trunk/Source/WebCore/Modules/geolocation/Geolocation.h
r192848 r195075 49 49 class Page; 50 50 class ScriptExecutionContext; 51 class SecurityOrigin; 51 52 52 53 class Geolocation : public ScriptWrappable, public RefCounted<Geolocation>, public ActiveDOMObject … … 88 89 89 90 Page* page() const; 91 SecurityOrigin* securityOrigin() const; 90 92 91 93 typedef Vector<RefPtr<GeoNotifier>> GeoNotifierVector; -
trunk/Source/WebCore/page/SecurityOrigin.h
r194367 r195075 157 157 bool canAccessApplicationCache(const SecurityOrigin* topOrigin) const { return canAccessStorage(topOrigin); } 158 158 bool canAccessCookies() const { return !isUnique(); } 159 bool canRequestGeolocation() const { return !isUnique(); } 159 160 Policy canShowNotifications() const; 160 161
Note:
See TracChangeset
for help on using the changeset viewer.