Title: [169861] trunk/Source/WebCore
Revision
169861
Author
[email protected]
Date
2014-06-11 16:57:39 -0700 (Wed, 11 Jun 2014)

Log Message

Remove XHRReplayData::addHeader
https://bugs.webkit.org/show_bug.cgi?id=133776

Reviewed by Antti Koivisto.

Just pass the HTTP header map to XHRReplayData::create directly.

* inspector/InspectorResourceAgent.cpp:
(WebCore::InspectorResourceAgent::willLoadXHR):
* inspector/NetworkResourcesData.cpp:
(WebCore::XHRReplayData::create):
(WebCore::XHRReplayData::XHRReplayData):
(WebCore::XHRReplayData::addHeader): Deleted.
* inspector/NetworkResourcesData.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (169860 => 169861)


--- trunk/Source/WebCore/ChangeLog	2014-06-11 23:53:09 UTC (rev 169860)
+++ trunk/Source/WebCore/ChangeLog	2014-06-11 23:57:39 UTC (rev 169861)
@@ -1,3 +1,20 @@
+2014-06-11  Anders Carlsson  <[email protected]>
+
+        Remove XHRReplayData::addHeader
+        https://bugs.webkit.org/show_bug.cgi?id=133776
+
+        Reviewed by Antti Koivisto.
+
+        Just pass the HTTP header map to XHRReplayData::create directly.
+
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::willLoadXHR):
+        * inspector/NetworkResourcesData.cpp:
+        (WebCore::XHRReplayData::create):
+        (WebCore::XHRReplayData::XHRReplayData):
+        (WebCore::XHRReplayData::addHeader): Deleted.
+        * inspector/NetworkResourcesData.h:
+
 2014-06-11  Andy Estes  <[email protected]>
 
         Fix the Mac build.

Modified: trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp (169860 => 169861)


--- trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp	2014-06-11 23:53:09 UTC (rev 169860)
+++ trunk/Source/WebCore/inspector/InspectorResourceAgent.cpp	2014-06-11 23:57:39 UTC (rev 169861)
@@ -484,9 +484,8 @@
 
 void InspectorResourceAgent::willLoadXHR(ThreadableLoaderClient* client, const String& method, const URL& url, bool async, PassRefPtr<FormData> formData, const HTTPHeaderMap& headers, bool includeCredentials)
 {
-    RefPtr<XHRReplayData> xhrReplayData = XHRReplayData::create(method, url, async, formData, includeCredentials);
-    for (const auto& header : headers)
-        xhrReplayData->addHeader(header.key, header.value);
+    RefPtr<XHRReplayData> xhrReplayData = XHRReplayData::create(method, url, async, formData, headers, includeCredentials);
+
     m_pendingXHRReplayData.set(client, xhrReplayData);
 }
 

Modified: trunk/Source/WebCore/inspector/NetworkResourcesData.cpp (169860 => 169861)


--- trunk/Source/WebCore/inspector/NetworkResourcesData.cpp	2014-06-11 23:53:09 UTC (rev 169860)
+++ trunk/Source/WebCore/inspector/NetworkResourcesData.cpp	2014-06-11 23:57:39 UTC (rev 169861)
@@ -51,21 +51,18 @@
 namespace WebCore {
 
 
-PassRefPtr<XHRReplayData> XHRReplayData::create(const String &method, const URL& url, bool async, PassRefPtr<FormData> formData, bool includeCredentials)
+PassRefPtr<XHRReplayData> XHRReplayData::create(const String &method, const URL& url, bool async, PassRefPtr<FormData> formData, const HTTPHeaderMap& headers, bool includeCredentials)
 {
-    return adoptRef(new XHRReplayData(method, url, async, formData, includeCredentials));
+    return adoptRef(new XHRReplayData(method, url, async, formData, headers, includeCredentials));
 }
 
-void XHRReplayData::addHeader(const AtomicString& key, const String& value)
-{
-    m_headers.set(key, value);
-}
 
-XHRReplayData::XHRReplayData(const String &method, const URL& url, bool async, PassRefPtr<FormData> formData, bool includeCredentials)
+XHRReplayData::XHRReplayData(const String &method, const URL& url, bool async, PassRefPtr<FormData> formData, const HTTPHeaderMap& headers, bool includeCredentials)
     : m_method(method)
     , m_url(url)
     , m_async(async)
     , m_formData(formData)
+    , m_headers(headers)
     , m_includeCredentials(includeCredentials)
 {
 }

Modified: trunk/Source/WebCore/inspector/NetworkResourcesData.h (169860 => 169861)


--- trunk/Source/WebCore/inspector/NetworkResourcesData.h	2014-06-11 23:53:09 UTC (rev 169860)
+++ trunk/Source/WebCore/inspector/NetworkResourcesData.h	2014-06-11 23:57:39 UTC (rev 169861)
@@ -51,9 +51,8 @@
 
 class XHRReplayData : public RefCounted<XHRReplayData> {
 public:
-    static PassRefPtr<XHRReplayData> create(const String &method, const URL&, bool async, PassRefPtr<FormData>, bool includeCredentials);
+    static PassRefPtr<XHRReplayData> create(const String &method, const URL&, bool async, PassRefPtr<FormData>, const HTTPHeaderMap& headers, bool includeCredentials);
 
-    void addHeader(const AtomicString& key, const String& value);
     const String& method() const { return m_method; }
     const URL& url() const { return m_url; }
     bool async() const { return m_async; }
@@ -61,13 +60,13 @@
     const HTTPHeaderMap& headers() const { return m_headers; }
     bool includeCredentials() const { return m_includeCredentials; }
 private:
-    XHRReplayData(const String &method, const URL&, bool async, PassRefPtr<FormData>, bool includeCredentials);
+    XHRReplayData(const String &method, const URL&, bool async, PassRefPtr<FormData>, const HTTPHeaderMap& headers, bool includeCredentials);
 
     String m_method;
     URL m_url;
     bool m_async;
     RefPtr<FormData> m_formData;
-    HTTPHeaderMap m_headers;
+    const HTTPHeaderMap m_headers;
     bool m_includeCredentials;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to