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

Side by Side Diff: net/base/x509_certificate_win.cc

Issue 9447084: Refactor Pickle Read methods to use higher performance PickleIterator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile (racing with incoming CLs) Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « net/base/x509_certificate_unittest.cc ('k') | net/http/http_response_headers.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/x509_certificate.h" 5 #include "net/base/x509_certificate.h"
6 6
7 #define PRArenaPool PLArenaPool // Required by <blapi.h>. 7 #define PRArenaPool PLArenaPool // Required by <blapi.h>.
8 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS. 8 #include <blapi.h> // Implement CalculateChainFingerprint() with NSS.
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1054 unsigned int result_len; 1054 unsigned int result_len;
1055 SHA1_End(sha1_ctx, sha1.data, &result_len, SHA1_LENGTH); 1055 SHA1_End(sha1_ctx, sha1.data, &result_len, SHA1_LENGTH);
1056 SHA1_DestroyContext(sha1_ctx, PR_TRUE); 1056 SHA1_DestroyContext(sha1_ctx, PR_TRUE);
1057 1057
1058 return sha1; 1058 return sha1;
1059 } 1059 }
1060 1060
1061 // static 1061 // static
1062 X509Certificate::OSCertHandle 1062 X509Certificate::OSCertHandle
1063 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle, 1063 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle,
1064 void** pickle_iter) { 1064 PickleIterator* pickle_iter) {
1065 const char* data; 1065 const char* data;
1066 int length; 1066 int length;
1067 if (!pickle.ReadData(pickle_iter, &data, &length)) 1067 if (!pickle.ReadData(pickle_iter, &data, &length))
1068 return NULL; 1068 return NULL;
1069 1069
1070 OSCertHandle cert_handle = NULL; 1070 OSCertHandle cert_handle = NULL;
1071 if (!CertAddSerializedElementToStore( 1071 if (!CertAddSerializedElementToStore(
1072 NULL, reinterpret_cast<const BYTE*>(data), length, 1072 NULL, reinterpret_cast<const BYTE*>(data), length,
1073 CERT_STORE_ADD_USE_EXISTING, 0, CERT_STORE_CERTIFICATE_CONTEXT_FLAG, 1073 CERT_STORE_ADD_USE_EXISTING, 0, CERT_STORE_CERTIFICATE_CONTEXT_FLAG,
1074 NULL, reinterpret_cast<const void **>(&cert_handle))) { 1074 NULL, reinterpret_cast<const void **>(&cert_handle))) {
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1128 *type = kPublicKeyTypeECDH; 1128 *type = kPublicKeyTypeECDH;
1129 break; 1129 break;
1130 default: 1130 default:
1131 *type = kPublicKeyTypeUnknown; 1131 *type = kPublicKeyTypeUnknown;
1132 *size_bits = 0; 1132 *size_bits = 0;
1133 break; 1133 break;
1134 } 1134 }
1135 } 1135 }
1136 1136
1137 } // namespace net 1137 } // namespace net
OLDNEW
« no previous file with comments | « net/base/x509_certificate_unittest.cc ('k') | net/http/http_response_headers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698