| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/string_piece.h" | 8 #include "base/string_piece.h" |
| 9 #include "net/base/cert_verifier.h" | 9 #include "net/base/cert_verifier.h" |
| 10 #include "net/base/ssl_config_service.h" | 10 #include "net/base/ssl_config_service.h" |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 cert_verification_callback_ = callback; | 157 cert_verification_callback_ = callback; |
| 158 return ERR_IO_PENDING; | 158 return ERR_IO_PENDING; |
| 159 } | 159 } |
| 160 | 160 |
| 161 void SSLHostInfo::VerifyCallback(int rv) { | 161 void SSLHostInfo::VerifyCallback(int rv) { |
| 162 DCHECK(!verification_start_time_.is_null()); | 162 DCHECK(!verification_start_time_.is_null()); |
| 163 base::TimeTicks now = base::TimeTicks::Now(); | 163 base::TimeTicks now = base::TimeTicks::Now(); |
| 164 const base::TimeDelta duration = now - verification_start_time(); | 164 const base::TimeDelta duration = now - verification_start_time(); |
| 165 UMA_HISTOGRAM_TIMES("Net.SSLHostInfoVerificationTimeMs", duration); | 165 UMA_HISTOGRAM_TIMES("Net.SSLHostInfoVerificationTimeMs", duration); |
| 166 VLOG(1) << "Verification took " << duration.InMilliseconds() << "ms"; | 166 VLOG(1) << "Verification took " << duration.InMilliseconds() << "ms"; |
| 167 verification_end_time_ = now; |
| 167 cert_verification_complete_ = true; | 168 cert_verification_complete_ = true; |
| 168 cert_verification_error_ = rv; | 169 cert_verification_error_ = rv; |
| 169 if (cert_verification_callback_) { | 170 if (cert_verification_callback_) { |
| 170 CompletionCallback* callback = cert_verification_callback_; | 171 CompletionCallback* callback = cert_verification_callback_; |
| 171 cert_verification_callback_ = NULL; | 172 cert_verification_callback_ = NULL; |
| 172 callback->Run(rv); | 173 callback->Run(rv); |
| 173 } | 174 } |
| 174 } | 175 } |
| 175 | 176 |
| 176 SSLHostInfoFactory::~SSLHostInfoFactory() {} | 177 SSLHostInfoFactory::~SSLHostInfoFactory() {} |
| 177 | 178 |
| 178 } // namespace net | 179 } // namespace net |
| OLD | NEW |