summaryrefslogtreecommitdiffstats
path: root/chrome_frame/urlmon_url_request.h
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-08 21:20:51 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-08 21:20:51 +0000
commitf628e1b444c32ad882a3e57bc0d58170cec716ef (patch)
tree3a7fd25a9e5b19e622ddb946c72dbe4c072af820 /chrome_frame/urlmon_url_request.h
parentee82ec3dc0180187107c616b3a8c690215350a44 (diff)
downloadchromium_src-f628e1b444c32ad882a3e57bc0d58170cec716ef.zip
chromium_src-f628e1b444c32ad882a3e57bc0d58170cec716ef.tar.gz
chromium_src-f628e1b444c32ad882a3e57bc0d58170cec716ef.tar.bz2
The cache object used by the UrlmonUrlRequest class in ChromeFrame creates an in memory stream, which is used
to hold data received from Urlmon until Chrome reads it. At times attempts to write to this stream fail with E_OUTOFMEMORY. We don't really need the complexity of an in memory stream for our cache. A vector of bytes would do just fine. This fixes bug http://code.google.com/p/chromium/issues/detail?id=28658 I verified that it actually fixes this issue. Bug=28648 Test=covered by existing net tests. Review URL: http://codereview.chromium.org/469014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34086 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request.h')
-rw-r--r--chrome_frame/urlmon_url_request.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/chrome_frame/urlmon_url_request.h b/chrome_frame/urlmon_url_request.h
index fc98e8f..d4abee5 100644
--- a/chrome_frame/urlmon_url_request.h
+++ b/chrome_frame/urlmon_url_request.h
@@ -215,24 +215,22 @@ END_MSG_MAP()
// size less than 2GB
class Cache {
public:
- bool Create();
-
// Adds data to the end of the cache.
bool Append(IStream* source, size_t* bytes_copied);
// Reads from the cache.
bool Read(IStream* dest, size_t size, size_t* bytes_copied);
- size_t Size();
- size_t CurrentPos();
- size_t SizeRemaining();
- void Clear();
+ // Returns the size of the cache.
+ size_t Size() const;
+
+ // Returns true if the cache has valid data.
bool is_valid() const {
- return (stream_ != NULL);
+ return Size() != 0;
}
protected:
- ScopedComPtr<IStream> stream_;
+ std::vector<byte> cache_;
char read_buffer_[kCopyChunkSize];
};