| OLD | NEW |
| 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/cert/multi_log_ct_verifier.h" | 5 #include "net/cert/multi_log_ct_verifier.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 BoundNetLog bound_net_log = | 169 BoundNetLog bound_net_log = |
| 170 BoundNetLog::Make(&net_log, NetLog::SOURCE_CONNECT_JOB); | 170 BoundNetLog::Make(&net_log, NetLog::SOURCE_CONNECT_JOB); |
| 171 return (VerifySinglePrecertificateChain(chain, bound_net_log, &result) && | 171 return (VerifySinglePrecertificateChain(chain, bound_net_log, &result) && |
| 172 CheckForSingleVerifiedSCTInResult(result) && | 172 CheckForSingleVerifiedSCTInResult(result) && |
| 173 CheckForSCTOrigin(result, | 173 CheckForSCTOrigin(result, |
| 174 ct::SignedCertificateTimestamp::SCT_EMBEDDED) && | 174 ct::SignedCertificateTimestamp::SCT_EMBEDDED) && |
| 175 CheckForEmbeddedSCTInNetLog(net_log)); | 175 CheckForEmbeddedSCTInNetLog(net_log)); |
| 176 } | 176 } |
| 177 | 177 |
| 178 // Histogram-related helper methods | 178 // Histogram-related helper methods |
| 179 int GetValueFromHistogram(std::string histogram_name, int sample_index) { | 179 int GetValueFromHistogram(const std::string& histogram_name, |
| 180 int sample_index) { |
| 180 base::Histogram* histogram = static_cast<base::Histogram*>( | 181 base::Histogram* histogram = static_cast<base::Histogram*>( |
| 181 base::StatisticsRecorder::FindHistogram(histogram_name)); | 182 base::StatisticsRecorder::FindHistogram(histogram_name)); |
| 182 | 183 |
| 183 if (histogram == NULL) | 184 if (histogram == NULL) |
| 184 return 0; | 185 return 0; |
| 185 | 186 |
| 186 scoped_ptr<base::HistogramSamples> samples = histogram->SnapshotSamples(); | 187 scoped_ptr<base::HistogramSamples> samples = histogram->SnapshotSamples(); |
| 187 return samples->GetCount(sample_index); | 188 return samples->GetCount(sample_index); |
| 188 } | 189 } |
| 189 | 190 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 Mock::VerifyAndClearExpectations(&observer); | 330 Mock::VerifyAndClearExpectations(&observer); |
| 330 | 331 |
| 331 EXPECT_CALL(observer, OnSCTVerified(embedded_sct_chain_.get(), _)).Times(0); | 332 EXPECT_CALL(observer, OnSCTVerified(embedded_sct_chain_.get(), _)).Times(0); |
| 332 verifier_->SetObserver(nullptr); | 333 verifier_->SetObserver(nullptr); |
| 333 ASSERT_TRUE(VerifySinglePrecertificateChain(embedded_sct_chain_)); | 334 ASSERT_TRUE(VerifySinglePrecertificateChain(embedded_sct_chain_)); |
| 334 } | 335 } |
| 335 | 336 |
| 336 } // namespace | 337 } // namespace |
| 337 | 338 |
| 338 } // namespace net | 339 } // namespace net |
| OLD | NEW |