Diff
Modified: branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog (293138 => 293139)
--- branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/ChangeLog 2022-04-21 02:43:49 UTC (rev 293139)
@@ -1,125 +1,3 @@
-2022-04-19 Alan Coon <[email protected]>
-
- Cherry-pick r291589. rdar://problem/90511155
-
- LayoutTests/imported/w3c:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- Import web-platform-tests test coverage.
-
- * web-platform-tests/webmessaging/broadcastchannel/opaque-origin-expected.txt: Added.
- * web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html: Added.
- * web-platform-tests/webmessaging/broadcastchannel/w3c-import.log:
-
- Source/WebCore:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
- which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
- SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
- unique SecurityOrigins, they would compare as equal.
-
- To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
- to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
- objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
- would not be equal but the same unique SecurityOrigin would be. I then used this new
- PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
- ClientOrigin. This allows communication between several BroadcastChannels from the same
- unique origin, while preventing communication between distinct opaque origins.
-
- When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
- the Network Process at all since the destination can only be in the same WebProcess.
-
- Test: imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html
-
- * Headers.cmake:
- * WebCore.xcodeproj/project.pbxproj:
- * dom/BroadcastChannel.cpp:
- (WebCore::shouldPartitionOrigin):
- (WebCore::BroadcastChannel::MainThreadBridge::registerChannel):
- (WebCore::BroadcastChannel::MainThreadBridge::unregisterChannel):
- (WebCore::BroadcastChannel::MainThreadBridge::postMessage):
- * dom/BroadcastChannelRegistry.h:
- * loader/EmptyClients.cpp:
- * page/PartitionedSecurityOrigin.h: Added.
- (WebCore::PartitionedSecurityOrigin::PartitionedSecurityOrigin):
- (WebCore::PartitionedSecurityOrigin::isHashTableDeletedValue const):
- (WebCore::PartitionedSecurityOrigin::isHashTableEmptyValue const):
- (WebCore::operator==):
- (WTF::add):
- (WTF::PartitionedSecurityOriginHash::hash):
- (WTF::PartitionedSecurityOriginHash::equal):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::emptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::constructEmptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::isEmptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::peek):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::take):
-
- Source/WebKit:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
- which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
- SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
- unique SecurityOrigins, they would compare as equal.
-
- To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
- to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
- objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
- would not be equal but the same unique SecurityOrigin would be. I then used this new
- PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
- ClientOrigin. This allows communication between several BroadcastChannels from the same
- unique origin, while preventing communication between distinct opaque origins.
-
- When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
- the Network Process at all since the destination can only be in the same WebProcess.
-
- * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp:
- (WebKit::toClientOrigin):
- (WebKit::WebBroadcastChannelRegistry::registerChannel):
- (WebKit::WebBroadcastChannelRegistry::unregisterChannel):
- (WebKit::WebBroadcastChannelRegistry::postMessage):
- (WebKit::WebBroadcastChannelRegistry::postMessageLocally):
- (WebKit::WebBroadcastChannelRegistry::postMessageToRemote):
- (WebKit::WebBroadcastChannelRegistry::networkProcessCrashed):
- * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h:
-
- Source/WebKitLegacy:
- Dust off Mac CMake build
- https://bugs.webkit.org/show_bug.cgi?id=238121
-
- Reviewed by Yusuke Suzuki.
-
- * PlatformMac.cmake:
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2022-03-21 Chris Dumez <[email protected]>
-
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- Import web-platform-tests test coverage.
-
- * web-platform-tests/webmessaging/broadcastchannel/opaque-origin-expected.txt: Added.
- * web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html: Added.
- * web-platform-tests/webmessaging/broadcastchannel/w3c-import.log:
-
2022-04-18 Kocsen Chung <[email protected]>
Cherry-pick r292400. rdar://problem/89382543
Deleted: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin-expected.txt (293138 => 293139)
--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin-expected.txt 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin-expected.txt 2022-04-21 02:43:49 UTC (rev 293139)
@@ -1,4 +0,0 @@
-
-PASS Opaque origin should be serialized to "null"
-PASS BroadcastChannel messages from opaque origins should be self-contained
-
Deleted: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html (293138 => 293139)
--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html 2022-04-21 02:43:49 UTC (rev 293139)
@@ -1,85 +0,0 @@
-<!doctype html>
-<html>
-<head>
-<meta charset=utf-8>
-<title></title>
-<script src=""
-<script src=""
-</head>
-<body>
-<script>
-<!--
-promise_test(t => {
- return new Promise((resolve) => {
- let ifr = document.createElement("iframe");
- ifr.src =
- "data:text/html,<script> let bc = new BroadcastChannel(\"test\");" +
- "bc._onmessage_ = (e) => {" +
- " if (e.data == \"ping\") bc.postMessage('pong');"+
- " else parent.postMessage({workerMessageOrigin: e.data, messageOrigin: e.origin}, \"*\"); };" +
- "new Worker(URL.createObjectURL(new Blob([\"" +
- "let bc2 = new BroadcastChannel('test'); bc2.postMessage('ping'); " +
- "bc2._onmessage_ = e => bc2.postMessage(e.origin);" +
- "\"], {type: 'text/_javascript_'}))); </script>";
- window.addEventListener("message", t.step_func(e => {
- assert_equals(e.data.workerMessageOrigin, "null");
- assert_equals(e.data.messageOrigin, "null");
- resolve();
- }), {once: true});
- t.add_cleanup(() => { document.body.removeChild(ifr) });
- document.body.appendChild(ifr);
- });
-}, "Opaque origin should be serialized to \"null\"");
-
-
-const iframe_src = (channel_name, iframe_name) => `data:text/html,<script>
-let bc2 = new BroadcastChannel("${channel_name}");
-bc2._onmessage_ = (e) => {
- if (e.data == "from-${iframe_name}") {
- parent.postMessage("${iframe_name}-done", "*");
- } else {
- parent.postMessage("fail", "*");
- }
-};
-let bc3 = new BroadcastChannel("${channel_name}");
-bc3.postMessage("from-${iframe_name}");
-</script>`;
-
-promise_test(t => {
- return new Promise((resolve, reject) => {
- const channel_name = "opaque-origin-test-2";
- const bc1 = new BroadcastChannel(channel_name);
- bc1._onmessage_ = t.unreached_func("Received message from an opaque origin");
-
- // We'll create an iframe and have it send a BroadcastChannel message
- // between two instances. Once the message is received, it will postMessage
- // back and we'll repeat this with another iframe. If the first
- // BroadcastChannel message is received by `bc1`, or if the second
- // BroadcastChannel message is received by `bc1` or `bc2` in the first
- // iframe, then the test should fail.
-
- window.addEventListener("message", e => {
- if(e.data == "iframe1-done") {
- let iframe2 = document.createElement("iframe");
- iframe2.src = "" "iframe2");
- t.add_cleanup(() => { document.body.removeChild(iframe2) });
- document.body.appendChild(iframe2);
- } else if(e.data == "iframe2-done") {
- resolve();
- } else if(e.data == "fail") {
- reject("One opaque origin received a message from the other");
- } else {
- reject("An unexpected error occurred");
- }
- });
-
- let iframe1 = document.createElement("iframe");
- iframe1.src = "" "iframe1");
- t.add_cleanup(() => { document.body.removeChild(iframe1) });
- document.body.appendChild(iframe1);
- });
-}, "BroadcastChannel messages from opaque origins should be self-contained");
-//-->
-</script>
-</body>
-</html>
Modified: branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/w3c-import.log (293138 => 293139)
--- branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/w3c-import.log 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/w3c-import.log 2022-04-21 02:43:49 UTC (rev 293139)
@@ -19,7 +19,6 @@
/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/cross-origin.html
/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/detached-iframe.html
/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/interface.any.js
-/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html
/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/ordering.html
/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/origin.window.js
/LayoutTests/imported/w3c/web-platform-tests/webmessaging/broadcastchannel/sandbox.html
Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (293138 => 293139)
--- branches/safari-613-branch/Source/WebCore/ChangeLog 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog 2022-04-21 02:43:49 UTC (rev 293139)
@@ -808,163 +808,6 @@
2022-04-19 Alan Coon <[email protected]>
- Cherry-pick r291589. rdar://problem/90511155
-
- LayoutTests/imported/w3c:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- Import web-platform-tests test coverage.
-
- * web-platform-tests/webmessaging/broadcastchannel/opaque-origin-expected.txt: Added.
- * web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html: Added.
- * web-platform-tests/webmessaging/broadcastchannel/w3c-import.log:
-
- Source/WebCore:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
- which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
- SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
- unique SecurityOrigins, they would compare as equal.
-
- To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
- to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
- objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
- would not be equal but the same unique SecurityOrigin would be. I then used this new
- PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
- ClientOrigin. This allows communication between several BroadcastChannels from the same
- unique origin, while preventing communication between distinct opaque origins.
-
- When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
- the Network Process at all since the destination can only be in the same WebProcess.
-
- Test: imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html
-
- * Headers.cmake:
- * WebCore.xcodeproj/project.pbxproj:
- * dom/BroadcastChannel.cpp:
- (WebCore::shouldPartitionOrigin):
- (WebCore::BroadcastChannel::MainThreadBridge::registerChannel):
- (WebCore::BroadcastChannel::MainThreadBridge::unregisterChannel):
- (WebCore::BroadcastChannel::MainThreadBridge::postMessage):
- * dom/BroadcastChannelRegistry.h:
- * loader/EmptyClients.cpp:
- * page/PartitionedSecurityOrigin.h: Added.
- (WebCore::PartitionedSecurityOrigin::PartitionedSecurityOrigin):
- (WebCore::PartitionedSecurityOrigin::isHashTableDeletedValue const):
- (WebCore::PartitionedSecurityOrigin::isHashTableEmptyValue const):
- (WebCore::operator==):
- (WTF::add):
- (WTF::PartitionedSecurityOriginHash::hash):
- (WTF::PartitionedSecurityOriginHash::equal):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::emptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::constructEmptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::isEmptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::peek):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::take):
-
- Source/WebKit:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
- which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
- SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
- unique SecurityOrigins, they would compare as equal.
-
- To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
- to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
- objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
- would not be equal but the same unique SecurityOrigin would be. I then used this new
- PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
- ClientOrigin. This allows communication between several BroadcastChannels from the same
- unique origin, while preventing communication between distinct opaque origins.
-
- When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
- the Network Process at all since the destination can only be in the same WebProcess.
-
- * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp:
- (WebKit::toClientOrigin):
- (WebKit::WebBroadcastChannelRegistry::registerChannel):
- (WebKit::WebBroadcastChannelRegistry::unregisterChannel):
- (WebKit::WebBroadcastChannelRegistry::postMessage):
- (WebKit::WebBroadcastChannelRegistry::postMessageLocally):
- (WebKit::WebBroadcastChannelRegistry::postMessageToRemote):
- (WebKit::WebBroadcastChannelRegistry::networkProcessCrashed):
- * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h:
-
- Source/WebKitLegacy:
- Dust off Mac CMake build
- https://bugs.webkit.org/show_bug.cgi?id=238121
-
- Reviewed by Yusuke Suzuki.
-
- * PlatformMac.cmake:
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2022-03-21 Chris Dumez <[email protected]>
-
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
- which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
- SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
- unique SecurityOrigins, they would compare as equal.
-
- To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
- to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
- objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
- would not be equal but the same unique SecurityOrigin would be. I then used this new
- PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
- ClientOrigin. This allows communication between several BroadcastChannels from the same
- unique origin, while preventing communication between distinct opaque origins.
-
- When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
- the Network Process at all since the destination can only be in the same WebProcess.
-
- Test: imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html
-
- * Headers.cmake:
- * WebCore.xcodeproj/project.pbxproj:
- * dom/BroadcastChannel.cpp:
- (WebCore::shouldPartitionOrigin):
- (WebCore::BroadcastChannel::MainThreadBridge::registerChannel):
- (WebCore::BroadcastChannel::MainThreadBridge::unregisterChannel):
- (WebCore::BroadcastChannel::MainThreadBridge::postMessage):
- * dom/BroadcastChannelRegistry.h:
- * loader/EmptyClients.cpp:
- * page/PartitionedSecurityOrigin.h: Added.
- (WebCore::PartitionedSecurityOrigin::PartitionedSecurityOrigin):
- (WebCore::PartitionedSecurityOrigin::isHashTableDeletedValue const):
- (WebCore::PartitionedSecurityOrigin::isHashTableEmptyValue const):
- (WebCore::operator==):
- (WTF::add):
- (WTF::PartitionedSecurityOriginHash::hash):
- (WTF::PartitionedSecurityOriginHash::equal):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::emptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::constructEmptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::isEmptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::peek):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::take):
-
-2022-04-19 Alan Coon <[email protected]>
-
Cherry-pick r291689. rdar://problem/88461772
REGRESSION (iOS 15.1 / r280824) QuickLook - model not loading when passing extra parameters
Modified: branches/safari-613-branch/Source/WebCore/Headers.cmake (293138 => 293139)
--- branches/safari-613-branch/Source/WebCore/Headers.cmake 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebCore/Headers.cmake 2022-04-21 02:43:49 UTC (rev 293139)
@@ -1125,7 +1125,6 @@
page/PageOverlay.h
page/PageOverlayController.h
page/PagePasteboardContext.h
- page/PartitionedSecurityOrigin.h
page/PerformanceLogging.h
page/PerformanceLoggingClient.h
page/PointerCaptureController.h
Modified: branches/safari-613-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj (293138 => 293139)
--- branches/safari-613-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebCore/WebCore.xcodeproj/project.pbxproj 2022-04-21 02:43:49 UTC (rev 293139)
@@ -1346,7 +1346,6 @@
4682D2001F79783000C863DB /* StoredCredentialsPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = 4682D1FF1F79782300C863DB /* StoredCredentialsPolicy.h */; settings = {ATTRIBUTES = (Private, ); }; };
468344E01EDDFAAA00B7795B /* DOMRectList.h in Headers */ = {isa = PBXBuildFile; fileRef = 468344DE1EDDFA5F00B7795B /* DOMRectList.h */; settings = {ATTRIBUTES = (Private, ); }; };
4688EE3C26DD2610002AF5C4 /* CrossOriginMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 4688EE3A26DD260C002AF5C4 /* CrossOriginMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
- 46893B8427E8D74C002CC13D /* PartitionedSecurityOrigin.h in Headers */ = {isa = PBXBuildFile; fileRef = 46893B8327E8D716002CC13D /* PartitionedSecurityOrigin.h */; settings = {ATTRIBUTES = (Private, ); }; };
469CCCFE269D021C006E0314 /* BroadcastChannel.h in Headers */ = {isa = PBXBuildFile; fileRef = 469CCCFC269D0202006E0314 /* BroadcastChannel.h */; settings = {ATTRIBUTES = (Private, ); }; };
469D77B82701625100142FA6 /* NavigationRequester.h in Headers */ = {isa = PBXBuildFile; fileRef = 469D77B62701625000142FA6 /* NavigationRequester.h */; settings = {ATTRIBUTES = (Private, ); }; };
46AAAA3D25D3632000BAF42F /* AudioFileReaderCocoa.h in Headers */ = {isa = PBXBuildFile; fileRef = 46AAAA3A25D3631400BAF42F /* AudioFileReaderCocoa.h */; };
@@ -9216,7 +9215,6 @@
468344DD1EDDFA5F00B7795B /* DOMRectList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = DOMRectList.cpp; sourceTree = "<group>"; };
468344DE1EDDFA5F00B7795B /* DOMRectList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DOMRectList.h; sourceTree = "<group>"; };
4688EE3A26DD260C002AF5C4 /* CrossOriginMode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CrossOriginMode.h; sourceTree = "<group>"; };
- 46893B8327E8D716002CC13D /* PartitionedSecurityOrigin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PartitionedSecurityOrigin.h; sourceTree = "<group>"; };
468B8BDE25CC849300F67822 /* JSBaseAudioContextCustom.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSBaseAudioContextCustom.cpp; sourceTree = "<group>"; };
469CCCFA269D0202006E0314 /* BroadcastChannel.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BroadcastChannel.cpp; sourceTree = "<group>"; };
469CCCFC269D0202006E0314 /* BroadcastChannel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BroadcastChannel.h; sourceTree = "<group>"; };
@@ -24086,7 +24084,6 @@
F40DAAEE25D9F3BF0011B4FA /* PagePasteboardContext.h */,
371E65CD13661EED00BEEDB0 /* PageSerializer.cpp */,
371E65CB13661EDC00BEEDB0 /* PageSerializer.h */,
- 46893B8327E8D716002CC13D /* PartitionedSecurityOrigin.h */,
BC4A53282560563B0028C592 /* PDFImageCachingPolicy.h */,
7C72471E2516758800C363CD /* Performance+NavigationTiming.idl */,
7C72471C251674CE00C363CD /* Performance+PerformanceTimeline.idl */,
@@ -36375,7 +36372,6 @@
447958041643B49A001E0A7F /* ParsedContentType.h in Headers */,
5C4A0FDA25C3449A00D9EE97 /* ParsedRequestRange.h in Headers */,
536D5A23193E8E0C00CE4CAB /* ParsingUtilities.h in Headers */,
- 46893B8427E8D74C002CC13D /* PartitionedSecurityOrigin.h in Headers */,
F55B3DCA1251F12D003EF269 /* PasswordInputType.h in Headers */,
4B2708C70AF19EE40065127F /* Pasteboard.h in Headers */,
F40DAAEC25D9F25E0011B4FA /* PasteboardContext.h in Headers */,
Modified: branches/safari-613-branch/Source/WebCore/dom/BroadcastChannel.cpp (293138 => 293139)
--- branches/safari-613-branch/Source/WebCore/dom/BroadcastChannel.cpp 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebCore/dom/BroadcastChannel.cpp 2022-04-21 02:43:49 UTC (rev 293139)
@@ -30,7 +30,6 @@
#include "EventNames.h"
#include "MessageEvent.h"
#include "Page.h"
-#include "PartitionedSecurityOrigin.h"
#include "SecurityOrigin.h"
#include "SerializedScriptValue.h"
#include "WorkerGlobalScope.h"
@@ -87,7 +86,7 @@
WeakPtr<BroadcastChannel> m_broadcastChannel;
const BroadcastChannelIdentifier m_identifier;
const String m_name; // Main thread only.
- std::optional<PartitionedSecurityOrigin> m_origin; // Main thread only.
+ ClientOrigin m_origin; // Main thread only.
};
BroadcastChannel::MainThreadBridge::MainThreadBridge(BroadcastChannel& channel, const String& name)
@@ -121,9 +120,9 @@
void BroadcastChannel::MainThreadBridge::registerChannel()
{
ensureOnMainThread([this, contextIdentifier = m_broadcastChannel->scriptExecutionContext()->identifier()](auto& document) {
- m_origin = PartitionedSecurityOrigin { shouldPartitionOrigin(document) ? document.topOrigin() : document.securityOrigin(), document.securityOrigin() };
+ m_origin = { shouldPartitionOrigin(document) ? document.topOrigin().data() : document.securityOrigin().data(), document.securityOrigin().data() };
if (auto* page = document.page())
- page->broadcastChannelRegistry().registerChannel(*m_origin, m_name, m_identifier);
+ page->broadcastChannelRegistry().registerChannel(m_origin, m_name, m_identifier);
channelToContextIdentifier().add(m_identifier, contextIdentifier);
});
}
@@ -132,7 +131,7 @@
{
ensureOnMainThread([this](auto& document) {
if (auto* page = document.page())
- page->broadcastChannelRegistry().unregisterChannel(*m_origin, m_name, m_identifier);
+ page->broadcastChannelRegistry().unregisterChannel(m_origin, m_name, m_identifier);
channelToContextIdentifier().remove(m_identifier);
});
}
@@ -145,7 +144,7 @@
return;
auto blobHandles = message->blobHandles();
- page->broadcastChannelRegistry().postMessage(*m_origin, m_name, m_identifier, WTFMove(message), [blobHandles = WTFMove(blobHandles)] {
+ page->broadcastChannelRegistry().postMessage(m_origin, m_name, m_identifier, WTFMove(message), [blobHandles = WTFMove(blobHandles)] {
// Keeps Blob data inside messageData alive until the message has been delivered.
});
});
Modified: branches/safari-613-branch/Source/WebCore/dom/BroadcastChannelRegistry.h (293138 => 293139)
--- branches/safari-613-branch/Source/WebCore/dom/BroadcastChannelRegistry.h 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebCore/dom/BroadcastChannelRegistry.h 2022-04-21 02:43:49 UTC (rev 293139)
@@ -31,15 +31,15 @@
namespace WebCore {
-struct PartitionedSecurityOrigin;
class SerializedScriptValue;
+struct ClientOrigin;
class BroadcastChannelRegistry : public RefCounted<BroadcastChannelRegistry> {
public:
virtual ~BroadcastChannelRegistry() { }
- virtual void registerChannel(const PartitionedSecurityOrigin&, const String& name, BroadcastChannelIdentifier) = 0;
- virtual void unregisterChannel(const PartitionedSecurityOrigin&, const String& name, BroadcastChannelIdentifier) = 0;
- virtual void postMessage(const PartitionedSecurityOrigin&, const String& name, BroadcastChannelIdentifier source, Ref<SerializedScriptValue>&&, CompletionHandler<void()>&&) = 0;
+ virtual void registerChannel(const ClientOrigin&, const String& name, BroadcastChannelIdentifier) = 0;
+ virtual void unregisterChannel(const ClientOrigin&, const String& name, BroadcastChannelIdentifier) = 0;
+ virtual void postMessage(const ClientOrigin&, const String& name, BroadcastChannelIdentifier source, Ref<SerializedScriptValue>&&, CompletionHandler<void()>&&) = 0;
};
} // namespace WebCore
Modified: branches/safari-613-branch/Source/WebCore/loader/EmptyClients.cpp (293138 => 293139)
--- branches/safari-613-branch/Source/WebCore/loader/EmptyClients.cpp 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebCore/loader/EmptyClients.cpp 2022-04-21 02:43:49 UTC (rev 293139)
@@ -1183,9 +1183,9 @@
private:
EmptyBroadcastChannelRegistry() = default;
- void registerChannel(const PartitionedSecurityOrigin&, const String&, BroadcastChannelIdentifier) final { }
- void unregisterChannel(const PartitionedSecurityOrigin&, const String&, BroadcastChannelIdentifier) final { }
- void postMessage(const PartitionedSecurityOrigin&, const String&, BroadcastChannelIdentifier, Ref<SerializedScriptValue>&&, CompletionHandler<void()>&&) final { }
+ void registerChannel(const ClientOrigin&, const String&, BroadcastChannelIdentifier) final { }
+ void unregisterChannel(const ClientOrigin&, const String&, BroadcastChannelIdentifier) final { }
+ void postMessage(const ClientOrigin&, const String&, BroadcastChannelIdentifier, Ref<SerializedScriptValue>&&, CompletionHandler<void()>&&) final { }
};
class EmptyWebLockRegistry final : public WebLockRegistry {
Deleted: branches/safari-613-branch/Source/WebCore/page/PartitionedSecurityOrigin.h (293138 => 293139)
--- branches/safari-613-branch/Source/WebCore/page/PartitionedSecurityOrigin.h 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebCore/page/PartitionedSecurityOrigin.h 2022-04-21 02:43:49 UTC (rev 293139)
@@ -1,100 +0,0 @@
-/*
- * Copyright (C) 2022 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include "SecurityOrigin.h"
-#include <wtf/HashTraits.h>
-#include <wtf/Hasher.h>
-#include <wtf/Ref.h>
-
-namespace WebCore {
-
-struct PartitionedSecurityOrigin {
- PartitionedSecurityOrigin(Ref<SecurityOrigin>&& topOrigin, Ref<SecurityOrigin>&& clientOrigin)
- : topOrigin(WTFMove(topOrigin))
- , clientOrigin(WTFMove(clientOrigin))
- { }
-
- PartitionedSecurityOrigin(WTF::HashTableDeletedValueType)
- : topOrigin(WTF::HashTableDeletedValue)
- , clientOrigin(WTF::HashTableDeletedValue)
- { }
-
- PartitionedSecurityOrigin(WTF::HashTableEmptyValueType)
- : topOrigin(WTF::HashTableEmptyValue)
- , clientOrigin(WTF::HashTableEmptyValue)
- { }
-
- bool isHashTableDeletedValue() const { return topOrigin.isHashTableDeletedValue(); }
- bool isHashTableEmptyValue() const { return topOrigin.isHashTableEmptyValue(); }
-
- Ref<SecurityOrigin> topOrigin;
- Ref<SecurityOrigin> clientOrigin;
-};
-
-inline bool operator==(const PartitionedSecurityOrigin& a, const PartitionedSecurityOrigin& b)
-{
- return a.topOrigin->isSameOriginAs(b.topOrigin) && a.clientOrigin->isSameOriginAs(b.clientOrigin);
-}
-
-} // namespace WebCore
-
-namespace WTF {
-
-inline void add(Hasher& hasher, const WebCore::PartitionedSecurityOrigin& origin)
-{
- add(hasher, origin.topOrigin.get(), origin.clientOrigin.get());
-}
-
-struct PartitionedSecurityOriginHash {
- static unsigned hash(const WebCore::PartitionedSecurityOrigin& origin) { return computeHash(origin); }
- static bool equal(const WebCore::PartitionedSecurityOrigin& a, const WebCore::PartitionedSecurityOrigin& b) { return a == b; }
- static constexpr bool safeToCompareToEmptyOrDeleted = false;
-};
-
-template<> struct DefaultHash<WebCore::PartitionedSecurityOrigin> : PartitionedSecurityOriginHash { };
-
-template<> struct HashTraits<WebCore::PartitionedSecurityOrigin> : SimpleClassHashTraits<WebCore::PartitionedSecurityOrigin> {
- static constexpr bool emptyValueIsZero = true;
- static WebCore::PartitionedSecurityOrigin emptyValue() { return HashTableEmptyValue; }
-
- template <typename>
- static void constructEmptyValue(WebCore::PartitionedSecurityOrigin& slot)
- {
- new (NotNull, std::addressof(slot)) WebCore::PartitionedSecurityOrigin(HashTableEmptyValue);
- }
-
- static constexpr bool hasIsEmptyValueFunction = true;
- static bool isEmptyValue(const WebCore::PartitionedSecurityOrigin& value) { return value.isHashTableEmptyValue(); }
-
- using PeekType = std::optional<WebCore::PartitionedSecurityOrigin>;
- static PeekType peek(const WebCore::PartitionedSecurityOrigin& value) { return isEmptyValue(value) ? std::nullopt : std::optional { value }; }
-
- using TakeType = std::optional<WebCore::PartitionedSecurityOrigin>;
- static TakeType take(WebCore::PartitionedSecurityOrigin&& value) { return isEmptyValue(value) ? std::nullopt : std::optional { WTFMove(value) }; }
-};
-
-} // namespace WTF
Modified: branches/safari-613-branch/Source/WebKit/ChangeLog (293138 => 293139)
--- branches/safari-613-branch/Source/WebKit/ChangeLog 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKit/ChangeLog 2022-04-21 02:43:49 UTC (rev 293139)
@@ -252,148 +252,6 @@
2022-04-19 Alan Coon <[email protected]>
- Cherry-pick r291589. rdar://problem/90511155
-
- LayoutTests/imported/w3c:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- Import web-platform-tests test coverage.
-
- * web-platform-tests/webmessaging/broadcastchannel/opaque-origin-expected.txt: Added.
- * web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html: Added.
- * web-platform-tests/webmessaging/broadcastchannel/w3c-import.log:
-
- Source/WebCore:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
- which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
- SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
- unique SecurityOrigins, they would compare as equal.
-
- To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
- to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
- objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
- would not be equal but the same unique SecurityOrigin would be. I then used this new
- PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
- ClientOrigin. This allows communication between several BroadcastChannels from the same
- unique origin, while preventing communication between distinct opaque origins.
-
- When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
- the Network Process at all since the destination can only be in the same WebProcess.
-
- Test: imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html
-
- * Headers.cmake:
- * WebCore.xcodeproj/project.pbxproj:
- * dom/BroadcastChannel.cpp:
- (WebCore::shouldPartitionOrigin):
- (WebCore::BroadcastChannel::MainThreadBridge::registerChannel):
- (WebCore::BroadcastChannel::MainThreadBridge::unregisterChannel):
- (WebCore::BroadcastChannel::MainThreadBridge::postMessage):
- * dom/BroadcastChannelRegistry.h:
- * loader/EmptyClients.cpp:
- * page/PartitionedSecurityOrigin.h: Added.
- (WebCore::PartitionedSecurityOrigin::PartitionedSecurityOrigin):
- (WebCore::PartitionedSecurityOrigin::isHashTableDeletedValue const):
- (WebCore::PartitionedSecurityOrigin::isHashTableEmptyValue const):
- (WebCore::operator==):
- (WTF::add):
- (WTF::PartitionedSecurityOriginHash::hash):
- (WTF::PartitionedSecurityOriginHash::equal):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::emptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::constructEmptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::isEmptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::peek):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::take):
-
- Source/WebKit:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
- which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
- SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
- unique SecurityOrigins, they would compare as equal.
-
- To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
- to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
- objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
- would not be equal but the same unique SecurityOrigin would be. I then used this new
- PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
- ClientOrigin. This allows communication between several BroadcastChannels from the same
- unique origin, while preventing communication between distinct opaque origins.
-
- When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
- the Network Process at all since the destination can only be in the same WebProcess.
-
- * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp:
- (WebKit::toClientOrigin):
- (WebKit::WebBroadcastChannelRegistry::registerChannel):
- (WebKit::WebBroadcastChannelRegistry::unregisterChannel):
- (WebKit::WebBroadcastChannelRegistry::postMessage):
- (WebKit::WebBroadcastChannelRegistry::postMessageLocally):
- (WebKit::WebBroadcastChannelRegistry::postMessageToRemote):
- (WebKit::WebBroadcastChannelRegistry::networkProcessCrashed):
- * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h:
-
- Source/WebKitLegacy:
- Dust off Mac CMake build
- https://bugs.webkit.org/show_bug.cgi?id=238121
-
- Reviewed by Yusuke Suzuki.
-
- * PlatformMac.cmake:
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2022-03-21 Chris Dumez <[email protected]>
-
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
- which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
- SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
- unique SecurityOrigins, they would compare as equal.
-
- To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
- to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
- objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
- would not be equal but the same unique SecurityOrigin would be. I then used this new
- PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
- ClientOrigin. This allows communication between several BroadcastChannels from the same
- unique origin, while preventing communication between distinct opaque origins.
-
- When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
- the Network Process at all since the destination can only be in the same WebProcess.
-
- * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp:
- (WebKit::toClientOrigin):
- (WebKit::WebBroadcastChannelRegistry::registerChannel):
- (WebKit::WebBroadcastChannelRegistry::unregisterChannel):
- (WebKit::WebBroadcastChannelRegistry::postMessage):
- (WebKit::WebBroadcastChannelRegistry::postMessageLocally):
- (WebKit::WebBroadcastChannelRegistry::postMessageToRemote):
- (WebKit::WebBroadcastChannelRegistry::networkProcessCrashed):
- * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h:
-
-2022-04-19 Alan Coon <[email protected]>
-
Cherry-pick r291689. rdar://problem/88461772
REGRESSION (iOS 15.1 / r280824) QuickLook - model not loading when passing extra parameters
Modified: branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.cpp (293138 => 293139)
--- branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.cpp 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.cpp 2022-04-21 02:43:49 UTC (rev 293139)
@@ -26,7 +26,6 @@
#include "config.h"
#include "NetworkBroadcastChannelRegistry.h"
-#include "NetworkProcessProxyMessages.h"
#include "WebBroadcastChannelRegistryMessages.h"
#include <WebCore/MessageWithMessagePorts.h>
#include <wtf/CallbackAggregator.h>
@@ -33,31 +32,10 @@
namespace WebKit {
-#define REGISTRY_MESSAGE_CHECK(assertion) REGISTRY_MESSAGE_CHECK_COMPLETION(assertion, (void)0)
-#define REGISTRY_MESSAGE_CHECK_COMPLETION(assertion, completion) do { \
- ASSERT(assertion); \
- if (UNLIKELY(!(assertion))) { \
- if (auto webProcessIdentifier = m_networkProcess->webProcessIdentifierForConnection(connection)) \
- m_networkProcess->parentProcessConnection()->send(Messages::NetworkProcessProxy::TerminateWebProcess(webProcessIdentifier), 0); \
- { completion; } \
- return; \
- } \
-} while (0)
+NetworkBroadcastChannelRegistry::NetworkBroadcastChannelRegistry() = default;
-static bool isValidClientOrigin(const WebCore::ClientOrigin& clientOrigin)
-{
- return !clientOrigin.topOrigin.isEmpty() && !clientOrigin.clientOrigin.isEmpty();
-}
-
-NetworkBroadcastChannelRegistry::NetworkBroadcastChannelRegistry(NetworkProcess& networkProcess)
- : m_networkProcess(networkProcess)
-{
-}
-
void NetworkBroadcastChannelRegistry::registerChannel(IPC::Connection& connection, const WebCore::ClientOrigin& origin, const String& name)
{
- REGISTRY_MESSAGE_CHECK(isValidClientOrigin(origin));
-
auto& channelsForOrigin = m_broadcastChannels.ensure(origin, [] { return NameToConnectionIdentifiersMap { }; }).iterator->value;
auto& connectionIdentifiersForName = channelsForOrigin.ensure(name, [] { return Vector<IPC::Connection::UniqueID> { }; }).iterator->value;
ASSERT(!connectionIdentifiersForName.contains(connection.uniqueID()));
@@ -66,8 +44,6 @@
void NetworkBroadcastChannelRegistry::unregisterChannel(IPC::Connection& connection, const WebCore::ClientOrigin& origin, const String& name)
{
- REGISTRY_MESSAGE_CHECK(isValidClientOrigin(origin));
-
auto channelsForOriginIterator = m_broadcastChannels.find(origin);
ASSERT(channelsForOriginIterator != m_broadcastChannels.end());
if (channelsForOriginIterator == m_broadcastChannels.end())
@@ -83,8 +59,6 @@
void NetworkBroadcastChannelRegistry::postMessage(IPC::Connection& connection, const WebCore::ClientOrigin& origin, const String& name, WebCore::MessageWithMessagePorts&& message, CompletionHandler<void()>&& completionHandler)
{
- REGISTRY_MESSAGE_CHECK_COMPLETION(isValidClientOrigin(origin), completionHandler());
-
auto channelsForOriginIterator = m_broadcastChannels.find(origin);
ASSERT(channelsForOriginIterator != m_broadcastChannels.end());
if (channelsForOriginIterator == m_broadcastChannels.end())
@@ -127,7 +101,4 @@
m_broadcastChannels.remove(originToRemove);
}
-#undef REGISTRY_MESSAGE_CHECK
-#undef REGISTRY_MESSAGE_CHECK_COMPLETION
-
} // namespace WebKit
Modified: branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.h (293138 => 293139)
--- branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.h 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkBroadcastChannelRegistry.h 2022-04-21 02:43:49 UTC (rev 293139)
@@ -36,12 +36,10 @@
namespace WebKit {
-class NetworkProcess;
-
class NetworkBroadcastChannelRegistry {
WTF_MAKE_FAST_ALLOCATED;
public:
- explicit NetworkBroadcastChannelRegistry(NetworkProcess&);
+ NetworkBroadcastChannelRegistry();
void removeConnection(IPC::Connection&);
@@ -52,7 +50,6 @@
void postMessage(IPC::Connection&, const WebCore::ClientOrigin&, const String& name, WebCore::MessageWithMessagePorts&&, CompletionHandler<void()>&&);
private:
- Ref<NetworkProcess> m_networkProcess;
using NameToConnectionIdentifiersMap = HashMap<String, Vector<IPC::Connection::UniqueID>>;
HashMap<WebCore::ClientOrigin, NameToConnectionIdentifiersMap> m_broadcastChannels;
};
Modified: branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp (293138 => 293139)
--- branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkProcess.cpp 2022-04-21 02:43:49 UTC (rev 293139)
@@ -2605,15 +2605,6 @@
}
}
-WebCore::ProcessIdentifier NetworkProcess::webProcessIdentifierForConnection(IPC::Connection& connection) const
-{
- for (auto& [processIdentifier, webConnection] : m_webProcessConnections) {
- if (&webConnection->connection() == &connection)
- return processIdentifier;
- }
- return { };
-}
-
NetworkConnectionToWebProcess* NetworkProcess::webProcessConnection(ProcessIdentifier identifier) const
{
return m_webProcessConnections.get(identifier);
Modified: branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkProcess.h (293138 => 293139)
--- branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkProcess.h 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkProcess.h 2022-04-21 02:43:49 UTC (rev 293139)
@@ -335,7 +335,6 @@
const OptionSet<NetworkCache::CacheOption>& cacheOptions() const { return m_cacheOptions; }
NetworkConnectionToWebProcess* webProcessConnection(WebCore::ProcessIdentifier) const;
- WebCore::ProcessIdentifier webProcessIdentifierForConnection(IPC::Connection&) const;
WebCore::MessagePortChannelRegistry& messagePortChannelRegistry() { return m_messagePortChannelRegistry; }
void setServiceWorkerFetchTimeoutForTesting(Seconds, CompletionHandler<void()>&&);
Modified: branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkSession.cpp (293138 => 293139)
--- branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkSession.cpp 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKit/NetworkProcess/NetworkSession.cpp 2022-04-21 02:43:49 UTC (rev 293139)
@@ -125,7 +125,7 @@
#endif
, m_privateClickMeasurement(managerOrProxy(*this, networkProcess, parameters))
, m_privateClickMeasurementDebugModeEnabled(parameters.enablePrivateClickMeasurementDebugMode)
- , m_broadcastChannelRegistry(makeUniqueRef<NetworkBroadcastChannelRegistry>(networkProcess))
+ , m_broadcastChannelRegistry(makeUniqueRef<NetworkBroadcastChannelRegistry>())
, m_testSpeedMultiplier(parameters.testSpeedMultiplier)
, m_allowsServerPreconnect(parameters.allowsServerPreconnect)
, m_shouldRunServiceWorkersOnMainThreadForTesting(parameters.shouldRunServiceWorkersOnMainThreadForTesting)
Modified: branches/safari-613-branch/Source/WebKit/WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp (293138 => 293139)
--- branches/safari-613-branch/Source/WebKit/WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKit/WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp 2022-04-21 02:43:49 UTC (rev 293139)
@@ -40,30 +40,17 @@
return WebProcess::singleton().ensureNetworkProcessConnection().connection();
}
-// Unique origins are only stored in process in m_channelsPerOrigin and never sent to the NetworkProcess as a ClientOrigin.
-// The identity of unique origins wouldn't be preserved when serializing them as a SecurityOriginData (via ClientOrigin).
-// Since BroadcastChannels from a unique origin can only communicate with other BroadcastChannels from the same unique origin,
-// the destination channels have to be within the same WebProcess anyway.
-static std::optional<WebCore::ClientOrigin> toClientOrigin(const WebCore::PartitionedSecurityOrigin& origin)
+void WebBroadcastChannelRegistry::registerChannel(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
{
- if (origin.topOrigin->isUnique() || origin.clientOrigin->isUnique())
- return std::nullopt;
- return WebCore::ClientOrigin { origin.topOrigin->data(), origin.clientOrigin->data() };
-}
-
-void WebBroadcastChannelRegistry::registerChannel(const WebCore::PartitionedSecurityOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
-{
auto& channelsForOrigin = m_channelsPerOrigin.ensure(origin, [] { return HashMap<String, Vector<WebCore::BroadcastChannelIdentifier>> { }; }).iterator->value;
auto& channelsForName = channelsForOrigin.ensure(name, [] { return Vector<WebCore::BroadcastChannelIdentifier> { }; }).iterator->value;
channelsForName.append(identifier);
- if (channelsForName.size() == 1) {
- if (auto clientOrigin = toClientOrigin(origin))
- networkProcessConnection().send(Messages::NetworkBroadcastChannelRegistry::RegisterChannel { *clientOrigin, name }, 0);
- }
+ if (channelsForName.size() == 1)
+ networkProcessConnection().send(Messages::NetworkBroadcastChannelRegistry::RegisterChannel { origin, name }, 0);
}
-void WebBroadcastChannelRegistry::unregisterChannel(const WebCore::PartitionedSecurityOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
+void WebBroadcastChannelRegistry::unregisterChannel(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
{
auto channelsPerOriginIterator = m_channelsPerOrigin.find(origin);
if (channelsPerOriginIterator == m_channelsPerOrigin.end())
@@ -81,22 +68,20 @@
return;
channelsForOrigin.remove(channelsForOriginIterator);
- if (auto clientOrigin = toClientOrigin(origin))
- networkProcessConnection().send(Messages::NetworkBroadcastChannelRegistry::UnregisterChannel { *clientOrigin, name }, 0);
+ networkProcessConnection().send(Messages::NetworkBroadcastChannelRegistry::UnregisterChannel { origin, name }, 0);
if (channelsForOrigin.isEmpty())
m_channelsPerOrigin.remove(channelsPerOriginIterator);
}
-void WebBroadcastChannelRegistry::postMessage(const WebCore::PartitionedSecurityOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&& message, CompletionHandler<void()>&& completionHandler)
+void WebBroadcastChannelRegistry::postMessage(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&& message, CompletionHandler<void()>&& completionHandler)
{
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
postMessageLocally(origin, name, source, message.copyRef(), callbackAggregator.copyRef());
- if (auto clientOrigin = toClientOrigin(origin))
- networkProcessConnection().sendWithAsyncReply(Messages::NetworkBroadcastChannelRegistry::PostMessage { *clientOrigin, name, WebCore::MessageWithMessagePorts { WTFMove(message), { } } }, [callbackAggregator] { }, 0);
+ networkProcessConnection().sendWithAsyncReply(Messages::NetworkBroadcastChannelRegistry::PostMessage { origin, name, WebCore::MessageWithMessagePorts { WTFMove(message), { } } }, [callbackAggregator] { }, 0);
}
-void WebBroadcastChannelRegistry::postMessageLocally(const WebCore::PartitionedSecurityOrigin& origin, const String& name, std::optional<WebCore::BroadcastChannelIdentifier> sourceInProcess, Ref<WebCore::SerializedScriptValue>&& message, Ref<WTF::CallbackAggregator>&& callbackAggregator)
+void WebBroadcastChannelRegistry::postMessageLocally(const WebCore::ClientOrigin& origin, const String& name, std::optional<WebCore::BroadcastChannelIdentifier> sourceInProcess, Ref<WebCore::SerializedScriptValue>&& message, Ref<WTF::CallbackAggregator>&& callbackAggregator)
{
auto channelsPerOriginIterator = m_channelsPerOrigin.find(origin);
if (channelsPerOriginIterator == m_channelsPerOrigin.end())
@@ -115,10 +100,9 @@
}
}
-void WebBroadcastChannelRegistry::postMessageToRemote(const WebCore::ClientOrigin& clientOrigin, const String& name, WebCore::MessageWithMessagePorts&& message, CompletionHandler<void()>&& completionHandler)
+void WebBroadcastChannelRegistry::postMessageToRemote(const WebCore::ClientOrigin& origin, const String& name, WebCore::MessageWithMessagePorts&& message, CompletionHandler<void()>&& completionHandler)
{
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
- WebCore::PartitionedSecurityOrigin origin { clientOrigin.topOrigin.securityOrigin(), clientOrigin.clientOrigin.securityOrigin() };
postMessageLocally(origin, name, std::nullopt, *message.message, callbackAggregator.copyRef());
}
@@ -125,11 +109,8 @@
void WebBroadcastChannelRegistry::networkProcessCrashed()
{
for (auto& [origin, channelsForOrigin] : m_channelsPerOrigin) {
- auto clientOrigin = toClientOrigin(origin);
- if (!clientOrigin)
- continue;
for (auto& name : channelsForOrigin.keys())
- networkProcessConnection().send(Messages::NetworkBroadcastChannelRegistry::RegisterChannel { *clientOrigin, name }, 0);
+ networkProcessConnection().send(Messages::NetworkBroadcastChannelRegistry::RegisterChannel { origin, name }, 0);
}
}
Modified: branches/safari-613-branch/Source/WebKit/WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h (293138 => 293139)
--- branches/safari-613-branch/Source/WebKit/WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKit/WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h 2022-04-21 02:43:49 UTC (rev 293139)
@@ -28,8 +28,6 @@
#include "Connection.h"
#include <WebCore/BroadcastChannelRegistry.h>
#include <WebCore/ClientOrigin.h>
-#include <WebCore/PartitionedSecurityOrigin.h>
-#include <WebCore/SecurityOrigin.h>
#include <wtf/HashMap.h>
#include <wtf/Vector.h>
@@ -50,9 +48,9 @@
return adoptRef(*new WebBroadcastChannelRegistry);
}
- void registerChannel(const WebCore::PartitionedSecurityOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
- void unregisterChannel(const WebCore::PartitionedSecurityOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
- void postMessage(const WebCore::PartitionedSecurityOrigin&, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&&, CompletionHandler<void()>&&) final;
+ void registerChannel(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
+ void unregisterChannel(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
+ void postMessage(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&&, CompletionHandler<void()>&&) final;
void networkProcessCrashed();
@@ -62,9 +60,9 @@
WebBroadcastChannelRegistry() = default;
void postMessageToRemote(const WebCore::ClientOrigin&, const String& name, WebCore::MessageWithMessagePorts&&, CompletionHandler<void()>&&);
- void postMessageLocally(const WebCore::PartitionedSecurityOrigin&, const String& name, std::optional<WebCore::BroadcastChannelIdentifier> sourceInProcess, Ref<WebCore::SerializedScriptValue>&&, Ref<WTF::CallbackAggregator>&&);
+ void postMessageLocally(const WebCore::ClientOrigin&, const String& name, std::optional<WebCore::BroadcastChannelIdentifier> sourceInProcess, Ref<WebCore::SerializedScriptValue>&&, Ref<WTF::CallbackAggregator>&&);
- HashMap<WebCore::PartitionedSecurityOrigin, HashMap<String, Vector<WebCore::BroadcastChannelIdentifier>>> m_channelsPerOrigin;
+ HashMap<WebCore::ClientOrigin, HashMap<String, Vector<WebCore::BroadcastChannelIdentifier>>> m_channelsPerOrigin;
};
} // namespace WebKit
Modified: branches/safari-613-branch/Source/WebKitLegacy/ChangeLog (293138 => 293139)
--- branches/safari-613-branch/Source/WebKitLegacy/ChangeLog 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKitLegacy/ChangeLog 2022-04-21 02:43:49 UTC (rev 293139)
@@ -1,137 +1,15 @@
-2022-04-19 Alan Coon <[email protected]>
+2022-01-24 Alan Coon <[email protected]>
- Cherry-pick r291589. rdar://problem/90511155
+ Cherry-pick r288389. rdar://problem/85405320
- LayoutTests/imported/w3c:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
+ Disable CFURLCache in WebKit2
+ https://bugs.webkit.org/show_bug.cgi?id=234988
+ <rdar://problem/87619196>
- Reviewed by Alex Christensen.
+ Reviewed by Geoffrey Garen.
- Import web-platform-tests test coverage.
-
- * web-platform-tests/webmessaging/broadcastchannel/opaque-origin-expected.txt: Added.
- * web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html: Added.
- * web-platform-tests/webmessaging/broadcastchannel/w3c-import.log:
-
Source/WebCore:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
- Reviewed by Alex Christensen.
-
- The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
- which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
- SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
- unique SecurityOrigins, they would compare as equal.
-
- To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
- to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
- objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
- would not be equal but the same unique SecurityOrigin would be. I then used this new
- PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
- ClientOrigin. This allows communication between several BroadcastChannels from the same
- unique origin, while preventing communication between distinct opaque origins.
-
- When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
- the Network Process at all since the destination can only be in the same WebProcess.
-
- Test: imported/w3c/web-platform-tests/webmessaging/broadcastchannel/opaque-origin.html
-
- * Headers.cmake:
- * WebCore.xcodeproj/project.pbxproj:
- * dom/BroadcastChannel.cpp:
- (WebCore::shouldPartitionOrigin):
- (WebCore::BroadcastChannel::MainThreadBridge::registerChannel):
- (WebCore::BroadcastChannel::MainThreadBridge::unregisterChannel):
- (WebCore::BroadcastChannel::MainThreadBridge::postMessage):
- * dom/BroadcastChannelRegistry.h:
- * loader/EmptyClients.cpp:
- * page/PartitionedSecurityOrigin.h: Added.
- (WebCore::PartitionedSecurityOrigin::PartitionedSecurityOrigin):
- (WebCore::PartitionedSecurityOrigin::isHashTableDeletedValue const):
- (WebCore::PartitionedSecurityOrigin::isHashTableEmptyValue const):
- (WebCore::operator==):
- (WTF::add):
- (WTF::PartitionedSecurityOriginHash::hash):
- (WTF::PartitionedSecurityOriginHash::equal):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::emptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::constructEmptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::isEmptyValue):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::peek):
- (WTF::HashTraits<WebCore::PartitionedSecurityOrigin>::take):
-
- Source/WebKit:
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- The issue is that we would use a ClientOrigin to distinguish origins for BroadcastChannel,
- which relies on SecurityOriginData internally. A unique/opaque SecurityOrigin becomes an empty
- SecurityOriginData upon conversion. As a result, when comparing ClientOrigin objects from
- unique SecurityOrigins, they would compare as equal.
-
- To address the issue, I introduced a new PartitionedSecurityOrigin type which is similar
- to ClientOrigin but stores SecurityOrigin objects internally, instead of SecurityOriginData
- objects. PartitionedSecurityOrigin's operator==() is such that different SecurityOrigins
- would not be equal but the same unique SecurityOrigin would be. I then used this new
- PartitionedSecurityOrigin type as key in our HashMap on the WebProcess side instead of
- ClientOrigin. This allows communication between several BroadcastChannels from the same
- unique origin, while preventing communication between distinct opaque origins.
-
- When the PartitionedSecurityOrigin contains an opaque security origin, we don't involve
- the Network Process at all since the destination can only be in the same WebProcess.
-
- * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.cpp:
- (WebKit::toClientOrigin):
- (WebKit::WebBroadcastChannelRegistry::registerChannel):
- (WebKit::WebBroadcastChannelRegistry::unregisterChannel):
- (WebKit::WebBroadcastChannelRegistry::postMessage):
- (WebKit::WebBroadcastChannelRegistry::postMessageLocally):
- (WebKit::WebBroadcastChannelRegistry::postMessageToRemote):
- (WebKit::WebBroadcastChannelRegistry::networkProcessCrashed):
- * WebProcess/WebCoreSupport/WebBroadcastChannelRegistry.h:
-
- Source/WebKitLegacy:
- Dust off Mac CMake build
- https://bugs.webkit.org/show_bug.cgi?id=238121
-
- Reviewed by Yusuke Suzuki.
-
- * PlatformMac.cmake:
-
- git-svn-id: https://svn.webkit.org/repository/webkit/trunk@291589 268f45cc-cd09-0410-ab3c-d52691b4dbfc
-
- 2022-01-24 Alan Coon <[email protected]>
-
- Cherry-pick r288389. rdar://problem/85405320
-
- Disable CFURLCache in WebKit2
- https://bugs.webkit.org/show_bug.cgi?id=234988
- <rdar://problem/87619196>
-
- Reviewed by Geoffrey Garen.
-2022-03-21 Chris Dumez <[email protected]>
-
- BroadcastChannel instances in distinct opaque origins can communicate
- https://bugs.webkit.org/show_bug.cgi?id=238090
- <rdar://problem/90511155>
-
- Reviewed by Alex Christensen.
-
- * WebCoreSupport/WebBroadcastChannelRegistry.cpp:
- (WebBroadcastChannelRegistry::registerChannel):
- (WebBroadcastChannelRegistry::unregisterChannel):
- (WebBroadcastChannelRegistry::postMessage):
- * WebCoreSupport/WebBroadcastChannelRegistry.h:
-
-
- Source/WebCore:
-
_CFURLStorageSessionCopyCache can be slow (see rdar://85418732) and UI process may kill network process for
being unresponsive. Since WebKit does not use CFURLCache, we should disable it to avoid the hang.
Modified: branches/safari-613-branch/Source/WebKitLegacy/WebCoreSupport/WebBroadcastChannelRegistry.cpp (293138 => 293139)
--- branches/safari-613-branch/Source/WebKitLegacy/WebCoreSupport/WebBroadcastChannelRegistry.cpp 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKitLegacy/WebCoreSupport/WebBroadcastChannelRegistry.cpp 2022-04-21 02:43:49 UTC (rev 293139)
@@ -44,7 +44,7 @@
return registry;
}
-void WebBroadcastChannelRegistry::registerChannel(const WebCore::PartitionedSecurityOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
+void WebBroadcastChannelRegistry::registerChannel(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
{
ASSERT(isMainThread());
auto& channelsForOrigin = m_channels.ensure(origin, [] { return NameToChannelIdentifiersMap { }; }).iterator->value;
@@ -53,7 +53,7 @@
channelsForName.append(identifier);
}
-void WebBroadcastChannelRegistry::unregisterChannel(const WebCore::PartitionedSecurityOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
+void WebBroadcastChannelRegistry::unregisterChannel(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier identifier)
{
ASSERT(isMainThread());
auto channelsForOriginIterator = m_channels.find(origin);
@@ -66,7 +66,7 @@
channelsForNameIterator->value.removeFirst(identifier);
}
-void WebBroadcastChannelRegistry::postMessage(const WebCore::PartitionedSecurityOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&& message, CompletionHandler<void()>&& completionHandler)
+void WebBroadcastChannelRegistry::postMessage(const WebCore::ClientOrigin& origin, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&& message, CompletionHandler<void()>&& completionHandler)
{
ASSERT(isMainThread());
auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler));
Modified: branches/safari-613-branch/Source/WebKitLegacy/WebCoreSupport/WebBroadcastChannelRegistry.h (293138 => 293139)
--- branches/safari-613-branch/Source/WebKitLegacy/WebCoreSupport/WebBroadcastChannelRegistry.h 2022-04-21 02:08:23 UTC (rev 293138)
+++ branches/safari-613-branch/Source/WebKitLegacy/WebCoreSupport/WebBroadcastChannelRegistry.h 2022-04-21 02:43:49 UTC (rev 293139)
@@ -24,7 +24,7 @@
*/
#include <WebCore/BroadcastChannelRegistry.h>
-#include <WebCore/PartitionedSecurityOrigin.h>
+#include <WebCore/ClientOrigin.h>
#include <wtf/Forward.h>
#include <wtf/WeakPtr.h>
@@ -34,13 +34,13 @@
public:
static Ref<WebBroadcastChannelRegistry> getOrCreate(bool privateSession);
- void registerChannel(const WebCore::PartitionedSecurityOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
- void unregisterChannel(const WebCore::PartitionedSecurityOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
- void postMessage(const WebCore::PartitionedSecurityOrigin&, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&&, CompletionHandler<void()>&&) final;
+ void registerChannel(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
+ void unregisterChannel(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier) final;
+ void postMessage(const WebCore::ClientOrigin&, const String& name, WebCore::BroadcastChannelIdentifier source, Ref<WebCore::SerializedScriptValue>&&, CompletionHandler<void()>&&) final;
private:
WebBroadcastChannelRegistry() = default;
using NameToChannelIdentifiersMap = HashMap<String, Vector<WebCore::BroadcastChannelIdentifier>>;
- HashMap<WebCore::PartitionedSecurityOrigin, NameToChannelIdentifiersMap> m_channels;
+ HashMap<WebCore::ClientOrigin, NameToChannelIdentifiersMap> m_channels;
};