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_BROWSER_RENDERER_HOST_LAYERED_RESOURCE_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_LAYERED_RESOURCE_HANDLER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_LAYERED_RESOURCE_HANDLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_LAYERED_RESOURCE_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "content/browser/renderer_host/resource_handler.h" | 9 #include "content/browser/renderer_host/resource_handler.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 | 11 |
12 namespace content { | 12 namespace content { |
13 | 13 |
14 // A ResourceHandler that simply delegates all calls to a next handler. This | 14 // A ResourceHandler that simply delegates all calls to a next handler. This |
15 // class is intended to be subclassed. | 15 // class is intended to be subclassed. |
16 class CONTENT_EXPORT LayeredResourceHandler : public ResourceHandler { | 16 class CONTENT_EXPORT LayeredResourceHandler : public ResourceHandler { |
17 public: | 17 public: |
18 LayeredResourceHandler(ResourceHandler* next_handler); | 18 LayeredResourceHandler(ResourceHandler* next_handler); |
19 | 19 |
20 // ResourceHandler implementation: | 20 // ResourceHandler implementation: |
21 virtual bool OnUploadProgress(int request_id, uint64 position, | 21 virtual bool OnUploadProgress(int request_id, uint64 position, |
22 uint64 size) OVERRIDE; | 22 uint64 size) OVERRIDE; |
23 virtual bool OnRequestRedirected(int request_id, const GURL& url, | 23 virtual bool OnRequestRedirected(int request_id, const GURL& url, |
24 ResourceResponse* response, | 24 ResourceResponse* response, |
25 bool* defer) OVERRIDE; | 25 bool* defer) OVERRIDE; |
26 virtual bool OnResponseStarted(int request_id, | 26 virtual bool OnResponseStarted(int request_id, |
27 ResourceResponse* response) OVERRIDE; | 27 ResourceResponse* response, |
| 28 bool* defer) OVERRIDE; |
28 virtual bool OnWillStart(int request_id, const GURL& url, | 29 virtual bool OnWillStart(int request_id, const GURL& url, |
29 bool* defer) OVERRIDE; | 30 bool* defer) OVERRIDE; |
30 virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, | 31 virtual bool OnWillRead(int request_id, net::IOBuffer** buf, int* buf_size, |
31 int min_size) OVERRIDE; | 32 int min_size) OVERRIDE; |
32 virtual bool OnReadCompleted(int request_id, int* bytes_read) OVERRIDE; | 33 virtual bool OnReadCompleted(int request_id, int* bytes_read, |
| 34 bool* defer) OVERRIDE; |
33 virtual bool OnResponseCompleted(int request_id, | 35 virtual bool OnResponseCompleted(int request_id, |
34 const net::URLRequestStatus& status, | 36 const net::URLRequestStatus& status, |
35 const std::string& security_info) OVERRIDE; | 37 const std::string& security_info) OVERRIDE; |
36 virtual void OnRequestClosed() OVERRIDE; | 38 virtual void OnRequestClosed() OVERRIDE; |
37 virtual void OnDataDownloaded(int request_id, int bytes_downloaded) OVERRIDE; | 39 virtual void OnDataDownloaded(int request_id, int bytes_downloaded) OVERRIDE; |
38 | 40 |
39 protected: | 41 protected: |
40 virtual ~LayeredResourceHandler(); | 42 virtual ~LayeredResourceHandler(); |
41 | 43 |
42 scoped_refptr<ResourceHandler> next_handler_; | 44 scoped_refptr<ResourceHandler> next_handler_; |
43 }; | 45 }; |
44 | 46 |
45 } // namespace content | 47 } // namespace content |
46 | 48 |
47 #endif // CONTENT_BROWSER_RENDERER_HOST_LAYERED_RESOURCE_HANDLER_H_ | 49 #endif // CONTENT_BROWSER_RENDERER_HOST_LAYERED_RESOURCE_HANDLER_H_ |
OLD | NEW |