Skip to content

Commit 7112496

Browse files
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: - whatwg/html#5803 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: - whatwg/html#5803 * 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: - whatwg/html#5803 * 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. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@282105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 2ee20f4 commit 7112496

24 files changed

+253
-42
lines changed

LayoutTests/ChangeLog

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
2021-09-07 Chris Dumez <[email protected]>
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+
115
2021-09-07 Ayumi Kojima <[email protected]>
216

317
[iOS, BigSur+] webrtc/datachannel/getStats-no-prflx-remote-candidate.html is a flaky timeout.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Tests that BroadcastChannel is partioning based on top origin / frame origin.
2+
3+
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
4+
5+
6+
PASS Received message from same-origin popup
7+
PASS gotMessageFromSameOriginPopup is false
8+
PASS Received message from same-origin iframe under same-origin popup
9+
PASS gotMessageFromSameOriginIframeUnderSameOriginPopup is false
10+
PASS successfullyParsed is true
11+
12+
TEST COMPLETE
13+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<!DOCTYPE html><!-- webkit-test-runner [ BroadcastChannelOriginPartitioningEnabled=true ] -->
2+
<html>
3+
<body>
4+
<script src="/js-test-resources/js-test.js"></script>
5+
<script>
6+
description("Tests that BroadcastChannel is partioning based on top origin / frame origin.");
7+
jsTestIsAsync = true;
8+
9+
if (window.testRunner)
10+
testRunner.setCanOpenWindows();
11+
12+
let bc = new BroadcastChannel("broadcastchannel-partitioning");
13+
14+
let gotMessageFromSameOriginPopup = false;
15+
let gotMessageFromSameOriginIframeUnderSameOriginPopup = false;
16+
bc.onmessage = (message) => {
17+
if (message.data == "same-origin-popup") {
18+
testPassed("Received message from same-origin popup");
19+
shouldBeFalse("gotMessageFromSameOriginPopup");
20+
gotMessageFromSameOriginPopup = true;
21+
} else if (message.data == "same-origin-iframe-under-same-origin-popup") {
22+
testPassed("Received message from same-origin iframe under same-origin popup");
23+
shouldBeFalse("gotMessageFromSameOriginIframeUnderSameOriginPopup");
24+
gotMessageFromSameOriginIframeUnderSameOriginPopup = true;
25+
} else {
26+
testFailed("Received unexpected message: " + message.data);
27+
}
28+
29+
if (gotMessageFromSameOriginPopup && gotMessageFromSameOriginIframeUnderSameOriginPopup)
30+
setTimeout(finishJSTest, 1000);
31+
};
32+
33+
onload = () => {
34+
open("http://localhost:8000/messaging/resources/broadcastchannel-partitioning-popup.html");
35+
open("resources/broadcastchannel-partitioning-popup.html", "same-origin-popup", "noopener");
36+
};
37+
</script>
38+
</body>
39+
</html>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<script>
5+
function isSameOriginAsTop()
6+
{
7+
try {
8+
return self.origin == top.origin;
9+
} catch (e) {
10+
return false;
11+
}
12+
}
13+
14+
let bc = new BroadcastChannel("broadcastchannel-partitioning");
15+
16+
if (location.origin == "http://127.0.0.1:8000") {
17+
if (isSameOriginAsTop())
18+
bc.postMessage("same-origin-iframe-under-same-origin-popup");
19+
else
20+
bc.postMessage("same-origin-iframe-under-cross-origin-popup");
21+
} else {
22+
if (isSameOriginAsTop())
23+
bc.postMessage("cross-origin-iframe-under-cross-origin-popup");
24+
else
25+
bc.postMessage("cross-origin-iframe-under-same-origin-popup");
26+
}
27+
</script>
28+
</body>
29+
</html>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<script>
5+
let bc = new BroadcastChannel("broadcastchannel-partitioning");
6+
if (location.origin == "http://127.0.0.1:8000")
7+
bc.postMessage("same-origin-popup");
8+
else
9+
bc.postMessage("cross-origin-popup");
10+
</script>
11+
<iframe src="http://localhost:8000/messaging/resources/broadcastchannel-partitioning-iframe.html"></iframe>
12+
<iframe src="http://127.0.0.1:8000/messaging/resources/broadcastchannel-partitioning-iframe.html"></iframe>
13+
</body>
14+
</html>

LayoutTests/platform/win/TestExpectations

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4636,8 +4636,9 @@ fast/forms/option-mouseevents.html [ Pass Failure ]
46364636
fast/forms/password-doubleclick-selection.html [ Pass Failure ]
46374637
fast/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.
46404640
fast/html/broadcast-channel-between-different-sessions.html [ Skip ]
4641+
http/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
46434644
# not implemented. The feature flags in question are CSSCounterStyleAtRulesEnabled and CSSCounterStyleAtRuleImageSymbolsEnabled.
@@ -4688,4 +4689,4 @@ webkit.org/b/229379 fast/visual-viewport/resize-event-fired-window-resized.html
46884689

46894690
webkit.org/b/215318 fast/text/zwj-ligature.html [ ImageOnlyFailure ]
46904691

