| 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 // This is the interface of a simulated infinite cache. The purpose of this | 5 // This is the interface of a simulated infinite cache. The purpose of this |
| 6 // code is to evaluate the performance of an HTTP cache that is not constrained | 6 // code is to evaluate the performance of an HTTP cache that is not constrained |
| 7 // to evict resources. | 7 // to evict resources. |
| 8 | 8 |
| 9 #ifndef NET_HTTP_INFINITE_CACHE_H_ | 9 #ifndef NET_HTTP_INFINITE_CACHE_H_ |
| 10 #define NET_HTTP_INFINITE_CACHE_H_ | 10 #define NET_HTTP_INFINITE_CACHE_H_ |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // every request that goes through the HttpCache. This object is notified when | 36 // every request that goes through the HttpCache. This object is notified when |
| 37 // relevant steps are reached while processing the request. | 37 // relevant steps are reached while processing the request. |
| 38 class NET_EXPORT_PRIVATE InfiniteCacheTransaction { | 38 class NET_EXPORT_PRIVATE InfiniteCacheTransaction { |
| 39 public: | 39 public: |
| 40 explicit InfiniteCacheTransaction(InfiniteCache* cache); | 40 explicit InfiniteCacheTransaction(InfiniteCache* cache); |
| 41 ~InfiniteCacheTransaction(); | 41 ~InfiniteCacheTransaction(); |
| 42 | 42 |
| 43 // Called when a new HttpTransaction is started. | 43 // Called when a new HttpTransaction is started. |
| 44 void OnRequestStart(const HttpRequestInfo* request); | 44 void OnRequestStart(const HttpRequestInfo* request); |
| 45 | 45 |
| 46 // Called when the transaction corresponds to a back navigation. |
| 47 void OnBackForwardNavigation(); |
| 48 |
| 46 // Called when the response headers are available. | 49 // Called when the response headers are available. |
| 47 void OnResponseReceived(const HttpResponseInfo* response); | 50 void OnResponseReceived(const HttpResponseInfo* response); |
| 48 | 51 |
| 49 // Called when the response data is received from the network. | 52 // Called when the response data is received from the network. |
| 50 void OnDataRead(const char* data, int data_len); | 53 void OnDataRead(const char* data, int data_len); |
| 51 | 54 |
| 52 // Called when the resource is marked as truncated by the HttpCache. | 55 // Called when the resource is marked as truncated by the HttpCache. |
| 53 void OnTruncatedResponse(); | 56 void OnTruncatedResponse(); |
| 54 | 57 |
| 55 // Called when the resource is served from the cache, so OnDataRead will not | 58 // Called when the resource is served from the cache, so OnDataRead will not |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 scoped_refptr<base::SequencedWorkerPool> worker_pool_; | 113 scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
| 111 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 114 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 112 base::RepeatingTimer<InfiniteCache> timer_; | 115 base::RepeatingTimer<InfiniteCache> timer_; |
| 113 | 116 |
| 114 DISALLOW_COPY_AND_ASSIGN(InfiniteCache); | 117 DISALLOW_COPY_AND_ASSIGN(InfiniteCache); |
| 115 }; | 118 }; |
| 116 | 119 |
| 117 } // namespace net | 120 } // namespace net |
| 118 | 121 |
| 119 #endif // NET_HTTP_INFINITE_CACHE_H_ | 122 #endif // NET_HTTP_INFINITE_CACHE_H_ |
| OLD | NEW |