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

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

Issue 2563163002: Add some tests for ThrottlingResourceHandler. (Closed)
Patch Set: Merge 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
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 7095b090b99d471e05c0cb4776df80c06b72d181..6238ebb4d93319ffc0eabf51e79f9b13cd0c6fa8 100644
--- a/content/browser/loader/throttling_resource_handler.cc
+++ b/content/browser/loader/throttling_resource_handler.cc
@@ -7,7 +7,6 @@
#include <utility>
#include "content/browser/loader/resource_controller.h"
-#include "content/browser/loader/resource_request_info_impl.h"
#include "content/public/common/resource_response.h"
#include "net/url_request/url_request.h"
@@ -123,7 +122,12 @@ void ThrottlingResourceHandler::CancelWithError(int error_code) {
}
void ThrottlingResourceHandler::Resume() {
- DCHECK(!cancelled_by_resource_throttle_);
+ // Throttles expect to be able to cancel requests out-of-band, so just do
+ // nothing if one request resumes after another cancels. Can't even recognize
+ // out-of-band cancels and for synchronous teardown, since don't know if the
+ // currently active throttle called Cancel() or if it was another one.
Randy Smith (Not in Mondays) 2016/12/20 22:16:41 I'd really like to understand this use case better
mmenke 2017/01/04 22:02:29 I was wrong about NavigationResourceThrottle (It's
mmenke 2017/01/05 18:50:00 Sorry, I was wrong. For the problematic case, hav
Randy Smith (Not in Mondays) 2017/01/11 19:57:15 Oh, what a mess. Ok. * For purposes of this CL,
+ if (cancelled_by_resource_throttle_)
+ return;
DeferredStage last_deferred_stage = deferred_stage_;
deferred_stage_ = DEFERRED_NONE;

Powered by Google App Engine
This is Rietveld 408576698