| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/renderer/pepper_plugin_delegate_impl.h" | 5 #include "chrome/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "app/surface/transport_dib.h" | 9 #include "app/surface/transport_dib.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 14 #include "base/string_split.h" | 14 #include "base/string_split.h" |
| 15 #include "base/task.h" | 15 #include "base/task.h" |
| 16 #include "base/time.h" | 16 #include "base/time.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "chrome/common/child_thread.h" | 18 #include "chrome/common/child_thread.h" |
| 19 #include "chrome/common/file_system/file_system_dispatcher.h" | 19 #include "chrome/common/file_system/file_system_dispatcher.h" |
| 20 #include "chrome/common/pepper_file_messages.h" | 20 #include "chrome/common/pepper_file_messages.h" |
| 21 #include "chrome/common/pepper_messages.h" |
| 21 #include "chrome/common/pepper_plugin_registry.h" | 22 #include "chrome/common/pepper_plugin_registry.h" |
| 22 #include "chrome/common/render_messages.h" | 23 #include "chrome/common/render_messages.h" |
| 23 #include "chrome/common/render_messages_params.h" | 24 #include "chrome/common/render_messages_params.h" |
| 24 #include "chrome/renderer/audio_message_filter.h" | 25 #include "chrome/renderer/audio_message_filter.h" |
| 25 #include "chrome/renderer/command_buffer_proxy.h" | 26 #include "chrome/renderer/command_buffer_proxy.h" |
| 26 #include "chrome/renderer/ggl/ggl.h" | 27 #include "chrome/renderer/ggl/ggl.h" |
| 27 #include "chrome/renderer/gpu_channel_host.h" | 28 #include "chrome/renderer/gpu_channel_host.h" |
| 28 #include "chrome/renderer/pepper_platform_context_3d_impl.h" | 29 #include "chrome/renderer/pepper_platform_context_3d_impl.h" |
| 29 #include "chrome/renderer/render_thread.h" | 30 #include "chrome/renderer/render_thread.h" |
| 30 #include "chrome/renderer/render_view.h" | 31 #include "chrome/renderer/render_view.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 42 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 43 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 43 #include "ui/base/l10n/l10n_util.h" | 44 #include "ui/base/l10n/l10n_util.h" |
| 44 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 45 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
| 45 #include "webkit/plugins/npapi/webplugin.h" | 46 #include "webkit/plugins/npapi/webplugin.h" |
| 46 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" | 47 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
| 47 #include "webkit/plugins/ppapi/plugin_module.h" | 48 #include "webkit/plugins/ppapi/plugin_module.h" |
| 48 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 49 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 49 #include "webkit/plugins/ppapi/ppb_flash_impl.h" | 50 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
| 50 | 51 |
| 51 #if defined(OS_MACOSX) | 52 #if defined(OS_MACOSX) |
| 52 #include "chrome/common/render_messages.h" | |
| 53 #include "chrome/renderer/render_thread.h" | 53 #include "chrome/renderer/render_thread.h" |
| 54 #endif | 54 #endif |
| 55 | 55 |
| 56 #if defined(OS_POSIX) | 56 #if defined(OS_POSIX) |
| 57 #include "ipc/ipc_channel_posix.h" | 57 #include "ipc/ipc_channel_posix.h" |
| 58 #endif | 58 #endif |
| 59 | 59 |
| 60 using WebKit::WebView; | 60 using WebKit::WebView; |
| 61 | 61 |
| 62 namespace { | 62 namespace { |
| (...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 return RenderThread::current()->GetFileThreadMessageLoopProxy(); | 807 return RenderThread::current()->GetFileThreadMessageLoopProxy(); |
| 808 } | 808 } |
| 809 | 809 |
| 810 int32_t PepperPluginDelegateImpl::ConnectTcp( | 810 int32_t PepperPluginDelegateImpl::ConnectTcp( |
| 811 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, | 811 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, |
| 812 const char* host, | 812 const char* host, |
| 813 uint16_t port) { | 813 uint16_t port) { |
| 814 int request_id = pending_connect_tcps_.Add( | 814 int request_id = pending_connect_tcps_.Add( |
| 815 new scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>(connector)); | 815 new scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>(connector)); |
| 816 IPC::Message* msg = | 816 IPC::Message* msg = |
| 817 new ViewHostMsg_PepperConnectTcp(render_view_->routing_id(), | 817 new PepperMsg_ConnectTcp(render_view_->routing_id(), |
| 818 request_id, | 818 request_id, |
| 819 std::string(host), | 819 std::string(host), |
| 820 port); | 820 port); |
| 821 if (!render_view_->Send(msg)) | 821 if (!render_view_->Send(msg)) |
| 822 return PP_ERROR_FAILED; | 822 return PP_ERROR_FAILED; |
| 823 | 823 |
| 824 return PP_ERROR_WOULDBLOCK; | 824 return PP_ERROR_WOULDBLOCK; |
| 825 } | 825 } |
| 826 | 826 |
| 827 int32_t PepperPluginDelegateImpl::ConnectTcpAddress( | 827 int32_t PepperPluginDelegateImpl::ConnectTcpAddress( |
| 828 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, | 828 webkit::ppapi::PPB_Flash_NetConnector_Impl* connector, |
| 829 const struct PP_Flash_NetAddress* addr) { | 829 const struct PP_Flash_NetAddress* addr) { |
| 830 int request_id = pending_connect_tcps_.Add( | 830 int request_id = pending_connect_tcps_.Add( |
| 831 new scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>(connector)); | 831 new scoped_refptr<webkit::ppapi::PPB_Flash_NetConnector_Impl>(connector)); |
| 832 IPC::Message* msg = | 832 IPC::Message* msg = |
| 833 new ViewHostMsg_PepperConnectTcpAddress(render_view_->routing_id(), | 833 new PepperMsg_ConnectTcpAddress(render_view_->routing_id(), |
| 834 request_id, | 834 request_id, |
| 835 *addr); | 835 *addr); |
| 836 if (!render_view_->Send(msg)) | 836 if (!render_view_->Send(msg)) |
| 837 return PP_ERROR_FAILED; | 837 return PP_ERROR_FAILED; |
| 838 | 838 |
| 839 return PP_ERROR_WOULDBLOCK; | 839 return PP_ERROR_WOULDBLOCK; |
| 840 } | 840 } |
| 841 | 841 |
| 842 void PepperPluginDelegateImpl::OnConnectTcpACK( | 842 void PepperPluginDelegateImpl::OnConnectTcpACK( |
| 843 int request_id, | 843 int request_id, |
| 844 base::PlatformFile socket, | 844 base::PlatformFile socket, |
| 845 const PP_Flash_NetAddress& local_addr, | 845 const PP_Flash_NetAddress& local_addr, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 | 889 |
| 890 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { | 890 void PepperPluginDelegateImpl::SetContentRestriction(int restrictions) { |
| 891 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( | 891 render_view_->Send(new ViewHostMsg_UpdateContentRestrictions( |
| 892 render_view_->routing_id(), restrictions)); | 892 render_view_->routing_id(), restrictions)); |
| 893 } | 893 } |
| 894 | 894 |
| 895 void PepperPluginDelegateImpl::HasUnsupportedFeature() { | 895 void PepperPluginDelegateImpl::HasUnsupportedFeature() { |
| 896 render_view_->Send(new ViewHostMsg_PDFHasUnsupportedFeature( | 896 render_view_->Send(new ViewHostMsg_PDFHasUnsupportedFeature( |
| 897 render_view_->routing_id())); | 897 render_view_->routing_id())); |
| 898 } | 898 } |
| OLD | NEW |