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/browser/renderer_host/pepper/pepper_socket_utils.h" | 5 #include "content/browser/renderer_host/pepper/pepper_socket_utils.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h" | 21 #include "ppapi/shared_impl/private/ppb_x509_certificate_private_shared.h" |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 namespace pepper_socket_utils { | 24 namespace pepper_socket_utils { |
25 | 25 |
26 SocketPermissionRequest CreateSocketPermissionRequest( | 26 SocketPermissionRequest CreateSocketPermissionRequest( |
27 SocketPermissionRequest::OperationType type, | 27 SocketPermissionRequest::OperationType type, |
28 const PP_NetAddress_Private& net_addr) { | 28 const PP_NetAddress_Private& net_addr) { |
29 std::string host = | 29 std::string host = |
30 ppapi::NetAddressPrivateImpl::DescribeNetAddress(net_addr, false); | 30 ppapi::NetAddressPrivateImpl::DescribeNetAddress(net_addr, false); |
31 int port = 0; | 31 uint16 port = 0; |
32 std::vector<unsigned char> address; | 32 std::vector<unsigned char> address; |
33 ppapi::NetAddressPrivateImpl::NetAddressToIPEndPoint( | 33 ppapi::NetAddressPrivateImpl::NetAddressToIPEndPoint( |
34 net_addr, &address, &port); | 34 net_addr, &address, &port); |
35 return SocketPermissionRequest(type, host, port); | 35 return SocketPermissionRequest(type, host, port); |
36 } | 36 } |
37 | 37 |
38 bool CanUseSocketAPIs(bool external_plugin, | 38 bool CanUseSocketAPIs(bool external_plugin, |
39 bool private_api, | 39 bool private_api, |
40 const SocketPermissionRequest* params, | 40 const SocketPermissionRequest* params, |
41 int render_process_id, | 41 int render_process_id, |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 ppapi::PPB_X509Certificate_Fields* fields) { | 123 ppapi::PPB_X509Certificate_Fields* fields) { |
124 scoped_refptr<net::X509Certificate> cert = | 124 scoped_refptr<net::X509Certificate> cert = |
125 net::X509Certificate::CreateFromBytes(der, length); | 125 net::X509Certificate::CreateFromBytes(der, length); |
126 if (!cert.get()) | 126 if (!cert.get()) |
127 return false; | 127 return false; |
128 return GetCertificateFields(*cert.get(), fields); | 128 return GetCertificateFields(*cert.get(), fields); |
129 } | 129 } |
130 | 130 |
131 } // namespace pepper_socket_utils | 131 } // namespace pepper_socket_utils |
132 } // namespace content | 132 } // namespace content |
OLD | NEW |