OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/media/rtc_certificate_generator.h" | 5 #include "content/renderer/media/rtc_certificate_generator.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 return WebRTCKeyParamsToKeyParams(key_params).IsValid(); | 159 return WebRTCKeyParamsToKeyParams(key_params).IsValid(); |
160 } | 160 } |
161 | 161 |
162 std::unique_ptr<blink::WebRTCCertificate> RTCCertificateGenerator::fromPEM( | 162 std::unique_ptr<blink::WebRTCCertificate> RTCCertificateGenerator::fromPEM( |
163 blink::WebString pem_private_key, | 163 blink::WebString pem_private_key, |
164 blink::WebString pem_certificate) { | 164 blink::WebString pem_certificate) { |
165 rtc::scoped_refptr<rtc::RTCCertificate> certificate = | 165 rtc::scoped_refptr<rtc::RTCCertificate> certificate = |
166 rtc::RTCCertificate::FromPEM( | 166 rtc::RTCCertificate::FromPEM( |
167 rtc::RTCCertificatePEM(pem_private_key.utf8(), | 167 rtc::RTCCertificatePEM(pem_private_key.utf8(), |
168 pem_certificate.utf8())); | 168 pem_certificate.utf8())); |
169 return std::unique_ptr<blink::WebRTCCertificate>( | 169 if (!certificate) |
170 new RTCCertificate(certificate)); | 170 return nullptr; |
| 171 return base::MakeUnique<RTCCertificate>(certificate); |
171 } | 172 } |
172 | 173 |
173 } // namespace content | 174 } // namespace content |
OLD | NEW |