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

Unified Diff: content/browser/loader/throttling_resource_handler.cc

Issue 2164113002: Remove ResourceHandler::OnBeforeNetworkStart (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Oops Created 4 years, 5 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
« no previous file with comments | « content/browser/loader/throttling_resource_handler.h ('k') | content/public/browser/resource_throttle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/loader/throttling_resource_handler.cc
diff --git a/content/browser/loader/throttling_resource_handler.cc b/content/browser/loader/throttling_resource_handler.cc
index 99d84e65707138358a311ab4d5eb3de172b5a299..cf8ad2247c1f47a9dceb633080ab22195ab27a2f 100644
--- a/content/browser/loader/throttling_resource_handler.cc
+++ b/content/browser/loader/throttling_resource_handler.cc
@@ -83,30 +83,6 @@ bool ThrottlingResourceHandler::OnWillStart(const GURL& url, bool* defer) {
return next_handler_->OnWillStart(url, defer);
}
-bool ThrottlingResourceHandler::OnBeforeNetworkStart(const GURL& url,
- bool* defer) {
- DCHECK(!cancelled_by_resource_throttle_);
-
- *defer = false;
- while (next_index_ < throttles_.size()) {
- int index = next_index_;
- throttles_[index]->WillStartUsingNetwork(defer);
- next_index_++;
- if (cancelled_by_resource_throttle_)
- return false;
- if (*defer) {
- OnRequestDefered(index);
- deferred_stage_ = DEFERRED_NETWORK_START;
- deferred_url_ = url;
- return true; // Do not cancel.
- }
- }
-
- next_index_ = 0; // Reset for next time.
-
- return next_handler_->OnBeforeNetworkStart(url, defer);
-}
-
bool ThrottlingResourceHandler::OnResponseStarted(ResourceResponse* response,
bool* defer) {
DCHECK(!cancelled_by_resource_throttle_);
@@ -159,9 +135,6 @@ void ThrottlingResourceHandler::Resume() {
case DEFERRED_START:
ResumeStart();
break;
- case DEFERRED_NETWORK_START:
- ResumeNetworkStart();
- break;
case DEFERRED_REDIRECT:
ResumeRedirect();
break;
@@ -185,20 +158,6 @@ void ThrottlingResourceHandler::ResumeStart() {
}
}
-void ThrottlingResourceHandler::ResumeNetworkStart() {
- DCHECK(!cancelled_by_resource_throttle_);
-
- GURL url = deferred_url_;
- deferred_url_ = GURL();
-
- bool defer = false;
- if (!OnBeforeNetworkStart(url, &defer)) {
- controller()->Cancel();
- } else if (!defer) {
- controller()->Resume();
- }
-}
-
void ThrottlingResourceHandler::ResumeRedirect() {
DCHECK(!cancelled_by_resource_throttle_);
« no previous file with comments | « content/browser/loader/throttling_resource_handler.h ('k') | content/public/browser/resource_throttle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698