OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/pepper/pepper_broker_impl.h" | 5 #include "content/renderer/pepper/pepper_broker_impl.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" | 8 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
9 #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h" | 9 #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h" |
10 #include "ipc/ipc_channel_handle.h" | 10 #include "ipc/ipc_channel_handle.h" |
11 #include "ppapi/proxy/broker_dispatcher.h" | 11 #include "ppapi/proxy/broker_dispatcher.h" |
12 #include "ppapi/proxy/ppapi_messages.h" | 12 #include "ppapi/proxy/ppapi_messages.h" |
13 #include "ppapi/shared_impl/platform_file.h" | 13 #include "ppapi/shared_impl/platform_file.h" |
14 #include "webkit/plugins/ppapi/plugin_module.h" | 14 #include "webkit/plugins/ppapi/plugin_module.h" |
15 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 15 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
16 | 16 |
17 #if defined(OS_WIN) | 17 #if defined(OS_WIN) |
18 #include <windows.h> | 18 #include <windows.h> |
19 #endif | 19 #endif |
20 | 20 |
| 21 namespace content { |
| 22 |
21 namespace { | 23 namespace { |
22 | 24 |
23 base::SyncSocket::Handle DuplicateHandle(base::SyncSocket::Handle handle) { | 25 base::SyncSocket::Handle DuplicateHandle(base::SyncSocket::Handle handle) { |
24 base::SyncSocket::Handle out_handle = base::kInvalidPlatformFileValue; | 26 base::SyncSocket::Handle out_handle = base::kInvalidPlatformFileValue; |
25 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
26 DWORD options = DUPLICATE_SAME_ACCESS; | 28 DWORD options = DUPLICATE_SAME_ACCESS; |
27 if (!::DuplicateHandle(::GetCurrentProcess(), | 29 if (!::DuplicateHandle(::GetCurrentProcess(), |
28 handle, | 30 handle, |
29 ::GetCurrentProcess(), | 31 ::GetCurrentProcess(), |
30 &out_handle, | 32 &out_handle, |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 } | 240 } |
239 | 241 |
240 // TOOD(ddorwin): Change the IPC to asynchronous: Queue an object containing | 242 // TOOD(ddorwin): Change the IPC to asynchronous: Queue an object containing |
241 // client and plugin_socket.release(), then return. | 243 // client and plugin_socket.release(), then return. |
242 // That message handler will then call client->BrokerConnected() with the | 244 // That message handler will then call client->BrokerConnected() with the |
243 // saved pipe handle. | 245 // saved pipe handle. |
244 // Temporarily, just call back. | 246 // Temporarily, just call back. |
245 client->BrokerConnected(ppapi::PlatformFileToInt(plugin_handle), result); | 247 client->BrokerConnected(ppapi::PlatformFileToInt(plugin_handle), result); |
246 } | 248 } |
247 | 249 |
| 250 } // namespace content |
OLD | NEW |