2011-02-16 Brian Ryner <bryner@chromium.org>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Feb 2011 06:25:05 +0000 (06:25 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Feb 2011 06:25:05 +0000 (06:25 +0000)
        Reviewed by Darin Fisher.

        Split the socket address field into separate IP address and port fields.
        This will make the field less error-prone to parse, for example when
        dealing with IPv6 literals.
        https://bugs.webkit.org/show_bug.cgi?id=54607

        No new tests required.

        * platform/network/chromium/ResourceResponse.cpp:
        (WebCore::ResourceResponse::doPlatformCopyData):
        (WebCore::ResourceResponse::doPlatformAdopt):
        * platform/network/chromium/ResourceResponse.h:
        (WebCore::ResourceResponse::ResourceResponse):
        (WebCore::ResourceResponse::remoteIPAddress):
        (WebCore::ResourceResponse::setRemoteIPAddress):
        (WebCore::ResourceResponse::remotePort):
        (WebCore::ResourceResponse::setRemotePort):
2011-02-16  Brian Ryner  <bryner@chromium.org>

        Reviewed by Darin Fisher.

        Split the socket address field into separate IP address and port fields.
        This will make the field less error-prone to parse, for example when
        dealing with IPv6 literals.
        https://bugs.webkit.org/show_bug.cgi?id=54607

        * public/WebURLResponse.h:
        * src/WebURLResponse.cpp:
        (WebKit::WebURLResponse::remoteIPAddress):
        (WebKit::WebURLResponse::setRemoteIPAddress):
        (WebKit::WebURLResponse::remotePort):
        (WebKit::WebURLResponse::setRemotePort):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@78790 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 2aacdf18bb3ec5871fb80c31c66f83002557aa96..fc893164c382ec77132bae610ef652d794e40b0b 100644 (file)
@@ -1,3 +1,24 @@
+2011-02-16  Brian Ryner  <bryner@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Split the socket address field into separate IP address and port fields.
+        This will make the field less error-prone to parse, for example when
+        dealing with IPv6 literals.
+        https://bugs.webkit.org/show_bug.cgi?id=54607
+
+        No new tests required.
+
+        * platform/network/chromium/ResourceResponse.cpp:
+        (WebCore::ResourceResponse::doPlatformCopyData):
+        (WebCore::ResourceResponse::doPlatformAdopt):
+        * platform/network/chromium/ResourceResponse.h:
+        (WebCore::ResourceResponse::ResourceResponse):
+        (WebCore::ResourceResponse::remoteIPAddress):
+        (WebCore::ResourceResponse::setRemoteIPAddress):
+        (WebCore::ResourceResponse::remotePort):
+        (WebCore::ResourceResponse::setRemotePort):
+
 2011-02-16  Dominic Mazzoni  <dmazzoni@google.com>
 
         Reviewed by Chris Fleizach.
index fc8ac6226d598c2e34ba84230065f12c226603a8..5614fd756f4f1d196254d0036bd10848e4251d7b 100644 (file)
@@ -39,7 +39,8 @@ PassOwnPtr<CrossThreadResourceResponseData> ResourceResponse::doPlatformCopyData
     data->m_wasAlternateProtocolAvailable = m_wasAlternateProtocolAvailable;
     data->m_wasFetchedViaProxy = m_wasFetchedViaProxy;
     data->m_responseTime = m_responseTime;
-    data->m_socketAddress = m_socketAddress;
+    data->m_remoteIPAddress = m_remoteIPAddress;
+    data->m_remotePort = m_remotePort;
     data->m_downloadFilePath = m_downloadFilePath;
     return data;
 }
@@ -55,7 +56,8 @@ 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;
+    m_remoteIPAddress = data->m_remoteIPAddress;
+    m_remotePort = data->m_remotePort;
     m_downloadFilePath = data->m_downloadFilePath;
 }
 
