Title: [180132] trunk/Source
Revision
180132
Author
b...@cs.washington.edu
Date
2015-02-15 18:17:38 -0800 (Sun, 15 Feb 2015)

Log Message

Web Inspector: remove unused XHR replay code
https://bugs.webkit.org/show_bug.cgi?id=141622

Reviewed by Timothy Hatcher.

Source/_javascript_Core:

* inspector/protocol/Network.json: remove XHR replay methods.

Source/WebCore:

XHR Replay functionality became unused with the last frontend rewrite.
Remove instrumentation and data storage classes only used by this feature.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClientImpl): Deleted.
(WebCore::InspectorInstrumentation::willLoadXHRImpl): Deleted.
(WebCore::InspectorInstrumentation::didFailXHRLoadingImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient): Deleted.
(WebCore::InspectorInstrumentation::willLoadXHR): Deleted.
(WebCore::InspectorInstrumentation::didFailXHRLoading): Deleted.
* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
(WebCore::InspectorResourceAgent::didFinishXHRLoading):
(WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): Deleted.
(WebCore::InspectorResourceAgent::willLoadXHR): Deleted.
(WebCore::InspectorResourceAgent::didFailXHRLoading): Deleted.
(WebCore::InspectorResourceAgent::replayXHR): Deleted.
* inspector/InspectorResourceAgent.h:
* inspector/NetworkResourcesData.cpp:
(WebCore::NetworkResourcesData::clear):
(WebCore::XHRReplayData::create): Deleted.
(WebCore::XHRReplayData::XHRReplayData): Deleted.
(WebCore::NetworkResourcesData::xhrReplayData): Deleted.
(WebCore::NetworkResourcesData::setXHRReplayData): Deleted.
(WebCore::NetworkResourcesData::reuseXHRReplayData): Deleted.
* inspector/NetworkResourcesData.h:
(WebCore::XHRReplayData::method): Deleted.
(WebCore::XHRReplayData::url): Deleted.
(WebCore::XHRReplayData::async): Deleted.
(WebCore::XHRReplayData::formData): Deleted.
(WebCore::XHRReplayData::headers): Deleted.
(WebCore::XHRReplayData::includeCredentials): Deleted.
(WebCore::NetworkResourcesData::ResourceData::xhrReplayData): Deleted.
(WebCore::NetworkResourcesData::ResourceData::setXHRReplayData): Deleted.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::createRequest):
(WebCore::XMLHttpRequest::internalAbort):
(WebCore::XMLHttpRequest::sendForInspectorXHRReplay): Deleted.
* xml/XMLHttpRequest.h:

Source/WebInspectorUI:

* UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
* UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
* Versions/Inspector-iOS-7.0.json:
* Versions/Inspector-iOS-8.0.json:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (180131 => 180132)


--- trunk/Source/_javascript_Core/ChangeLog	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-02-16 02:17:38 UTC (rev 180132)
@@ -1,3 +1,12 @@
+2015-02-15  Brian J. Burg  <b...@cs.washington.edu>
+
+        Web Inspector: remove unused XHR replay code
+        https://bugs.webkit.org/show_bug.cgi?id=141622
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/protocol/Network.json: remove XHR replay methods.
+
 2015-02-15  David Kilzer  <ddkil...@apple.com>
 
         REGRESSION (r180082): WebCore Debug builds fail on Mavericks due to weak export symbols

Modified: trunk/Source/_javascript_Core/inspector/protocol/Network.json (180131 => 180132)


