Skip to content
  • aestes@apple.com's avatar
    Allow session storage for third-party origins even if third-party data access is blocked. · 16141c97
    aestes@apple.com authored
    https://bugs.webkit.org/show_bug.cgi?id=116532
    
    Reviewed by Anders Carlsson.
    
    Source/WebCore:
    
    In http://trac.webkit.org/changeset/149326 we relaxed our policy for
    localStorage when third-party data blocking is enabled to create a
    transient, session-scoped storage area for the third-party origin
    instead of throwing an exception. Since this gives essentially the same
    behavior as sessionStorage, we might as well also allow sessionStorage
    for third-party origins.
    
    Test: http/tests/security/cross-origin-session-storage-third-party-blocked.html
    
    * WebCore.exp.in: Updated the symbol for
    SecurityOrigin::canAccessStorage.
    * page/DOMWindow.cpp:
    (WebCore::DOMWindow::sessionStorage): Called canAccessSessionStorage()
    rather than canAccessLocalStorage().
    * page/SecurityOrigin.cpp:
    (WebCore::SecurityOrigin::canAccessStorage): Passed in an enum
    indicating if access should be allowed from third-party origins.
    * page/SecurityOrigin.h:
    (WebCore::SecurityOrigin::canAccessSessionStorage): Called
    canAccessStorage() with AlwaysAllowFromThirdParty.
    (SecurityOrigin):
    
    LayoutTests:
    
    * http/tests/security/cross-origin-session-storage-third-party-blocked-expected.txt: Renamed from LayoutTests/http/tests/security/cross-origin-session-storage-expected.txt.
    * http/tests/security/cross-origin-session-storage-third-party-blocked.html: Renamed from LayoutTests/http/tests/security/cross-origin-session-storage.html.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    16141c97