Changeset 282105 in webkit


Ignore:
Timestamp:
Sep 7, 2021 12:38:07 PM (11 months ago)
Author:
Chris Dumez
Message:

Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel
https://bugs.webkit.org/show_bug.cgi?id=229814

Reviewed by Alex Christensen.

Source/WebCore:

Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel to address privacy
concerns, as discussed here:

Test: http/tests/messaging/broadcastchannel-partitioning.html

  • dom/BroadcastChannel.cpp:

(WebCore::BroadcastChannel::BroadcastChannel):
(WebCore::m_identifier):
(WebCore::BroadcastChannel::dispatchMessage):

  • dom/BroadcastChannel.h:
  • dom/BroadcastChannelRegistry.h:
  • loader/EmptyClients.cpp:

Source/WebKit:

Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel to address privacy
concerns, as discussed here:

  • NetworkProcess/NetworkBroadcastChannelRegistry.cpp:

(WebKit::NetworkBroadcastChannelRegistry::registerChannel):
(WebKit::NetworkBroadcastChannelRegistry::unregisterChannel):
(WebKit::NetworkBroadcastChannelRegistry::postMessage):
(WebKit::NetworkBroadcastChannelRegistry::removeConnection):

  • NetworkProcess/NetworkBroadcastChannelRegistry.h:
  • NetworkProcess/NetworkBroadcastChannelRegistry.messages.in:
  • WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp:

(WebKit::WebBroadcastChannelRegistry::registerChannel):
(WebKit::WebBroadcastChannelRegistry::unregisterChannel):
(WebKit::WebBroadcastChannelRegistry::postMessage):

  • WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h:

Source/WebKitLegacy:

Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel to address privacy
concerns, as discussed here:

  • WebCoreSupport/WebBroadcastChannelRegistry.cpp:

(WebBroadcastChannelRegistry::registerChannel):
(WebBroadcastChannelRegistry::unregisterChannel):
(WebBroadcastChannelRegistry::postMessage):

  • WebCoreSupport/WebBroadcastChannelRegistry.h:

Source/WTF:

Add experimental preference for BroadcastChannel origin partitioning. This is useful because we currently
disable this when running web-platform-tests in WKTR / DRT for now.

  • Scripts/Preferences/WebPreferencesExperimental.yaml:

Tools:

Disable BroadcastChannel origin partitioning when running layout tests since it would cause
too many test failures in WPT tests at this point (e.g. COOP/COEP tests).

  • TestRunnerShared/TestFeatures.cpp:

(WTR::shouldDisableBroadcastChannelOriginPartitioning):
(WTR::hardcodedFeaturesBasedOnPathForTest):

  • WebKitTestRunner/TestController.cpp:

(WTR::TestController::resetPreferencesToConsistentValues):

  • WebKitTestRunner/TestOptions.cpp:

(WTR::TestOptions::defaults):

LayoutTests:

Add layout test coverage.

  • http/tests/messaging/broadcastchannel-partitioning-expected.txt: Added.
  • http/tests/messaging/broadcastchannel-partitioning.html: Added.
  • http/tests/messaging/resources/broadcastchannel-partitioning-iframe.html: Added.
  • http/tests/messaging/resources/broadcastchannel-partitioning-popup.html: Added.