index 35f13d14c524bb1d255ad754662feb08f6a9cb13..b7313d4c051c613478953917271a500ebb4efda9 100644 (file)
@@ -44,6 +44,7 @@ namespace WebCore {
             , m_wasAlternateProtocolAvailable(false)
             , m_wasFetchedViaProxy(false)
             , m_responseTime(0)
+            , m_remotePort(0)
         {
         }
 
@@ -57,6 +58,7 @@ namespace WebCore {
             , m_wasAlternateProtocolAvailable(false)
             , m_wasFetchedViaProxy(false)
             , m_responseTime(0)
+            , m_remotePort(0)
         {
         }
 
@@ -96,8 +98,11 @@ 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; }
+        const String& remoteIPAddress() const { return m_remoteIPAddress; }
+        void setRemoteIPAddress(const String& value) { m_remoteIPAddress = value; }
+
+        unsigned short remotePort() const { return m_remotePort; }
+        void setRemotePort(unsigned short value) { m_remotePort = value; }
 
         const String& downloadFilePath() const { return m_downloadFilePath; }
         void setDownloadFilePath(const String& downloadFilePath) { m_downloadFilePath = downloadFilePath; }
@@ -150,9 +155,11 @@ namespace WebCore {
         // 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;
+        // Remote IP address of the socket which fetched this resource.
+        String m_remoteIPAddress;
+
+        // Remote port number of the socket which fetched this resource.
+        unsigned short m_remotePort;
 
         // The path to the downloaded file.
         String m_downloadFilePath;
@@ -168,7 +175,8 @@ namespace WebCore {
         bool m_wasAlternateProtocolAvailable;
         bool m_wasFetchedViaProxy;
         double m_responseTime;
-        String m_socketAddress;
+        String m_remoteIPAddress;
+        unsigned short m_remotePort;
         String m_downloadFilePath;
     };
 
index 32262103fdfde194160ce6434c4fac7a8eeaae06..62a49dbfd8e6d6e34bad2c3dfa5f309637f774f5 100644 (file)
@@ -1,3 +1,19 @@
+2011-02-16  Brian Ryner  <bryner@chromium.org>
+
+        Reviewed by Darin Fisher.
+
+        Split the socket address field into separate IP address and port fields.
+        This will make the field less error-prone to parse, for example when
+        dealing with IPv6 literals.
+        https://bugs.webkit.org/show_bug.cgi?id=54607
+
+        * public/WebURLResponse.h:
+        * src/WebURLResponse.cpp:
+        (WebKit::WebURLResponse::remoteIPAddress):
+        (WebKit::WebURLResponse::setRemoteIPAddress):
+        (WebKit::WebURLResponse::remotePort):
+        (WebKit::WebURLResponse::setRemotePort):
+
 2011-02-16  Dominic Mazzoni  <dmazzoni@google.com>
 
         Reviewed by Chris Fleizach.
index 4ecee17756d2fa3d8a5a78c2948bfb9e761d1eea..e6235689faee319317823fcfa85ad68a0692dc2c 100644 (file)
@@ -169,10 +169,13 @@ 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&);
+    // Remote IP address of the socket which fetched this resource.
+    WEBKIT_API WebString remoteIPAddress() const;
+    WEBKIT_API void setRemoteIPAddress(const WebString&);
+
+    // Remote port number of the socket which fetched this resource.
+    WEBKIT_API unsigned short remotePort() const;
+    WEBKIT_API void setRemotePort(unsigned short);
 
 protected:
     void assign(WebURLResponsePrivate*);
index 79172981ed9b333aa8e3ad09685e49a5003d242b..e39abf2d5b8ebd97d93d53bbc9bd79babb03feb7 100644 (file)
@@ -384,14 +384,24 @@ void WebURLResponse::setDownloadFilePath(const WebString& downloadFilePath)
     m_private->m_downloadFilePath = downloadFilePath;
 }
 
-WebString WebURLResponse::socketAddress() const
+WebString WebURLResponse::remoteIPAddress() const
 {
-    return m_private->m_resourceResponse->socketAddress();
+    return m_private->m_resourceResponse->remoteIPAddress();
 }
 
-void WebURLResponse::setSocketAddress(const WebString& socketAddress)
+void WebURLResponse::setRemoteIPAddress(const WebString& remoteIPAddress)
 {
-    m_private->m_resourceResponse->setSocketAddress(socketAddress);
+    m_private->m_resourceResponse->setRemoteIPAddress(remoteIPAddress);
+}
+
+unsigned short WebURLResponse::remotePort() const
+{
+    return m_private->m_resourceResponse->remotePort();
+}
+
+void WebURLResponse::setRemotePort(unsigned short remotePort)
+{
+    m_private->m_resourceResponse->setRemotePort(remotePort);
 }
 
 void WebURLResponse::assign(WebURLResponsePrivate* p)