From f1f3f0f8af3740ec2afaebcaed410950a9cc0ac8 Mon Sep 17 00:00:00 2001 From: "willchan@chromium.org" Date: Sat, 1 Oct 2011 20:38:10 +0000 Subject: Begin CompletionCallback switchover. Rename CompletionCallback to OldCompletionCallback in preparation for introducing a new CompletionCallback based on base::Callback. Also renames other CompletionCallback types like CancelableCompletionCallback and TestCompletionCallback and CompletionCallbackImpl. All using sed with s/CompletionCallback/OldCompletionCallback/g. BUG=98719 TEST=none Review URL: http://codereview.chromium.org/8070013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103650 0039d316-1c4b-4281-b951-d872f2087c98 --- net/base/completion_callback.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'net/base/completion_callback.h') diff --git a/net/base/completion_callback.h b/net/base/completion_callback.h index 23d0166..1d3e551 100644 --- a/net/base/completion_callback.h +++ b/net/base/completion_callback.h @@ -12,31 +12,31 @@ namespace net { // A callback specialization that takes a single int parameter. Usually this // is used to report a byte count or network error code. -typedef Callback1::Type CompletionCallback; +typedef Callback1::Type OldCompletionCallback; -// Used to implement a CompletionCallback. +// Used to implement a OldCompletionCallback. template -class CompletionCallbackImpl : +class OldCompletionCallbackImpl : public CallbackImpl< T, void (T::*)(int), Tuple1 > { public: - CompletionCallbackImpl(T* obj, void (T::* meth)(int)) + OldCompletionCallbackImpl(T* obj, void (T::* meth)(int)) : CallbackImpl< T, void (T::*)(int), Tuple1 >::CallbackImpl(obj, meth) { } }; -// CancelableCompletionCallback is used for completion callbacks +// CancelableOldCompletionCallback is used for completion callbacks // which may outlive the target for the method dispatch. In such a case, the // provider of the callback calls Cancel() to mark the callback as // "canceled". When the canceled callback is eventually run it does nothing // other than to decrement the refcount to 0 and free the memory. template -class CancelableCompletionCallback : - public CompletionCallbackImpl, - public base::RefCounted > { +class CancelableOldCompletionCallback : + public OldCompletionCallbackImpl, + public base::RefCounted > { public: - CancelableCompletionCallback(T* obj, void (T::* meth)(int)) - : CompletionCallbackImpl(obj, meth), is_canceled_(false) { + CancelableOldCompletionCallback(T* obj, void (T::* meth)(int)) + : OldCompletionCallbackImpl(obj, meth), is_canceled_(false) { } void Cancel() { @@ -45,9 +45,9 @@ class CancelableCompletionCallback : virtual void RunWithParams(const Tuple1& params) { if (is_canceled_) { - base::RefCounted >::Release(); + base::RefCounted >::Release(); } else { - CompletionCallbackImpl::RunWithParams(params); + OldCompletionCallbackImpl::RunWithParams(params); } } -- cgit v1.1