Extend third-party storage blocking API to optionally allow blocking all storage
authorjpfau@apple.com <jpfau@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Sep 2012 02:05:36 +0000 (02:05 +0000)
committerjpfau@apple.com <jpfau@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 8 Sep 2012 02:05:36 +0000 (02:05 +0000)
commit680e44afb0d9616876d35c0fd35975a47e6472ad
tree564591843dac935c7835dad95b96dc8a8c1f8126
parent2ee293c1a2fc9f02cc14e3d16ccb5146e3700584
Extend third-party storage blocking API to optionally allow blocking all storage
https://bugs.webkit.org/show_bug.cgi?id=95915

Reviewed by Brady Eidson.

Source/WebCore:

Replace boolean API with tri-state API that allows for blocking no, third-party, or all storage.

Tests: http/tests/security/same-origin-shared-worker-blocked.html
       http/tests/security/same-origin-storage-blocked.html
       http/tests/security/same-origin-websql-blocked.html

* dom/Document.cpp:
(WebCore::Document::initSecurityContext):
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::SecurityOrigin):
(WebCore::SecurityOrigin::canAccessStorage):
* page/SecurityOrigin.h:
(WebCore::SecurityOrigin::setStorageBlockingPolicy):
(SecurityOrigin):
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setStorageBlockingPolicy):
(WebCore::Settings::storageBlockingPolicy):
(Settings):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setStorageBlockingPolicy):
* testing/InternalSettings.h:
(InternalSettings):
* testing/InternalSettings.idl:

Source/WebKit2:

Update WK2 API to use revised Settings API.

* Shared/WebPreferencesStore.h:
(WebKit):
* UIProcess/API/C/WKAPICast.h:
(WebKit::toStorageBlockingPolicy):
(WebKit):
(WebKit::toAPI):
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetStorageBlockingPolicy):
(WKPreferencesGetStorageBlockingPolicy):
* UIProcess/API/C/WKPreferences.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Modified API test to use new revised API.

* TestWebKitAPI/Tests/WebKit2/WKPreferences.cpp:
(TestWebKitAPI::TEST):

LayoutTests:

Update tests to use revised API.

* http/tests/security/cross-origin-local-storage.html:
* http/tests/security/cross-origin-plugin-private-browsing-toggled.html:
* http/tests/security/cross-origin-plugin.html:
* http/tests/security/cross-origin-session-storage.html:
* http/tests/security/cross-origin-shared-worker.html:
* http/tests/security/cross-origin-websql.html:
* http/tests/security/cross-origin-worker-websql.html:
* http/tests/security/resources/document-for-cross-origin-worker-websql.html:
* http/tests/security/same-origin-document-domain-storage-allowed.html:
* http/tests/security/same-origin-shared-worker-blocked-expected.txt: Added.
* http/tests/security/same-origin-shared-worker-blocked.html: Added.
* http/tests/security/same-origin-storage-blocked-expected.txt: Added.
* http/tests/security/same-origin-storage-blocked.html: Added.
* http/tests/security/same-origin-websql-blocked-expected.txt: Added.
* http/tests/security/same-origin-websql-blocked.html: Added.
* platform/chromium/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@127956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/security/cross-origin-local-storage.html
LayoutTests/http/tests/security/cross-origin-plugin-private-browsing-toggled.html
LayoutTests/http/tests/security/cross-origin-plugin.html
LayoutTests/http/tests/security/cross-origin-session-storage.html
LayoutTests/http/tests/security/cross-origin-shared-worker.html
LayoutTests/http/tests/security/cross-origin-websql.html
LayoutTests/http/tests/security/cross-origin-worker-websql.html
LayoutTests/http/tests/security/resources/document-for-cross-origin-worker-websql.html
LayoutTests/http/tests/security/same-origin-document-domain-storage-allowed.html
LayoutTests/http/tests/security/same-origin-shared-worker-blocked-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/same-origin-shared-worker-blocked.html [new file with mode: 0644]
LayoutTests/http/tests/security/same-origin-storage-blocked-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/same-origin-storage-blocked.html [new file with mode: 0644]
LayoutTests/http/tests/security/same-origin-websql-blocked-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/same-origin-websql-blocked.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/page/SecurityOrigin.cpp
Source/WebCore/page/SecurityOrigin.h
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesStore.h
Source/WebKit2/UIProcess/API/C/WKAPICast.h
Source/WebKit2/UIProcess/API/C/WKPreferences.cpp
Source/WebKit2/UIProcess/API/C/WKPreferences.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKit2/WKPreferences.cpp