| 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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 last_quic_address_ = address; | 558 last_quic_address_ = address; |
| 559 } | 559 } |
| 560 } | 560 } |
| 561 | 561 |
| 562 void HttpServerPropertiesImpl::SetServerNetworkStats( | 562 void HttpServerPropertiesImpl::SetServerNetworkStats( |
| 563 const url::SchemeHostPort& server, | 563 const url::SchemeHostPort& server, |
| 564 ServerNetworkStats stats) { | 564 ServerNetworkStats stats) { |
| 565 server_network_stats_map_.Put(server, stats); | 565 server_network_stats_map_.Put(server, stats); |
| 566 } | 566 } |
| 567 | 567 |
| 568 void HttpServerPropertiesImpl::ClearServerNetworkStats( |
| 569 const url::SchemeHostPort& server) { |
| 570 ServerNetworkStatsMap::iterator it = server_network_stats_map_.Get(server); |
| 571 if (it != server_network_stats_map_.end()) { |
| 572 server_network_stats_map_.Erase(it); |
| 573 } |
| 574 } |
| 575 |
| 568 const ServerNetworkStats* HttpServerPropertiesImpl::GetServerNetworkStats( | 576 const ServerNetworkStats* HttpServerPropertiesImpl::GetServerNetworkStats( |
| 569 const url::SchemeHostPort& server) { | 577 const url::SchemeHostPort& server) { |
| 570 ServerNetworkStatsMap::iterator it = server_network_stats_map_.Get(server); | 578 ServerNetworkStatsMap::iterator it = server_network_stats_map_.Get(server); |
| 571 if (it == server_network_stats_map_.end()) { | 579 if (it == server_network_stats_map_.end()) { |
| 572 return NULL; | 580 return NULL; |
| 573 } | 581 } |
| 574 return &it->second; | 582 return &it->second; |
| 575 } | 583 } |
| 576 | 584 |
| 577 const ServerNetworkStatsMap& | 585 const ServerNetworkStatsMap& |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 743 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); | 751 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); |
| 744 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 752 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 745 FROM_HERE, | 753 FROM_HERE, |
| 746 base::Bind( | 754 base::Bind( |
| 747 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, | 755 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, |
| 748 weak_ptr_factory_.GetWeakPtr()), | 756 weak_ptr_factory_.GetWeakPtr()), |
| 749 delay); | 757 delay); |
| 750 } | 758 } |
| 751 | 759 |
| 752 } // namespace net | 760 } // namespace net |
| OLD | NEW |