Chromium Code Reviews| Index: net/base/completion_callback.h |
| diff --git a/net/base/completion_callback.h b/net/base/completion_callback.h |
| index f55a8552705f52b32b1e3877b603b8194ad3a7cf..f86eb3c013d0b70818b66f1aed6db1e15c34f0ba 100644 |
| --- a/net/base/completion_callback.h |
| +++ b/net/base/completion_callback.h |
| @@ -6,68 +6,18 @@ |
| #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" |
|
groby-ooo-7-16
2012/01/03 18:32:25
Don't need that one any more.
James Hawkins
2012/01/03 18:39:21
Done.
|
| 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__ |