<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[280881] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/280881">280881</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2021-08-10 19:58:01 -0700 (Tue, 10 Aug 2021)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add Cross-Origin-Opener-Policy support for Blob URLs
https://bugs.webkit.org/show_bug.cgi?id=228924

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT test that is now passing.

* web-platform-tests/html/cross-origin-opener-policy/blob-popup.https-expected.txt:

Source/WebCore:

Pass ScriptExecutionContext's cross-origin-opener-policy when registering a public
Blob URL and store it in the blob registry alongside the blob data. As a result,
we are able to service the right COOP headers on the blob response later on when
doing a load of this blob. In the future, we'll pass the cross-origin-embedder-policy
as well, once we support it.

No new tests, rebaselined existing test.

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::startLoadingBlobURL):
* dom/Document.h:
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::crossOriginOpenerPolicy const):
* dom/ScriptExecutionContext.h:
* fileapi/Blob.cpp:
(WebCore::BlobURLRegistry::registerURL):
(WebCore::Blob::Blob):
* fileapi/FileReaderLoader.cpp:
(WebCore::FileReaderLoader::start):
* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::registerBlobURL):
* fileapi/ThreadableBlobRegistry.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::loadResource):

* loader/CrossOriginEmbedderPolicy.cpp:
(WebCore::obtainCrossOriginEmbedderPolicy):
For WebKit1, the initial empty document seems to have an empty URL instead of
"about:blank" so I had to extend the check so that COEP properly gets enabled.

* loader/CrossOriginOpenerPolicy.cpp:
(WebCore::obtainCrossOriginOpenerPolicy):
For WebKit1, the initial empty document seems to have an empty URL instead of
"about:blank" so I had to extend the check so that COOP properly gets enabled.

