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