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

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

Issue 2563163002: Add some tests for ThrottlingResourceHandler. (Closed)
Patch Set: Add comments Created 3 years, 11 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/loader/throttling_resource_handler.cc
diff --git a/content/browser/loader/throttling_resource_handler.cc b/content/browser/loader/throttling_resource_handler.cc
index e12ab0f18226c3bee250279ee20a99d5009ab434..0c1ed65e25d2965173797bf9e12cd07a55a00769 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.
+ if (cancelled_by_resource_throttle_)
+ return;
DeferredStage last_deferred_stage = deferred_stage_;
deferred_stage_ = DEFERRED_NONE;
« no previous file with comments | « content/browser/loader/throttling_resource_handler.h ('k') | content/browser/loader/throttling_resource_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698