Changeset 128653 in webkit


Ignore:
Timestamp:
Sep 14, 2012 2:30:42 PM (12 years ago)
Author:
jpfau@apple.com
Message:

Allow third-party storage blocking setting to change while a page is loaded
https://bugs.webkit.org/show_bug.cgi?id=95790

Reviewed by Brady Eidson.

.:

Update exported symbols.

  • Source/autotools/symbols.filter:

Source/WebCore:

Pipe through changes to the storage blocking policy to each document and plugin.

Tests: http/tests/security/storage-blocking-loosened-local-storage.html

http/tests/security/storage-blocking-loosened-plugin.html
http/tests/security/storage-blocking-loosened-private-browsing-plugin.html
http/tests/security/storage-blocking-loosened-shared-worker.html
http/tests/security/storage-blocking-loosened-websql.html
http/tests/security/storage-blocking-strengthened-local-storage.html
http/tests/security/storage-blocking-strengthened-plugin.html
http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html
http/tests/security/storage-blocking-strengthened-shared-worker.html
http/tests/security/storage-blocking-strengthened-websql.html

  • WebCore.exp.in:
  • dom/Document.cpp: Pipe changes through to the Document's SecurityOrigin.

(WebCore::Document::storageBlockingStateDidChange):
(WebCore):

  • dom/Document.h:

(Document):

  • page/DOMWindow.cpp: Check to make sure access is allowed before returning a cached storage area.

(WebCore::DOMWindow::sessionStorage):
(WebCore::DOMWindow::localStorage):

  • page/Page.cpp:

(WebCore::Page::collectPluginViews): Refactored out into a function.
(WebCore):
(WebCore::Page::storageBlockingStateChanged): Pipe changes through to each PluginView.
(WebCore::Page::privateBrowsingStateChanged):

  • page/Page.h:

(Page):

  • page/Settings.cpp:

(WebCore::Settings::setStorageBlockingPolicy): Tell Pages about changes to the storage blocking policy.
(WebCore):

  • page/Settings.h:

(Settings):

  • plugins/PluginViewBase.h:

(WebCore::PluginViewBase::storageBlockingStateChanged):

Source/WebKit2:

Inform plugins about changes to the storage blocking policy by way of the private browsing feature.

  • PluginProcess/PluginControllerProxy.cpp:

(WebKit::PluginControllerProxy::storageBlockingStateChanged):
(WebKit):

  • PluginProcess/PluginControllerProxy.h:

(PluginControllerProxy):

  • PluginProcess/PluginControllerProxy.messages.in: Add WK2 message for storageBlockingStateChanged.
  • WebProcess/Plugins/Netscape/NetscapePlugin.cpp:

(WebKit::NetscapePlugin::storageBlockingStateChanged):
(WebKit):
(WebKit::NetscapePlugin::privateBrowsingStateChanged):
(WebKit::NetscapePlugin::updateNPNPrivateMode): Set plugin's private browsing if either private browsing or storage blocking is enabled.

  • WebProcess/Plugins/Netscape/NetscapePlugin.h:

(NetscapePlugin):

  • WebProcess/Plugins/PDF/BuiltInPDFView.h:

(BuiltInPDFView):

  • WebProcess/Plugins/PDF/BuiltInPDFView.mm: Treat storageBlockingStateChanged as a no-op.

(WebKit::BuiltInPDFView::storageBlockingStateChanged):
(WebKit):

  • WebProcess/Plugins/Plugin.h: Add pure virtual storageBlockingStateChanged method.

(Plugin):

  • WebProcess/Plugins/PluginProxy.cpp:

(WebKit::PluginProxy::storageBlockingStateChanged):
(WebKit):

  • WebProcess/Plugins/PluginProxy.h:

(PluginProxy):

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::PluginView::storageBlockingStateChanged):
(WebKit):

  • WebProcess/Plugins/PluginView.h:

(PluginView):

  • win/WebKit2.def:

LayoutTests:

