summaryrefslogtreecommitdiffstats
path: root/chromium/base/threading/thread.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-02-13 15:05:36 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-02-14 10:33:47 +0000
commite684a3455bcc29a6e3e66a004e352dea4e1141e7 (patch)
treed55b4003bde34d7d05f558f02cfd82b2a66a7aac /chromium/base/threading/thread.cc
parent2b94bfe47ccb6c08047959d1c26e392919550e86 (diff)
BASELINE: Update Chromium to 72.0.3626.110 and Ninja to 1.9.0
Change-Id: Ic57220b00ecc929a893c91f5cc552f5d3e99e922 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/base/threading/thread.cc')
-rw-r--r--chromium/base/threading/thread.cc37
1 files changed, 5 insertions, 32 deletions
diff --git a/chromium/base/threading/thread.cc b/chromium/base/threading/thread.cc
index cbdda7e63db..86062857918 100644
--- a/chromium/base/threading/thread.cc
+++ b/chromium/base/threading/thread.cc
@@ -11,7 +11,6 @@
#include "base/logging.h"
#include "base/run_loop.h"
#include "base/synchronization/waitable_event.h"
-#include "base/task/sequence_manager/sequence_manager.h"
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
#include "base/threading/thread_id_name_manager.h"
#include "base/threading/thread_local.h"
@@ -97,18 +96,12 @@ bool Thread::StartWithOptions(const Options& options) {
if (!options.message_pump_factory.is_null())
type = MessageLoop::TYPE_CUSTOM;
- message_loop_timer_slack_ = options.timer_slack;
+ timer_slack_ = options.timer_slack;
std::unique_ptr<MessageLoop> message_loop_owned =
MessageLoop::CreateUnbound(type, options.message_pump_factory);
message_loop_ = message_loop_owned.get();
start_event_.Reset();
- if (options.on_sequence_manager_created) {
- sequence_manager_ =
- sequence_manager::CreateUnboundSequenceManager(message_loop_);
- options.on_sequence_manager_created.Run(sequence_manager_.get());
- }
-
// Hold |thread_lock_| while starting the new thread to synchronize with
// Stop() while it's not guaranteed to be sequenced (until crbug/629139 is
// fixed).
@@ -232,11 +225,6 @@ PlatformThreadId Thread::GetThreadId() const {
return id_;
}
-PlatformThreadHandle Thread::GetThreadHandle() const {
- AutoLock lock(thread_lock_);
- return thread_;
-}
-
bool Thread::IsRunning() const {
// TODO(gab): Fix improper usage of this API (http://crbug.com/629139) and
// enable this check.
@@ -305,31 +293,18 @@ void Thread::ThreadMain() {
PlatformThread::SetName(name_.c_str());
ANNOTATE_THREAD_NAME(name_.c_str()); // Tell the name to race detector.
- if (sequence_manager_) {
- // Bind the SequenceManager before binding the MessageLoop, so that the
- // TaskQueues are bound before the MessageLoop. This is required as one of
- // the TaskQueues may have already replaced the MessageLoop's TaskRunner,
- // and the MessageLoop's TaskRunner needs to be associated with this thread
- // when we call MessageLoop::BindToCurrentThread().
- sequence_manager_->BindToCurrentThread();
- }
-
// Lazily initialize the |message_loop| so that it can run on this thread.
DCHECK(message_loop_);
std::unique_ptr<MessageLoop> message_loop(message_loop_);
message_loop_->BindToCurrentThread();
- message_loop_->SetTimerSlack(message_loop_timer_slack_);
-
- if (sequence_manager_) {
- sequence_manager_->CompleteInitializationOnBoundThread();
- }
+ message_loop_->SetTimerSlack(timer_slack_);
#if defined(OS_POSIX) && !defined(OS_NACL)
// Allow threads running a MessageLoopForIO to use FileDescriptorWatcher API.
std::unique_ptr<FileDescriptorWatcher> file_descriptor_watcher;
- if (MessageLoopForIO::IsCurrent()) {
- file_descriptor_watcher.reset(new FileDescriptorWatcher(
- static_cast<MessageLoopForIO*>(message_loop_)));
+ if (MessageLoopCurrentForIO::IsSet()) {
+ file_descriptor_watcher.reset(
+ new FileDescriptorWatcher(message_loop_->task_runner()));
}
#endif
@@ -368,8 +343,6 @@ void Thread::ThreadMain() {
com_initializer.reset();
#endif
- sequence_manager_.reset();
-
if (message_loop->type() != MessageLoop::TYPE_CUSTOM) {
// Assert that RunLoop::QuitWhenIdle was called by ThreadQuitHelper. Don't
// check for custom message pumps, because their shutdown might not allow