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

Side by Side Diff: net/ssl/ssl_platform_key_win.cc

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 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 | « net/ssl/ssl_platform_key_nss.cc ('k') | net/ssl/test_ssl_private_key.cc » ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 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 "net/ssl/ssl_platform_key.h" 5 #include "net/ssl/ssl_platform_key.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <NCrypt.h> 8 #include <NCrypt.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 if (!CryptAcquireCertificatePrivateKey(cert_context, flags, nullptr, 344 if (!CryptAcquireCertificatePrivateKey(cert_context, flags, nullptr,
345 &prov_or_key, &key_spec, &must_free)) { 345 &prov_or_key, &key_spec, &must_free)) {
346 PLOG(WARNING) << "Could not acquire private key"; 346 PLOG(WARNING) << "Could not acquire private key";
347 return nullptr; 347 return nullptr;
348 } 348 }
349 349
350 // Should never get a cached handle back - ownership must always be 350 // Should never get a cached handle back - ownership must always be
351 // transferred. 351 // transferred.
352 CHECK_EQ(must_free, TRUE); 352 CHECK_EQ(must_free, TRUE);
353 353
354 scoped_ptr<ThreadedSSLPrivateKey::Delegate> delegate; 354 std::unique_ptr<ThreadedSSLPrivateKey::Delegate> delegate;
355 if (key_spec == CERT_NCRYPT_KEY_SPEC) { 355 if (key_spec == CERT_NCRYPT_KEY_SPEC) {
356 delegate.reset(new SSLPlatformKeyCNG(prov_or_key, key_type, max_length)); 356 delegate.reset(new SSLPlatformKeyCNG(prov_or_key, key_type, max_length));
357 } else { 357 } else {
358 DCHECK(SSLPrivateKey::Type::RSA == key_type); 358 DCHECK(SSLPrivateKey::Type::RSA == key_type);
359 delegate.reset(new SSLPlatformKeyCAPI(prov_or_key, key_spec, max_length)); 359 delegate.reset(new SSLPlatformKeyCAPI(prov_or_key, key_spec, max_length));
360 } 360 }
361 return make_scoped_refptr(new ThreadedSSLPrivateKey( 361 return make_scoped_refptr(new ThreadedSSLPrivateKey(
362 std::move(delegate), GetSSLPlatformKeyTaskRunner())); 362 std::move(delegate), GetSSLPlatformKeyTaskRunner()));
363 } 363 }
364 364
365 } // namespace net 365 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/ssl_platform_key_nss.cc ('k') | net/ssl/test_ssl_private_key.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698