Changeset 195400 in webkit
- Timestamp:
- Jan 20, 2016, 11:13:45 PM (11 years ago)
- Location:
- branches/safari-601.1.46-branch
- Files:
-
- 5 edited
- 15 copied
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt (copied) (copied from trunk/LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt )
-
LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition.html (copied) (copied from trunk/LayoutTests/fast/dom/Geolocation/dataURL-getCurrentPosition.html )
-
LayoutTests/fast/dom/Geolocation/dataURL-watchPosition-expected.txt (copied) (copied from trunk/LayoutTests/fast/dom/Geolocation/dataURL-watchPosition-expected.txt )
-
LayoutTests/fast/dom/Geolocation/dataURL-watchPosition.html (copied) (copied from trunk/LayoutTests/fast/dom/Geolocation/dataURL-watchPosition.html )
-
LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt (copied) (copied from trunk/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt )
-
LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition.html (copied) (copied from trunk/LayoutTests/fast/dom/Geolocation/srcdoc-getCurrentPosition.html )
-
LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition-expected.txt (copied) (copied from trunk/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition-expected.txt )
-
LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition.html (copied) (copied from trunk/LayoutTests/fast/dom/Geolocation/srcdoc-watchPosition.html )
-
LayoutTests/http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js (copied) (copied from trunk/LayoutTests/http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js )
-
LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html (copied) (copied from trunk/LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html )
-
LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html (copied) (copied from trunk/LayoutTests/http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html )
-
LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt (copied) (copied from trunk/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt )
-
LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html (copied) (copied from trunk/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html )
-
LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt (copied) (copied from trunk/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt )
-
LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition.html (copied) (copied from trunk/LayoutTests/http/tests/security/sandboxed-iframe-geolocation-watchPosition.html )
-
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
-
branches/safari-601.1.46-branch/LayoutTests/ChangeLog
r195399 r195400 1 2016-01-20 Babak Shafiei <bshafiei@apple.com> 2 3 Merge r195075. 4 5 2016-01-14 Daniel Bates <dabates@apple.com> 6 7 Disallow use of Geolocation service from unique origins 8 https://bugs.webkit.org/show_bug.cgi?id=153102 9 <rdar://problem/23055645> 10 11 Reviewed by Alexey Proskuryakov. 12 13 * fast/dom/Geolocation/dataURL-getCurrentPosition-expected.txt: Added. 14 * fast/dom/Geolocation/dataURL-getCurrentPosition.html: Added. 15 * fast/dom/Geolocation/dataURL-watchPosition-expected.txt: Added. 16 * fast/dom/Geolocation/dataURL-watchPosition.html: Added. 17 * fast/dom/Geolocation/srcdoc-getCurrentPosition-expected.txt: Added. 18 * fast/dom/Geolocation/srcdoc-getCurrentPosition.html: Added. 19 * fast/dom/Geolocation/srcdoc-watchPosition-expected.txt: Added. 20 * fast/dom/Geolocation/srcdoc-watchPosition.html: Added. 21 * http/tests/security/resources/checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod.js: Added. 22 (done): 23 (logMessage): 24 (didReceivePosition): 25 (didReceiveError): 26 (checkThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod): 27 (markupToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod): 28 (dataURLToCheckThatPositionErrorCallbackIsCalledWithPositionUnavailableForGeolocationMethod): 29 * http/tests/security/resources/sandboxed-iframe-geolocation-getCurrentPosition.html: Added. 30 * http/tests/security/resources/sandboxed-iframe-geolocation-watchPosition.html: Added. 31 * http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition-expected.txt: Added. 32 * http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html: Added. 33 * http/tests/security/sandboxed-iframe-geolocation-watchPosition-expected.txt: Added. 34 * http/tests/security/sandboxed-iframe-geolocation-watchPosition.html: Added. 35 1 36 2016-01-20 Babak Shafiei <bshafiei@apple.com> 2 37 -
branches/safari-601.1.46-branch/Source/WebCore/ChangeLog
r195399 r195400 1 2016-01-20 Babak Shafiei <bshafiei@apple.com> 2 3 Merge r195075. 4 5 2016-01-14 Daniel Bates <dabates@apple.com> 6 7 Disallow use of Geolocation service from unique origins 8 https://bugs.webkit.org/show_bug.cgi?id=153102 9 <rdar://problem/23055645> 10 11 Reviewed by Alexey Proskuryakov. 12 13 Tests: fast/dom/Geolocation/dataURL-getCurrentPosition.html 14 fast/dom/Geolocation/dataURL-watchPosition.html 15 fast/dom/Geolocation/srcdoc-getCurrentPosition.html 16 fast/dom/Geolocation/srcdoc-watchPosition.html 17 http/tests/security/sandboxed-iframe-geolocation-getCurrentPosition.html 18 http/tests/security/sandboxed-iframe-geolocation-watchPosition.html 19 20 * Modules/geolocation/Geolocation.cpp: 21 (WebCore::Geolocation::securityOrigin): Convenience function to get the SecurityOrigin object 22 associated with this script execution context. 23 (WebCore::Geolocation::startRequest): Notify requester POSITION_UNAVAILABLE when requested 24 from a document with a unique origin. 25 * Modules/geolocation/Geolocation.h: 26 * page/SecurityOrigin.h: 27 (WebCore::SecurityOrigin::canRequestGeolocation): Added. 28 1 29 2016-01-20 Babak Shafiei <bshafiei@apple.com> 2 30 -
branches/safari-601.1.46-branch/Source/WebCore/Modules/geolocation/Geolocation.cpp
r185101 r195400 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 PassRefPtr<Geoposition> createGeoposition(GeolocationPosition* position) … … 151 153 { 152 154 return downcast<Document>(scriptExecutionContext()); 155 } 156 157 SecurityOrigin* Geolocation::securityOrigin() const 158 { 159 return scriptExecutionContext()->securityOrigin(); 153 160 } 154 161 … … 337 344 void Geolocation::startRequest(GeoNotifier *notifier) 338 345 { 346 if (!securityOrigin()->canRequestGeolocation()) { 347 notifier->setFatalError(PositionError::create(PositionError::POSITION_UNAVAILABLE, ASCIILiteral(originCannotRequestGeolocationErrorMessage))); 348 return; 349 } 350 339 351 // Check whether permissions have already been denied. Note that if this is the case, 340 352 // the permission state can not change again in the lifetime of this page. -
branches/safari-601.1.46-branch/Source/WebCore/Modules/geolocation/Geolocation.h
r185860 r195400 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; -
branches/safari-601.1.46-branch/Source/WebCore/page/SecurityOrigin.h
r185231 r195400 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.