<!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>[210279] 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/210279">210279</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-01-04 11:20:51 -0800 (Wed, 04 Jan 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Cross Origin importScripts() scripts lack source URL, causes issues with Inspector showing Resource
https://bugs.webkit.org/show_bug.cgi?id=165569
&lt;rdar://problem/29607569&gt;

Patch by Joseph Pecoraro &lt;pecoraro@apple.com&gt; on 2017-01-04
Reviewed by Youenn Fablet.

Source/WebCore:

Test: http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html

* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
* loader/ThreadableLoader.cpp:
(WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
* loader/ThreadableLoader.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::LoaderTaskOptions::LoaderTaskOptions):
Add a new ThreadableLoader option to avoid filtering the response.

* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
Disable filtering of the response. This is an internal load, we
don't want to filter data that would be valuable later.

LayoutTests:

* http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts-expected.txt: Added.
* http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html: Added.
* http/tests/inspector/worker/resources/worker-blob-import-script.js: Added.
* http/tests/inspector/worker/resources/worker-blob-script.js: Added.
Ensure cross origin scripts imported by workers still get the correct Script URL.
Also this provides a test for worker started with a blob URL.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</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="#trunkSourceWebCoreloaderDocumentThreadableLoadercpp">trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderThreadableLoadercpp">trunk/Source/WebCore/loader/ThreadableLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderThreadableLoaderh">trunk/Source/WebCore/loader/ThreadableLoader.h</a></li>
<li><a href="#trunkSourceWebCoreloaderWorkerThreadableLoadercpp">trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreworkersWorkerScriptLoadercpp">trunk/Source/WebCore/workers/WorkerScriptLoader.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/http/tests/inspector/worker/</li>
<li><a href="#trunkLayoutTestshttptestsinspectorworkerblobscriptwithcrossdomainimportedscriptsexpectedtxt">trunk/LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectorworkerblobscriptwithcrossdomainimportedscriptshtml">trunk/LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html</a></li>
<li>trunk/LayoutTests/http/tests/inspector/worker/resources/</li>
<li><a href="#trunkLayoutTestshttptestsinspectorworkerresourcesworkerblobimportscriptjs">trunk/LayoutTests/http/tests/inspector/worker/resources/worker-blob-import-script.js</a></li>
<li><a href="#trunkLayoutTestshttptestsinspectorworkerresourcesworkerblobscriptjs">trunk/LayoutTests/http/tests/inspector/worker/resources/worker-blob-script.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (210278 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2017-01-04 19:14:58 UTC (rev 210278)
+++ trunk/LayoutTests/ChangeLog        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2017-01-04  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Cross Origin importScripts() scripts lack source URL, causes issues with Inspector showing Resource
+        https://bugs.webkit.org/show_bug.cgi?id=165569
+        &lt;rdar://problem/29607569&gt;
+
+        Reviewed by Youenn Fablet.
+
+        * http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts-expected.txt: Added.
+        * http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html: Added.
+        * http/tests/inspector/worker/resources/worker-blob-import-script.js: Added.
+        * http/tests/inspector/worker/resources/worker-blob-script.js: Added.
+        Ensure cross origin scripts imported by workers still get the correct Script URL.
+        Also this provides a test for worker started with a blob URL.
+
</ins><span class="cx"> 2017-01-03  Ryosuke Niwa  &lt;rniwa@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         label element with tabindex &gt;= 0 is not focusable
</span></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorworkerblobscriptwithcrossdomainimportedscriptsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts-expected.txt (0 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts-expected.txt        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Test for Resources in a Worker started with a Blob URL that imports cross origin scripts.
+
+
+== Running test suite: Worker.Resources
+-- Running test case: Worker.Resource.Start
+PASS: Added Target should have Worker type.
+RESOURCES:
+http://localhost:8000/inspector/worker/resources/worker-blob-script.js
+http://localhost:8000/inspector/worker/resources/worker-blob-import-script.js
+SCRIPTS:
+blob:&lt;sanitized&gt;
+http://localhost:8000/inspector/worker/resources/worker-blob-script.js
+http://localhost:8000/inspector/worker/resources/worker-blob-import-script.js
+
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorworkerblobscriptwithcrossdomainimportedscriptshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html (0 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+let worker;
+
+function triggerWorkerStart() {
+    let blob = new Blob([`importScripts([&quot;http://localhost:8000/inspector/worker/resources/worker-blob-script.js&quot;]);`]);
+    let blobURL = URL.createObjectURL(blob);
+    worker = new Worker(blobURL);
+}
+
+function test()
+{
+    let workerTarget;
+    let mainTarget = WebInspector.mainTarget;
+
+    function sanitizeURL(url) {
+        if (!url)
+            return &quot;&lt;null&gt;&quot;;
+        if (url.startsWith(&quot;blob:&quot;))
+            return &quot;blob:&lt;sanitized&gt;&quot;;
+        return url;
+    }
+
+    function dumpURLs(urls) {
+        if (!urls.length)
+            InspectorTest.log(&quot;-- None --&quot;);
+        else {
+            urls.sort((a, b) =&gt; a &lt;= b)
+            for (let url of urls)
+                InspectorTest.log(url);
+        }
+    }
+
+    function dumpWorkerScripts() {
+        InspectorTest.log(&quot;SCRIPTS:&quot;);
+        let targetData = WebInspector.debuggerManager.dataForTarget(workerTarget);
+        let urls = [];
+        for (let script of targetData.scripts)
+            urls.push(sanitizeURL(script.url));
+        dumpURLs(urls);
+    }
+
+    function dumpWorkerResources() {
+        InspectorTest.log(&quot;RESOURCES:&quot;);
+        let urls = [];
+        for (let resource of workerTarget.resourceCollection.items)
+            urls.push(sanitizeURL(resource.url));
+        dumpURLs(urls);
+    }
+
+    let suite = InspectorTest.createAsyncSuite(&quot;Worker.Resources&quot;);
+
+    suite.addTestCase({
+        name: &quot;Worker.Resource.Start&quot;,
+        description: &quot;Start the worker and load multiple resources.&quot;,
+        test(resolve, reject) {
+            InspectorTest.evaluateInPage(&quot;triggerWorkerStart()&quot;);
+
+            WebInspector.targetManager.singleFireEventListener(WebInspector.TargetManager.Event.TargetAdded, (event) =&gt; {
+                workerTarget = event.data.target;
+                InspectorTest.assert(workerTarget instanceof WebInspector.Target);
+                InspectorTest.expectEqual(workerTarget.type, WebInspector.Target.Type.Worker, &quot;Added Target should have Worker type.&quot;);
+            });
+
+            let seen = 0;
+            const expected = 3;
+            let listener = WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, (event) =&gt; {
+                if (event.data.script.target === workerTarget)
+                    seen++;
+                if (seen !== expected)
+                    return;
+
+                WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.ScriptAdded, listener);
+                dumpWorkerResources();
+                dumpWorkerScripts();
+                resolve();
+            });
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;p&gt;Test for Resources in a Worker started with a Blob URL that imports cross origin scripts.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorworkerresourcesworkerblobimportscriptjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/inspector/worker/resources/worker-blob-import-script.js (0 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/worker/resources/worker-blob-import-script.js                                (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/worker/resources/worker-blob-import-script.js        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+function workerBlobImportScript() {
+    console.trace(&quot;workerBlobImportScript&quot;);
+}
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestsinspectorworkerresourcesworkerblobscriptjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/inspector/worker/resources/worker-blob-script.js (0 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/inspector/worker/resources/worker-blob-script.js                                (rev 0)
+++ trunk/LayoutTests/http/tests/inspector/worker/resources/worker-blob-script.js        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+importScripts([&quot;http://localhost:8000/inspector/worker/resources/worker-blob-import-script.js&quot;]);
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (210278 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-01-04 19:14:58 UTC (rev 210278)
+++ trunk/Source/WebCore/ChangeLog        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2017-01-04  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Cross Origin importScripts() scripts lack source URL, causes issues with Inspector showing Resource
+        https://bugs.webkit.org/show_bug.cgi?id=165569
+        &lt;rdar://problem/29607569&gt;
+
+        Reviewed by Youenn Fablet.
+
+        Test: http/tests/inspector/worker/blob-script-with-cross-domain-imported-scripts.html
+
+        * Modules/fetch/FetchLoader.cpp:
+        (WebCore::FetchLoader::start):
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::didReceiveResponse):
+        * loader/ThreadableLoader.cpp:
+        (WebCore::ThreadableLoaderOptions::ThreadableLoaderOptions):
+        * loader/ThreadableLoader.h:
+        * loader/WorkerThreadableLoader.cpp:
+        (WebCore::LoaderTaskOptions::LoaderTaskOptions):
+        Add a new ThreadableLoader option to avoid filtering the response.
+
+        * workers/WorkerScriptLoader.cpp:
+        (WebCore::WorkerScriptLoader::loadSynchronously):
+        (WebCore::WorkerScriptLoader::loadAsynchronously):
+        Disable filtering of the response. This is an internal load, we
+        don't want to filter data that would be valuable later.
+
</ins><span class="cx"> 2017-01-03  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove final custom binding from IDBRequest
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesfetchFetchLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp (210278 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp        2017-01-04 19:14:58 UTC (rev 210278)
+++ trunk/Source/WebCore/Modules/fetch/FetchLoader.cpp        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx">     ThreadableLoaderOptions options(request.fetchOptions(), ConsiderPreflight,
</span><span class="cx">         context.shouldBypassMainWorldContentSecurityPolicy() ? ContentSecurityPolicyEnforcement::DoNotEnforce : ContentSecurityPolicyEnforcement::EnforceConnectSrcDirective,
</span><span class="cx">         String(cachedResourceRequestInitiators().fetch),
</span><del>-        OpaqueResponseBodyPolicy::DoNotReceive);
</del><ins>+        OpaqueResponseBodyPolicy::DoNotReceive, ResponseFilteringPolicy::Enable);
</ins><span class="cx">     options.sendLoadCallbacks = SendCallbacks;
</span><span class="cx">     options.dataBufferingPolicy = DoNotBufferData;
</span><span class="cx">     options.sameOriginDataURLFlag = SameOriginDataURLFlag::Set;
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentThreadableLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (210278 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp        2017-01-04 19:14:58 UTC (rev 210278)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(response.type() != ResourceResponse::Type::Error);
</span><span class="cx">     if (response.type() == ResourceResponse::Type::Default) {
</span><del>-        m_client-&gt;didReceiveResponse(identifier, ResourceResponse::filterResponse(response, tainting));
</del><ins>+        m_client-&gt;didReceiveResponse(identifier, options().filteringPolicy == ResponseFilteringPolicy::Enable ? ResourceResponse::filterResponse(response, tainting) : response);
</ins><span class="cx">         if (tainting == ResourceResponse::Tainting::Opaque &amp;&amp; options().opaqueResponse == OpaqueResponseBodyPolicy::DoNotReceive) {
</span><span class="cx">             clearResource();
</span><span class="cx">             if (m_client)
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderThreadableLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ThreadableLoader.cpp (210278 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ThreadableLoader.cpp        2017-01-04 19:14:58 UTC (rev 210278)
+++ trunk/Source/WebCore/loader/ThreadableLoader.cpp        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -52,12 +52,13 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-ThreadableLoaderOptions::ThreadableLoaderOptions(const ResourceLoaderOptions&amp; baseOptions, PreflightPolicy preflightPolicy, ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement, String&amp;&amp; initiator, OpaqueResponseBodyPolicy opaqueResponse)
</del><ins>+ThreadableLoaderOptions::ThreadableLoaderOptions(const ResourceLoaderOptions&amp; baseOptions, PreflightPolicy preflightPolicy, ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement, String&amp;&amp; initiator, OpaqueResponseBodyPolicy opaqueResponse, ResponseFilteringPolicy filteringPolicy)
</ins><span class="cx">     : ResourceLoaderOptions(baseOptions)
</span><span class="cx">     , preflightPolicy(preflightPolicy)
</span><span class="cx">     , contentSecurityPolicyEnforcement(contentSecurityPolicyEnforcement)
</span><span class="cx">     , initiator(WTFMove(initiator))
</span><span class="cx">     , opaqueResponse(opaqueResponse)
</span><ins>+    , filteringPolicy(filteringPolicy)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderThreadableLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ThreadableLoader.h (210278 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ThreadableLoader.h        2017-01-04 19:14:58 UTC (rev 210278)
+++ trunk/Source/WebCore/loader/ThreadableLoader.h        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -62,9 +62,14 @@
</span><span class="cx">         DoNotReceive
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    enum class ResponseFilteringPolicy {
+        Enable,
+        Disable,
+    };
+
</ins><span class="cx">     struct ThreadableLoaderOptions : ResourceLoaderOptions {
</span><span class="cx">         ThreadableLoaderOptions();
</span><del>-        ThreadableLoaderOptions(const ResourceLoaderOptions&amp;, PreflightPolicy, ContentSecurityPolicyEnforcement, String&amp;&amp; initiator, OpaqueResponseBodyPolicy);
</del><ins>+        ThreadableLoaderOptions(const ResourceLoaderOptions&amp;, PreflightPolicy, ContentSecurityPolicyEnforcement, String&amp;&amp; initiator, OpaqueResponseBodyPolicy, ResponseFilteringPolicy);
</ins><span class="cx">         ~ThreadableLoaderOptions();
</span><span class="cx"> 
</span><span class="cx">         PreflightPolicy preflightPolicy { ConsiderPreflight };
</span><span class="lines">@@ -71,6 +76,7 @@
</span><span class="cx">         ContentSecurityPolicyEnforcement contentSecurityPolicyEnforcement { ContentSecurityPolicyEnforcement::EnforceConnectSrcDirective };
</span><span class="cx">         String initiator; // This cannot be an AtomicString, as isolatedCopy() wouldn't create an object that's safe for passing to another thread.
</span><span class="cx">         OpaqueResponseBodyPolicy opaqueResponse { OpaqueResponseBodyPolicy::Receive };
</span><ins>+        ResponseFilteringPolicy filteringPolicy { ResponseFilteringPolicy::Enable };
</ins><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     // Useful for doing loader operations from any thread (not threadsafe,
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderWorkerThreadableLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp (210278 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp        2017-01-04 19:14:58 UTC (rev 210278)
+++ trunk/Source/WebCore/loader/WorkerThreadableLoader.cpp        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -92,7 +92,7 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> LoaderTaskOptions::LoaderTaskOptions(const ThreadableLoaderOptions&amp; options, const String&amp; referrer, Ref&lt;SecurityOrigin&gt;&amp;&amp; origin)
</span><del>-    : options(options, options.preflightPolicy, options.contentSecurityPolicyEnforcement, options.initiator.isolatedCopy(), options.opaqueResponse)
</del><ins>+    : options(options, options.preflightPolicy, options.contentSecurityPolicyEnforcement, options.initiator.isolatedCopy(), options.opaqueResponse, options.filteringPolicy)
</ins><span class="cx">     , referrer(referrer.isolatedCopy())
</span><span class="cx">     , origin(WTFMove(origin))
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreworkersWorkerScriptLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/workers/WorkerScriptLoader.cpp (210278 => 210279)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/workers/WorkerScriptLoader.cpp        2017-01-04 19:14:58 UTC (rev 210278)
+++ trunk/Source/WebCore/workers/WorkerScriptLoader.cpp        2017-01-04 19:20:51 UTC (rev 210279)
</span><span class="lines">@@ -66,6 +66,7 @@
</span><span class="cx">     options.mode = mode;
</span><span class="cx">     options.sendLoadCallbacks = SendCallbacks;
</span><span class="cx">     options.contentSecurityPolicyEnforcement = contentSecurityPolicyEnforcement;
</span><ins>+    options.filteringPolicy = ResponseFilteringPolicy::Disable;
</ins><span class="cx"> 
</span><span class="cx">     WorkerThreadableLoader::loadResourceSynchronously(downcast&lt;WorkerGlobalScope&gt;(*scriptExecutionContext), WTFMove(*request), *this, options);
</span><span class="cx"> }
</span><span class="lines">@@ -91,6 +92,7 @@
</span><span class="cx">     options.mode = mode;
</span><span class="cx">     options.sendLoadCallbacks = SendCallbacks;
</span><span class="cx">     options.contentSecurityPolicyEnforcement = contentSecurityPolicyEnforcement;
</span><ins>+    options.filteringPolicy = ResponseFilteringPolicy::Disable;
</ins><span class="cx"> 
</span><span class="cx">     // During create, callbacks may happen which remove the last reference to this object.
</span><span class="cx">     Ref&lt;WorkerScriptLoader&gt; protectedThis(*this);
</span></span></pre>
</div>
</div>

</body>
</html>