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

Unified Diff: webkit/appcache/appcache_disk_cache.h

Issue 9064007: base::Bind: Remove OldCompletionCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes 2. Created 8 years, 12 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: webkit/appcache/appcache_disk_cache.h
diff --git a/webkit/appcache/appcache_disk_cache.h b/webkit/appcache/appcache_disk_cache.h
index 069127c40d3c859658b42c1a8e1609d6e07b402b..35fa6424a2c97468af7342e06f7f5b5f563838aa 100644
--- a/webkit/appcache/appcache_disk_cache.h
+++ b/webkit/appcache/appcache_disk_cache.h
@@ -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.
@@ -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,19 @@ 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);
+ 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_;

Powered by Google App Engine
This is Rietveld 408576698