--- trunk/Source/_javascript_Core/inspector/protocol/Network.json	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/_javascript_Core/inspector/protocol/Network.json	2015-02-16 02:17:38 UTC (rev 180132)
@@ -151,13 +151,6 @@
             ]
         },
         {
-            "name": "replayXHR",
-            "description": "This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.",
-            "parameters": [
-                { "name": "requestId", "$ref": "RequestId", "description": "Identifier of XHR to replay." }
-            ]
-        },
-        {
             "name": "canClearBrowserCache",
             "description": "Tells whether clearing browser cache is supported.",
             "returns": [

Modified: trunk/Source/WebCore/ChangeLog (180131 => 180132)


--- trunk/Source/WebCore/ChangeLog	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebCore/ChangeLog	2015-02-16 02:17:38 UTC (rev 180132)
@@ -1,3 +1,53 @@
+2015-02-15  Brian J. Burg  <b...@cs.washington.edu>
+
+        Web Inspector: remove unused XHR replay code
+        https://bugs.webkit.org/show_bug.cgi?id=141622
+
+        Reviewed by Timothy Hatcher.
+
+        XHR Replay functionality became unused with the last frontend rewrite.
+        Remove instrumentation and data storage classes only used by this feature.
+
+        * inspector/InspectorInstrumentation.cpp:
+        (WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClientImpl): Deleted.
+        (WebCore::InspectorInstrumentation::willLoadXHRImpl): Deleted.
+        (WebCore::InspectorInstrumentation::didFailXHRLoadingImpl): Deleted.
+        * inspector/InspectorInstrumentation.h:
+        (WebCore::InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient): Deleted.
+        (WebCore::InspectorInstrumentation::willLoadXHR): Deleted.
+        (WebCore::InspectorInstrumentation::didFailXHRLoading): Deleted.
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::didLoadResourceFromMemoryCache):
+        (WebCore::InspectorResourceAgent::didFinishXHRLoading):
+        (WebCore::InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient): Deleted.
+        (WebCore::InspectorResourceAgent::willLoadXHR): Deleted.
+        (WebCore::InspectorResourceAgent::didFailXHRLoading): Deleted.
+        (WebCore::InspectorResourceAgent::replayXHR): Deleted.
+        * inspector/InspectorResourceAgent.h:
+        * inspector/NetworkResourcesData.cpp:
+        (WebCore::NetworkResourcesData::clear):
+        (WebCore::XHRReplayData::create): Deleted.
+        (WebCore::XHRReplayData::XHRReplayData): Deleted.
+        (WebCore::NetworkResourcesData::xhrReplayData): Deleted.
+        (WebCore::NetworkResourcesData::setXHRReplayData): Deleted.
+        (WebCore::NetworkResourcesData::reuseXHRReplayData): Deleted.
+        * inspector/NetworkResourcesData.h:
+        (WebCore::XHRReplayData::method): Deleted.
+        (WebCore::XHRReplayData::url): Deleted.
+        (WebCore::XHRReplayData::async): Deleted.
+        (WebCore::XHRReplayData::formData): Deleted.
+        (WebCore::XHRReplayData::headers): Deleted.
+        (WebCore::XHRReplayData::includeCredentials): Deleted.
+        (WebCore::NetworkResourcesData::ResourceData::xhrReplayData): Deleted.
+        (WebCore::NetworkResourcesData::ResourceData::setXHRReplayData): Deleted.
+        * loader/DocumentThreadableLoader.cpp:
+        (WebCore::DocumentThreadableLoader::loadRequest):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::createRequest):
+        (WebCore::XMLHttpRequest::internalAbort):
+        (WebCore::XMLHttpRequest::sendForInspectorXHRReplay): Deleted.
+        * xml/XMLHttpRequest.h:
+
 2015-02-15  Said Abou-Hallawa  <sabouhall...@apple.com>
 
         Crash when accessing an item in SVGTransformList and then removing a previous item from this list.

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp (180131 => 180132)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.cpp	2015-02-16 02:17:38 UTC (rev 180132)
@@ -646,24 +646,6 @@
         consoleAgent->didFailLoading(identifier, error); // This should come AFTER resource notification, front-end relies on this.
 }
 
