diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-25 04:49:58 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-25 04:49:58 +0000 |
commit | c868a1e1ecc2cdcf7e9fec93fee4189d4950f3c4 (patch) | |
tree | d11b0e453470e2925ea4af3235b953ecbc2fcdab | |
parent | 54f35df0033974caffe108258cfa8392819368f3 (diff) | |
download | chromium_src-c868a1e1ecc2cdcf7e9fec93fee4189d4950f3c4.zip chromium_src-c868a1e1ecc2cdcf7e9fec93fee4189d4950f3c4.tar.gz chromium_src-c868a1e1ecc2cdcf7e9fec93fee4189d4950f3c4.tar.bz2 |
Relanding this as this broke chrome frame net tests as we were not sending the response for the initial
request initiated by IE. We need to check whether the request id on the initial request is -1
before deciding whether we should send over a response to Chrome.
ChromeFrame would fail to load the page correctly if a manifest was specified in the html tag.
This would work the first time and fail on subsequent attempts. Basically the manifest specifies
portions of the website that is cached locally. In this case when there is a subsequent navigation
to the original URL the cached resource can be served out of the appcache which lives in chrome.
ChromeFrame expects the first url request from chrome to match that of the url which the user
navigated to. This url is served out of chrome'a app cache thus causing the pending url reques
checks to fail.
Fix is to validate the pending url request with the request received and stop the pending request
if there is no match. We just trace the fact and stop this request. A new request object is
created to handle the request received and life goes on.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=76439
BUG=76439
TEST=manually as described in the bug.
TBR=amit
Review URL: http://codereview.chromium.org/6736022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79369 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome_frame/urlmon_url_request.cc | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index 652361c..c50f01b 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -851,7 +851,7 @@ void UrlmonUrlRequest::NotifyDelegateAndDie() { delegate_ = NULL; ReleaseBindings(); TerminateTransaction(); - if (delegate) { + if (delegate && id() != -1) { net::URLRequestStatus result = status_.get_result(); delegate->OnResponseEnd(id(), result); } else { @@ -995,22 +995,22 @@ void UrlmonUrlRequestManager::StartRequest(int request_id, bool is_started = false; if (pending_request_) { if (pending_request_->url() != request_info.url) { - DLOG(WARNING) << __FUNCTION__ - << "Received unexpected url request for url:" - << request_info.url - << ".Pending url request for url:" - << pending_request_->url() - << " was expected."; - net::URLRequestStatus result; - result.set_status(net::URLRequestStatus::FAILED); - OnResponseEnd(request_id, result); - return; + DLOG(INFO) << __FUNCTION__ + << "Received url request for url:" + << request_info.url + << ". Stopping pending url request for url:" + << pending_request_->url(); + pending_request_->Stop(); + pending_request_ = NULL; + } else { + new_request.swap(pending_request_); + is_started = true; + DVLOG(1) << __FUNCTION__ << new_request->me() + << " assigned id " << request_id; } - new_request.swap(pending_request_); - is_started = true; - DVLOG(1) << __FUNCTION__ << new_request->me() - << " assigned id " << request_id; - } else { + } + + if (!is_started) { CComObject<UrlmonUrlRequest>* created_request = NULL; CComObject<UrlmonUrlRequest>::CreateInstance(&created_request); new_request = created_request; |