| 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 <map> | 8 #include <map> |
| 9 #include <queue> | 9 #include <queue> |
| 10 | 10 |
| (...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 const PP_NetAddress_Private& addr) { | 977 const PP_NetAddress_Private& addr) { |
| 978 RegisterTCPSocket(socket, socket_id); | 978 RegisterTCPSocket(socket, socket_id); |
| 979 render_view_->Send( | 979 render_view_->Send( |
| 980 new PpapiHostMsg_PPBTCPSocket_ConnectWithNetAddress( | 980 new PpapiHostMsg_PPBTCPSocket_ConnectWithNetAddress( |
| 981 render_view_->routing_id(), socket_id, addr)); | 981 render_view_->routing_id(), socket_id, addr)); |
| 982 } | 982 } |
| 983 | 983 |
| 984 void PepperPluginDelegateImpl::TCPSocketSSLHandshake( | 984 void PepperPluginDelegateImpl::TCPSocketSSLHandshake( |
| 985 uint32 socket_id, | 985 uint32 socket_id, |
| 986 const std::string& server_name, | 986 const std::string& server_name, |
| 987 uint16_t server_port) { | 987 uint16_t server_port, |
| 988 const std::vector<std::vector<char> >& trusted_certs, |
| 989 const std::vector<std::vector<char> >& untrusted_certs) { |
| 988 DCHECK(tcp_sockets_.Lookup(socket_id)); | 990 DCHECK(tcp_sockets_.Lookup(socket_id)); |
| 989 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_SSLHandshake( | 991 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_SSLHandshake( |
| 990 socket_id, server_name, server_port)); | 992 socket_id, server_name, server_port, trusted_certs, untrusted_certs)); |
| 991 } | 993 } |
| 992 | 994 |
| 993 void PepperPluginDelegateImpl::TCPSocketRead(uint32 socket_id, | 995 void PepperPluginDelegateImpl::TCPSocketRead(uint32 socket_id, |
| 994 int32_t bytes_to_read) { | 996 int32_t bytes_to_read) { |
| 995 DCHECK(tcp_sockets_.Lookup(socket_id)); | 997 DCHECK(tcp_sockets_.Lookup(socket_id)); |
| 996 render_view_->Send( | 998 render_view_->Send( |
| 997 new PpapiHostMsg_PPBTCPSocket_Read(socket_id, bytes_to_read)); | 999 new PpapiHostMsg_PPBTCPSocket_Read(socket_id, bytes_to_read)); |
| 998 } | 1000 } |
| 999 | 1001 |
| 1000 void PepperPluginDelegateImpl::TCPSocketWrite(uint32 socket_id, | 1002 void PepperPluginDelegateImpl::TCPSocketWrite(uint32 socket_id, |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1401 tcp_sockets_.Lookup(socket_id); | 1403 tcp_sockets_.Lookup(socket_id); |
| 1402 if (socket) | 1404 if (socket) |
| 1403 socket->OnConnectCompleted(succeeded, local_addr, remote_addr); | 1405 socket->OnConnectCompleted(succeeded, local_addr, remote_addr); |
| 1404 if (!succeeded) | 1406 if (!succeeded) |
| 1405 tcp_sockets_.Remove(socket_id); | 1407 tcp_sockets_.Remove(socket_id); |
| 1406 } | 1408 } |
| 1407 | 1409 |
| 1408 void PepperPluginDelegateImpl::OnTCPSocketSSLHandshakeACK( | 1410 void PepperPluginDelegateImpl::OnTCPSocketSSLHandshakeACK( |
| 1409 uint32 plugin_dispatcher_id, | 1411 uint32 plugin_dispatcher_id, |
| 1410 uint32 socket_id, | 1412 uint32 socket_id, |
| 1411 bool succeeded) { | 1413 bool succeeded, |
| 1414 const ppapi::PPB_X509Certificate_Fields& certificate_fields) { |
| 1412 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = | 1415 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = |
| 1413 tcp_sockets_.Lookup(socket_id); | 1416 tcp_sockets_.Lookup(socket_id); |
| 1414 if (socket) | 1417 if (socket) |
| 1415 socket->OnSSLHandshakeCompleted(succeeded); | 1418 socket->OnSSLHandshakeCompleted(succeeded, certificate_fields); |
| 1416 } | 1419 } |
| 1417 | 1420 |
| 1418 void PepperPluginDelegateImpl::OnTCPSocketReadACK(uint32 plugin_dispatcher_id, | 1421 void PepperPluginDelegateImpl::OnTCPSocketReadACK(uint32 plugin_dispatcher_id, |
| 1419 uint32 socket_id, | 1422 uint32 socket_id, |
| 1420 bool succeeded, | 1423 bool succeeded, |
| 1421 const std::string& data) { | 1424 const std::string& data) { |
| 1422 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = | 1425 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = |
| 1423 tcp_sockets_.Lookup(socket_id); | 1426 tcp_sockets_.Lookup(socket_id); |
| 1424 if (socket) | 1427 if (socket) |
| 1425 socket->OnReadCompleted(succeeded, data); | 1428 socket->OnReadCompleted(succeeded, data); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1591 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); | 1594 render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(target); |
| 1592 delete target; | 1595 delete target; |
| 1593 mouse_lock_instances_.erase(it); | 1596 mouse_lock_instances_.erase(it); |
| 1594 } | 1597 } |
| 1595 } | 1598 } |
| 1596 | 1599 |
| 1597 webkit_glue::ClipboardClient* | 1600 webkit_glue::ClipboardClient* |
| 1598 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1601 PepperPluginDelegateImpl::CreateClipboardClient() const { |
| 1599 return new RendererClipboardClient; | 1602 return new RendererClipboardClient; |
| 1600 } | 1603 } |
| OLD | NEW |