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

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

Issue 10501004: Refactor the guts of ResourceDispatcherHostImpl into a new class named (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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
Index: content/browser/renderer_host/throttling_resource_handler.cc
===================================================================
--- content/browser/renderer_host/throttling_resource_handler.cc (revision 141889)
+++ content/browser/renderer_host/throttling_resource_handler.cc (working copy)
@@ -4,21 +4,18 @@
#include "content/browser/renderer_host/throttling_resource_handler.h"
-#include "content/browser/renderer_host/resource_dispatcher_host_impl.h"
#include "content/public/browser/resource_throttle.h"
#include "content/public/common/resource_response.h"
namespace content {
ThrottlingResourceHandler::ThrottlingResourceHandler(
- ResourceDispatcherHostImpl* host,
scoped_ptr<ResourceHandler> next_handler,
int child_id,
int request_id,
ScopedVector<ResourceThrottle> throttles)
: LayeredResourceHandler(next_handler.Pass()),
deferred_stage_(DEFERRED_NONE),
- host_(host),
child_id_(child_id),
request_id_(request_id),
throttles_(throttles.Pass()),
@@ -96,7 +93,7 @@
}
void ThrottlingResourceHandler::Cancel() {
- host_->CancelRequest(child_id_, request_id_, false);
+ controller()->Cancel();
}
void ThrottlingResourceHandler::Resume() {
@@ -123,9 +120,9 @@
bool defer = false;
if (!OnWillStart(request_id_, url, &defer)) {
- Cancel();
+ controller()->Cancel();
} else if (!defer) {
- host_->StartDeferredRequest(child_id_, request_id_);
+ controller()->Resume();
}
}
@@ -137,9 +134,9 @@
bool defer = false;
if (!OnRequestRedirected(request_id_, new_url, response, &defer)) {
- Cancel();
+ controller()->Cancel();
} else if (!defer) {
- host_->FollowDeferredRedirect(child_id_, request_id_, false, GURL());
+ controller()->Resume();
}
}
@@ -149,9 +146,9 @@
bool defer = false;
if (!OnResponseStarted(request_id_, response, &defer)) {
- Cancel();
+ controller()->Cancel();
} else if (!defer) {
- host_->ResumeDeferredRequest(child_id_, request_id_);
+ controller()->Resume();
}
}

Powered by Google App Engine
This is Rietveld 408576698