-void InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClientImpl(InstrumentingAgents& instrumentingAgents, unsigned long identifier, ThreadableLoaderClient* client)
-{
-    if (InspectorResourceAgent* resourceAgent = instrumentingAgents.inspectorResourceAgent())
-        resourceAgent->documentThreadableLoaderStartedLoadingForClient(identifier, client);
-}
-
-void InspectorInstrumentation::willLoadXHRImpl(InstrumentingAgents& instrumentingAgents, ThreadableLoaderClient* client, const String& method, const URL& url, bool async, RefPtr<FormData>&& formData, const HTTPHeaderMap& headers, bool includeCredentials)
-{
-    if (InspectorResourceAgent* resourceAgent = instrumentingAgents.inspectorResourceAgent())
-        resourceAgent->willLoadXHR(client, method, url, async, WTF::move(formData), headers, includeCredentials);
-}
-
-void InspectorInstrumentation::didFailXHRLoadingImpl(InstrumentingAgents& instrumentingAgents, ThreadableLoaderClient* client)
-{
-    if (InspectorResourceAgent* resourceAgent = instrumentingAgents.inspectorResourceAgent())
-        resourceAgent->didFailXHRLoading(client);
-}
-
 void InspectorInstrumentation::didFinishXHRLoadingImpl(InstrumentingAgents& instrumentingAgents, ThreadableLoaderClient* client, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
 {
     if (WebConsoleAgent* consoleAgent = instrumentingAgents.webConsoleAgent())

Modified: trunk/Source/WebCore/inspector/InspectorInstrumentation.h (180131 => 180132)


--- trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebCore/inspector/InspectorInstrumentation.h	2015-02-16 02:17:38 UTC (rev 180132)
@@ -183,9 +183,6 @@
     static void didReceiveData(Frame*, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
     static void didFinishLoading(Frame*, DocumentLoader*, unsigned long identifier, double finishTime);
     static void didFailLoading(Frame*, DocumentLoader*, unsigned long identifier, const ResourceError&);
-    static void documentThreadableLoaderStartedLoadingForClient(Document&, unsigned long identifier, ThreadableLoaderClient*);
-    static void willLoadXHR(ScriptExecutionContext*, ThreadableLoaderClient*, const String&, const URL&, bool, RefPtr<FormData>&&, const HTTPHeaderMap&, bool);
-    static void didFailXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient*);
     static void didFinishXHRLoading(ScriptExecutionContext*, ThreadableLoaderClient*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
     static void didReceiveXHRResponse(ScriptExecutionContext*, unsigned long identifier);
     static void willLoadXHRSynchronously(ScriptExecutionContext*);
@@ -365,7 +362,6 @@
     static void didReceiveDataImpl(InstrumentingAgents&, unsigned long identifier, const char* data, int dataLength, int encodedDataLength);
     static void didFinishLoadingImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, double finishTime);
     static void didFailLoadingImpl(InstrumentingAgents&, unsigned long identifier, DocumentLoader*, const ResourceError&);
-    static void documentThreadableLoaderStartedLoadingForClientImpl(InstrumentingAgents&, unsigned long identifier, ThreadableLoaderClient*);
     static void willLoadXHRImpl(InstrumentingAgents&, ThreadableLoaderClient*, const String&, const URL&, bool, RefPtr<FormData>&&, const HTTPHeaderMap&, bool);
     static void didFailXHRLoadingImpl(InstrumentingAgents&, ThreadableLoaderClient*);
     static void didFinishXHRLoadingImpl(InstrumentingAgents&, ThreadableLoaderClient*, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber);
@@ -949,25 +945,6 @@
         didFailLoadingImpl(*instrumentingAgents, identifier, loader, error);
 }
 
-inline void InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(Document& document, unsigned long identifier, ThreadableLoaderClient* client)
-{
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForDocument(document))
-        documentThreadableLoaderStartedLoadingForClientImpl(*instrumentingAgents, identifier, client);
-}
-
-inline void InspectorInstrumentation::willLoadXHR(ScriptExecutionContext* context, ThreadableLoaderClient* client, const String& method, const URL& url, bool async, RefPtr<FormData>&& formData, const HTTPHeaderMap& headers, bool includeCredentials)
-{
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
-        willLoadXHRImpl(*instrumentingAgents, client, method, url, async, WTF::move(formData), headers, includeCredentials);
-}
-
-inline void InspectorInstrumentation::didFailXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client)
-{
-    if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))
-        didFailXHRLoadingImpl(*instrumentingAgents, client);
-}
-
-
 inline void InspectorInstrumentation::didFinishXHRLoading(ScriptExecutionContext* context, ThreadableLoaderClient* client, unsigned long identifier, const String& sourceString, const String& url, const String& sendURL, unsigned sendLineNumber, unsigned sendColumnNumber)
 {
     if (InstrumentingAgents* instrumentingAgents = instrumentingAgentsForContext(context))

Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (180131 => 180132)


--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp	2015-02-16 02:17:38 UTC (rev 180132)
@@ -61,7 +61,6 @@
 #include "ThreadableLoaderClient.h"
 #include "URL.h"
 #include "WebSocketFrame.h"
-#include "XMLHttpRequest.h"
 #include <inspector/IdentifiersFactory.h>
 #include <inspector/InspectorValues.h>
 #include <inspector/ScriptCallStack.h>
@@ -448,10 +447,6 @@
     String requestId = IdentifiersFactory::requestId(identifier);
     m_resourcesData->resourceCreated(requestId, loaderId);
     m_resourcesData->addCachedResource(requestId, &resource);
-    if (resource.type() == CachedResource::RawResource) {
-        String rawRequestId = IdentifiersFactory::requestId(downcast<CachedRawResource>(resource).identifier());
-        m_resourcesData->reuseXHRReplayData(requestId, rawRequestId);
-    }
 
     RefPtr<Inspector::Protocol::Network::Initiator> initiatorObject = buildInitiatorObject(loader.frame() ? loader.frame()->document() : nullptr);
 
@@ -468,39 +463,12 @@
     m_resourcesData->setResourceType(IdentifiersFactory::requestId(identifier), InspectorPageAgent::ScriptResource);
 }
 
