Changeset 125736 in webkit
- Timestamp:
- Aug 15, 2012, 7:14:16 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/security/cross-origin-websql-allowed-expected.txt (added)
-
LayoutTests/http/tests/security/cross-origin-websql-allowed.html (added)
-
LayoutTests/http/tests/security/cross-origin-websql-expected.txt (added)
-
LayoutTests/http/tests/security/cross-origin-websql.html (added)
-
LayoutTests/http/tests/security/resources/cross-origin-iframe-for-websql.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.cpp (modified) (1 diff)
-
Source/WebCore/page/SecurityOrigin.cpp (modified) (1 diff)
-
Source/WebCore/page/SecurityOrigin.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r125735 r125736 1 2012-08-14 Jeffrey Pfau <jpfau@apple.com> 2 3 Allow blocking of Web SQL databases in third-party documents 4 https://bugs.webkit.org/show_bug.cgi?id=94057 5 6 Reviewed by Adam Barth. 7 8 Created tests for accessing openDatabase from a third party and first party context when third-party blocking is on and off. 9 10 * http/tests/security/cross-origin-websql-allowed-expected.txt: Added. 11 * http/tests/security/cross-origin-websql-allowed.html: Added. 12 * http/tests/security/cross-origin-websql-expected.txt: Added. 13 * http/tests/security/cross-origin-websql.html: Added. 14 * http/tests/security/resources/cross-origin-iframe-for-websql.html: Added. 15 1 16 2012-08-15 Kiran Muppala <cmuppala@apple.com> 2 17 -
trunk/Source/WebCore/ChangeLog
r125734 r125736 1 2012-08-14 Jeffrey Pfau <jpfau@apple.com> 2 3 Allow blocking of Web SQL databases in third-party documents 4 https://bugs.webkit.org/show_bug.cgi?id=94057 5 6 Reviewed by Adam Barth. 7 8 Add a check for pages in third-party pages to allow third-party storage blocking of Web SQL databases. 9 10 Tests: http/tests/security/cross-origin-websql-allowed.html 11 http/tests/security/cross-origin-websql.html 12 13 * Modules/webdatabase/DOMWindowWebDatabase.cpp: 14 (WebCore::DOMWindowWebDatabase::openDatabase): Pass top origin to canAccessDatabase 15 * page/SecurityOrigin.cpp: 16 (WebCore::SecurityOrigin::canAccessStorage): Common method for various types of storage that use the same criteria 17 * page/SecurityOrigin.h: 18 (WebCore::SecurityOrigin::canAccessDatabase): Use canAccessStorage 19 (WebCore::SecurityOrigin::canAccessLocalStorage): Change to using canAccessStorage 20 (SecurityOrigin): 21 1 22 2012-08-15 Nikhil Bhargava <nbhargava@google.com> 2 23 -
trunk/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.cpp
r112035 r125736 47 47 48 48 RefPtr<Database> database = 0; 49 if (AbstractDatabase::isAvailable() && window->document()->securityOrigin()->canAccessDatabase( ))49 if (AbstractDatabase::isAvailable() && window->document()->securityOrigin()->canAccessDatabase(window->document()->topDocument()->securityOrigin())) 50 50 database = Database::openDatabase(window->document(), name, version, displayName, estimatedSize, creationCallback, ec); 51 51 -
trunk/Source/WebCore/page/SecurityOrigin.cpp
r125335 r125736 392 392 } 393 393 394 bool SecurityOrigin::canAccess LocalStorage(const SecurityOrigin* topOrigin) const394 bool SecurityOrigin::canAccessStorage(const SecurityOrigin* topOrigin) const 395 395 { 396 396 if (isUnique()) 397 397 return false; 398 399 // FIXME: This check should be replaced with an ASSERT once we can guarantee that topOrigin is not null. 400 if (!topOrigin) 401 return true; 398 402 399 403 if (m_blockThirdPartyStorage && topOrigin->isThirdParty(this)) -
trunk/Source/WebCore/page/SecurityOrigin.h
r125335 r125736 124 124 void blockThirdPartyStorage() { m_blockThirdPartyStorage = true; } 125 125 126 bool canAccessDatabase( ) const { return !isUnique(); }127 bool canAccessLocalStorage(const SecurityOrigin* topOrigin) const ;126 bool canAccessDatabase(const SecurityOrigin* topOrigin = 0) const { return canAccessStorage(topOrigin); }; 127 bool canAccessLocalStorage(const SecurityOrigin* topOrigin) const { return canAccessStorage(topOrigin); }; 128 128 bool canAccessCookies() const { return !isUnique(); } 129 129 bool canAccessPasswordManager() const { return !isUnique(); } … … 193 193 bool passesFileCheck(const SecurityOrigin*) const; 194 194 bool isThirdParty(const SecurityOrigin*) const; 195 bool canAccessStorage(const SecurityOrigin*) const; 195 196 196 197 String m_protocol;
Note:
See TracChangeset
for help on using the changeset viewer.