<!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>[205609] releases/WebKitGTK/webkit-2.14</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/205609">205609</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-08 02:05:55 -0700 (Thu, 08 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/205268">r205268</a> - Web Inspector: XHR with text but responseType = &quot;blob&quot; shows blank content
https://bugs.webkit.org/show_bug.cgi?id=161422
&lt;rdar://problem/28066869&gt;

Reviewed by Brian Burg.

Source/WebCore:

Test: inspector/network/xhr-json-blob-has-content.html

When an XMLHttpRequest finished loading it was always setting the Inspector's
content for that load at the end. However, if the XHR was loading binary data
then it was passing an empty string to the inspector and overwriting the
data the inspector already had for the resource. Avoid this overwriting.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::didFinishLoading):
When loading binary content we have no decoded text to send to the inspector.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didFinishXHRLoading):
Switch to an Optional string, and if it is not available don't
call through to the NetworkAgent expecting decoded text.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::didFinishXHRLoading):
* inspector/InspectorNetworkAgent.h:
Improve variable name.

LayoutTests:

* inspector/network/resources/data.json: Added.
* inspector/network/xhr-json-blob-has-content-expected.txt: Added.
* inspector/network/xhr-json-blob-has-content.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestsChangeLog">releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreinspectorInspectorInstrumentationcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorInstrumentation.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreinspectorInspectorInstrumentationh">releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorInstrumentation.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreinspectorInspectorNetworkAgentcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorNetworkAgent.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCoreinspectorInspectorNetworkAgenth">releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorNetworkAgent.h</a></li>
<li><a href="#releasesWebKitGTKwebkit214SourceWebCorexmlXMLHttpRequestcpp">releases/WebKitGTK/webkit-2.14/Source/WebCore/xml/XMLHttpRequest.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/resources/</li>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestsinspectornetworkresourcesdatajson">releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/resources/data.json</a></li>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestsinspectornetworkxhrjsonblobhascontentexpectedtxt">releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/xhr-json-blob-has-content-expected.txt</a></li>
<li><a href="#releasesWebKitGTKwebkit214LayoutTestsinspectornetworkxhrjsonblobhascontenthtml">releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/xhr-json-blob-has-content.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit214LayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog (205608 => 205609)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog        2016-09-08 09:04:02 UTC (rev 205608)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/ChangeLog        2016-09-08 09:05:55 UTC (rev 205609)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-08-31  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: XHR with text but responseType = &quot;blob&quot; shows blank content
+        https://bugs.webkit.org/show_bug.cgi?id=161422
+        &lt;rdar://problem/28066869&gt;
+
+        Reviewed by Brian Burg.
+
+        * inspector/network/resources/data.json: Added.
+        * inspector/network/xhr-json-blob-has-content-expected.txt: Added.
+        * inspector/network/xhr-json-blob-has-content.html: Added.
+
</ins><span class="cx"> 2016-08-31  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Object.getPrototypeOf() should return null cross-origin
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214LayoutTestsinspectornetworkresourcesdatajson"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/resources/data.json (0 => 205609)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/resources/data.json                                (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/resources/data.json        2016-09-08 09:05:55 UTC (rev 205609)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+{&quot;alpha&quot;:&quot;beta&quot;,&quot;gamma&quot;:12345}
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214LayoutTestsinspectornetworkxhrjsonblobhascontentexpectedtxt"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/xhr-json-blob-has-content-expected.txt (0 => 205609)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/xhr-json-blob-has-content-expected.txt                                (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/xhr-json-blob-has-content-expected.txt        2016-09-08 09:05:55 UTC (rev 205609)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+Tests that an XMLHttpRequest resource gives us JSON text even if it is marked as having blob content.
+
+
+== Running test suite: XHR.Blob
+-- Running test case: XHR.JSONContent
+PASS: Resource should be created.
+PASS: Resource should complete loading.
+PASS: Resource has expected content.
+
+-- Running test case: XHR.JSONContent.Blob
+PASS: Resource should be created.
+PASS: Resource should complete loading.
+PASS: Resource has expected content.
+
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214LayoutTestsinspectornetworkxhrjsonblobhascontenthtml"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/xhr-json-blob-has-content.html (0 => 205609)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/xhr-json-blob-has-content.html                                (rev 0)
+++ releases/WebKitGTK/webkit-2.14/LayoutTests/inspector/network/xhr-json-blob-has-content.html        2016-09-08 09:05:55 UTC (rev 205609)
</span><span class="lines">@@ -0,0 +1,68 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function createJSONXHR() {
+    let xhr = new XMLHttpRequest;
+    xhr.open(&quot;GET&quot;, &quot;resources/data.json?&quot; + Math.random(), true);
+    xhr.send();
+}
+
+function createJSONBlobXHR() {
+    let xhr = new XMLHttpRequest;
+    xhr.open(&quot;GET&quot;, &quot;resources/data.json?&quot; + Math.random(), true);
+    xhr.responseType = &quot;blob&quot;;
+    xhr.send();
+}
+
+function test()
+{
+    let suite = InspectorTest.createAsyncSuite(&quot;XHR.Blob&quot;);
+
+    const jsonContent = `{&quot;alpha&quot;:&quot;beta&quot;,&quot;gamma&quot;:12345}\n`;
+
+    suite.addTestCase({
+        name: &quot;XHR.JSONContent&quot;,
+        description: &quot;Ensure an XMLHttpRequest with JSON content still gives us text.&quot;,
+        test: (resolve, reject) =&gt; {
+            InspectorTest.evaluateInPage(&quot;createJSONXHR()&quot;);
+            WebInspector.Frame.singleFireEventListener(WebInspector.Frame.Event.ResourceWasAdded, (event) =&gt; {
+                let resource = event.data.resource;
+                InspectorTest.expectThat(resource instanceof WebInspector.Resource, &quot;Resource should be created.&quot;);
+                resource.singleFireEventListener(WebInspector.Resource.Event.LoadingDidFinish, (event) =&gt; {
+                    InspectorTest.pass(&quot;Resource should complete loading.&quot;);
+                    resource.requestContent().then(() =&gt; {
+                        InspectorTest.expectThat(resource.content === jsonContent, &quot;Resource has expected content.&quot;);
+                    }).then(resolve, reject);
+                });
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;XHR.JSONContent.Blob&quot;,
+        description: &quot;Ensure an XMLHttpRequest with JSON content and a responseType of blob still gives us text.&quot;,
+        test: (resolve, reject) =&gt; {
+            InspectorTest.evaluateInPage(&quot;createJSONBlobXHR()&quot;);
+            WebInspector.Frame.singleFireEventListener(WebInspector.Frame.Event.ResourceWasAdded, (event) =&gt; {
+                let resource = event.data.resource;
+                InspectorTest.expectThat(resource instanceof WebInspector.Resource, &quot;Resource should be created.&quot;);
+                resource.singleFireEventListener(WebInspector.Resource.Event.LoadingDidFinish, (event) =&gt; {
+                    InspectorTest.pass(&quot;Resource should complete loading.&quot;);
+                    resource.requestContent().then(() =&gt; {
+                        InspectorTest.expectThat(resource.content === jsonContent, &quot;Resource has expected content.&quot;);
+                    }).then(resolve, reject);
+                });
+            });
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;p&gt;Tests that an XMLHttpRequest resource gives us JSON text even if it is marked as having blob content.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog (205608 => 205609)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-09-08 09:04:02 UTC (rev 205608)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/ChangeLog        2016-09-08 09:05:55 UTC (rev 205609)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2016-08-31  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: XHR with text but responseType = &quot;blob&quot; shows blank content
+        https://bugs.webkit.org/show_bug.cgi?id=161422
+        &lt;rdar://problem/28066869&gt;
+
+        Reviewed by Brian Burg.
+
+        Test: inspector/network/xhr-json-blob-has-content.html
+
+        When an XMLHttpRequest finished loading it was always setting the Inspector's
+        content for that load at the end. However, if the XHR was loading binary data
+        then it was passing an empty string to the inspector and overwriting the
+        data the inspector already had for the resource. Avoid this overwriting.
+
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::didFinishLoading):
+        When loading binary content we have no decoded text to send to the inspector.
+
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::didFinishXHRLoadingImpl):
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::didFinishXHRLoading):
+        Switch to an Optional string, and if it is not available don't
+        call through to the NetworkAgent expecting decoded text.
+
+        * inspector/InspectorNetworkAgent.cpp:
+        (WebCore::InspectorNetworkAgent::didFinishXHRLoading):
+        * inspector/InspectorNetworkAgent.h:
+        Improve variable name.
+
</ins><span class="cx"> 2016-08-31  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         DOM event handling should pass Event around by reference.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreinspectorInspectorInstrumentationcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorInstrumentation.cpp (205608 => 205609)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorInstrumentation.cpp        2016-09-08 09:04:02 UTC (rev 205608)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorInstrumentation.cpp        2016-09-08 09:05:55 UTC (rev 205609)
</span><span class="lines">@@ -635,12 +635,14 @@
</span><span class="cx">         consoleAgent-&gt;didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this.
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorInstrumentation::didFinishXHRLoadingImpl(InstrumentingAgents&amp; instrumentingAgents, ThreadableLoaderClient* client, unsigned long identifier, const String&amp; sourceString, const String&amp; url, const String&amp; sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
</del><ins>+void InspectorInstrumentation::didFinishXHRLoadingImpl(InstrumentingAgents&amp; instrumentingAgents, ThreadableLoaderClient* client, unsigned long identifier, Optional&lt;String&gt; decodedText, const String&amp; url, const String&amp; sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
</ins><span class="cx"> {
</span><span class="cx">     if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())
</span><span class="cx">         consoleAgent-&gt;didFinishXHRLoading(identifier, url, sendURL, sendLineNumber, sendColumnNumber);
</span><del>-    if (InspectorNetworkAgent* networkAgent = instrumentingAgents.inspectorNetworkAgent())
-        networkAgent-&gt;didFinishXHRLoading(client, identifier, sourceString);
</del><ins>+    if (InspectorNetworkAgent* networkAgent = instrumentingAgents.inspectorNetworkAgent()) {
+        if (decodedText)
+            networkAgent-&gt;didFinishXHRLoading(client, identifier, *decodedText);
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorInstrumentation::didReceiveXHRResponseImpl(InstrumentingAgents&amp; instrumentingAgents, unsigned long identifier)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreinspectorInspectorInstrumentationh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorInstrumentation.h (205608 => 205609)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorInstrumentation.h        2016-09-08 09:04:02 UTC (rev 205608)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorInstrumentation.h        2016-09-08 09:05:55 UTC (rev 205609)
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx">     static void didReceiveData(Frame*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
</span><span class="cx">     static void didFinishLoading(Frame*, DocumentLoader*, unsigned long identifier, double finishTime);
</span><span class="cx">     static void didFailLoading(Frame*, DocumentLoader*, unsigned long identifier, const ResourceError&amp;);
</span><del>-    static void didFinishXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient*, unsigned long identifier, const String&amp; sourceString, const String&amp; url, const String&amp; sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
</del><ins>+    static void didFinishXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient*, unsigned long identifier, Optional&lt;String&gt; decodedText, const String&amp; url, const String&amp; sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
</ins><span class="cx">     static void didReceiveXHRResponse(ScriptExecutionContext*, unsigned long identifier);
</span><span class="cx">     static void willLoadXHRSynchronously(ScriptExecutionContext*);
</span><span class="cx">     static void didLoadXHRSynchronously(ScriptExecutionContext*);
</span><span class="lines">@@ -348,7 +348,7 @@
</span><span class="cx">     static void didFailLoadingImpl(InstrumentingAgents&amp;, unsigned long identifier, DocumentLoader*, const ResourceError&amp;);
</span><span class="cx">     static void willLoadXHRImpl(InstrumentingAgents&amp;, ThreadableLoaderClient*, const String&amp;, const URL&amp;, bool, RefPtr&lt;FormData&gt;&amp;&amp;, const HTTPHeaderMap&amp;, bool);
</span><span class="cx">     static void didFailXHRLoadingImpl(InstrumentingAgents&amp;, ThreadableLoaderClient*);
</span><del>-    static void didFinishXHRLoadingImpl(InstrumentingAgents&amp;, ThreadableLoaderClient*, unsigned long identifier, const String&amp; sourceString, const String&amp; url, const String&amp; sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
</del><ins>+    static void didFinishXHRLoadingImpl(InstrumentingAgents&amp;, ThreadableLoaderClient*, unsigned long identifier, Optional&lt;String&gt; decodedText, const String&amp; url, const String&amp; sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
</ins><span class="cx">     static void didReceiveXHRResponseImpl(InstrumentingAgents&amp;, unsigned long identifier);
</span><span class="cx">     static void willLoadXHRSynchronouslyImpl(InstrumentingAgents&amp;);
</span><span class="cx">     static void didLoadXHRSynchronouslyImpl(InstrumentingAgents&amp;);
</span><span class="lines">@@ -916,10 +916,10 @@
</span><span class="cx">         didFailLoadingImpl(*instrumentingAgents, identifier, loader, error);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client, unsigned long identifier, const String&amp; sourceString, const String&amp; url, const String&amp; sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
</del><ins>+inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client, unsigned long identifier, Optional&lt;String&gt; decodedText, const String&amp; url, const String&amp; sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
</ins><span class="cx"> {
</span><span class="cx">     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
</span><del>-        didFinishXHRLoadingImpl(*instrumentingAgents, client, identifier, sourceString, url, sendURL, sendLineNumber, sendColumnNumber);
</del><ins>+        didFinishXHRLoadingImpl(*instrumentingAgents, client, identifier, decodedText, url, sendURL, sendLineNumber, sendColumnNumber);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> inline void InspectorInstrumentation::didReceiveXHRResponse(ScriptExecutionContext* context, unsigned long identifier)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreinspectorInspectorNetworkAgentcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorNetworkAgent.cpp (205608 => 205609)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorNetworkAgent.cpp        2016-09-08 09:04:02 UTC (rev 205608)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorNetworkAgent.cpp        2016-09-08 09:05:55 UTC (rev 205609)
</span><span class="lines">@@ -448,9 +448,9 @@
</span><span class="cx">     m_resourcesData-&gt;setResourceType(IdentifiersFactory::requestId(identifier), InspectorPageAgent::ScriptResource);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorNetworkAgent::didFinishXHRLoading(ThreadableLoaderClient*, unsigned long identifier, const String&amp; sourceString)
</del><ins>+void InspectorNetworkAgent::didFinishXHRLoading(ThreadableLoaderClient*, unsigned long identifier, const String&amp; decodedText)
</ins><span class="cx"> {
</span><del>-    m_resourcesData-&gt;setResourceContent(IdentifiersFactory::requestId(identifier), sourceString);
</del><ins>+    m_resourcesData-&gt;setResourceContent(IdentifiersFactory::requestId(identifier), decodedText);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorNetworkAgent::didReceiveXHRResponse(unsigned long identifier)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCoreinspectorInspectorNetworkAgenth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorNetworkAgent.h (205608 => 205609)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorNetworkAgent.h        2016-09-08 09:04:02 UTC (rev 205608)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/inspector/InspectorNetworkAgent.h        2016-09-08 09:05:55 UTC (rev 205609)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx">     void didFinishLoading(unsigned long identifier, DocumentLoader&amp;, double finishTime);
</span><span class="cx">     void didFailLoading(unsigned long identifier, DocumentLoader&amp;, const ResourceError&amp;);
</span><span class="cx">     void didLoadResourceFromMemoryCache(DocumentLoader&amp;, CachedResource&amp;);
</span><del>-    void didFinishXHRLoading(ThreadableLoaderClient*, unsigned long identifier, const String&amp; sourceString);
</del><ins>+    void didFinishXHRLoading(ThreadableLoaderClient*, unsigned long identifier, const String&amp; decodedText);
</ins><span class="cx">     void didReceiveXHRResponse(unsigned long identifier);
</span><span class="cx">     void willLoadXHRSynchronously();
</span><span class="cx">     void didLoadXHRSynchronously();
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit214SourceWebCorexmlXMLHttpRequestcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.14/Source/WebCore/xml/XMLHttpRequest.cpp (205608 => 205609)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.14/Source/WebCore/xml/XMLHttpRequest.cpp        2016-09-08 09:04:02 UTC (rev 205608)
+++ releases/WebKitGTK/webkit-2.14/Source/WebCore/xml/XMLHttpRequest.cpp        2016-09-08 09:05:55 UTC (rev 205609)
</span><span class="lines">@@ -1006,7 +1006,10 @@
</span><span class="cx"> 
</span><span class="cx">     m_responseBuilder.shrinkToFit();
</span><span class="cx"> 
</span><del>-    InspectorInstrumentation::didFinishXHRLoading(scriptExecutionContext(), this, identifier, m_responseBuilder.toStringPreserveCapacity(), m_url, m_lastSendURL, m_lastSendLineNumber, m_lastSendColumnNumber);
</del><ins>+    Optional&lt;String&gt; decodedText;
+    if (!m_binaryResponseBuilder)
+        decodedText = m_responseBuilder.toStringPreserveCapacity();
+    InspectorInstrumentation::didFinishXHRLoading(scriptExecutionContext(), this, identifier, decodedText, m_url, m_lastSendURL, m_lastSendLineNumber, m_lastSendColumnNumber);
</ins><span class="cx"> 
</span><span class="cx">     bool hadLoader = m_loader;
</span><span class="cx">     m_loader = nullptr;
</span></span></pre>
</div>
</div>

</body>
</html>