-void InspectorResourceAgent::documentThreadableLoaderStartedLoadingForClient(unsigned long identifier, ThreadableLoaderClient* client)
+void InspectorResourceAgent::didFinishXHRLoading(ThreadableLoaderClient*, unsigned long identifier, const String& sourceString)
 {
-    if (!client)
-        return;
-
-    PendingXHRReplayDataMap::iterator it = m_pendingXHRReplayData.find(client);
-    if (it == m_pendingXHRReplayData.end())
-        return;
-
-    XHRReplayData* xhrReplayData = it->value.get();
-    String requestId = IdentifiersFactory::requestId(identifier);
-    m_resourcesData->setXHRReplayData(requestId, xhrReplayData);
-}
-
-void InspectorResourceAgent::willLoadXHR(ThreadableLoaderClient* client, const String& method, const URL& url, bool async, RefPtr<FormData>&& formData, const HTTPHeaderMap& headers, bool includeCredentials)
-{
-    RefPtr<XHRReplayData> xhrReplayData = XHRReplayData::create(method, url, async, WTF::move(formData), headers, includeCredentials);
-
-    m_pendingXHRReplayData.set(client, WTF::move(xhrReplayData));
-}
-
-void InspectorResourceAgent::didFailXHRLoading(ThreadableLoaderClient* client)
-{
-    m_pendingXHRReplayData.remove(client);
-}
-
-void InspectorResourceAgent::didFinishXHRLoading(ThreadableLoaderClient* client, unsigned long identifier, const String& sourceString)
-{
     // For Asynchronous XHRs, the inspector can grab the data directly off of the CachedResource. For sync XHRs, we need to
     // provide the data here, since no CachedResource was involved.
     if (m_loadingXHRSynchronously)
         m_resourcesData->setResourceContent(IdentifiersFactory::requestId(identifier), sourceString);
-    m_pendingXHRReplayData.remove(client);
 }
 
 void InspectorResourceAgent::didReceiveXHRResponse(unsigned long identifier)
@@ -694,30 +662,6 @@
     errorString = ASCIILiteral("No data found for resource with given identifier");
 }
 
