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

Unified Diff: webkit/appcache/appcache_disk_cache.h

Issue 8991001: base::Bind: Convert most of webkit/appcache. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clang fix. Created 9 years 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: webkit/appcache/appcache_disk_cache.h
diff --git a/webkit/appcache/appcache_disk_cache.h b/webkit/appcache/appcache_disk_cache.h
index f5259c278779f13c305fe004bb1fa89581597d93..069127c40d3c859658b42c1a8e1609d6e07b402b 100644
--- a/webkit/appcache/appcache_disk_cache.h
+++ b/webkit/appcache/appcache_disk_cache.h
@@ -27,22 +27,22 @@ class APPCACHE_EXPORT AppCacheDiskCache
int InitWithDiskBackend(const FilePath& disk_cache_directory,
int disk_cache_size, bool force,
base::MessageLoopProxy* cache_thread,
- net::OldCompletionCallback* callback);
+ const net::CompletionCallback& callback);
// Initializes the object to use memory only storage.
// This is used for Chrome's incognito browsing.
int InitWithMemBackend(int disk_cache_size,
- net::OldCompletionCallback* callback);
+ const net::CompletionCallback& callback);
void Disable();
bool is_disabled() const { return is_disabled_; }
virtual int CreateEntry(int64 key, Entry** entry,
- net::OldCompletionCallback* callback) OVERRIDE;
+ const net::CompletionCallback& callback) OVERRIDE;
virtual int OpenEntry(int64 key, Entry** entry,
- net::OldCompletionCallback* callback) OVERRIDE;
+ const net::CompletionCallback& callback) OVERRIDE;
virtual int DoomEntry(int64 key,
- net::OldCompletionCallback* callback) OVERRIDE;
+ const net::CompletionCallback& callback) OVERRIDE;
private:
class EntryImpl;
@@ -76,13 +76,23 @@ class APPCACHE_EXPORT AppCacheDiskCache
PendingCallType call_type;
int64 key;
Entry** entry;
- net::OldCompletionCallback* callback;
+ net::CompletionCallback callback;
PendingCall()
- : call_type(CREATE), key(0), entry(NULL), callback(NULL) {}
+ : call_type(CREATE),
+ key(0),
+ entry(NULL) {
+ }
+
PendingCall(PendingCallType call_type, int64 key,
- Entry** entry, net::OldCompletionCallback* callback)
- : call_type(call_type), key(key), entry(entry), callback(callback) {}
+ Entry** entry, const net::CompletionCallback& callback)
+ : call_type(call_type),
+ key(key),
+ entry(entry),
+ callback(callback) {
+ }
+
+ ~PendingCall();
};
typedef std::vector<PendingCall> PendingCalls;
@@ -95,13 +105,13 @@ class APPCACHE_EXPORT AppCacheDiskCache
disk_cache::Backend* disk_cache() { return disk_cache_.get(); }
int Init(net::CacheType cache_type, const FilePath& directory,
int cache_size, bool force, base::MessageLoopProxy* cache_thread,
- net::OldCompletionCallback* callback);
+ const net::CompletionCallback& callback);
void OnCreateBackendComplete(int rv);
void AddActiveCall(ActiveCall* call) { active_calls_.insert(call); }
void RemoveActiveCall(ActiveCall* call) { active_calls_.erase(call); }
bool is_disabled_;
- net::OldCompletionCallback* init_callback_;
+ net::CompletionCallback init_callback_;
scoped_refptr<CreateBackendCallback> create_backend_callback_;
PendingCalls pending_calls_;
ActiveCalls active_calls_;

Powered by Google App Engine
This is Rietveld 408576698