Chromium Code Reviews| Index: content/child/child_thread_impl.cc |
| diff --git a/content/child/child_thread_impl.cc b/content/child/child_thread_impl.cc |
| index 3978af0b74a438b49b1758b62803fa11f0f28ca1..7982b02b23ebbed75589af2fe5b9d954e8da9be2 100644 |
| --- a/content/child/child_thread_impl.cc |
| +++ b/content/child/child_thread_impl.cc |
| @@ -68,6 +68,10 @@ |
| #include "content/child/child_io_surface_manager_mac.h" |
| #endif |
| +#if defined(USE_OZONE) |
| +#include "ui/ozone/public/client_native_pixmap_factory.h" |
| +#endif |
| + |
| #if defined(OS_WIN) |
| #include "ipc/attachment_broker_unprivileged_win.h" |
| #endif |
| @@ -192,6 +196,29 @@ class IOSurfaceManagerFilter : public IPC::MessageFilter { |
| }; |
| #endif |
| +#if defined(USE_OZONE) |
| +class ClientNativePixmapFactoryFilter : public IPC::MessageFilter { |
| + public: |
| + // Overridden from IPC::MessageFilter: |
| + bool OnMessageReceived(const IPC::Message& message) override { |
| + bool handled = true; |
| + IPC_BEGIN_MESSAGE_MAP(ClientNativePixmapFactoryFilter, message) |
| + IPC_MESSAGE_HANDLER(ChildProcessMsg_SetVgemFD, OnSetVgemFD) |
| + IPC_MESSAGE_UNHANDLED(handled = false) |
| + IPC_END_MESSAGE_MAP() |
| + return handled; |
| + } |
| + |
| + protected: |
| + ~ClientNativePixmapFactoryFilter() override {} |
| + |
| + void OnSetVgemFD(const base::FileDescriptor& virtual_device) { |
|
reveman
2015/08/14 13:19:13
nit: s/virtual_device/vgem_fd/
dshwang
2015/08/14 16:20:27
Done.
|
| + DCHECK(ui::ClientNativePixmapFactory::GetInstance()); |
|
reveman
2015/08/14 13:19:13
nit: unnecessary as dereferencing null will alread
dshwang
2015/08/14 16:20:27
Done.
|
| + ui::ClientNativePixmapFactory::GetInstance()->SetVgemFD(virtual_device); |
| + } |
| +}; |
| +#endif |
| + |
| #if defined(OS_ANDROID) |
| // A class that allows for triggering a clean shutdown from another |
| // thread through draining the main thread's msg loop. |
| @@ -428,6 +455,10 @@ void ChildThreadImpl::Init(const Options& options) { |
| channel_->AddFilter(new IOSurfaceManagerFilter()); |
| #endif |
| +#if defined(USE_OZONE) |
| + channel_->AddFilter(new ClientNativePixmapFactoryFilter()); |
| +#endif |
| + |
| // Add filters passed here via options. |
| for (auto startup_filter : options.startup_filters) { |
| channel_->AddFilter(startup_filter); |