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

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

Issue 10911297: Modify AsyncResourceHandler to use a single shared memory buffer (in ring (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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/async_resource_handler.h
===================================================================
--- content/browser/renderer_host/async_resource_handler.h (revision 157294)
+++ content/browser/renderer_host/async_resource_handler.h (working copy)
@@ -15,6 +15,7 @@
}
namespace content {
+class ResourceBuffer;
class ResourceDispatcherHostImpl;
class ResourceMessageFilter;
class SharedIOBuffer;
@@ -61,36 +62,26 @@
virtual void OnDataDownloaded(int request_id,
int bytes_downloaded) OVERRIDE;
- static void GlobalCleanup();
-
private:
- // Returns true if it's ok to send the data. If there are already too many
- // data messages pending, it defers the request and returns false. In this
- // case the caller should not send the data.
- void WillSendData(bool* defer);
-
+ bool EnsureResourceBufferIsInitialized();
void ResumeIfDeferred();
- scoped_refptr<SharedIOBuffer> read_buffer_;
+ scoped_refptr<ResourceBuffer> buffer_;
scoped_refptr<ResourceMessageFilter> filter_;
int routing_id_;
net::URLRequest* request_;
ResourceDispatcherHostImpl* rdh_;
- // |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_;
-
// Number of messages we've sent to the renderer that we haven't gotten an
// ACK for. This allows us to avoid having too many messages in flight.
int pending_data_count_;
+ int allocation_size_;
+
bool did_defer_;
bool sent_received_response_msg_;
+ bool sent_first_data_msg_;
DISALLOW_COPY_AND_ASSIGN(AsyncResourceHandler);
};

Powered by Google App Engine
This is Rietveld 408576698