Location:
trunk
Files:
4 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r282104 r282105  
     12021-09-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel
     4        https://bugs.webkit.org/show_bug.cgi?id=229814
     5
     6        Reviewed by Alex Christensen.
     7
     8        Add layout test coverage.
     9
     10        * http/tests/messaging/broadcastchannel-partitioning-expected.txt: Added.
     11        * http/tests/messaging/broadcastchannel-partitioning.html: Added.
     12        * http/tests/messaging/resources/broadcastchannel-partitioning-iframe.html: Added.
     13        * http/tests/messaging/resources/broadcastchannel-partitioning-popup.html: Added.
     14
    1152021-09-07  Ayumi Kojima  <ayumi_kojima@apple.com>
    216
  • trunk/LayoutTests/platform/win/TestExpectations

    r282022 r282105  
    46374637fast/text/offsetForPosition-complex-fallback.html [ Pass Failure ]
    46384638
    4639 # testRunner.setShouldSwapToEphemeralSessionOnNextNavigation() does not work with window.open() in DRT.
     4639# No BroadcastChannel support on Windows.
    46404640fast/html/broadcast-channel-between-different-sessions.html [ Skip ]
     4641http/tests/messaging/broadcastchannel-partitioning.html [ Skip ]
    46414642
    46424643# This test is skipped because the necessary feature flag functionality specific to the Windows WebKit legacy port is
  • trunk/Source/WTF/ChangeLog

    r282061 r282105  
     12021-09-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel
     4        https://bugs.webkit.org/show_bug.cgi?id=229814
     5
     6        Reviewed by Alex Christensen.
     7
     8        Add experimental preference for BroadcastChannel origin partitioning. This is useful because we currently
     9        disable this when running web-platform-tests in WKTR / DRT for now.
     10
     11        * Scripts/Preferences/WebPreferencesExperimental.yaml:
     12
    1132021-09-06  Dmitry Kalinkin  <dmitry.kalinkin+webkit@gmail.com>
    214
  • trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml

    r282007 r282105  
    8888      default: true
    8989
    90 # We have to resolve the privacy issue in https://github.com/whatwg/html/issues/5803 before we can enable this.
     90# We would have to partition BroadcastChannel based on PageGroups if we wanted to enable this for WebKitLegacy.
    9191BroadcastChannelEnabled:
    9292  type: bool
     
    100100    WebCore:
    101101      default: false
     102
     103BroadcastChannelOriginPartitioningEnabled:
     104  type: bool
     105  defaultValue:
     106    WebKitLegacy:
     107      default: true
     108    WebKit:
     109      default: true
     110    WebCore:
     111      default: true
    102112
    103113CFNetworkNetworkLoaderEnabled:
  • trunk/Source/WebCore/ChangeLog

    r282097 r282105  
     12021-09-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel
     4        https://bugs.webkit.org/show_bug.cgi?id=229814
     5
     6        Reviewed by Alex Christensen.
     7
     8        Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel to address privacy
     9        concerns, as discussed here:
     10        - https://github.com/whatwg/html/issues/5803
     11
     12        Test: http/tests/messaging/broadcastchannel-partitioning.html
     13
     14        * dom/BroadcastChannel.cpp:
     15        (WebCore::BroadcastChannel::BroadcastChannel):
     16        (WebCore::m_identifier):
     17        (WebCore::BroadcastChannel::dispatchMessage):
     18        * dom/BroadcastChannel.h:
     19        * dom/BroadcastChannelRegistry.h:
     20        * loader/EmptyClients.cpp:
     21
    1222021-09-07  Kimmo Kinnunen  <kkinnunen@apple.com>
    223
  • trunk/Source/WebCore/dom/BroadcastChannel.cpp

    r280547 r282105  
    6161    : ActiveDOMObject(&context)
    6262    , m_name(name)
    63     , m_origin(context.securityOrigin()->data())
     63    , m_origin { context.settingsValues().broadcastChannelOriginPartitioningEnabled ? context.topOrigin().data() : context.securityOrigin()->data(), context.securityOrigin()->data() }
    6464    , m_identifier(BroadcastChannelIdentifier::generateThreadSafe())
    6565{
     
    151151    queueTaskKeepingObjectAlive(*this, TaskSource::PostedMessageQueue, [this, message = WTFMove(message)]() mutable {
    152152        if (!m_isClosed)
    153             dispatchEvent(MessageEvent::create({ }, WTFMove(message), m_origin.toString()));
     153            dispatchEvent(MessageEvent::create({ }, WTFMove(message), m_origin.clientOrigin.toString()));
    154154    });
    155155}
  • trunk/Source/WebCore/dom/BroadcastChannel.h

    r280547 r282105  
    2828#include "ActiveDOMObject.h"
    2929#include "BroadcastChannelIdentifier.h"
     30#include "ClientOrigin.h"
    3031#include "EventTarget.h"
    3132#include "ExceptionOr.h"
    32 #include "SecurityOriginData.h"
    3333#include <wtf/Forward.h>
    3434#include <wtf/RefCounted.h>
     
    8484
    8585    const String m_name;
    86     const SecurityOriginData m_origin;
     86    const ClientOrigin m_origin;
    8787    const BroadcastChannelIdentifier m_identifier;
    8888    bool m_isClosed { false };
  • trunk/Source/WebCore/dom/BroadcastChannelRegistry.h

    r280547 r282105  
    3333
    3434class SerializedScriptValue;
    35 struct SecurityOriginData;
     35struct ClientOrigin;
    3636
    3737class BroadcastChannelRegistry : public RefCounted<BroadcastChannelRegistry> {
    3838public:
    3939    virtual ~BroadcastChannelRegistry() { }
    40     virtual void registerChannel(const SecurityOriginData&, const String& name, BroadcastChannelIdentifier) = 0;
    41     virtual void unregisterChannel(const SecurityOriginData&, const String& name, BroadcastChannelIdentifier) = 0;
    42     virtual void postMessage(const SecurityOriginData&, const String& name, BroadcastChannelIdentifier source, Ref<SerializedScriptValue>&&, CompletionHandler<void()>&&) = 0;
     40    virtual void registerChannel(const ClientOrigin&, const String& name, BroadcastChannelIdentifier) = 0;
     41    virtual void unregisterChannel(const ClientOrigin&, const String& name, BroadcastChannelIdentifier) = 0;
     42    virtual void postMessage(const ClientOrigin&, const String& name, BroadcastChannelIdentifier source, Ref<SerializedScriptValue>&&, CompletionHandler<void()>&&) = 0;
    4343};
    4444
  • trunk/Source/WebCore/loader/EmptyClients.cpp

    r281832 r282105  
    11751175    EmptyBroadcastChannelRegistry() = default;
    11761176
    1177     void registerChannel(const SecurityOriginData&, const String&, BroadcastChannelIdentifier) final { }
    1178     void unregisterChannel(const SecurityOriginData&, const String&, BroadcastChannelIdentifier) final { }
    1179     void postMessage(const SecurityOriginData&, const String&, BroadcastChannelIdentifier, Ref<SerializedScriptValue>&&, CompletionHandler<void()>&&) final { }
     1177    void registerChannel(const ClientOrigin&, const String&, BroadcastChannelIdentifier) final { }
     1178    void unregisterChannel(const ClientOrigin&, const String&, BroadcastChannelIdentifier) final { }
     1179    void postMessage(const ClientOrigin&, const String&, BroadcastChannelIdentifier, Ref<SerializedScriptValue>&&, CompletionHandler<void()>&&) final { }
    11801180};
    11811181
  • trunk/Source/WebKit/ChangeLog

    r282090 r282105  
     12021-09-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel
     4        https://bugs.webkit.org/show_bug.cgi?id=229814
     5
     6        Reviewed by Alex Christensen.
     7
     8        Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel to address privacy
     9        concerns, as discussed here:
     10        - https://github.com/whatwg/html/issues/5803
     11
     12        * NetworkProcess/NetworkBroadcastChannelRegistry.cpp:
     13        (WebKit::NetworkBroadcastChannelRegistry::registerChannel):
     14        (WebKit::NetworkBroadcastChannelRegistry::unregisterChannel):
     15        (WebKit::NetworkBroadcastChannelRegistry::postMessage):
     16        (WebKit::NetworkBroadcastChannelRegistry::removeConnection):
     17        * NetworkProcess/NetworkBroadcastChannelRegistry.h:
     18        * NetworkProcess/NetworkBroadcastChannelRegistry.messages.in:
     19        * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp:
     20        (WebKit::WebBroadcastChannelRegistry::registerChannel):
     21        (WebKit::WebBroadcastChannelRegistry::unregisterChannel):
     22        (WebKit::WebBroadcastChannelRegistry::postMessage):
     23        * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h:
     24
    1252021-09-07  Wenson Hsieh  <wenson_hsieh@apple.com>
    226
  • trunk/Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.cpp

    r280547 r282105  
    3535NetworkBroadcastChannelRegistry::NetworkBroadcastChannelRegistry() = default;
    3636
    37 void NetworkBroadcastChannelRegistry::registerChannel(IPC::Connection& connection, const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier channelIdentifier)
     37void NetworkBroadcastChannelRegistry::registerChannel(IPC::Connection& connection, const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier channelIdentifier)
    3838{
    3939    auto& channelsForOrigin = m_broadcastChannels.ensure(origin, [] { return NameToChannelIdentifiersMap { }; }).iterator->value;
     
    4444}
    4545
    46 void NetworkBroadcastChannelRegistry::unregisterChannel(IPC::Connection& connection, const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier channelIdentifier)
     46void NetworkBroadcastChannelRegistry::unregisterChannel(IPC::Connection& connection, const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier channelIdentifier)
    4747{
    4848    auto channelsForOriginIterator = m_broadcastChannels.find(origin);
     
    6060}
    6161
    62 void NetworkBroadcastChannelRegistry::postMessage(IPC::Connection& connection, const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier source, WebCore::MessageWithMessagePorts&& message, CompletionHandler<void()>&& completionHandler)
     62void NetworkBroadcastChannelRegistry::postMessage(IPC::Connection& connection, const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier source, WebCore::MessageWithMessagePorts&& message, CompletionHandler<void()>&& completionHandler)
    6363{
    6464    auto channelsForOriginIterator = m_broadcastChannels.find(origin);
     
    8787void NetworkBroadcastChannelRegistry::removeConnection(IPC::Connection& connection)
    8888{
    89     Vector<WebCore::SecurityOriginData> originsToRemove;
     89    Vector<WebCore::ClientOrigin> originsToRemove;
    9090    for (auto& entry : m_broadcastChannels) {
    9191        Vector<String> namesToRemove;
  • trunk/Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.h

    r280547 r282105  
    2828#include "Connection.h"
    2929#include <WebCore/BroadcastChannelIdentifier.h>
    30 #include <WebCore/SecurityOriginData.h>
     30#include <WebCore/ClientOrigin.h>
    3131#include <wtf/HashMap.h>
    3232
     
    4646    void didReceiveMessage(IPC::Connection&, IPC::Decoder&);
    4747
    48     void registerChannel(IPC::Connection&, const WebCore::SecurityOriginData&, const String& name, WebCore::BroadcastChannelIdentifier);
    49     void unregisterChannel(IPC::Connection&, const WebCore::SecurityOriginData&, const String& name, WebCore::BroadcastChannelIdentifier);
    50     void postMessage(IPC::Connection&, const WebCore::SecurityOriginData&, const String& name, WebCore::BroadcastChannelIdentifier source, WebCore::MessageWithMessagePorts&&, CompletionHandler<void()>&&);
     48    void registerChannel(IPC::Connection&, const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier);
     49    void unregisterChannel(IPC::Connection&, const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier);
     50    void postMessage(IPC::Connection&, const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier source, WebCore::MessageWithMessagePorts&&, CompletionHandler<void()>&&);
    5151
    5252private:
     
    6161    };
    6262
    63     // FIXME: BroadcastChannel needs partitioning (https://github.com/whatwg/html/issues/5803).
    6463    using NameToChannelIdentifiersMap = HashMap<String, Vector<GlobalBroadcastChannelIdentifier>>;
    65     HashMap<WebCore::SecurityOriginData, NameToChannelIdentifiersMap> m_broadcastChannels;
     64    HashMap<WebCore::ClientOrigin, NameToChannelIdentifiersMap> m_broadcastChannels;
    6665};
    6766
  • trunk/Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.messages.in

    r280547 r282105  
    2222
    2323messages -> NetworkBroadcastChannelRegistry NotRefCounted {
    24     RegisterChannel(struct WebCore::SecurityOriginData origin, String name, WebCore::BroadcastChannelIdentifier channelIdentifier) WantsConnection
    25     UnregisterChannel(struct WebCore::SecurityOriginData origin, String name, WebCore::BroadcastChannelIdentifier channelIdentifier) WantsConnection
    26     PostMessage(struct WebCore::SecurityOriginData origin, String name, WebCore::BroadcastChannelIdentifier source, struct WebCore::MessageWithMessagePorts message) -> () Async WantsConnection
     24    RegisterChannel(struct WebCore::ClientOrigin origin, String name, WebCore::BroadcastChannelIdentifier channelIdentifier) WantsConnection
     25    UnregisterChannel(struct WebCore::ClientOrigin origin, String name, WebCore::BroadcastChannelIdentifier channelIdentifier) WantsConnection
     26    PostMessage(struct WebCore::ClientOrigin origin, String name, WebCore::BroadcastChannelIdentifier source, struct WebCore::MessageWithMessagePorts message) -> () Async WantsConnection
    2727}
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp

    r280547 r282105  
    4040}
    4141
    42 void WebBroadcastChannelRegistry::registerChannel(const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
     42void WebBroadcastChannelRegistry::registerChannel(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
    4343{
    4444    networkProcessConnection().send(Messages::NetworkBroadcastChannelRegistry::RegisterChannel { origin, name, identifier }, 0);
    4545}
    4646
    47 void WebBroadcastChannelRegistry::unregisterChannel(const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
     47void WebBroadcastChannelRegistry::unregisterChannel(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
    4848{
    4949    networkProcessConnection().send(Messages::NetworkBroadcastChannelRegistry::UnregisterChannel { origin, name, identifier }, 0);
    5050}
    5151
    52 void WebBroadcastChannelRegistry::postMessage(const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&& message, CompletionHandler<void()>&& completionHandler)
     52void WebBroadcastChannelRegistry::postMessage(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&& message, CompletionHandler<void()>&& completionHandler)
    5353{
    5454    networkProcessConnection().sendWithAsyncReply(Messages::NetworkBroadcastChannelRegistry::PostMessage { origin, name, source, WebCore::MessageWithMessagePorts { WTFMove(message), { } } }, WTFMove(completionHandler), 0);
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h

    r280547 r282105  
    4242    }
    4343
    44     void registerChannel(const WebCore::SecurityOriginData&, const String& name, WebCore::BroadcastChannelIdentifier) final;
    45     void unregisterChannel(const WebCore::SecurityOriginData&, const String& name, WebCore::BroadcastChannelIdentifier) final;
    46     void postMessage(const WebCore::SecurityOriginData&, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&&, CompletionHandler<void()>&&) final;
     44    void registerChannel(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
     45    void unregisterChannel(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
     46    void postMessage(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&&, CompletionHandler<void()>&&) final;
    4747
    4848    void didReceiveMessage(IPC::Connection&, IPC::Decoder&);
  • trunk/Source/WebKitLegacy/ChangeLog

    r281725 r282105  
     12021-09-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel
     4        https://bugs.webkit.org/show_bug.cgi?id=229814
     5
     6        Reviewed by Alex Christensen.
     7
     8        Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel to address privacy
     9        concerns, as discussed here:
     10        - https://github.com/whatwg/html/issues/5803
     11
     12        * WebCoreSupport/WebBroadcastChannelRegistry.cpp:
     13        (WebBroadcastChannelRegistry::registerChannel):
     14        (WebBroadcastChannelRegistry::unregisterChannel):
     15        (WebBroadcastChannelRegistry::postMessage):
     16        * WebCoreSupport/WebBroadcastChannelRegistry.h:
     17
    1182021-08-27  Russell Epstein  <repstein@apple.com>
    219
  • trunk/Source/WebKitLegacy/WebCoreSupport/WebBroadcastChannelRegistry.cpp

    r280547 r282105  
    4545}
    4646
    47 void WebBroadcastChannelRegistry::registerChannel(const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
     47void WebBroadcastChannelRegistry::registerChannel(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
    4848{
    4949    ASSERT(isMainThread());
     
    5454}
    5555
    56 void WebBroadcastChannelRegistry::unregisterChannel(const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
     56void WebBroadcastChannelRegistry::unregisterChannel(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
    5757{
    5858    ASSERT(isMainThread());
     
    6767}
    6868
    69 void WebBroadcastChannelRegistry::postMessage(const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&& message, CompletionHandler<void()>&& completionHandler)
     69void WebBroadcastChannelRegistry::postMessage(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&& message, CompletionHandler<void()>&& completionHandler)
    7070{
    7171    ASSERT(isMainThread());
  • trunk/Source/WebKitLegacy/WebCoreSupport/WebBroadcastChannelRegistry.h

    r280547 r282105  
    2525
    2626#include <WebCore/BroadcastChannelRegistry.h>
    27 #include <WebCore/SecurityOriginData.h>
     27#include <WebCore/ClientOrigin.h>
    2828#include <wtf/Forward.h>
    2929#include <wtf/WeakPtr.h>
     
    3535    static Ref<WebBroadcastChannelRegistry> getOrCreate(bool privateSession);
    3636
    37     void registerChannel(const WebCore::SecurityOriginData&, const String& name, WebCore::BroadcastChannelIdentifier) final;
    38     void unregisterChannel(const WebCore::SecurityOriginData&, const String& name, WebCore::BroadcastChannelIdentifier) final;
    39     void postMessage(const WebCore::SecurityOriginData&, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&&, CompletionHandler<void()>&&) final;
     37    void registerChannel(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
     38    void unregisterChannel(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
     39    void postMessage(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&&, CompletionHandler<void()>&&) final;
    4040
    4141private:
    4242    WebBroadcastChannelRegistry() = default;
    4343
    44     // FIXME: BroadcastChannel needs partitioning (https://github.com/whatwg/html/issues/5803).
    4544    using NameToChannelIdentifiersMap = HashMap<String, Vector<WebCore::BroadcastChannelIdentifier>>;
    46     HashMap<WebCore::SecurityOriginData, NameToChannelIdentifiersMap> m_channels;
     45    HashMap<WebCore::ClientOrigin, NameToChannelIdentifiersMap> m_channels;
    4746};
  • trunk/Tools/ChangeLog

    r282103 r282105  
     12021-09-07  Chris Dumez  <cdumez@apple.com>
     2
     3        Implement origin partitioning (top-origin/frame-origin) for BroadcastChannel
     4        https://bugs.webkit.org/show_bug.cgi?id=229814
     5
     6        Reviewed by Alex Christensen.
     7
     8        Disable BroadcastChannel origin partitioning when running layout tests since it would cause
     9        too many test failures in WPT tests at this point (e.g. COOP/COEP tests).
     10
     11        * TestRunnerShared/TestFeatures.cpp:
     12        (WTR::shouldDisableBroadcastChannelOriginPartitioning):
     13        (WTR::hardcodedFeaturesBasedOnPathForTest):
     14        * WebKitTestRunner/TestController.cpp:
     15        (WTR::TestController::resetPreferencesToConsistentValues):
     16        * WebKitTestRunner/TestOptions.cpp:
     17        (WTR::TestOptions::defaults):
     18
    1192021-09-07  Chris Dumez  <cdumez@apple.com>
    220
  • trunk/Tools/WebKitTestRunner/TestOptions.cpp

    r281461 r282105  
    6565            { "AsyncFrameScrollingEnabled", false },
    6666            { "AsyncOverflowScrollingEnabled", false },
     67            { "BroadcastChannelOriginPartitioningEnabled", false },
    6768            { "CSSOMViewScrollingAPIEnabled", true },
    6869            { "CaptureAudioInGPUProcessEnabled", captureAudioInGPUProcessEnabledValue },
Note: See TracChangeset for help on using the changeset viewer.