Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(186)

Side by Side Diff: content/browser/renderer_host/duplicate_resource_handler.h

Issue 10701151: DuplicateContentResourceHandler to monitor resources and track how many times th… (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 #pragma once
8
9 #include <set>
gavinp 2012/07/13 21:16:04 You don't need this one, either. Move it to the .c
10
11 #include "base/memory/ref_counted.h"
12 #include "content/browser/renderer_host/layered_resource_handler.h"
13
14 namespace net {
15 class URLRequest;
16 class IOBuffer;
17 }
18
19 namespace content {
20
21 class DuplicateResourceHandler: public LayeredResourceHandler {
22
23 public:
24 DuplicateResourceHandler(scoped_ptr<ResourceHandler> next_handler,
25 net::URLRequest* request);
26 virtual ~DuplicateResourceHandler();
27
28 private:
29 // ResourceHandler implementation
30 virtual bool OnWillRead(int request_id,
31 net::IOBuffer** buf,
32 int* buf_size,
33 int min_size) OVERRIDE;
34 virtual bool OnReadCompleted(int request_id, int bytes_read,
35 bool* defer) OVERRIDE;
36
37 int bytes_hit_; // bytes that hit element in cache
gavinp 2012/07/13 21:16:04 Nit: two spaces before //.
38 int bytes_miss_; // bytes that miss element in cache
39 int read_buffer_size_;
40 scoped_refptr<net::IOBuffer> read_buffer_;
41 net::URLRequest* request_;
42
43 DISALLOW_COPY_AND_ASSIGN(DuplicateResourceHandler);
44 }; // class DuplicateResourceHandler
45
46 } // namespace content
47
48
49 #endif // CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_RESOURCE_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698