summaryrefslogtreecommitdiffstats
path: root/chromium/base/threading/thread.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2021-10-26 13:57:00 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-11-02 11:31:01 +0000
commit1943b3c2a1dcee36c233724fc4ee7613d71b9cf6 (patch)
tree8c1b5f12357025c197da5427ae02cfdc2f3570d6 /chromium/base/threading/thread.cc
parent21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (diff)
BASELINE: Update Chromium to 94.0.4606.111
Change-Id: I924781584def20fc800bedf6ff41fdb96c438193 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/base/threading/thread.cc')
-rw-r--r--chromium/base/threading/thread.cc22
1 files changed, 19 insertions, 3 deletions
diff --git a/chromium/base/threading/thread.cc b/chromium/base/threading/thread.cc
index 8834896a59f..0454b1b0676 100644
--- a/chromium/base/threading/thread.cc
+++ b/chromium/base/threading/thread.cc
@@ -122,6 +122,22 @@ Thread::Options::Options(Options&& other)
other.moved_from = true;
}
+Thread::Options& Thread::Options::operator=(Thread::Options&& other) {
+ DCHECK_NE(this, &other);
+
+ message_pump_type = std::move(other.message_pump_type);
+ delegate = std::move(other.delegate);
+ timer_slack = std::move(other.timer_slack);
+ task_queue_time_domain = std::move(other.task_queue_time_domain);
+ message_pump_factory = std::move(other.message_pump_factory);
+ stack_size = std::move(other.stack_size);
+ priority = std::move(other.priority);
+ joinable = std::move(other.joinable);
+ other.moved_from = true;
+
+ return *this;
+}
+
Thread::Options::~Options() = default;
Thread::Thread(const std::string& name)
@@ -149,10 +165,10 @@ bool Thread::Start() {
if (com_status_ == STA)
options.message_pump_type = MessagePumpType::UI;
#endif
- return StartWithOptions(options);
+ return StartWithOptions(std::move(options));
}
-bool Thread::StartWithOptions(const Options& options) {
+bool Thread::StartWithOptions(Options options) {
DCHECK(options.IsValid());
DCHECK(owning_sequence_checker_.CalledOnValidSequence());
DCHECK(!delegate_);
@@ -175,7 +191,7 @@ bool Thread::StartWithOptions(const Options& options) {
if (options.delegate) {
DCHECK(!options.message_pump_factory);
DCHECK(!options.task_queue_time_domain);
- delegate_ = WrapUnique(options.delegate);
+ delegate_ = std::move(options.delegate);
} else if (options.message_pump_factory) {
delegate_ = std::make_unique<SequenceManagerThreadDelegate>(
MessagePumpType::CUSTOM, options.message_pump_factory,