Skip to content
  • jpfau@apple.com's avatar
    Extend third-party storage blocking API to optionally allow blocking all storage · d5a0fa0d
    jpfau@apple.com authored
    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: http://svn.webkit.org/repository/webkit/trunk@127956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d5a0fa0d