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

Unified Diff: base/message_loop/message_loop.h

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 Created 4 years, 8 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
« no previous file with comments | « base/memory/weak_ptr_unittest.cc ('k') | base/message_loop/message_loop.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_loop.h
diff --git a/base/message_loop/message_loop.h b/base/message_loop/message_loop.h
index ce960e19cf5e32cc399bb7451f3e222fca50c805..802fae0dd191e64034c1779c81263a83d1fe6492 100644
--- a/base/message_loop/message_loop.h
+++ b/base/message_loop/message_loop.h
@@ -5,6 +5,7 @@
#ifndef BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_
#define BASE_MESSAGE_LOOP_MESSAGE_LOOP_H_
+#include <memory>
#include <queue>
#include <string>
@@ -15,7 +16,6 @@
#include "base/location.h"
#include "base/macros.h"
#include "base/memory/ref_counted.h"
-#include "base/memory/scoped_ptr.h"
#include "base/message_loop/incoming_task_queue.h"
#include "base/message_loop/message_loop_task_runner.h"
#include "base/message_loop/message_pump.h"
@@ -115,7 +115,7 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
explicit MessageLoop(Type type = TYPE_DEFAULT);
// Creates a TYPE_CUSTOM MessageLoop with the supplied MessagePump, which must
// be non-NULL.
- explicit MessageLoop(scoped_ptr<MessagePump> pump);
+ explicit MessageLoop(std::unique_ptr<MessagePump> pump);
~MessageLoop() override;
@@ -124,7 +124,7 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
static void EnableHistogrammer(bool enable_histogrammer);
- typedef scoped_ptr<MessagePump> (MessagePumpFactory)();
+ typedef std::unique_ptr<MessagePump>(MessagePumpFactory)();
// Uses the given base::MessagePumpForUIFactory to override the default
// MessagePump implementation for 'TYPE_UI'. Returns true if the factory
// was successfully registered.
@@ -132,7 +132,7 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// Creates the default MessagePump based on |type|. Caller owns return
// value.
- static scoped_ptr<MessagePump> CreateMessagePumpForType(Type type);
+ static std::unique_ptr<MessagePump> CreateMessagePumpForType(Type type);
// A DestructionObserver is notified when the current MessageLoop is being
// destroyed. These observers are notified prior to MessageLoop::current()
// being changed to return NULL. This gives interested parties the chance to
@@ -397,9 +397,9 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
//----------------------------------------------------------------------------
protected:
- scoped_ptr<MessagePump> pump_;
+ std::unique_ptr<MessagePump> pump_;
- using MessagePumpFactoryCallback = Callback<scoped_ptr<MessagePump>()>;
+ using MessagePumpFactoryCallback = Callback<std::unique_ptr<MessagePump>()>;
// Common protected constructor. Other constructors delegate the
// initialization to this constructor.
@@ -430,7 +430,7 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// thread the message loop runs on, before calling Run().
// Before BindToCurrentThread() is called, only Post*Task() functions can
// be called on the message loop.
- static scoped_ptr<MessageLoop> CreateUnbound(
+ static std::unique_ptr<MessageLoop> CreateUnbound(
Type type,
MessagePumpFactoryCallback pump_factory);
@@ -538,7 +538,7 @@ class BASE_EXPORT MessageLoop : public MessagePump::Delegate {
// The task runner associated with this message loop.
scoped_refptr<SingleThreadTaskRunner> task_runner_;
- scoped_ptr<ThreadTaskRunnerHandle> thread_task_runner_handle_;
+ std::unique_ptr<ThreadTaskRunnerHandle> thread_task_runner_handle_;
template <class T, class R> friend class base::subtle::DeleteHelperInternal;
template <class T, class R> friend class base::subtle::ReleaseHelperInternal;
@@ -567,7 +567,7 @@ class BASE_EXPORT MessageLoopForUI : public MessageLoop {
MessageLoopForUI() : MessageLoop(TYPE_UI) {
}
- explicit MessageLoopForUI(scoped_ptr<MessagePump> pump);
+ explicit MessageLoopForUI(std::unique_ptr<MessagePump> pump);
// Returns the MessageLoopForUI of the current thread.
static MessageLoopForUI* current() {
« no previous file with comments | « base/memory/weak_ptr_unittest.cc ('k') | base/message_loop/message_loop.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698