Deprecate MessageLoop::Type
It is currently just an alias to MessagePump::Type. This patch changes a bunch of references to use MessagePump::Type as MessageLoop will eventually disappear. Also rename base::Thread::Options::message_loop_type to message_pump_type It is weird to see things like message_loop_type = MessagePump::Type::UI Also change some other instances that I happened to see in the form loop_type = MessagePump::Type::UI to pump_type = MessagePump::Type::UI This is a mechanical change that will be reviewed according to https://chromium.googlesource.com/chromium/src/+/master/docs/code_reviews.md#mechanical-changes BUG=891670 TBR=gab@chromium.org Change-Id: Ib41ccc6547b8c9fa0bdba5d23c4767ae03f2a97d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1718331 Commit-Queue: Carlos Caballero <carlscab@google.com> Reviewed-by: Gabriel Charette <gab@chromium.org> Cr-Commit-Position: refs/heads/master@{#682254}
This commit is contained in:

committed by
Commit Bot

parent
9988d686e5
commit
dd8bf7b04a
ash
base
files
message_loop
message_loop.ccmessage_loop.hmessage_loop_current.ccmessage_loop_unittest.ccmessage_pump_glib_unittest.ccmessage_pump_libevent_unittest.ccmessage_pump_perftest.ccmessage_pump_unittest.cc
task
test
threading
chrome
app_shim
browser
devtools
local_discovery
media
printing
cloud_print
safe_browsing
chrome_cleaner
chrome_cleaner
common
service
test
chromedriver
utility
image_writer
chromecast
base
device
bluetooth
external_mojo
broker_service
media
audio
cma
chromeos
dbus
process_proxy
services
machine_learning
public
components
browser_watcher
cronet
download
internal
background_service
exo
wayland
fuzzer
grpc_support
invalidation
nacl
loader
sync
engine
viz
content
browser
appcache
browser_associated_interface_unittest.cccompositor
devtools
gpu
media
capture
renderer_host
scheduler
service_manager
child
gpu
renderer
dbus
bus_unittest.ccend_to_end_async_unittest.ccobject_manager_unittest.ccproperty_unittest.ccsignal_sender_verification_unittest.cctest_server.cctest_service.cc
device
bluetooth
gamepad
vr
windows_mixed_reality
extensions/browser/api/networking_private
ios
chrome
web
ipc
media
audio
capture
cast
test
gpu
midi
mojo/core
net
base
network_change_notifier_fuchsia_unittest.ccnetwork_config_watcher_mac.ccnetwork_notification_thread_mac.cc
cert
cert_net
disk_cache
blockfile
proxy_resolution
test
tools
url_request
ppapi
remoting
base
client
host
chromoting_host_context.ccconfig_file_watcher_unittest.ccdesktop_process.ccdesktop_process_unittest.cchost_power_save_blocker_unittest.ccipc_desktop_environment_unittest.cc
linux
native_messaging
security_key
security_key_auth_handler_posix_unittest.ccsecurity_key_message_reader.ccsecurity_key_message_reader_impl.ccsecurity_key_message_writer_impl_unittest.cc
setup
ios
test
rlz/lib
services
device
network
service_manager
public
cpp
service_executable
test
viz
public
cpp
tools/ipc_fuzzer/message_replay
ui
@ -6,6 +6,7 @@
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/system/sys_info.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "chromeos/dbus/constants/dbus_switches.h"
|
||||
@ -47,7 +48,7 @@ void AshDBusHelper::InitializeDBus() {
|
||||
|
||||
// Create the D-Bus thread.
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
dbus_thread_ = std::make_unique<base::Thread>("D-Bus thread");
|
||||
dbus_thread_->StartWithOptions(thread_options);
|
||||
|
||||
|
@ -4,6 +4,7 @@
|
||||
|
||||
#include "ash/test/ash_test_suite.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/test/launcher/unit_test_launcher.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "mojo/core/embedder/embedder.h"
|
||||
@ -16,7 +17,7 @@ int main(int argc, char** argv) {
|
||||
// The IPC thread is necessary for the window service.
|
||||
base::Thread ipc_thread("IPC thread");
|
||||
ipc_thread.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
mojo::core::ScopedIPCSupport ipc_support(
|
||||
ipc_thread.task_runner(),
|
||||
mojo::core::ScopedIPCSupport::ShutdownPolicy::CLEAN);
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/test/scoped_task_environment.h"
|
||||
@ -63,7 +64,7 @@ class FileDescriptorWatcherTest
|
||||
if (GetParam() ==
|
||||
FileDescriptorWatcherTestType::MESSAGE_PUMP_FOR_IO_ON_OTHER_THREAD) {
|
||||
Thread::Options options;
|
||||
options.message_loop_type = MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = MessagePumpType::IO;
|
||||
ASSERT_TRUE(other_thread_.StartWithOptions(options));
|
||||
file_descriptor_watcher_ =
|
||||
std::make_unique<FileDescriptorWatcher>(other_thread_.task_runner());
|
||||
|
@ -25,26 +25,16 @@
|
||||
|
||||
namespace base {
|
||||
|
||||
// Unfortunately since we're not on C++17 we're required to provide an out of
|
||||
// line definition.
|
||||
constexpr MessageLoop::Type MessageLoop::TYPE_DEFAULT;
|
||||
constexpr MessageLoop::Type MessageLoop::TYPE_UI;
|
||||
constexpr MessageLoop::Type MessageLoop::TYPE_CUSTOM;
|
||||
constexpr MessageLoop::Type MessageLoop::TYPE_IO;
|
||||
#if defined(OS_ANDROID)
|
||||
constexpr MessageLoop::Type MessageLoop::TYPE_JAVA;
|
||||
#endif
|
||||
|
||||
MessageLoop::MessageLoop(Type type) : MessageLoop(type, nullptr) {
|
||||
MessageLoop::MessageLoop(MessagePumpType type) : MessageLoop(type, nullptr) {
|
||||
// For TYPE_CUSTOM you must either use
|
||||
// MessageLoop(std::unique_ptr<MessagePump> pump) or
|
||||
// MessageLoop::CreateUnbound()
|
||||
DCHECK_NE(type_, TYPE_CUSTOM);
|
||||
DCHECK_NE(type_, MessagePumpType::CUSTOM);
|
||||
BindToCurrentThread();
|
||||
}
|
||||
|
||||
MessageLoop::MessageLoop(std::unique_ptr<MessagePump> pump)
|
||||
: MessageLoop(TYPE_CUSTOM, std::move(pump)) {
|
||||
: MessageLoop(MessagePumpType::CUSTOM, std::move(pump)) {
|
||||
BindToCurrentThread();
|
||||
}
|
||||
|
||||
@ -73,7 +63,7 @@ MessageLoop::~MessageLoop() {
|
||||
#endif // !defined(OS_IOS)
|
||||
}
|
||||
|
||||
bool MessageLoop::IsType(Type type) const {
|
||||
bool MessageLoop::IsType(MessagePumpType type) const {
|
||||
return type_ == type;
|
||||
}
|
||||
|
||||
@ -101,17 +91,19 @@ bool MessageLoop::IsIdleForTesting() {
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
// static
|
||||
std::unique_ptr<MessageLoop> MessageLoop::CreateUnbound(Type type) {
|
||||
std::unique_ptr<MessageLoop> MessageLoop::CreateUnbound(MessagePumpType type) {
|
||||
return WrapUnique(new MessageLoop(type, nullptr));
|
||||
}
|
||||
|
||||
// static
|
||||
std::unique_ptr<MessageLoop> MessageLoop::CreateUnbound(
|
||||
std::unique_ptr<MessagePump> custom_pump) {
|
||||
return WrapUnique(new MessageLoop(TYPE_CUSTOM, std::move(custom_pump)));
|
||||
return WrapUnique(
|
||||
new MessageLoop(MessagePumpType::CUSTOM, std::move(custom_pump)));
|
||||
}
|
||||
|
||||
MessageLoop::MessageLoop(Type type, std::unique_ptr<MessagePump> custom_pump)
|
||||
MessageLoop::MessageLoop(MessagePumpType type,
|
||||
std::unique_ptr<MessagePump> custom_pump)
|
||||
: sequence_manager_(
|
||||
sequence_manager::internal::SequenceManagerImpl::CreateUnbound(
|
||||
sequence_manager::SequenceManager::Settings::Builder()
|
||||
@ -174,11 +166,11 @@ void MessageLoop::SetTaskRunner(
|
||||
//------------------------------------------------------------------------------
|
||||
// MessageLoopForUI
|
||||
|
||||
MessageLoopForUI::MessageLoopForUI(Type type) : MessageLoop(type) {
|
||||
MessageLoopForUI::MessageLoopForUI(MessagePumpType type) : MessageLoop(type) {
|
||||
#if defined(OS_ANDROID)
|
||||
DCHECK(type == TYPE_UI || type == TYPE_JAVA);
|
||||
DCHECK(type == MessagePumpType::UI || type == MessagePump::Type::JAVA);
|
||||
#else
|
||||
DCHECK_EQ(type, TYPE_UI);
|
||||
DCHECK_EQ(type, MessagePumpType::UI);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -85,8 +85,10 @@ class SequenceManagerImpl;
|
||||
// for tests. TODO(https://crbug.com/891670/) remove this class.
|
||||
class BASE_EXPORT MessageLoop {
|
||||
public:
|
||||
using Type = MessagePump::Type;
|
||||
// DEPRECATED: Use MessagePumpType instead
|
||||
using Type = MessagePumpType;
|
||||
|
||||
// DEPRECATED: Use MessagePumpType::* instead
|
||||
static constexpr Type TYPE_DEFAULT = Type::DEFAULT;
|
||||
static constexpr Type TYPE_UI = Type::UI;
|
||||
static constexpr Type TYPE_CUSTOM = Type::CUSTOM;
|
||||
@ -97,9 +99,9 @@ class BASE_EXPORT MessageLoop {
|
||||
|
||||
// Normally, it is not necessary to instantiate a MessageLoop. Instead, it
|
||||
// is typical to make use of the current thread's MessageLoop instance.
|
||||
explicit MessageLoop(Type type = Type::DEFAULT);
|
||||
// Creates a TYPE_CUSTOM MessageLoop with the supplied MessagePump, which must
|
||||
// be non-NULL.
|
||||
explicit MessageLoop(MessagePumpType type = MessagePump::Type::DEFAULT);
|
||||
// Creates a MessageLoop with the supplied MessagePump, which must be
|
||||
// non-null.
|
||||
explicit MessageLoop(std::unique_ptr<MessagePump> custom_pump);
|
||||
|
||||
virtual ~MessageLoop();
|
||||
@ -107,12 +109,12 @@ class BASE_EXPORT MessageLoop {
|
||||
// Set the timer slack for this message loop.
|
||||
void SetTimerSlack(TimerSlack timer_slack);
|
||||
|
||||
// Returns true if this loop is |type|. This allows subclasses (especially
|
||||
// those in tests) to specialize how they are identified.
|
||||
virtual bool IsType(Type type) const;
|
||||
// Returns true if this loop's pump is |type|. This allows subclasses
|
||||
// (especially those in tests) to specialize how they are identified.
|
||||
virtual bool IsType(MessagePumpType type) const;
|
||||
|
||||
// Returns the type passed to the constructor.
|
||||
Type type() const { return type_; }
|
||||
MessagePumpType type() const { return type_; }
|
||||
|
||||
// Sets a new TaskRunner for this message loop. If the message loop was
|
||||
// already bound, this must be called on the thread to which it is bound.
|
||||
@ -152,7 +154,7 @@ class BASE_EXPORT MessageLoop {
|
||||
// specific type with a custom loop. The implementation does not call
|
||||
// BindToCurrentThread. If this constructor is invoked directly by a subclass,
|
||||
// then the subclass must subsequently bind the message loop.
|
||||
MessageLoop(Type type, std::unique_ptr<MessagePump> pump);
|
||||
MessageLoop(MessagePumpType type, std::unique_ptr<MessagePump> pump);
|
||||
|
||||
// Configure various members and bind this message loop to the current thread.
|
||||
void BindToCurrentThread();
|
||||
@ -185,7 +187,7 @@ class BASE_EXPORT MessageLoop {
|
||||
// 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 std::unique_ptr<MessageLoop> CreateUnbound(Type type);
|
||||
static std::unique_ptr<MessageLoop> CreateUnbound(MessagePumpType type);
|
||||
static std::unique_ptr<MessageLoop> CreateUnbound(
|
||||
std::unique_ptr<MessagePump> pump);
|
||||
|
||||
@ -198,7 +200,7 @@ class BASE_EXPORT MessageLoop {
|
||||
return sequence_manager_.get();
|
||||
}
|
||||
|
||||
const Type type_;
|
||||
const MessagePumpType type_;
|
||||
|
||||
// If set this will be returned by the next call to CreateMessagePump().
|
||||
// This is only set if |type_| is TYPE_CUSTOM and |pump_| is null.
|
||||
@ -229,7 +231,7 @@ class BASE_EXPORT MessageLoop {
|
||||
//
|
||||
class BASE_EXPORT MessageLoopForUI : public MessageLoop {
|
||||
public:
|
||||
explicit MessageLoopForUI(Type type = TYPE_UI);
|
||||
explicit MessageLoopForUI(MessagePumpType type = MessagePump::Type::UI);
|
||||
|
||||
#if defined(OS_IOS)
|
||||
// On iOS, the main message loop cannot be Run(). Instead call Attach(),
|
||||
@ -279,7 +281,7 @@ static_assert(sizeof(MessageLoop) == sizeof(MessageLoopForUI),
|
||||
//
|
||||
class BASE_EXPORT MessageLoopForIO : public MessageLoop {
|
||||
public:
|
||||
MessageLoopForIO() : MessageLoop(TYPE_IO) {}
|
||||
MessageLoopForIO() : MessageLoop(MessagePumpType::IO) {}
|
||||
};
|
||||
|
||||
// Do not add any member variables to MessageLoopForIO! This is important b/c
|
||||
|
@ -5,9 +5,9 @@
|
||||
#include "base/message_loop/message_loop_current.h"
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_for_io.h"
|
||||
#include "base/message_loop/message_pump_for_ui.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/task/sequence_manager/sequence_manager_impl.h"
|
||||
#include "base/threading/thread_local.h"
|
||||
@ -114,10 +114,10 @@ MessageLoopCurrentForUI MessageLoopCurrentForUI::Get() {
|
||||
auto* sequence_manager = GetCurrentSequenceManagerImpl();
|
||||
DCHECK(sequence_manager);
|
||||
#if defined(OS_ANDROID)
|
||||
DCHECK(sequence_manager->IsType(MessageLoop::TYPE_UI) ||
|
||||
sequence_manager->IsType(MessageLoop::TYPE_JAVA));
|
||||
DCHECK(sequence_manager->IsType(MessagePumpType::UI) ||
|
||||
sequence_manager->IsType(MessagePumpType::JAVA));
|
||||
#else // defined(OS_ANDROID)
|
||||
DCHECK(sequence_manager->IsType(MessageLoop::TYPE_UI));
|
||||
DCHECK(sequence_manager->IsType(MessagePumpType::UI));
|
||||
#endif // defined(OS_ANDROID)
|
||||
return MessageLoopCurrentForUI(sequence_manager);
|
||||
}
|
||||
@ -128,10 +128,10 @@ bool MessageLoopCurrentForUI::IsSet() {
|
||||
GetCurrentSequenceManagerImpl();
|
||||
return sequence_manager &&
|
||||
#if defined(OS_ANDROID)
|
||||
(sequence_manager->IsType(MessageLoop::TYPE_UI) ||
|
||||
sequence_manager->IsType(MessageLoop::TYPE_JAVA));
|
||||
(sequence_manager->IsType(MessagePumpType::UI) ||
|
||||
sequence_manager->IsType(MessagePumpType::JAVA));
|
||||
#else // defined(OS_ANDROID)
|
||||
sequence_manager->IsType(MessageLoop::TYPE_UI);
|
||||
sequence_manager->IsType(MessagePumpType::UI);
|
||||
#endif // defined(OS_ANDROID)
|
||||
}
|
||||
|
||||
@ -185,14 +185,14 @@ void MessageLoopCurrentForUI::RemoveMessagePumpObserver(
|
||||
MessageLoopCurrentForIO MessageLoopCurrentForIO::Get() {
|
||||
auto* sequence_manager = GetCurrentSequenceManagerImpl();
|
||||
DCHECK(sequence_manager);
|
||||
DCHECK(sequence_manager->IsType(MessageLoop::TYPE_IO));
|
||||
DCHECK(sequence_manager->IsType(MessagePumpType::IO));
|
||||
return MessageLoopCurrentForIO(sequence_manager);
|
||||
}
|
||||
|
||||
// static
|
||||
bool MessageLoopCurrentForIO::IsSet() {
|
||||
auto* sequence_manager = GetCurrentSequenceManagerImpl();
|
||||
return sequence_manager && sequence_manager->IsType(MessageLoop::TYPE_IO);
|
||||
return sequence_manager && sequence_manager->IsType(MessagePumpType::IO);
|
||||
}
|
||||
|
||||
MessagePumpForIO* MessageLoopCurrentForIO::GetMessagePumpForIO() const {
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_loop_current.h"
|
||||
#include "base/message_loop/message_pump_for_io.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/pending_task.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
#include "base/run_loop.h"
|
||||
@ -423,7 +424,7 @@ void RunTest_IOHandler() {
|
||||
|
||||
Thread thread("IOHandler test");
|
||||
Thread::Options options;
|
||||
options.message_loop_type = MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = MessagePumpType::IO;
|
||||
ASSERT_TRUE(thread.StartWithOptions(options));
|
||||
|
||||
TestIOHandler handler(kPipeName, callback_called.Get(), false);
|
||||
@ -459,7 +460,7 @@ void RunTest_WaitForIO() {
|
||||
|
||||
Thread thread("IOHandler test");
|
||||
Thread::Options options;
|
||||
options.message_loop_type = MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = MessagePumpType::IO;
|
||||
ASSERT_TRUE(thread.StartWithOptions(options));
|
||||
|
||||
TestIOHandler handler1(kPipeName1, callback1_called.Get(), false);
|
||||
@ -503,33 +504,32 @@ void RunTest_WaitForIO() {
|
||||
// that message loops work properly in all configurations. Of course, in some
|
||||
// cases, a unit test may only be for a particular type of loop.
|
||||
|
||||
class MessageLoopTypedTest
|
||||
: public ::testing::TestWithParam<MessageLoop::Type> {
|
||||
class MessageLoopTypedTest : public ::testing::TestWithParam<MessagePumpType> {
|
||||
public:
|
||||
MessageLoopTypedTest() = default;
|
||||
~MessageLoopTypedTest() = default;
|
||||
|
||||
static std::string ParamInfoToString(
|
||||
::testing::TestParamInfo<MessageLoop::Type> param_info) {
|
||||
::testing::TestParamInfo<MessagePumpType> param_info) {
|
||||
switch (param_info.param) {
|
||||
case MessageLoop::TYPE_DEFAULT:
|
||||
case MessagePumpType::DEFAULT:
|
||||
return "default_pump";
|
||||
case MessageLoop::TYPE_IO:
|
||||
case MessagePumpType::IO:
|
||||
return "IO_pump";
|
||||
case MessageLoop::TYPE_UI:
|
||||
case MessagePumpType::UI:
|
||||
return "UI_pump";
|
||||
case MessageLoop::TYPE_CUSTOM:
|
||||
case MessagePumpType::CUSTOM:
|
||||
break;
|
||||
#if defined(OS_ANDROID)
|
||||
case MessageLoop::TYPE_JAVA:
|
||||
case MessagePumpType::JAVA:
|
||||
break;
|
||||
#endif // defined(OS_ANDROID)
|
||||
#if defined(OS_MACOSX)
|
||||
case MessagePump::Type::NS_RUNLOOP:
|
||||
case MessagePumpType::NS_RUNLOOP:
|
||||
break;
|
||||
#endif // defined(OS_MACOSX)
|
||||
#if defined(OS_WIN)
|
||||
case MessagePump::Type::UI_WITH_WM_QUIT_SUPPORT:
|
||||
case MessagePumpType::UI_WITH_WM_QUIT_SUPPORT:
|
||||
break;
|
||||
#endif // defined(OS_WIN)
|
||||
}
|
||||
@ -1471,9 +1471,9 @@ TEST_P(MessageLoopTypedTest, IsIdleForTestingNonNestableTask) {
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(,
|
||||
MessageLoopTypedTest,
|
||||
::testing::Values(MessageLoop::TYPE_DEFAULT,
|
||||
MessageLoop::TYPE_UI,
|
||||
MessageLoop::TYPE_IO),
|
||||
::testing::Values(MessagePumpType::DEFAULT,
|
||||
MessagePumpType::UI,
|
||||
MessagePumpType::IO),
|
||||
MessageLoopTypedTest::ParamInfoToString);
|
||||
|
||||
#if defined(OS_WIN)
|
||||
@ -1482,7 +1482,7 @@ INSTANTIATE_TEST_SUITE_P(,
|
||||
// Users of MessageLoop typically expect to control when their RunLoops stop
|
||||
// Run()ning explicitly, via QuitClosure() etc (see https://crbug.com/720078).
|
||||
TEST_F(MessageLoopTest, WmQuitIsIgnored) {
|
||||
MessageLoop loop(MessageLoop::TYPE_UI);
|
||||
MessageLoop loop(MessagePumpType::UI);
|
||||
|
||||
// Post a WM_QUIT message to the current thread.
|
||||
::PostQuitMessage(0);
|
||||
@ -1507,7 +1507,7 @@ TEST_F(MessageLoopTest, WmQuitIsIgnored) {
|
||||
}
|
||||
|
||||
TEST_F(MessageLoopTest, WmQuitIsNotIgnoredWithEnableWmQuit) {
|
||||
MessageLoop loop(MessageLoop::TYPE_UI);
|
||||
MessageLoop loop(MessagePumpType::UI);
|
||||
static_cast<MessageLoopForUI*>(&loop)->EnableWmQuit();
|
||||
|
||||
// Post a WM_QUIT message to the current thread.
|
||||
@ -1530,7 +1530,7 @@ TEST_F(MessageLoopTest, WmQuitIsNotIgnoredWithEnableWmQuit) {
|
||||
}
|
||||
|
||||
TEST_F(MessageLoopTest, PostDelayedTask_SharedTimer_SubPump) {
|
||||
MessageLoop message_loop(MessageLoop::TYPE_UI);
|
||||
MessageLoop message_loop(MessagePumpType::UI);
|
||||
|
||||
// Test that the interval of the timer, used to run the next delayed task, is
|
||||
// set to a value corresponding to when the next delayed task should run.
|
||||
@ -1608,7 +1608,7 @@ bool DelayedQuitOnSystemTimer(UINT message,
|
||||
// https://crrev.com/c/1455266/9/base/message_loop/message_pump_win.cc#125
|
||||
// See below for the delayed task version.
|
||||
TEST_F(MessageLoopTest, PostImmediateTaskFromSystemPump) {
|
||||
MessageLoop message_loop(MessageLoop::TYPE_UI);
|
||||
MessageLoop message_loop(MessagePumpType::UI);
|
||||
|
||||
RunLoop run_loop;
|
||||
|
||||
@ -1633,7 +1633,7 @@ TEST_F(MessageLoopTest, PostImmediateTaskFromSystemPump) {
|
||||
// is the delayed task equivalent of the above PostImmediateTaskFromSystemPump
|
||||
// test.
|
||||
TEST_F(MessageLoopTest, PostDelayedTaskFromSystemPump) {
|
||||
MessageLoop message_loop(MessageLoop::TYPE_UI);
|
||||
MessageLoop message_loop(MessagePumpType::UI);
|
||||
|
||||
RunLoop run_loop;
|
||||
|
||||
@ -1654,7 +1654,7 @@ TEST_F(MessageLoopTest, PostDelayedTaskFromSystemPump) {
|
||||
}
|
||||
|
||||
TEST_F(MessageLoopTest, WmQuitIsVisibleToSubPump) {
|
||||
MessageLoop message_loop(MessageLoop::TYPE_UI);
|
||||
MessageLoop message_loop(MessagePumpType::UI);
|
||||
|
||||
// Regression test for https://crbug.com/888559. When processing a
|
||||
// kMsgHaveWork we peek and remove the next message and dispatch that ourself,
|
||||
@ -1688,7 +1688,7 @@ TEST_F(MessageLoopTest, WmQuitIsVisibleToSubPump) {
|
||||
}
|
||||
|
||||
TEST_F(MessageLoopTest, RepostingWmQuitDoesntStarveUpcomingNativeLoop) {
|
||||
MessageLoop message_loop(MessageLoop::TYPE_UI);
|
||||
MessageLoop message_loop(MessagePumpType::UI);
|
||||
|
||||
// This test ensures that application tasks are being processed by the native
|
||||
// subpump despite the kMsgHaveWork event having already been consumed by the
|
||||
@ -1731,7 +1731,7 @@ TEST_F(MessageLoopTest, RepostingWmQuitDoesntStarveUpcomingNativeLoop) {
|
||||
// works.
|
||||
TEST_F(MessageLoopTest,
|
||||
DISABLED_UnwindingMultipleSubPumpsDoesntStarveApplicationTasks) {
|
||||
MessageLoop message_loop(MessageLoop::TYPE_UI);
|
||||
MessageLoop message_loop(MessagePumpType::UI);
|
||||
|
||||
// Regression test for https://crbug.com/890016.
|
||||
// Tests that the subpump is still processing application tasks after
|
||||
@ -1777,12 +1777,12 @@ TEST_F(MessageLoopTest,
|
||||
namespace {
|
||||
|
||||
// A side effect of this test is the generation a beep. Sorry.
|
||||
void RunTest_RecursiveDenial2(MessageLoop::Type message_loop_type) {
|
||||
MessageLoop loop(message_loop_type);
|
||||
void RunTest_RecursiveDenial2(MessagePumpType message_pump_type) {
|
||||
MessageLoop loop(message_pump_type);
|
||||
|
||||
Thread worker("RecursiveDenial2_worker");
|
||||
Thread::Options options;
|
||||
options.message_loop_type = message_loop_type;
|
||||
options.message_pump_type = message_pump_type;
|
||||
ASSERT_EQ(true, worker.StartWithOptions(options));
|
||||
TaskList order;
|
||||
win::ScopedHandle event(CreateEvent(NULL, FALSE, FALSE, NULL));
|
||||
@ -1819,19 +1819,19 @@ void RunTest_RecursiveDenial2(MessageLoop::Type message_loop_type) {
|
||||
|
||||
// This test occasionally hangs. See http://crbug.com/44567.
|
||||
TEST_F(MessageLoopTest, DISABLED_RecursiveDenial2) {
|
||||
RunTest_RecursiveDenial2(MessageLoop::TYPE_DEFAULT);
|
||||
RunTest_RecursiveDenial2(MessageLoop::TYPE_UI);
|
||||
RunTest_RecursiveDenial2(MessageLoop::TYPE_IO);
|
||||
RunTest_RecursiveDenial2(MessagePumpType::DEFAULT);
|
||||
RunTest_RecursiveDenial2(MessagePumpType::UI);
|
||||
RunTest_RecursiveDenial2(MessagePumpType::IO);
|
||||
}
|
||||
|
||||
// A side effect of this test is the generation a beep. Sorry. This test also
|
||||
// needs to process windows messages on the current thread.
|
||||
TEST_F(MessageLoopTest, RecursiveSupport2) {
|
||||
MessageLoop loop(MessageLoop::TYPE_UI);
|
||||
MessageLoop loop(MessagePumpType::UI);
|
||||
|
||||
Thread worker("RecursiveSupport2_worker");
|
||||
Thread::Options options;
|
||||
options.message_loop_type = MessageLoop::TYPE_UI;
|
||||
options.message_pump_type = MessagePumpType::UI;
|
||||
ASSERT_EQ(true, worker.StartWithOptions(options));
|
||||
TaskList order;
|
||||
win::ScopedHandle event(CreateEvent(NULL, FALSE, FALSE, NULL));
|
||||
@ -2032,10 +2032,10 @@ TEST_F(MessageLoopTest, ThreadMainTaskRunner) {
|
||||
}
|
||||
|
||||
TEST_F(MessageLoopTest, IsType) {
|
||||
MessageLoop loop(MessageLoop::TYPE_UI);
|
||||
EXPECT_TRUE(loop.IsType(MessageLoop::TYPE_UI));
|
||||
EXPECT_FALSE(loop.IsType(MessageLoop::TYPE_IO));
|
||||
EXPECT_FALSE(loop.IsType(MessageLoop::TYPE_DEFAULT));
|
||||
MessageLoop loop(MessagePumpType::UI);
|
||||
EXPECT_TRUE(loop.IsType(MessagePumpType::UI));
|
||||
EXPECT_FALSE(loop.IsType(MessagePumpType::IO));
|
||||
EXPECT_FALSE(loop.IsType(MessagePumpType::DEFAULT));
|
||||
}
|
||||
|
||||
#if defined(OS_WIN)
|
||||
@ -2110,7 +2110,7 @@ LRESULT CALLBACK TestWndProcThunk(HWND hwnd,
|
||||
}
|
||||
|
||||
TEST_F(MessageLoopTest, AlwaysHaveUserMessageWhenNesting) {
|
||||
MessageLoop loop(MessageLoop::TYPE_UI);
|
||||
MessageLoop loop(MessagePumpType::UI);
|
||||
HINSTANCE instance = CURRENT_MODULE();
|
||||
WNDCLASSEX wc = {0};
|
||||
wc.cbSize = sizeof(wc);
|
||||
@ -2158,7 +2158,7 @@ TEST_F(MessageLoopTest, DeleteUnboundLoop) {
|
||||
// already has another active loop. This happens when thread creation fails.
|
||||
MessageLoop loop;
|
||||
std::unique_ptr<MessageLoop> unbound_loop(
|
||||
MessageLoop::CreateUnbound(MessageLoop::TYPE_DEFAULT));
|
||||
MessageLoop::CreateUnbound(MessagePumpType::DEFAULT));
|
||||
unbound_loop.reset();
|
||||
EXPECT_TRUE(loop.task_runner()->RunsTasksInCurrentSequence());
|
||||
EXPECT_EQ(loop.task_runner(), ThreadTaskRunnerHandle::Get());
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_loop_current.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/threading/thread.h"
|
||||
@ -161,7 +162,7 @@ class MessagePumpGLibTest : public testing::Test {
|
||||
|
||||
// Overridden from testing::Test:
|
||||
void SetUp() override {
|
||||
loop_ = new MessageLoop(MessageLoop::TYPE_UI);
|
||||
loop_ = new MessageLoop(MessagePumpType::UI);
|
||||
injector_ = new EventInjector();
|
||||
}
|
||||
void TearDown() override {
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
@ -32,12 +33,12 @@ namespace base {
|
||||
class MessagePumpLibeventTest : public testing::Test {
|
||||
protected:
|
||||
MessagePumpLibeventTest()
|
||||
: ui_loop_(new MessageLoop(MessageLoop::TYPE_UI)),
|
||||
: ui_loop_(new MessageLoop(MessagePumpType::UI)),
|
||||
io_thread_("MessagePumpLibeventTestIOThread") {}
|
||||
~MessagePumpLibeventTest() override = default;
|
||||
|
||||
void SetUp() override {
|
||||
Thread::Options options(MessageLoop::TYPE_IO, 0);
|
||||
Thread::Options options(MessagePumpType::IO, 0);
|
||||
ASSERT_TRUE(io_thread_.StartWithOptions(options));
|
||||
int ret = pipe(pipefds_);
|
||||
ASSERT_EQ(0, ret);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_loop_current.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/synchronization/condition_variable.h"
|
||||
@ -86,9 +87,9 @@ class ScheduleWorkTest : public testing::Test {
|
||||
base::Unretained(this), schedule_calls));
|
||||
}
|
||||
|
||||
void ScheduleWork(MessageLoop::Type target_type, int num_scheduling_threads) {
|
||||
void ScheduleWork(MessagePumpType target_type, int num_scheduling_threads) {
|
||||
#if defined(OS_ANDROID)
|
||||
if (target_type == MessageLoop::TYPE_JAVA) {
|
||||
if (target_type == MessagePumpType::JAVA) {
|
||||
java_thread_.reset(new JavaHandlerThreadForTest("target"));
|
||||
java_thread_->Start();
|
||||
} else
|
||||
@ -134,7 +135,7 @@ class ScheduleWorkTest : public testing::Test {
|
||||
scheduling_threads[i]->Stop();
|
||||
}
|
||||
#if defined(OS_ANDROID)
|
||||
if (target_type == MessageLoop::TYPE_JAVA) {
|
||||
if (target_type == MessagePumpType::JAVA) {
|
||||
java_thread_->Stop();
|
||||
java_thread_.reset();
|
||||
} else
|
||||
@ -154,11 +155,10 @@ class ScheduleWorkTest : public testing::Test {
|
||||
max_batch_time = std::max(max_batch_time, max_batch_times_[i]);
|
||||
}
|
||||
std::string trace = StringPrintf(
|
||||
"%d_threads_scheduling_to_%s_pump",
|
||||
num_scheduling_threads,
|
||||
target_type == MessageLoop::TYPE_IO
|
||||
"%d_threads_scheduling_to_%s_pump", num_scheduling_threads,
|
||||
target_type == MessagePumpType::IO
|
||||
? "io"
|
||||
: (target_type == MessageLoop::TYPE_UI ? "ui" : "default"));
|
||||
: (target_type == MessagePumpType::UI ? "ui" : "default"));
|
||||
perf_test::PrintResult(
|
||||
"task",
|
||||
"",
|
||||
@ -218,52 +218,52 @@ class ScheduleWorkTest : public testing::Test {
|
||||
};
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToIOFromOneThread) {
|
||||
ScheduleWork(MessageLoop::TYPE_IO, 1);
|
||||
ScheduleWork(MessagePumpType::IO, 1);
|
||||
}
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToIOFromTwoThreads) {
|
||||
ScheduleWork(MessageLoop::TYPE_IO, 2);
|
||||
ScheduleWork(MessagePumpType::IO, 2);
|
||||
}
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToIOFromFourThreads) {
|
||||
ScheduleWork(MessageLoop::TYPE_IO, 4);
|
||||
ScheduleWork(MessagePumpType::IO, 4);
|
||||
}
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToUIFromOneThread) {
|
||||
ScheduleWork(MessageLoop::TYPE_UI, 1);
|
||||
ScheduleWork(MessagePumpType::UI, 1);
|
||||
}
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToUIFromTwoThreads) {
|
||||
ScheduleWork(MessageLoop::TYPE_UI, 2);
|
||||
ScheduleWork(MessagePumpType::UI, 2);
|
||||
}
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToUIFromFourThreads) {
|
||||
ScheduleWork(MessageLoop::TYPE_UI, 4);
|
||||
ScheduleWork(MessagePumpType::UI, 4);
|
||||
}
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToDefaultFromOneThread) {
|
||||
ScheduleWork(MessageLoop::TYPE_DEFAULT, 1);
|
||||
ScheduleWork(MessagePumpType::DEFAULT, 1);
|
||||
}
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToDefaultFromTwoThreads) {
|
||||
ScheduleWork(MessageLoop::TYPE_DEFAULT, 2);
|
||||
ScheduleWork(MessagePumpType::DEFAULT, 2);
|
||||
}
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToDefaultFromFourThreads) {
|
||||
ScheduleWork(MessageLoop::TYPE_DEFAULT, 4);
|
||||
ScheduleWork(MessagePumpType::DEFAULT, 4);
|
||||
}
|
||||
|
||||
#if defined(OS_ANDROID)
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToJavaFromOneThread) {
|
||||
ScheduleWork(MessageLoop::TYPE_JAVA, 1);
|
||||
ScheduleWork(MessagePumpType::JAVA, 1);
|
||||
}
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToJavaFromTwoThreads) {
|
||||
ScheduleWork(MessageLoop::TYPE_JAVA, 2);
|
||||
ScheduleWork(MessagePumpType::JAVA, 2);
|
||||
}
|
||||
|
||||
TEST_F(ScheduleWorkTest, ThreadTimeToJavaFromFourThreads) {
|
||||
ScheduleWork(MessageLoop::TYPE_JAVA, 4);
|
||||
ScheduleWork(MessagePumpType::JAVA, 4);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_for_io.h"
|
||||
#include "base/message_loop/message_pump_for_ui.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/task/single_thread_task_executor.h"
|
||||
#include "base/test/bind_test_util.h"
|
||||
@ -32,9 +33,9 @@ namespace base {
|
||||
|
||||
namespace {
|
||||
|
||||
bool PumpTypeUsesDoSomeWork(MessageLoop::Type type) {
|
||||
bool PumpTypeUsesDoSomeWork(MessagePumpType type) {
|
||||
switch (type) {
|
||||
case MessagePump::Type::DEFAULT:
|
||||
case MessagePumpType::DEFAULT:
|
||||
#if defined(OS_IOS)
|
||||
// iOS uses a MessagePumpCFRunLoop instead of MessagePumpDefault for
|
||||
// TYPE_DEFAULT. TODO(gab): migrate MessagePumpCFRunLoop too.
|
||||
@ -43,7 +44,7 @@ bool PumpTypeUsesDoSomeWork(MessageLoop::Type type) {
|
||||
return true;
|
||||
#endif
|
||||
|
||||
case MessagePump::Type::UI:
|
||||
case MessagePumpType::UI:
|
||||
#if defined(OS_IOS)
|
||||
// iOS uses a MessagePumpDefault for UI in unit tests, ref.
|
||||
// test_support_ios.mm::CreateMessagePumpForUIForTests().
|
||||
@ -60,7 +61,7 @@ bool PumpTypeUsesDoSomeWork(MessageLoop::Type type) {
|
||||
return false;
|
||||
#endif
|
||||
|
||||
case MessagePump::Type::IO:
|
||||
case MessagePumpType::IO:
|
||||
#if defined(OS_WIN) || (defined(OS_MACOSX) && !defined(OS_IOS))
|
||||
return true;
|
||||
#elif defined(OS_POSIX) && !defined(OS_NACL_SFI)
|
||||
@ -73,15 +74,15 @@ bool PumpTypeUsesDoSomeWork(MessageLoop::Type type) {
|
||||
return false;
|
||||
#endif
|
||||
|
||||
case MessagePump::Type::CUSTOM:
|
||||
case MessagePumpType::CUSTOM:
|
||||
#if defined(OS_ANDROID)
|
||||
case MessagePump::Type::JAVA:
|
||||
case MessagePumpType::JAVA:
|
||||
#endif // defined(OS_ANDROID)
|
||||
#if defined(OS_MACOSX)
|
||||
case MessagePump::Type::NS_RUNLOOP:
|
||||
case MessagePumpType::NS_RUNLOOP:
|
||||
#endif // defined(OS_MACOSX)
|
||||
#if defined(OS_WIN)
|
||||
case MessagePump::Type::UI_WITH_WM_QUIT_SUPPORT:
|
||||
case MessagePumpType::UI_WITH_WM_QUIT_SUPPORT:
|
||||
#endif // defined(OS_WIN)
|
||||
// Not tested in this file.
|
||||
NOTREACHED();
|
||||
@ -106,7 +107,7 @@ class MockMessagePumpDelegate : public MessagePump::Delegate {
|
||||
DISALLOW_COPY_AND_ASSIGN(MockMessagePumpDelegate);
|
||||
};
|
||||
|
||||
class MessagePumpTest : public ::testing::TestWithParam<MessageLoop::Type> {
|
||||
class MessagePumpTest : public ::testing::TestWithParam<MessagePumpType> {
|
||||
public:
|
||||
MessagePumpTest() : message_pump_(MessagePump::Create(GetParam())) {}
|
||||
|
||||
@ -357,15 +358,15 @@ TEST_P(MessagePumpTest, NestedRunWithoutScheduleWorkInvokesDoWork) {
|
||||
|
||||
INSTANTIATE_TEST_SUITE_P(,
|
||||
MessagePumpTest,
|
||||
::testing::Values(MessageLoop::TYPE_DEFAULT,
|
||||
MessageLoop::TYPE_UI,
|
||||
MessageLoop::TYPE_IO));
|
||||
::testing::Values(MessagePumpType::DEFAULT,
|
||||
MessagePumpType::UI,
|
||||
MessagePumpType::IO));
|
||||
|
||||
#if defined(OS_WIN)
|
||||
|
||||
TEST(MessagePumpTestWin, WmQuitIsNotIgnoredWithEnableWmQuit) {
|
||||
SingleThreadTaskExecutor task_executor(
|
||||
MessagePump::Type::UI_WITH_WM_QUIT_SUPPORT);
|
||||
MessagePumpType::UI_WITH_WM_QUIT_SUPPORT);
|
||||
|
||||
// Post a WM_QUIT message to the current thread.
|
||||
::PostQuitMessage(0);
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "base/base_export.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/task/thread_pool/task_tracker.h"
|
||||
#include "base/threading/platform_thread.h"
|
||||
|
||||
@ -29,7 +30,7 @@ class BASE_EXPORT TaskTrackerPosix : public TaskTracker {
|
||||
|
||||
// Sets the task runner with which to setup FileDescriptorWatcher in
|
||||
// the scope in which tasks run. |io_thread_task_runner| must refer to
|
||||
// a Thread with MessageLoop::TYPE_IO.
|
||||
// a Thread with MessagePumpType::IO.
|
||||
// Must be called before starting to run tasks.
|
||||
// External synchronization is required between a call to this and a call to
|
||||
// RunTask().
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/sequence_token.h"
|
||||
@ -35,7 +35,7 @@ class ThreadPoolTaskTrackerPosixTest : public testing::Test {
|
||||
public:
|
||||
ThreadPoolTaskTrackerPosixTest() : service_thread_("ServiceThread") {
|
||||
Thread::Options service_thread_options;
|
||||
service_thread_options.message_loop_type = MessageLoop::TYPE_IO;
|
||||
service_thread_options.message_pump_type = MessagePumpType::IO;
|
||||
service_thread_.StartWithOptions(service_thread_options);
|
||||
tracker_.set_io_thread_task_runner(service_thread_.task_runner());
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/field_trial_params.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/string_util.h"
|
||||
@ -142,11 +142,11 @@ void ThreadPoolImpl::Start(const ThreadPoolInstance::InitParams& init_params,
|
||||
// SFI), the service thread runs a MessageLoopForIO which is used to support
|
||||
// FileDescriptorWatcher in the scope in which tasks run.
|
||||
ServiceThread::Options service_thread_options;
|
||||
service_thread_options.message_loop_type =
|
||||
service_thread_options.message_pump_type =
|
||||
#if defined(OS_POSIX) && !defined(OS_NACL_SFI)
|
||||
MessageLoop::TYPE_IO;
|
||||
MessagePumpType::IO;
|
||||
#else
|
||||
MessageLoop::TYPE_DEFAULT;
|
||||
MessagePumpType::DEFAULT;
|
||||
#endif
|
||||
service_thread_options.timer_slack = TIMER_SLACK_MAXIMUM;
|
||||
CHECK(service_thread_->StartWithOptions(service_thread_options));
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "base/test/test_io_thread.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
@ -29,7 +29,7 @@ void TestIOThread::Start() {
|
||||
CHECK(!io_thread_started_);
|
||||
io_thread_started_ = true;
|
||||
CHECK(io_thread_.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0)));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0)));
|
||||
}
|
||||
|
||||
void TestIOThread::Stop() {
|
||||
|
@ -9,7 +9,7 @@ namespace base {
|
||||
|
||||
TestMessageLoop::TestMessageLoop() = default;
|
||||
|
||||
TestMessageLoop::TestMessageLoop(MessageLoop::Type type) : loop_(type) {}
|
||||
TestMessageLoop::TestMessageLoop(MessagePumpType type) : loop_(type) {}
|
||||
|
||||
TestMessageLoop::~TestMessageLoop() {
|
||||
RunLoop().RunUntilIdle();
|
||||
|
@ -6,6 +6,7 @@
|
||||
#define BASE_TEST_TEST_MESSAGE_LOOP_H_
|
||||
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
@ -18,7 +19,7 @@ namespace base {
|
||||
class TestMessageLoop {
|
||||
public:
|
||||
TestMessageLoop();
|
||||
explicit TestMessageLoop(MessageLoop::Type type);
|
||||
explicit TestMessageLoop(MessagePumpType type);
|
||||
~TestMessageLoop();
|
||||
|
||||
scoped_refptr<SingleThreadTaskRunner> task_runner() {
|
||||
|
@ -42,8 +42,8 @@ base::LazyInstance<base::ThreadLocalBoolean>::Leaky lazy_tls_bool =
|
||||
|
||||
Thread::Options::Options() = default;
|
||||
|
||||
Thread::Options::Options(MessageLoop::Type type, size_t size)
|
||||
: message_loop_type(type), stack_size(size) {}
|
||||
Thread::Options::Options(MessagePumpType type, size_t size)
|
||||
: message_pump_type(type), stack_size(size) {}
|
||||
|
||||
Thread::Options::Options(Options&& other) = default;
|
||||
|
||||
@ -72,7 +72,7 @@ bool Thread::Start() {
|
||||
Options options;
|
||||
#if defined(OS_WIN)
|
||||
if (com_status_ == STA)
|
||||
options.message_loop_type = MessageLoop::TYPE_UI;
|
||||
options.message_pump_type = MessagePumpType::UI;
|
||||
#endif
|
||||
return StartWithOptions(options);
|
||||
}
|
||||
@ -85,7 +85,7 @@ bool Thread::StartWithOptions(const Options& options) {
|
||||
<< "not allowed!";
|
||||
#if defined(OS_WIN)
|
||||
DCHECK((com_status_ != STA) ||
|
||||
(options.message_loop_type == MessageLoop::TYPE_UI));
|
||||
(options.message_pump_type == MessagePumpType::UI));
|
||||
#endif
|
||||
|
||||
// Reset |id_| here to support restarting the thread.
|
||||
@ -104,7 +104,7 @@ bool Thread::StartWithOptions(const Options& options) {
|
||||
MessageLoop::CreateUnbound(options.message_pump_factory.Run()));
|
||||
} else {
|
||||
task_environment_ = std::make_unique<internal::MessageLoopTaskEnvironment>(
|
||||
MessageLoop::CreateUnbound(options.message_loop_type));
|
||||
MessageLoop::CreateUnbound(options.message_pump_type));
|
||||
}
|
||||
|
||||
start_event_.Reset();
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_loop_current.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/message_loop/timer_slack.h"
|
||||
#include "base/sequence_checker.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
@ -76,13 +77,13 @@ class BASE_EXPORT Thread : PlatformThread::Delegate {
|
||||
RepeatingCallback<std::unique_ptr<MessagePump>()>;
|
||||
|
||||
Options();
|
||||
Options(MessageLoop::Type type, size_t size);
|
||||
Options(MessagePumpType type, size_t size);
|
||||
Options(Options&& other);
|
||||
~Options();
|
||||
|
||||
// Specifies the type of message loop that will be allocated on the thread.
|
||||
// Specifies the type of message pump that will be allocated on the thread.
|
||||
// This is ignored if message_pump_factory.is_null() is false.
|
||||
MessageLoop::Type message_loop_type = MessageLoop::TYPE_DEFAULT;
|
||||
MessagePumpType message_pump_type = MessagePump::Type::DEFAULT;
|
||||
|
||||
// An unbound TaskEnvironment that will be bound to the thread. Ownership
|
||||
// of |task_environment| will be transferred to the thread.
|
||||
@ -94,8 +95,8 @@ class BASE_EXPORT Thread : PlatformThread::Delegate {
|
||||
|
||||
// Used to create the MessagePump for the MessageLoop. The callback is Run()
|
||||
// on the thread. If message_pump_factory.is_null(), then a MessagePump
|
||||
// appropriate for |message_loop_type| is created. Setting this forces the
|
||||
// MessageLoop::Type to TYPE_CUSTOM. This is not compatible with a non-null
|
||||
// appropriate for |message_pump_type| is created. Setting this forces the
|
||||
// MessagePumpType to TYPE_CUSTOM. This is not compatible with a non-null
|
||||
// |task_environment|.
|
||||
MessagePumpFactory message_pump_factory;
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "base/mac/mac_logging.h"
|
||||
#include "base/mac/scoped_nsautorelease_pool.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
@ -122,7 +123,7 @@ int APP_SHIM_ENTRY_POINT_NAME(const app_mode::ChromeAppModeInfo* info) {
|
||||
|
||||
// Launch the IO thread.
|
||||
base::Thread::Options io_thread_options;
|
||||
io_thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
io_thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
base::Thread *io_thread = new base::Thread("CrAppShimIO");
|
||||
io_thread->StartWithOptions(io_thread_options);
|
||||
|
||||
@ -136,8 +137,7 @@ int APP_SHIM_ENTRY_POINT_NAME(const app_mode::ChromeAppModeInfo* info) {
|
||||
[AppShimApplication sharedApplication];
|
||||
CHECK([NSApp isKindOfClass:[AppShimApplication class]]);
|
||||
|
||||
base::SingleThreadTaskExecutor main_task_executor(
|
||||
base::MessagePump::Type::UI);
|
||||
base::SingleThreadTaskExecutor main_task_executor(base::MessagePumpType::UI);
|
||||
ui::WindowResizeHelperMac::Get()->Init(main_task_executor.task_runner());
|
||||
base::PlatformThread::SetName("CrAppShimMain");
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/location.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/strings/strcat.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
@ -516,7 +516,7 @@ AndroidDeviceManager::HandlerThread::HandlerThread() {
|
||||
instance_ = this;
|
||||
thread_ = new base::Thread(kDevToolsAdbBridgeThreadName);
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
if (!thread_->StartWithOptions(options)) {
|
||||
delete thread_;
|
||||
thread_ = nullptr;
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/debug/dump_without_crashing.h"
|
||||
#include "base/memory/singleton.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
@ -171,7 +171,7 @@ void ServiceDiscoveryClientMac::StartThreadIfNotStarted() {
|
||||
service_discovery_thread_.reset(
|
||||
new base::Thread(kServiceDiscoveryThreadName));
|
||||
// Only TYPE_UI uses an NSRunLoop.
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_UI, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::UI, 0);
|
||||
service_discovery_thread_->StartWithOptions(options);
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/hash/hash.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/task/post_task.h"
|
||||
@ -236,9 +237,9 @@ NativeDesktopMediaList::NativeDesktopMediaList(
|
||||
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
||||
// On Windows/OSX the thread must be a UI thread.
|
||||
base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_UI;
|
||||
base::MessagePumpType thread_type = base::MessagePump::Type::UI;
|
||||
#else
|
||||
base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT;
|
||||
base::MessagePumpType thread_type = base::MessagePump::Type::DEFAULT;
|
||||
#endif
|
||||
thread_.StartWithOptions(base::Thread::Options(thread_type, 0));
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/scoped_temp_dir.h"
|
||||
#include "base/message_loop/message_pump.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/process/kill.h"
|
||||
#include "base/process/process.h"
|
||||
#include "base/rand_util.h"
|
||||
@ -136,7 +137,7 @@ bool TestServiceProcess::Initialize(
|
||||
quit_closure_ = std::move(quit_closure);
|
||||
service_process_state_ = std::move(state);
|
||||
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
io_thread_.reset(new base::Thread("TestServiceProcess_IO"));
|
||||
return io_thread_->StartWithOptions(options);
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/sequenced_task_runner.h"
|
||||
#include "base/stl_util.h"
|
||||
@ -598,7 +599,7 @@ int MockChromeCleanerProcess::Run() {
|
||||
if (options_.crash_point() == CrashPoint::kOnStartup)
|
||||
exit(kDeliberateCrashExitCode);
|
||||
|
||||
base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options thread_options(base::MessagePumpType::IO, 0);
|
||||
base::Thread io_thread("IPCThread");
|
||||
EXPECT_TRUE(io_thread.StartWithOptions(thread_options));
|
||||
if (::testing::Test::HasFailure())
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "base/files/file.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "base/process/kill.h"
|
||||
#include "base/process/launch.h"
|
||||
@ -154,7 +155,7 @@ void RecoveryComponent::SetHttpAgentFactoryForTesting(
|
||||
|
||||
void RecoveryComponent::PreScan() {
|
||||
bool success = recovery_io_thread_.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
DCHECK(success) << "Can't start File Thread!";
|
||||
|
||||
recovery_io_thread_.task_runner()->PostTask(
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "mojo/core/embedder/embedder.h"
|
||||
|
||||
namespace chrome_cleaner {
|
||||
@ -58,7 +58,7 @@ MojoTaskRunner::~MojoTaskRunner() {
|
||||
bool MojoTaskRunner::Initialize() {
|
||||
io_thread_ = std::make_unique<base::Thread>("MojoThread");
|
||||
if (!io_thread_->StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0))) {
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0))) {
|
||||
io_thread_.reset();
|
||||
return false;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "base/mac/scoped_nsobject.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/process/launch.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
@ -44,7 +45,7 @@ class ServiceProcessStateFileManipulationTest : public ::testing::Test {
|
||||
|
||||
void SetUp() override {
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
ASSERT_TRUE(io_thread_.StartWithOptions(options));
|
||||
ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
|
||||
ASSERT_TRUE(MockLaunchd::MakeABundle(GetTempDirPath(), "Test",
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
#include "base/at_exit.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/strings/string_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "base/test/multiprocess_test.h"
|
||||
@ -98,7 +99,7 @@ ServiceProcessStateTest::~ServiceProcessStateTest() {
|
||||
}
|
||||
|
||||
void ServiceProcessStateTest::SetUp() {
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
ASSERT_TRUE(io_thread_.StartWithOptions(options));
|
||||
}
|
||||
|
||||
@ -233,7 +234,7 @@ MULTIPROCESS_TEST_MAIN(ServiceProcessStateTestShutdown) {
|
||||
base::test::ScopedTaskEnvironment scoped_task_environment;
|
||||
base::RunLoop run_loop;
|
||||
base::Thread io_thread_("ServiceProcessStateTestShutdownIOThread");
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
EXPECT_TRUE(io_thread_.StartWithOptions(options));
|
||||
ServiceProcessState state;
|
||||
EXPECT_TRUE(state.Initialize());
|
||||
|
@ -95,7 +95,7 @@ ServiceIPCServerTest::ServiceIPCServerTest()
|
||||
void ServiceIPCServerTest::SetUp() {
|
||||
base::Thread::Options options;
|
||||
mojo::MessagePipe channel;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
ASSERT_TRUE(io_thread_.StartWithOptions(options));
|
||||
|
||||
server_.reset(new ServiceIPCServer(&service_process_client_,
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "base/location.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/singleton.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
@ -175,7 +175,7 @@ bool ServiceProcess::Initialize(base::OnceClosure quit_closure,
|
||||
|
||||
// Initialize the IO and FILE threads.
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
io_thread_.reset(new ServiceIOThread("ServiceProcess_IO"));
|
||||
if (!io_thread_->StartWithOptions(options)) {
|
||||
NOTREACHED();
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/location.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
@ -41,7 +41,7 @@ class FetchUrlTest : public testing::Test,
|
||||
response_(kSendHello),
|
||||
scoped_task_environment_(
|
||||
base::test::ScopedTaskEnvironment::MainThreadType::IO) {
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
CHECK(io_thread_.StartWithOptions(options));
|
||||
|
||||
base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/threading/platform_thread.h"
|
||||
#include "base/threading/thread.h"
|
||||
@ -29,7 +29,7 @@ class SyncWebSocketImplTest : public testing::Test {
|
||||
~SyncWebSocketImplTest() override {}
|
||||
|
||||
void SetUp() override {
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
ASSERT_TRUE(client_thread_.StartWithOptions(options));
|
||||
context_getter_ = new URLRequestContextGetter(client_thread_.task_runner());
|
||||
ASSERT_TRUE(server_.Start());
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/stl_util.h"
|
||||
@ -352,7 +353,7 @@ void RunServer(uint16_t port,
|
||||
int adb_port) {
|
||||
base::Thread io_thread("ChromeDriver IO");
|
||||
CHECK(io_thread.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0)));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0)));
|
||||
|
||||
base::SingleThreadTaskExecutor main_task_executor;
|
||||
base::RunLoop cmd_run_loop;
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include "base/message_loop/message_pump_mac.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
@ -18,7 +19,7 @@ namespace image_writer {
|
||||
|
||||
DiskUnmounterMac::DiskUnmounterMac() : cf_thread_("ImageWriterDiskArb") {
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_UI;
|
||||
options.message_pump_type = base::MessagePumpType::UI;
|
||||
|
||||
cf_thread_.StartWithOptions(options);
|
||||
}
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/values.h"
|
||||
#include "chromecast/base/serializers.h"
|
||||
@ -238,7 +239,7 @@ void AssertBasicOperationsSuccessful(const DeviceCapabilities* capabilities) {
|
||||
class DeviceCapabilitiesImplTest : public ::testing::Test {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO));
|
||||
message_loop_.reset(new base::MessageLoop(base::MessagePumpType::IO));
|
||||
capabilities_ = DeviceCapabilities::Create();
|
||||
mock_capabilities_observer_.reset(new MockCapabilitiesObserver());
|
||||
capabilities_->AddCapabilitiesObserver(mock_capabilities_observer_.get());
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/test/mock_callback.h"
|
||||
#include "base/test/test_mock_time_task_runner.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
@ -167,7 +168,7 @@ class GattClientManagerTest : public ::testing::Test {
|
||||
void SetUp() override {
|
||||
fake_task_runner_ = new base::TestMockTimeTaskRunner();
|
||||
message_loop_ =
|
||||
std::make_unique<base::MessageLoop>(base::MessageLoop::TYPE_DEFAULT);
|
||||
std::make_unique<base::MessageLoop>(base::MessagePumpType::DEFAULT);
|
||||
message_loop_->SetTaskRunner(fake_task_runner_);
|
||||
gatt_client_ = std::make_unique<bluetooth_v2_shlib::MockGattClient>();
|
||||
gatt_client_manager_ =
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/location.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/sequenced_task_runner.h"
|
||||
#include "base/threading/thread.h"
|
||||
@ -60,7 +61,7 @@ BrokerService::BrokerService(service_manager::mojom::ServiceRequest request)
|
||||
: service_binding_(this, std::move(request)) {
|
||||
io_thread_ = std::make_unique<base::Thread>("external_mojo");
|
||||
io_thread_->StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
|
||||
std::vector<std::string> external_services_to_proxy;
|
||||
const service_manager::Manifest& manifest = GetManifest();
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include "base/callback.h"
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/threading/sequenced_task_runner_handle.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/timer/timer.h"
|
||||
@ -161,7 +162,7 @@ CaptureServiceReceiver::CaptureServiceReceiver(
|
||||
const ::media::AudioParameters& audio_params)
|
||||
: audio_params_(audio_params), io_thread_(__func__) {
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
// TODO(b/137106361): Tweak the thread priority once the thread priority for
|
||||
// speech processing gets fixed.
|
||||
options.priority = base::ThreadPriority::DISPLAY;
|
||||
|
@ -14,6 +14,7 @@
|
||||
#include "base/callback_helpers.h"
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
#include "chromecast/base/bind_to_task_runner.h"
|
||||
@ -483,7 +484,7 @@ CastAudioOutputStream::MixerServiceWrapper::MixerServiceWrapper(
|
||||
DETACH_FROM_THREAD(io_thread_checker_);
|
||||
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
options.priority = base::ThreadPriority::REALTIME_AUDIO;
|
||||
CHECK(io_thread_.StartWithOptions(options));
|
||||
io_task_runner_ = io_thread_.task_runner();
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "chromecast/base/init_command_line_shlib.h"
|
||||
#include "chromecast/base/serializers.h"
|
||||
@ -45,7 +45,7 @@ VolumeControlAndroid::VolumeControlAndroid()
|
||||
base::android::AttachCurrentThread(), reinterpret_cast<intptr_t>(this)));
|
||||
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
thread_.StartWithOptions(options);
|
||||
|
||||
thread_.task_runner()->PostTask(
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "base/json/json_reader.h"
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/sequenced_task_runner.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
@ -59,7 +59,7 @@ CastAudioJsonProviderImpl::CastAudioJsonProviderImpl()
|
||||
: thread_("cast_audio_json_provider"),
|
||||
cast_audio_watcher_(std::make_unique<base::FilePathWatcher>()) {
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
thread_.StartWithOptions(options);
|
||||
task_runner_ = thread_.task_runner();
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/numerics/ranges.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
@ -39,7 +39,7 @@ class VolumeControlInternal {
|
||||
}
|
||||
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
thread_.StartWithOptions(options);
|
||||
}
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "base/bind_helpers.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
@ -185,7 +186,7 @@ StreamMixer::StreamMixer(
|
||||
options.priority = base::ThreadPriority::REALTIME_AUDIO;
|
||||
#if defined(OS_FUCHSIA)
|
||||
// MixerOutputStreamFuchsia uses FIDL, which works only on IO threads.
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
#endif
|
||||
mixer_thread_->StartWithOptions(options);
|
||||
mixer_task_runner_ = mixer_thread_->task_runner();
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/synchronization/lock.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
@ -124,7 +124,7 @@ class VolumeControlInternal : public SystemVolumeControl::Delegate {
|
||||
}
|
||||
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
thread_.StartWithOptions(options);
|
||||
|
||||
thread_.task_runner()->PostTask(
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "base/command_line.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/system/sys_info.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "chromeos/dbus/arc_keymaster_client.h"
|
||||
@ -61,7 +61,7 @@ DBusThreadManager::DBusThreadManager(ClientSet client_set,
|
||||
if (use_real_clients) {
|
||||
// Create the D-Bus thread.
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
dbus_thread_.reset(new base::Thread("D-Bus thread"));
|
||||
dbus_thread_->StartWithOptions(thread_options);
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "base/callback.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/location.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
@ -146,7 +147,7 @@ class ProcessOutputWatcherTest : public testing::Test {
|
||||
ASSERT_FALSE(output_watch_thread_started_);
|
||||
output_watch_thread_.reset(new base::Thread("ProcessOutpuWatchThread"));
|
||||
output_watch_thread_started_ = output_watch_thread_->StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
ASSERT_TRUE(output_watch_thread_started_);
|
||||
|
||||
int pt_pipe[2];
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/sequenced_task_runner.h"
|
||||
#include "base/task/lazy_task_runner.h"
|
||||
|
||||
@ -185,7 +185,7 @@ bool ProcessProxyRegistry::EnsureWatcherThreadStarted() {
|
||||
// spinning a new thread.
|
||||
watcher_thread_.reset(new base::Thread(kWatcherThreadName));
|
||||
return watcher_thread_->StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
}
|
||||
|
||||
base::ProcessHandle ProcessProxyRegistry::GetProcessHandleForTesting(
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/test/scoped_task_environment.h"
|
||||
#include "base/threading/thread.h"
|
||||
@ -39,7 +40,7 @@ class ServiceConnectionTest : public testing::Test {
|
||||
static void SetUpTestCase() {
|
||||
static base::Thread ipc_thread("ipc");
|
||||
ipc_thread.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
static mojo::core::ScopedIPCSupport ipc_support(
|
||||
ipc_thread.task_runner(),
|
||||
mojo::core::ScopedIPCSupport::ShutdownPolicy::CLEAN);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "base/base_switches.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/process/launch.h"
|
||||
#include "base/process/process.h"
|
||||
@ -143,7 +144,7 @@ class MonitoredProcessClient {
|
||||
// Creates a thread then creates the message window on it.
|
||||
void CreateMessageWindow() {
|
||||
ASSERT_TRUE(message_window_thread_.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_UI, 0)));
|
||||
base::Thread::Options(base::MessagePumpType::UI, 0)));
|
||||
|
||||
bool succeeded = false;
|
||||
base::WaitableEvent created(
|
||||
@ -259,7 +260,7 @@ class HangMonitorThread {
|
||||
// window for |process|. Blocks until the monitor has been initialized.
|
||||
bool Start(base::Process process) {
|
||||
if (!thread_.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_UI, 0))) {
|
||||
base::Thread::Options(base::MessagePumpType::UI, 0))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_loop_current.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
#include "base/task/single_thread_task_executor.h"
|
||||
#include "base/task/thread_pool/thread_pool.h"
|
||||
@ -112,7 +113,7 @@ void JNI_CronetLibraryLoader_CronetInitOnInitThread(JNIEnv* env) {
|
||||
DCHECK(!base::MessageLoopCurrent::IsSet());
|
||||
DCHECK(!g_init_task_executor);
|
||||
g_init_task_executor =
|
||||
new base::SingleThreadTaskExecutor(base::MessageLoop::Type::JAVA);
|
||||
new base::SingleThreadTaskExecutor(base::MessagePumpType::JAVA);
|
||||
|
||||
// In integrated mode, NetworkChangeNotifier has been initialized by the host.
|
||||
#if BUILDFLAG(INTEGRATED_MODE)
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/test/test_support_android.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "components/cronet/android/cronet_tests_jni_headers/QuicTestServer_jni.h"
|
||||
@ -88,7 +88,7 @@ void JNI_QuicTestServer_StartQuicTestServer(
|
||||
|
||||
g_quic_server_thread = new base::Thread("quic server thread");
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
bool started = g_quic_server_thread->StartWithOptions(thread_options);
|
||||
DCHECK(started);
|
||||
base::FilePath test_files_root(
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/metrics/statistics_recorder.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
@ -149,7 +149,7 @@ CronetURLRequestContext::CronetURLRequestContext(
|
||||
if (!network_task_runner_) {
|
||||
network_thread_ = std::make_unique<base::Thread>("network");
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
network_thread_->StartWithOptions(options);
|
||||
network_task_runner_ = network_thread_->task_runner();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "base/files/scoped_file.h"
|
||||
#include "base/mac/foundation_util.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/synchronization/waitable_event.h"
|
||||
@ -250,7 +250,7 @@ void CronetEnvironment::Start() {
|
||||
// Threads setup.
|
||||
file_thread_.reset(new base::Thread("Chrome File Thread"));
|
||||
file_thread_->StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
// Fetching the task_runner will create the shared thread if necessary.
|
||||
scoped_refptr<base::SingleThreadTaskRunner> task_runner =
|
||||
ios_global_state::GetSharedNetworkIOThreadTaskRunner();
|
||||
@ -258,7 +258,7 @@ void CronetEnvironment::Start() {
|
||||
network_io_thread_.reset(
|
||||
new CronetNetworkThread("Chrome Network IO Thread", this));
|
||||
network_io_thread_->StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
}
|
||||
|
||||
net::SetCookieStoreIOSClient(new CronetCookieStoreIOSClient(
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/guid.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/test/bind_test_util.h"
|
||||
#include "base/test/scoped_task_environment.h"
|
||||
@ -89,7 +89,7 @@ class InMemoryDownloadTest : public testing::Test {
|
||||
|
||||
void SetUp() override {
|
||||
io_thread_.reset(new base::Thread("Network and Blob IO thread"));
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
io_thread_->StartWithOptions(options);
|
||||
|
||||
base::RunLoop loop;
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/scoped_temp_dir.h"
|
||||
#include "base/i18n/rtl.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/test/icu_test_util.h"
|
||||
#include "components/exo/display.h"
|
||||
@ -34,7 +35,7 @@ ServerEnvironment::ServerEnvironment()
|
||||
|
||||
base::CommandLine::Init(0, nullptr);
|
||||
|
||||
base::Thread::Options ui_options(base::MessageLoop::TYPE_UI, 0);
|
||||
base::Thread::Options ui_options(base::MessagePumpType::UI, 0);
|
||||
ui_thread_.StartWithOptions(ui_options);
|
||||
WaylandClientTestHelper::SetUIThreadTaskRunner(ui_thread_.task_runner());
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
@ -116,7 +116,7 @@ void CreateRequestContextGetterIfNecessary() {
|
||||
static base::Thread* test_io_thread_ =
|
||||
new base::Thread("grpc_support_test_io_thread");
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
bool started = test_io_thread_->StartWithOptions(options);
|
||||
DCHECK(started);
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "base/bind_helpers.h"
|
||||
#include "base/location.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/test/scoped_task_environment.h"
|
||||
#include "base/threading/thread.h"
|
||||
@ -39,7 +40,7 @@ class NonBlockingInvalidatorTestDelegate {
|
||||
invalidation_state_tracker) {
|
||||
DCHECK(!invalidator_);
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
io_thread_.StartWithOptions(options);
|
||||
net_config_helper_ =
|
||||
std::make_unique<jingle_glue::NetworkServiceConfigTestUtil>(
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/read_only_shared_memory_region.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/rand_util.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
@ -163,7 +163,7 @@ NaClListener::NaClListener()
|
||||
#endif
|
||||
is_started_(false) {
|
||||
io_thread_.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
DCHECK(g_listener == NULL);
|
||||
g_listener = this;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/file_descriptor_posix.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/rand_util.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "build/build_config.h"
|
||||
@ -41,7 +41,7 @@ NonSfiListener::NonSfiListener()
|
||||
base::WaitableEvent::InitialState::NOT_SIGNALED),
|
||||
key_fd_map_(new std::map<std::string, int>) {
|
||||
io_thread_.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
}
|
||||
|
||||
NonSfiListener::~NonSfiListener() {
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/bit_cast.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
@ -53,7 +53,7 @@ class MAYBE_SyncHttpBridgeTest : public testing::Test {
|
||||
|
||||
void SetUp() override {
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
io_thread_.StartWithOptions(options);
|
||||
|
||||
HttpBridge::SetIOCapableTaskRunnerForTest(io_thread_.task_runner());
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "components/viz/common/frame_sinks/begin_frame_source.h"
|
||||
#include "components/viz/service/main/viz_compositor_thread_runner.h"
|
||||
|
||||
@ -22,7 +22,7 @@ DemoService::DemoService(viz::mojom::FrameSinkManagerRequest request,
|
||||
params->frame_sink_manager = std::move(request);
|
||||
params->frame_sink_manager_client = client.PassInterface();
|
||||
runner_ = std::make_unique<viz::VizCompositorThreadRunner>(
|
||||
base::MessageLoop::TYPE_DEFAULT);
|
||||
base::MessagePumpType::DEFAULT);
|
||||
runner_->CreateFrameSinkManager(std::move(params));
|
||||
}
|
||||
|
||||
|
@ -41,7 +41,7 @@ namespace {
|
||||
const char kThreadName[] = "VizCompositorThread";
|
||||
|
||||
std::unique_ptr<VizCompositorThreadType> CreateAndStartCompositorThread(
|
||||
base::MessageLoop::Type message_loop_type) {
|
||||
base::MessagePumpType message_pump_type) {
|
||||
const base::ThreadPriority thread_priority =
|
||||
base::FeatureList::IsEnabled(features::kGpuUseDisplayThreadPriority)
|
||||
? base::ThreadPriority::DISPLAY
|
||||
@ -55,7 +55,7 @@ std::unique_ptr<VizCompositorThreadType> CreateAndStartCompositorThread(
|
||||
auto thread = std::make_unique<base::Thread>(kThreadName);
|
||||
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = message_loop_type;
|
||||
thread_options.message_pump_type = message_pump_type;
|
||||
|
||||
#if defined(OS_MACOSX)
|
||||
// Increase the thread priority to get more reliable values in performance
|
||||
@ -77,8 +77,8 @@ std::unique_ptr<VizCompositorThreadType> CreateAndStartCompositorThread(
|
||||
} // namespace
|
||||
|
||||
VizCompositorThreadRunner::VizCompositorThreadRunner(
|
||||
base::MessageLoop::Type message_loop_type)
|
||||
: thread_(CreateAndStartCompositorThread(message_loop_type)),
|
||||
base::MessagePumpType message_pump_type)
|
||||
: thread_(CreateAndStartCompositorThread(message_pump_type)),
|
||||
task_runner_(thread_->task_runner()) {}
|
||||
|
||||
VizCompositorThreadRunner::~VizCompositorThreadRunner() {
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "build/build_config.h"
|
||||
#include "services/network/public/mojom/tcp_socket.mojom.h"
|
||||
#include "services/viz/privileged/mojom/viz_main.mojom.h"
|
||||
@ -49,7 +49,7 @@ using VizCompositorThreadType = base::Thread;
|
||||
// and then stop the thread.
|
||||
class VizCompositorThreadRunner {
|
||||
public:
|
||||
explicit VizCompositorThreadRunner(base::MessageLoop::Type message_loop_type);
|
||||
explicit VizCompositorThreadRunner(base::MessagePumpType message_pump_type);
|
||||
// Performs teardown on thread and then stops thread.
|
||||
~VizCompositorThreadRunner();
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/power_monitor/power_monitor.h"
|
||||
#include "base/power_monitor/power_monitor_device_source.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
@ -37,7 +37,7 @@ namespace {
|
||||
std::unique_ptr<base::Thread> CreateAndStartIOThread() {
|
||||
// TODO(sad): We do not need the IO thread once gpu has a separate process.
|
||||
// It should be possible to use |main_task_runner_| for doing IO tasks.
|
||||
base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options thread_options(base::MessagePumpType::IO, 0);
|
||||
// TODO(reveman): Remove this in favor of setting it explicitly for each
|
||||
// type of process.
|
||||
if (base::FeatureList::IsEnabled(features::kGpuUseDisplayThreadPriority))
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/containers/stack.h"
|
||||
#include "base/location.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/pickle.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/stl_util.h"
|
||||
@ -73,7 +73,7 @@ class AppCacheResponseTest : public testing::Test {
|
||||
scoped_task_environment_ =
|
||||
std::make_unique<base::test::ScopedTaskEnvironment>();
|
||||
io_thread_ = std::make_unique<base::Thread>("AppCacheResponseTest Thread");
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
io_thread_->StartWithOptions(options);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/files/scoped_temp_dir.h"
|
||||
#include "base/location.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/sequenced_task_runner.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/stl_util.h"
|
||||
@ -263,7 +263,7 @@ class AppCacheStorageImplTest : public testing::Test {
|
||||
|
||||
// We start the background thread as TYPE_IO because we also use the
|
||||
// db_thread for the disk_cache which needs to be of TYPE_IO.
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
background_thread =
|
||||
std::make_unique<base::Thread>("AppCacheTest::BackgroundThread");
|
||||
ASSERT_TRUE(background_thread->StartWithOptions(options));
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/pickle.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/stl_util.h"
|
||||
@ -235,7 +235,7 @@ class AppCacheURLRequestJobTest : public testing::Test {
|
||||
std::make_unique<base::test::ScopedTaskEnvironment>();
|
||||
io_thread_ =
|
||||
std::make_unique<base::Thread>("AppCacheURLRequestJobTest Thread");
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
io_thread_->StartWithOptions(options);
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/pickle.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
@ -137,7 +137,7 @@ class TestClientRunner {
|
||||
static void RunTestClient(mojo::ScopedMessagePipeHandle pipe) {
|
||||
base::Thread io_thread("Client IO thread");
|
||||
io_thread.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
ProxyRunner proxy(std::move(pipe), false, io_thread.task_runner());
|
||||
|
||||
mojom::BrowserAssociatedInterfaceTestDriverAssociatedPtr driver;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/debug/dump_without_crashing.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/task/post_task.h"
|
||||
#include "cc/mojo_embedder/async_layer_tree_frame_sink.h"
|
||||
@ -191,7 +191,7 @@ void VizProcessTransportFactory::ConnectHostFrameSinkManager() {
|
||||
// GPU process access is disabled. Start a new thread to run the display
|
||||
// compositor in-process and connect HostFrameSinkManager to it.
|
||||
viz_compositor_thread_ = std::make_unique<viz::VizCompositorThreadRunner>(
|
||||
base::MessageLoop::TYPE_DEFAULT);
|
||||
base::MessagePumpType::DEFAULT);
|
||||
|
||||
viz::mojom::FrameSinkManagerParamsPtr params =
|
||||
viz::mojom::FrameSinkManagerParams::New();
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ref_counted_memory.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
@ -792,7 +793,7 @@ DevToolsHttpHandler::DevToolsHttpHandler(
|
||||
std::unique_ptr<base::Thread> thread(
|
||||
new base::Thread(kDevToolsHandlerThreadName));
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
if (thread->StartWithOptions(options)) {
|
||||
auto task_runner = thread->task_runner();
|
||||
task_runner->PostTask(
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "base/command_line.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/memory/ref_counted_memory.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/sequenced_task_runner.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/string_util.h"
|
||||
@ -248,7 +248,7 @@ DevToolsPipeHandler::DevToolsPipeHandler()
|
||||
: read_fd_(kReadFD), write_fd_(kWriteFD) {
|
||||
read_thread_.reset(new base::Thread(kDevToolsPipeHandlerReadThreadName));
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
if (!read_thread_->StartWithOptions(options)) {
|
||||
read_thread_.reset();
|
||||
Shutdown();
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "base/feature_list.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/field_trial.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
@ -842,7 +842,7 @@ bool GpuProcessHost::Init() {
|
||||
base::Thread::Options options;
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
||||
// WGL needs to create its own window and pump messages on it.
|
||||
options.message_loop_type = base::MessageLoop::TYPE_UI;
|
||||
options.message_pump_type = base::MessagePumpType::UI;
|
||||
#endif
|
||||
if (base::FeatureList::IsEnabled(features::kGpuUseDisplayThreadPriority))
|
||||
options.priority = base::ThreadPriority::DISPLAY;
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
@ -587,9 +587,9 @@ DesktopCaptureDevice::DesktopCaptureDevice(
|
||||
: thread_("desktopCaptureThread") {
|
||||
#if defined(OS_WIN) || defined(OS_MACOSX)
|
||||
// On Windows/OSX the thread must be a UI thread.
|
||||
base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_UI;
|
||||
base::MessagePumpType thread_type = base::MessagePump::Type::UI;
|
||||
#else
|
||||
base::MessageLoop::Type thread_type = base::MessageLoop::TYPE_DEFAULT;
|
||||
base::MessagePumpType thread_type = base::MessagePump::Type::DEFAULT;
|
||||
#endif
|
||||
|
||||
thread_.StartWithOptions(base::Thread::Options(thread_type, 0));
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/memory/shared_memory_mapping.h"
|
||||
#include "base/memory/writable_shared_memory_region.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/field_trial.h"
|
||||
#include "base/metrics/histogram_base.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
@ -1691,11 +1691,11 @@ bool RenderProcessHostImpl::Init() {
|
||||
base::Thread::Options options;
|
||||
#if defined(OS_WIN) && !defined(OS_MACOSX)
|
||||
// In-process plugins require this to be a UI message loop.
|
||||
options.message_loop_type = base::MessageLoop::TYPE_UI;
|
||||
options.message_pump_type = base::MessagePumpType::UI;
|
||||
#else
|
||||
// We can't have multiple UI loops on Linux and Android, so we don't support
|
||||
// in-process plugins.
|
||||
options.message_loop_type = base::MessageLoop::TYPE_DEFAULT;
|
||||
options.message_pump_type = base::MessagePumpType::DEFAULT;
|
||||
#endif
|
||||
// As for execution sequence, this callback should have no any dependency
|
||||
// on starting in-process-render-thread.
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/deferred_sequenced_task_runner.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/task/post_task.h"
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
@ -277,7 +278,7 @@ std::unique_ptr<BrowserProcessSubThread> BrowserTaskExecutor::CreateIOThread() {
|
||||
}
|
||||
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessagePump::Type::IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
options.task_environment =
|
||||
g_browser_task_executor->browser_io_task_environment_.release();
|
||||
// Up the priority of the |io_thread_| as some of its IPCs relate to
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/no_destructor.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/process/process_handle.h"
|
||||
@ -667,7 +667,7 @@ ServiceManagerContext::ServiceManagerContext(
|
||||
scoped_refptr<base::SequencedTaskRunner> task_runner =
|
||||
service_manager_thread_task_runner_;
|
||||
if (base::FeatureList::IsEnabled(kNetworkServiceDedicatedThread)) {
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
network_service_thread_.StartWithOptions(options);
|
||||
task_runner = network_service_thread_.task_runner();
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/process/process_handle.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/task/thread_pool/thread_pool.h"
|
||||
@ -53,7 +53,7 @@ ChildProcess::ChildProcess(base::ThreadPriority io_thread_priority,
|
||||
}
|
||||
|
||||
// We can't recover from failing to start the IO thread.
|
||||
base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options thread_options(base::MessagePumpType::IO, 0);
|
||||
thread_options.priority = io_thread_priority;
|
||||
#if defined(OS_ANDROID)
|
||||
// TODO(reveman): Remove this in favor of setting it explicitly for each type
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/rand_util.h"
|
||||
#include "base/run_loop.h"
|
||||
@ -246,14 +247,14 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
if (command_line.HasSwitch(switches::kHeadless)) {
|
||||
main_thread_task_executor =
|
||||
std::make_unique<base::SingleThreadTaskExecutor>(
|
||||
base::MessagePump::Type::DEFAULT);
|
||||
base::MessagePumpType::DEFAULT);
|
||||
} else {
|
||||
#if defined(OS_WIN)
|
||||
// The GpuMain thread should not be pumping Windows messages because no UI
|
||||
// is expected to run on this thread.
|
||||
main_thread_task_executor =
|
||||
std::make_unique<base::SingleThreadTaskExecutor>(
|
||||
base::MessagePump::Type::DEFAULT);
|
||||
base::MessagePumpType::DEFAULT);
|
||||
#elif defined(USE_X11)
|
||||
// Depending on how Chrome is running there are multiple threads that can
|
||||
// make Xlib function calls. Call XInitThreads() here to be safe, even if
|
||||
@ -267,7 +268,7 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
return RESULT_CODE_GPU_DEAD_ON_ARRIVAL;
|
||||
main_thread_task_executor =
|
||||
std::make_unique<base::SingleThreadTaskExecutor>(
|
||||
base::MessagePump::Type::UI);
|
||||
base::MessagePumpType::UI);
|
||||
event_source = ui::PlatformEventSource::CreateDefault();
|
||||
#elif defined(USE_OZONE)
|
||||
// The MessagePump type required depends on the Ozone platform selected at
|
||||
@ -283,14 +284,14 @@ int GpuMain(const MainFunctionParams& parameters) {
|
||||
// https://crbug.com/312462#c51 and https://crbug.com/783298
|
||||
main_thread_task_executor =
|
||||
std::make_unique<base::SingleThreadTaskExecutor>(
|
||||
base::MessagePump::Type::NS_RUNLOOP);
|
||||
base::MessagePumpType::NS_RUNLOOP);
|
||||
|
||||
// Tell LaunchServices to continue without a connection to the daemon.
|
||||
_LSSetApplicationLaunchServicesServerConnectionStatus(0, nullptr);
|
||||
#else
|
||||
main_thread_task_executor =
|
||||
std::make_unique<base::SingleThreadTaskExecutor>(
|
||||
base::MessagePump::Type::DEFAULT);
|
||||
base::MessagePumpType::DEFAULT);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/test/scoped_task_environment.h"
|
||||
#include "base/threading/thread.h"
|
||||
@ -30,7 +31,7 @@ const int kRenderFrameId = 0;
|
||||
|
||||
std::unique_ptr<base::Thread> MakeIOThread() {
|
||||
auto io_thread = std::make_unique<base::Thread>("test IO thread");
|
||||
base::Thread::Options thread_options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options thread_options(base::MessagePumpType::IO, 0);
|
||||
CHECK(io_thread->StartWithOptions(thread_options));
|
||||
return io_thread;
|
||||
}
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/discardable_memory_allocator.h"
|
||||
#include "base/memory/shared_memory.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/field_trial.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
@ -2203,7 +2204,7 @@ RenderThreadImpl::GetMediaThreadTaskRunner() {
|
||||
media_thread_.reset(new base::Thread("Media"));
|
||||
#if defined(OS_FUCHSIA)
|
||||
// Start IO thread on Fuchsia to make that thread usable for FIDL.
|
||||
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0);
|
||||
base::Thread::Options options(base::MessagePumpType::IO, 0);
|
||||
#else
|
||||
base::Thread::Options options;
|
||||
#endif
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include "base/files/file_descriptor_watcher_posix.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/test/scoped_task_environment.h"
|
||||
#include "base/threading/thread.h"
|
||||
@ -133,7 +134,7 @@ TEST(BusTest, RemoveObjectProxy) {
|
||||
|
||||
// Start the D-Bus thread.
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
base::Thread dbus_thread("D-Bus thread");
|
||||
dbus_thread.StartWithOptions(thread_options);
|
||||
|
||||
@ -211,7 +212,7 @@ TEST(BusTest, GetExportedObject) {
|
||||
TEST(BusTest, UnregisterExportedObject) {
|
||||
// Start the D-Bus thread.
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
base::Thread dbus_thread("D-Bus thread");
|
||||
dbus_thread.StartWithOptions(thread_options);
|
||||
|
||||
@ -261,7 +262,7 @@ TEST(BusTest, ShutdownAndBlock) {
|
||||
TEST(BusTest, ShutdownAndBlockWithDBusThread) {
|
||||
// Start the D-Bus thread.
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
base::Thread dbus_thread("D-Bus thread");
|
||||
dbus_thread.StartWithOptions(thread_options);
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/bind_helpers.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/stl_util.h"
|
||||
@ -46,7 +47,7 @@ class EndToEndAsyncTest : public testing::Test {
|
||||
// Start the D-Bus thread.
|
||||
dbus_thread_.reset(new base::Thread("D-Bus Thread"));
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options));
|
||||
|
||||
// Start the test service, using the D-Bus thread.
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/test/scoped_task_environment.h"
|
||||
@ -68,7 +69,7 @@ class ObjectManagerTest
|
||||
// Start the D-Bus thread.
|
||||
dbus_thread_.reset(new base::Thread("D-Bus Thread"));
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options));
|
||||
|
||||
// Start the test service, using the D-Bus thread.
|
||||
|
@ -13,6 +13,7 @@
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
@ -60,7 +61,7 @@ class PropertyTest : public testing::Test {
|
||||
// Start the D-Bus thread.
|
||||
dbus_thread_.reset(new base::Thread("D-Bus Thread"));
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options));
|
||||
|
||||
// Start the test service, using the D-Bus thread.
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/metrics/histogram_samples.h"
|
||||
#include "base/run_loop.h"
|
||||
@ -36,7 +37,7 @@ class SignalSenderVerificationTest : public testing::Test {
|
||||
// Start the D-Bus thread.
|
||||
dbus_thread_.reset(new base::Thread("D-Bus Thread"));
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
ASSERT_TRUE(dbus_thread_->StartWithOptions(thread_options));
|
||||
|
||||
// Create the test service, using the D-Bus thread.
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "base/at_exit.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/test/test_timeouts.h"
|
||||
#include "dbus/bus.h"
|
||||
#include "dbus/test_service.h"
|
||||
@ -16,7 +16,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
base::Thread dbus_thread("D-Bus Thread");
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
CHECK(dbus_thread.StartWithOptions(thread_options));
|
||||
|
||||
dbus::TestService::Options options;
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/bind_helpers.h"
|
||||
#include "base/guid.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/test/test_timeouts.h"
|
||||
@ -59,7 +59,7 @@ TestService::~TestService() {
|
||||
|
||||
bool TestService::StartService() {
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
return StartWithOptions(thread_options);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
#include "device/bluetooth/bluetooth_socket_thread.h"
|
||||
|
||||
#include "base/lazy_instance.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/sequenced_task_runner.h"
|
||||
#include "base/threading/thread.h"
|
||||
|
||||
@ -56,7 +56,7 @@ void BluetoothSocketThread::EnsureStarted() {
|
||||
return;
|
||||
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
thread_.reset(new base::Thread("BluetoothSocketThread"));
|
||||
thread_->StartWithOptions(thread_options);
|
||||
task_runner_ = thread_->task_runner();
|
||||
|
@ -4,7 +4,7 @@
|
||||
|
||||
#include "device/bluetooth/dbus/bluez_dbus_thread_manager.h"
|
||||
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "dbus/bus.h"
|
||||
|
||||
@ -14,7 +14,7 @@ static BluezDBusThreadManager* g_bluez_dbus_thread_manager = NULL;
|
||||
|
||||
BluezDBusThreadManager::BluezDBusThreadManager() {
|
||||
base::Thread::Options thread_options;
|
||||
thread_options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
thread_options.message_pump_type = base::MessagePumpType::IO;
|
||||
dbus_thread_.reset(new base::Thread("Bluez D-Bus thread"));
|
||||
dbus_thread_->StartWithOptions(thread_options);
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
#include "base/strings/string_number_conversions.h"
|
||||
#include "base/third_party/dynamic_annotations/dynamic_annotations.h"
|
||||
@ -170,16 +170,15 @@ void GamepadProvider::Initialize(std::unique_ptr<GamepadDataFetcher> fetcher) {
|
||||
#if defined(OS_LINUX)
|
||||
// On Linux, the data fetcher needs to watch file descriptors, so the message
|
||||
// loop needs to be a libevent loop.
|
||||
const base::MessageLoop::Type kMessageLoopType = base::MessageLoop::TYPE_IO;
|
||||
const base::MessagePumpType kMessageLoopType = base::MessagePump::Type::IO;
|
||||
#elif defined(OS_ANDROID)
|
||||
// On Android, keeping a message loop of default type.
|
||||
const base::MessageLoop::Type kMessageLoopType =
|
||||
base::MessageLoop::TYPE_DEFAULT;
|
||||
const base::MessagePumpType kMessageLoopType = base::MessagePumpType::DEFAULT;
|
||||
#else
|
||||
// On Mac, the data fetcher uses IOKit which depends on CFRunLoop, so the
|
||||
// message loop needs to be a UI-type loop. On Windows it must be a UI loop
|
||||
// to properly pump the MessageWindow that captures device state.
|
||||
const base::MessageLoop::Type kMessageLoopType = base::MessageLoop::TYPE_UI;
|
||||
const base::MessagePumpType kMessageLoopType = base::MessagePump::Type::UI;
|
||||
#endif
|
||||
polling_thread_->StartWithOptions(base::Thread::Options(kMessageLoopType, 0));
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/numerics/math_constants.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "build/build_config.h"
|
||||
@ -98,7 +98,7 @@ void MixedRealityDevice::RequestSession(
|
||||
// We need to start a UI message loop or we will not receive input events
|
||||
// on 1809 or newer.
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_UI;
|
||||
options.message_pump_type = base::MessagePumpType::UI;
|
||||
render_loop_->StartWithOptions(options);
|
||||
|
||||
// IsRunning() should be true here unless the thread failed to start (likely
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/bind_helpers.h"
|
||||
#include "base/callback.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/strings/string16.h"
|
||||
#include "base/strings/string_split.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
@ -138,7 +138,7 @@ void GetCachedNetworkPropertiesCallback(
|
||||
|
||||
NetworkingPrivateLinux::NetworkingPrivateLinux()
|
||||
: dbus_thread_("Networking Private DBus"), network_manager_proxy_(NULL) {
|
||||
base::Thread::Options thread_options(base::MessageLoop::Type::IO, 0);
|
||||
base::Thread::Options thread_options(base::MessagePumpType::IO, 0);
|
||||
|
||||
dbus_thread_.StartWithOptions(thread_options);
|
||||
dbus_thread_.task_runner()->PostTask(
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/user_metrics.h"
|
||||
#include "base/metrics/user_metrics_action.h"
|
||||
#include "base/run_loop.h"
|
||||
@ -22,7 +23,7 @@ using base::UserMetricsAction;
|
||||
class FirstUserActionRecorderTest : public PlatformTest {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_DEFAULT));
|
||||
loop_.reset(new base::MessageLoop(base::MessagePumpType::DEFAULT));
|
||||
ui_thread_.reset(new web::TestWebThread(web::WebThread::UI, loop_.get()));
|
||||
|
||||
base::TimeDelta delta = base::TimeDelta::FromSeconds(60);
|
||||
|
@ -3,7 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "base/bind.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/test/launcher/unit_test_launcher.h"
|
||||
#include "base/threading/thread.h"
|
||||
#include "ios/chrome/app/startup/ios_chrome_main.h"
|
||||
@ -19,7 +19,7 @@ int main(int argc, char** argv) {
|
||||
|
||||
base::Thread ipc_thread("IPC thread");
|
||||
ipc_thread.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
mojo::core::ScopedIPCSupport ipc_support(
|
||||
ipc_thread.task_runner(),
|
||||
mojo::core::ScopedIPCSupport::ShutdownPolicy::CLEAN);
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "base/bind.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/power_monitor/power_monitor.h"
|
||||
@ -121,7 +122,7 @@ int WebMainLoop::CreateThreads() {
|
||||
ios_global_state::StartThreadPool();
|
||||
|
||||
base::Thread::Options io_message_loop_options;
|
||||
io_message_loop_options.message_loop_type = base::MessagePump::Type::IO;
|
||||
io_message_loop_options.message_pump_type = base::MessagePumpType::IO;
|
||||
io_thread_ = std::make_unique<WebSubThread>(WebThread::IO);
|
||||
if (!io_thread_->StartWithOptions(io_message_loop_options))
|
||||
LOG(FATAL) << "Failed to start WebThread::IO";
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "ios/web/web_sub_thread.h"
|
||||
#include "ios/web/web_thread_impl.h"
|
||||
|
||||
@ -61,7 +62,7 @@ void TestWebThread::StartIOThread() {
|
||||
|
||||
void TestWebThread::StartIOThreadUnregistered() {
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
CHECK(real_thread_->StartWithOptions(options));
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "base/memory/platform_shared_memory_region.h"
|
||||
#include "base/memory/shared_memory.h"
|
||||
#include "base/memory/shared_memory_mapping.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/optional.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/pickle.h"
|
||||
@ -787,7 +788,7 @@ class ChannelProxyRunner {
|
||||
|
||||
void CreateProxy(IPC::Listener* listener) {
|
||||
io_thread_.StartWithOptions(
|
||||
base::Thread::Options(base::MessageLoop::TYPE_IO, 0));
|
||||
base::Thread::Options(base::MessagePumpType::IO, 0));
|
||||
proxy_ = IPC::SyncChannel::Create(listener, io_thread_.task_runner(),
|
||||
base::ThreadTaskRunnerHandle::Get(),
|
||||
&never_signaled_);
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include <stdint.h>
|
||||
#include <memory>
|
||||
|
||||
#include "base/message_loop/message_loop.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/pickle.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/threading/thread.h"
|
||||
@ -245,7 +245,7 @@ class IPCChannelProxyTest : public IPCChannelMojoTestBase {
|
||||
|
||||
thread_.reset(new base::Thread("ChannelProxyTestServerThread"));
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_IO;
|
||||
options.message_pump_type = base::MessagePumpType::IO;
|
||||
thread_->StartWithOptions(options);
|
||||
|
||||
listener_.reset(new QuitListener());
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "base/location.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/message_loop/message_pump_type.h"
|
||||
#include "base/process/process_handle.h"
|
||||
#include "base/run_loop.h"
|
||||
#include "base/single_thread_task_runner.h"
|
||||
@ -88,7 +89,7 @@ class Worker : public Listener, public Sender {
|
||||
channel_->Close();
|
||||
}
|
||||
void Start() {
|
||||
StartThread(&listener_thread_, base::MessageLoop::TYPE_DEFAULT);
|
||||
StartThread(&listener_thread_, base::MessagePumpType::DEFAULT);
|
||||
ListenerThread()->task_runner()->PostTask(
|
||||
FROM_HERE, base::BindOnce(&Worker::OnStart, base::Unretained(this)));
|
||||
}
|
||||
@ -192,7 +193,7 @@ class Worker : public Listener, public Sender {
|
||||
// Called on the listener thread to create the sync channel.
|
||||
void OnStart() {
|
||||
// Link ipc_thread_, listener_thread_ and channel_ altogether.
|
||||
StartThread(&ipc_thread_, base::MessageLoop::TYPE_IO);
|
||||
StartThread(&ipc_thread_, base::MessagePumpType::IO);
|
||||
channel_.reset(CreateChannel());
|
||||
channel_created_->Signal();
|
||||
Run();
|
||||
@ -237,9 +238,9 @@ class Worker : public Listener, public Sender {
|
||||
return true;
|
||||
}
|
||||
|
||||
void StartThread(base::Thread* thread, base::MessageLoop::Type type) {
|
||||
void StartThread(base::Thread* thread, base::MessagePumpType type) {
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = type;
|
||||
options.message_pump_type = type;
|
||||
thread->StartWithOptions(options);
|
||||
}
|
||||
|
||||
@ -1040,7 +1041,7 @@ class SyncMessageFilterServer : public Worker {
|
||||
std::move(channel_handle)),
|
||||
thread_("helper_thread") {
|
||||
base::Thread::Options options;
|
||||
options.message_loop_type = base::MessageLoop::TYPE_DEFAULT;
|
||||
options.message_pump_type = base::MessagePumpType::DEFAULT;
|
||||
thread_.StartWithOptions(options);
|
||||
filter_ = new TestSyncMessageFilter(shutdown_event(), this,
|
||||
thread_.task_runner());
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user