summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-29 04:45:02 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-29 04:45:02 +0000
commit926360f6381d34fbb61d3383e52dbc7d34fbfa5f (patch)
tree3e8f418c2b114859967bfab739e2e8f7c72ce7b0 /native_client_sdk
parentcc2386c4e2a249c1dc8f55890c8f3c16a6a9d346 (diff)
downloadchromium_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 'native_client_sdk')
0 files changed, 0 insertions, 0 deletions