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

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

Issue 2535723005: Stop using ResourceController in ResourceThrottle (Closed)
Patch Set: Addressed #62 Created 4 years 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 cf8ad2247c1f47a9dceb633080ab22195ab27a2f..f0574073306acc401c68b365531cccf4e6db39b5 100644
--- a/content/browser/loader/throttling_resource_handler.cc
+++ b/content/browser/loader/throttling_resource_handler.cc
@@ -7,7 +7,7 @@
#include <utility>
#include "content/browser/loader/resource_request_info_impl.h"
-#include "content/public/browser/resource_throttle.h"
+#include "content/public/browser/resource_controller.h"
#include "content/public/common/resource_response.h"
#include "net/url_request/url_request.h"
@@ -23,7 +23,7 @@ ThrottlingResourceHandler::ThrottlingResourceHandler(
next_index_(0),
cancelled_by_resource_throttle_(false) {
for (size_t i = 0; i < throttles_.size(); ++i) {
- throttles_[i]->set_controller(this);
+ throttles_[i]->set_delegate(this);
// Throttles must have a name, as otherwise, bugs where a throttle fails
// to resume a request can be very difficult to debug.
DCHECK(throttles_[i]->GetNameForLogging());
@@ -38,8 +38,8 @@ bool ThrottlingResourceHandler::OnRequestRedirected(
ResourceResponse* response,
bool* defer) {
DCHECK(!cancelled_by_resource_throttle_);
+ DCHECK(!*defer);
- *defer = false;
while (next_index_ < throttles_.size()) {
int index = next_index_;
throttles_[index]->WillRedirectRequest(redirect_info, defer);
@@ -47,7 +47,7 @@ bool ThrottlingResourceHandler::OnRequestRedirected(
if (cancelled_by_resource_throttle_)
return false;
if (*defer) {
- OnRequestDefered(index);
+ OnRequestDeferred(index);
deferred_stage_ = DEFERRED_REDIRECT;
deferred_redirect_ = redirect_info;
deferred_response_ = response;
@@ -62,8 +62,8 @@ bool ThrottlingResourceHandler::OnRequestRedirected(
bool ThrottlingResourceHandler::OnWillStart(const GURL& url, bool* defer) {
DCHECK(!cancelled_by_resource_throttle_);
+ DCHECK(!*defer);
- *defer = false;
while (next_index_ < throttles_.size()) {
int index = next_index_;
throttles_[index]->WillStartRequest(defer);
@@ -71,7 +71,7 @@ bool ThrottlingResourceHandler::OnWillStart(const GURL& url, bool* defer) {
if (cancelled_by_resource_throttle_)
return false;
if (*defer) {
- OnRequestDefered(index);
+ OnRequestDeferred(index);
deferred_stage_ = DEFERRED_START;
deferred_url_ = url;
return true; // Do not cancel.
@@ -86,6 +86,7 @@ bool ThrottlingResourceHandler::OnWillStart(const GURL& url, bool* defer) {
bool ThrottlingResourceHandler::OnResponseStarted(ResourceResponse* response,
bool* defer) {
DCHECK(!cancelled_by_resource_throttle_);
+ DCHECK(!*defer);
while (next_index_ < throttles_.size()) {
int index = next_index_;
@@ -94,7 +95,7 @@ bool ThrottlingResourceHandler::OnResponseStarted(ResourceResponse* response,
if (cancelled_by_resource_throttle_)
return false;
if (*defer) {
- OnRequestDefered(index);
+ OnRequestDeferred(index);
deferred_stage_ = DEFERRED_RESPONSE;
deferred_response_ = response;
return true; // Do not cancel.
@@ -188,7 +189,7 @@ void ThrottlingResourceHandler::ResumeResponse() {
}
}
-void ThrottlingResourceHandler::OnRequestDefered(int throttle_index) {
+void ThrottlingResourceHandler::OnRequestDeferred(int throttle_index) {
request()->LogBlockedBy(throttles_[throttle_index]->GetNameForLogging());
}
« 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