| 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/http_server_properties_impl.h" | 5 #include "net/http/http_server_properties_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 void HttpServerPropertiesImpl::SetSupportsQuic(bool used_quic, | 612 void HttpServerPropertiesImpl::SetSupportsQuic(bool used_quic, |
| 613 const IPAddress& address) { | 613 const IPAddress& address) { |
| 614 if (!used_quic) { | 614 if (!used_quic) { |
| 615 last_quic_address_ = IPAddress(); | 615 last_quic_address_ = IPAddress(); |
| 616 } else { | 616 } else { |
| 617 last_quic_address_ = address; | 617 last_quic_address_ = address; |
| 618 } | 618 } |
| 619 } | 619 } |
| 620 | 620 |
| 621 void HttpServerPropertiesImpl::SetServerNetworkStats( | 621 void HttpServerPropertiesImpl::SetServerNetworkStats( |
| 622 const HostPortPair& host_port_pair, | 622 const url::SchemeHostPort& server, |
| 623 ServerNetworkStats stats) { | 623 ServerNetworkStats stats) { |
| 624 server_network_stats_map_.Put(host_port_pair, stats); | 624 server_network_stats_map_.Put(server, stats); |
| 625 } | 625 } |
| 626 | 626 |
| 627 const ServerNetworkStats* HttpServerPropertiesImpl::GetServerNetworkStats( | 627 const ServerNetworkStats* HttpServerPropertiesImpl::GetServerNetworkStats( |
| 628 const HostPortPair& host_port_pair) { | 628 const url::SchemeHostPort& server) { |
| 629 ServerNetworkStatsMap::iterator it = | 629 ServerNetworkStatsMap::iterator it = server_network_stats_map_.Get(server); |
| 630 server_network_stats_map_.Get(host_port_pair); | |
| 631 if (it == server_network_stats_map_.end()) { | 630 if (it == server_network_stats_map_.end()) { |
| 632 return NULL; | 631 return NULL; |
| 633 } | 632 } |
| 634 return &it->second; | 633 return &it->second; |
| 635 } | 634 } |
| 636 | 635 |
| 637 const ServerNetworkStatsMap& | 636 const ServerNetworkStatsMap& |
| 638 HttpServerPropertiesImpl::server_network_stats_map() const { | 637 HttpServerPropertiesImpl::server_network_stats_map() const { |
| 639 return server_network_stats_map_; | 638 return server_network_stats_map_; |
| 640 } | 639 } |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); | 798 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); |
| 800 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 799 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 801 FROM_HERE, | 800 FROM_HERE, |
| 802 base::Bind( | 801 base::Bind( |
| 803 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, | 802 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, |
| 804 weak_ptr_factory_.GetWeakPtr()), | 803 weak_ptr_factory_.GetWeakPtr()), |
| 805 delay); | 804 delay); |
| 806 } | 805 } |
| 807 | 806 |
| 808 } // namespace net | 807 } // namespace net |
| OLD | NEW |