<!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>[165582] trunk/Source/WebCore</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/165582">165582</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2014-03-13 18:11:11 -0700 (Thu, 13 Mar 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Network.loadResource XHR crash if page reloaded while request is ongoing
https://bugs.webkit.org/show_bug.cgi?id=130211

Reviewed by Timothy Hatcher.

Merged from Blink with changes, (patch by vsevik@chromium.org):
http://src.chromium.org/viewvc/blink?view=revision&amp;revision=152712

Using an XMLHttpRequest to download resources had a few issues. Being an
Active DOM Object the load could be paused. Without an extra retain,
when the load was cancelled (e.g. a page reload) the XHR would get
destructed and could cause a crash if the list of active DOM objects
was actively being iterated.

Switch to a DocumentThreadableLoader to manage the load ourselves.
This still uses the Memory cache, but we have a little more control.

* inspector/InspectorResourceAgent.h:
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::InspectorResourceAgent):
(WebCore::InspectorResourceAgent::loadResource):
Switch from XHR to DocumentThreadableLoader.

* xml/XMLHttpRequest.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::XMLHttpRequest):
(WebCore::XMLHttpRequest::createRequest):
(WebCore::XMLHttpRequest::sendForInspector):
Remove the now unnecessary XHR sendForInspector path.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorResourceAgentcpp">trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorResourceAgenth">trunk/Source/WebCore/inspector/InspectorResourceAgent.h</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequestcpp">trunk/Source/WebCore/xml/XMLHttpRequest.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLHttpRequesth">trunk/Source/WebCore/xml/XMLHttpRequest.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (165581 => 165582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-03-14 01:05:29 UTC (rev 165581)
+++ trunk/Source/WebCore/ChangeLog        2014-03-14 01:11:11 UTC (rev 165582)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2014-03-13  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Network.loadResource XHR crash if page reloaded while request is ongoing
+        https://bugs.webkit.org/show_bug.cgi?id=130211
+
+        Reviewed by Timothy Hatcher.
+
+        Merged from Blink with changes, (patch by vsevik@chromium.org):
+        http://src.chromium.org/viewvc/blink?view=revision&amp;revision=152712
+
+        Using an XMLHttpRequest to download resources had a few issues. Being an
+        Active DOM Object the load could be paused. Without an extra retain,
+        when the load was cancelled (e.g. a page reload) the XHR would get
+        destructed and could cause a crash if the list of active DOM objects
+        was actively being iterated.
+
+        Switch to a DocumentThreadableLoader to manage the load ourselves.
+        This still uses the Memory cache, but we have a little more control.
+
+        * inspector/InspectorResourceAgent.h:
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::InspectorResourceAgent):
+        (WebCore::InspectorResourceAgent::loadResource):
+        Switch from XHR to DocumentThreadableLoader.
+
+        * xml/XMLHttpRequest.h:
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::XMLHttpRequest):
+        (WebCore::XMLHttpRequest::createRequest):
+        (WebCore::XMLHttpRequest::sendForInspector):
+        Remove the now unnecessary XHR sendForInspector path.
+
</ins><span class="cx"> 2014-03-13  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r165540.
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorResourceAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (165581 => 165582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-03-14 01:05:29 UTC (rev 165581)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp        2014-03-14 01:11:11 UTC (rev 165582)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><ins>+#include &quot;DocumentThreadableLoader.h&quot;
</ins><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="lines">@@ -58,8 +59,8 @@
</span><span class="cx"> #include &quot;ResourceRequest.h&quot;
</span><span class="cx"> #include &quot;ResourceResponse.h&quot;
</span><span class="cx"> #include &quot;ScriptableDocumentParser.h&quot;
</span><del>-#include &quot;Settings.h&quot;
</del><span class="cx"> #include &quot;SubresourceLoader.h&quot;
</span><ins>+#include &quot;ThreadableLoaderClient.h&quot;
</ins><span class="cx"> #include &quot;URL.h&quot;
</span><span class="cx"> #include &quot;WebSocketFrame.h&quot;
</span><span class="cx"> #include &quot;XMLHttpRequest.h&quot;
</span><span class="lines">@@ -68,8 +69,6 @@
</span><span class="cx"> #include &lt;inspector/ScriptCallStack.h&gt;
</span><span class="cx"> #include &lt;inspector/ScriptCallStackFactory.h&gt;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><del>-#include &lt;wtf/HexNumber.h&gt;
-#include &lt;wtf/ListHashSet.h&gt;
</del><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><span class="cx"> #include &lt;wtf/text/StringBuilder.h&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -79,6 +78,102 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+namespace {
+
+class InspectorThreadableLoaderClient final : public ThreadableLoaderClient {
+    WTF_MAKE_NONCOPYABLE(InspectorThreadableLoaderClient);
+public:
+    InspectorThreadableLoaderClient(PassRefPtr&lt;LoadResourceCallback&gt; callback)
+        : m_callback(callback) { }
+
+    virtual ~InspectorThreadableLoaderClient() { }
+
+    virtual void didReceiveResponse(unsigned long, const ResourceResponse&amp; response) override
+    {
+        m_mimeType = response.mimeType();
+
+        // FIXME: This assumes text only responses. We should support non-text responses as well.
+        TextEncoding textEncoding(response.textEncodingName());
+        bool useDetector = false;
+        if (!textEncoding.isValid()) {
+            textEncoding = UTF8Encoding();
+            useDetector = true;
+        }
+
+        m_decoder = TextResourceDecoder::create(ASCIILiteral(&quot;text/plain&quot;), textEncoding, useDetector);
+    }
+
+    virtual void didReceiveData(const char* data, int dataLength) override
+    {
+        if (!dataLength)
+            return;
+
+        if (dataLength == -1)
+            dataLength = strlen(data);
+
+        m_responseText.append(m_decoder-&gt;decode(data, dataLength));
+    }
+
+    virtual void didFinishLoading(unsigned long, double) override
+    {
+        if (m_decoder)
+            m_responseText.append(m_decoder-&gt;flush());
+
+        m_callback-&gt;sendSuccess(m_responseText.toString(), m_mimeType);
+        dispose();
+    }
+
+    virtual void didFail(const ResourceError&amp;) override
+    {
+        m_callback-&gt;sendFailure(ASCIILiteral(&quot;Loading resource for inspector failed&quot;));
+        dispose();
+    }
+
+    virtual void didFailRedirectCheck() override
+    {
+        m_callback-&gt;sendFailure(ASCIILiteral(&quot;Loading resource for inspector failed redirect check&quot;));
+        dispose();
+    }
+
+    void didFailLoaderCreation()
+    {
+        m_callback-&gt;sendFailure(ASCIILiteral(&quot;Could not create a loader&quot;));
+        dispose();
+    }
+
+    void setLoader(PassRefPtr&lt;ThreadableLoader&gt; loader)
+    {
+        m_loader = loader;
+    }
+
+private:
+    void dispose()
+    {
+        m_loader = nullptr;
+        delete this;
+    }
+
+    RefPtr&lt;LoadResourceCallback&gt; m_callback;
+    RefPtr&lt;ThreadableLoader&gt; m_loader;
+    RefPtr&lt;TextResourceDecoder&gt; m_decoder;
+    String m_mimeType;
+    StringBuilder m_responseText;
+};
+
+} // namespace
+
+InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client)
+    : InspectorAgentBase(ASCIILiteral(&quot;Network&quot;), instrumentingAgents)
+    , m_pageAgent(pageAgent)
+    , m_client(client)
+    , m_resourcesData(std::make_unique&lt;NetworkResourcesData&gt;())
+    , m_enabled(false)
+    , m_cacheDisabled(false)
+    , m_loadingXHRSynchronously(false)
+    , m_isRecalculatingStyle(false)
+{
+}
+
</ins><span class="cx"> void InspectorResourceAgent::didCreateFrontendAndBackend(Inspector::InspectorFrontendChannel* frontendChannel, InspectorBackendDispatcher* backendDispatcher)
</span><span class="cx"> {
</span><span class="cx">     m_frontendDispatcher = std::make_unique&lt;InspectorNetworkFrontendDispatcher&gt;(frontendChannel);
</span><span class="lines">@@ -627,88 +722,6 @@
</span><span class="cx">     xhr-&gt;sendForInspectorXHRReplay(xhrReplayData-&gt;formData(), IGNORE_EXCEPTION);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-namespace {
-
-class LoadResourceListener final : public EventListener {
-    WTF_MAKE_NONCOPYABLE(LoadResourceListener);
-public:
-    static PassRefPtr&lt;LoadResourceListener&gt; create(PassRefPtr&lt;LoadResourceCallback&gt; callback)
-    {
-        return adoptRef(new LoadResourceListener(callback));
-    }
-
-    virtual ~LoadResourceListener() { }
-
-    virtual bool operator==(const EventListener&amp; other) override
-    {
-        return this == &amp;other;
-    }
-
-    virtual void handleEvent(ScriptExecutionContext*, Event* event) override
-    {
-        if (!m_callback-&gt;isActive())
-            return;
-
-        if (event-&gt;type() == eventNames().errorEvent) {
-            m_callback-&gt;sendFailure(ASCIILiteral(&quot;Error loading resource&quot;));
-            return;
-        }
-
-        if (event-&gt;type() != eventNames().readystatechangeEvent) {
-            m_callback-&gt;sendFailure(ASCIILiteral(&quot;Unexpected event type&quot;));
-            return;
-        }
-
-        XMLHttpRequest* xhr = static_cast&lt;XMLHttpRequest*&gt;(event-&gt;target());
-        if (xhr-&gt;readyState() != XMLHttpRequest::DONE)
-            return;
-
-        m_callback-&gt;sendSuccess(xhr-&gt;responseTextIgnoringResponseType(), xhr-&gt;responseMIMEType());
-    }
-
-private:
-    LoadResourceListener(PassRefPtr&lt;LoadResourceCallback&gt; callback)
-        : EventListener(EventListener::CPPEventListenerType)
-        , m_callback(callback) { }
-
-    RefPtr&lt;LoadResourceCallback&gt; m_callback;
-};
-
-} // namespace
-
-void InspectorResourceAgent::loadResource(ErrorString* errorString, const String&amp; frameId, const String&amp; urlString, PassRefPtr&lt;LoadResourceCallback&gt; callback)
-{
-    Frame* frame = m_pageAgent-&gt;assertFrame(errorString, frameId);
-    if (!frame)
-        return;
-
-    Document* document = frame-&gt;document();
-    if (!document) {
-        *errorString = ASCIILiteral(&quot;No Document instance for the specified frame&quot;);
-        return;
-    }
-
-    RefPtr&lt;XMLHttpRequest&gt; xhr = XMLHttpRequest::create(*document);
-
-    ExceptionCode ec = 0;
-    xhr-&gt;open(ASCIILiteral(&quot;GET&quot;), document-&gt;completeURL(urlString), ec);
-    if (ec) {
-        *errorString = ASCIILiteral(&quot;Error creating request&quot;);
-        return;
-    }
-
-    RefPtr&lt;LoadResourceListener&gt; loadResourceListener = LoadResourceListener::create(callback);
-    xhr-&gt;addEventListener(eventNames().abortEvent, loadResourceListener, false);
-    xhr-&gt;addEventListener(eventNames().errorEvent, loadResourceListener, false);
-    xhr-&gt;addEventListener(eventNames().readystatechangeEvent, loadResourceListener, false);
-    xhr-&gt;sendForInspector(ec);
-
-    if (ec) {
-        *errorString = ASCIILiteral(&quot;Error sending request&quot;);
-        return;
-    }
-}
-
</del><span class="cx"> void InspectorResourceAgent::canClearBrowserCache(ErrorString*, bool* result)
</span><span class="cx"> {
</span><span class="cx">     *result = m_client-&gt;canClearBrowserCache();
</span><span class="lines">@@ -736,6 +749,48 @@
</span><span class="cx">         memoryCache()-&gt;evictResources();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void InspectorResourceAgent::loadResource(ErrorString* errorString, const String&amp; frameId, const String&amp; urlString, PassRefPtr&lt;LoadResourceCallback&gt; prpCallback)
+{
+    Frame* frame = m_pageAgent-&gt;assertFrame(errorString, frameId);
+    if (!frame)
+        return;
+
+    Document* document = frame-&gt;document();
+    if (!document) {
+        *errorString = ASCIILiteral(&quot;No Document instance for the specified frame&quot;);
+        return;
+    }
+
+    RefPtr&lt;LoadResourceCallback&gt; callback = prpCallback;
+
+    URL url = document-&gt;completeURL(urlString);
+    ResourceRequest request(url);
+    request.setHTTPMethod(ASCIILiteral(&quot;GET&quot;));
+    request.setHiddenFromInspector(true);
+
+    ThreadableLoaderOptions options;
+    options.sendLoadCallbacks = SendCallbacks; // So we remove this from m_hiddenRequestIdentifiers on completion.
+    options.allowCredentials = AllowStoredCredentials;
+    options.crossOriginRequestPolicy = AllowCrossOriginRequests;
+
+    // InspectorThreadableLoaderClient deletes itself when the load completes.
+    InspectorThreadableLoaderClient* inspectorThreadableLoaderClient = new InspectorThreadableLoaderClient(callback);
+
+    RefPtr&lt;DocumentThreadableLoader&gt; loader = DocumentThreadableLoader::create(*document, *inspectorThreadableLoaderClient, request, options);
+    if (!loader) {
+        inspectorThreadableLoaderClient-&gt;didFailLoaderCreation();
+        return;
+    }
+
+    loader-&gt;setDefersLoading(false);
+
+    // If the load already completed, inspectorThreadableLoaderClient will have been deleted and we will have already called the callback.
+    if (!callback-&gt;isActive())
+        return;
+
+    inspectorThreadableLoaderClient-&gt;setLoader(loader.release());
+}
+
</ins><span class="cx"> void InspectorResourceAgent::mainFrameNavigated(DocumentLoader* loader)
</span><span class="cx"> {
</span><span class="cx">     if (m_cacheDisabled)
</span><span class="lines">@@ -744,18 +799,6 @@
</span><span class="cx">     m_resourcesData-&gt;clear(m_pageAgent-&gt;loaderId(loader));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-InspectorResourceAgent::InspectorResourceAgent(InstrumentingAgents* instrumentingAgents, InspectorPageAgent* pageAgent, InspectorClient* client)
-    : InspectorAgentBase(ASCIILiteral(&quot;Network&quot;), instrumentingAgents)
-    , m_pageAgent(pageAgent)
-    , m_client(client)
-    , m_resourcesData(std::make_unique&lt;NetworkResourcesData&gt;())
-    , m_enabled(false)
-    , m_cacheDisabled(false)
-    , m_loadingXHRSynchronously(false)
-    , m_isRecalculatingStyle(false)
-{
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(INSPECTOR)
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorResourceAgenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.h (165581 => 165582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorResourceAgent.h        2014-03-14 01:05:29 UTC (rev 165581)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.h        2014-03-14 01:11:11 UTC (rev 165582)
</span><span class="lines">@@ -57,7 +57,6 @@
</span><span class="cx"> class InspectorClient;
</span><span class="cx"> class InspectorPageAgent;
</span><span class="cx"> class InstrumentingAgents;
</span><del>-class URL;
</del><span class="cx"> class NetworkResourcesData;
</span><span class="cx"> class Page;
</span><span class="cx"> class ResourceError;
</span><span class="lines">@@ -66,6 +65,7 @@
</span><span class="cx"> class ResourceResponse;
</span><span class="cx"> class SharedBuffer;
</span><span class="cx"> class ThreadableLoaderClient;
</span><ins>+class URL;
</ins><span class="cx"> class XHRReplayData;
</span><span class="cx"> class XMLHttpRequest;
</span><span class="cx"> 
</span><span class="lines">@@ -121,23 +121,20 @@
</span><span class="cx">     void didReceiveWebSocketFrameError(unsigned long identifier, const String&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    // called from Internals for layout test purposes.
</del><ins>+    // Called from Internals for layout test purposes.
</ins><span class="cx">     void setResourcesDataSizeLimitsFromInternals(int maximumResourcesContentSize, int maximumSingleResourceContentSize);
</span><span class="cx"> 
</span><del>-    // Called from frontend
</del><ins>+    // Called from frontend.
</ins><span class="cx">     virtual void enable(ErrorString*) override;
</span><span class="cx">     virtual void disable(ErrorString*) override;
</span><span class="cx">     virtual void setExtraHTTPHeaders(ErrorString*, const RefPtr&lt;Inspector::InspectorObject&gt;&amp;) override;
</span><span class="cx">     virtual void getResponseBody(ErrorString*, const String&amp; requestId, String* content, bool* base64Encoded) override;
</span><del>-
</del><span class="cx">     virtual void replayXHR(ErrorString*, const String&amp; requestId) override;
</span><del>-
</del><span class="cx">     virtual void canClearBrowserCache(ErrorString*, bool*) override;
</span><span class="cx">     virtual void clearBrowserCache(ErrorString*) override;
</span><span class="cx">     virtual void canClearBrowserCookies(ErrorString*, bool*) override;
</span><span class="cx">     virtual void clearBrowserCookies(ErrorString*) override;
</span><span class="cx">     virtual void setCacheDisabled(ErrorString*, bool cacheDisabled) override;
</span><del>-
</del><span class="cx">     virtual void loadResource(ErrorString*, const String&amp; frameId, const String&amp; url, PassRefPtr&lt;LoadResourceCallback&gt;) override;
</span><span class="cx"> 
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (165581 => 165582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2014-03-14 01:05:29 UTC (rev 165581)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp        2014-03-14 01:11:11 UTC (rev 165582)
</span><span class="lines">@@ -184,7 +184,6 @@
</span><span class="cx">     , m_uploadEventsAllowed(true)
</span><span class="cx">     , m_uploadComplete(false)
</span><span class="cx">     , m_sameOriginRequest(true)
</span><del>-    , m_sendingForInspector(false)
</del><span class="cx">     , m_receivedLength(0)
</span><span class="cx">     , m_lastSendLineNumber(0)
</span><span class="cx">     , m_lastSendColumnNumber(0)
</span><span class="lines">@@ -738,12 +737,6 @@
</span><span class="cx">     createRequest(ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void XMLHttpRequest::sendForInspector(ExceptionCode&amp; ec)
-{
-    m_sendingForInspector = true;
-    send(ec);
-}
-
</del><span class="cx"> void XMLHttpRequest::sendForInspectorXHRReplay(PassRefPtr&lt;FormData&gt; formData, ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     m_requestEntityBody = formData ? formData-&gt;deepCopy() : 0;
</span><span class="lines">@@ -781,9 +774,6 @@
</span><span class="cx"> 
</span><span class="cx">     ResourceRequest request(m_url);
</span><span class="cx">     request.setHTTPMethod(m_method);
</span><del>-#if ENABLE(INSPECTOR)
-    request.setHiddenFromInspector(m_sendingForInspector);
-#endif
</del><span class="cx"> 
</span><span class="cx">     InspectorInstrumentation::willLoadXHR(scriptExecutionContext(), this, m_method, m_url, m_async, m_requestEntityBody ? m_requestEntityBody-&gt;deepCopy() : 0, m_requestHeaders, m_includeCredentials);
</span><span class="cx"> 
</span><span class="lines">@@ -801,7 +791,7 @@
</span><span class="cx">     options.sniffContent = DoNotSniffContent;
</span><span class="cx">     options.preflightPolicy = uploadEvents ? ForcePreflight : ConsiderPreflight;
</span><span class="cx">     options.allowCredentials = (m_sameOriginRequest || m_includeCredentials) ? AllowStoredCredentials : DoNotAllowStoredCredentials;
</span><del>-    options.crossOriginRequestPolicy = m_sendingForInspector ? AllowCrossOriginRequests : UseAccessControl;
</del><ins>+    options.crossOriginRequestPolicy = UseAccessControl;
</ins><span class="cx">     options.securityOrigin = securityOrigin();
</span><span class="cx"> #if ENABLE(RESOURCE_TIMING)
</span><span class="cx">     options.initiator = cachedResourceRequestInitiators().xmlhttprequest;
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLHttpRequesth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLHttpRequest.h (165581 => 165582)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLHttpRequest.h        2014-03-14 01:05:29 UTC (rev 165581)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.h        2014-03-14 01:11:11 UTC (rev 165582)
</span><span class="lines">@@ -122,7 +122,6 @@
</span><span class="cx">     bool responseCacheIsValid() const { return m_responseCacheIsValid; }
</span><span class="cx">     void didCacheResponseJSON();
</span><span class="cx"> 
</span><del>-    void sendForInspector(ExceptionCode&amp;);
</del><span class="cx">     void sendForInspectorXHRReplay(PassRefPtr&lt;FormData&gt;, ExceptionCode&amp;);
</span><span class="cx"> 
</span><span class="cx">     // Expose HTTP validation methods for other untrusted requests.
</span><span class="lines">@@ -246,7 +245,6 @@
</span><span class="cx">     bool m_uploadComplete;
</span><span class="cx"> 
</span><span class="cx">     bool m_sameOriginRequest;
</span><del>-    bool m_sendingForInspector;
</del><span class="cx"> 
</span><span class="cx">     // Used for onprogress tracking
</span><span class="cx">     long long m_receivedLength;
</span></span></pre>
</div>
</div>

</body>
</html>