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

Side by Side Diff: net/disk_cache/tracing_cache_backend.h

Issue 20737002: Change the API of disk_cache::CreateCacheBackend to use scoped_ptr (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new test Created 7 years, 4 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
« no previous file with comments | « net/disk_cache/mem_backend_impl.cc ('k') | net/disk_cache/tracing_cache_backend.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_CACHE_BACKEND_H_
6 #define NET_DISK_CACHE_TRACING_CACHE_BACKEND_H_ 6 #define NET_DISK_CACHE_TRACING_CACHE_BACKEND_H_
7 7
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "net/disk_cache/disk_cache.h" 9 #include "net/disk_cache/disk_cache.h"
10 #include "net/disk_cache/stats.h" 10 #include "net/disk_cache/stats.h"
11 11
12 namespace disk_cache { 12 namespace disk_cache {
13 13
14 class EntryProxy; 14 class EntryProxy;
15 15
16 // The TracingCacheBackend implements the Cache Backend interface. It intercepts 16 // The TracingCacheBackend implements the Cache Backend interface. It intercepts
17 // all backend operations from the IO thread and records the time from the start 17 // all backend operations from the IO thread and records the time from the start
18 // of the operation until the result is delivered. 18 // of the operation until the result is delivered.
19 class NET_EXPORT TracingCacheBackend : public Backend, 19 class NET_EXPORT TracingCacheBackend : public Backend,
20 public base::SupportsWeakPtr<TracingCacheBackend> { 20 public base::SupportsWeakPtr<TracingCacheBackend> {
21 public: 21 public:
22 explicit TracingCacheBackend(Backend* backend); 22 explicit TracingCacheBackend(scoped_ptr<Backend> backend);
23 23
24 virtual net::CacheType GetCacheType() const OVERRIDE; 24 virtual net::CacheType GetCacheType() const OVERRIDE;
25 virtual int32 GetEntryCount() const OVERRIDE; 25 virtual int32 GetEntryCount() const OVERRIDE;
26 virtual int OpenEntry(const std::string& key, Entry** entry, 26 virtual int OpenEntry(const std::string& key, Entry** entry,
27 const CompletionCallback& callback) OVERRIDE; 27 const CompletionCallback& callback) OVERRIDE;
28 virtual int CreateEntry(const std::string& key, Entry** entry, 28 virtual int CreateEntry(const std::string& key, Entry** entry,
29 const CompletionCallback& callback) OVERRIDE; 29 const CompletionCallback& callback) OVERRIDE;
30 virtual int DoomEntry(const std::string& key, 30 virtual int DoomEntry(const std::string& key,
31 const CompletionCallback& callback) OVERRIDE; 31 const CompletionCallback& callback) OVERRIDE;
32 virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE; 32 virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 scoped_ptr<Backend> backend_; 72 scoped_ptr<Backend> backend_;
73 typedef std::map<Entry*, EntryProxy*> EntryToProxyMap; 73 typedef std::map<Entry*, EntryProxy*> EntryToProxyMap;
74 EntryToProxyMap open_entries_; 74 EntryToProxyMap open_entries_;
75 75
76 DISALLOW_COPY_AND_ASSIGN(TracingCacheBackend); 76 DISALLOW_COPY_AND_ASSIGN(TracingCacheBackend);
77 }; 77 };
78 78
79 } // namespace disk_cache 79 } // namespace disk_cache
80 80
81 #endif // NET_DISK_CACHE_TRACING_CACHE_BACKEND_H_ 81 #endif // NET_DISK_CACHE_TRACING_CACHE_BACKEND_H_
OLDNEW
« no previous file with comments | « net/disk_cache/mem_backend_impl.cc ('k') | net/disk_cache/tracing_cache_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698