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

Unified Diff: content/public/browser/resource_throttle.h

Issue 2005273002: Move MimeTypeResourceHandler before ThrottlingResourceHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added missing file 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
Index: content/public/browser/resource_throttle.h
diff --git a/content/public/browser/resource_throttle.h b/content/public/browser/resource_throttle.h
index 7a980f2a21691357e111eeebdf469ffc317c6c63..731d8b8efaa531e6130c1b6895ac4699cb2a458d 100644
--- a/content/public/browser/resource_throttle.h
+++ b/content/public/browser/resource_throttle.h
@@ -5,6 +5,8 @@
#ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_THROTTLE_H_
#define CONTENT_PUBLIC_BROWSER_RESOURCE_THROTTLE_H_
+#include "content/common/content_export.h"
+
namespace net {
struct RedirectInfo;
}
@@ -20,7 +22,7 @@ class ThrottlingResourceHandler;
// resource load. The ResourceController interface may be used to resume a
// deferred resource load, or it may be used to cancel a resource load at any
// time.
-class ResourceThrottle {
+class CONTENT_EXPORT ResourceThrottle {
public:
virtual ~ResourceThrottle() {}
@@ -42,6 +44,12 @@ class ResourceThrottle {
// returned string.
virtual const char* GetNameForLogging() const = 0;
+ // Whether this ResourceThrottle needs to execute WillProcessResponse before
+ // mime sniffing happens. Normally this is false. This should be set to true
+ // if the ResourceThrottle wants to ensure that no part of the response will
+ // be cached if the request is canceled in WillProcessResponse.
+ virtual bool MustProcessResponseBeforeMimeSniffing();
mmenke 2016/07/27 19:34:01 Could name this be more general? MustProcessRespo
clamy 2016/08/17 12:47:35 Done. To do what you suggest we have two options:
mmenke 2016/08/17 19:53:08 I don't think this is going to happen, reliably -
clamy 2016/08/18 12:01:51 Acknowledged.
+
void set_controller_for_testing(ResourceController* c) {
controller_ = c;
}

Powered by Google App Engine
This is Rietveld 408576698