OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/domain_reliability/util.h" | 5 #include "components/domain_reliability/util.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 } | 101 } |
102 | 102 |
103 // TODO(juliatuttle): Consider using NPN/ALPN instead, if there's a good way to | 103 // TODO(juliatuttle): Consider using NPN/ALPN instead, if there's a good way to |
104 // differentiate HTTP and HTTPS. | 104 // differentiate HTTP and HTTPS. |
105 std::string GetDomainReliabilityProtocol( | 105 std::string GetDomainReliabilityProtocol( |
106 net::HttpResponseInfo::ConnectionInfo connection_info, | 106 net::HttpResponseInfo::ConnectionInfo connection_info, |
107 bool ssl_info_populated) { | 107 bool ssl_info_populated) { |
108 switch (connection_info) { | 108 switch (connection_info) { |
109 case net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN: | 109 case net::HttpResponseInfo::CONNECTION_INFO_UNKNOWN: |
110 return ""; | 110 return ""; |
111 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1: | 111 case net::HttpResponseInfo::CONNECTION_INFO_HTTP0_9: |
| 112 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_0: |
| 113 case net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1: |
112 return ssl_info_populated ? "HTTPS" : "HTTP"; | 114 return ssl_info_populated ? "HTTPS" : "HTTP"; |
113 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_SPDY2: | 115 case net::HttpResponseInfo::CONNECTION_INFO_DEPRECATED_SPDY2: |
114 case net::HttpResponseInfo::CONNECTION_INFO_SPDY3: | 116 case net::HttpResponseInfo::CONNECTION_INFO_SPDY3: |
115 case net::HttpResponseInfo::CONNECTION_INFO_HTTP2_14: | 117 case net::HttpResponseInfo::CONNECTION_INFO_HTTP2_14: |
116 case net::HttpResponseInfo::CONNECTION_INFO_HTTP2_15: | 118 case net::HttpResponseInfo::CONNECTION_INFO_HTTP2_15: |
117 case net::HttpResponseInfo::CONNECTION_INFO_HTTP2: | 119 case net::HttpResponseInfo::CONNECTION_INFO_HTTP2: |
118 return "SPDY"; | 120 return "SPDY"; |
119 case net::HttpResponseInfo::CONNECTION_INFO_QUIC1_SPDY3: | 121 case net::HttpResponseInfo::CONNECTION_INFO_QUIC1_SPDY3: |
120 return "QUIC"; | 122 return "QUIC"; |
121 case net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS: | 123 case net::HttpResponseInfo::NUM_OF_CONNECTION_INFOS: |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 ActualTime::~ActualTime() {} | 228 ActualTime::~ActualTime() {} |
227 | 229 |
228 base::Time ActualTime::Now() { return base::Time::Now(); } | 230 base::Time ActualTime::Now() { return base::Time::Now(); } |
229 base::TimeTicks ActualTime::NowTicks() { return base::TimeTicks::Now(); } | 231 base::TimeTicks ActualTime::NowTicks() { return base::TimeTicks::Now(); } |
230 | 232 |
231 std::unique_ptr<MockableTime::Timer> ActualTime::CreateTimer() { | 233 std::unique_ptr<MockableTime::Timer> ActualTime::CreateTimer() { |
232 return std::unique_ptr<MockableTime::Timer>(new ActualTimer()); | 234 return std::unique_ptr<MockableTime::Timer>(new ActualTimer()); |
233 } | 235 } |
234 | 236 |
235 } // namespace domain_reliability | 237 } // namespace domain_reliability |
OLD | NEW |