| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
| 15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
| 17 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
| 18 #include "base/strings/stringprintf.h" | |
| 19 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
| 20 #include "base/values.h" | 19 #include "base/values.h" |
| 21 | 20 |
| 22 namespace net { | 21 namespace net { |
| 23 | 22 |
| 24 namespace { | 23 namespace { |
| 25 | 24 |
| 26 // Initial delay for broken alternative services. | 25 // Initial delay for broken alternative services. |
| 27 const uint64_t kBrokenAlternativeProtocolDelaySecs = 300; | 26 const uint64_t kBrokenAlternativeProtocolDelaySecs = 300; |
| 28 // Subsequent failures result in exponential (base 2) backoff. | 27 // Subsequent failures result in exponential (base 2) backoff. |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); | 738 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); |
| 740 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 739 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 741 FROM_HERE, | 740 FROM_HERE, |
| 742 base::Bind( | 741 base::Bind( |
| 743 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, | 742 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, |
| 744 weak_ptr_factory_.GetWeakPtr()), | 743 weak_ptr_factory_.GetWeakPtr()), |
| 745 delay); | 744 delay); |
| 746 } | 745 } |
| 747 | 746 |
| 748 } // namespace net | 747 } // namespace net |
| OLD | NEW |