(WebCore::crossOriginOpenerPolicyToString):
(WebCore::CrossOriginOpenerPolicy::isolatedCopy const):
(WebCore::addCrossOriginOpenerPolicyHeaders):
* loader/CrossOriginOpenerPolicy.h:
(WebCore::operator==):
(WebCore::CrossOriginOpenerPolicy::encode const):
(WebCore::CrossOriginOpenerPolicy::decode):
* platform/network/BlobData.cpp:
(WebCore::BlobData::clone const):
* platform/network/BlobData.h:
(WebCore::BlobData::crossOriginOpenerPolicy const):
(WebCore::BlobData::setCrossOriginOpenerPolicy):
* platform/network/BlobRegistry.h:
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::registerBlobURL):
(WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
* platform/network/BlobRegistryImpl.h:
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
(WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/NetworkConnectionToWebProcess.messages.in:
* NetworkProcess/NetworkDataTaskBlob.cpp:
(WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
* NetworkProcess/NetworkProcessPlatformStrategies.cpp:
(WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
* WebProcess/FileAPI/BlobRegistryProxy.cpp:
(WebKit::BlobRegistryProxy::registerBlobURL):
* WebProcess/FileAPI/BlobRegistryProxy.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPlatformStrategies.mm:

Source/WebKitLegacy/win:

* WebCoreSupport/WebPlatformStrategies.cpp:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicyblobpopuphttpsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/blob-popup.https-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesfetchFetchLoadercpp">trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomScriptExecutionContextcpp">trunk/Source/WebCore/dom/ScriptExecutionContext.cpp</a></li>
<li><a href="#trunkSourceWebCoredomScriptExecutionContexth">trunk/Source/WebCore/dom/ScriptExecutionContext.h</a></li>
<li><a href="#trunkSourceWebCorefileapiBlobcpp">trunk/Source/WebCore/fileapi/Blob.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiFileReaderLoadercpp">trunk/Source/WebCore/fileapi/FileReaderLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiThreadableBlobRegistrycpp">trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp</a></li>
<li><a href="#trunkSourceWebCorefileapiThreadableBlobRegistryh">trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderCrossOriginEmbedderPolicycpp">trunk/Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderCrossOriginOpenerPolicycpp">trunk/Source/WebCore/loader/CrossOriginOpenerPolicy.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderCrossOriginOpenerPolicyh">trunk/Source/WebCore/loader/CrossOriginOpenerPolicy.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobDatacpp">trunk/Source/WebCore/platform/network/BlobData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobDatah">trunk/Source/WebCore/platform/network/BlobData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryh">trunk/Source/WebCore/platform/network/BlobRegistry.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp">trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobRegistryImplh">trunk/Source/WebCore/platform/network/BlobRegistryImpl.h</a></li>
<li><a href="#trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp">trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcesscpp">trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessh">trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessmessagesin">trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkDataTaskBlobcpp">trunk/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp</a></li>
<li><a href="#trunkSourceWebKitNetworkProcessNetworkProcessPlatformStrategiescpp">trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessFileAPIBlobRegistryProxycpp">trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp</a></li>
<li><a href="#trunkSourceWebKitWebProcessFileAPIBlobRegistryProxyh">trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h</a></li>
<li><a href="#trunkSourceWebKitLegacymacChangeLog">trunk/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebCoreSupportWebPlatformStrategiesmm">trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm</a></li>
<li><a href="#trunkSourceWebKitLegacywinChangeLog">trunk/Source/WebKitLegacy/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacywinWebCoreSupportWebPlatformStrategiescpp">trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations       2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/LayoutTests/TestExpectations  2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -719,10 +719,6 @@
</span><span class="cx"> # test is served over HTTP.
</span><span class="cx"> imported/w3c/web-platform-tests/html/cross-origin-opener-policy/no-https.html [ Skip ]
</span><span class="cx"> 
</span><del>-# COOP tests that are failing and keep printing a different uuid in the error output.
-imported/w3c/web-platform-tests/html/cross-origin-opener-policy/blob-popup.https.html [ Failure Pass ]
-imported/w3c/web-platform-tests/html/cross-origin-opener-policy/coep-blob-popup.https.html [ Failure Pass ]
-
</del><span class="cx"> # Newly imported WPT tests that are crashing.
</span><span class="cx"> imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-04.html [ ImageOnlyFailure Crash ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog 2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/LayoutTests/imported/w3c/ChangeLog    2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -1,5 +1,16 @@
</span><span class="cx"> 2021-08-10  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><ins>+        Add Cross-Origin-Opener-Policy support for Blob URLs
+        https://bugs.webkit.org/show_bug.cgi?id=228924
+
+        Reviewed by Alex Christensen.
+
+        Rebaseline WPT test that is now passing.
+
+        * web-platform-tests/html/cross-origin-opener-policy/blob-popup.https-expected.txt:
+
+2021-08-10  Chris Dumez  <cdumez@apple.com>
+
</ins><span class="cx">         Meta HTTP refresh should not navigate if document has sandboxed automatic features browsing context flag set
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=228965
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmlcrossoriginopenerpolicyblobpopuphttpsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/blob-popup.https-expected.txt (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/blob-popup.https-expected.txt  2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/cross-origin-opener-policy/blob-popup.https-expected.txt     2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -1,4 +1,3 @@
</span><del>-CONSOLE MESSAGE: TypeError: null is not an object (evaluating 'window.opener.furtherPopup = w')
</del><span class="cx"> 
</span><del>-FAIL Cross-Origin-Opener-Policy and a blob URL popup assert_equals: expected 0 but got 36
</del><ins>+PASS Cross-Origin-Opener-Policy and a blob URL popup
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/ChangeLog      2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -1,3 +1,65 @@
</span><ins>+2021-08-10  Chris Dumez  <cdumez@apple.com>
+
+        Add Cross-Origin-Opener-Policy support for Blob URLs
+        https://bugs.webkit.org/show_bug.cgi?id=228924
+
+        Reviewed by Alex Christensen.
+
+        Pass ScriptExecutionContext's cross-origin-opener-policy when registering a public
+        Blob URL and store it in the blob registry alongside the blob data. As a result,
+        we are able to service the right COOP headers on the blob response later on when
+        doing a load of this blob. In the future, we'll pass the cross-origin-embedder-policy
+        as well, once we support it.
+
+        No new tests, rebaselined existing test.
+
+        * Modules/fetch/FetchLoader.cpp:
+        (WebCore::FetchLoader::startLoadingBlobURL):
+        * dom/Document.h:
+        * dom/ScriptExecutionContext.cpp:
+        (WebCore::ScriptExecutionContext::crossOriginOpenerPolicy const):
+        * dom/ScriptExecutionContext.h:
+        * fileapi/Blob.cpp:
+        (WebCore::BlobURLRegistry::registerURL):
+        (WebCore::Blob::Blob):
+        * fileapi/FileReaderLoader.cpp:
+        (WebCore::FileReaderLoader::start):
+        * fileapi/ThreadableBlobRegistry.cpp:
+        (WebCore::ThreadableBlobRegistry::registerBlobURL):
+        * fileapi/ThreadableBlobRegistry.h:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::loadResource):
+
+        * loader/CrossOriginEmbedderPolicy.cpp:
+        (WebCore::obtainCrossOriginEmbedderPolicy):
+        For WebKit1, the initial empty document seems to have an empty URL instead of
+        "about:blank" so I had to extend the check so that COEP properly gets enabled.
+
+        * loader/CrossOriginOpenerPolicy.cpp:
+        (WebCore::obtainCrossOriginOpenerPolicy):
+        For WebKit1, the initial empty document seems to have an empty URL instead of
+        "about:blank" so I had to extend the check so that COOP properly gets enabled.
+
+        (WebCore::crossOriginOpenerPolicyToString):
+        (WebCore::CrossOriginOpenerPolicy::isolatedCopy const):
+        (WebCore::addCrossOriginOpenerPolicyHeaders):
+        * loader/CrossOriginOpenerPolicy.h:
+        (WebCore::operator==):
+        (WebCore::CrossOriginOpenerPolicy::encode const):
+        (WebCore::CrossOriginOpenerPolicy::decode):
+        * platform/network/BlobData.cpp:
+        (WebCore::BlobData::clone const):
+        * platform/network/BlobData.h:
+        (WebCore::BlobData::crossOriginOpenerPolicy const):
+        (WebCore::BlobData::setCrossOriginOpenerPolicy):
+        * platform/network/BlobRegistry.h:
+        * platform/network/BlobRegistryImpl.cpp:
+        (WebCore::BlobRegistryImpl::registerBlobURL):
+        (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
+        * platform/network/BlobRegistryImpl.h:
+        * platform/network/BlobResourceHandle.cpp:
+        (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
+
</ins><span class="cx"> 2021-08-10  Wenson Hsieh  <wenson_hsieh@apple.com>
</span><span class="cx"> 
</span><span class="cx">         [Live Text] Unable to start drag on image when the first piece of text inside the image is selected
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp       2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp  2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -65,7 +65,7 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ThreadableBlobRegistry::registerBlobURL(context.securityOrigin(), m_urlForReading, blobURL);
</del><ins>+    ThreadableBlobRegistry::registerBlobURL(context.securityOrigin(), context.crossOriginOpenerPolicy(), m_urlForReading, blobURL);
</ins><span class="cx"> 
</span><span class="cx">     ResourceRequest request(m_urlForReading);
</span><span class="cx">     request.setInitiatorIdentifier(context.resourceRequestIdentifier());
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h      2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/dom/Document.h 2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -1354,7 +1354,7 @@
</span><span class="cx">     bool isSameOriginAsTopDocument() const { return securityOrigin().isSameOriginAs(topOrigin()); }
</span><span class="cx">     bool shouldForceNoOpenerBasedOnCOOP() const;
</span><span class="cx"> 
</span><del>-    const CrossOriginOpenerPolicy& crossOriginOpenerPolicy() const;
</del><ins>+    const CrossOriginOpenerPolicy& crossOriginOpenerPolicy() const final;
</ins><span class="cx">     void setCrossOriginOpenerPolicy(const CrossOriginOpenerPolicy&);
</span><span class="cx"> 
</span><span class="cx">     void willLoadScriptElement(const URL&);
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptExecutionContextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptExecutionContext.cpp      2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.cpp 2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "CSSValuePool.h"
</span><span class="cx"> #include "CachedScript.h"
</span><span class="cx"> #include "CommonVM.h"
</span><ins>+#include "CrossOriginOpenerPolicy.h"
</ins><span class="cx"> #include "DOMTimer.h"
</span><span class="cx"> #include "DOMWindow.h"
</span><span class="cx"> #include "DatabaseContext.h"
</span><span class="lines">@@ -335,6 +336,12 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const CrossOriginOpenerPolicy& ScriptExecutionContext::crossOriginOpenerPolicy() const
+{
+    static NeverDestroyed<CrossOriginOpenerPolicy> coop;
+    return coop;
+}
+
</ins><span class="cx"> void ScriptExecutionContext::suspendActiveDOMObjectIfNeeded(ActiveDOMObject& activeDOMObject)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(m_activeDOMObjects.contains(&activeDOMObject));
</span></span></pre></div>
<a id="trunkSourceWebCoredomScriptExecutionContexth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ScriptExecutionContext.h (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ScriptExecutionContext.h        2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/dom/ScriptExecutionContext.h   2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -78,6 +78,8 @@
</span><span class="cx"> enum class ReferrerPolicy : uint8_t;
</span><span class="cx"> enum class TaskSource : uint8_t;
</span><span class="cx"> 
</span><ins>+struct CrossOriginOpenerPolicy;
+
</ins><span class="cx"> #if ENABLE(SERVICE_WORKER)
</span><span class="cx"> class ServiceWorker;
</span><span class="cx"> class ServiceWorkerContainer;
</span><span class="lines">@@ -146,6 +148,8 @@
</span><span class="cx">     bool activeDOMObjectsAreSuspended() const { return m_activeDOMObjectsAreSuspended; }
</span><span class="cx">     bool activeDOMObjectsAreStopped() const { return m_activeDOMObjectsAreStopped; }
</span><span class="cx"> 
</span><ins>+    virtual const CrossOriginOpenerPolicy& crossOriginOpenerPolicy() const;
+
</ins><span class="cx">     JSC::ScriptExecutionStatus jscScriptExecutionStatus() const;
</span><span class="cx"> 
</span><span class="cx">     // Called from the constructor and destructors of ActiveDOMObject.
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiBlobcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/Blob.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/Blob.cpp    2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/fileapi/Blob.cpp       2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -62,7 +62,7 @@
</span><span class="cx"> void BlobURLRegistry::registerURL(ScriptExecutionContext& context, const URL& publicURL, URLRegistrable& blob)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(&blob.registry() == this);
</span><del>-    ThreadableBlobRegistry::registerBlobURL(context.securityOrigin(), publicURL, static_cast<Blob&>(blob).url());
</del><ins>+    ThreadableBlobRegistry::registerBlobURL(context.securityOrigin(), context.crossOriginOpenerPolicy(), publicURL, static_cast<Blob&>(blob).url());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BlobURLRegistry::unregisterURL(const URL& url)
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">     , m_internalURL(BlobURL::createInternalURL())
</span><span class="cx"> {
</span><span class="cx">     if (fileBackedPath.isEmpty())
</span><del>-        ThreadableBlobRegistry::registerBlobURL(nullptr, m_internalURL, srcURL);
</del><ins>+        ThreadableBlobRegistry::registerBlobURL(nullptr, { }, m_internalURL, srcURL);
</ins><span class="cx">     else
</span><span class="cx">         ThreadableBlobRegistry::registerBlobURLOptionallyFileBacked(m_internalURL, srcURL, fileBackedPath, m_type);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiFileReaderLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/FileReaderLoader.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/FileReaderLoader.cpp        2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/fileapi/FileReaderLoader.cpp   2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">         failed(SecurityError);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), m_urlForReading, blob.url());
</del><ins>+    ThreadableBlobRegistry::registerBlobURL(scriptExecutionContext->securityOrigin(), scriptExecutionContext->crossOriginOpenerPolicy(), m_urlForReading, blob.url());
</ins><span class="cx"> 
</span><span class="cx">     // Construct and load the request.
</span><span class="cx">     ResourceRequest request(m_urlForReading);
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiThreadableBlobRegistrycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp  2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.cpp     2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -99,7 +99,7 @@
</span><span class="cx">     return url.string().substring(startIndex, endIndex - startIndex - 1) == "null";
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void ThreadableBlobRegistry::registerBlobURL(SecurityOrigin* origin, const URL& url, const URL& srcURL)
</del><ins>+void ThreadableBlobRegistry::registerBlobURL(SecurityOrigin* origin, const CrossOriginOpenerPolicy& coop, const URL& url, const URL& srcURL)
</ins><span class="cx"> {
</span><span class="cx">     // If the blob URL contains null origin, as in the context with unique security origin or file URL, save the mapping between url and origin so that the origin can be retrived when doing security origin check.
</span><span class="cx">     if (origin && isBlobURLContainsNullOrigin(url))
</span><span class="lines">@@ -106,12 +106,12 @@
</span><span class="cx">         originMap()->add(url.string(), origin);
</span><span class="cx"> 
</span><span class="cx">     if (isMainThread()) {
</span><del>-        blobRegistry().registerBlobURL(url, srcURL);
</del><ins>+        blobRegistry().registerBlobURL(url, srcURL, coop);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    callOnMainThread([url = url.isolatedCopy(), srcURL = srcURL.isolatedCopy()] {
-        blobRegistry().registerBlobURL(url, srcURL);
</del><ins>+    callOnMainThread([url = url.isolatedCopy(), srcURL = srcURL.isolatedCopy(), coop = crossThreadCopy(coop)] {
+        blobRegistry().registerBlobURL(url, srcURL, coop);
</ins><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorefileapiThreadableBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h    2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/fileapi/ThreadableBlobRegistry.h       2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -38,11 +38,13 @@
</span><span class="cx"> class BlobPart;
</span><span class="cx"> class SecurityOrigin;
</span><span class="cx"> 
</span><ins>+struct CrossOriginOpenerPolicy;
+
</ins><span class="cx"> class ThreadableBlobRegistry {
</span><span class="cx"> public:
</span><span class="cx">     static void registerFileBlobURL(const URL&, const String& path, const String& replacementPath, const String& contentType);
</span><span class="cx">     static void registerBlobURL(const URL&, Vector<BlobPart>&& blobParts, const String& contentType);
</span><del>-    static void registerBlobURL(SecurityOrigin*, const URL&, const URL& srcURL);
</del><ins>+    static void registerBlobURL(SecurityOrigin*, const CrossOriginOpenerPolicy&, const URL&, const URL& srcURL);
</ins><span class="cx">     static void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
</span><span class="cx">     static void registerBlobURLForSlice(const URL& newURL, const URL& srcURL, long long start, long long end, const String& contentType);
</span><span class="cx">     static void unregisterBlobURL(const URL&);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp   2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp      2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -1552,7 +1552,7 @@
</span><span class="cx">         if (!m_blobURLForReading.isEmpty())
</span><span class="cx">             ThreadableBlobRegistry::unregisterBlobURL(m_blobURLForReading);
</span><span class="cx">         m_blobURLForReading = BlobURL::createPublicURL(&document().securityOrigin());
</span><del>-        ThreadableBlobRegistry::registerBlobURL(&document().securityOrigin(), m_blobURLForReading, m_blob->url());
</del><ins>+        ThreadableBlobRegistry::registerBlobURL(&document().securityOrigin(), document().crossOriginOpenerPolicy(), m_blobURLForReading, m_blob->url());
</ins><span class="cx"> 
</span><span class="cx">         if (!m_player->load(m_blobURLForReading, contentType, keySystem))
</span><span class="cx">             mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderCrossOriginEmbedderPolicycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp        2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/loader/CrossOriginEmbedderPolicy.cpp   2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -45,7 +45,7 @@
</span><span class="cx"> 
</span><span class="cx">     CrossOriginEmbedderPolicy policy;
</span><span class="cx">     // FIXME: about:blank should be marked as secure as per https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url.
</span><del>-    if (!context.isSecureContext() && context.url() != aboutBlankURL())
</del><ins>+    if (!context.isSecureContext() && context.url() != aboutBlankURL() && !context.url().isEmpty())
</ins><span class="cx">         return policy;
</span><span class="cx"> 
</span><span class="cx">     parseCOEPHeader(HTTPHeaderName::CrossOriginEmbedderPolicy, policy.value, policy.reportingEndpoint);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderCrossOriginOpenerPolicycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/CrossOriginOpenerPolicy.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/CrossOriginOpenerPolicy.cpp  2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/loader/CrossOriginOpenerPolicy.cpp     2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -33,6 +33,20 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+static String crossOriginOpenerPolicyToString(const CrossOriginOpenerPolicyValue& coop)
+{
+    switch (coop) {
+    case CrossOriginOpenerPolicyValue::SameOrigin:
+    case CrossOriginOpenerPolicyValue::SameOriginPlusCOEP:
+        return "same-origin"_s;
+    case CrossOriginOpenerPolicyValue::SameOriginAllowPopups:
+        return "same-origin-allow-popups"_s;
+    case CrossOriginOpenerPolicyValue::UnsafeNone:
+        break;
+    }
+    return "unsafe-none"_s;
+}
+
</ins><span class="cx"> // https://html.spec.whatwg.org/multipage/origin.html#obtain-coop
</span><span class="cx"> CrossOriginOpenerPolicy obtainCrossOriginOpenerPolicy(const ResourceResponse& response, const ScriptExecutionContext& context)
</span><span class="cx"> {
</span><span class="lines">@@ -61,7 +75,7 @@
</span><span class="cx"> 
</span><span class="cx">     CrossOriginOpenerPolicy policy;
</span><span class="cx">     // FIXME: about:blank should be marked as secure as per https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url.
</span><del>-    if (!context.isSecureContext() && context.url() != aboutBlankURL())
</del><ins>+    if (!context.isSecureContext() && context.url() != aboutBlankURL() && !context.url().isEmpty())
</ins><span class="cx">         return policy;
</span><span class="cx"> 
</span><span class="cx">     parseCOOP(HTTPHeaderName::CrossOriginOpenerPolicy, policy.value, policy.reportingEndpoint);
</span><span class="lines">@@ -69,4 +83,34 @@
</span><span class="cx">     return policy;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+CrossOriginOpenerPolicy CrossOriginOpenerPolicy::isolatedCopy() const
+{
+    return {
+        value,
+        reportingEndpoint.isolatedCopy(),
+        reportOnlyValue,
+        reportOnlyReportingEndpoint.isolatedCopy()
+    };
+}
+
+void addCrossOriginOpenerPolicyHeaders(ResourceResponse& response, const CrossOriginOpenerPolicy& coop)
+{
+    if (coop.value != CrossOriginOpenerPolicyValue::UnsafeNone) {
+        if (coop.reportingEndpoint.isEmpty())
+            response.setHTTPHeaderField(HTTPHeaderName::CrossOriginOpenerPolicy, crossOriginOpenerPolicyToString(coop.value));
+        else
+            response.setHTTPHeaderField(HTTPHeaderName::CrossOriginOpenerPolicy, makeString(crossOriginOpenerPolicyToString(coop.value), "; report-to=\"", coop.reportingEndpoint, '\"'));
+        if (coop.value == CrossOriginOpenerPolicyValue::SameOriginPlusCOEP)
+            response.setHTTPHeaderField(HTTPHeaderName::CrossOriginEmbedderPolicy, "require-corp"_s); // FIXME: Pass in coep and set header value correctly.
+    }
+    if (coop.reportOnlyValue != CrossOriginOpenerPolicyValue::UnsafeNone) {
+        if (coop.reportOnlyReportingEndpoint.isEmpty())
+            response.setHTTPHeaderField(HTTPHeaderName::CrossOriginOpenerPolicyReportOnly, crossOriginOpenerPolicyToString(coop.reportOnlyValue));
+        else
+            response.setHTTPHeaderField(HTTPHeaderName::CrossOriginOpenerPolicyReportOnly, makeString(crossOriginOpenerPolicyToString(coop.reportOnlyValue), "; report-to=\"", coop.reportOnlyReportingEndpoint, '\"'));
+        if (coop.reportOnlyValue == CrossOriginOpenerPolicyValue::SameOriginPlusCOEP)
+            response.setHTTPHeaderField(HTTPHeaderName::CrossOriginEmbedderPolicyReportOnly, "require-corp"_s); // FIXME: Pass in coep and set header value correctly.
+    }
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderCrossOriginOpenerPolicyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/CrossOriginOpenerPolicy.h (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/CrossOriginOpenerPolicy.h    2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/loader/CrossOriginOpenerPolicy.h       2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -48,8 +48,54 @@
</span><span class="cx">     String reportingEndpoint;
</span><span class="cx">     CrossOriginOpenerPolicyValue reportOnlyValue { CrossOriginOpenerPolicyValue::UnsafeNone };
</span><span class="cx">     String reportOnlyReportingEndpoint;
</span><ins>+
+    CrossOriginOpenerPolicy isolatedCopy() const;
+    template<class Encoder> void encode(Encoder&) const;
+    template<class Decoder> static std::optional<CrossOriginOpenerPolicy> decode(Decoder&);
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+inline bool operator==(const CrossOriginOpenerPolicy& a, const CrossOriginOpenerPolicy& b)
+{
+    return a.value == b.value && a.reportingEndpoint == b.reportingEndpoint && a.reportOnlyValue == b.reportOnlyValue && a.reportOnlyReportingEndpoint == b.reportOnlyReportingEndpoint;
+}
+
+template<class Encoder>
+void CrossOriginOpenerPolicy::encode(Encoder& encoder) const
+{
+    encoder << value << reportingEndpoint << reportOnlyValue << reportOnlyReportingEndpoint;
+}
+
+template<class Decoder>
+std::optional<CrossOriginOpenerPolicy> CrossOriginOpenerPolicy::decode(Decoder& decoder)
+{
+    std::optional<CrossOriginOpenerPolicyValue> value;
+    decoder >> value;
+    if (!value)
+        return std::nullopt;
+
+    std::optional<String> reportingEndpoint;
+    decoder >> reportingEndpoint;
+    if (!reportingEndpoint)
+        return std::nullopt;
+
+    std::optional<CrossOriginOpenerPolicyValue> reportOnlyValue;
+    decoder >> reportOnlyValue;
+    if (!reportOnlyValue)
+        return std::nullopt;
+
+    std::optional<String> reportOnlyReportingEndpoint;
+    decoder >> reportOnlyReportingEndpoint;
+    if (!reportOnlyReportingEndpoint)
+        return std::nullopt;
+
+    return {{
+        *value,
+        WTFMove(*reportingEndpoint),
+        *reportOnlyValue,
+        WTFMove(*reportOnlyReportingEndpoint)
+    }};
+}
+
</ins><span class="cx"> // https://html.spec.whatwg.org/multipage/origin.html#coop-enforcement-result
</span><span class="cx"> struct CrossOriginOpenerPolicyEnforcementResult {
</span><span class="cx">     bool needsBrowsingContextGroupSwitch { false };
</span><span class="lines">@@ -61,5 +107,20 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> CrossOriginOpenerPolicy obtainCrossOriginOpenerPolicy(const ResourceResponse&, const ScriptExecutionContext&);
</span><ins>+WEBCORE_EXPORT void addCrossOriginOpenerPolicyHeaders(ResourceResponse&, const CrossOriginOpenerPolicy&);
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span><ins>+
+namespace WTF {
+
+template<> struct EnumTraits<WebCore::CrossOriginOpenerPolicyValue> {
+    using values = EnumValues<
+    WebCore::CrossOriginOpenerPolicyValue,
+    WebCore::CrossOriginOpenerPolicyValue::UnsafeNone,
+    WebCore::CrossOriginOpenerPolicyValue::SameOrigin,
+    WebCore::CrossOriginOpenerPolicyValue::SameOriginPlusCOEP,
+    WebCore::CrossOriginOpenerPolicyValue::SameOriginAllowPopups
+    >;
+};
+
+} // namespace WTF
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobData.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobData.cpp       2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/platform/network/BlobData.cpp  2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -78,6 +78,14 @@
</span><span class="cx">     m_items.append(BlobDataItem(WTFMove(file)));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+Ref<BlobData> BlobData::clone() const
+{
+    auto blobData = BlobData::create(m_contentType);
+    blobData->m_coop = m_coop;
+    blobData->m_items = m_items;
+    return blobData;
+}
+
</ins><span class="cx"> void BlobData::appendFile(BlobDataFileReference* file, long long offset, long long length)
</span><span class="cx"> {
</span><span class="cx">     m_items.append(BlobDataItem(file, offset, length));
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobData.h (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobData.h 2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/platform/network/BlobData.h    2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #define BlobData_h
</span><span class="cx"> 
</span><span class="cx"> #include "BlobDataFileReference.h"
</span><ins>+#include "CrossOriginOpenerPolicy.h"
</ins><span class="cx"> #include "ThreadSafeDataBuffer.h"
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/ThreadSafeRefCounted.h>
</span><span class="lines">@@ -105,6 +106,9 @@
</span><span class="cx"> 
</span><span class="cx">     const String& contentType() const { return m_contentType; }
</span><span class="cx"> 
</span><ins>+    const CrossOriginOpenerPolicy& crossOriginOpenerPolicy() const { return m_coop; }
+    void setCrossOriginOpenerPolicy(const CrossOriginOpenerPolicy& coop) { m_coop = coop; }
+
</ins><span class="cx">     const BlobDataItemList& items() const { return m_items; }
</span><span class="cx">     void swapItems(BlobDataItemList&);
</span><span class="cx"> 
</span><span class="lines">@@ -111,6 +115,8 @@
</span><span class="cx">     void appendData(const ThreadSafeDataBuffer&);
</span><span class="cx">     void appendFile(Ref<BlobDataFileReference>&&);
</span><span class="cx"> 
</span><ins>+    Ref<BlobData> clone() const;
+
</ins><span class="cx"> private:
</span><span class="cx">     friend class BlobRegistryImpl;
</span><span class="cx">     BlobData(const String& contentType);
</span><span class="lines">@@ -119,6 +125,7 @@
</span><span class="cx">     void appendFile(BlobDataFileReference*, long long offset, long long length);
</span><span class="cx"> 
</span><span class="cx">     String m_contentType;
</span><ins>+    CrossOriginOpenerPolicy m_coop;
</ins><span class="cx">     BlobDataItemList m_items;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistry.h (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistry.h     2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/platform/network/BlobRegistry.h        2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><ins>+#include <optional>
</ins><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -40,6 +41,8 @@
</span><span class="cx"> class BlobRegistry;
</span><span class="cx"> class BlobRegistryImpl;
</span><span class="cx"> 
</span><ins>+struct CrossOriginOpenerPolicy;
+
</ins><span class="cx"> WEBCORE_EXPORT BlobRegistry& blobRegistry();
</span><span class="cx"> 
</span><span class="cx"> // BlobRegistry is not thread-safe. It should only be called from main thread.
</span><span class="lines">@@ -53,7 +56,7 @@
</span><span class="cx">     virtual void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType) = 0;
</span><span class="cx">     
</span><span class="cx">     // Registers a new blob URL referring to the blob data identified by the specified srcURL.
</span><del>-    virtual void registerBlobURL(const URL&, const URL& srcURL) = 0;
</del><ins>+    virtual void registerBlobURL(const URL&, const URL& srcURL, const CrossOriginOpenerPolicy&) = 0;
</ins><span class="cx"> 
</span><span class="cx">     // Registers a new blob URL referring to the blob data identified by the specified srcURL or, if none found, referring to the file found at the given path.
</span><span class="cx">     virtual void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp       2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.cpp  2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -152,12 +152,12 @@
</span><span class="cx">     addBlobData(url.string(), WTFMove(blobData));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobRegistryImpl::registerBlobURL(const URL& url, const URL& srcURL)
</del><ins>+void BlobRegistryImpl::registerBlobURL(const URL& url, const URL& srcURL, const CrossOriginOpenerPolicy& coop)
</ins><span class="cx"> {
</span><del>-    registerBlobURLOptionallyFileBacked(url, srcURL, nullptr, { });
</del><ins>+    registerBlobURLOptionallyFileBacked(url, srcURL, nullptr, { }, coop);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobRegistryImpl::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& file, const String& contentType)
</del><ins>+void BlobRegistryImpl::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& file, const String& contentType, const CrossOriginOpenerPolicy& coop)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isMainThread());
</span><span class="cx">     registerBlobResourceHandleConstructor();
</span><span class="lines">@@ -164,7 +164,13 @@
</span><span class="cx"> 
</span><span class="cx">     BlobData* src = getBlobDataFromURL(srcURL);
</span><span class="cx">     if (src) {
</span><del>-        addBlobData(url.string(), src);
</del><ins>+        if (src->crossOriginOpenerPolicy() == coop)
+            addBlobData(url.string(), src);
+        else {
+            auto clone = src->clone();
+            clone->setCrossOriginOpenerPolicy(coop);
+            addBlobData(url.string(), WTFMove(clone));
+        }
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -173,6 +179,7 @@
</span><span class="cx"> 
</span><span class="cx">     auto backingFile = BlobData::create(contentType);
</span><span class="cx">     backingFile->appendFile(file.releaseNonNull());
</span><ins>+    backingFile->setCrossOriginOpenerPolicy(coop);
</ins><span class="cx"> 
</span><span class="cx">     addBlobData(url.string(), WTFMove(backingFile));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobRegistryImplh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobRegistryImpl.h (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobRegistryImpl.h 2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/platform/network/BlobRegistryImpl.h    2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -45,6 +45,7 @@
</span><span class="cx"> class ResourceHandleClient;
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> class ThreadSafeDataBuffer;
</span><ins>+struct CrossOriginOpenerPolicy;
</ins><span class="cx"> 
</span><span class="cx"> // BlobRegistryImpl is not thread-safe. It should only be called from main thread.
</span><span class="cx"> class WEBCORE_EXPORT BlobRegistryImpl {
</span><span class="lines">@@ -61,8 +62,8 @@
</span><span class="cx"> 
</span><span class="cx">     void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& contentType);
</span><span class="cx">     void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType);
</span><del>-    void registerBlobURL(const URL&, const URL& srcURL);
-    void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType);
</del><ins>+    void registerBlobURL(const URL&, const URL& srcURL, const CrossOriginOpenerPolicy&);
+    void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType, const CrossOriginOpenerPolicy&);
</ins><span class="cx">     void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType);
</span><span class="cx">     void unregisterBlobURL(const URL&);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformnetworkBlobResourceHandlecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp     2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebCore/platform/network/BlobResourceHandle.cpp        2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include "AsyncFileStream.h"
</span><span class="cx"> #include "BlobData.h"
</span><ins>+#include "CrossOriginOpenerPolicy.h"
</ins><span class="cx"> #include "FileStream.h"
</span><span class="cx"> #include "HTTPHeaderNames.h"
</span><span class="cx"> #include "HTTPParsers.h"
</span><span class="lines">@@ -576,6 +577,7 @@
</span><span class="cx"> 
</span><span class="cx">     response.setHTTPHeaderField(HTTPHeaderName::ContentType, m_blobData->contentType());
</span><span class="cx">     response.setHTTPHeaderField(HTTPHeaderName::ContentLength, String::number(m_totalRemainingSize));
</span><ins>+    addCrossOriginOpenerPolicyHeaders(response, m_blobData->crossOriginOpenerPolicy());
</ins><span class="cx"> 
</span><span class="cx">     if (isRangeRequest)
</span><span class="cx">         response.setHTTPHeaderField(HTTPHeaderName::ContentRange, ParsedContentRange(m_rangeOffset, m_rangeEnd, m_totalSize).headerValue());
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKit/ChangeLog       2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2021-08-10  Chris Dumez  <cdumez@apple.com>
+
+        Add Cross-Origin-Opener-Policy support for Blob URLs
+        https://bugs.webkit.org/show_bug.cgi?id=228924
+
+        Reviewed by Alex Christensen.
+
+        * NetworkProcess/NetworkConnectionToWebProcess.cpp:
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURLFromURL):
+        (WebKit::NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked):
+        * NetworkProcess/NetworkConnectionToWebProcess.h:
+        * NetworkProcess/NetworkConnectionToWebProcess.messages.in:
+        * NetworkProcess/NetworkDataTaskBlob.cpp:
+        (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse):
+        * NetworkProcess/NetworkProcessPlatformStrategies.cpp:
+        (WebKit::NetworkProcessPlatformStrategies::createBlobRegistry):
+        * WebProcess/FileAPI/BlobRegistryProxy.cpp:
+        (WebKit::BlobRegistryProxy::registerBlobURL):
+        * WebProcess/FileAPI/BlobRegistryProxy.h:
+
</ins><span class="cx"> 2021-08-10  Tim Horton  <timothy_horton@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Unreviewed build fix.
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp     2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp        2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -828,13 +828,13 @@
</span><span class="cx">     session->blobRegistry().registerBlobURL(url, WTFMove(blobParts), contentType);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void NetworkConnectionToWebProcess::registerBlobURLFromURL(const URL& url, const URL& srcURL)
</del><ins>+void NetworkConnectionToWebProcess::registerBlobURLFromURL(const URL& url, const URL& srcURL, CrossOriginOpenerPolicy&& coop)
</ins><span class="cx"> {
</span><span class="cx">     auto* session = networkSession();
</span><span class="cx">     if (!session)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    session->blobRegistry().registerBlobURL(url, srcURL);
</del><ins>+    session->blobRegistry().registerBlobURL(url, srcURL, WTFMove(coop));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkConnectionToWebProcess::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, const String& fileBackedPath, const String& contentType)
</span><span class="lines">@@ -845,7 +845,7 @@
</span><span class="cx">     if (!session)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    session->blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, BlobDataFileReferenceWithSandboxExtension::create(fileBackedPath), contentType);
</del><ins>+    session->blobRegistry().registerBlobURLOptionallyFileBacked(url, srcURL, BlobDataFileReferenceWithSandboxExtension::create(fileBackedPath), contentType, { });
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void NetworkConnectionToWebProcess::registerBlobURLForSlice(const URL& url, const URL& srcURL, int64_t start, int64_t end, const String& contentType)
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h       2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h  2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx"> class ResourceRequest;
</span><span class="cx"> enum class StorageAccessScope : bool;
</span><span class="cx"> enum class ShouldAskITP : bool;
</span><ins>+struct CrossOriginOpenerPolicy;
</ins><span class="cx"> struct RequestStorageAccessResult;
</span><span class="cx"> struct SameSiteInfo;
</span><span class="cx"> 
</span><span class="lines">@@ -229,7 +230,7 @@
</span><span class="cx"> 
</span><span class="cx">     void registerFileBlobURL(const URL&, const String& path, const String& replacementPath, SandboxExtension::Handle&&, const String& contentType);
</span><span class="cx">     void registerBlobURL(const URL&, Vector<WebCore::BlobPart>&&, const String& contentType);
</span><del>-    void registerBlobURLFromURL(const URL&, const URL& srcURL);
</del><ins>+    void registerBlobURLFromURL(const URL&, const URL& srcURL, WebCore::CrossOriginOpenerPolicy&&);
</ins><span class="cx">     void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, const String& fileBackedPath, const String& contentType);
</span><span class="cx">     void registerBlobURLForSlice(const URL&, const URL& srcURL, int64_t start, int64_t end, const String& contentType);
</span><span class="cx">     void blobSize(const URL&, CompletionHandler<void(uint64_t)>&&);
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkConnectionToWebProcessmessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in     2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.messages.in        2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> 
</span><span class="cx">     RegisterFileBlobURL(URL url, String path, String replacementPath, WebKit::SandboxExtension::Handle extensionHandle, String contentType)
</span><span class="cx">     RegisterBlobURL(URL url, Vector<WebCore::BlobPart> blobParts, String contentType)
</span><del>-    RegisterBlobURLFromURL(URL url, URL srcURL)
</del><ins>+    RegisterBlobURLFromURL(URL url, URL srcURL, struct WebCore::CrossOriginOpenerPolicy coop)
</ins><span class="cx">     RegisterBlobURLOptionallyFileBacked(URL url, URL srcURL, String fileBackedPath, String contentType)
</span><span class="cx">     RegisterBlobURLForSlice(URL url, URL srcURL, int64_t start, int64_t end, String contentType)
</span><span class="cx">     UnregisterBlobURL(URL url)
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkDataTaskBlobcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp       2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKit/NetworkProcess/NetworkDataTaskBlob.cpp  2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -41,6 +41,7 @@
</span><span class="cx"> #include "WebErrors.h"
</span><span class="cx"> #include <WebCore/AsyncFileStream.h>
</span><span class="cx"> #include <WebCore/BlobRegistryImpl.h>
</span><ins>+#include <WebCore/CrossOriginOpenerPolicy.h>
</ins><span class="cx"> #include <WebCore/HTTPParsers.h>
</span><span class="cx"> #include <WebCore/ParsedContentRange.h>
</span><span class="cx"> #include <WebCore/ResourceError.h>
</span><span class="lines">@@ -264,6 +265,7 @@
</span><span class="cx"> 
</span><span class="cx">         response.setHTTPHeaderField(HTTPHeaderName::ContentType, m_blobData->contentType());
</span><span class="cx">         response.setHTTPHeaderField(HTTPHeaderName::ContentLength, String::number(m_totalRemainingSize));
</span><ins>+        addCrossOriginOpenerPolicyHeaders(response, m_blobData->crossOriginOpenerPolicy());
</ins><span class="cx"> 
</span><span class="cx">         if (isRangeRequest)
</span><span class="cx">             response.setHTTPHeaderField(HTTPHeaderName::ContentRange, ParsedContentRange(m_rangeOffset, m_rangeEnd, m_totalSize).headerValue());
</span></span></pre></div>
<a id="trunkSourceWebKitNetworkProcessNetworkProcessPlatformStrategiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp  2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKit/NetworkProcess/NetworkProcessPlatformStrategies.cpp     2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     class EmptyBlobRegistry : public WebCore::BlobRegistry {
</span><span class="cx">         void registerFileBlobURL(const URL&, Ref<BlobDataFileReference>&&, const String& path, const String& contentType) final { ASSERT_NOT_REACHED(); }
</span><span class="cx">         void registerBlobURL(const URL&, Vector<BlobPart>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
</span><del>-        void registerBlobURL(const URL&, const URL& srcURL) final { ASSERT_NOT_REACHED(); }
</del><ins>+        void registerBlobURL(const URL&, const URL& srcURL, const WebCore::CrossOriginOpenerPolicy&) final { ASSERT_NOT_REACHED(); }
</ins><span class="cx">         void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<BlobDataFileReference>&&, const String& contentType) final { ASSERT_NOT_REACHED(); }
</span><span class="cx">         void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType) final { ASSERT_NOT_REACHED(); }
</span><span class="cx">         void unregisterBlobURL(const URL&) final { ASSERT_NOT_REACHED(); }
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessFileAPIBlobRegistryProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp     2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.cpp        2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "WebCoreArgumentCoders.h"
</span><span class="cx"> #include "WebProcess.h"
</span><span class="cx"> #include <WebCore/BlobDataFileReference.h>
</span><ins>+#include <WebCore/CrossOriginOpenerPolicy.h>
</ins><span class="cx"> #include <WebCore/SWContextManager.h>
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -53,9 +54,9 @@
</span><span class="cx">     WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURL(url, blobParts, contentType), 0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BlobRegistryProxy::registerBlobURL(const URL& url, const URL& srcURL)
</del><ins>+void BlobRegistryProxy::registerBlobURL(const URL& url, const URL& srcURL, const CrossOriginOpenerPolicy& coop)
</ins><span class="cx"> {
</span><del>-    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL { url, srcURL }, 0);
</del><ins>+    WebProcess::singleton().ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::RegisterBlobURLFromURL { url, srcURL, coop }, 0);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void BlobRegistryProxy::registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&& file, const String& contentType)
</span></span></pre></div>
<a id="trunkSourceWebKitWebProcessFileAPIBlobRegistryProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h       2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKit/WebProcess/FileAPI/BlobRegistryProxy.h  2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -33,7 +33,7 @@
</span><span class="cx"> public:
</span><span class="cx">     void registerFileBlobURL(const URL&, Ref<WebCore::BlobDataFileReference>&&, const String& path, const String& contentType) final;
</span><span class="cx">     void registerBlobURL(const URL&, Vector<WebCore::BlobPart>&&, const String& contentType) final;
</span><del>-    void registerBlobURL(const URL&, const URL& srcURL) final;
</del><ins>+    void registerBlobURL(const URL&, const URL& srcURL, const WebCore::CrossOriginOpenerPolicy&) final;
</ins><span class="cx">     void registerBlobURLOptionallyFileBacked(const URL&, const URL& srcURL, RefPtr<WebCore::BlobDataFileReference>&&, const String& contentType) final;
</span><span class="cx">     void unregisterBlobURL(const URL&) final;
</span><span class="cx">     void registerBlobURLForSlice(const URL&, const URL& srcURL, long long start, long long end, const String& contentType) final;
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/ChangeLog  2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog     2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -1,5 +1,14 @@
</span><span class="cx"> 2021-08-10  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><ins>+        Add Cross-Origin-Opener-Policy support for Blob URLs
+        https://bugs.webkit.org/show_bug.cgi?id=228924
+
+        Reviewed by Alex Christensen.
+
+        * WebCoreSupport/WebPlatformStrategies.mm:
+
+2021-08-10  Chris Dumez  <cdumez@apple.com>
+
</ins><span class="cx">         Document.baseURI is inaccurate for iframe srcdoc documents
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=228933
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebCoreSupportWebPlatformStrategiesmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm    2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebPlatformStrategies.mm       2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -85,8 +85,8 @@
</span><span class="cx"> private:
</span><span class="cx">     void registerFileBlobURL(const URL& url, Ref<BlobDataFileReference>&& reference, const String&, const String& contentType) final { m_blobRegistry.registerFileBlobURL(url, WTFMove(reference), contentType); }
</span><span class="cx">     void registerBlobURL(const URL& url, Vector<BlobPart>&& parts, const String& contentType) final { m_blobRegistry.registerBlobURL(url, WTFMove(parts), contentType); }
</span><del>-    void registerBlobURL(const URL& url, const URL& srcURL) final { m_blobRegistry.registerBlobURL(url, srcURL); }
-    void registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType); }
</del><ins>+    void registerBlobURL(const URL& url, const URL& srcURL, const CrossOriginOpenerPolicy& coop) final { m_blobRegistry.registerBlobURL(url, srcURL, coop); }
+    void registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType, { }); }
</ins><span class="cx">     void registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end, const String& contentType) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end, contentType); }
</span><span class="cx">     void unregisterBlobURL(const URL& url) final { m_blobRegistry.unregisterBlobURL(url); }
</span><span class="cx">     unsigned long long blobSize(const URL& url) final { return m_blobRegistry.blobSize(url); }
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/ChangeLog (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/ChangeLog  2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKitLegacy/win/ChangeLog     2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -1,3 +1,12 @@
</span><ins>+2021-08-10  Chris Dumez  <cdumez@apple.com>
+
+        Add Cross-Origin-Opener-Policy support for Blob URLs
+        https://bugs.webkit.org/show_bug.cgi?id=228924
+
+        Reviewed by Alex Christensen.
+
+        * WebCoreSupport/WebPlatformStrategies.cpp:
+
</ins><span class="cx"> 2021-08-09  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Blob URL changes after loading it
</span></span></pre></div>
<a id="trunkSourceWebKitLegacywinWebCoreSupportWebPlatformStrategiescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp (280880 => 280881)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp   2021-08-11 01:55:16 UTC (rev 280880)
+++ trunk/Source/WebKitLegacy/win/WebCoreSupport/WebPlatformStrategies.cpp      2021-08-11 02:58:01 UTC (rev 280881)
</span><span class="lines">@@ -81,8 +81,8 @@
</span><span class="cx"> private:
</span><span class="cx">     void registerFileBlobURL(const URL& url, Ref<BlobDataFileReference>&& reference, const String&, const String& contentType) final { m_blobRegistry.registerFileBlobURL(url, WTFMove(reference), contentType); }
</span><span class="cx">     void registerBlobURL(const URL& url, Vector<BlobPart>&& parts, const String& contentType) final { m_blobRegistry.registerBlobURL(url, WTFMove(parts), contentType); }
</span><del>-    void registerBlobURL(const URL& url, const URL& srcURL) final { m_blobRegistry.registerBlobURL(url, srcURL); }
-    void registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType); }
</del><ins>+    void registerBlobURL(const URL& url, const URL& srcURL, const CrossOriginOpenerPolicy& coop) final { m_blobRegistry.registerBlobURL(url, srcURL, coop); }
+    void registerBlobURLOptionallyFileBacked(const URL& url, const URL& srcURL, RefPtr<BlobDataFileReference>&& reference, const String& contentType) final { m_blobRegistry.registerBlobURLOptionallyFileBacked(url, srcURL, WTFMove(reference), contentType, { }); }
</ins><span class="cx">     void registerBlobURLForSlice(const URL& url, const URL& srcURL, long long start, long long end, const String& contentType) final { m_blobRegistry.registerBlobURLForSlice(url, srcURL, start, end, contentType); }
</span><span class="cx">     void unregisterBlobURL(const URL& url) final { m_blobRegistry.unregisterBlobURL(url); }
</span><span class="cx">     unsigned long long blobSize(const URL& url) final { return m_blobRegistry.blobSize(url); }
</span></span></pre>
</div>
</div>

</body>
</html>