diff options
author | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-22 19:47:19 +0000 |
---|---|---|
committer | bryner@chromium.org <bryner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-22 19:47:19 +0000 |
commit | 6d81b488e8cc5e10eaeca0a4ee4819dc3f469a24 (patch) | |
tree | e628aa40ac26d26a6a9a46374001be983e7a7f41 /webkit | |
parent | f19572134235f4cceb76e85e1c064ba668bbd3bd (diff) | |
download | chromium_src-6d81b488e8cc5e10eaeca0a4ee4819dc3f469a24.zip chromium_src-6d81b488e8cc5e10eaeca0a4ee4819dc3f469a24.tar.gz chromium_src-6d81b488e8cc5e10eaeca0a4ee4819dc3f469a24.tar.bz2 |
Propagate the remote socket address to URLRequest and to ViewHostMsg_FrameNavigate.
This will be used to run pre-classification checks for client-side phishing
detection, and will also enable the socket address to be exposed via the
webRequest extension API. This is adapted from the original patch by pmarks
on http://codereview.chromium.org/6369003/ .
BUG=51663
TEST=added socket address checks to various unittests
Review URL: http://codereview.chromium.org/6488010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75620 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r-- | webkit/glue/resource_loader_bridge.h | 4 | ||||
-rw-r--r-- | webkit/glue/weburlloader_impl.cc | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/webkit/glue/resource_loader_bridge.h b/webkit/glue/resource_loader_bridge.h index 23ebb35..e12f142 100644 --- a/webkit/glue/resource_loader_bridge.h +++ b/webkit/glue/resource_loader_bridge.h @@ -31,6 +31,7 @@ #include "base/time.h" #include "base/values.h" #include "googleurl/src/gurl.h" +#include "net/base/host_port_pair.h" #include "net/url_request/url_request_status.h" #include "webkit/glue/resource_type.h" @@ -182,6 +183,9 @@ struct ResourceResponseInfo { // transparent proxy). The proxy could be any type of proxy, HTTP or SOCKS. // Note: we cannot tell if a transparent proxy may have been involved. bool was_fetched_via_proxy; + + // Remote address of the socket which fetched this resource. + net::HostPortPair socket_address; }; class ResourceLoaderBridge { diff --git a/webkit/glue/weburlloader_impl.cc b/webkit/glue/weburlloader_impl.cc index d4b5162..e461ca9 100644 --- a/webkit/glue/weburlloader_impl.cc +++ b/webkit/glue/weburlloader_impl.cc @@ -187,6 +187,9 @@ void PopulateURLResponse( response->setWasAlternateProtocolAvailable( info.was_alternate_protocol_available); response->setWasFetchedViaProxy(info.was_fetched_via_proxy); + response->setRemoteIPAddress( + WebString::fromUTF8(info.socket_address.host())); + response->setRemotePort(info.socket_address.port()); response->setConnectionID(info.connection_id); response->setConnectionReused(info.connection_reused); response->setDownloadFilePath(FilePathToWebString(info.download_file_path)); |