-void InspectorResourceAgent::replayXHR(ErrorString&, const String& requestId)
-{
-    RefPtr<XMLHttpRequest> xhr = XMLHttpRequest::create(*m_pageAgent->mainFrame()->document());
-    String actualRequestId = requestId;
-
-    XHRReplayData* xhrReplayData = m_resourcesData->xhrReplayData(requestId);
-    if (!xhrReplayData)
-        return;
-
-    ResourceRequest request(xhrReplayData->url());
-#if ENABLE(CACHE_PARTITIONING)
-    request.setDomainForCachePartition(m_pageAgent->mainFrame()->document()->topOrigin()->domainForCachePartition());
-#endif
-
-    auto& memoryCache = MemoryCache::singleton();
-    if (CachedResource* cachedResource = memoryCache.resourceForRequest(request, m_pageAgent->page()->sessionID()))
-        memoryCache.remove(*cachedResource);
-
-    xhr->open(xhrReplayData->method(), xhrReplayData->url(), xhrReplayData->async(), IGNORE_EXCEPTION);
-    for (const auto& header : xhrReplayData->headers())
-        xhr->setRequestHeader(header.key, header.value, IGNORE_EXCEPTION);
-    xhr->sendForInspectorXHRReplay(xhrReplayData->formData(), IGNORE_EXCEPTION);
-}
-
 void InspectorResourceAgent::canClearBrowserCache(ErrorString&, bool* result)
 {
     *result = m_client->canClearBrowserCache();

Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.h (180131 => 180132)


--- trunk/Source/WebCore/inspector/InspectorResourceAgent.h	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.h	2015-02-16 02:17:38 UTC (rev 180132)
@@ -64,7 +64,6 @@
 class SharedBuffer;
 class ThreadableLoaderClient;
 class URL;
-class XHRReplayData;
 class XMLHttpRequest;
 
 #if ENABLE(WEB_SOCKETS)
@@ -92,9 +91,6 @@
     void didFinishLoading(unsigned long identifier, DocumentLoader&, double finishTime);
     void didFailLoading(unsigned long identifier, DocumentLoader&, const ResourceError&);
     void didLoadResourceFromMemoryCache(DocumentLoader&, CachedResource&);
-    void documentThreadableLoaderStartedLoadingForClient(unsigned long identifier, ThreadableLoaderClient*);
-    void willLoadXHR(ThreadableLoaderClient*, const String& method, const URL&, bool async, RefPtr<FormData>&& body, const HTTPHeaderMap& headers, bool includeCrendentials);
-    void didFailXHRLoading(ThreadableLoaderClient*);
     void didFinishXHRLoading(ThreadableLoaderClient*, unsigned long identifier, const String& sourceString);
     void didReceiveXHRResponse(unsigned long identifier);
     void willLoadXHRSynchronously();
@@ -123,7 +119,6 @@
     virtual void disable(ErrorString&) override;
     virtual void setExtraHTTPHeaders(ErrorString&, const RefPtr<Inspector::InspectorObject>&&) override;
     virtual void getResponseBody(ErrorString&, const String& requestId, String* content, bool* base64Encoded) override;
-    virtual void replayXHR(ErrorString&, const String& requestId) override;
     virtual void canClearBrowserCache(ErrorString&, bool*) override;
     virtual void clearBrowserCache(ErrorString&) override;
     virtual void canClearBrowserCookies(ErrorString&, bool*) override;
@@ -148,8 +143,6 @@
 
     HashSet<unsigned long> m_hiddenRequestIdentifiers;
 
-    typedef HashMap<ThreadableLoaderClient*, RefPtr<XHRReplayData>> PendingXHRReplayDataMap;
-    PendingXHRReplayDataMap m_pendingXHRReplayData;
     // FIXME: InspectorResourceAgent should now be aware of style recalculation.
     RefPtr<Inspector::Protocol::Network::Initiator> m_styleRecalculationInitiator;
     bool m_isRecalculatingStyle;

Modified: trunk/Source/WebCore/inspector/NetworkResourcesData.cpp (180131 => 180132)


--- trunk/Source/WebCore/inspector/NetworkResourcesData.cpp	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebCore/inspector/NetworkResourcesData.cpp	2015-02-16 02:17:38 UTC (rev 180132)
@@ -47,23 +47,6 @@
 
 namespace WebCore {
 
-
-Ref<XHRReplayData> XHRReplayData::create(const String &method, const URL& url, bool async, RefPtr<FormData>&& formData, const HTTPHeaderMap& headers, bool includeCredentials)
-{
-    return adoptRef(*new XHRReplayData(method, url, async, WTF::move(formData), headers, includeCredentials));
-}
-
-
-XHRReplayData::XHRReplayData(const String &method, const URL& url, bool async, RefPtr<FormData>&& formData, const HTTPHeaderMap& headers, bool includeCredentials)
-    : m_method(method)
-    , m_url(url)
-    , m_async(async)
-    , m_formData(WTF::move(formData))
-    , m_headers(headers)
-    , m_includeCredentials(includeCredentials)
-{
-}
-
 // ResourceData
 NetworkResourcesData::ResourceData::ResourceData(const String& requestId, const String& loaderId)
     : m_requestId(requestId)
@@ -268,46 +251,6 @@
     return resourceDataForRequestId(requestId);
 }
 
-XHRReplayData* NetworkResourcesData::xhrReplayData(const String& requestId)
-{
-    if (m_reusedXHRReplayDataRequestIds.contains(requestId))
-        return xhrReplayData(m_reusedXHRReplayDataRequestIds.get(requestId));
-
-    ResourceData* resourceData = resourceDataForRequestId(requestId);
-    if (!resourceData)
-        return nullptr;
-    return resourceData->xhrReplayData();
-}
-
-void NetworkResourcesData::setXHRReplayData(const String& requestId, XHRReplayData* xhrReplayData)
-{
-    ResourceData* resourceData = resourceDataForRequestId(requestId);
-    if (!resourceData) {
-        Vector<String> result;
-        ReusedRequestIds::iterator it;
-        ReusedRequestIds::iterator end = m_reusedXHRReplayDataRequestIds.end();
-        for (it = m_reusedXHRReplayDataRequestIds.begin(); it != end; ++it) {
-            if (it->value == requestId)
-                setXHRReplayData(it->key, xhrReplayData);
-        }
-        return;
-    }
-
-    resourceData->setXHRReplayData(xhrReplayData);
-}
-
-void NetworkResourcesData::reuseXHRReplayData(const String& requestId, const String& reusedRequestId)
-{
-    ResourceData* reusedResourceData = resourceDataForRequestId(reusedRequestId);
-    ResourceData* resourceData = resourceDataForRequestId(requestId);
-    if (!reusedResourceData || !resourceData) {
-        m_reusedXHRReplayDataRequestIds.set(requestId, reusedRequestId);
-        return;
-    }
-
-    resourceData->setXHRReplayData(reusedResourceData->xhrReplayData());
-}
-
 Vector<String> NetworkResourcesData::removeCachedResource(CachedResource* cachedResource)
 {
     Vector<String> result;
@@ -342,8 +285,6 @@
             delete resourceData;
     }
     m_requestIdToResourceDataMap.swap(preservedMap);
-
-    m_reusedXHRReplayDataRequestIds.clear();
 }
 
 NetworkResourcesData::ResourceData* NetworkResourcesData::resourceDataForRequestId(const String& requestId)

