commit | 5584eab1352afd0d2db7fa856fbbc886522e1732 | [log] [tgz] |
---|---|---|
author | [email protected] <[email protected]@0039d316-1c4b-4281-b951-d872f2087c98> | Thu Jan 09 22:16:15 2014 |
committer | [email protected] <[email protected]@0039d316-1c4b-4281-b951-d872f2087c98> | Thu Jan 09 22:16:15 2014 |
tree | 61df6d86bbd692659b4a7910c5954a5fd5251eed | |
parent | aa52489e2c6c7637c1d8c34424b5e1576dae7705 [diff] [blame] |
Adds the new URLRequest::OnBeforeNetworkStart hook to the ResourceThrottle so that the ResourceScheduler can eventually throttle closer to the start of network usage. This is the second step in the design doc: https://docs.google.com/document/d/1TSI3jwozVB_nueWJxzi8uKbgDfsGZRZqw8tvtD-P1Iw/edit?usp=sharing The third step is to create the new ResourceScheduler. BUG=328741 Review URL: https://codereview.chromium.org/129173002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243994 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/loader/detachable_resource_handler.cc b/content/browser/loader/detachable_resource_handler.cc index 7cc7b09d..42c7d1f1 100644 --- a/content/browser/loader/detachable_resource_handler.cc +++ b/content/browser/loader/detachable_resource_handler.cc
@@ -133,6 +133,20 @@ return ret; } +bool DetachableResourceHandler::OnBeforeNetworkStart(int request_id, + const GURL& url, + bool* defer) { + DCHECK(!is_deferred_); + + if (!next_handler_) + return true; + + bool ret = + next_handler_->OnBeforeNetworkStart(request_id, url, &is_deferred_); + *defer = is_deferred_; + return ret; +} + bool DetachableResourceHandler::OnWillRead(int request_id, scoped_refptr<net::IOBuffer>* buf, int* buf_size,