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,48 @@ |
+// 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_ |
+#pragma once |
+ |
+#include <set> |
+#include <vector> |
gavinp
2012/07/11 23:39:46
Remove unneeded headers.
frankwang
2012/07/12 01:50:36
Done.
|
+ |
+#include "content/browser/renderer_host/layered_resource_handler.h" |
+ |
+namespace net { |
+class URLRequest; |
+} |
+ |
+namespace content{ |
+ |
+class DuplicateResourceHandler: public LayeredResourceHandler{ |
gavinp
2012/07/11 23:39:46
Nit: space before {. Same throughout this CL.
frankwang
2012/07/12 01:50:36
Done.
|
+ |
+ public: |
+ DuplicateResourceHandler(scoped_ptr<ResourceHandler> next_handler, |
+ net::URLRequest* request); |
gavinp
2012/07/11 23:39:46
Nit: indent
frankwang
2012/07/12 01:50:36
Done.
|
+ virtual ~DuplicateResourceHandler(); |
+ |
+ 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, |
+ bool* defer) OVERRIDE; |
+ |
+ int bytes_hit_; // bytes that hit element in cache |
+ int bytes_miss_; // bytes that miss element in cache |
+ int read_buffer_size_; |
+ scoped_refptr<net::IOBuffer> read_buffer_; |
gavinp
2012/07/11 23:39:46
Include base/memory/ref_counted.h for this. Also,
frankwang
2012/07/12 01:50:36
Done.
|
+ net::URLRequest* request_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DuplicateResourceHandler); |
+}; // class DuplicateResourceHandler |
gavinp
2012/07/11 23:39:46
Nit: two spaces before //. Same issue throughout t
frankwang
2012/07/12 01:50:36
Done.
|
+ |
+} // namespace content |
+ |
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_RESOURCE_HANDLER_H_ |