4691-
webkit.org/b/229594 js/dfg-int16array.html [ Pass Crash ]
4692+
webkit.org/b/229594 js/dfg-int16array.html [ Pass Crash ]

Source/WTF/ChangeLog

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2021-09-07 Chris Dumez <[email protected]>
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+
113
2021-09-06 Dmitry Kalinkin <[email protected]>
214

315
Fix WebKitGTK build on MacOS

Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ BlankAnchorTargetImpliesNoOpenerEnabled:
8787
WebCore:
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.
9191
BroadcastChannelEnabled:
9292
type: bool
9393
humanReadableName: "BroadcastChannel API"
@@ -100,6 +100,16 @@ BroadcastChannelEnabled:
100100
WebCore:
101101
default: false
102102

103+
BroadcastChannelOriginPartitioningEnabled:
104+
type: bool
105+
defaultValue:
106+
WebKitLegacy:
107+
default: true
108+
WebKit:
109+
default: true
110+
WebCore:
111+
default: true
112+
103113
CFNetworkNetworkLoaderEnabled:
104114
type: bool
105115
humanReadableName: "Experimental network loader"

Source/WebCore/ChangeLog

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
2021-09-07 Chris Dumez <[email protected]>
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+
122
2021-09-07 Kimmo Kinnunen <[email protected]>
223

324
webgl/2.0.y/deqp/functional/gles3/negativestateapi.html get_framebuffer_attachment_parameter fails on Metal

Source/WebCore/dom/BroadcastChannel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static HashMap<BroadcastChannelIdentifier, ScriptExecutionContextIdentifier>& ch
6060
BroadcastChannel::BroadcastChannel(ScriptExecutionContext& context, const String& name)
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
{
6666
{
@@ -150,7 +150,7 @@ void BroadcastChannel::dispatchMessage(Ref<SerializedScriptValue>&& message)
150150

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
}
156156

Source/WebCore/dom/BroadcastChannel.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

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>
3535

@@ -83,7 +83,7 @@ class BroadcastChannel : public RefCounted<BroadcastChannel>, public EventTarget
8383
void stop() final { close(); }
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 };
8989
bool m_hasRelevantEventListener { false };

Source/WebCore/dom/BroadcastChannelRegistry.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@
3232
namespace WebCore {
3333

3434
class SerializedScriptValue;
35-
struct SecurityOriginData;
35+
struct ClientOrigin;
3636

3737
class BroadcastChannelRegistry : public RefCounted<BroadcastChannelRegistry> {
3838
public:
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

4545
} // namespace WebCore

Source/WebCore/loader/EmptyClients.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,9 +1174,9 @@ class EmptyBroadcastChannelRegistry final : public BroadcastChannelRegistry {
11741174
private:
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

11821182
PageConfiguration pageConfigurationWithEmptyClients(PAL::SessionID sessionID)

Source/WebKit/ChangeLog

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
2021-09-07 Chris Dumez <[email protected]>
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+
125
2021-09-07 Wenson Hsieh <[email protected]>
226

327
Post-layout `EditorState` updates should be scheduled using `RenderingUpdateScheduler`

Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace WebKit {
3434

3535
NetworkBroadcastChannelRegistry::NetworkBroadcastChannelRegistry() = default;
3636

37-
void NetworkBroadcastChannelRegistry::registerChannel(IPC::Connection& connection, const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier channelIdentifier)
37+
void 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;
4040
auto& channelsForName = channelsForOrigin.ensure(name, [] { return Vector<GlobalBroadcastChannelIdentifier> { }; }).iterator->value;
@@ -43,7 +43,7 @@ void NetworkBroadcastChannelRegistry::registerChannel(IPC::Connection& connectio
4343
channelsForName.append(WTFMove(globalChannelIdentifier));
4444
}
4545

46-
void NetworkBroadcastChannelRegistry::unregisterChannel(IPC::Connection& connection, const WebCore::SecurityOriginData& origin, const String& name, WebCore::BroadcastChannelIdentifier channelIdentifier)
46+
void NetworkBroadcastChannelRegistry::unregisterChannel(IPC::Connection& connection, const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier channelIdentifier)
4747
{
4848
auto channelsForOriginIterator = m_broadcastChannels.find(origin);
4949
ASSERT(channelsForOriginIterator != m_broadcastChannels.end());
@@ -59,7 +59,7 @@ void NetworkBroadcastChannelRegistry::unregisterChannel(IPC::Connection& connect
5959
channelsForNameIterator->value.removeFirst(globalChannelIdentifier);
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)
62+
void 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);
6565
ASSERT(channelsForOriginIterator != m_broadcastChannels.end());
@@ -86,7 +86,7 @@ void NetworkBroadcastChannelRegistry::postMessage(IPC::Connection& connection, c
8686

8787
void 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;
9292
for (auto& innerEntry : entry.value) {

Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

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

3333
namespace WebCore {
@@ -45,9 +45,9 @@ class NetworkBroadcastChannelRegistry {
4545

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

5252
private:
5353
struct GlobalBroadcastChannelIdentifier {
@@ -60,9 +60,8 @@ class NetworkBroadcastChannelRegistry {
6060
}
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

6867
} // namespace WebKit

Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.messages.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2222

2323
messages -> 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
}

0 commit comments

Comments
 (0)