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

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

Issue 2222723002: Avoid calling into the ContentBrowserClient interface from ResourceDispatcherHostImpl to determine … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile failures Created 4 years, 4 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_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_

Powered by Google App Engine
This is Rietveld 408576698