OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // DuplicateContentResourceHandler keeps a hash of resources seen and based on | 5 // DuplicateContentResourceHandler keeps a hash of resources seen and based on |
6 // url. It is an experiment meant to simulate cache hits for both a url-based | 6 // url. It is an experiment meant to simulate cache hits for both a url-based |
7 // and a content-based cache. | 7 // and a content-based cache. |
8 | 8 |
9 #ifndef CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_CONTENT_RESOURCE_HANDLER_H_ | 9 #ifndef CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_CONTENT_RESOURCE_HANDLER_H_ |
10 #define CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_CONTENT_RESOURCE_HANDLER_H_ | 10 #define CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_CONTENT_RESOURCE_HANDLER_H_ |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 ResourceType::Type resource_type_; | 49 ResourceType::Type resource_type_; |
50 int bytes_read_; | 50 int bytes_read_; |
51 scoped_refptr<net::IOBuffer> read_buffer_; | 51 scoped_refptr<net::IOBuffer> read_buffer_; |
52 net::URLRequest* request_; | 52 net::URLRequest* request_; |
53 | 53 |
54 // These values are temporary values that are used in each digest of the | 54 // These values are temporary values that are used in each digest of the |
55 // inputs for the incremental hash (PMurHash). | 55 // inputs for the incremental hash (PMurHash). |
56 MH_UINT32 pmurhash_ph1_; | 56 MH_UINT32 pmurhash_ph1_; |
57 MH_UINT32 pmurhash_pcarry_; | 57 MH_UINT32 pmurhash_pcarry_; |
58 | 58 |
| 59 // Used to track if it's a request we're interested in. If it's not, then we |
| 60 // early out to avoid calculating the hash unnecessarily. |
| 61 bool track_request_; |
| 62 |
59 DISALLOW_COPY_AND_ASSIGN(DuplicateContentResourceHandler); | 63 DISALLOW_COPY_AND_ASSIGN(DuplicateContentResourceHandler); |
60 }; | 64 }; |
61 | 65 |
62 } // namespace content | 66 } // namespace content |
63 | 67 |
64 #endif // CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_CONTENT_RESOURCE_HANDLER_H_ | 68 #endif // CONTENT_BROWSER_RENDERER_HOST_DUPLICATE_CONTENT_RESOURCE_HANDLER_H_ |
65 | 69 |
OLD | NEW |