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