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

Side by Side Diff: net/test/cert_test_util_nss.cc

Issue 509563003: Remove implicit conversions from scoped_refptr to T* in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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_client_auth_cache_unittest.cc ('k') | net/tools/crl_set_dump/crl_set_dump.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/test/cert_test_util.h" 5 #include "net/test/cert_test_util.h"
6 6
7 #include <pk11pub.h> 7 #include <pk11pub.h>
8 #include <secmodt.h> 8 #include <secmodt.h>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 const std::string& cert_filename, 64 const std::string& cert_filename,
65 const std::string& key_filename, 65 const std::string& key_filename,
66 PK11SlotInfo* slot) { 66 PK11SlotInfo* slot) {
67 if (!ImportSensitiveKeyFromFile(dir, key_filename, slot)) { 67 if (!ImportSensitiveKeyFromFile(dir, key_filename, slot)) {
68 LOG(ERROR) << "Could not import private key from file " << key_filename; 68 LOG(ERROR) << "Could not import private key from file " << key_filename;
69 return NULL; 69 return NULL;
70 } 70 }
71 71
72 scoped_refptr<X509Certificate> cert(ImportCertFromFile(dir, cert_filename)); 72 scoped_refptr<X509Certificate> cert(ImportCertFromFile(dir, cert_filename));
73 73
74 if (!cert) { 74 if (!cert.get()) {
75 LOG(ERROR) << "Failed to parse cert from file " << cert_filename; 75 LOG(ERROR) << "Failed to parse cert from file " << cert_filename;
76 return NULL; 76 return NULL;
77 } 77 }
78 78
79 if (!ImportClientCertToSlot(cert, slot)) 79 if (!ImportClientCertToSlot(cert, slot))
80 return NULL; 80 return NULL;
81 81
82 // |cert| continues to point to the original X509Certificate before the 82 // |cert| continues to point to the original X509Certificate before the
83 // import to |slot|. However this should not make a difference as NSS handles 83 // import to |slot|. However this should not make a difference as NSS handles
84 // state globally. 84 // state globally.
85 return cert; 85 return cert;
86 } 86 }
87 87
88 } // namespace net 88 } // namespace net
OLDNEW
« no previous file with comments | « net/ssl/ssl_client_auth_cache_unittest.cc ('k') | net/tools/crl_set_dump/crl_set_dump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698