summaryrefslogtreecommitdiffstats
path: root/chrome_frame/urlmon_url_request.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 20:42:51 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-24 20:42:51 +0000
commit0d282c2e73b39d58ed920177dd53211238dbd211 (patch)
tree82ae5fc3f6a5e8a5a1ff8b34c58a815bc617f787 /chrome_frame/urlmon_url_request.cc
parent56235c632f18380a4455b6ea113cd6e2a2df0d69 (diff)
downloadchromium_src-0d282c2e73b39d58ed920177dd53211238dbd211.zip
chromium_src-0d282c2e73b39d58ed920177dd53211238dbd211.tar.gz
chromium_src-0d282c2e73b39d58ed920177dd53211238dbd211.tar.bz2
Fix for the HTTPSGetTest and GetTest net test failures with ChromeFrame. These failures occurred
because of new expectations in these tests which match the server ip address and port being connected to. We need to return that information from ChromeFrame. Fix is to send over the corresponding HostPortPair structure in the AutomationMsg_RequestStarted IPC message. A major part of this CL is basically the groundwork to pass this information over via automation. BUG=none TEST=chrome frame net tests should pass. Review URL: http://codereview.chromium.org/6575027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75942 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request.cc')
-rw-r--r--chrome_frame/urlmon_url_request.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index c803263..92ee33c 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -52,6 +52,10 @@ bool UrlmonUrlRequest::Start() {
DCHECK(thread_ == 0 || thread_ == base::PlatformThread::CurrentId());
thread_ = base::PlatformThread::CurrentId();
status_.Start();
+ // Initialize the net::HostPortPair structure from the url initially. We may
+ // not receive the ip address of the host if the request is satisfied from
+ // the cache.
+ socket_address_ = net::HostPortPair::FromURL(GURL(url()));
// The UrlmonUrlRequest instance can get destroyed in the context of
// StartAsyncDownload if BindToStorage finishes synchronously with an error.
// Grab a reference to protect against this.
@@ -282,6 +286,13 @@ STDMETHODIMP UrlmonUrlRequest::OnProgress(ULONG progress, ULONG max_progress,
}
switch (status_code) {
+ case BINDSTATUS_CONNECTING: {
+ if (status_text) {
+ socket_address_.set_host(WideToUTF8(status_text));
+ }
+ break;
+ }
+
case BINDSTATUS_REDIRECTING: {
// If we receive a redirect for the initial pending request initiated
// when our document loads we should stash it away and inform Chrome
@@ -666,7 +677,8 @@ STDMETHODIMP UrlmonUrlRequest::OnResponse(DWORD dwResponseCode,
0, // size
base::Time(), // last_modified
status_.get_redirection().utf8_url,
- status_.get_redirection().http_code);
+ status_.get_redirection().http_code,
+ socket_address_);
return S_OK;
}
@@ -1158,13 +1170,13 @@ void UrlmonUrlRequestManager::StopAll() {
void UrlmonUrlRequestManager::OnResponseStarted(int request_id,
const char* mime_type, const char* headers, int size,
base::Time last_modified, const std::string& redirect_url,
- int redirect_status) {
+ int redirect_status, const net::HostPortPair& socket_address) {
DCHECK_NE(request_id, -1);
DVLOG(1) << __FUNCTION__;
DCHECK(LookupRequest(request_id) != NULL);
++calling_delegate_;
delegate_->OnResponseStarted(request_id, mime_type, headers, size,
- last_modified, redirect_url, redirect_status);
+ last_modified, redirect_url, redirect_status, socket_address);
--calling_delegate_;
}