| 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/http/transport_security_state.h" | 5 #include "net/http/transport_security_state.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 return memcmp(lhs.data, rhs.data(), rhs.size()) < 0; | 62 return memcmp(lhs.data, rhs.data(), rhs.size()) < 0; |
| 63 } | 63 } |
| 64 | 64 |
| 65 bool operator()(const HashValue& lhs, const SHA256HashValue& rhs) const { | 65 bool operator()(const HashValue& lhs, const SHA256HashValue& rhs) const { |
| 66 DCHECK_EQ(HASH_VALUE_SHA256, lhs.tag); | 66 DCHECK_EQ(HASH_VALUE_SHA256, lhs.tag); |
| 67 return memcmp(lhs.data(), rhs.data, lhs.size()) < 0; | 67 return memcmp(lhs.data(), rhs.data, lhs.size()) < 0; |
| 68 } | 68 } |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 void RecordUMAForHPKPReportFailure(const GURL& report_uri, int net_error) { | 71 void RecordUMAForHPKPReportFailure(const GURL& report_uri, int net_error) { |
| 72 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.PublicKeyPinReportSendingFailure", | 72 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.PublicKeyPinReportSendingFailure2", |
| 73 net_error); | 73 -net_error); |
| 74 } | 74 } |
| 75 | 75 |
| 76 std::string TimeToISO8601(const base::Time& t) { | 76 std::string TimeToISO8601(const base::Time& t) { |
| 77 base::Time::Exploded exploded; | 77 base::Time::Exploded exploded; |
| 78 t.UTCExplode(&exploded); | 78 t.UTCExplode(&exploded); |
| 79 return base::StringPrintf( | 79 return base::StringPrintf( |
| 80 "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", exploded.year, exploded.month, | 80 "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", exploded.year, exploded.month, |
| 81 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second, | 81 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second, |
| 82 exploded.millisecond); | 82 exploded.millisecond); |
| 83 } | 83 } |
| (...skipping 1437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1521 TransportSecurityState::PKPStateIterator::PKPStateIterator( | 1521 TransportSecurityState::PKPStateIterator::PKPStateIterator( |
| 1522 const TransportSecurityState& state) | 1522 const TransportSecurityState& state) |
| 1523 : iterator_(state.enabled_pkp_hosts_.begin()), | 1523 : iterator_(state.enabled_pkp_hosts_.begin()), |
| 1524 end_(state.enabled_pkp_hosts_.end()) { | 1524 end_(state.enabled_pkp_hosts_.end()) { |
| 1525 } | 1525 } |
| 1526 | 1526 |
| 1527 TransportSecurityState::PKPStateIterator::~PKPStateIterator() { | 1527 TransportSecurityState::PKPStateIterator::~PKPStateIterator() { |
| 1528 } | 1528 } |
| 1529 | 1529 |
| 1530 } // namespace | 1530 } // namespace |
| OLD | NEW |