Chromium Code Reviews| Index: content/browser/renderer_host/duplicate_resource_handler.h |
| =================================================================== |
| --- content/browser/renderer_host/duplicate_resource_handler.h (revision 0) |
| +++ content/browser/renderer_host/duplicate_resource_handler.h (revision 0) |
| @@ -0,0 +1,54 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_RESOURCE_HANDLER_H_ |
| +#define CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_RESOURCE_HANDLER_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/memory/ref_counted.h" |
| +#include "content/browser/renderer_host/layered_resource_handler.h" |
| +#include "webkit/glue/resource_type.h" |
| + |
| +namespace net { |
| +class IOBuffer; |
| +class URLRequest; |
| +class URLRequestStatus; |
| +} |
| + |
| +namespace content { |
| + |
| +class DuplicateResourceHandler: public LayeredResourceHandler { |
| + public: |
| + DuplicateResourceHandler(scoped_ptr<ResourceHandler> next_handler, |
| + ResourceType::Type resource_type, |
| + net::URLRequest* request); |
| + virtual ~DuplicateResourceHandler(); |
|
gavinp
2012/07/20 01:37:59
I have no real comment here, except to say that ho
frankwang
2012/07/20 04:50:00
That's an interesting tidbit. Thanks!
|
| + |
| + private: |
| + // ResourceHandler implementation |
| + virtual bool OnWillRead(int request_id, |
| + net::IOBuffer** buf, |
| + int* buf_size, |
| + int min_size) OVERRIDE; |
| + virtual bool OnReadCompleted(int request_id, int bytes_read, |
|
gavinp
2012/07/20 01:37:59
In method definitions, it's either all on one line
frankwang
2012/07/20 04:50:00
Done.
|
| + bool* defer) OVERRIDE; |
| + virtual bool OnResponseCompleted(int request_id, |
| + const net::URLRequestStatus& status, |
| + const std::string& security_info) OVERRIDE; |
| + |
| + ResourceType::Type resource_type_; |
| + uint32 pmurhash_ph1_; |
|
gavinp
2012/07/20 01:37:59
I would like to see these pmumurhash members separ
frankwang
2012/07/20 04:50:00
Done.
|
| + uint32 pmurhash_pcarry_; |
| + int bytes_read_; |
| + scoped_refptr<net::IOBuffer> read_buffer_; |
| + net::URLRequest* request_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DuplicateResourceHandler); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_RESOURCE_HANDLER_H_ |
| + |