diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-07-31 15:50:41 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-08-30 12:35:23 +0000 |
commit | 7b2ffa587235a47d4094787d72f38102089f402a (patch) | |
tree | 30e82af9cbab08a7fa028bb18f4f2987a3f74dfa /chromium/base/message_loop/message_loop.cc | |
parent | d94af01c90575348c4e81a418257f254b6f8d225 (diff) |
BASELINE: Update Chromium to 76.0.3809.94
Change-Id: I321c3f5f929c105aec0f98c5091ef6108822e647
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/base/message_loop/message_loop.cc')
-rw-r--r-- | chromium/base/message_loop/message_loop.cc | 59 |
1 files changed, 4 insertions, 55 deletions
diff --git a/chromium/base/message_loop/message_loop.cc b/chromium/base/message_loop/message_loop.cc index afcf04d5882..90cb3e3fc7d 100644 --- a/chromium/base/message_loop/message_loop.cc +++ b/chromium/base/message_loop/message_loop.cc @@ -25,12 +25,6 @@ namespace base { -namespace { - -MessageLoop::MessagePumpFactory* message_pump_for_ui_factory_ = nullptr; - -} // namespace - // Unfortunately since we're not on C++17 we're required to provide an out of // line definition. constexpr MessageLoop::Type MessageLoop::TYPE_DEFAULT; @@ -79,49 +73,6 @@ MessageLoop::~MessageLoop() { #endif // !defined(OS_IOS) } -// static -bool MessageLoop::InitMessagePumpForUIFactory(MessagePumpFactory* factory) { - if (message_pump_for_ui_factory_) - return false; - - message_pump_for_ui_factory_ = factory; - return true; -} - -// static -std::unique_ptr<MessagePump> MessageLoop::CreateMessagePumpForType(Type type) { - if (type == MessageLoop::TYPE_UI) { - if (message_pump_for_ui_factory_) - return message_pump_for_ui_factory_(); -#if defined(OS_IOS) || defined(OS_MACOSX) - return MessagePumpMac::Create(); -#elif defined(OS_NACL) || defined(OS_AIX) - // Currently NaCl and AIX don't have a UI MessageLoop. - // TODO(abarth): Figure out if we need this. - NOTREACHED(); - return nullptr; -#else - return std::make_unique<MessagePumpForUI>(); -#endif - } - - if (type == MessageLoop::TYPE_IO) - return std::make_unique<MessagePumpForIO>(); - -#if defined(OS_ANDROID) - if (type == MessageLoop::TYPE_JAVA) - return std::make_unique<MessagePumpForUI>(); -#endif - - DCHECK_EQ(MessageLoop::TYPE_DEFAULT, type); -#if defined(OS_IOS) - // On iOS, a native runloop is always required to pump system work. - return std::make_unique<MessagePumpCFRunLoop>(); -#else - return std::make_unique<MessagePumpDefault>(); -#endif -} - bool MessageLoop::IsType(Type type) const { return type_ == type; } @@ -163,7 +114,9 @@ std::unique_ptr<MessageLoop> MessageLoop::CreateUnbound( MessageLoop::MessageLoop(Type type, std::unique_ptr<MessagePump> custom_pump) : sequence_manager_( sequence_manager::internal::SequenceManagerImpl::CreateUnbound( - sequence_manager::SequenceManager::Settings{type})), + sequence_manager::SequenceManager::Settings::Builder() + .SetMessagePumpType(type) + .Build())), default_task_queue_(CreateDefaultTaskQueue()), type_(type), custom_pump_(std::move(custom_pump)) { @@ -198,7 +151,7 @@ std::unique_ptr<MessagePump> MessageLoop::CreateMessagePump() { if (custom_pump_) { return std::move(custom_pump_); } else { - return CreateMessagePumpForType(type_); + return MessagePump::Create(type_); } } @@ -206,10 +159,6 @@ void MessageLoop::SetTimerSlack(TimerSlack timer_slack) { sequence_manager_->SetTimerSlack(timer_slack); } -std::string MessageLoop::GetThreadName() const { - return sequence_manager_->GetThreadName(); -} - scoped_refptr<SingleThreadTaskRunner> MessageLoop::task_runner() const { return sequence_manager_->GetTaskRunner(); } |