Tested combinations of loosening and strengthening the storage blocking policy on various types of storage.

  • http/tests/security/resources/iframe-for-storage-blocking-changed-local-storage.html: Added.
  • http/tests/security/resources/iframe-for-storage-blocking-changed-shared-worker.html: Added.
  • http/tests/security/resources/iframe-for-storage-blocking-changed-websql.html: Added.
  • http/tests/security/storage-blocking-loosened-local-storage-expected.txt: Added.
  • http/tests/security/storage-blocking-loosened-local-storage.html: Added.
  • http/tests/security/storage-blocking-loosened-plugin-expected.txt: Added.
  • http/tests/security/storage-blocking-loosened-plugin.html: Added.
  • http/tests/security/storage-blocking-loosened-private-browsing-plugin-expected.txt: Added.
  • http/tests/security/storage-blocking-loosened-private-browsing-plugin.html: Added.
  • http/tests/security/storage-blocking-loosened-shared-worker-expected.txt: Added.
  • http/tests/security/storage-blocking-loosened-shared-worker.html: Added.
  • http/tests/security/storage-blocking-loosened-websql-expected.txt: Added.
  • http/tests/security/storage-blocking-loosened-websql.html: Added.
  • http/tests/security/storage-blocking-strengthened-local-storage-expected.txt: Added.
  • http/tests/security/storage-blocking-strengthened-local-storage.html: Added.
  • http/tests/security/storage-blocking-strengthened-plugin-expected.txt: Added.
  • http/tests/security/storage-blocking-strengthened-plugin.html: Added.
  • http/tests/security/storage-blocking-strengthened-private-browsing-plugin-expected.txt: Added.
  • http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html: Added.
  • http/tests/security/storage-blocking-strengthened-shared-worker-expected.txt: Added.
  • http/tests/security/storage-blocking-strengthened-shared-worker.html: Added.
  • http/tests/security/storage-blocking-strengthened-websql-expected.txt: Added.
  • http/tests/security/storage-blocking-strengthened-websql.html: Added.
  • platform/chromium/TestExpectations: Skip shared worker and plugin tests.
  • platform/mac-wk2/http/tests/security/storage-blocking-strengthened-plugin-expected.txt: Added.
  • platform/mac-wk2/http/tests/security/storage-blocking-strengthened-private-browsing-plugin-expected.txt: Added.
