Chromium Code Reviews| 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_plugin_delegate_impl.h" | 5 #include "content/renderer/pepper_plugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <queue> | 8 #include <queue> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 69 #include "webkit/fileapi/file_system_callback_dispatcher.h" | 69 #include "webkit/fileapi/file_system_callback_dispatcher.h" |
| 70 #include "webkit/glue/context_menu.h" | 70 #include "webkit/glue/context_menu.h" |
| 71 #include "webkit/plugins/npapi/webplugin.h" | 71 #include "webkit/plugins/npapi/webplugin.h" |
| 72 #include "webkit/plugins/ppapi/file_path.h" | 72 #include "webkit/plugins/ppapi/file_path.h" |
| 73 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" | 73 #include "webkit/plugins/ppapi/ppb_file_io_impl.h" |
| 74 #include "webkit/plugins/ppapi/plugin_module.h" | 74 #include "webkit/plugins/ppapi/plugin_module.h" |
| 75 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 75 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 76 #include "webkit/plugins/ppapi/ppb_broker_impl.h" | 76 #include "webkit/plugins/ppapi/ppb_broker_impl.h" |
| 77 #include "webkit/plugins/ppapi/ppb_flash_impl.h" | 77 #include "webkit/plugins/ppapi/ppb_flash_impl.h" |
| 78 #include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" | 78 #include "webkit/plugins/ppapi/ppb_flash_net_connector_impl.h" |
| 79 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" | |
| 79 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" | 80 #include "webkit/plugins/ppapi/ppb_tcp_socket_private_impl.h" |
| 80 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" | 81 #include "webkit/plugins/ppapi/ppb_udp_socket_private_impl.h" |
| 81 #include "webkit/plugins/ppapi/resource_helper.h" | 82 #include "webkit/plugins/ppapi/resource_helper.h" |
| 82 #include "webkit/plugins/webplugininfo.h" | 83 #include "webkit/plugins/webplugininfo.h" |
| 83 | 84 |
| 84 using WebKit::WebView; | 85 using WebKit::WebView; |
| 85 using WebKit::WebFrame; | 86 using WebKit::WebFrame; |
| 86 | 87 |
| 87 namespace { | 88 namespace { |
| 88 | 89 |
| (...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1656 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_Create( | 1657 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_Create( |
| 1657 render_view_->routing_id(), 0, &socket_id)); | 1658 render_view_->routing_id(), 0, &socket_id)); |
| 1658 return socket_id; | 1659 return socket_id; |
| 1659 } | 1660 } |
| 1660 | 1661 |
| 1661 void PepperPluginDelegateImpl::TCPSocketConnect( | 1662 void PepperPluginDelegateImpl::TCPSocketConnect( |
| 1662 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 1663 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
| 1663 uint32 socket_id, | 1664 uint32 socket_id, |
| 1664 const std::string& host, | 1665 const std::string& host, |
| 1665 uint16_t port) { | 1666 uint16_t port) { |
| 1666 tcp_sockets_.AddWithID(socket, socket_id); | 1667 TCPSocketRegister(socket, socket_id); |
| 1667 render_view_->Send( | 1668 render_view_->Send( |
| 1668 new PpapiHostMsg_PPBTCPSocket_Connect(socket_id, host, port)); | 1669 new PpapiHostMsg_PPBTCPSocket_Connect(socket_id, host, port)); |
| 1669 } | 1670 } |
| 1670 | 1671 |
| 1671 void PepperPluginDelegateImpl::TCPSocketConnectWithNetAddress( | 1672 void PepperPluginDelegateImpl::TCPSocketConnectWithNetAddress( |
| 1672 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | 1673 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, |
| 1673 uint32 socket_id, | 1674 uint32 socket_id, |
| 1674 const PP_NetAddress_Private& addr) { | 1675 const PP_NetAddress_Private& addr) { |
| 1675 tcp_sockets_.AddWithID(socket, socket_id); | 1676 tcp_sockets_.AddWithID(socket, socket_id); |
|
yzshen1
2012/02/09 02:31:50
TCPSocketRegister?
ygorshenin1
2012/02/09 15:00:10
Done.
| |
| 1676 render_view_->Send( | 1677 render_view_->Send( |
| 1677 new PpapiHostMsg_PPBTCPSocket_ConnectWithNetAddress(socket_id, addr)); | 1678 new PpapiHostMsg_PPBTCPSocket_ConnectWithNetAddress(socket_id, addr)); |
| 1678 } | 1679 } |
| 1679 | 1680 |
| 1680 void PepperPluginDelegateImpl::TCPSocketSSLHandshake( | 1681 void PepperPluginDelegateImpl::TCPSocketSSLHandshake( |
| 1681 uint32 socket_id, | 1682 uint32 socket_id, |
| 1682 const std::string& server_name, | 1683 const std::string& server_name, |
| 1683 uint16_t server_port) { | 1684 uint16_t server_port) { |
| 1684 DCHECK(tcp_sockets_.Lookup(socket_id)); | 1685 DCHECK(tcp_sockets_.Lookup(socket_id)); |
| 1685 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_SSLHandshake( | 1686 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_SSLHandshake( |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 1700 } | 1701 } |
| 1701 | 1702 |
| 1702 void PepperPluginDelegateImpl::TCPSocketDisconnect(uint32 socket_id) { | 1703 void PepperPluginDelegateImpl::TCPSocketDisconnect(uint32 socket_id) { |
| 1703 // There are no DCHECK(tcp_sockets_.Lookup(socket_id)) because it | 1704 // There are no DCHECK(tcp_sockets_.Lookup(socket_id)) because it |
| 1704 // can be called before | 1705 // can be called before |
| 1705 // TCPSocketConnect/TCPSocketConnectWithNetAddress is called. | 1706 // TCPSocketConnect/TCPSocketConnectWithNetAddress is called. |
| 1706 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_Disconnect(socket_id)); | 1707 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_Disconnect(socket_id)); |
| 1707 tcp_sockets_.Remove(socket_id); | 1708 tcp_sockets_.Remove(socket_id); |
| 1708 } | 1709 } |
| 1709 | 1710 |
| 1711 void PepperPluginDelegateImpl::TCPSocketRegister( | |
|
yzshen1
2012/02/09 02:31:50
Please use RegisterTCPSocket (Verb+Noun).
ygorshenin1
2012/02/09 15:00:10
Done.
| |
| 1712 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket, | |
| 1713 uint32 socket_id) { | |
| 1714 tcp_sockets_.AddWithID(socket, socket_id); | |
| 1715 } | |
| 1716 | |
| 1710 uint32 PepperPluginDelegateImpl::UDPSocketCreate() { | 1717 uint32 PepperPluginDelegateImpl::UDPSocketCreate() { |
| 1711 if (!CanUseSocketAPIs()) | 1718 if (!CanUseSocketAPIs()) |
| 1712 return 0; | 1719 return 0; |
| 1713 | 1720 |
| 1714 uint32 socket_id = 0; | 1721 uint32 socket_id = 0; |
| 1715 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Create( | 1722 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Create( |
| 1716 render_view_->routing_id(), 0, &socket_id)); | 1723 render_view_->routing_id(), 0, &socket_id)); |
| 1717 return socket_id; | 1724 return socket_id; |
| 1718 } | 1725 } |
| 1719 | 1726 |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 1741 new PpapiHostMsg_PPBUDPSocket_SendTo(socket_id, buffer, net_addr)); | 1748 new PpapiHostMsg_PPBUDPSocket_SendTo(socket_id, buffer, net_addr)); |
| 1742 } | 1749 } |
| 1743 | 1750 |
| 1744 void PepperPluginDelegateImpl::UDPSocketClose(uint32 socket_id) { | 1751 void PepperPluginDelegateImpl::UDPSocketClose(uint32 socket_id) { |
| 1745 // There are no DCHECK(udp_sockets_.Lookup(socket_id)) because it | 1752 // There are no DCHECK(udp_sockets_.Lookup(socket_id)) because it |
| 1746 // can be called before UDPSocketBind is called. | 1753 // can be called before UDPSocketBind is called. |
| 1747 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Close(socket_id)); | 1754 render_view_->Send(new PpapiHostMsg_PPBUDPSocket_Close(socket_id)); |
| 1748 udp_sockets_.Remove(socket_id); | 1755 udp_sockets_.Remove(socket_id); |
| 1749 } | 1756 } |
| 1750 | 1757 |
| 1758 bool PepperPluginDelegateImpl::TCPServerSocketInitialize( | |
| 1759 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket) { | |
| 1760 DCHECK(socket != NULL); | |
| 1761 if (!CanUseSocketAPIs()) | |
| 1762 return false; | |
| 1763 | |
| 1764 uninitialized_tcp_server_sockets_.push(socket); | |
| 1765 render_view_->Send(new PpapiHostMsg_PPBTCPServerSocket_Initialize( | |
| 1766 render_view_->routing_id(), 0)); | |
| 1767 return true; | |
| 1768 } | |
| 1769 | |
| 1770 void PepperPluginDelegateImpl::TCPServerSocketListen( | |
| 1771 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket, | |
| 1772 uint32 socket_id, | |
| 1773 const PP_NetAddress_Private& addr, | |
| 1774 int32_t backlog) { | |
| 1775 tcp_server_sockets_.AddWithID(socket, socket_id); | |
| 1776 render_view_->Send( | |
| 1777 new PpapiHostMsg_PPBTCPServerSocket_Listen(socket_id, addr, backlog)); | |
| 1778 } | |
| 1779 | |
| 1780 void PepperPluginDelegateImpl::TCPServerSocketAccept(uint32 socket_id) { | |
| 1781 DCHECK(tcp_server_sockets_.Lookup(socket_id)); | |
| 1782 render_view_->Send(new PpapiHostMsg_PPBTCPServerSocket_Accept(socket_id)); | |
| 1783 } | |
| 1784 | |
| 1785 void PepperPluginDelegateImpl::TCPServerSocketStopListening(uint32 socket_id) { | |
| 1786 // There are no DCHECK(tcp_server_sockets_.Lookup(socket_id)) | |
| 1787 // because it can be called before TCPServerSocketListen is called. | |
| 1788 render_view_->Send( | |
| 1789 new PpapiHostMsg_PPBTCPServerSocket_StopListening(socket_id)); | |
| 1790 tcp_server_sockets_.Remove(socket_id); | |
| 1791 } | |
| 1792 | |
| 1751 int32_t PepperPluginDelegateImpl::ShowContextMenu( | 1793 int32_t PepperPluginDelegateImpl::ShowContextMenu( |
| 1752 webkit::ppapi::PluginInstance* instance, | 1794 webkit::ppapi::PluginInstance* instance, |
| 1753 webkit::ppapi::PPB_Flash_Menu_Impl* menu, | 1795 webkit::ppapi::PPB_Flash_Menu_Impl* menu, |
| 1754 const gfx::Point& position) { | 1796 const gfx::Point& position) { |
| 1755 int32 render_widget_id = render_view_->routing_id(); | 1797 int32 render_widget_id = render_view_->routing_id(); |
| 1756 if (instance->FlashIsFullscreen(instance->pp_instance())) { | 1798 if (instance->FlashIsFullscreen(instance->pp_instance())) { |
| 1757 webkit::ppapi::FullscreenContainer* container = | 1799 webkit::ppapi::FullscreenContainer* container = |
| 1758 instance->fullscreen_container(); | 1800 instance->fullscreen_container(); |
| 1759 DCHECK(container); | 1801 DCHECK(container); |
| 1760 render_widget_id = | 1802 render_widget_id = |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1971 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK, | 2013 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ConnectACK, |
| 1972 OnTCPSocketConnectACK) | 2014 OnTCPSocketConnectACK) |
| 1973 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, | 2015 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_SSLHandshakeACK, |
| 1974 OnTCPSocketSSLHandshakeACK) | 2016 OnTCPSocketSSLHandshakeACK) |
| 1975 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK) | 2017 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_ReadACK, OnTCPSocketReadACK) |
| 1976 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK) | 2018 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPSocket_WriteACK, OnTCPSocketWriteACK) |
| 1977 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_BindACK, OnUDPSocketBindACK) | 2019 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_BindACK, OnUDPSocketBindACK) |
| 1978 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_RecvFromACK, | 2020 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_RecvFromACK, |
| 1979 OnUDPSocketRecvFromACK) | 2021 OnUDPSocketRecvFromACK) |
| 1980 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_SendToACK, OnUDPSocketSendToACK) | 2022 IPC_MESSAGE_HANDLER(PpapiMsg_PPBUDPSocket_SendToACK, OnUDPSocketSendToACK) |
| 2023 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPServerSocket_InitializeACK, | |
| 2024 OnTCPServerSocketInitializeACK) | |
| 2025 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPServerSocket_ListenACK, | |
| 2026 OnTCPServerSocketListenACK) | |
| 2027 IPC_MESSAGE_HANDLER(PpapiMsg_PPBTCPServerSocket_AcceptACK, | |
| 2028 OnTCPServerSocketAcceptACK) | |
| 1981 IPC_MESSAGE_UNHANDLED(handled = false) | 2029 IPC_MESSAGE_UNHANDLED(handled = false) |
| 1982 IPC_END_MESSAGE_MAP() | 2030 IPC_END_MESSAGE_MAP() |
| 1983 return handled; | 2031 return handled; |
| 1984 } | 2032 } |
| 1985 | 2033 |
| 1986 void PepperPluginDelegateImpl::OnDestruct() { | 2034 void PepperPluginDelegateImpl::OnDestruct() { |
| 1987 // Nothing to do here. Default implementation in RenderViewObserver does | 2035 // Nothing to do here. Default implementation in RenderViewObserver does |
| 1988 // 'delete this' but it's not suitable for PepperPluginDelegateImpl because | 2036 // 'delete this' but it's not suitable for PepperPluginDelegateImpl because |
| 1989 // it's non-pointer member in RenderViewImpl. | 2037 // it's non-pointer member in RenderViewImpl. |
| 1990 } | 2038 } |
| 1991 | 2039 |
| 1992 void PepperPluginDelegateImpl::OnTCPSocketConnectACK( | 2040 void PepperPluginDelegateImpl::OnTCPSocketConnectACK( |
| 1993 uint32 plugin_dispatcher_id, | 2041 uint32 plugin_dispatcher_id, |
| 1994 uint32 socket_id, | 2042 uint32 socket_id, |
| 1995 bool succeeded, | 2043 bool succeeded, |
| 1996 const PP_NetAddress_Private& local_addr, | 2044 const PP_NetAddress_Private& local_addr, |
| 1997 const PP_NetAddress_Private& remote_addr) { | 2045 const PP_NetAddress_Private& remote_addr) { |
| 1998 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = | 2046 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = |
| 1999 tcp_sockets_.Lookup(socket_id); | 2047 tcp_sockets_.Lookup(socket_id); |
| 2000 if (socket) | 2048 if (socket) |
| 2001 socket->OnConnectCompleted(succeeded, local_addr, remote_addr); | 2049 socket->OnConnectCompleted(succeeded, local_addr, remote_addr); |
| 2050 if (!succeeded) | |
| 2051 tcp_sockets_.Remove(socket_id); | |
| 2002 } | 2052 } |
| 2003 | 2053 |
| 2004 void PepperPluginDelegateImpl::OnTCPSocketSSLHandshakeACK( | 2054 void PepperPluginDelegateImpl::OnTCPSocketSSLHandshakeACK( |
| 2005 uint32 plugin_dispatcher_id, | 2055 uint32 plugin_dispatcher_id, |
| 2006 uint32 socket_id, | 2056 uint32 socket_id, |
| 2007 bool succeeded) { | 2057 bool succeeded) { |
| 2008 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = | 2058 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = |
| 2009 tcp_sockets_.Lookup(socket_id); | 2059 tcp_sockets_.Lookup(socket_id); |
| 2010 if (socket) | 2060 if (socket) |
| 2011 socket->OnSSLHandshakeCompleted(succeeded); | 2061 socket->OnSSLHandshakeCompleted(succeeded); |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 2031 socket->OnWriteCompleted(succeeded, bytes_written); | 2081 socket->OnWriteCompleted(succeeded, bytes_written); |
| 2032 } | 2082 } |
| 2033 | 2083 |
| 2034 void PepperPluginDelegateImpl::OnUDPSocketBindACK(uint32 plugin_dispatcher_id, | 2084 void PepperPluginDelegateImpl::OnUDPSocketBindACK(uint32 plugin_dispatcher_id, |
| 2035 uint32 socket_id, | 2085 uint32 socket_id, |
| 2036 bool succeeded) { | 2086 bool succeeded) { |
| 2037 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket = | 2087 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket = |
| 2038 udp_sockets_.Lookup(socket_id); | 2088 udp_sockets_.Lookup(socket_id); |
| 2039 if (socket) | 2089 if (socket) |
| 2040 socket->OnBindCompleted(succeeded); | 2090 socket->OnBindCompleted(succeeded); |
| 2091 if (!succeeded) | |
| 2092 udp_sockets_.Remove(socket_id); | |
| 2041 } | 2093 } |
| 2042 | 2094 |
| 2043 void PepperPluginDelegateImpl::OnUDPSocketRecvFromACK( | 2095 void PepperPluginDelegateImpl::OnUDPSocketRecvFromACK( |
| 2044 uint32 plugin_dispatcher_id, | 2096 uint32 plugin_dispatcher_id, |
| 2045 uint32 socket_id, | 2097 uint32 socket_id, |
| 2046 bool succeeded, | 2098 bool succeeded, |
| 2047 const std::string& data, | 2099 const std::string& data, |
| 2048 const PP_NetAddress_Private& remote_addr) { | 2100 const PP_NetAddress_Private& remote_addr) { |
| 2049 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket = | 2101 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket = |
| 2050 udp_sockets_.Lookup(socket_id); | 2102 udp_sockets_.Lookup(socket_id); |
| 2051 if (socket) | 2103 if (socket) |
| 2052 socket->OnRecvFromCompleted(succeeded, data, remote_addr); | 2104 socket->OnRecvFromCompleted(succeeded, data, remote_addr); |
| 2053 } | 2105 } |
| 2054 | 2106 |
| 2055 void PepperPluginDelegateImpl::OnUDPSocketSendToACK(uint32 plugin_dispatcher_id, | 2107 void PepperPluginDelegateImpl::OnUDPSocketSendToACK(uint32 plugin_dispatcher_id, |
| 2056 uint32 socket_id, | 2108 uint32 socket_id, |
| 2057 bool succeeded, | 2109 bool succeeded, |
| 2058 int32_t bytes_written) { | 2110 int32_t bytes_written) { |
| 2059 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket = | 2111 webkit::ppapi::PPB_UDPSocket_Private_Impl* socket = |
| 2060 udp_sockets_.Lookup(socket_id); | 2112 udp_sockets_.Lookup(socket_id); |
| 2061 if (socket) | 2113 if (socket) |
| 2062 socket->OnSendToCompleted(succeeded, bytes_written); | 2114 socket->OnSendToCompleted(succeeded, bytes_written); |
| 2063 } | 2115 } |
| 2064 | 2116 |
| 2117 void PepperPluginDelegateImpl::OnTCPServerSocketListenACK( | |
| 2118 uint32 plugin_dispatcher_id, | |
| 2119 uint32 socket_id, | |
| 2120 bool succeeded) { | |
| 2121 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket = | |
| 2122 tcp_server_sockets_.Lookup(socket_id); | |
| 2123 if (socket) | |
| 2124 socket->OnListenCompleted(succeeded); | |
| 2125 if (!succeeded) | |
| 2126 tcp_server_sockets_.Remove(socket_id); | |
| 2127 } | |
| 2128 | |
| 2129 void PepperPluginDelegateImpl::OnTCPServerSocketInitializeACK( | |
| 2130 uint32 plugin_dispatcher_id, | |
| 2131 uint32 tcp_server_socket_id) { | |
| 2132 DCHECK(!uninitialized_tcp_server_sockets_.empty()); | |
| 2133 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket = | |
| 2134 uninitialized_tcp_server_sockets_.front(); | |
| 2135 uninitialized_tcp_server_sockets_.pop(); | |
| 2136 DCHECK(socket != NULL); | |
| 2137 socket->OnInitializeCompleted(tcp_server_socket_id); | |
| 2138 } | |
| 2139 | |
| 2140 void PepperPluginDelegateImpl::OnTCPServerSocketAcceptACK( | |
| 2141 uint32 plugin_dispatcher_id, | |
| 2142 uint32 tcp_server_socket_id, | |
| 2143 uint32 tcp_socket_id, | |
| 2144 const PP_NetAddress_Private& local_addr, | |
| 2145 const PP_NetAddress_Private& remote_addr) { | |
| 2146 webkit::ppapi::PPB_TCPServerSocket_Private_Impl* socket = | |
| 2147 tcp_server_sockets_.Lookup(tcp_server_socket_id); | |
| 2148 if (socket) { | |
| 2149 bool succeeded = tcp_socket_id != 0; | |
| 2150 socket->OnAcceptCompleted(succeeded, | |
| 2151 tcp_socket_id, | |
| 2152 local_addr, | |
| 2153 remote_addr); | |
| 2154 } | |
| 2155 } | |
| 2156 | |
| 2065 int PepperPluginDelegateImpl::GetRoutingId() const { | 2157 int PepperPluginDelegateImpl::GetRoutingId() const { |
| 2066 return render_view_->routing_id(); | 2158 return render_view_->routing_id(); |
| 2067 } | 2159 } |
| 2068 | 2160 |
| 2069 ContentGLContext* | 2161 ContentGLContext* |
| 2070 PepperPluginDelegateImpl::GetParentContextForPlatformContext3D() { | 2162 PepperPluginDelegateImpl::GetParentContextForPlatformContext3D() { |
| 2071 WebGraphicsContext3DCommandBufferImpl* context = | 2163 WebGraphicsContext3DCommandBufferImpl* context = |
| 2072 static_cast<WebGraphicsContext3DCommandBufferImpl*>( | 2164 static_cast<WebGraphicsContext3DCommandBufferImpl*>( |
| 2073 render_view_->webview()->graphicsContext3D()); | 2165 render_view_->webview()->graphicsContext3D()); |
| 2074 if (!context) | 2166 if (!context) |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2106 void PepperPluginDelegateImpl::UnSetAndDeleteLockTargetAdapter( | 2198 void PepperPluginDelegateImpl::UnSetAndDeleteLockTargetAdapter( |
| 2107 webkit::ppapi::PluginInstance* instance) { | 2199 webkit::ppapi::PluginInstance* instance) { |
| 2108 LockTargetMap::iterator it = mouse_lock_instances_.find(instance); | 2200 LockTargetMap::iterator it = mouse_lock_instances_.find(instance); |
| 2109 if (it != mouse_lock_instances_.end()) { | 2201 if (it != mouse_lock_instances_.end()) { |
| 2110 MouseLockDispatcher::LockTarget* target = it->second; | 2202 MouseLockDispatcher::LockTarget* target = it->second; |
| 2111 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); | 2203 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); |
| 2112 delete target; | 2204 delete target; |
| 2113 mouse_lock_instances_.erase(it); | 2205 mouse_lock_instances_.erase(it); |
| 2114 } | 2206 } |
| 2115 } | 2207 } |
| OLD | NEW |