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_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_delegate_impl.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <queue> | 10 #include <queue> |
11 | 11 |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/callback.h" | 13 #include "base/callback.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/file_path.h" | 15 #include "base/file_path.h" |
16 #include "base/file_util_proxy.h" | 16 #include "base/file_util_proxy.h" |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/string_split.h" | 18 #include "base/string_split.h" |
19 #include "base/sync_socket.h" | 19 #include "base/sync_socket.h" |
20 #include "base/time.h" | 20 #include "base/time.h" |
21 #include "content/common/child_process.h" | 21 #include "content/common/child_process.h" |
22 #include "content/common/child_process_messages.h" | 22 #include "content/common/child_process_messages.h" |
23 #include "content/common/child_thread.h" | 23 #include "content/common/child_thread.h" |
24 #include "content/common/fileapi/file_system_dispatcher.h" | 24 #include "content/common/fileapi/file_system_dispatcher.h" |
25 #include "content/common/fileapi/file_system_messages.h" | 25 #include "content/common/fileapi/file_system_messages.h" |
26 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 26 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 27 #include "content/common/pepper_messages.h" |
27 #include "content/common/pepper_plugin_registry.h" | 28 #include "content/common/pepper_plugin_registry.h" |
28 #include "content/common/pepper_messages.h" | |
29 #include "content/common/quota_dispatcher.h" | 29 #include "content/common/quota_dispatcher.h" |
30 #include "content/common/view_messages.h" | 30 #include "content/common/view_messages.h" |
31 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
32 #include "content/public/common/context_menu_params.h" | 32 #include "content/public/common/context_menu_params.h" |
33 #include "content/public/common/media_stream_request.h" | 33 #include "content/public/common/media_stream_request.h" |
34 #include "content/public/common/referrer.h" | 34 #include "content/public/common/referrer.h" |
35 #include "content/public/renderer/content_renderer_client.h" | 35 #include "content/public/renderer/content_renderer_client.h" |
36 #include "content/public/renderer/renderer_restrict_dispatch_group.h" | 36 #include "content/public/renderer/renderer_restrict_dispatch_group.h" |
37 #include "content/renderer/browser_plugin/old/browser_plugin_constants.h" | 37 #include "content/renderer/browser_plugin/old/browser_plugin_constants.h" |
38 #include "content/renderer/browser_plugin/old/browser_plugin_registry.h" | 38 #include "content/renderer/browser_plugin/old/browser_plugin_registry.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 78 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 79 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 80 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 81 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
82 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 82 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 83 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
84 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 84 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
85 #include "ui/gfx/size.h" | 85 #include "ui/gfx/size.h" |
86 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 86 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
87 #include "webkit/plugins/npapi/webplugin.h" | 87 #include "webkit/plugins/npapi/webplugin.h" |
88 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" | |
89 #include "webkit/plugins/ppapi/plugin_module.h" | 88 #include "webkit/plugins/ppapi/plugin_module.h" |
90 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 89 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 90 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
91 #include "webkit/plugins/ppapi/ppb_flash_impl.h" | 91 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
92 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" | 92 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" |
93 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" | 93 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" |
94 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" | 94 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" |
95 #include "webkit/plugins/ppapi/resource_helper.h" | 95 #include "webkit/plugins/ppapi/resource_helper.h" |
96 #include "webkit/plugins/webplugininfo.h" | 96 #include "webkit/plugins/webplugininfo.h" |
97 | 97 |
98 using WebKit::WebView; | 98 using WebKit::WebView; |
99 using WebKit::WebFrame; | 99 using WebKit::WebFrame; |
100 | 100 |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1170 tcp_sockets_.AddWithID(socket, socket_id); | 1170 tcp_sockets_.AddWithID(socket, socket_id); |
1171 } | 1171 } |
1172 | 1172 |
1173 uint32 PepperPluginDelegateImpl::UDPSocketCreate() { | 1173 uint32 PepperPluginDelegateImpl::UDPSocketCreate() { |
1174 uint32 socket_id = 0; | 1174 uint32 socket_id = 0; |
1175 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Create( | 1175 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Create( |
1176 render_view_->routing_id(), 0, &socket_id)); | 1176 render_view_->routing_id(), 0, &socket_id)); |
1177 return socket_id; | 1177 return socket_id; |
1178 } | 1178 } |
1179 | 1179 |
| 1180 void PepperPluginDelegateImpl::UDPSocketSetBoolSocketFeature( |
| 1181 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, |
| 1182 uint32 socket_id, |
| 1183 int32_t name, |
| 1184 bool value) { |
| 1185 render_view_->Send( |
| 1186 new PpapiHostMsg_PPBUDPSocket_SetBoolSocketFeature( |
| 1187 render_view_->routing_id(), socket_id, name, value)); |
| 1188 } |
| 1189 |
1180 void PepperPluginDelegateImpl::UDPSocketBind( | 1190 void PepperPluginDelegateImpl::UDPSocketBind( |
1181 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, | 1191 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket, |
1182 uint32 socket_id, | 1192 uint32 socket_id, |
1183 const PP_NetAddress_Private& addr) { | 1193 const PP_NetAddress_Private& addr) { |
1184 udp_sockets_.AddWithID(socket, socket_id); | 1194 if (!udp_sockets_.Lookup(socket_id)) |
| 1195 udp_sockets_.AddWithID(socket, socket_id); |
1185 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Bind( | 1196 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Bind( |
1186 render_view_->routing_id(), socket_id, addr)); | 1197 render_view_->routing_id(), socket_id, addr)); |
1187 } | 1198 } |
1188 | 1199 |
1189 void PepperPluginDelegateImpl::UDPSocketRecvFrom(uint32 socket_id, | 1200 void PepperPluginDelegateImpl::UDPSocketRecvFrom(uint32 socket_id, |
1190 int32_t num_bytes) { | 1201 int32_t num_bytes) { |
1191 DCHECK(udp_sockets_.Lookup(socket_id)); | 1202 DCHECK(udp_sockets_.Lookup(socket_id)); |
1192 render_view_->Send( | 1203 render_view_->Send( |
1193 new PpapiHostMsg_PPBUDPSocket_RecvFrom(socket_id, num_bytes)); | 1204 new PpapiHostMsg_PPBUDPSocket_RecvFrom(socket_id, num_bytes)); |
1194 } | 1205 } |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1819 else | 1830 else |
1820 return render_view_->mouse_lock_dispatcher(); | 1831 return render_view_->mouse_lock_dispatcher(); |
1821 } | 1832 } |
1822 | 1833 |
1823 webkit_glue::ClipboardClient* | 1834 webkit_glue::ClipboardClient* |
1824 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1835 PepperPluginDelegateImpl::CreateClipboardClient() const { |
1825 return new RendererClipboardClient; | 1836 return new RendererClipboardClient; |
1826 } | 1837 } |
1827 | 1838 |
1828 } // namespace content | 1839 } // namespace content |
OLD | NEW |