diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-12 01:15:07 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-12 01:15:07 +0000 |
commit | 5c50ef53508d10638e7d32c059eef5471539d7db (patch) | |
tree | a4da6a78cb4b26f4d629d81a06f53d8422bebabc /chrome_frame | |
parent | a540c2d2927d84f850bbe85c151e79965ae6e29b (diff) | |
download | chromium_src-5c50ef53508d10638e7d32c059eef5471539d7db.zip chromium_src-5c50ef53508d10638e7d32c059eef5471539d7db.tar.gz chromium_src-5c50ef53508d10638e7d32c059eef5471539d7db.tar.bz2 |
ChromeFrame's host network stack implementation for IE should ensure that HTTP requests issued by Chrome
which terminate without any data complete correctly, i.e. we send over the request end notification to
Chrome. This ensures that Chrome does not wait forever for the request to complete.
This fixes http://code.google.com/p/chromium/issues/detail?id=30149, which shows up on certain sites where
the throbber continues to spin at times and at times pages show up blank.
Bug=30149
Test=Launch ChromeFrame in IE and navigate to cf:http://www.tennisballcricket.org. We should not see a
blank page. Will look into a unit test for this.
Review URL: http://codereview.chromium.org/491057
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/urlmon_url_request.cc | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index 2e39bea..49de036 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -214,8 +214,10 @@ STDMETHODIMP UrlmonUrlRequest::OnProgress(ULONG progress, ULONG max_progress, OnResponse(0, UTF8ToWide(headers).c_str(), NULL, NULL); ignore_redirect_stop_binding_error_ = true; DCHECK(binding_ != NULL); - binding_->Abort(); - binding_ = NULL; + if (binding_) { + binding_->Abort(); + binding_ = NULL; + } return E_ABORT; } @@ -244,6 +246,15 @@ STDMETHODIMP UrlmonUrlRequest::OnStopBinding(HRESULT result, LPCWSTR error) { status_.set_status(URLRequestStatus::SUCCESS); status_.set_os_error(0); ReleaseBindings(); + // In most cases we receive the end request notification from Chrome. + // However at times requests can complete without us receiving any + // data. In this case we need to inform Chrome that this request has been + // completed to prevent Chrome from waiting forever for data for this + // request. + if (pending_read_size_) { + pending_read_size_ = 0; + OnResponseEnd(status_); + } } return S_OK; @@ -332,6 +343,7 @@ STDMETHODIMP UrlmonUrlRequest::OnDataAvailable(DWORD flags, DWORD size, cached_data_.Read(&send_stream, pending_read_size_, &pending_read_size_); DLOG(INFO) << StringPrintf("URL: %s Obj: %X", url().c_str(), this) << " - size read: " << pending_read_size_; + pending_read_size_ = 0; } else { DLOG(INFO) << StringPrintf("URL: %s Obj: %X", url().c_str(), this) << " - waiting for remote read"; |