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