| 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 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 const PP_NetAddress_Private& addr) { | 948 const PP_NetAddress_Private& addr) { |
| 949 RegisterTCPSocket(socket, socket_id); | 949 RegisterTCPSocket(socket, socket_id); |
| 950 render_view_->Send( | 950 render_view_->Send( |
| 951 new PpapiHostMsg_PPBTCPSocket_ConnectWithNetAddress( | 951 new PpapiHostMsg_PPBTCPSocket_ConnectWithNetAddress( |
| 952 render_view_->routing_id(), socket_id, addr)); | 952 render_view_->routing_id(), socket_id, addr)); |
| 953 } | 953 } |
| 954 | 954 |
| 955 void PepperPluginDelegateImpl::TCPSocketSSLHandshake( | 955 void PepperPluginDelegateImpl::TCPSocketSSLHandshake( |
| 956 uint32 socket_id, | 956 uint32 socket_id, |
| 957 const std::string& server_name, | 957 const std::string& server_name, |
| 958 uint16_t server_port) { | 958 uint16_t server_port, |
| 959 const std::vector<std::vector<char> >& trusted_certs, |
| 960 const std::vector<std::vector<char> >& untrusted_certs) { |
| 959 DCHECK(tcp_sockets_.Lookup(socket_id)); | 961 DCHECK(tcp_sockets_.Lookup(socket_id)); |
| 960 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_SSLHandshake( | 962 render_view_->Send(new PpapiHostMsg_PPBTCPSocket_SSLHandshake( |
| 961 socket_id, server_name, server_port)); | 963 socket_id, server_name, server_port, trusted_certs, untrusted_certs)); |
| 962 } | 964 } |
| 963 | 965 |
| 964 void PepperPluginDelegateImpl::TCPSocketRead(uint32 socket_id, | 966 void PepperPluginDelegateImpl::TCPSocketRead(uint32 socket_id, |
| 965 int32_t bytes_to_read) { | 967 int32_t bytes_to_read) { |
| 966 DCHECK(tcp_sockets_.Lookup(socket_id)); | 968 DCHECK(tcp_sockets_.Lookup(socket_id)); |
| 967 render_view_->Send( | 969 render_view_->Send( |
| 968 new PpapiHostMsg_PPBTCPSocket_Read(socket_id, bytes_to_read)); | 970 new PpapiHostMsg_PPBTCPSocket_Read(socket_id, bytes_to_read)); |
| 969 } | 971 } |
| 970 | 972 |
| 971 void PepperPluginDelegateImpl::TCPSocketWrite(uint32 socket_id, | 973 void PepperPluginDelegateImpl::TCPSocketWrite(uint32 socket_id, |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1403 tcp_sockets_.Lookup(socket_id); | 1405 tcp_sockets_.Lookup(socket_id); |
| 1404 if (socket) | 1406 if (socket) |
| 1405 socket->OnConnectCompleted(succeeded, local_addr, remote_addr); | 1407 socket->OnConnectCompleted(succeeded, local_addr, remote_addr); |
| 1406 if (!succeeded) | 1408 if (!succeeded) |
| 1407 tcp_sockets_.Remove(socket_id); | 1409 tcp_sockets_.Remove(socket_id); |
| 1408 } | 1410 } |
| 1409 | 1411 |
| 1410 void PepperPluginDelegateImpl::OnTCPSocketSSLHandshakeACK( | 1412 void PepperPluginDelegateImpl::OnTCPSocketSSLHandshakeACK( |
| 1411 uint32 plugin_dispatcher_id, | 1413 uint32 plugin_dispatcher_id, |
| 1412 uint32 socket_id, | 1414 uint32 socket_id, |
| 1413 bool succeeded) { | 1415 bool succeeded, |
| 1416 const ppapi::PPB_X509Certificate_Fields& certificate_fields) { |
| 1414 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = | 1417 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = |
| 1415 tcp_sockets_.Lookup(socket_id); | 1418 tcp_sockets_.Lookup(socket_id); |
| 1416 if (socket) | 1419 if (socket) |
| 1417 socket->OnSSLHandshakeCompleted(succeeded); | 1420 socket->OnSSLHandshakeCompleted(succeeded, certificate_fields); |
| 1418 } | 1421 } |
| 1419 | 1422 |
| 1420 void PepperPluginDelegateImpl::OnTCPSocketReadACK(uint32 plugin_dispatcher_id, | 1423 void PepperPluginDelegateImpl::OnTCPSocketReadACK(uint32 plugin_dispatcher_id, |
| 1421 uint32 socket_id, | 1424 uint32 socket_id, |
| 1422 bool succeeded, | 1425 bool succeeded, |
| 1423 const std::string& data) { | 1426 const std::string& data) { |
| 1424 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = | 1427 webkit::ppapi::PPB_TCPSocket_Private_Impl* socket = |
| 1425 tcp_sockets_.Lookup(socket_id); | 1428 tcp_sockets_.Lookup(socket_id); |
| 1426 if (socket) | 1429 if (socket) |
| 1427 socket->OnReadCompleted(succeeded, data); | 1430 socket->OnReadCompleted(succeeded, data); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1611 mouse_lock_instances_.erase(it); | 1614 mouse_lock_instances_.erase(it); |
| 1612 } | 1615 } |
| 1613 } | 1616 } |
| 1614 | 1617 |
| 1615 webkit_glue::ClipboardClient* | 1618 webkit_glue::ClipboardClient* |
| 1616 PepperPluginDelegateImpl::CreateClipboardClient() const { | 1619 PepperPluginDelegateImpl::CreateClipboardClient() const { |
| 1617 return new RendererClipboardClient; | 1620 return new RendererClipboardClient; |
| 1618 } | 1621 } |
| 1619 | 1622 |
| 1620 } // namespace content | 1623 } // namespace content |
| OLD | NEW |