Modified: trunk/Source/WebCore/inspector/NetworkResourcesData.h (180131 => 180132)


--- trunk/Source/WebCore/inspector/NetworkResourcesData.h	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebCore/inspector/NetworkResourcesData.h	2015-02-16 02:17:38 UTC (rev 180132)
@@ -47,27 +47,6 @@
 class SharedBuffer;
 class TextResourceDecoder;
 
-class XHRReplayData : public RefCounted<XHRReplayData> {
-public:
-    static Ref<XHRReplayData> create(const String &method, const URL&, bool async, RefPtr<FormData>&&, const HTTPHeaderMap& headers, bool includeCredentials);
-
-    const String& method() const { return m_method; }
-    const URL& url() const { return m_url; }
-    bool async() const { return m_async; }
-    PassRefPtr<FormData> formData() const { return m_formData; }
-    const HTTPHeaderMap& headers() const { return m_headers; }
-    bool includeCredentials() const { return m_includeCredentials; }
-private:
-    XHRReplayData(const String &method, const URL&, bool async, RefPtr<FormData>&&, const HTTPHeaderMap& headers, bool includeCredentials);
-
-    String m_method;
-    URL m_url;
-    bool m_async;
-    RefPtr<FormData> m_formData;
-    const HTTPHeaderMap m_headers;
-    bool m_includeCredentials;
-};
-
 class NetworkResourcesData {
     WTF_MAKE_FAST_ALLOCATED;
 public:
@@ -114,9 +93,6 @@
         CachedResource* cachedResource() const { return m_cachedResource; }
         void setCachedResource(CachedResource* cachedResource) { m_cachedResource = cachedResource; }
 
-        XHRReplayData* xhrReplayData() const { return m_xhrReplayData.get(); }
-        void setXHRReplayData(XHRReplayData* xhrReplayData) { m_xhrReplayData = xhrReplayData; }
-
     private:
         bool hasData() const { return m_dataBuffer; }
         size_t dataLength() const;
@@ -128,7 +104,6 @@
         String m_frameId;
         String m_url;
         String m_content;
-        RefPtr<XHRReplayData> m_xhrReplayData;
         bool m_base64Encoded;
         RefPtr<SharedBuffer> m_dataBuffer;
         bool m_isContentEvicted;
@@ -159,10 +134,6 @@
     Vector<String> removeCachedResource(CachedResource*);
     void clear(const String& preservedLoaderId = String());
 
-    void setXHRReplayData(const String& requestId, XHRReplayData*);
-    void reuseXHRReplayData(const String& requestId, const String& reusedRequestId);
-    XHRReplayData* xhrReplayData(const String& requestId);
-
 private:
     ResourceData* resourceDataForRequestId(const String& requestId);
     void ensureNoDataForRequestId(const String& requestId);
@@ -170,8 +141,6 @@
 
     Deque<String> m_requestIdsDeque;
 
-    typedef HashMap<String, String> ReusedRequestIds;
-    ReusedRequestIds m_reusedXHRReplayDataRequestIds;
     typedef HashMap<String, ResourceData*> ResourceDataMap;
     ResourceDataMap m_requestIdToResourceDataMap;
     size_t m_contentSize;

Modified: trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp (180131 => 180132)


--- trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebCore/loader/DocumentThreadableLoader.cpp	2015-02-16 02:17:38 UTC (rev 180132)
@@ -367,13 +367,9 @@
 #endif
         ASSERT(!m_resource);
         m_resource = m_document.cachedResourceLoader().requestRawResource(newRequest);
-        if (m_resource) {
-            if (m_resource->loader()) {
-                unsigned long identifier = m_resource->loader()->identifier();
-                InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_document, identifier, m_client);
-            }
+        if (m_resource)
             m_resource->addClient(this);
-        }
+
         return;
     }
     
