| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 // be called for this request. | 56 // be called for this request. |
| 57 void OnServedFromCache(const HttpResponseInfo* response); | 57 void OnServedFromCache(const HttpResponseInfo* response); |
| 58 | 58 |
| 59 private: | 59 private: |
| 60 friend class InfiniteCache; | 60 friend class InfiniteCache; |
| 61 struct ResourceData; | 61 struct ResourceData; |
| 62 void Finish(); | 62 void Finish(); |
| 63 | 63 |
| 64 base::WeakPtr<InfiniteCache> cache_; | 64 base::WeakPtr<InfiniteCache> cache_; |
| 65 scoped_ptr<ResourceData> resource_data_; | 65 scoped_ptr<ResourceData> resource_data_; |
| 66 bool must_doom_entry_; | |
| 67 DISALLOW_COPY_AND_ASSIGN(InfiniteCacheTransaction); | 66 DISALLOW_COPY_AND_ASSIGN(InfiniteCacheTransaction); |
| 68 }; | 67 }; |
| 69 | 68 |
| 70 // An InfiniteCache is paired with an HttpCache instance to simulate an infinite | 69 // An InfiniteCache is paired with an HttpCache instance to simulate an infinite |
| 71 // backend storage. | 70 // backend storage. |
| 72 class NET_EXPORT_PRIVATE InfiniteCache | 71 class NET_EXPORT_PRIVATE InfiniteCache |
| 73 : public base::SupportsWeakPtr<InfiniteCache> { | 72 : public base::SupportsWeakPtr<InfiniteCache> { |
| 74 public: | 73 public: |
| 75 InfiniteCache(); | 74 InfiniteCache(); |
| 76 ~InfiniteCache(); | 75 ~InfiniteCache(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 scoped_refptr<base::SequencedWorkerPool> worker_pool_; | 110 scoped_refptr<base::SequencedWorkerPool> worker_pool_; |
| 112 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 111 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
| 113 base::RepeatingTimer<InfiniteCache> timer_; | 112 base::RepeatingTimer<InfiniteCache> timer_; |
| 114 | 113 |
| 115 DISALLOW_COPY_AND_ASSIGN(InfiniteCache); | 114 DISALLOW_COPY_AND_ASSIGN(InfiniteCache); |
| 116 }; | 115 }; |
| 117 | 116 |
| 118 } // namespace net | 117 } // namespace net |
| 119 | 118 |
| 120 #endif // NET_HTTP_INFINITE_CACHE_H_ | 119 #endif // NET_HTTP_INFINITE_CACHE_H_ |
| OLD | NEW |