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

Side by Side Diff: webrtc/api/test/fakedtlsidentitystore.h

Issue 1920043002: Replace scoped_ptr with unique_ptr in webrtc/base/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 4 years, 7 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 | « webrtc/api/statscollector_unittest.cc ('k') | webrtc/api/webrtcsession.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 /* 1 /*
2 * Copyright 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_API_TEST_FAKEDTLSIDENTITYSERVICE_H_ 11 #ifndef WEBRTC_API_TEST_FAKEDTLSIDENTITYSERVICE_H_
12 #define WEBRTC_API_TEST_FAKEDTLSIDENTITYSERVICE_H_ 12 #define WEBRTC_API_TEST_FAKEDTLSIDENTITYSERVICE_H_
13 13
14 #include <memory>
14 #include <string> 15 #include <string>
15 #include <utility> 16 #include <utility>
16 17
17 #include "webrtc/api/dtlsidentitystore.h" 18 #include "webrtc/api/dtlsidentitystore.h"
18 #include "webrtc/api/peerconnectioninterface.h" 19 #include "webrtc/api/peerconnectioninterface.h"
19 #include "webrtc/base/rtccertificate.h" 20 #include "webrtc/base/rtccertificate.h"
20 21
21 static const struct { 22 static const struct {
22 const char* rsa_private_key_pem; 23 const char* rsa_private_key_pem;
23 const char* cert_pem; 24 const char* cert_pem;
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 kKeysAndCerts[0].rsa_private_key_pem, &key); 121 kKeysAndCerts[0].rsa_private_key_pem, &key);
121 122
122 std::string pem_cert = rtc::SSLIdentity::DerToPem( 123 std::string pem_cert = rtc::SSLIdentity::DerToPem(
123 rtc::kPemTypeCertificate, 124 rtc::kPemTypeCertificate,
124 reinterpret_cast<const unsigned char*>(cert.data()), 125 reinterpret_cast<const unsigned char*>(cert.data()),
125 cert.length()); 126 cert.length());
126 std::string pem_key = rtc::SSLIdentity::DerToPem( 127 std::string pem_key = rtc::SSLIdentity::DerToPem(
127 rtc::kPemTypeRsaPrivateKey, 128 rtc::kPemTypeRsaPrivateKey,
128 reinterpret_cast<const unsigned char*>(key.data()), 129 reinterpret_cast<const unsigned char*>(key.data()),
129 key.length()); 130 key.length());
130 rtc::scoped_ptr<rtc::SSLIdentity> identity( 131 std::unique_ptr<rtc::SSLIdentity> identity(
131 rtc::SSLIdentity::FromPEMStrings(pem_key, pem_cert)); 132 rtc::SSLIdentity::FromPEMStrings(pem_key, pem_cert));
132 133
133 return rtc::RTCCertificate::Create(std::move(identity)); 134 return rtc::RTCCertificate::Create(std::move(identity));
134 } 135 }
135 136
136 private: 137 private:
137 enum { 138 enum {
138 MSG_SUCCESS, 139 MSG_SUCCESS,
139 MSG_FAILURE, 140 MSG_FAILURE,
140 }; 141 };
(...skipping 22 matching lines...) Expand all
163 break; 164 break;
164 } 165 }
165 delete message_data; 166 delete message_data;
166 } 167 }
167 168
168 bool should_fail_; 169 bool should_fail_;
169 int key_index_ = 0; 170 int key_index_ = 0;
170 }; 171 };
171 172
172 #endif // WEBRTC_API_TEST_FAKEDTLSIDENTITYSERVICE_H_ 173 #endif // WEBRTC_API_TEST_FAKEDTLSIDENTITYSERVICE_H_
OLDNEW
« no previous file with comments | « webrtc/api/statscollector_unittest.cc ('k') | webrtc/api/webrtcsession.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698