2011-02-03 Brian Ryner <bryner@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 05:38:21 +0000 (05:38 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 4 Feb 2011 05:38:21 +0000 (05:38 +0000)
        Reviewed by Darin Fisher.

        Add a field to the ResourceResponse for tracking the socket address
        of the host that the resource was fetched from.  Patch was originally
        by Paul Marks.
        https://bugs.webkit.org/show_bug.cgi?id=53699

        * platform/network/chromium/ResourceResponse.cpp:
        (WebCore::ResourceResponse::doPlatformCopyData):
        (WebCore::ResourceResponse::doPlatformAdopt):
        * platform/network/chromium/ResourceResponse.h:
        (WebCore::ResourceResponse::socketAddress):
        (WebCore::ResourceResponse::setSocketAddress):
2011-02-03  Brian Ryner  <bryner@chromium.org>

        Reviewed by Darin Fisher.

        Add a field to the ResourceResponse for tracking the socket address
        of the host that the resource was fetched from.  Patch was originally
        by Paul Marks.
        https://bugs.webkit.org/show_bug.cgi?id=53699

        * public/WebURLResponse.h:
        * src/WebURLResponse.cpp:
        (WebKit::WebURLResponse::socketAddress):
        (WebKit::WebURLResponse::setSocketAddress):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77604 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/network/chromium/ResourceResponse.cpp
Source/WebCore/platform/network/chromium/ResourceResponse.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebURLResponse.h
Source/WebKit/chromium/src/WebURLResponse.cpp

index 1cf0be8fe3d6379eade539889312172c3a64d242..6dd0ee5c5cd3b85e8a99a44b0bcfa27ea02faf52 100644 (file)
@@ -1,3 +1,19 @@
+2011-02-03  Brian Ryner  <bryner@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Add a field to the ResourceResponse for tracking the socket address
+        of the host that the resource was fetched from.  Patch was originally
+        by Paul Marks.
+        https://bugs.webkit.org/show_bug.cgi?id=53699
+
+        * platform/network/chromium/ResourceResponse.cpp:
+        (WebCore::ResourceResponse::doPlatformCopyData):
+        (WebCore::ResourceResponse::doPlatformAdopt):
+        * platform/network/chromium/ResourceResponse.h:
+        (WebCore::ResourceResponse::socketAddress):
+        (WebCore::ResourceResponse::setSocketAddress):
+
 2011-02-03  Adam Langley  <agl@chromium.org>
 
         Reviewed by Adam Barth.
index acd44d323e4e2ac95efea039ea3ca98593e0be4d..983ccc04d7067eaa721b103fc8c0fd1e09f9c480 100644 (file)
@@ -39,6 +39,7 @@ PassOwnPtr<CrossThreadResourceResponseData> ResourceResponse::doPlatformCopyData
     data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable;
     data->m_wasFetchedViaProxy = m_wasFetchedViaProxy;
     data->m_responseTime = m_responseTime;
+    data->m_socketAddress = m_socketAddress;
     return data;
 }
 
@@ -53,6 +54,7 @@ void ResourceResponse::doPlatformAdopt(PassOwnPtr<CrossThreadResourceResponseDat
     m_wasAlternateProtocolAvailable = data->m_wasAlternateProtocolAvailable;
     m_wasFetchedViaProxy = data->m_wasFetchedViaProxy;
     m_responseTime = data->m_responseTime;
+    m_socketAddress = data->m_socketAddress;
 }
 
 } // namespace WebCore
index 5e999942942de5c1675eb19b8d06b7c4c7ff421b..e6c47ad86e2efe76ad952fa91f8883307ad56c28 100644 (file)
@@ -96,6 +96,9 @@ namespace WebCore {
         double responseTime() const { return m_responseTime; }
         void setResponseTime(double responseTime) { m_responseTime = responseTime; }
 
+        const String& socketAddress() const { return m_socketAddress; }
+        void setSocketAddress(const String& value) { m_socketAddress = value; }
+
     private:
         friend class ResourceResponseBase;
 
@@ -143,6 +146,10 @@ namespace WebCore {
         // The time at which the response headers were received.  For cached
         // responses, this time could be "far" in the past.
         double m_responseTime;
+
+        // Remote address of the socket which fetched this resource, for presenting
+        // to inquisitive users.  Can be "ipv4:port", "[ipv6]:port", or empty.
+        String m_socketAddress;
     };
 
     struct CrossThreadResourceResponseData : public CrossThreadResourceResponseDataBase {
@@ -155,6 +162,7 @@ namespace WebCore {
         bool m_wasAlternateProtocolAvailable;
         bool m_wasFetchedViaProxy;
         double m_responseTime;
+        String m_socketAddress;
     };
 
 } // namespace WebCore
index 4edc7ee325113b95fcb76aca459ebb676e2e7c41..ab2d47df4f92d9f52b01d2455ef886aec94b9a88 100644 (file)
@@ -1,3 +1,17 @@
+2011-02-03  Brian Ryner  <bryner@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Add a field to the ResourceResponse for tracking the socket address
+        of the host that the resource was fetched from.  Patch was originally
+        by Paul Marks.
+        https://bugs.webkit.org/show_bug.cgi?id=53699
+
+        * public/WebURLResponse.h:
+        * src/WebURLResponse.cpp:
+        (WebKit::WebURLResponse::socketAddress):
+        (WebKit::WebURLResponse::setSocketAddress):
+
 2011-02-03  Adam Langley  <agl@chromium.org>
 
         Reviewed by Adam Barth.
index c50f88ec1b585dbd80ca9331668d049207fca043..4ecee17756d2fa3d8a5a78c2948bfb9e761d1eea 100644 (file)
@@ -169,6 +169,11 @@ public:
     WEBKIT_API WebString downloadFilePath() const;
     WEBKIT_API void setDownloadFilePath(const WebString&);
 
+    // Remote address of the socket which fetched this resource, for presenting
+    // to inquisitive users.  Can be "ipv4:port", "[ipv6]:port", or empty.
+    WEBKIT_API WebString socketAddress() const;
+    WEBKIT_API void setSocketAddress(const WebString&);
+
 protected:
     void assign(WebURLResponsePrivate*);
 
index bf3c521bb870de8de4c5d17361ca5c3dceaa00f2..79172981ed9b333aa8e3ad09685e49a5003d242b 100644 (file)
@@ -384,6 +384,16 @@ void WebURLResponse::setDownloadFilePath(const WebString& downloadFilePath)
     m_private->m_downloadFilePath = downloadFilePath;
 }
 
+WebString WebURLResponse::socketAddress() const
+{
+    return m_private->m_resourceResponse->socketAddress();
+}
+
+void WebURLResponse::setSocketAddress(const WebString& socketAddress)
+{
+    m_private->m_resourceResponse->setSocketAddress(socketAddress);
+}
+
 void WebURLResponse::assign(WebURLResponsePrivate* p)
 {
     // Subclasses may call this directly so a self-assignment check is needed