aboutsummaryrefslogtreecommitdiff
path: root/third_party/chromium/base/callback_list.h
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/chromium/base/callback_list.h')
-rw-r--r--third_party/chromium/base/callback_list.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/third_party/chromium/base/callback_list.h b/third_party/chromium/base/callback_list.h
index 7d6a478..7ab79dd 100644
--- a/third_party/chromium/base/callback_list.h
+++ b/third_party/chromium/base/callback_list.h
@@ -6,13 +6,12 @@
#define BASE_CALLBACK_LIST_H_
#include <list>
+#include <memory>
#include "base/callback.h"
-#include "base/callback_internal.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
// OVERVIEW:
//
@@ -29,7 +28,7 @@
//
// typedef base::Callback<void(const Foo&)> OnFooCallback;
//
-// scoped_ptr<base::CallbackList<void(const Foo&)>::Subscription>
+// std::unique_ptr<base::CallbackList<void(const Foo&)>::Subscription>
// RegisterCallback(const OnFooCallback& cb) {
// return callback_list_.Add(cb);
// }
@@ -62,7 +61,7 @@
// // Do something.
// }
//
-// scoped_ptr<base::CallbackList<void(const Foo&)>::Subscription>
+// std::unique_ptr<base::CallbackList<void(const Foo&)>::Subscription>
// foo_subscription_;
//
// DISALLOW_COPY_AND_ASSIGN(MyWidgetListener);
@@ -103,9 +102,9 @@ class CallbackListBase {
// Add a callback to the list. The callback will remain registered until the
// returned Subscription is destroyed, which must occur before the
// CallbackList is destroyed.
- scoped_ptr<Subscription> Add(const CallbackType& cb) WARN_UNUSED_RESULT {
+ std::unique_ptr<Subscription> Add(const CallbackType& cb) WARN_UNUSED_RESULT {
DCHECK(!cb.is_null());
- return scoped_ptr<Subscription>(
+ return std::unique_ptr<Subscription>(
new Subscription(this, callbacks_.insert(callbacks_.end(), cb)));
}
@@ -211,8 +210,8 @@ class CallbackList<void(Args...)>
CallbackList() {}
- void Notify(
- typename internal::CallbackParamTraits<Args>::ForwardType... args) {
+ template <typename... RunArgs>
+ void Notify(RunArgs&&... args) {
typename internal::CallbackListBase<CallbackType>::Iterator it =
this->GetIterator();
CallbackType* cb;