| 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/quic/chromium/quic_stream_factory.h" | 5 #include "net/quic/chromium/quic_stream_factory.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <tuple> | 8 #include <tuple> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 DCHECK(url.is_valid()); | 200 DCHECK(url.is_valid()); |
| 201 return origin_filter_.Run(url); | 201 return origin_filter_.Run(url); |
| 202 } | 202 } |
| 203 | 203 |
| 204 private: | 204 private: |
| 205 const base::Callback<bool(const GURL&)> origin_filter_; | 205 const base::Callback<bool(const GURL&)> origin_filter_; |
| 206 }; | 206 }; |
| 207 | 207 |
| 208 // Returns the estimate of dynamically allocated memory of |server_id|. | 208 // Returns the estimate of dynamically allocated memory of |server_id|. |
| 209 size_t EstimateServerIdMemoryUsage(const QuicServerId& server_id) { | 209 size_t EstimateServerIdMemoryUsage(const QuicServerId& server_id) { |
| 210 return HostPortPair::EstimateMemoryUsage(server_id.host_port_pair()); | 210 return base::trace_event::EstimateMemoryUsage(server_id.host_port_pair()); |
| 211 } | 211 } |
| 212 | 212 |
| 213 } // namespace | 213 } // namespace |
| 214 | 214 |
| 215 // Responsible for verifying the certificates saved in | 215 // Responsible for verifying the certificates saved in |
| 216 // QuicCryptoClientConfig, and for notifying any associated requests when | 216 // QuicCryptoClientConfig, and for notifying any associated requests when |
| 217 // complete. Results from cert verification are ignored. | 217 // complete. Results from cert verification are ignored. |
| 218 class QuicStreamFactory::CertVerifierJob { | 218 class QuicStreamFactory::CertVerifierJob { |
| 219 public: | 219 public: |
| 220 // ProofVerifierCallbackImpl is passed as the callback method to | 220 // ProofVerifierCallbackImpl is passed as the callback method to |
| (...skipping 865 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1086 std::tie(other.destination_, other.server_id_); | 1086 std::tie(other.destination_, other.server_id_); |
| 1087 } | 1087 } |
| 1088 | 1088 |
| 1089 bool QuicStreamFactory::QuicSessionKey::operator==( | 1089 bool QuicStreamFactory::QuicSessionKey::operator==( |
| 1090 const QuicSessionKey& other) const { | 1090 const QuicSessionKey& other) const { |
| 1091 return destination_.Equals(other.destination_) && | 1091 return destination_.Equals(other.destination_) && |
| 1092 server_id_ == other.server_id_; | 1092 server_id_ == other.server_id_; |
| 1093 } | 1093 } |
| 1094 | 1094 |
| 1095 size_t QuicStreamFactory::QuicSessionKey::EstimateMemoryUsage() const { | 1095 size_t QuicStreamFactory::QuicSessionKey::EstimateMemoryUsage() const { |
| 1096 return HostPortPair::EstimateMemoryUsage(destination_) + | 1096 return base::trace_event::EstimateMemoryUsage(destination_) + |
| 1097 EstimateServerIdMemoryUsage(server_id_); | 1097 EstimateServerIdMemoryUsage(server_id_); |
| 1098 } | 1098 } |
| 1099 | 1099 |
| 1100 void QuicStreamFactory::CreateAuxilaryJob(const QuicSessionKey& key, | 1100 void QuicStreamFactory::CreateAuxilaryJob(const QuicSessionKey& key, |
| 1101 int cert_verify_flags, | 1101 int cert_verify_flags, |
| 1102 const NetLogWithSource& net_log) { | 1102 const NetLogWithSource& net_log) { |
| 1103 Job* aux_job = | 1103 Job* aux_job = |
| 1104 new Job(this, host_resolver_, key, WasQuicRecentlyBroken(key.server_id()), | 1104 new Job(this, host_resolver_, key, WasQuicRecentlyBroken(key.server_id()), |
| 1105 cert_verify_flags, nullptr, net_log); | 1105 cert_verify_flags, nullptr, net_log); |
| 1106 active_jobs_[key.server_id()][aux_job] = base::WrapUnique(aux_job); | 1106 active_jobs_[key.server_id()][aux_job] = base::WrapUnique(aux_job); |
| (...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1982 void QuicStreamFactory::OpenFactory() { | 1982 void QuicStreamFactory::OpenFactory() { |
| 1983 status_ = OPEN; | 1983 status_ = OPEN; |
| 1984 } | 1984 } |
| 1985 | 1985 |
| 1986 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { | 1986 void QuicStreamFactory::MaybeClearConsecutiveDisabledCount() { |
| 1987 if (status_ == OPEN) | 1987 if (status_ == OPEN) |
| 1988 consecutive_disabled_count_ = 0; | 1988 consecutive_disabled_count_ = 0; |
| 1989 } | 1989 } |
| 1990 | 1990 |
| 1991 } // namespace net | 1991 } // namespace net |
| OLD | NEW |