<!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>[200461] 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/200461">200461</a></dd>
<dt>Author</dt> <dd>achristensen@apple.com</dd>
<dt>Date</dt> <dd>2016-05-05 10:43:04 -0700 (Thu, 05 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Blocked redirected main resource requests need descriptive errors
https://bugs.webkit.org/show_bug.cgi?id=156828
rdar://problem/25711316

Reviewed by Daniel Bates.

Source/WebCore:

Test: http/tests/contentextensions/main-resource-redirect-error.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
Call cancelMainResourceLoad() so that InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame()
is called to be consistent with blocked redirected main resource requests.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal):
(WebCore::ResourceLoader::blockedError):
(WebCore::ResourceLoader::blockedByContentBlockerError):
(WebCore::ResourceLoader::cannotShowURLError):
* loader/ResourceLoader.h:
Use a blockedByContentBlockerError() instead of a cannotShowURLError() when we blocked the load.

Tools:

* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
Print out the error type to make sure we have the most descriptive error type.

LayoutTests:

* http/tests/contentextensions/block-everything-if-domain-expected.txt:
Updated because the page no longer loads because the main resource was blocked.
* http/tests/contentextensions/block-everything-unless-domain-expected.txt:
* http/tests/contentextensions/block-everything-unless-domain.html:
Updated test because about:blank is no longer loaded when the main resource fails to load.
* http/tests/contentextensions/main-resource-expected.txt:
Update to reflect new behavior of calling didFailProvisionalLoadWithError instead of just didFailLoadingWithError.
* http/tests/contentextensions/main-resource-redirect-error-expected.txt: Added.
* http/tests/contentextensions/main-resource-redirect-error.html: Added.
* http/tests/contentextensions/main-resource-redirect-error.html.json: Added.
* http/tests/contentextensions/main-resource.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestshttptestscontentextensionsblockeverythingifdomainexpectedtxt">trunk/LayoutTests/http/tests/contentextensions/block-everything-if-domain-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscontentextensionsblockeverythingunlessdomainexpectedtxt">trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscontentextensionsblockeverythingunlessdomainhtml">trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain.html</a></li>
<li><a href="#trunkLayoutTestshttptestscontentextensionsmainresourceexpectedtxt">trunk/LayoutTests/http/tests/contentextensions/main-resource-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscontentextensionsmainresourcehtml">trunk/LayoutTests/http/tests/contentextensions/main-resource.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoadercpp">trunk/Source/WebCore/loader/ResourceLoader.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderResourceLoaderh">trunk/Source/WebCore/loader/ResourceLoader.h</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp">trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestshttptestscontentextensionsmainresourceredirecterrorexpectedtxt">trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error-expected.txt</a></li>
<li><a href="#trunkLayoutTestshttptestscontentextensionsmainresourceredirecterrorhtml">trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error.html</a></li>
<li><a href="#trunkLayoutTestshttptestscontentextensionsmainresourceredirecterrorhtmljson">trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error.html.json</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/LayoutTests/ChangeLog        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-05-04  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Blocked redirected main resource requests need descriptive errors
+        https://bugs.webkit.org/show_bug.cgi?id=156828
+        rdar://problem/25711316
+
+        Reviewed by Daniel Bates.
+
+        * http/tests/contentextensions/block-everything-if-domain-expected.txt:
+        Updated because the page no longer loads because the main resource was blocked.
+        * http/tests/contentextensions/block-everything-unless-domain-expected.txt:
+        * http/tests/contentextensions/block-everything-unless-domain.html:
+        Updated test because about:blank is no longer loaded when the main resource fails to load.
+        * http/tests/contentextensions/main-resource-expected.txt:
+        Update to reflect new behavior of calling didFailProvisionalLoadWithError instead of just didFailLoadingWithError.
+        * http/tests/contentextensions/main-resource-redirect-error-expected.txt: Added.
+        * http/tests/contentextensions/main-resource-redirect-error.html: Added.
+        * http/tests/contentextensions/main-resource-redirect-error.html.json: Added.
+        * http/tests/contentextensions/main-resource.html:
+
</ins><span class="cx"> 2016-05-04  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         CSP: Perform case sensitive match against path portion of source expression URL that ends in '/'
</span></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsblockeverythingifdomainexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/contentextensions/block-everything-if-domain-expected.txt (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/block-everything-if-domain-expected.txt        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/LayoutTests/http/tests/contentextensions/block-everything-if-domain-expected.txt        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -1,6 +1 @@
</span><span class="cx"> CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-everything-if-domain.html from loading a resource from http://127.0.0.1:8000/contentextensions/block-everything-if-domain.html
</span><del>-layer at (0,0) size 800x600
-  RenderView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  RenderBlock {HTML} at (0,0) size 800x600
-    RenderBody {BODY} at (8,8) size 784x584
</del></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsblockeverythingunlessdomainexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-expected.txt (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-expected.txt        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain-expected.txt        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -1,5 +1,4 @@
</span><del>-CONSOLE MESSAGE: line 18: http://127.0.0.1:8000/contentextensions/resources/block-everything-unless-domain-helper.html
</del><span class="cx"> CONSOLE MESSAGE: line 5: helper loaded
</span><span class="cx"> CONSOLE MESSAGE: line 7: Content blocker prevented frame displaying http://localhost:8000/contentextensions/resources/should-not-load.html from loading a resource from http://localhost:8000/contentextensions/resources/should-not-load.html
</span><del>-CONSOLE MESSAGE: line 15: successfully blocked load from localhost
</del><ins>+CONSOLE MESSAGE: line 13: PASS - blocked the load
</ins><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsblockeverythingunlessdomainhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain.html (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain.html        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/LayoutTests/http/tests/contentextensions/block-everything-unless-domain.html        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -9,13 +9,12 @@
</span><span class="cx"> var maxEventLoopRuns = 50;
</span><span class="cx"> function helperLoaded () {
</span><span class="cx">     if (!maxEventLoopRuns) {
</span><del>-        console.log(&quot;blocking load failed&quot;);
</del><ins>+        if (helper.location == &quot;http://127.0.0.1:8000/contentextensions/resources/block-everything-unless-domain-helper.html&quot;)
+            console.log(&quot;PASS - blocked the load&quot;);
+        else
+            console.log(&quot;FAIL - loaded blocked URL&quot;);
</ins><span class="cx">         testRunner.notifyDone();
</span><del>-    } else if (helper.location == &quot;about:blank&quot;) {
-        console.log(&quot;successfully blocked load from localhost&quot;);
-        testRunner.notifyDone();
</del><span class="cx">     } else {
</span><del>-        console.log(helper.location);
</del><span class="cx">         setTimeout(helperLoaded, 1);
</span><span class="cx">         maxEventLoopRuns--;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsmainresourceexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/contentextensions/main-resource-expected.txt (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/main-resource-expected.txt        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/LayoutTests/http/tests/contentextensions/main-resource-expected.txt        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -1,5 +1,8 @@
</span><ins>+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
</ins><span class="cx"> http://127.0.0.1:8000/contentextensions/main-resource.html - didFinishLoading
</span><ins>+main frame - didStartProvisionalLoadForFrame
</ins><span class="cx"> CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/resources/should-not-load.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/should-not-load.html
</span><del>-http://127.0.0.1:8000/contentextensions/resources/should-not-load.html - didFailLoadingWithError: &lt;NSError domain WebKitErrorDomain, code 104, failing URL &quot;http://127.0.0.1:8000/contentextensions/resources/should-not-load.html&quot;&gt;
-http://127.0.0.1:8000/contentextensions/resources/should-not-load.html - didFinishLoading
-
</del><ins>+main frame - didFailProvisionalLoadWithError
+main frame - (kWKErrorCodeFrameLoadBlockedByContentBlocker)
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsmainresourceredirecterrorexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error-expected.txt (0 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error-expected.txt                                (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error-expected.txt        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+main frame - didFinishDocumentLoadForFrame
+main frame - didHandleOnloadEventsForFrame
+main frame - didFinishLoadForFrame
+http://127.0.0.1:8000/contentextensions/main-resource-redirect-error.html - didFinishLoading
+main frame - didStartProvisionalLoadForFrame
+http://127.0.0.1:8000/resources/redirect.php?url=should-not-load.html - willSendRequest &lt;NSURLRequest URL http://127.0.0.1:8000/resources/redirect.php?url=should-not-load.html, main document URL http://127.0.0.1:8000/resources/redirect.php?url=should-not-load.html, http method GET&gt; redirectResponse (null)
+CONSOLE MESSAGE: Content blocker prevented frame displaying http://127.0.0.1:8000/resources/should-not-load.html from loading a resource from http://127.0.0.1:8000/resources/should-not-load.html
+main frame - didFailProvisionalLoadWithError
+main frame - (kWKErrorCodeFrameLoadBlockedByContentBlocker)
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsmainresourceredirecterrorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error.html (0 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error.html                                (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error.html        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;script&gt;
+if (window.testRunner) {
+    testRunner.dumpResourceLoadCallbacks();
+    testRunner.dumpFrameLoadCallbacks();
+    testRunner.dumpAsText();
+    testRunner.queueLoad(&quot;/resources/redirect.php?url=should-not-load.html&quot;);
+}
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsmainresourceredirecterrorhtmljson"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error.html.json (0 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error.html.json                                (rev 0)
+++ trunk/LayoutTests/http/tests/contentextensions/main-resource-redirect-error.html.json        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+[
+    {
+        &quot;action&quot;: {
+            &quot;type&quot;: &quot;block&quot;
+        },
+        &quot;trigger&quot;: {
+            &quot;url-filter&quot;: &quot;/should-not-load&quot;
+        }
+    }
+]
</ins></span></pre></div>
<a id="trunkLayoutTestshttptestscontentextensionsmainresourcehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/http/tests/contentextensions/main-resource.html (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/http/tests/contentextensions/main-resource.html        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/LayoutTests/http/tests/contentextensions/main-resource.html        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -1,6 +1,7 @@
</span><span class="cx"> &lt;script&gt;
</span><span class="cx"> if (window.testRunner) {
</span><span class="cx">     testRunner.dumpResourceLoadCallbacks();
</span><ins>+    testRunner.dumpFrameLoadCallbacks();
</ins><span class="cx">     testRunner.dumpAsText();
</span><span class="cx">     testRunner.queueLoad(&quot;resources/should-not-load.html&quot;);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/Source/WebCore/ChangeLog        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -1,3 +1,25 @@
</span><ins>+2016-05-04  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Blocked redirected main resource requests need descriptive errors
+        https://bugs.webkit.org/show_bug.cgi?id=156828
+        rdar://problem/25711316
+
+        Reviewed by Daniel Bates.
+
+        Test: http/tests/contentextensions/main-resource-redirect-error.html
+
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::startLoadingMainResource):
+        Call cancelMainResourceLoad() so that InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame()
+        is called to be consistent with blocked redirected main resource requests.
+        * loader/ResourceLoader.cpp:
+        (WebCore::ResourceLoader::willSendRequestInternal):
+        (WebCore::ResourceLoader::blockedError):
+        (WebCore::ResourceLoader::blockedByContentBlockerError):
+        (WebCore::ResourceLoader::cannotShowURLError):
+        * loader/ResourceLoader.h:
+        Use a blockedByContentBlockerError() instead of a cannotShowURLError() when we blocked the load.
+
</ins><span class="cx"> 2016-05-05  Zan Dobersek  &lt;zdobersek@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix assertions in debug builds for the GTK+ port.
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -1504,10 +1504,8 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="cx">     if (m_mainResource &amp;&amp; m_mainResource-&gt;errorOccurred() &amp;&amp; m_frame-&gt;page() &amp;&amp; m_mainResource-&gt;resourceError().domain() == ContentExtensions::WebKitContentBlockerDomain) {
</span><del>-        m_identifierForLoadWithoutResourceLoader = m_frame-&gt;page()-&gt;progress().createUniqueIdentifier();
-        frameLoader()-&gt;notifier().assignIdentifierToInitialRequest(m_identifierForLoadWithoutResourceLoader, this, request);
-        frameLoader()-&gt;notifier().dispatchDidFailLoading(this, m_identifierForLoadWithoutResourceLoader, frameLoader()-&gt;blockedByContentBlockerError(m_request));
-        m_mainResource = nullptr;
</del><ins>+        cancelMainResourceLoad(frameLoader()-&gt;blockedByContentBlockerError(m_request));
+        return;
</ins><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.cpp (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.cpp        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/Source/WebCore/loader/ResourceLoader.cpp        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -346,8 +346,11 @@
</span><span class="cx">     if (frameLoader()) {
</span><span class="cx">         Page* page = frameLoader()-&gt;frame().page();
</span><span class="cx">         if (page &amp;&amp; m_documentLoader) {
</span><del>-            if (page-&gt;userContentProvider().processContentExtensionRulesForLoad(request, m_resourceType, *m_documentLoader) == ContentExtensions::BlockedStatus::Blocked)
</del><ins>+            if (page-&gt;userContentProvider().processContentExtensionRulesForLoad(request, m_resourceType, *m_documentLoader) == ContentExtensions::BlockedStatus::Blocked) {
</ins><span class="cx">                 request = { };
</span><ins>+                didFail(blockedByContentBlockerError());
+                return;
+            }
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="lines">@@ -603,6 +606,11 @@
</span><span class="cx">     return frameLoader()-&gt;client().blockedError(m_request);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ResourceError ResourceLoader::blockedByContentBlockerError()
+{
+    return frameLoader()-&gt;client().blockedByContentBlockerError(m_request);
+}
+
</ins><span class="cx"> ResourceError ResourceLoader::cannotShowURLError()
</span><span class="cx"> {
</span><span class="cx">     return frameLoader()-&gt;client().cannotShowURLError(m_request);
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderResourceLoaderh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/ResourceLoader.h (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/ResourceLoader.h        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/Source/WebCore/loader/ResourceLoader.h        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -84,6 +84,7 @@
</span><span class="cx">     WEBCORE_EXPORT void cancel(const ResourceError&amp;);
</span><span class="cx">     WEBCORE_EXPORT ResourceError cancelledError();
</span><span class="cx">     ResourceError blockedError();
</span><ins>+    ResourceError blockedByContentBlockerError();
</ins><span class="cx">     ResourceError cannotShowURLError();
</span><span class="cx">     
</span><span class="cx">     virtual void setDefersLoading(bool);
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/Tools/ChangeLog        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-05-04  Alex Christensen  &lt;achristensen@webkit.org&gt;
+
+        Blocked redirected main resource requests need descriptive errors
+        https://bugs.webkit.org/show_bug.cgi?id=156828
+        rdar://problem/25711316
+
+        Reviewed by Daniel Bates.
+
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::didFailProvisionalLoadWithErrorForFrame):
+        Print out the error type to make sure we have the most descriptive error type.
+
</ins><span class="cx"> 2016-05-05  Enrique Ocaña González  &lt;eocanha@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GStreamer] Bump internal jhbuild versions to 1.8.0 and patches to support MSE
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundleInjectedBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp (200460 => 200461)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp        2016-05-05 17:41:11 UTC (rev 200460)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp        2016-05-05 17:43:04 UTC (rev 200461)
</span><span class="lines">@@ -697,8 +697,11 @@
</span><span class="cx"> 
</span><span class="cx">     if (injectedBundle.testRunner()-&gt;shouldDumpFrameLoadCallbacks()) {
</span><span class="cx">         dumpLoadEvent(frame, &quot;didFailProvisionalLoadWithError&quot;);
</span><del>-        if (WKErrorGetErrorCode(error) == kWKErrorCodeCannotShowURL)
</del><ins>+        auto code = WKErrorGetErrorCode(error);
+        if (code == kWKErrorCodeCannotShowURL)
</ins><span class="cx">             dumpLoadEvent(frame, &quot;(kWKErrorCodeCannotShowURL)&quot;);
</span><ins>+        else if (code == kWKErrorCodeFrameLoadBlockedByContentBlocker)
+            dumpLoadEvent(frame, &quot;(kWKErrorCodeFrameLoadBlockedByContentBlocker)&quot;);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     frameDidChangeLocation(frame);
</span></span></pre>
</div>
</div>

</body>
</html>