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

Unified Diff: net/disk_cache/simple/simple_index.h

Issue 13880016: Make SimpleEntryImpl ref counted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remediation Created 7 years, 8 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
Index: net/disk_cache/simple/simple_index.h
diff --git a/net/disk_cache/simple/simple_index.h b/net/disk_cache/simple/simple_index.h
index 76cf55ff5df6e51e09aad04bc60d82f0856624e6..44fdf1725f55d4c89a32e501d00bbadfd6c8c016 100644
--- a/net/disk_cache/simple/simple_index.h
+++ b/net/disk_cache/simple/simple_index.h
@@ -14,7 +14,7 @@
#include "base/hash_tables.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
+#include "base/threading/thread_checker.h"
#include "base/time.h"
#include "net/base/net_export.h"
@@ -67,15 +67,14 @@ class NET_EXPORT_PRIVATE EntryMetadata {
// This class is not Thread-safe.
class NET_EXPORT_PRIVATE SimpleIndex
- : public base::SupportsWeakPtr<SimpleIndex> {
+ : public base::RefCountedThreadSafe<SimpleIndex> {
+ friend class base::RefCountedThreadSafe<SimpleIndex>;
public:
SimpleIndex(
const scoped_refptr<base::TaskRunner>& cache_thread,
const scoped_refptr<base::TaskRunner>& io_thread,
const base::FilePath& path);
- virtual ~SimpleIndex();
-
void Initialize();
void Insert(const std::string& key);
@@ -105,6 +104,8 @@ class NET_EXPORT_PRIVATE SimpleIndex
private:
typedef base::Callback<void(scoped_ptr<EntrySet>)> IndexCompletionCallback;
+ virtual ~SimpleIndex();
+
static void LoadFromDisk(
const base::FilePath& index_filename,
const scoped_refptr<base::TaskRunner>& io_thread,

Powered by Google App Engine
This is Rietveld 408576698