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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 it = map_it->second.erase(it); | 329 it = map_it->second.erase(it); |
330 continue; | 330 continue; |
331 } | 331 } |
332 AlternativeService alternative_service(it->alternative_service); | 332 AlternativeService alternative_service(it->alternative_service); |
333 if (alternative_service.host.empty()) { | 333 if (alternative_service.host.empty()) { |
334 alternative_service.host = origin.host(); | 334 alternative_service.host = origin.host(); |
335 } | 335 } |
336 // If the alternative service is equivalent to the origin (same host, same | 336 // If the alternative service is equivalent to the origin (same host, same |
337 // port, and both TCP), skip it. | 337 // port, and both TCP), skip it. |
338 if (host_port_pair.Equals(alternative_service.host_port_pair()) && | 338 if (host_port_pair.Equals(alternative_service.host_port_pair()) && |
339 NPN_SPDY_MINIMUM_VERSION <= alternative_service.protocol && | 339 alternative_service.protocol == NPN_HTTP_2) { |
340 alternative_service.protocol <= NPN_SPDY_MAXIMUM_VERSION) { | |
341 ++it; | 340 ++it; |
342 continue; | 341 continue; |
343 } | 342 } |
344 valid_alternative_services.push_back(alternative_service); | 343 valid_alternative_services.push_back(alternative_service); |
345 ++it; | 344 ++it; |
346 } | 345 } |
347 if (map_it->second.empty()) { | 346 if (map_it->second.empty()) { |
348 alternative_service_map_.Erase(map_it); | 347 alternative_service_map_.Erase(map_it); |
349 } | 348 } |
350 return valid_alternative_services; | 349 return valid_alternative_services; |
(...skipping 448 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 |