| OLD | NEW |
| 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_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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 class ResourceThrottle; | 32 class ResourceThrottle; |
| 33 class StreamHandle; | 33 class StreamHandle; |
| 34 struct Referrer; | 34 struct Referrer; |
| 35 struct ResourceResponse; | 35 struct ResourceResponse; |
| 36 | 36 |
| 37 // Interface that the embedder provides to ResourceDispatcherHost to allow | 37 // Interface that the embedder provides to ResourceDispatcherHost to allow |
| 38 // observing and modifying requests. | 38 // observing and modifying requests. |
| 39 class CONTENT_EXPORT ResourceDispatcherHostDelegate { | 39 class CONTENT_EXPORT ResourceDispatcherHostDelegate { |
| 40 public: | 40 public: |
| 41 // Called when a request begins. Return false to abort the request. | 41 // Called when a request begins. Return false to abort the request. |
| 42 virtual bool ShouldBeginRequest(int child_id, | 42 virtual bool ShouldBeginRequest(const std::string& method, |
| 43 int route_id, | |
| 44 const std::string& method, | |
| 45 const GURL& url, | 43 const GURL& url, |
| 46 ResourceType resource_type, | 44 ResourceType resource_type, |
| 47 ResourceContext* resource_context); | 45 ResourceContext* resource_context); |
| 48 | 46 |
| 49 // Called after ShouldBeginRequest to allow the embedder to add resource | 47 // Called after ShouldBeginRequest to allow the embedder to add resource |
| 50 // throttles. | 48 // throttles. |
| 51 virtual void RequestBeginning(net::URLRequest* request, | 49 virtual void RequestBeginning(net::URLRequest* request, |
| 52 ResourceContext* resource_context, | 50 ResourceContext* resource_context, |
| 53 AppCacheService* appcache_service, | 51 AppCacheService* appcache_service, |
| 54 ResourceType resource_type, | 52 ResourceType resource_type, |
| 55 int child_id, | |
| 56 int route_id, | |
| 57 ScopedVector<ResourceThrottle>* throttles); | 53 ScopedVector<ResourceThrottle>* throttles); |
| 58 | 54 |
| 59 // Allows an embedder to add additional resource handlers for a download. | 55 // Allows an embedder to add additional resource handlers for a download. |
| 60 // |must_download| is set if the request must be handled as a download. | 56 // |must_download| is set if the request must be handled as a download. |
| 61 virtual void DownloadStarting(net::URLRequest* request, | 57 virtual void DownloadStarting(net::URLRequest* request, |
| 62 ResourceContext* resource_context, | 58 ResourceContext* resource_context, |
| 63 int child_id, | 59 int child_id, |
| 64 int route_id, | 60 int route_id, |
| 65 int request_id, | 61 int request_id, |
| 66 bool is_content_initiated, | 62 bool is_content_initiated, |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 virtual void RequestComplete(net::URLRequest* url_request); | 118 virtual void RequestComplete(net::URLRequest* url_request); |
| 123 | 119 |
| 124 protected: | 120 protected: |
| 125 ResourceDispatcherHostDelegate(); | 121 ResourceDispatcherHostDelegate(); |
| 126 virtual ~ResourceDispatcherHostDelegate(); | 122 virtual ~ResourceDispatcherHostDelegate(); |
| 127 }; | 123 }; |
| 128 | 124 |
| 129 } // namespace content | 125 } // namespace content |
| 130 | 126 |
| 131 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ | 127 #endif // CONTENT_PUBLIC_BROWSER_RESOURCE_DISPATCHER_HOST_DELEGATE_H_ |
| OLD | NEW |