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

Unified Diff: chrome/browser/renderer_host/async_resource_handler.h

Issue 331001: When sending resources across the IPC barrier, use increasing sized buffers. (Closed)
Patch Set: Created 11 years, 2 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: chrome/browser/renderer_host/async_resource_handler.h
diff --git a/chrome/browser/renderer_host/async_resource_handler.h b/chrome/browser/renderer_host/async_resource_handler.h
index 17e9260ff5f8512c5da3a7dc6cc2522132ed4806..b946d4d70a8b7dc5979961d6e1dc823fd7427d8b 100644
--- a/chrome/browser/renderer_host/async_resource_handler.h
+++ b/chrome/browser/renderer_host/async_resource_handler.h
@@ -46,6 +46,12 @@ class AsyncResourceHandler : public ResourceHandler {
base::ProcessHandle process_handle_;
ResourceDispatcherHost* rdh_;
+ // We exponentially grow the size of the buffer allocated. On the first
+ // OnWillRead() call, we allocate a buffer of 32k and double it on each
+ // subsequent call, up to a maximum size of 512k. |next_buffer_size_| is the
+ // size of the buffer to be allocated on the next OnWillRead() call.
+ int next_buffer_size_;
+
DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler);
};

Powered by Google App Engine
This is Rietveld 408576698