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

Unified Diff: net/disk_cache/backend_impl.h

Issue 9702059: Disk cache: Remove all non essential synchronization from the cache destructor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | « no previous file | net/disk_cache/backend_impl.cc » ('j') | net/disk_cache/disk_cache.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/backend_impl.h
===================================================================
--- net/disk_cache/backend_impl.h (revision 126788)
+++ net/disk_cache/backend_impl.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -56,10 +56,10 @@
int max_bytes, net::CacheType type,
uint32 flags, base::MessageLoopProxy* thread,
net::NetLog* net_log, Backend** backend,
- const net::CompletionCallback& callback);
+ const CompletionCallback& callback);
// Performs general initialization for this current instance of the cache.
- int Init(const net::CompletionCallback& callback);
+ int Init(const CompletionCallback& callback);
// Performs the actual initialization and final cleanup on destruction.
int SyncInit();
@@ -67,7 +67,7 @@
// Same behavior as OpenNextEntry but walks the list from back to front.
int OpenPrevEntry(void** iter, Entry** prev_entry,
- const net::CompletionCallback& callback);
+ const CompletionCallback& callback);
// Synchronous implementation of the asynchronous interface.
int SyncOpenEntry(const std::string& key, Entry** entry);
@@ -100,9 +100,8 @@
// Returns the actual file used to store a given (non-external) address.
MappedFile* File(Addr address);
- InFlightBackendIO* background_queue() {
- return &background_queue_;
- }
+ // Returns a weak pointer to the background queue.
+ base::WeakPtr<InFlightBackendIO> GetBackgroundQueue();
// Creates an external storage file.
bool CreateExternalFile(Addr* address);
@@ -238,12 +237,12 @@
void ClearRefCountForTest();
// Sends a dummy operation through the operation queue, for unit tests.
- int FlushQueueForTest(const net::CompletionCallback& callback);
+ int FlushQueueForTest(const CompletionCallback& callback);
// Runs the provided task on the cache thread. The task will be automatically
// deleted after it runs.
int RunTaskForTest(const base::Closure& task,
- const net::CompletionCallback& callback);
+ const CompletionCallback& callback);
// Trims an entry (all if |empty| is true) from the list of deleted
// entries. This method should be called directly on the cache thread.
@@ -260,21 +259,19 @@
// Backend implementation.
virtual int32 GetEntryCount() const OVERRIDE;
virtual int OpenEntry(const std::string& key, Entry** entry,
- const net::CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) OVERRIDE;
virtual int CreateEntry(const std::string& key, Entry** entry,
- const net::CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) OVERRIDE;
virtual int DoomEntry(const std::string& key,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual int DoomAllEntries(const net::CompletionCallback& callback) OVERRIDE;
- virtual int DoomEntriesBetween(
- const base::Time initial_time,
- const base::Time end_time,
- const net::CompletionCallback& callback) OVERRIDE;
- virtual int DoomEntriesSince(
- const base::Time initial_time,
- const net::CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) OVERRIDE;
+ virtual int DoomAllEntries(const CompletionCallback& callback) OVERRIDE;
+ virtual int DoomEntriesBetween(const base::Time initial_time,
+ const base::Time end_time,
+ const CompletionCallback& callback) OVERRIDE;
+ virtual int DoomEntriesSince(const base::Time initial_time,
+ const CompletionCallback& callback) OVERRIDE;
virtual int OpenNextEntry(void** iter, Entry** next_entry,
- const net::CompletionCallback& callback) OVERRIDE;
+ const CompletionCallback& callback) OVERRIDE;
virtual void EndEnumeration(void** iter) OVERRIDE;
virtual void GetStats(StatsItems* stats) OVERRIDE;
virtual void OnExternalCacheHit(const std::string& key) OVERRIDE;
« no previous file with comments | « no previous file | net/disk_cache/backend_impl.cc » ('j') | net/disk_cache/disk_cache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698