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> |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 #include "content/renderer/render_thread_impl.h" | 51 #include "content/renderer/render_thread_impl.h" |
52 #include "content/renderer/render_view_impl.h" | 52 #include "content/renderer/render_view_impl.h" |
53 #include "content/renderer/render_widget_fullscreen_pepper.h" | 53 #include "content/renderer/render_widget_fullscreen_pepper.h" |
54 #include "content/renderer/renderer_clipboard_client.h" | 54 #include "content/renderer/renderer_clipboard_client.h" |
55 #include "content/renderer/webplugin_delegate_proxy.h" | 55 #include "content/renderer/webplugin_delegate_proxy.h" |
56 #include "ipc/ipc_channel_handle.h" | 56 #include "ipc/ipc_channel_handle.h" |
57 #include "media/video/capture/video_capture_proxy.h" | 57 #include "media/video/capture/video_capture_proxy.h" |
58 #include "ppapi/c/dev/pp_video_dev.h" | 58 #include "ppapi/c/dev/pp_video_dev.h" |
59 #include "ppapi/c/pp_errors.h" | 59 #include "ppapi/c/pp_errors.h" |
60 #include "ppapi/c/private/ppb_flash.h" | 60 #include "ppapi/c/private/ppb_flash.h" |
61 #include "ppapi/c/private/ppb_flash_net_connector.h" | |
62 #include "ppapi/proxy/host_dispatcher.h" | 61 #include "ppapi/proxy/host_dispatcher.h" |
63 #include "ppapi/proxy/ppapi_messages.h" | 62 #include "ppapi/proxy/ppapi_messages.h" |
64 #include "ppapi/shared_impl/platform_file.h" | 63 #include "ppapi/shared_impl/platform_file.h" |
65 #include "ppapi/shared_impl/ppapi_preferences.h" | 64 #include "ppapi/shared_impl/ppapi_preferences.h" |
66 #include "ppapi/shared_impl/ppb_device_ref_shared.h" | 65 #include "ppapi/shared_impl/ppb_device_ref_shared.h" |
67 #include "ppapi/thunk/enter.h" | 66 #include "ppapi/thunk/enter.h" |
68 #include "ppapi/thunk/ppb_tcp_server_socket_private_api.h" | 67 #include "ppapi/thunk/ppb_tcp_server_socket_private_api.h" |
69 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" | 68 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" |
70 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 69 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
71 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserComplet
ion.h" | 70 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserComplet
ion.h" |
72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.
h" | 71 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFileChooserParams.
h" |
73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
74 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" | 74 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginContainer.h" |
76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" | 75 #include "third_party/WebKit/Source/WebKit/chromium/public/WebScreenInfo.h" |
77 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 76 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
78 #include "ui/gfx/size.h" | 77 #include "ui/gfx/size.h" |
79 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 78 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
80 #include "webkit/plugins/npapi/webplugin.h" | 79 #include "webkit/plugins/npapi/webplugin.h" |
81 #include "webkit/plugins/ppapi/file_path.h" | 80 #include "webkit/plugins/ppapi/file_path.h" |
82 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" | 81 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
83 #include "webkit/plugins/ppapi/plugin_module.h" | 82 #include "webkit/plugins/ppapi/plugin_module.h" |
84 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 83 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
85 #include "webkit/plugins/ppapi/ppb_flash_impl.h" | 84 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
86 #include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" | |
87 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" | 85 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" |
88 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" | 86 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" |
89 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" | 87 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" |
90 #include "webkit/plugins/ppapi/resource_helper.h" | 88 #include "webkit/plugins/ppapi/resource_helper.h" |
91 #include "webkit/plugins/webplugininfo.h" | 89 #include "webkit/plugins/webplugininfo.h" |
92 | 90 |
93 using WebKit::WebView; | 91 using WebKit::WebView; |
94 using WebKit::WebFrame; | 92 using WebKit::WebFrame; |
95 | 93 |
96 namespace { | 94 namespace { |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 const GURL& url, FilePath* platform_path) { | 914 const GURL& url, FilePath* platform_path) { |
917 RenderThreadImpl::current()->Send(new FileSystemHostMsg_SyncGetPlatformPath( | 915 RenderThreadImpl::current()->Send(new FileSystemHostMsg_SyncGetPlatformPath( |
918 url, platform_path)); | 916 url, platform_path)); |
919 } | 917 } |
920 | 918 |
921 scoped_refptr<base::MessageLoopProxy> | 919 scoped_refptr<base::MessageLoopProxy> |
922 PepperPluginDelegateImpl::GetFileThreadMessageLoopProxy() { | 920 PepperPluginDelegateImpl::GetFileThreadMessageLoopProxy() { |
923 return RenderThreadImpl::current()->GetFileThreadMessageLoopProxy(); | 921 return RenderThreadImpl::current()->GetFileThreadMessageLoopProxy(); |
924 } | 922 } |
925 | 923 |
926 int32_t PepperPluginDelegateImpl::ConnectTcp( | |
927 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, | |
928 const char* host, | |
929 uint16_t port) { | |
930 int request_id = pending_connect_tcps_.Add( | |
931 new scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>(connector)); | |
932 IPC::Message* msg = | |
933 new PepperMsg_ConnectTcp(render_view_->routing_id(), | |
934 request_id, | |
935 std::string(host), | |
936 port); | |
937 if (!render_view_->Send(msg)) { | |
938 pending_connect_tcps_.Remove(request_id); | |
939 return PP_ERROR_FAILED; | |
940 } | |
941 | |
942 return PP_OK_COMPLETIONPENDING; | |
943 } | |
944 | |
945 int32_t PepperPluginDelegateImpl::ConnectTcpAddress( | |
946 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, | |
947 const struct PP_NetAddress_Private* addr) { | |
948 int request_id = pending_connect_tcps_.Add( | |
949 new scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>(connector)); | |
950 IPC::Message* msg = | |
951 new PepperMsg_ConnectTcpAddress(render_view_->routing_id(), | |
952 request_id, | |
953 *addr); | |
954 if (!render_view_->Send(msg)) { | |
955 pending_connect_tcps_.Remove(request_id); | |
956 return PP_ERROR_FAILED; | |
957 } | |
958 | |
959 return PP_OK_COMPLETIONPENDING; | |
960 } | |
961 | |
962 void PepperPluginDelegateImpl::OnConnectTcpACK( | |
963 int request_id, | |
964 base::PlatformFile socket, | |
965 const PP_NetAddress_Private& local_addr, | |
966 const PP_NetAddress_Private& remote_addr) { | |
967 scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl> connector = | |
968 *pending_connect_tcps_.Lookup(request_id); | |
969 pending_connect_tcps_.Remove(request_id); | |
970 | |
971 connector->CompleteConnectTcp(socket, local_addr, remote_addr); | |
972 } | |
973 | |
974 uint32 PepperPluginDelegateImpl::TCPSocketCreate() { | 924 uint32 PepperPluginDelegateImpl::TCPSocketCreate() { |
975 uint32 socket_id = 0; | 925 uint32 socket_id = 0; |
976 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_Create( | 926 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_Create( |
977 render_view_->routing_id(), 0, &socket_id)); | 927 render_view_->routing_id(), 0, &socket_id)); |
978 return socket_id; | 928 return socket_id; |
979 } | 929 } |
980 | 930 |
981 void PepperPluginDelegateImpl::TCPSocketConnect( | 931 void PepperPluginDelegateImpl::TCPSocketConnect( |
982 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 932 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
983 uint32 socket_id, | 933 uint32 socket_id, |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1648 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); | 1598 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); |
1649 delete target; | 1599 delete target; |
1650 mouse_lock_instances_.erase(it); | 1600 mouse_lock_instances_.erase(it); |
1651 } | 1601 } |
1652 } | 1602 } |
1653 | 1603 |
1654 webkit_glue::ClipboardClient* | 1604 webkit_glue::ClipboardClient* |
1655 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1605 PepperPluginDelegateImpl::CreateClipboardClient() const { |
1656 return new RendererClipboardClient; | 1606 return new RendererClipboardClient; |
1657 } | 1607 } |
OLD | NEW |