diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 22:02:27 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 22:02:27 +0000 |
commit | 7ae80749da2e8caa8155984be0970ac20a42a04a (patch) | |
tree | 68aaa7a0af783451f54916bafe39734bbbe18d3e /chrome_frame/urlmon_url_request_private.h | |
parent | 3ca335b4eb7ecbe1fb2de5ecec2742e85d87d096 (diff) | |
download | chromium_src-7ae80749da2e8caa8155984be0970ac20a42a04a.zip chromium_src-7ae80749da2e8caa8155984be0970ac20a42a04a.tar.gz chromium_src-7ae80749da2e8caa8155984be0970ac20a42a04a.tar.bz2 |
Fix for a race issue when chrome decides that a request needs to be downloaded by the host browser.
Before the request could under some circumstances be terminated before we handed it over to the host for download.
In such cases we would just drop the request and not download anything.
TEST=Fixes flakyness of _some_ download scenarios. This is only a part of a fix needed for the related bug.
BUG=36694
Review URL: http://codereview.chromium.org/1240004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42673 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request_private.h')
-rw-r--r-- | chrome_frame/urlmon_url_request_private.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome_frame/urlmon_url_request_private.h b/chrome_frame/urlmon_url_request_private.h index 10dcedf..596c099c 100644 --- a/chrome_frame/urlmon_url_request_private.h +++ b/chrome_frame/urlmon_url_request_private.h @@ -32,7 +32,7 @@ class UrlmonUrlRequest // Special function needed by ActiveDocument::Load() HRESULT SetRequestData(RequestData* data); - // Used from "OnDownloadRequestInHost". + // Used from "DownloadRequestInHost". void StealMoniker(IMoniker** moniker); // Parent Window for UrlMon error dialogs @@ -98,7 +98,6 @@ class UrlmonUrlRequest protected: void ReleaseBindings(); - static const size_t kCopyChunkSize = 32 * 1024; // A fake stream class to make it easier to copy received data using // IStream::CopyTo instead of allocating temporary buffers and keeping // track of data copied so far. @@ -177,7 +176,10 @@ class UrlmonUrlRequest // Manage data caching. Note: this class supports cache // size less than 2GB class Cache { - public: + public: + Cache() { + } + // Adds data to the end of the cache. bool Append(IStream* source, size_t* bytes_copied); @@ -192,9 +194,8 @@ class UrlmonUrlRequest return Size() != 0; } - protected: + protected: std::vector<byte> cache_; - char read_buffer_[kCopyChunkSize]; }; HRESULT StartAsyncDownload(); |