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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_INTERCEPTOR_H_
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_INTERCEPTOR_H_
7
8 #include <string>
9
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "content/common/content_export.h"
13
14 namespace content {
15
16 class ResourceContext;
17
18 // This class defines an interceptor for the ResourceDispatcherHost. Callers
19 // can implement this interface and register it with the ResourceDispatcherHost
20 // instance, which will then call methods on this class at various stages of a
21 // URL request. Currently only HTTP header based interceptors are supported.
22 class CONTENT_EXPORT ResourceDispatcherHostInterceptor {
23 public:
24 typedef base::Callback<void(bool, int)> OnHeaderProcessedCallback;
25
26 ResourceDispatcherHostInterceptor();
27
28 // This callback is invoked when a header which the interceptor has registered
29 // for is found. The contract here is that the caller has to wait for the
30 // processing to finish which will be signaled via a call to the |callback|
31 // function.
32 virtual void OnHttpHeaderReceived(const std::string& header,
33 const std::string& value,
34 int child_process_id,
35 content::ResourceContext* resource_context,
36 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,
37
38 protected:
39 virtual ~ResourceDispatcherHostInterceptor();
40
41 DISALLOW_COPY_AND_ASSIGN(ResourceDispatcherHostInterceptor);
42 };
43
44 } // namespace content.
45
46 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_INTERCEPTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698