OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_DELEGATE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "webkit/glue/resource_type.h" |
12 | 13 |
13 class GURL; | 14 class GURL; |
14 class ResourceDispatcherHostLoginDelegate; | 15 class ResourceDispatcherHostLoginDelegate; |
15 class ResourceHandler; | 16 class ResourceHandler; |
16 class ResourceMessageFilter; | 17 class ResourceMessageFilter; |
17 struct ResourceHostMsg_Request; | |
18 struct ResourceResponse; | 18 struct ResourceResponse; |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 class ResourceContext; | 21 class ResourceContext; |
22 } | 22 } |
23 | 23 |
24 namespace net { | 24 namespace net { |
25 class AuthChallengeInfo; | 25 class AuthChallengeInfo; |
26 class SSLCertRequestInfo; | 26 class SSLCertRequestInfo; |
27 class URLRequest; | 27 class URLRequest; |
28 } | 28 } |
29 | 29 |
30 namespace content { | 30 namespace content { |
31 | 31 |
32 // Interface that the embedder provides to ResourceDispatcherHost to allow | 32 // Interface that the embedder provides to ResourceDispatcherHost to allow |
33 // observing and modifying requests. | 33 // observing and modifying requests. |
34 class ResourceDispatcherHostDelegate { | 34 class ResourceDispatcherHostDelegate { |
35 public: | 35 public: |
36 // Called when a request begins. Return false to abort the request. | 36 // Called when a request begins. Return false to abort the request. |
37 virtual bool ShouldBeginRequest( | 37 virtual bool ShouldBeginRequest( |
38 int child_id, int route_id, | 38 int child_id, |
39 const ResourceHostMsg_Request& request_data, | 39 int route_id, |
| 40 const std::string& method, |
| 41 const GURL& url, |
| 42 ResourceType::Type resource_type, |
40 const content::ResourceContext& resource_context, | 43 const content::ResourceContext& resource_context, |
41 const GURL& referrer) = 0; | 44 const GURL& referrer) = 0; |
42 | 45 |
43 // Called after ShouldBeginRequest when all the resource handlers from the | 46 // Called after ShouldBeginRequest when all the resource handlers from the |
44 // content layer have been added. To add new handlers to the front, return | 47 // content layer have been added. To add new handlers to the front, return |
45 // a new handler that is chained to the given one, otherwise just reutrn the | 48 // a new handler that is chained to the given one, otherwise just reutrn the |
46 // given handler. | 49 // given handler. |
47 virtual ResourceHandler* RequestBeginning( | 50 virtual ResourceHandler* RequestBeginning( |
48 ResourceHandler* handler, | 51 ResourceHandler* handler, |
49 net::URLRequest* request, | 52 net::URLRequest* request, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 ResourceMessageFilter* filter) = 0; | 120 ResourceMessageFilter* filter) = 0; |
118 | 121 |
119 protected: | 122 protected: |
120 ResourceDispatcherHostDelegate() {} | 123 ResourceDispatcherHostDelegate() {} |
121 virtual ~ResourceDispatcherHostDelegate() {} | 124 virtual ~ResourceDispatcherHostDelegate() {} |
122 }; | 125 }; |
123 | 126 |
124 } // namespace content | 127 } // namespace content |
125 | 128 |
126 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 129 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
OLD | NEW |