OLD | NEW |
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/socket/ssl_host_info.h" | 5 #include "net/socket/ssl_host_info.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/pickle.h" | 9 #include "base/pickle.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 bool r = ParseInner(data); | 57 bool r = ParseInner(data); |
58 if (!r) | 58 if (!r) |
59 state->Clear(); | 59 state->Clear(); |
60 return r; | 60 return r; |
61 } | 61 } |
62 | 62 |
63 bool SSLHostInfo::ParseInner(const std::string& data) { | 63 bool SSLHostInfo::ParseInner(const std::string& data) { |
64 State* state = mutable_state(); | 64 State* state = mutable_state(); |
65 | 65 |
66 Pickle p(data.data(), data.size()); | 66 Pickle p(data.data(), data.size()); |
67 void* iter = NULL; | 67 PickleIterator iter(p); |
68 | 68 |
69 int num_der_certs; | 69 int num_der_certs; |
70 if (!p.ReadInt(&iter, &num_der_certs) || | 70 if (!p.ReadInt(&iter, &num_der_certs) || |
71 num_der_certs < 0) { | 71 num_der_certs < 0) { |
72 return false; | 72 return false; |
73 } | 73 } |
74 | 74 |
75 for (int i = 0; i < num_der_certs; i++) { | 75 for (int i = 0; i < num_der_certs; i++) { |
76 std::string der_cert; | 76 std::string der_cert; |
77 if (!p.ReadString(&iter, &der_cert)) | 77 if (!p.ReadString(&iter, &der_cert)) |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 if (!cert_verification_callback_.is_null()) { | 197 if (!cert_verification_callback_.is_null()) { |
198 CompletionCallback callback = cert_verification_callback_; | 198 CompletionCallback callback = cert_verification_callback_; |
199 cert_verification_callback_.Reset(); | 199 cert_verification_callback_.Reset(); |
200 callback.Run(rv); | 200 callback.Run(rv); |
201 } | 201 } |
202 } | 202 } |
203 | 203 |
204 SSLHostInfoFactory::~SSLHostInfoFactory() {} | 204 SSLHostInfoFactory::~SSLHostInfoFactory() {} |
205 | 205 |
206 } // namespace net | 206 } // namespace net |
OLD | NEW |