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

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: Changes for second full pass-through 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
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 public:
24 DuplicateResourceHandler(scoped_ptr<ResourceHandler> next_handler,
25 ResourceType::Type resource_type,
26 net::URLRequest* request);
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,
36 int bytes_read,
37 bool* defer) OVERRIDE;
38 virtual bool OnResponseCompleted(int request_id,
39 const net::URLRequestStatus& status,
40 const std::string& security_info) OVERRIDE;
41
42 ResourceType::Type resource_type_;
43 int bytes_read_;
44 scoped_refptr<net::IOBuffer> read_buffer_;
45 net::URLRequest* request_;
46
47 // These values are temporary values that are used in each digest of the
48 // inputs for the incremental hash (PMurHash).
49 uint32 pmurhash_ph1_;
50 uint32 pmurhash_pcarry_;
51
52 DISALLOW_COPY_AND_ASSIGN(DuplicateResourceHandler);
53 };
54
55 } // namespace content
56
57 #endif // CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_RESOURCE_HANDLER_H_
58
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698