Chromium Code Reviews| Index: webkit/appcache/appcache_disk_cache.h |
| diff --git a/webkit/appcache/appcache_disk_cache.h b/webkit/appcache/appcache_disk_cache.h |
| index 069127c40d3c859658b42c1a8e1609d6e07b402b..752c28309d09133a1a07f6589aa5e4088fc5fcb6 100644 |
| --- a/webkit/appcache/appcache_disk_cache.h |
| +++ b/webkit/appcache/appcache_disk_cache.h |
| @@ -45,23 +45,9 @@ class APPCACHE_EXPORT AppCacheDiskCache |
| const net::CompletionCallback& callback) OVERRIDE; |
| private: |
| + struct CreateBackendDataShim; |
| class EntryImpl; |
| - class CreateBackendCallback |
| - : public net::CancelableOldCompletionCallback<AppCacheDiskCache> { |
| - public: |
| - typedef net::CancelableOldCompletionCallback<AppCacheDiskCache> BaseClass; |
| - CreateBackendCallback(AppCacheDiskCache* object, |
| - void (AppCacheDiskCache::* method)(int)) |
| - : BaseClass(object, method), backend_ptr_(NULL) {} |
| - |
| - disk_cache::Backend* backend_ptr_; // Accessed directly. |
| - private: |
| - virtual ~CreateBackendCallback() { |
| - delete backend_ptr_; |
| - } |
| - }; |
| - |
| // PendingCalls allow CreateEntry, OpenEntry, and DoomEntry to be called |
| // immediately after construction, without waiting for the |
| // underlying disk_cache::Backend to be fully constructed. Early |
| @@ -100,19 +86,22 @@ class APPCACHE_EXPORT AppCacheDiskCache |
| typedef std::set<ActiveCall*> ActiveCalls; |
| bool is_initializing() const { |
| - return create_backend_callback_.get() != NULL; |
| + return !create_backend_callback_.IsCancelled(); |
| } |
| 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, |
| const net::CompletionCallback& callback); |
| - void OnCreateBackendComplete(int rv); |
| + // The |unused| parameter is a small hack so that we can have the |
|
groby-ooo-7-16
2012/01/03 18:32:25
Which one is |unused|. I assume you mean |backend|
James Hawkins
2012/01/03 18:39:21
Done.
|
| + // CreateBackendDataShim object owned by the Callback that is created for |
| + // this method. |
| + void OnCreateBackendComplete(disk_cache::Backend** backend, int rv); |
| void AddActiveCall(ActiveCall* call) { active_calls_.insert(call); } |
| void RemoveActiveCall(ActiveCall* call) { active_calls_.erase(call); } |
| bool is_disabled_; |
| net::CompletionCallback init_callback_; |
| - scoped_refptr<CreateBackendCallback> create_backend_callback_; |
| + net::CancelableCompletionCallback create_backend_callback_; |
| PendingCalls pending_calls_; |
| ActiveCalls active_calls_; |
| scoped_ptr<disk_cache::Backend> disk_cache_; |