OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_RESOURCE_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_RESOURCE_HANDLER_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "base/memory/ref_counted.h" |
| 11 #include "content/browser/renderer_host/layered_resource_handler.h" |
| 12 #include "webkit/glue/resource_type.h" |
| 13 |
| 14 namespace net { |
| 15 class IOBuffer; |
| 16 class URLRequest; |
| 17 class URLRequestStatus; |
| 18 } |
| 19 |
| 20 namespace content { |
| 21 |
| 22 class DuplicateResourceHandler: public LayeredResourceHandler { |
| 23 |
| 24 public: |
| 25 DuplicateResourceHandler(scoped_ptr<ResourceHandler> next_handler, |
| 26 ResourceType::Type resource_type); |
| 27 virtual ~DuplicateResourceHandler(); |
| 28 |
| 29 private: |
| 30 // ResourceHandler implementation |
| 31 virtual bool OnWillRead(int request_id, |
| 32 net::IOBuffer** buf, |
| 33 int* buf_size, |
| 34 int min_size) OVERRIDE; |
| 35 virtual bool OnReadCompleted(int request_id, int bytes_read, |
| 36 bool* defer) OVERRIDE; |
| 37 virtual bool OnResponseCompleted(int request_id, |
| 38 const net::URLRequestStatus& status, |
| 39 const std::string& security_info) OVERRIDE; |
| 40 |
| 41 ResourceType::Type resource_type_; |
| 42 uint32 pmurhash_ph1_; |
| 43 uint32 pmurhash_pcarry_; |
| 44 int bytes_read_; |
| 45 scoped_refptr<net::IOBuffer> read_buffer_; |
| 46 net::URLRequest* request_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(DuplicateResourceHandler); |
| 49 }; |
| 50 |
| 51 } // namespace content |
| 52 |
| 53 #endif // CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_RESOURCE_HANDLER_H_ |
OLD | NEW |