Location:
trunk
Files:
25 added
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r128645 r128653  
     12012-09-14  Jeffrey Pfau  <jpfau@apple.com>
     2
     3        Allow third-party storage blocking setting to change while a page is loaded
     4        https://bugs.webkit.org/show_bug.cgi?id=95790
     5
     6        Reviewed by Brady Eidson.
     7
     8        Update exported symbols.
     9
     10        * Source/autotools/symbols.filter:
     11
    1122012-09-14  Bo Liu  <boliu@chromium.org>
    213
  • trunk/LayoutTests/ChangeLog

    r128652 r128653  
     12012-09-14  Jeffrey Pfau  <jpfau@apple.com>
     2
     3        Allow third-party storage blocking setting to change while a page is loaded
     4        https://bugs.webkit.org/show_bug.cgi?id=95790
     5
     6        Reviewed by Brady Eidson.
     7
     8        Tested combinations of loosening and strengthening the storage blocking policy on various types of storage.
     9
     10        * http/tests/security/resources/iframe-for-storage-blocking-changed-local-storage.html: Added.
     11        * http/tests/security/resources/iframe-for-storage-blocking-changed-shared-worker.html: Added.
     12        * http/tests/security/resources/iframe-for-storage-blocking-changed-websql.html: Added.
     13        * http/tests/security/storage-blocking-loosened-local-storage-expected.txt: Added.
     14        * http/tests/security/storage-blocking-loosened-local-storage.html: Added.
     15        * http/tests/security/storage-blocking-loosened-plugin-expected.txt: Added.
     16        * http/tests/security/storage-blocking-loosened-plugin.html: Added.
     17        * http/tests/security/storage-blocking-loosened-private-browsing-plugin-expected.txt: Added.
     18        * http/tests/security/storage-blocking-loosened-private-browsing-plugin.html: Added.
     19        * http/tests/security/storage-blocking-loosened-shared-worker-expected.txt: Added.
     20        * http/tests/security/storage-blocking-loosened-shared-worker.html: Added.
     21        * http/tests/security/storage-blocking-loosened-websql-expected.txt: Added.
     22        * http/tests/security/storage-blocking-loosened-websql.html: Added.
     23        * http/tests/security/storage-blocking-strengthened-local-storage-expected.txt: Added.
     24        * http/tests/security/storage-blocking-strengthened-local-storage.html: Added.
     25        * http/tests/security/storage-blocking-strengthened-plugin-expected.txt: Added.
     26        * http/tests/security/storage-blocking-strengthened-plugin.html: Added.
     27        * http/tests/security/storage-blocking-strengthened-private-browsing-plugin-expected.txt: Added.
     28        * http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html: Added.
     29        * http/tests/security/storage-blocking-strengthened-shared-worker-expected.txt: Added.
     30        * http/tests/security/storage-blocking-strengthened-shared-worker.html: Added.
     31        * http/tests/security/storage-blocking-strengthened-websql-expected.txt: Added.
     32        * http/tests/security/storage-blocking-strengthened-websql.html: Added.
     33        * platform/chromium/TestExpectations: Skip shared worker and plugin tests.
     34        * platform/mac-wk2/http/tests/security/storage-blocking-strengthened-plugin-expected.txt: Added.
     35        * platform/mac-wk2/http/tests/security/storage-blocking-strengthened-private-browsing-plugin-expected.txt: Added.
     36
    1372012-09-14  Beth Dakin  <bdakin@apple.com>
    238
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r128639 r128653  
    538538WONTFIX SKIP : http/tests/security/cross-origin-shared-worker-allowed.html = TEXT
    539539WONTFIX SKIP : http/tests/security/same-origin-shared-worker-blocked.html = TEXT
     540WONTFIX SKIP : http/tests/security/storage-blocking-loosened-shared-worker.html = TEXT
     541WONTFIX SKIP : http/tests/security/storage-blocking-strengthened-shared-worker.html = TEXT
    540542WONTFIX SKIP : storage/indexeddb/basics-shared-workers.html = PASS
    541543
     
    612614// We do not use Safari's private browsing mode.
    613615WONTFIX SKIP : http/tests/security/cross-frame-access-private-browsing.html = PASS
     616WONTFIX SKIP : http/tests/security/storage-blocking-loosened-plugin.html = PASS
     617WONTFIX SKIP : http/tests/security/storage-blocking-loosened-private-browsing-plugin.html = PASS
     618WONTFIX SKIP : http/tests/security/storage-blocking-strengthened-plugin.html = PASS
     619WONTFIX SKIP : http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html = PASS
    614620WONTFIX SKIP : plugins/private-browsing-mode.html = PASS
    615621WONTFIX SKIP : plugins/private-browsing-mode-2.html = TEXT
  • trunk/Source/WebCore/ChangeLog

    r128651 r128653  
     12012-09-14  Jeffrey Pfau  <jpfau@apple.com>
     2
     3        Allow third-party storage blocking setting to change while a page is loaded
     4        https://bugs.webkit.org/show_bug.cgi?id=95790
     5
     6        Reviewed by Brady Eidson.
     7
     8        Pipe through changes to the storage blocking policy to each document and plugin.
     9
     10        Tests: http/tests/security/storage-blocking-loosened-local-storage.html
     11               http/tests/security/storage-blocking-loosened-plugin.html
     12               http/tests/security/storage-blocking-loosened-private-browsing-plugin.html
     13               http/tests/security/storage-blocking-loosened-shared-worker.html
     14               http/tests/security/storage-blocking-loosened-websql.html
     15               http/tests/security/storage-blocking-strengthened-local-storage.html
     16               http/tests/security/storage-blocking-strengthened-plugin.html
     17               http/tests/security/storage-blocking-strengthened-private-browsing-plugin.html
     18               http/tests/security/storage-blocking-strengthened-shared-worker.html
     19               http/tests/security/storage-blocking-strengthened-websql.html
     20
     21        * WebCore.exp.in:
     22        * dom/Document.cpp: Pipe changes through to the Document's SecurityOrigin.
     23        (WebCore::Document::storageBlockingStateDidChange):
     24        (WebCore):
     25        * dom/Document.h:
     26        (Document):
     27        * page/DOMWindow.cpp: Check to make sure access is allowed before returning a cached storage area.
     28        (WebCore::DOMWindow::sessionStorage):
     29        (WebCore::DOMWindow::localStorage):
     30        * page/Page.cpp:
     31        (WebCore::Page::collectPluginViews): Refactored out into a function.
     32        (WebCore):
     33        (WebCore::Page::storageBlockingStateChanged): Pipe changes through to each PluginView.
     34        (WebCore::Page::privateBrowsingStateChanged):
     35        * page/Page.h:
     36        (Page):
     37        * page/Settings.cpp:
     38        (WebCore::Settings::setStorageBlockingPolicy): Tell Pages about changes to the storage blocking policy.
     39        (WebCore):
     40        * page/Settings.h:
     41        (Settings):
     42        * plugins/PluginViewBase.h:
     43        (WebCore::PluginViewBase::storageBlockingStateChanged):
     44
    1452012-09-14  Dan Carney  <dcarney@google.com>
    246
  • trunk/Source/WebCore/WebCore.exp.in

    r128645 r128653  
    883883__ZN7WebCore8Settings24setDNSPrefetchingEnabledEb
    884884__ZN7WebCore8Settings24setMockScrollbarsEnabledEb
     885__ZN7WebCore8Settings24setStorageBlockingPolicyENS_14SecurityOrigin21StorageBlockingPolicyE
    885886__ZN7WebCore8Settings24setTextAreasAreResizableEb
    886887__ZN7WebCore8Settings25setDeveloperExtrasEnabledEb
  • trunk/Source/WebCore/dom/Document.cpp

    r128650 r128653  
    45534553}
    45544554
     4555void Document::storageBlockingStateDidChange()
     4556{
     4557    if (Settings* settings = this->settings())
     4558        securityOrigin()->setStorageBlockingPolicy(settings->storageBlockingPolicy());
     4559}
     4560
    45554561void Document::privateBrowsingStateDidChange()
    45564562{
  • trunk/Source/WebCore/dom/Document.h

    r128594 r128653  
    10211021    void registerForPrivateBrowsingStateChangedCallbacks(Element*);
    10221022    void unregisterForPrivateBrowsingStateChangedCallbacks(Element*);
     1023    void storageBlockingStateDidChange();
    10231024    void privateBrowsingStateDidChange();
    10241025
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r128208 r128653  
    736736    if (!isCurrentlyDisplayedInFrame())
    737737        return 0;
     738
     739    Document* document = this->document();
     740    if (!document)
     741        return 0;
     742
     743    if (!document->securityOrigin()->canAccessLocalStorage(document->topDocument()->securityOrigin())) {
     744        ec = SECURITY_ERR;
     745        return 0;
     746    }
     747
    738748    if (m_sessionStorage)
    739749        return m_sessionStorage.get();
    740750
     751    Page* page = document->page();
     752    if (!page)
     753        return 0;
     754
     755    RefPtr<StorageArea> storageArea = page->sessionStorage()->storageArea(document->securityOrigin());
     756    InspectorInstrumentation::didUseDOMStorage(page, storageArea.get(), false, m_frame);
     757
     758    m_sessionStorage = Storage::create(m_frame, storageArea.release());
     759    return m_sessionStorage.get();
     760}
     761
     762Storage* DOMWindow::localStorage(ExceptionCode& ec) const
     763{
     764    if (!isCurrentlyDisplayedInFrame())
     765        return 0;
     766
    741767    Document* document = this->document();
    742768    if (!document)
     
    748774    }
    749775
    750     Page* page = document->page();
    751     if (!page)
    752         return 0;
    753 
    754     RefPtr<StorageArea> storageArea = page->sessionStorage()->storageArea(document->securityOrigin());
    755     InspectorInstrumentation::didUseDOMStorage(page, storageArea.get(), false, m_frame);
    756 
    757     m_sessionStorage = Storage::create(m_frame, storageArea.release());
    758     return m_sessionStorage.get();
    759 }
    760 
    761 Storage* DOMWindow::localStorage(ExceptionCode& ec) const
    762 {
    763     if (!isCurrentlyDisplayedInFrame())
    764         return 0;
    765776    if (m_localStorage)
    766777        return m_localStorage.get();
    767 
    768     Document* document = this->document();
    769     if (!document)
    770         return 0;
    771 
    772     if (!document->securityOrigin()->canAccessLocalStorage(document->topDocument()->securityOrigin())) {
    773         ec = SECURITY_ERR;
    774         return 0;
    775     }
    776778
    777779    Page* page = document->page();
  • trunk/Source/WebCore/page/Page.cpp

    r128394 r128653  
    5656#include "PluginData.h"
    5757#include "PluginView.h"
    58 #include "PluginViewBase.h"
    5958#include "PointerLockController.h"
    6059#include "ProgressTracker.h"
     
    10311030}
    10321031
    1033 void Page::privateBrowsingStateChanged()
    1034 {
    1035     bool privateBrowsingEnabled = m_settings->privateBrowsingEnabled();
    1036 
    1037     for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
    1038         frame->document()->privateBrowsingStateDidChange();
    1039 
    1040     // Collect the PluginViews in to a vector to ensure that action the plug-in takes
    1041     // from below privateBrowsingStateChanged does not affect their lifetime.
    1042     Vector<RefPtr<PluginViewBase>, 32> pluginViewBases;
     1032void Page::collectPluginViews(Vector<RefPtr<PluginViewBase>, 32>& pluginViewBases)
     1033{
    10431034    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext()) {
    10441035        FrameView* view = frame->view();
     
    10561047        }
    10571048    }
     1049}
     1050
     1051void Page::storageBlockingStateChanged()
     1052{
     1053    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
     1054        frame->document()->storageBlockingStateDidChange();
     1055
     1056    // Collect the PluginViews in to a vector to ensure that action the plug-in takes
     1057    // from below storageBlockingStateChanged does not affect their lifetime.
     1058    Vector<RefPtr<PluginViewBase>, 32> pluginViewBases;
     1059    collectPluginViews(pluginViewBases);
     1060
     1061    for (size_t i = 0; i < pluginViewBases.size(); ++i)
     1062        pluginViewBases[i]->storageBlockingStateChanged();
     1063}
     1064
     1065void Page::privateBrowsingStateChanged()
     1066{
     1067    bool privateBrowsingEnabled = m_settings->privateBrowsingEnabled();
     1068
     1069    for (Frame* frame = mainFrame(); frame; frame = frame->tree()->traverseNext())
     1070        frame->document()->privateBrowsingStateDidChange();
     1071
     1072    // Collect the PluginViews in to a vector to ensure that action the plug-in takes
     1073    // from below privateBrowsingStateChanged does not affect their lifetime.
     1074    Vector<RefPtr<PluginViewBase>, 32> pluginViewBases;
     1075    collectPluginViews(pluginViewBases);
    10581076
    10591077    for (size_t i = 0; i < pluginViewBases.size(); ++i)
  • trunk/Source/WebCore/page/Page.h

    r128394 r128653  
    2828#include "Pagination.h"
    2929#include "PlatformScreen.h"
     30#include "PluginViewBase.h"
    3031#include "Region.h"
    3132#include "Supplementable.h"
     
    278279
    279280        void dnsPrefetchingStateChanged();
     281        void storageBlockingStateChanged();
    280282        void privateBrowsingStateChanged();
    281283
     
    357359        double minimumTimerInterval() const;
    358360
     361        void collectPluginViews(Vector<RefPtr<PluginViewBase>, 32>& pluginViewBases);
     362
    359363        OwnPtr<Chrome> m_chrome;
    360364        OwnPtr<DragCaretController> m_dragCaretController;
  • trunk/Source/WebCore/page/Settings.cpp

    r128645 r128653  
    937937}
    938938
     939void Settings::setStorageBlockingPolicy(SecurityOrigin::StorageBlockingPolicy enabled)
     940{
     941    if (m_storageBlockingPolicy == enabled)
     942        return;
     943
     944    m_storageBlockingPolicy = enabled;
     945    m_page->storageBlockingStateChanged();
     946}
     947
    939948void Settings::setTiledBackingStoreEnabled(bool enabled)
    940949{
  • trunk/Source/WebCore/page/Settings.h

    r128645 r128653  
    603603        bool windowFocusRestricted() const { return m_windowFocusRestricted; }
    604604
    605         void setStorageBlockingPolicy(SecurityOrigin::StorageBlockingPolicy policy) { m_storageBlockingPolicy = policy; }
     605        void setStorageBlockingPolicy(SecurityOrigin::StorageBlockingPolicy);
    606606        SecurityOrigin::StorageBlockingPolicy storageBlockingPolicy() const { return m_storageBlockingPolicy; }
    607607
  • trunk/Source/WebCore/plugins/PluginViewBase.h

    r124954 r128653  
    5050
    5151    virtual JSC::JSObject* scriptObject(JSC::JSGlobalObject*) { return 0; }
     52    virtual void storageBlockingStateChanged() { }
    5253    virtual void privateBrowsingStateChanged(bool) { }
    5354    virtual bool getFormValue(String&) { return false; }
  • trunk/Source/WebKit2/ChangeLog

    r128652 r128653  
     12012-09-14  Jeffrey Pfau  <jpfau@apple.com>
     2
     3        Allow third-party storage blocking setting to change while a page is loaded
     4        https://bugs.webkit.org/show_bug.cgi?id=95790
     5
     6        Reviewed by Brady Eidson.
     7
     8        Inform plugins about changes to the storage blocking policy by way of the private browsing feature.
     9
     10        * PluginProcess/PluginControllerProxy.cpp:
     11        (WebKit::PluginControllerProxy::storageBlockingStateChanged):
     12        (WebKit):
     13        * PluginProcess/PluginControllerProxy.h:
     14        (PluginControllerProxy):
     15        * PluginProcess/PluginControllerProxy.messages.in: Add WK2 message for storageBlockingStateChanged.
     16        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
     17        (WebKit::NetscapePlugin::storageBlockingStateChanged):
     18        (WebKit):
     19        (WebKit::NetscapePlugin::privateBrowsingStateChanged):
     20        (WebKit::NetscapePlugin::updateNPNPrivateMode): Set plugin's private browsing if either private browsing or storage blocking is enabled.
     21        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
     22        (NetscapePlugin):
     23        * WebProcess/Plugins/PDF/BuiltInPDFView.h:
     24        (BuiltInPDFView):
     25        * WebProcess/Plugins/PDF/BuiltInPDFView.mm: Treat storageBlockingStateChanged as a no-op.
     26        (WebKit::BuiltInPDFView::storageBlockingStateChanged):
     27        (WebKit):
     28        * WebProcess/Plugins/Plugin.h: Add pure virtual storageBlockingStateChanged method.
     29        (Plugin):
     30        * WebProcess/Plugins/PluginProxy.cpp:
     31        (WebKit::PluginProxy::storageBlockingStateChanged):
     32        (WebKit):
     33        * WebProcess/Plugins/PluginProxy.h:
     34        (PluginProxy):
     35        * WebProcess/Plugins/PluginView.cpp:
     36        (WebKit::PluginView::storageBlockingStateChanged):
     37        (WebKit):
     38        * WebProcess/Plugins/PluginView.h:
     39        (PluginView):
     40        * win/WebKit2.def:
     41
    1422012-09-14  Beth Dakin  <bdakin@apple.com>
    243
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp

    r125457 r128653  
    564564}
    565565
     566void PluginControllerProxy::storageBlockingStateChanged(bool isStorageBlockingEnabled)
     567{
     568    if (m_storageBlockingEnabled != isStorageBlockingEnabled) {
     569        m_storageBlockingEnabled = isStorageBlockingEnabled;
     570        m_plugin->storageBlockingStateChanged(m_storageBlockingEnabled);
     571    }
     572}
     573
    566574void PluginControllerProxy::privateBrowsingStateChanged(bool isPrivateBrowsingEnabled)
    567575{
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h

    r125457 r128653  
    3636#include "WebProcessConnectionMessages.h"
    3737#include <WebCore/RunLoop.h>
     38#include <WebCore/SecurityOrigin.h>
    3839#include <wtf/Noncopyable.h>
    3940
     
    153154#endif
    154155
     156    void storageBlockingStateChanged(bool);
    155157    void privateBrowsingStateChanged(bool);
    156158    void getFormValue(bool& returnValue, String& formValue);
     
    164166
    165167    String m_userAgent;
     168    bool m_storageBlockingEnabled;
    166169    bool m_isPrivateBrowsingEnabled;
    167170    bool m_isAcceleratedCompositingEnabled;
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.messages.in

    r112338 r128653  
    107107    Snapshot() -> (WebKit::ShareableBitmap::Handle backingStoreHandle)
    108108   
     109    # Sent when storage blocking policy changes
     110    StorageBlockingStateChanged(bool storageBlockingEnabled)
     111
    109112    # Sent when private browsing is enabled or disabled
    110113    PrivateBrowsingStateChanged(bool isPrivateBrowsingEnabled)
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp

    r128271 r128653  
    947947}
    948948
     949void NetscapePlugin::storageBlockingStateChanged(bool storageBlockingEnabled)
     950{
     951    if (m_storageBlockingState != storageBlockingEnabled) {
     952        m_storageBlockingState = storageBlockingEnabled;
     953        updateNPNPrivateMode();
     954    }
     955}
     956
    949957void NetscapePlugin::privateBrowsingStateChanged(bool privateBrowsingEnabled)
     958{
     959    if (m_privateBrowsingState != privateBrowsingEnabled) {
     960        m_privateBrowsingState = privateBrowsingEnabled;
     961        updateNPNPrivateMode();
     962    }
     963}
     964
     965void NetscapePlugin::updateNPNPrivateMode()
    950966{
    951967    ASSERT(m_isStarted);
     
    956972    //   Plugins should check the boolean value pointed to, not the pointer itself.
    957973    //   The value will be true when private mode is on.
    958     NPBool value = privateBrowsingEnabled;
     974    NPBool value = m_privateBrowsingState || m_storageBlockingState;
    959975    NPP_SetValue(NPNVprivateModeBool, &value);
    960976}
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h

    r128271 r128653  
    222222
    223223    virtual void contentsScaleFactorChanged(float);
     224    virtual void storageBlockingStateChanged(bool);
    224225    virtual void privateBrowsingStateChanged(bool);
    225226    virtual bool getFormValue(String& formValue);
     
    236237    // converted (if the transformation matrix isn't invertible).
    237238    bool convertFromRootView(const WebCore::IntPoint& pointInRootViewCoordinates, WebCore::IntPoint& pointInPluginCoordinates);
     239
     240    void updateNPNPrivateMode();
    238241
    239242#if PLUGIN_ARCHITECTURE(WIN)
     
    312315    TimerMap m_timers;
    313316    unsigned m_nextTimerID;
     317
     318    bool m_privateBrowsingState;
     319    bool m_storageBlockingState;
    314320
    315321#if PLUGIN_ARCHITECTURE(MAC)
  • trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.h

    r128134 r128653  
    113113#endif
    114114
     115    virtual void storageBlockingStateChanged(bool);
    115116    virtual void privateBrowsingStateChanged(bool);
    116117    virtual bool getFormValue(String& formValue);
  • trunk/Source/WebKit2/WebProcess/Plugins/PDF/BuiltInPDFView.mm

    r128134 r128653  
    661661#endif
    662662
     663void BuiltInPDFView::storageBlockingStateChanged(bool)
     664{
     665}
     666
    663667void BuiltInPDFView::privateBrowsingStateChanged(bool)
    664668{
  • trunk/Source/WebKit2/WebProcess/Plugins/Plugin.h

    r128088 r128653  
    3030#include <WebCore/KURL.h>
    3131#include <WebCore/ScrollTypes.h>
     32#include <WebCore/SecurityOrigin.h>
    3233#include <wtf/RefCounted.h>
    3334#include <wtf/RetainPtr.h>
     
    217218    virtual void contentsScaleFactorChanged(float) = 0;
    218219
     220    // Called when the storage blocking policy for this plug-in changes.
     221    virtual void storageBlockingStateChanged(bool) = 0;
     222
    219223    // Called when the private browsing state for this plug-in changes.
    220224    virtual void privateBrowsingStateChanged(bool) = 0;
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp

    r128088 r128653  
    453453}
    454454
     455void PluginProxy::storageBlockingStateChanged(bool isStorageBlockingEnabled)
     456{
     457    m_connection->connection()->send(Messages::PluginControllerProxy::StorageBlockingStateChanged(isStorageBlockingEnabled), m_pluginInstanceID);
     458}
     459
    455460void PluginProxy::privateBrowsingStateChanged(bool isPrivateBrowsingEnabled)
    456461{
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h

    r128088 r128653  
    3333#include <WebCore/AffineTransform.h>
    3434#include <WebCore/IntRect.h>
     35#include <WebCore/SecurityOrigin.h>
    3536
    3637#if PLATFORM(MAC)
     
    112113
    113114    virtual void contentsScaleFactorChanged(float);
     115    virtual void storageBlockingStateChanged(bool);
    114116    virtual void privateBrowsingStateChanged(bool);
    115117    virtual bool getFormValue(String& formValue);
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp

    r128088 r128653  
    571571}
    572572
     573void PluginView::storageBlockingStateChanged()
     574{
     575    // The plug-in can be null here if it failed to initialize.
     576    if (!m_isInitialized || !m_plugin)
     577        return;
     578
     579    bool storageBlockingPolicy = !frame()->document()->securityOrigin()->canAccessPluginStorage(frame()->tree()->top()->document()->securityOrigin());
     580
     581    m_plugin->storageBlockingStateChanged(storageBlockingPolicy);
     582}
     583
    573584void PluginView::privateBrowsingStateChanged(bool privateBrowsingEnabled)
    574585{
    575586    // The plug-in can be null here if it failed to initialize.
    576587    if (!m_isInitialized || !m_plugin)
    577         return;
    578 
    579     if (!privateBrowsingEnabled && !frame()->document()->securityOrigin()->canAccessPluginStorage(frame()->tree()->top()->document()->securityOrigin()))
    580588        return;
    581589
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h

    r127752 r128653  
    110110#endif
    111111    virtual JSC::JSObject* scriptObject(JSC::JSGlobalObject*);
     112    virtual void storageBlockingStateChanged();
    112113    virtual void privateBrowsingStateChanged(bool);
    113114    virtual bool getFormValue(String&);
  • trunk/Source/WebKit2/win/WebKit2.def

    r128645 r128653  
    238238        ?setSerifFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
    239239        ?setStandardFontFamily@Settings@WebCore@@QAEXABVAtomicString@WTF@@W4UScriptCode@@@Z
     240        ?setStorageBlockingPolicy@Settings@WebCore@@QAEXW4StorageBlockingPolicy@SecurityOrigin@2@@Z
    240241        ?setSuggestedValue@HTMLInputElement@WebCore@@QAEXABVString@WTF@@@Z
    241242        ?setEditingValue@HTMLInputElement@WebCore@@QAEXABVString@WTF@@@Z
  • trunk/Source/autotools/symbols.filter

    r128645 r128653  
    156156_ZN7WebCore8Settings23setPictographFontFamilyERKN3WTF12AtomicStringE11UScriptCode;
    157157_ZN7WebCore8Settings24setMockScrollbarsEnabledEb;
     158_ZN7WebCore8Settings24setStorageBlockingPolicyENS_14SecurityOrigin21StorageBlockingPolicyE;
    158159_ZN7WebCore8Settings37setFixedElementsLayoutRelativeToFrameEb;
    159160_ZN7WebCore9FrameView17paintControlTintsEv;
Note: See TracChangeset for help on using the changeset viewer.