diff options
author | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-29 04:45:02 +0000 |
---|---|---|
committer | darin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-29 04:45:02 +0000 |
commit | 926360f6381d34fbb61d3383e52dbc7d34fbfa5f (patch) | |
tree | 3e8f418c2b114859967bfab739e2e8f7c72ce7b0 /content/browser/renderer_host/sync_resource_handler.h | |
parent | cc2386c4e2a249c1dc8f55890c8f3c16a6a9d346 (diff) | |
download | chromium_src-926360f6381d34fbb61d3383e52dbc7d34fbfa5f.zip chromium_src-926360f6381d34fbb61d3383e52dbc7d34fbfa5f.tar.gz chromium_src-926360f6381d34fbb61d3383e52dbc7d34fbfa5f.tar.bz2 |
Rewrite guts of ResourceLoader and BufferedResourceHandler to
suck less.
The key change is to the pause/resume behavior. ResourceHandlers
are now expected to consume events they receive. They can only
defer subsequent processing. It used to be the case that pausing
during OnReadCompleted would lead to repeating the call to
OnReadCompleted when resumed. This was quite problematic for
chained ResourceHandlers.
BufferedResourceHandler is now the ResourceController for its
downstream ResourceHandler. This enables the ResourceLoader and
the BufferedResourceHandler to be more cleanly decoupled. The
BufferedResourceHandler buffers network events, determines the
mime type of the response, selects the appropriate downstream
ResourceHandler, and then it replays the network events. It can
now do this independently of the ResourceLoader state machine.
OnReadCompleted no longer has an in/out bytes_read parameter.
This was used before in a very complicated way by the
BufferedResourceHandler to effect the bytes_read parameter of
future calls to OnReadCompleted (see the now deleted
ResourceLoader::paused_bytes_read_ member variable).
ResourceLoader gets a lot simpler and loses a lot of state
variables. It no longer needs to track things like pause_count_
or paused_read_bytes_. is_paused_, called_on_response_started_
and has_started_reading_ are all subsumed by deferred_stage_.
BufferedResourceLoader is modified extensively to hopefully
separate out the states more logically. It now advances through
buffering (withholds events from the downstream handler),
processing (detects mime type and selects downstream handler),
replaying (feeding downstream handler with buffered events) and
finally streaming (acts like a simple pass-through) states.
R=jam@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10578055
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144873 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/sync_resource_handler.h')
-rw-r--r-- | content/browser/renderer_host/sync_resource_handler.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/content/browser/renderer_host/sync_resource_handler.h b/content/browser/renderer_host/sync_resource_handler.h index f60f2e1..e99b8bc 100644 --- a/content/browser/renderer_host/sync_resource_handler.h +++ b/content/browser/renderer_host/sync_resource_handler.h @@ -52,7 +52,7 @@ class SyncResourceHandler : public ResourceHandler { int* buf_size, int min_size) OVERRIDE; virtual bool OnReadCompleted(int request_id, - int* bytes_read, + int bytes_read, bool* defer) OVERRIDE; virtual bool OnResponseCompleted(int request_id, const net::URLRequestStatus& status, |