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

Side by Side Diff: net/http/transport_security_state.cc

Issue 2120683002: Fix up certificate error reporting histograms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: components/BUILD.gn fix, don't build unit tests on iOS Created 4 years, 5 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
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/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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 const size_t kReportCacheKeyLength = 16; 42 const size_t kReportCacheKeyLength = 16;
43 43
44 // Override for ShouldRequireCT() for unit tests. Possible values: 44 // Override for ShouldRequireCT() for unit tests. Possible values:
45 // -1: Unless a delegate says otherwise, do not require CT. 45 // -1: Unless a delegate says otherwise, do not require CT.
46 // 0: Use the default implementation (e.g. production) 46 // 0: Use the default implementation (e.g. production)
47 // 1: Unless a delegate says otherwise, require CT. 47 // 1: Unless a delegate says otherwise, require CT.
48 int g_ct_required_for_testing = 0; 48 int g_ct_required_for_testing = 0;
49 49
50 void RecordUMAForHPKPReportFailure(const GURL& report_uri, int net_error) { 50 void RecordUMAForHPKPReportFailure(const GURL& report_uri, int net_error) {
51 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.PublicKeyPinReportSendingFailure", 51 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.PublicKeyPinReportSendingFailure",
52 net_error); 52 -net_error);
53 } 53 }
54 54
55 std::string TimeToISO8601(const base::Time& t) { 55 std::string TimeToISO8601(const base::Time& t) {
56 base::Time::Exploded exploded; 56 base::Time::Exploded exploded;
57 t.UTCExplode(&exploded); 57 t.UTCExplode(&exploded);
58 return base::StringPrintf( 58 return base::StringPrintf(
59 "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", exploded.year, exploded.month, 59 "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", exploded.year, exploded.month,
60 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second, 60 exploded.day_of_month, exploded.hour, exploded.minute, exploded.second,
61 exploded.millisecond); 61 exploded.millisecond);
62 } 62 }
(...skipping 1373 matching lines...) Expand 10 before | Expand all | Expand 10 after
1436 TransportSecurityState::PKPStateIterator::PKPStateIterator( 1436 TransportSecurityState::PKPStateIterator::PKPStateIterator(
1437 const TransportSecurityState& state) 1437 const TransportSecurityState& state)
1438 : iterator_(state.enabled_pkp_hosts_.begin()), 1438 : iterator_(state.enabled_pkp_hosts_.begin()),
1439 end_(state.enabled_pkp_hosts_.end()) { 1439 end_(state.enabled_pkp_hosts_.end()) {
1440 } 1440 }
1441 1441
1442 TransportSecurityState::PKPStateIterator::~PKPStateIterator() { 1442 TransportSecurityState::PKPStateIterator::~PKPStateIterator() {
1443 } 1443 }
1444 1444
1445 } // namespace 1445 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698