OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #ifndef NET_DISK_CACHE_TRACING_CACHE_BACKEND_H_ | 5 #ifndef NET_DISK_CACHE_TRACING_TRACING_CACHE_BACKEND_H_ |
6 #define NET_DISK_CACHE_TRACING_CACHE_BACKEND_H_ | 6 #define NET_DISK_CACHE_TRACING_TRACING_CACHE_BACKEND_H_ |
7 | 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/memory/scoped_ptr.h" |
8 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
| 12 #include "net/disk_cache/blockfile/stats.h" |
9 #include "net/disk_cache/disk_cache.h" | 13 #include "net/disk_cache/disk_cache.h" |
10 #include "net/disk_cache/stats.h" | |
11 | 14 |
12 namespace disk_cache { | 15 namespace disk_cache { |
13 | 16 |
14 class EntryProxy; | 17 class EntryProxy; |
15 | 18 |
16 // The TracingCacheBackend implements the Cache Backend interface. It intercepts | 19 // The TracingCacheBackend implements the Cache Backend interface. It intercepts |
17 // all backend operations from the IO thread and records the time from the start | 20 // all backend operations from the IO thread and records the time from the start |
18 // of the operation until the result is delivered. | 21 // of the operation until the result is delivered. |
19 class NET_EXPORT TracingCacheBackend : public Backend, | 22 class NET_EXPORT TracingCacheBackend : public Backend, |
20 public base::SupportsWeakPtr<TracingCacheBackend> { | 23 public base::SupportsWeakPtr<TracingCacheBackend> { |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 74 |
72 scoped_ptr<Backend> backend_; | 75 scoped_ptr<Backend> backend_; |
73 typedef std::map<Entry*, EntryProxy*> EntryToProxyMap; | 76 typedef std::map<Entry*, EntryProxy*> EntryToProxyMap; |
74 EntryToProxyMap open_entries_; | 77 EntryToProxyMap open_entries_; |
75 | 78 |
76 DISALLOW_COPY_AND_ASSIGN(TracingCacheBackend); | 79 DISALLOW_COPY_AND_ASSIGN(TracingCacheBackend); |
77 }; | 80 }; |
78 | 81 |
79 } // namespace disk_cache | 82 } // namespace disk_cache |
80 | 83 |
81 #endif // NET_DISK_CACHE_TRACING_CACHE_BACKEND_H_ | 84 #endif // NET_DISK_CACHE_TRACING_TRACING_CACHE_BACKEND_H_ |
OLD | NEW |