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

Side by Side Diff: net/quic/test_tools/crypto_test_utils_nss.cc

Issue 612323013: QUIC - (no behavior change) s/NULL/nullptr/g in .../quic/... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/quic/test_tools/crypto_test_utils.h" 5 #include "net/quic/test_tools/crypto_test_utils.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "crypto/ec_private_key.h" 9 #include "crypto/ec_private_key.h"
10 #include "crypto/ec_signature_creator.h" 10 #include "crypto/ec_signature_creator.h"
(...skipping 27 matching lines...) Expand all
38 typedef std::map<string, crypto::ECPrivateKey*> HostnameToKeyMap; 38 typedef std::map<string, crypto::ECPrivateKey*> HostnameToKeyMap;
39 39
40 crypto::ECPrivateKey* HostnameToKey(const string& hostname) { 40 crypto::ECPrivateKey* HostnameToKey(const string& hostname) {
41 HostnameToKeyMap::const_iterator it = hostname_to_key_.find(hostname); 41 HostnameToKeyMap::const_iterator it = hostname_to_key_.find(hostname);
42 if (it != hostname_to_key_.end()) { 42 if (it != hostname_to_key_.end()) {
43 return it->second->Copy(); 43 return it->second->Copy();
44 } 44 }
45 45
46 crypto::ECPrivateKey* keypair = crypto::ECPrivateKey::Create(); 46 crypto::ECPrivateKey* keypair = crypto::ECPrivateKey::Create();
47 if (!keypair) { 47 if (!keypair) {
48 return NULL; 48 return nullptr;
49 } 49 }
50 hostname_to_key_[hostname] = keypair; 50 hostname_to_key_[hostname] = keypair;
51 return keypair->Copy(); 51 return keypair->Copy();
52 } 52 }
53 53
54 HostnameToKeyMap hostname_to_key_; 54 HostnameToKeyMap hostname_to_key_;
55 }; 55 };
56 56
57 // static 57 // static
58 ChannelIDSource* CryptoTestUtils::ChannelIDSourceForTesting() { 58 ChannelIDSource* CryptoTestUtils::ChannelIDSourceForTesting() {
59 return new TestChannelIDSource(); 59 return new TestChannelIDSource();
60 } 60 }
61 61
62 } // namespace test 62 } // namespace test
63 63
64 } // namespace net 64 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/test_tools/crypto_test_utils_chromium.cc ('k') | net/quic/test_tools/crypto_test_utils_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698