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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
482 | 482 |
483 void HttpServerPropertiesImpl::SetSupportsQuic(bool used_quic, | 483 void HttpServerPropertiesImpl::SetSupportsQuic(bool used_quic, |
484 const IPAddressNumber& address) { | 484 const IPAddressNumber& address) { |
485 if (!used_quic) { | 485 if (!used_quic) { |
486 last_quic_address_.clear(); | 486 last_quic_address_.clear(); |
487 } else { | 487 } else { |
488 last_quic_address_ = address; | 488 last_quic_address_ = address; |
489 } | 489 } |
490 } | 490 } |
491 | 491 |
492 void HttpServerPropertiesImpl::SetServerNetworkStats( | 492 bool HttpServerPropertiesImpl::SetServerNetworkStats( |
493 const HostPortPair& host_port_pair, | 493 const HostPortPair& host_port_pair, |
494 ServerNetworkStats stats) { | 494 ServerNetworkStats stats) { |
495 const ServerNetworkStats* old_stats = GetServerNetworkStats(host_port_pair); | |
495 server_network_stats_map_.Put(host_port_pair, stats); | 496 server_network_stats_map_.Put(host_port_pair, stats); |
497 return !old_stats || *old_stats != stats; | |
ramant (doing other things)
2015/05/28 22:33:38
Hi Ryan,
Made a small change to update the Memor
ramant (doing other things)
2015/06/03 21:37:00
Please ignore this comment.
| |
496 } | 498 } |
497 | 499 |
498 const ServerNetworkStats* HttpServerPropertiesImpl::GetServerNetworkStats( | 500 const ServerNetworkStats* HttpServerPropertiesImpl::GetServerNetworkStats( |
499 const HostPortPair& host_port_pair) { | 501 const HostPortPair& host_port_pair) { |
500 ServerNetworkStatsMap::iterator it = | 502 ServerNetworkStatsMap::iterator it = |
501 server_network_stats_map_.Get(host_port_pair); | 503 server_network_stats_map_.Get(host_port_pair); |
502 if (it == server_network_stats_map_.end()) { | 504 if (it == server_network_stats_map_.end()) { |
503 return NULL; | 505 return NULL; |
504 } | 506 } |
505 return &it->second; | 507 return &it->second; |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
598 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); | 600 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); |
599 base::MessageLoop::current()->PostDelayedTask( | 601 base::MessageLoop::current()->PostDelayedTask( |
600 FROM_HERE, | 602 FROM_HERE, |
601 base::Bind( | 603 base::Bind( |
602 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, | 604 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, |
603 weak_ptr_factory_.GetWeakPtr()), | 605 weak_ptr_factory_.GetWeakPtr()), |
604 delay); | 606 delay); |
605 } | 607 } |
606 | 608 |
607 } // namespace net | 609 } // namespace net |
OLD | NEW |