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

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

Issue 1878273004: SHP 3: Change ServerNetworkStatsMap to use SchemeHostPort as the key. No change to Pref data. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git sync Created 4 years, 8 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/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
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
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
OLDNEW
« no previous file with comments | « net/http/http_server_properties_impl.h ('k') | net/http/http_server_properties_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698