Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1119)

Unified Diff: content/browser/renderer_host/redirect_to_file_resource_handler.h

Issue 10828024: Let RedirectToFileResourceHandler resize its internal buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/redirect_to_file_resource_handler.h
diff --git a/content/browser/renderer_host/redirect_to_file_resource_handler.h b/content/browser/renderer_host/redirect_to_file_resource_handler.h
index 17b27383699ee2f7a269fb78a80f5e9c56874061..b33b212cb24686fc43fbb9d11306ed70149dd50a 100644
--- a/content/browser/renderer_host/redirect_to_file_resource_handler.h
+++ b/content/browser/renderer_host/redirect_to_file_resource_handler.h
@@ -82,6 +82,13 @@ class RedirectToFileResourceHandler : public LayeredResourceHandler {
scoped_ptr<net::FileStream> file_stream_;
bool write_callback_pending_;
+ // |next_buffer_size_| is the size of the buffer to be allocated on the next
+ // OnWillRead() call. We exponentially grow the size of the buffer allocated
+ // when our owner fills our buffers. On the first OnWillRead() call, we
+ // allocate a buffer of 32k and double it in OnReadCompleted() if the buffer
+ // was filled, up to a maximum size of 512k.
+ int next_buffer_size_;
+
// We create a ShareableFileReference that's deletable for the temp
// file created as a result of the download.
scoped_refptr<webkit_blob::ShareableFileReference> deletable_file_;

Powered by Google App Engine
This is Rietveld 408576698