| 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 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 if (map_it->second.empty()) { | 369 if (map_it->second.empty()) { |
| 370 alternative_service_map_.Erase(map_it); | 370 alternative_service_map_.Erase(map_it); |
| 371 } | 371 } |
| 372 return valid_alternative_service_infos; | 372 return valid_alternative_service_infos; |
| 373 } | 373 } |
| 374 | 374 |
| 375 bool HttpServerPropertiesImpl::SetAlternativeService( | 375 bool HttpServerPropertiesImpl::SetAlternativeService( |
| 376 const url::SchemeHostPort& origin, | 376 const url::SchemeHostPort& origin, |
| 377 const AlternativeService& alternative_service, | 377 const AlternativeService& alternative_service, |
| 378 base::Time expiration) { | 378 base::Time expiration, |
| 379 const QuicVersionVector& advertised_versions) { |
| 379 return SetAlternativeServices( | 380 return SetAlternativeServices( |
| 380 origin, | 381 origin, |
| 381 AlternativeServiceInfoVector( | 382 AlternativeServiceInfoVector( |
| 382 /*size=*/1, AlternativeServiceInfo(alternative_service, expiration))); | 383 /*size=*/1, AlternativeServiceInfo(alternative_service, expiration, |
| 384 advertised_versions))); |
| 383 } | 385 } |
| 384 | 386 |
| 385 bool HttpServerPropertiesImpl::SetAlternativeServices( | 387 bool HttpServerPropertiesImpl::SetAlternativeServices( |
| 386 const url::SchemeHostPort& origin, | 388 const url::SchemeHostPort& origin, |
| 387 const AlternativeServiceInfoVector& alternative_service_info_vector) { | 389 const AlternativeServiceInfoVector& alternative_service_info_vector) { |
| 388 AlternativeServiceMap::iterator it = alternative_service_map_.Peek(origin); | 390 AlternativeServiceMap::iterator it = alternative_service_map_.Peek(origin); |
| 389 | 391 |
| 390 if (alternative_service_info_vector.empty()) { | 392 if (alternative_service_info_vector.empty()) { |
| 391 RemoveCanonicalHost(origin); | 393 RemoveCanonicalHost(origin); |
| 392 if (it == alternative_service_map_.end()) | 394 if (it == alternative_service_map_.end()) |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 767 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); | 769 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); |
| 768 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 770 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 769 FROM_HERE, | 771 FROM_HERE, |
| 770 base::Bind( | 772 base::Bind( |
| 771 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, | 773 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, |
| 772 weak_ptr_factory_.GetWeakPtr()), | 774 weak_ptr_factory_.GetWeakPtr()), |
| 773 delay); | 775 delay); |
| 774 } | 776 } |
| 775 | 777 |
| 776 } // namespace net | 778 } // namespace net |
| OLD | NEW |