@@ -385,8 +381,6 @@
     if (m_document.frame())
         identifier = m_document.frame()->loader().loadResourceSynchronously(request, m_options.allowCredentials(), m_options.clientCredentialPolicy(), error, response, data);
 
-    InspectorInstrumentation::documentThreadableLoaderStartedLoadingForClient(m_document, identifier, m_client);
-
     if (!error.isNull() && response.httpStatusCode() <= 0) {
         if (requestURL.isLocalFile()) {
             // We don't want XMLHttpRequest to raise an exception for file:// resources, see <rdar://problem/4962298>.

Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (180131 => 180132)


--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp	2015-02-16 02:17:38 UTC (rev 180132)
@@ -719,13 +719,6 @@
     createRequest(ec);
 }
 
-void XMLHttpRequest::sendForInspectorXHRReplay(PassRefPtr<FormData> formData, ExceptionCode& ec)
-{
-    m_requestEntityBody = formData ? formData->deepCopy() : 0;
-    createRequest(ec);
-    m_exceptionCode = ec;
-}
-
 void XMLHttpRequest::createRequest(ExceptionCode& ec)
 {
     // Only GET request is supported for blob URL.
@@ -755,8 +748,6 @@
     ResourceRequest request(m_url);
     request.setHTTPMethod(m_method);
 
-    InspectorInstrumentation::willLoadXHR(scriptExecutionContext(), this, m_method, m_url, m_async, m_requestEntityBody ? m_requestEntityBody->deepCopy() : 0, m_requestHeaders, m_includeCredentials);
-
     if (m_requestEntityBody) {
         ASSERT(m_method != "GET");
         ASSERT(m_method != "HEAD");
@@ -846,8 +837,6 @@
 
     m_decoder = 0;
 
-    InspectorInstrumentation::didFailXHRLoading(scriptExecutionContext(), this);
-
     if (!m_loader)
         return true;
 

Modified: trunk/Source/WebCore/xml/XMLHttpRequest.h (180131 => 180132)


--- trunk/Source/WebCore/xml/XMLHttpRequest.h	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.h	2015-02-16 02:17:38 UTC (rev 180132)
@@ -121,8 +121,6 @@
     bool responseCacheIsValid() const { return m_responseCacheIsValid; }
     void didCacheResponseJSON();
 
-    void sendForInspectorXHRReplay(PassRefPtr<FormData>, ExceptionCode&);
-
     // Expose HTTP validation methods for other untrusted requests.
     static bool isAllowedHTTPMethod(const String&);
     static String uppercaseKnownHTTPMethod(const String&);

Modified: trunk/Source/WebInspectorUI/ChangeLog (180131 => 180132)


--- trunk/Source/WebInspectorUI/ChangeLog	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebInspectorUI/ChangeLog	2015-02-16 02:17:38 UTC (rev 180132)
@@ -1,3 +1,15 @@
+2015-02-15  Brian J. Burg  <b...@cs.washington.edu>
+
+        Web Inspector: remove unused XHR replay code
+        https://bugs.webkit.org/show_bug.cgi?id=141622
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js:
+        * UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js:
+        * Versions/Inspector-iOS-7.0.json:
+        * Versions/Inspector-iOS-8.0.json:
+
 2015-02-14  Joseph Pecoraro  <pecor...@apple.com>
 
         Web Inspector: Remove specificity approximation

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js (180131 => 180132)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/7.0/InspectorBackendCommands.js	2015-02-16 02:17:38 UTC (rev 180132)
@@ -129,7 +129,6 @@
 InspectorBackend.registerCommand("Network.disable", [], []);
 InspectorBackend.registerCommand("Network.setExtraHTTPHeaders", [{"name": "headers", "type": "object", "optional": false}], []);
 InspectorBackend.registerCommand("Network.getResponseBody", [{"name": "requestId", "type": "string", "optional": false}], ["body", "base64Encoded"]);
-InspectorBackend.registerCommand("Network.replayXHR", [{"name": "requestId", "type": "string", "optional": false}], []);
 InspectorBackend.registerCommand("Network.canClearBrowserCache", [], ["result"]);
 InspectorBackend.registerCommand("Network.clearBrowserCache", [], []);
 InspectorBackend.registerCommand("Network.canClearBrowserCookies", [], ["result"]);

Modified: trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js (180131 => 180132)


--- trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebInspectorUI/UserInterface/Protocol/Legacy/8.0/InspectorBackendCommands.js	2015-02-16 02:17:38 UTC (rev 180132)
@@ -290,7 +290,6 @@
 InspectorBackend.registerCommand("Network.disable", [], []);
 InspectorBackend.registerCommand("Network.setExtraHTTPHeaders", [{"name": "headers", "type": "object", "optional": false}], []);
 InspectorBackend.registerCommand("Network.getResponseBody", [{"name": "requestId", "type": "string", "optional": false}], ["body", "base64Encoded"]);
-InspectorBackend.registerCommand("Network.replayXHR", [{"name": "requestId", "type": "string", "optional": false}], []);
 InspectorBackend.registerCommand("Network.canClearBrowserCache", [], ["result"]);
 InspectorBackend.registerCommand("Network.clearBrowserCache", [], []);
 InspectorBackend.registerCommand("Network.canClearBrowserCookies", [], ["result"]);

Modified: trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json (180131 => 180132)


--- trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebInspectorUI/Versions/Inspector-iOS-7.0.json	2015-02-16 02:17:38 UTC (rev 180132)
@@ -815,13 +815,6 @@
                 ]
             },
             {
-                "name": "replayXHR",
-                "description": "This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.",
-                "parameters": [
-                    { "name": "requestId", "$ref": "RequestId", "description": "Identifier of XHR to replay." }
-                ]
-            },
-            {
                 "name": "canClearBrowserCache",
                 "description": "Tells whether clearing browser cache is supported.",
                 "returns": [

Modified: trunk/Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json (180131 => 180132)


--- trunk/Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json	2015-02-16 02:16:23 UTC (rev 180131)
+++ trunk/Source/WebInspectorUI/Versions/Inspector-iOS-8.0.json	2015-02-16 02:17:38 UTC (rev 180132)
@@ -2448,13 +2448,6 @@
             ]
         },
         {
-            "name": "replayXHR",
-            "description": "This method sends a new XMLHttpRequest which is identical to the original one. The following parameters should be identical: method, url, async, request body, extra headers, withCredentials attribute, user, password.",
-            "parameters": [
-                { "name": "requestId", "$ref": "RequestId", "description": "Identifier of XHR to replay." }
-            ]
-        },
-        {
             "name": "canClearBrowserCache",
             "description": "Tells whether clearing browser cache is supported.",
             "returns": [
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to