Chromium Code Reviews| Index: content/public/browser/resource_dispatcher_host_interceptor.h |
| diff --git a/content/public/browser/resource_dispatcher_host_interceptor.h b/content/public/browser/resource_dispatcher_host_interceptor.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..953df282d2215905cf2bca8e6027d0f1b944f43a |
| --- /dev/null |
| +++ b/content/public/browser/resource_dispatcher_host_interceptor.h |
| @@ -0,0 +1,46 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_INTERCEPTOR_H_ |
| +#define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_INTERCEPTOR_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/callback.h" |
| +#include "base/macros.h" |
| +#include "content/common/content_export.h" |
| + |
| +namespace content { |
| + |
| +class ResourceContext; |
| + |
| +// This class defines an interceptor for the ResourceDispatcherHost. Callers |
| +// can implement this interface and register it with the ResourceDispatcherHost |
| +// instance, which will then call methods on this class at various stages of a |
| +// URL request. Currently only HTTP header based interceptors are supported. |
| +class CONTENT_EXPORT ResourceDispatcherHostInterceptor { |
| + public: |
| + typedef base::Callback<void(bool, int)> OnHeaderProcessedCallback; |
| + |
| + ResourceDispatcherHostInterceptor(); |
| + |
| + // This callback is invoked when a header which the interceptor has registered |
| + // for is found. The contract here is that the caller has to wait for the |
| + // processing to finish which will be signaled via a call to the |callback| |
| + // function. |
| + virtual void OnHttpHeaderReceived(const std::string& header, |
| + const std::string& value, |
| + int child_process_id, |
| + content::ResourceContext* resource_context, |
| + OnHeaderProcessedCallback callback); |
|
jam
2016/08/09 01:36:24
per https://www.chromium.org/developers/content-mo
ananta
2016/08/09 05:47:48
This could be a callback. Just thinking out aloud,
|
| + |
| + protected: |
| + virtual ~ResourceDispatcherHostInterceptor(); |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostInterceptor); |
| +}; |
| + |
| +} // namespace content. |
| + |
| +#endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_INTERCEPTOR_H_ |