| Index: net/base/completion_callback.h
|
| diff --git a/net/base/completion_callback.h b/net/base/completion_callback.h
|
| index f55a8552705f52b32b1e3877b603b8194ad3a7cf..a659d0ae2c8a8d4b8ea55c43e2cc4d14d85c71e0 100644
|
| --- a/net/base/completion_callback.h
|
| +++ b/net/base/completion_callback.h
|
| @@ -6,68 +6,17 @@
|
| #define NET_BASE_COMPLETION_CALLBACK_H__
|
| #pragma once
|
|
|
| -#include "base/callback_old.h"
|
| #include "base/callback.h"
|
| #include "base/cancelable_callback.h"
|
| -#include "net/base/net_export.h"
|
|
|
| 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<int>::Type OldCompletionCallback;
|
| +// A callback specialization that takes a single int parameter. Usually this is
|
| +// used to report a byte count or network error code.
|
| typedef base::Callback<void(int)> CompletionCallback;
|
|
|
| -// Temporary (in the code) adapter of OldCompletionCallback for use at call
|
| -// sites that expect a CompletionCallback.
|
| -//
|
| -// TODO(jhawkins): Remove once OldCompletionCallback is removed.
|
| -void NET_EXPORT OldCompletionCallbackAdapter(OldCompletionCallback* callback,
|
| - int result);
|
| -
|
| -// Used to implement a OldCompletionCallback.
|
| -template <class T>
|
| -class OldCompletionCallbackImpl :
|
| - public CallbackImpl< T, void (T::*)(int), Tuple1<int> > {
|
| - public:
|
| - OldCompletionCallbackImpl(T* obj, void (T::* meth)(int))
|
| - : CallbackImpl< T, void (T::*)(int),
|
| - Tuple1<int> >::CallbackImpl(obj, meth) {
|
| - }
|
| -};
|
| -
|
| typedef base::CancelableCallback<void(int)> CancelableCompletionCallback;
|
|
|
| -// 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 T>
|
| -class CancelableOldCompletionCallback :
|
| - public OldCompletionCallbackImpl<T>,
|
| - public base::RefCounted<CancelableOldCompletionCallback<T> > {
|
| - public:
|
| - CancelableOldCompletionCallback(T* obj, void (T::* meth)(int))
|
| - : OldCompletionCallbackImpl<T>(obj, meth), is_canceled_(false) {
|
| - }
|
| -
|
| - void Cancel() {
|
| - is_canceled_ = true;
|
| - }
|
| -
|
| - virtual void RunWithParams(const Tuple1<int>& params) {
|
| - if (is_canceled_) {
|
| - base::RefCounted<CancelableOldCompletionCallback<T> >::Release();
|
| - } else {
|
| - OldCompletionCallbackImpl<T>::RunWithParams(params);
|
| - }
|
| - }
|
| -
|
| - private:
|
| - bool is_canceled_;
|
| -};
|
| -
|
| } // namespace net
|
|
|
| #endif // NET_BASE_COMPLETION_CALLBACK_H__
|
|
|