| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_manager.h" | 5 #include "net/http/http_server_properties_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 } | 139 } |
| 140 | 140 |
| 141 void HttpServerPropertiesManager::SetSupportsSpdy(const HostPortPair& server, | 141 void HttpServerPropertiesManager::SetSupportsSpdy(const HostPortPair& server, |
| 142 bool support_spdy) { | 142 bool support_spdy) { |
| 143 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); | 143 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); |
| 144 | 144 |
| 145 http_server_properties_impl_->SetSupportsSpdy(server, support_spdy); | 145 http_server_properties_impl_->SetSupportsSpdy(server, support_spdy); |
| 146 ScheduleUpdatePrefsOnNetworkThread(); | 146 ScheduleUpdatePrefsOnNetworkThread(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 bool HttpServerPropertiesManager::RequiresHTTP11( |
| 150 const net::HostPortPair& server) { |
| 151 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); |
| 152 return http_server_properties_impl_->RequiresHTTP11(server); |
| 153 } |
| 154 |
| 155 void HttpServerPropertiesManager::SetHTTP11Required( |
| 156 const net::HostPortPair& server) { |
| 157 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); |
| 158 |
| 159 http_server_properties_impl_->SetHTTP11Required(server); |
| 160 ScheduleUpdatePrefsOnNetworkThread(); |
| 161 } |
| 162 |
| 163 void HttpServerPropertiesManager::MaybeForceHTTP11(const HostPortPair& server, |
| 164 SSLConfig* ssl_config) { |
| 165 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); |
| 166 http_server_properties_impl_->MaybeForceHTTP11(server, ssl_config); |
| 167 } |
| 168 |
| 149 bool HttpServerPropertiesManager::HasAlternateProtocol( | 169 bool HttpServerPropertiesManager::HasAlternateProtocol( |
| 150 const HostPortPair& server) { | 170 const HostPortPair& server) { |
| 151 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); | 171 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); |
| 152 return http_server_properties_impl_->HasAlternateProtocol(server); | 172 return http_server_properties_impl_->HasAlternateProtocol(server); |
| 153 } | 173 } |
| 154 | 174 |
| 155 AlternateProtocolInfo HttpServerPropertiesManager::GetAlternateProtocol( | 175 AlternateProtocolInfo HttpServerPropertiesManager::GetAlternateProtocol( |
| 156 const HostPortPair& server) { | 176 const HostPortPair& server) { |
| 157 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); | 177 DCHECK(network_task_runner_->RunsTasksOnCurrentThread()); |
| 158 return http_server_properties_impl_->GetAlternateProtocol(server); | 178 return http_server_properties_impl_->GetAlternateProtocol(server); |
| (...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 838 completion.Run(); | 858 completion.Run(); |
| 839 } | 859 } |
| 840 | 860 |
| 841 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { | 861 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { |
| 842 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); | 862 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); |
| 843 if (!setting_prefs_) | 863 if (!setting_prefs_) |
| 844 ScheduleUpdateCacheOnPrefThread(); | 864 ScheduleUpdateCacheOnPrefThread(); |
| 845 } | 865 } |
| 846 | 866 |
| 847 } // namespace net | 867 } // namespace net |
| OLD | NEW |