Commit 9a576de4 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Deprecate MessageLoop::Type

It is currently just an alias to MessagePump::Type. This patch changes
all references to use MessagePump::Type as MessageLoop will eventually
disappear.

This patch also changes some variable names from message_loop_type to
message_pump_type. In particular one field of the GpuPreferences mojo
struct. It is weird to see things like

message_loop_type = MessagePump::Type::UI

BUG=891670

Change-Id: I44680b19c83f009f7fbb0900f4d5b1140d51457f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726050Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#682635}
parent b70fad35
...@@ -82,7 +82,7 @@ VizMainImpl::VizMainImpl(Delegate* delegate, ...@@ -82,7 +82,7 @@ VizMainImpl::VizMainImpl(Delegate* delegate,
io_thread_ = CreateAndStartIOThread(); io_thread_ = CreateAndStartIOThread();
if (dependencies_.create_display_compositor) { if (dependencies_.create_display_compositor) {
viz_compositor_thread_runner_ = std::make_unique<VizCompositorThreadRunner>( viz_compositor_thread_runner_ = std::make_unique<VizCompositorThreadRunner>(
gpu_init_->gpu_preferences().message_loop_type); gpu_init_->gpu_preferences().message_pump_type);
if (delegate_) { if (delegate_) {
delegate_->PostCompositorThreadCreated( delegate_->PostCompositorThreadCreated(
viz_compositor_thread_runner_->task_runner()); viz_compositor_thread_runner_->task_runner());
......
...@@ -657,9 +657,9 @@ void GpuDataManagerImplPrivate::UpdateGpuPreferences( ...@@ -657,9 +657,9 @@ void GpuDataManagerImplPrivate::UpdateGpuPreferences(
#endif #endif
#if defined(USE_OZONE) #if defined(USE_OZONE)
gpu_preferences->message_loop_type = ui::OzonePlatform::GetInstance() gpu_preferences->message_pump_type = ui::OzonePlatform::GetInstance()
->GetPlatformProperties() ->GetPlatformProperties()
.message_loop_type_for_gpu; .message_pump_type_for_gpu;
#endif #endif
} }
......
...@@ -275,7 +275,7 @@ int GpuMain(const MainFunctionParams& parameters) { ...@@ -275,7 +275,7 @@ int GpuMain(const MainFunctionParams& parameters) {
// runtime. // runtime.
main_thread_task_executor = main_thread_task_executor =
std::make_unique<base::SingleThreadTaskExecutor>( std::make_unique<base::SingleThreadTaskExecutor>(
gpu_preferences.message_loop_type); gpu_preferences.message_pump_type);
#elif defined(OS_LINUX) #elif defined(OS_LINUX)
#error "Unsupported Linux platform." #error "Unsupported Linux platform."
#elif defined(OS_MACOSX) #elif defined(OS_MACOSX)
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#include <vector> #include <vector>
#include "base/macros.h" #include "base/macros.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_pump_type.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "gpu/gpu_export.h" #include "gpu/gpu_export.h"
#include "media/media_buildflags.h" #include "media/media_buildflags.h"
...@@ -215,8 +215,8 @@ struct GPU_EXPORT GpuPreferences { ...@@ -215,8 +215,8 @@ struct GPU_EXPORT GpuPreferences {
// Enable the WebGPU command buffer. // Enable the WebGPU command buffer.
bool enable_webgpu = false; bool enable_webgpu = false;
// Determines message loop type for the GPU thread. // Determines message pump type for the GPU thread.
base::MessageLoop::Type message_loop_type = base::MessageLoop::TYPE_DEFAULT; base::MessagePumpType message_pump_type = base::MessagePumpType::DEFAULT;
// Please update gpu_preferences_unittest.cc when making additions or // Please update gpu_preferences_unittest.cc when making additions or
// changes to this struct. // changes to this struct.
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include "base/message_loop/message_pump_type.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "gpu/ipc/common/gpu_preferences.mojom.h" #include "gpu/ipc/common/gpu_preferences.mojom.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
...@@ -72,7 +73,7 @@ void CheckGpuPreferencesEqual(GpuPreferences left, GpuPreferences right) { ...@@ -72,7 +73,7 @@ void CheckGpuPreferencesEqual(GpuPreferences left, GpuPreferences right) {
EXPECT_EQ(left.enable_gpu_benchmarking_extension, EXPECT_EQ(left.enable_gpu_benchmarking_extension,
right.enable_gpu_benchmarking_extension); right.enable_gpu_benchmarking_extension);
EXPECT_EQ(left.enable_webgpu, right.enable_webgpu); EXPECT_EQ(left.enable_webgpu, right.enable_webgpu);
EXPECT_EQ(left.message_loop_type, right.message_loop_type); EXPECT_EQ(left.message_pump_type, right.message_pump_type);
} }
} // namespace } // namespace
...@@ -155,8 +156,8 @@ TEST(GpuPreferencesTest, EncodeDecode) { ...@@ -155,8 +156,8 @@ TEST(GpuPreferencesTest, EncodeDecode) {
mojom::VulkanImplementationName::kNative) mojom::VulkanImplementationName::kNative)
GPU_PREFERENCES_FIELD(enable_gpu_benchmarking_extension, true) GPU_PREFERENCES_FIELD(enable_gpu_benchmarking_extension, true)
GPU_PREFERENCES_FIELD(enable_webgpu, true) GPU_PREFERENCES_FIELD(enable_webgpu, true)
GPU_PREFERENCES_FIELD_ENUM(message_loop_type, base::MessageLoop::TYPE_UI, GPU_PREFERENCES_FIELD_ENUM(message_pump_type, base::MessagePumpType::UI,
base::MessageLoop::TYPE_UI) base::MessagePumpType::UI)
input_prefs.texture_target_exception_list.emplace_back( input_prefs.texture_target_exception_list.emplace_back(
gfx::BufferUsage::SCANOUT, gfx::BufferFormat::RGBA_8888); gfx::BufferUsage::SCANOUT, gfx::BufferFormat::RGBA_8888);
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
// gpu/config/gpu_preferences.h // gpu/config/gpu_preferences.h
module gpu.mojom; module gpu.mojom;
import "mojo/public/mojom/base/message_loop_type.mojom"; import "mojo/public/mojom/base/message_pump_type.mojom";
import "ui/gfx/mojom/buffer_types.mojom"; import "ui/gfx/mojom/buffer_types.mojom";
// Corresponds to gpu::VulkanImplementationName. // Corresponds to gpu::VulkanImplementationName.
...@@ -68,5 +68,5 @@ struct GpuPreferences { ...@@ -68,5 +68,5 @@ struct GpuPreferences {
bool enable_metal; bool enable_metal;
bool enable_gpu_benchmarking_extension; bool enable_gpu_benchmarking_extension;
bool enable_webgpu; bool enable_webgpu;
mojo_base.mojom.MessageLoopType message_loop_type; mojo_base.mojom.MessagePumpType message_pump_type;
}; };
...@@ -7,10 +7,10 @@ ...@@ -7,10 +7,10 @@
#include <vector> #include <vector>
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_pump_type.h"
#include "gpu/config/gpu_preferences.h" #include "gpu/config/gpu_preferences.h"
#include "gpu/ipc/common/gpu_preferences.mojom.h" #include "gpu/ipc/common/gpu_preferences.mojom.h"
#include "mojo/public/cpp/base/message_loop_type_mojom_traits.h" #include "mojo/public/cpp/base/message_pump_type_mojom_traits.h"
#include "ui/gfx/mojom/buffer_types_mojom_traits.h" #include "ui/gfx/mojom/buffer_types_mojom_traits.h"
namespace mojo { namespace mojo {
...@@ -121,7 +121,7 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> { ...@@ -121,7 +121,7 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> {
out->enable_gpu_benchmarking_extension = out->enable_gpu_benchmarking_extension =
prefs.enable_gpu_benchmarking_extension(); prefs.enable_gpu_benchmarking_extension();
out->enable_webgpu = prefs.enable_webgpu(); out->enable_webgpu = prefs.enable_webgpu();
if (!prefs.ReadMessageLoopType(&out->message_loop_type)) if (!prefs.ReadMessagePumpType(&out->message_pump_type))
return false; return false;
return true; return true;
} }
...@@ -272,9 +272,9 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> { ...@@ -272,9 +272,9 @@ struct StructTraits<gpu::mojom::GpuPreferencesDataView, gpu::GpuPreferences> {
static bool enable_webgpu(const gpu::GpuPreferences& prefs) { static bool enable_webgpu(const gpu::GpuPreferences& prefs) {
return prefs.enable_webgpu; return prefs.enable_webgpu;
} }
static base::MessageLoop::Type message_loop_type( static base::MessagePumpType message_pump_type(
const gpu::GpuPreferences& prefs) { const gpu::GpuPreferences& prefs) {
return prefs.message_loop_type; return prefs.message_pump_type;
} }
}; };
......
...@@ -49,7 +49,7 @@ its lifetime. ...@@ -49,7 +49,7 @@ its lifetime.
Typically an application will create a dedicated background thread and give its Typically an application will create a dedicated background thread and give its
`TaskRunner` to Mojo. Note that in Chromium, we use the existing "IO thread" in `TaskRunner` to Mojo. Note that in Chromium, we use the existing "IO thread" in
the browser process and content child processes. In general, any thread used the browser process and content child processes. In general, any thread used
for Mojo IPC support must be running a `base::MessageLoop::TYPE_IO` loop. for Mojo IPC support must be running a `base::MessagePumpType::IO` loop.
``` ```
#include "base/threading/thread.h" #include "base/threading/thread.h"
...@@ -61,7 +61,7 @@ int main(int argc, char** argv) { ...@@ -61,7 +61,7 @@ int main(int argc, char** argv) {
base::Thread ipc_thread("ipc!"); base::Thread ipc_thread("ipc!");
ipc_thread.StartWithOptions( ipc_thread.StartWithOptions(
base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); base::Thread::Options(base::MessagePumpType::IO, 0));
// As long as this object is alive, all Mojo API surface relevant to IPC // As long as this object is alive, all Mojo API surface relevant to IPC
// connections is usable, and message pipes which span a process boundary will // connections is usable, and message pipes which span a process boundary will
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/at_exit.h" #include "base/at_exit.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/message_loop/message_pump_type.h"
#include "base/no_destructor.h" #include "base/no_destructor.h"
#include "base/synchronization/waitable_event.h" #include "base/synchronization/waitable_event.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
...@@ -22,7 +23,7 @@ namespace { ...@@ -22,7 +23,7 @@ namespace {
class IPCSupport { class IPCSupport {
public: public:
IPCSupport() : ipc_thread_("Mojo IPC") { IPCSupport() : ipc_thread_("Mojo IPC") {
base::Thread::Options options(base::MessageLoop::TYPE_IO, 0); base::Thread::Options options(base::MessagePumpType::IO, 0);
ipc_thread_.StartWithOptions(options); ipc_thread_.StartWithOptions(options);
mojo::core::Core::Get()->SetIOTaskRunner(ipc_thread_.task_runner()); mojo::core::Core::Get()->SetIOTaskRunner(ipc_thread_.task_runner());
} }
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/public/cpp/base/message_loop_type_mojom_traits.h"
#include "build/build_config.h"
namespace mojo {
// static
mojo_base::mojom::MessageLoopType
EnumTraits<mojo_base::mojom::MessageLoopType, base::MessageLoop::Type>::ToMojom(
base::MessageLoop::Type input) {
switch (input) {
case base::MessageLoop::TYPE_DEFAULT:
return mojo_base::mojom::MessageLoopType::kDefault;
case base::MessageLoop::TYPE_UI:
return mojo_base::mojom::MessageLoopType::kUi;
case base::MessageLoop::TYPE_CUSTOM:
return mojo_base::mojom::MessageLoopType::kCustom;
case base::MessageLoop::TYPE_IO:
return mojo_base::mojom::MessageLoopType::kIo;
#if defined(OS_ANDROID)
case base::MessageLoop::TYPE_JAVA:
return mojo_base::mojom::MessageLoopType::kJava;
#endif
#if defined(OS_MACOSX)
case base::MessageLoop::Type::NS_RUNLOOP:
return mojo_base::mojom::MessageLoopType::kNsRunloop;
#endif
#if defined(OS_WIN)
case base::MessageLoop::Type::UI_WITH_WM_QUIT_SUPPORT:
return mojo_base::mojom::MessageLoopType::kUiWithWmQuitSupport;
#endif
}
NOTREACHED();
return mojo_base::mojom::MessageLoopType::kDefault;
}
// static
bool EnumTraits<mojo_base::mojom::MessageLoopType, base::MessageLoop::Type>::
FromMojom(mojo_base::mojom::MessageLoopType input,
base::MessageLoop::Type* output) {
switch (input) {
case mojo_base::mojom::MessageLoopType::kDefault:
*output = base::MessageLoop::TYPE_DEFAULT;
return true;
case mojo_base::mojom::MessageLoopType::kUi:
*output = base::MessageLoop::TYPE_UI;
return true;
case mojo_base::mojom::MessageLoopType::kCustom:
*output = base::MessageLoop::TYPE_CUSTOM;
return true;
case mojo_base::mojom::MessageLoopType::kIo:
*output = base::MessageLoop::TYPE_IO;
return true;
#if defined(OS_ANDROID)
case mojo_base::mojom::MessageLoopType::kJava:
*output = base::MessageLoop::TYPE_JAVA;
return true;
#endif
#if defined(OS_MACOSX)
case mojo_base::mojom::MessageLoopType::kNsRunloop:
*output = base::MessageLoop::Type::NS_RUNLOOP;
return true;
#endif
#if defined(OS_WIN)
case mojo_base::mojom::MessageLoopType::kUiWithWmQuitSupport:
*output = base::MessageLoop::Type::UI_WITH_WM_QUIT_SUPPORT;
return true;
#endif
}
return false;
}
} // namespace mojo
...@@ -2,14 +2,14 @@ ...@@ -2,14 +2,14 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
mojom = "//mojo/public/mojom/base/message_loop_type.mojom" mojom = "//mojo/public/mojom/base/message_pump_type.mojom"
public_headers = [ "//base/message_loop/message_loop.h" ] public_headers = [ "//base/message_loop/message_pump_type.h" ]
traits_headers = [ "//mojo/public/cpp/base/message_loop_type_mojom_traits.h" ] traits_headers = [ "//mojo/public/cpp/base/message_pump_type_mojom_traits.h" ]
sources = [ sources = [
"//mojo/public/cpp/base/message_loop_type_mojom_traits.cc", "//mojo/public/cpp/base/message_pump_type_mojom_traits.cc",
"//mojo/public/cpp/base/message_loop_type_mojom_traits.h", "//mojo/public/cpp/base/message_pump_type_mojom_traits.h",
] ]
public_deps = [ public_deps = [
"//base", "//base",
] ]
type_mappings = [ "mojo_base.mojom.MessageLoopType=base::MessageLoop::Type" ] type_mappings = [ "mojo_base.mojom.MessagePumpType=base::MessagePumpType" ]
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "mojo/public/cpp/base/message_pump_type_mojom_traits.h"
#include "build/build_config.h"
namespace mojo {
// static
mojo_base::mojom::MessagePumpType
EnumTraits<mojo_base::mojom::MessagePumpType, base::MessagePumpType>::ToMojom(
base::MessagePumpType input) {
switch (input) {
case base::MessagePumpType::DEFAULT:
return mojo_base::mojom::MessagePumpType::kDefault;
case base::MessagePumpType::UI:
return mojo_base::mojom::MessagePumpType::kUi;
case base::MessagePumpType::CUSTOM:
return mojo_base::mojom::MessagePumpType::kCustom;
case base::MessagePumpType::IO:
return mojo_base::mojom::MessagePumpType::kIo;
#if defined(OS_ANDROID)
case base::MessagePumpType::JAVA:
return mojo_base::mojom::MessagePumpType::kJava;
#endif
#if defined(OS_MACOSX)
case base::MessagePumpType::NS_RUNLOOP:
return mojo_base::mojom::MessagePumpType::kNsRunloop;
#endif
#if defined(OS_WIN)
case base::MessagePumpType::UI_WITH_WM_QUIT_SUPPORT:
return mojo_base::mojom::MessagePumpType::kUiWithWmQuitSupport;
#endif
}
NOTREACHED();
return mojo_base::mojom::MessagePumpType::kDefault;
}
// static
bool EnumTraits<mojo_base::mojom::MessagePumpType, base::MessagePumpType>::
FromMojom(mojo_base::mojom::MessagePumpType input,
base::MessagePumpType* output) {
switch (input) {
case mojo_base::mojom::MessagePumpType::kDefault:
*output = base::MessagePumpType::DEFAULT;
return true;
case mojo_base::mojom::MessagePumpType::kUi:
*output = base::MessagePumpType::UI;
return true;
case mojo_base::mojom::MessagePumpType::kCustom:
*output = base::MessagePumpType::CUSTOM;
return true;
case mojo_base::mojom::MessagePumpType::kIo:
*output = base::MessagePumpType::IO;
return true;
#if defined(OS_ANDROID)
case mojo_base::mojom::MessagePumpType::kJava:
*output = base::MessagePumpType::JAVA;
return true;
#endif
#if defined(OS_MACOSX)
case mojo_base::mojom::MessagePumpType::kNsRunloop:
*output = base::MessagePumpType::NS_RUNLOOP;
return true;
#endif
#if defined(OS_WIN)
case mojo_base::mojom::MessagePumpType::kUiWithWmQuitSupport:
*output = base::MessagePumpType::UI_WITH_WM_QUIT_SUPPORT;
return true;
#endif
}
return false;
}
} // namespace mojo
...@@ -2,25 +2,24 @@ ...@@ -2,25 +2,24 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef MOJO_PUBLIC_CPP_BASE_MESSAGE_LOOP_TYPE_MOJOM_TRAITS_H_ #ifndef MOJO_PUBLIC_CPP_BASE_MESSAGE_PUMP_TYPE_MOJOM_TRAITS_H_
#define MOJO_PUBLIC_CPP_BASE_MESSAGE_LOOP_TYPE_MOJOM_TRAITS_H_ #define MOJO_PUBLIC_CPP_BASE_MESSAGE_PUMP_TYPE_MOJOM_TRAITS_H_
#include "base/component_export.h" #include "base/component_export.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_pump_type.h"
#include "mojo/public/cpp/bindings/struct_traits.h" #include "mojo/public/cpp/bindings/struct_traits.h"
#include "mojo/public/mojom/base/message_loop_type.mojom.h" #include "mojo/public/mojom/base/message_pump_type.mojom.h"
namespace mojo { namespace mojo {
template <> template <>
struct COMPONENT_EXPORT(MOJO_BASE_MOJOM) struct COMPONENT_EXPORT(MOJO_BASE_MOJOM)
EnumTraits<mojo_base::mojom::MessageLoopType, base::MessageLoop::Type> { EnumTraits<mojo_base::mojom::MessagePumpType, base::MessagePumpType> {
static mojo_base::mojom::MessageLoopType ToMojom( static mojo_base::mojom::MessagePumpType ToMojom(base::MessagePumpType input);
base::MessageLoop::Type input); static bool FromMojom(mojo_base::mojom::MessagePumpType input,
static bool FromMojom(mojo_base::mojom::MessageLoopType input, base::MessagePumpType* output);
base::MessageLoop::Type* output);
}; };
} // namespace mojo } // namespace mojo
#endif // MOJO_PUBLIC_CPP_BASE_MESSAGE_LOOP_TYPE_MOJOM_TRAITS_H_ #endif // MOJO_PUBLIC_CPP_BASE_MESSAGE_PUMP_TYPE_MOJOM_TRAITS_H_
...@@ -14,7 +14,7 @@ typemaps = [ ...@@ -14,7 +14,7 @@ typemaps = [
"//mojo/public/cpp/base/read_only_buffer.typemap", "//mojo/public/cpp/base/read_only_buffer.typemap",
"//mojo/public/cpp/base/memory_allocator_dump_cross_process_uid.typemap", "//mojo/public/cpp/base/memory_allocator_dump_cross_process_uid.typemap",
"//mojo/public/cpp/base/memory_pressure_level.typemap", "//mojo/public/cpp/base/memory_pressure_level.typemap",
"//mojo/public/cpp/base/message_loop_type.typemap", "//mojo/public/cpp/base/message_pump_type.typemap",
"//mojo/public/cpp/base/process_id.typemap", "//mojo/public/cpp/base/process_id.typemap",
"//mojo/public/cpp/base/ref_counted_memory.typemap", "//mojo/public/cpp/base/ref_counted_memory.typemap",
"//mojo/public/cpp/base/shared_memory.typemap", "//mojo/public/cpp/base/shared_memory.typemap",
......
...@@ -452,7 +452,7 @@ int main(int argc, char** argv) { ...@@ -452,7 +452,7 @@ int main(int argc, char** argv) {
mojo::core::Init(); mojo::core::Init();
base::Thread ipc_thread("ipc!"); base::Thread ipc_thread("ipc!");
ipc_thread.StartWithOptions( ipc_thread.StartWithOptions(
base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); base::Thread::Options(base::MessagePump::Type::IO, 0));
mojo::core::ScopedIPCSupport ipc_support( mojo::core::ScopedIPCSupport ipc_support(
ipc_thread.task_runner(), ipc_thread.task_runner(),
mojo::core::ScopedIPCSupport::ShutdownPolicy::CLEAN); mojo::core::ScopedIPCSupport::ShutdownPolicy::CLEAN);
......
...@@ -16,7 +16,7 @@ mojom_component("base") { ...@@ -16,7 +16,7 @@ mojom_component("base") {
"generic_pending_receiver.mojom", "generic_pending_receiver.mojom",
"memory_allocator_dump_cross_process_uid.mojom", "memory_allocator_dump_cross_process_uid.mojom",
"memory_pressure_level.mojom", "memory_pressure_level.mojom",
"message_loop_type.mojom", "message_pump_type.mojom",
"process_id.mojom", "process_id.mojom",
"read_only_buffer.mojom", "read_only_buffer.mojom",
"ref_counted_memory.mojom", "ref_counted_memory.mojom",
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
module mojo_base.mojom; module mojo_base.mojom;
// Mirror of base::MessageLoop::Type. // Mirror of base::MessagePumpType.
enum MessageLoopType { enum MessagePumpType {
kDefault, kDefault,
kUi, kUi,
kCustom, kCustom,
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/debug/alias.h" #include "base/debug/alias.h"
#include "base/memory/weak_ptr.h" #include "base/memory/weak_ptr.h"
#include "base/message_loop/message_pump_type.h"
#include "base/win/wrapped_window_proc.h" #include "base/win/wrapped_window_proc.h"
#include "ui/gfx/win/hwnd_util.h" #include "ui/gfx/win/hwnd_util.h"
#include "ui/gfx/win/window_impl.h" #include "ui/gfx/win/window_impl.h"
...@@ -128,7 +129,7 @@ bool ChildWindowWin::Initialize() { ...@@ -128,7 +129,7 @@ bool ChildWindowWin::Initialize() {
return true; return true;
thread_ = std::make_unique<base::Thread>("Window owner thread"); thread_ = std::make_unique<base::Thread>("Window owner thread");
base::Thread::Options options(base::MessageLoop::TYPE_UI, 0); base::Thread::Options options(base::MessagePumpType::UI, 0);
thread_->StartWithOptions(options); thread_->StartWithOptions(options);
base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC, base::WaitableEvent event(base::WaitableEvent::ResetPolicy::AUTOMATIC,
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop_current.h" #include "base/message_loop/message_loop_current.h"
#include "base/message_loop/message_pump_type.h"
#include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
#include "ui/base/ime/fuchsia/input_method_fuchsia.h" #include "ui/base/ime/fuchsia/input_method_fuchsia.h"
#include "ui/display/fake/fake_display_delegate.h" #include "ui/display/fake/fake_display_delegate.h"
...@@ -44,7 +45,7 @@ constexpr OzonePlatform::PlatformProperties kScenicPlatformProperties{ ...@@ -44,7 +45,7 @@ constexpr OzonePlatform::PlatformProperties kScenicPlatformProperties{
/*custom_frame_pref_default=*/false, /*custom_frame_pref_default=*/false,
/*use_system_title_bar=*/false, /*use_system_title_bar=*/false,
/*requires_mojo=*/true, /*requires_mojo=*/true,
/*message_loop_type_for_gpu=*/base::MessageLoop::TYPE_IO}; /*message_pump_type_for_gpu=*/base::MessagePumpType::IO};
class ScenicPlatformEventSource : public ui::PlatformEventSource { class ScenicPlatformEventSource : public ui::PlatformEventSource {
public: public:
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/message_loop/message_pump_type.h"
#include "ui/base/buildflags.h" #include "ui/base/buildflags.h"
#include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
#include "ui/base/ime/linux/input_method_auralinux.h" #include "ui/base/ime/linux/input_method_auralinux.h"
...@@ -64,7 +65,7 @@ constexpr OzonePlatform::PlatformProperties kWaylandPlatformProperties = { ...@@ -64,7 +65,7 @@ constexpr OzonePlatform::PlatformProperties kWaylandPlatformProperties = {
// TODO(msisov, rjkroege): Remove after http://crbug.com/806092. // TODO(msisov, rjkroege): Remove after http://crbug.com/806092.
/*requires_mojo=*/true, /*requires_mojo=*/true,
/*message_loop_type_for_gpu=*/base::MessageLoop::TYPE_DEFAULT}; /*message_pump_type_for_gpu=*/base::MessagePumpType::DEFAULT};
class OzonePlatformWayland : public OzonePlatform { class OzonePlatformWayland : public OzonePlatform {
public: public:
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
#include <memory> #include <memory>
#include <utility> #include <utility>
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_pump_type.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "ui/base/x/x11_util.h" #include "ui/base/x/x11_util.h"
#include "ui/display/fake/fake_display_delegate.h" #include "ui/display/fake/fake_display_delegate.h"
...@@ -46,7 +46,7 @@ constexpr OzonePlatform::PlatformProperties kX11PlatformProperties{ ...@@ -46,7 +46,7 @@ constexpr OzonePlatform::PlatformProperties kX11PlatformProperties{
// When the Ozone X11 backend is running, use a UI loop to grab Expose // When the Ozone X11 backend is running, use a UI loop to grab Expose
// events. See GLSurfaceGLX and https://crbug.com/326995. // events. See GLSurfaceGLX and https://crbug.com/326995.
/*message_loop_type_for_gpu=*/base::MessageLoop::TYPE_UI}; /*message_pump_type_for_gpu=*/base::MessagePumpType::UI};
// Singleton OzonePlatform implementation for X11 platform. // Singleton OzonePlatform implementation for X11 platform.
class OzonePlatformX11 : public OzonePlatform { class OzonePlatformX11 : public OzonePlatform {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "ui/ozone/public/ozone_gpu_test_helper.h" #include "ui/ozone/public/ozone_gpu_test_helper.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_pump_type.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/threading/thread.h" #include "base/threading/thread.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
...@@ -106,7 +106,7 @@ bool OzoneGpuTestHelper::Initialize( ...@@ -106,7 +106,7 @@ bool OzoneGpuTestHelper::Initialize(
const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) { const scoped_refptr<base::SingleThreadTaskRunner>& ui_task_runner) {
io_helper_thread_.reset(new base::Thread("IOHelperThread")); io_helper_thread_.reset(new base::Thread("IOHelperThread"));
if (!io_helper_thread_->StartWithOptions( if (!io_helper_thread_->StartWithOptions(
base::Thread::Options(base::MessageLoop::TYPE_IO, 0))) base::Thread::Options(base::MessagePumpType::IO, 0)))
return false; return false;
fake_gpu_process_.reset(new FakeGpuProcess(ui_task_runner)); fake_gpu_process_.reset(new FakeGpuProcess(ui_task_runner));
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
#include "base/callback.h" #include "base/callback.h"
#include "base/component_export.h" #include "base/component_export.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_pump_type.h"
#include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/public/cpp/binder_registry.h"
#include "ui/gfx/buffer_types.h" #include "ui/gfx/buffer_types.h"
...@@ -103,10 +103,10 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform { ...@@ -103,10 +103,10 @@ class COMPONENT_EXPORT(OZONE) OzonePlatform {
// Currently used only by the Ozone/Wayland platform. // Currently used only by the Ozone/Wayland platform.
bool requires_mojo = false; bool requires_mojo = false;
// Determines the type of message loop that should be used for GPU service // Determines the type of message pump that should be used for GPU service
// and display compositor threads in the GPU process. // and display compositor threads in the GPU process.
base::MessageLoop::Type message_loop_type_for_gpu = base::MessagePumpType message_pump_type_for_gpu =
base::MessageLoop::TYPE_DEFAULT; base::MessagePumpType::DEFAULT;
}; };
// Properties available in the host process after initialization. // Properties available in the host process after initialization.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment