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

Side by Side Diff: content/public/browser/resource_dispatcher_host.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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 #include <string>
11 12
12 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
13 #include "content/common/content_export.h" 14 #include "content/common/content_export.h"
14 15
15 namespace net { 16 namespace net {
16 class URLRequest; 17 class URLRequest;
17 } 18 }
18 19
19 namespace content { 20 namespace content {
20 21
21 class DownloadItem; 22 class DownloadItem;
22 class ResourceContext; 23 class ResourceContext;
23 class ResourceDispatcherHostDelegate; 24 class ResourceDispatcherHostDelegate;
25 class ResourceDispatcherHostInterceptor;
24 struct DownloadSaveInfo; 26 struct DownloadSaveInfo;
25 struct Referrer; 27 struct Referrer;
26 class RenderFrameHost; 28 class RenderFrameHost;
27 29
28 class CONTENT_EXPORT ResourceDispatcherHost { 30 class CONTENT_EXPORT ResourceDispatcherHost {
29 public: 31 public:
30 // Returns the singleton instance of the ResourceDispatcherHost. 32 // Returns the singleton instance of the ResourceDispatcherHost.
31 static ResourceDispatcherHost* Get(); 33 static ResourceDispatcherHost* Get();
32 34
33 // Causes all new requests for the root RenderFrameHost and its children to be 35 // Causes all new requests for the root RenderFrameHost and its children to be
(...skipping 10 matching lines...) Expand all
44 // delegate have a longer lifetime than the ResourceDispatcherHost. 46 // delegate have a longer lifetime than the ResourceDispatcherHost.
45 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) = 0; 47 virtual void SetDelegate(ResourceDispatcherHostDelegate* delegate) = 0;
46 48
47 // Controls whether third-party sub-content can pop-up HTTP basic auth 49 // Controls whether third-party sub-content can pop-up HTTP basic auth
48 // dialog boxes. 50 // dialog boxes.
49 virtual void SetAllowCrossOriginAuthPrompt(bool value) = 0; 51 virtual void SetAllowCrossOriginAuthPrompt(bool value) = 0;
50 52
51 // Clears the ResourceDispatcherHostLoginDelegate associated with the request. 53 // Clears the ResourceDispatcherHostLoginDelegate associated with the request.
52 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) = 0; 54 virtual void ClearLoginDelegateForRequest(net::URLRequest* request) = 0;
53 55
56 // Registers the |interceptor| for the |http_header| passed in.
57 // The |starts_with| parameter is used to match the prefix of the
58 // |http_header| in the response and the interceptor will be invoked if there
59 // is a match. If the |starts_with| parameter is empty, the interceptor will
60 // be invoked for every occurrence of the |http_header|.
61 // Currently only HTTP header based interceptors are supported.
62 // In the future to register a generic interceptor, we could pass in empty
63 // strings for the |http_header| and |starts_with| parameters.
64 // At the moment we only support one interceptor per |http_header|.
65 virtual void RegisterInterceptor(
66 const std::string& http_header,
67 const std::string& starts_with,
68 ResourceDispatcherHostInterceptor* interceptor) = 0;
69
70 // Unregisters the |interceptor| for the |http_header| passed in.
71 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.
72 const std::string& http_header,
73 ResourceDispatcherHostInterceptor* interceptor) = 0;
74
54 protected: 75 protected:
55 virtual ~ResourceDispatcherHost() {} 76 virtual ~ResourceDispatcherHost() {}
56 }; 77 };
57 78
58 } // namespace content 79 } // namespace content
59 80
60 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_ 81 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698