OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "content/child/child_client_native_pixmap_factory_message_filter_ozone. h" | |
6 | |
7 #include "base/files/scoped_file.h" | |
8 #include "content/child/child_client_native_pixmap_factory_ozone.h" | |
9 #include "content/common/gpu/client_native_pixmap_factory_ozone_messages.h" | |
10 #include "ipc/ipc_message_macros.h" | |
11 | |
12 namespace content { | |
13 | |
14 ChildClientNativePixmapFactoryMessageFilter:: | |
15 ChildClientNativePixmapFactoryMessageFilter() {} | |
16 | |
17 ChildClientNativePixmapFactoryMessageFilter:: | |
18 ~ChildClientNativePixmapFactoryMessageFilter() {} | |
19 | |
20 void ChildClientNativePixmapFactoryMessageFilter::OnSetVirtualDevice( | |
21 const base::FileDescriptor& virtual_device) { | |
22 if (!ui::ClientNativePixmapFactory::GetInstance()) { | |
23 ChildClientNativePixmapFactory::GetInstance()->Initialize(virtual_device); | |
24 ui::ClientNativePixmapFactory::SetInstance( | |
25 ChildClientNativePixmapFactory::GetInstance()); | |
reveman
2015/08/13 18:05:28
How do we make sure this happens before the render
dshwang
2015/08/14 12:40:03
Ok, now Renderer waits for vgem fd on importing Na
| |
26 } else { | |
27 // Many child threads can live in the same process. e.g. --single-process | |
28 if (virtual_device.auto_close) { | |
29 base::ScopedFD closing_fd(virtual_device.fd); | |
30 } | |
31 } | |
32 } | |
33 | |
34 bool ChildClientNativePixmapFactoryMessageFilter::OnMessageReceived( | |
35 const IPC::Message& message) { | |
36 bool handled = true; | |
37 IPC_BEGIN_MESSAGE_MAP(ChildClientNativePixmapFactoryMessageFilter, message) | |
38 IPC_MESSAGE_HANDLER(ChildClientNativePixmapFactoryMsg_SetVirtualDevice, | |
39 OnSetVirtualDevice) | |
40 IPC_MESSAGE_UNHANDLED(handled = false) | |
41 IPC_END_MESSAGE_MAP() | |
42 return handled; | |
43 } | |
44 | |
45 } // namespace content | |
OLD | NEW |