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

Unified Diff: net/disk_cache/trace.h

Issue 49027: Disk cache: First pass to make it possible to have... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/disk_cache/stress_cache.cc ('k') | net/disk_cache/trace.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/trace.h
===================================================================
--- net/disk_cache/trace.h (revision 12517)
+++ net/disk_cache/trace.h (working copy)
@@ -13,24 +13,29 @@
#include <vector>
#include "base/basictypes.h"
+#include "base/ref_counted.h"
namespace disk_cache {
// Create and destroy the tracing buffer.
-bool InitTrace(void);
+void InitTrace(void);
void DestroyTrace(void);
-// Simple class to handle the trace buffer lifetime.
-class TraceObject {
+// Simple class to handle the trace buffer lifetime. Any object interested in
+// tracing should keep a reference to the object returned by GetTraceObject().
+class TraceObject : public base::RefCounted<TraceObject> {
+ friend class base::RefCounted<TraceObject>;
public:
+ static TraceObject* GetTraceObject();
+
+ private:
TraceObject() {
InitTrace();
}
+
~TraceObject() {
DestroyTrace();
}
-
- private:
DISALLOW_EVIL_CONSTRUCTORS(TraceObject);
};
« no previous file with comments | « net/disk_cache/stress_cache.cc ('k') | net/disk_cache/trace.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698