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,