Index: content/public/browser/resource_dispatcher_host.h |
diff --git a/content/public/browser/resource_dispatcher_host.h b/content/public/browser/resource_dispatcher_host.h |
index 3bdd0cae132f4bb9dbd61c3066db169bf5e1bbf0..bcd6d2ab022f0670da86d274e77c0c9286618411 100644 |
--- a/content/public/browser/resource_dispatcher_host.h |
+++ b/content/public/browser/resource_dispatcher_host.h |
@@ -8,6 +8,7 @@ |
#include <stdint.h> |
#include <memory> |
+#include <string> |
#include "base/callback_forward.h" |
#include "content/common/content_export.h" |
@@ -21,6 +22,7 @@ namespace content { |
class DownloadItem; |
class ResourceContext; |
class ResourceDispatcherHostDelegate; |
+class ResourceDispatcherHostInterceptor; |
struct DownloadSaveInfo; |
struct Referrer; |
class RenderFrameHost; |
@@ -51,6 +53,25 @@ class CONTENT_EXPORT ResourceDispatcherHost { |
// Clears the ResourceDispatcherHostLoginDelegate associated with the request. |
virtual void ClearLoginDelegateForRequest(net::URLRequest* request) = 0; |
+ // Registers the |interceptor| for the |http_header| passed in. |
+ // The |starts_with| parameter is used to match the prefix of the |
+ // |http_header| in the response and the interceptor will be invoked if there |
+ // is a match. If the |starts_with| parameter is empty, the interceptor will |
+ // be invoked for every occurrence of the |http_header|. |
+ // Currently only HTTP header based interceptors are supported. |
+ // In the future to register a generic interceptor, we could pass in empty |
+ // strings for the |http_header| and |starts_with| parameters. |
+ // At the moment we only support one interceptor per |http_header|. |
+ virtual void RegisterInterceptor( |
+ const std::string& http_header, |
+ const std::string& starts_with, |
+ ResourceDispatcherHostInterceptor* interceptor) = 0; |
+ |
+ // Unregisters the |interceptor| for the |http_header| passed in. |
+ virtual void UnregisterInterceptor( |
jam
2016/08/09 01:36:24
I think we don't need this? e.g. if we get rid of
ananta
2016/08/09 05:47:48
Lets talk about this tomorrow. I was wondering whe
jam
2016/08/09 19:58:41
The motivation is that eventually RDH will be the
ananta
2016/08/09 23:35:19
Done.
|
+ const std::string& http_header, |
+ ResourceDispatcherHostInterceptor* interceptor) = 0; |
+ |
protected: |
virtual ~ResourceDispatcherHost() {} |
}; |