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,58 @@ |
+// 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 "googleurl/src/gurl.h" |
gavinp
2012/07/18 12:13:32
lose this include.
frankwang
2012/07/19 16:10:26
Done.
|
+#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, |
gavinp
2012/07/18 12:13:32
You're not using this. Lose the parameter if you d
frankwang
2012/07/19 16:10:26
Done.
|
+ net::URLRequest* request); |
+ virtual ~DuplicateResourceHandler(); |
+ |
+ private: |
+ |
gavinp
2012/07/18 12:13:32
lose this blank line.
frankwang
2012/07/19 16:10:26
Done.
|
+ // 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; |
+ virtual bool OnResponseCompleted(int request_id, |
+ const net::URLRequestStatus& status, |
+ const std::string& security_info) OVERRIDE; |
+ |
+ ResourceType::Type resource_type_; |
+ uint32 ph1_; |
+ uint32 pcarry_; |
gavinp
2012/07/18 12:13:32
I'm not a fan of either of these names. I know the
frankwang
2012/07/19 16:10:26
Done.
|
+ int buffer_size_; |
gavinp
2012/07/18 12:13:32
Move this next to read_buffer_.
frankwang
2012/07/19 16:10:26
I deleted the buffer_size_. I never use it anywher
|
+ int bytes_read_; |
+ scoped_refptr<net::IOBuffer> read_buffer_; |
gavinp
2012/07/18 12:13:32
You could use an IOBuffer* here safely I believe.
|
+ net::URLRequest* request_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(DuplicateResourceHandler); |
+}; // class DuplicateResourceHandler |
gavinp
2012/07/18 12:13:32
For short classes, we don't need this comment.
frankwang
2012/07/19 16:10:26
Done.
|
+ |
+} // namespace content |
+ |
gavinp
2012/07/18 12:13:32
Extra blank line.
frankwang
2012/07/19 16:10:26
Done.
|
+ |
+#endif // CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_RESOURCE_HANDLER_H_ |