Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: content/browser/renderer_host/pepper/pepper_socket_utils.cc

Issue 2799093006: Remove base::BinaryValue (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromecast/base/serializers_unittest.cc ('k') | content/child/v8_value_converter_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/memory/ptr_util.h" 11 #include "base/memory/ptr_util.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/values.h"
14 #include "build/build_config.h" 15 #include "build/build_config.h"
15 #include "content/public/browser/browser_thread.h" 16 #include "content/public/browser/browser_thread.h"
16 #include "content/public/browser/content_browser_client.h" 17 #include "content/public/browser/content_browser_client.h"
17 #include "content/public/browser/render_frame_host.h" 18 #include "content/public/browser/render_frame_host.h"
18 #include "content/public/browser/site_instance.h" 19 #include "content/public/browser/site_instance.h"
19 #include "content/public/common/content_client.h" 20 #include "content/public/common/content_client.h"
20 #include "net/base/ip_address.h" 21 #include "net/base/ip_address.h"
21 #include "net/base/ip_endpoint.h" 22 #include "net/base/ip_endpoint.h"
22 #include "net/cert/x509_certificate.h" 23 #include "net/cert/x509_certificate.h"
23 #include "ppapi/c/private/ppb_net_address_private.h" 24 #include "ppapi/c/private/ppb_net_address_private.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 base::MakeUnique<base::Value>(subject.country_name)); 108 base::MakeUnique<base::Value>(subject.country_name));
108 fields->SetField(PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_NAME, 109 fields->SetField(PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_NAME,
109 base::MakeUnique<base::Value>( 110 base::MakeUnique<base::Value>(
110 base::JoinString(subject.organization_names, "\n"))); 111 base::JoinString(subject.organization_names, "\n")));
111 fields->SetField(PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME, 112 fields->SetField(PP_X509CERTIFICATE_PRIVATE_SUBJECT_ORGANIZATION_UNIT_NAME,
112 base::MakeUnique<base::Value>(base::JoinString( 113 base::MakeUnique<base::Value>(base::JoinString(
113 subject.organization_unit_names, "\n"))); 114 subject.organization_unit_names, "\n")));
114 115
115 const std::string& serial_number = cert.serial_number(); 116 const std::string& serial_number = cert.serial_number();
116 fields->SetField(PP_X509CERTIFICATE_PRIVATE_SERIAL_NUMBER, 117 fields->SetField(PP_X509CERTIFICATE_PRIVATE_SERIAL_NUMBER,
117 base::BinaryValue::CreateWithCopiedBuffer( 118 base::Value::CreateWithCopiedBuffer(serial_number.data(),
118 serial_number.data(), serial_number.length())); 119 serial_number.length()));
119 fields->SetField( 120 fields->SetField(
120 PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_BEFORE, 121 PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_BEFORE,
121 base::MakeUnique<base::Value>(cert.valid_start().ToDoubleT())); 122 base::MakeUnique<base::Value>(cert.valid_start().ToDoubleT()));
122 fields->SetField( 123 fields->SetField(
123 PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_AFTER, 124 PP_X509CERTIFICATE_PRIVATE_VALIDITY_NOT_AFTER,
124 base::MakeUnique<base::Value>(cert.valid_expiry().ToDoubleT())); 125 base::MakeUnique<base::Value>(cert.valid_expiry().ToDoubleT()));
125 std::string der; 126 std::string der;
126 net::X509Certificate::GetDEREncoded(cert.os_cert_handle(), &der); 127 net::X509Certificate::GetDEREncoded(cert.os_cert_handle(), &der);
127 fields->SetField( 128 fields->SetField(
128 PP_X509CERTIFICATE_PRIVATE_RAW, 129 PP_X509CERTIFICATE_PRIVATE_RAW,
129 base::BinaryValue::CreateWithCopiedBuffer(der.data(), der.length())); 130 base::Value::CreateWithCopiedBuffer(der.data(), der.length()));
130 return true; 131 return true;
131 } 132 }
132 133
133 bool GetCertificateFields(const char* der, 134 bool GetCertificateFields(const char* der,
134 uint32_t length, 135 uint32_t length,
135 ppapi::PPB_X509Certificate_Fields* fields) { 136 ppapi::PPB_X509Certificate_Fields* fields) {
136 scoped_refptr<net::X509Certificate> cert = 137 scoped_refptr<net::X509Certificate> cert =
137 net::X509Certificate::CreateFromBytes(der, length); 138 net::X509Certificate::CreateFromBytes(der, length);
138 if (!cert.get()) 139 if (!cert.get())
139 return false; 140 return false;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 } 181 }
181 182
182 void OpenUDPFirewallHole(const net::IPEndPoint& address, 183 void OpenUDPFirewallHole(const net::IPEndPoint& address,
183 FirewallHoleOpenCallback callback) { 184 FirewallHoleOpenCallback callback) {
184 OpenFirewallHole(address, chromeos::FirewallHole::PortType::UDP, callback); 185 OpenFirewallHole(address, chromeos::FirewallHole::PortType::UDP, callback);
185 } 186 }
186 #endif // defined(OS_CHROMEOS) 187 #endif // defined(OS_CHROMEOS)
187 188
188 } // namespace pepper_socket_utils 189 } // namespace pepper_socket_utils
189 } // namespace content 190 } // namespace content
OLDNEW
« no previous file with comments | « chromecast/base/serializers_unittest.cc ('k') | content/child/v8_value_converter_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698