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

Unified Diff: webkit/appcache/appcache_response.h

Issue 9064007: base::Bind: Remove OldCompletionCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_response.h
diff --git a/webkit/appcache/appcache_response.h b/webkit/appcache/appcache_response.h
index 0ef61f0375b080393641a65491ebdfcc6fd06f24..0dd81bdfd29599e41e7f4109da18f8114fffe844 100644
--- a/webkit/appcache/appcache_response.h
+++ b/webkit/appcache/appcache_response.h
@@ -100,21 +100,6 @@ class APPCACHE_EXPORT AppCacheResponseIO {
int64 response_id() const { return response_id_; }
protected:
- template <class T>
- class EntryCallback : public net::CancelableOldCompletionCallback<T> {
- public:
- typedef net::CancelableOldCompletionCallback<T> BaseClass;
- EntryCallback(T* object, void (T::* method)(int))
- : BaseClass(object, method), entry_ptr_(NULL) {}
-
- AppCacheDiskCacheInterface::Entry* entry_ptr_; // Accessed directly.
- private:
- ~EntryCallback() {
- if (entry_ptr_)
- entry_ptr_->Close();
- }
- };
-
AppCacheResponseIO(int64 response_id,
int64 group_id,
AppCacheDiskCacheInterface* disk_cache);
@@ -194,12 +179,13 @@ class APPCACHE_EXPORT AppCacheResponseReader : public AppCacheResponseIO {
void ContinueReadInfo();
void ContinueReadData();
void OpenEntryIfNeededAndContinue();
- void OnOpenEntryComplete(int rv);
+ void OnOpenEntryComplete(AppCacheDiskCacheInterface::Entry** entry, int rv);
int range_offset_;
int range_length_;
int read_position_;
- scoped_refptr<EntryCallback<AppCacheResponseReader> > open_callback_;
+ net::CompletionCallback open_callback_;
+ base::WeakPtrFactory<AppCacheResponseReader> weak_factory_;
};
// Writes new response data to storage. If the object is deleted
@@ -257,13 +243,14 @@ class APPCACHE_EXPORT AppCacheResponseWriter : public AppCacheResponseIO {
void ContinueWriteInfo();
void ContinueWriteData();
void CreateEntryIfNeededAndContinue();
- void OnCreateEntryComplete(int rv);
+ void OnCreateEntryComplete(AppCacheDiskCacheInterface::Entry** entry, int rv);
int info_size_;
int write_position_;
int write_amount_;
CreationPhase creation_phase_;
- scoped_refptr<EntryCallback<AppCacheResponseWriter> > create_callback_;
+ net::CompletionCallback create_callback_;
+ base::WeakPtrFactory<AppCacheResponseWriter> weak_factory_;
};
} // namespace appcache

Powered by Google App Engine
This is Rietveld 408576698