| 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 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 std::string alternative_service_string(alternative_service_info.ToString()); | 405 std::string alternative_service_string(alternative_service_info.ToString()); |
| 406 AlternativeService alternative_service( | 406 AlternativeService alternative_service( |
| 407 alternative_service_info.alternative_service); | 407 alternative_service_info.alternative_service); |
| 408 if (alternative_service.host.empty()) { | 408 if (alternative_service.host.empty()) { |
| 409 alternative_service.host = host_port_pair.host(); | 409 alternative_service.host = host_port_pair.host(); |
| 410 } | 410 } |
| 411 if (IsAlternativeServiceBroken(alternative_service)) { | 411 if (IsAlternativeServiceBroken(alternative_service)) { |
| 412 alternative_service_string.append(" (broken)"); | 412 alternative_service_string.append(" (broken)"); |
| 413 } | 413 } |
| 414 | 414 |
| 415 base::DictionaryValue* dict = new base::DictionaryValue(); | 415 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 416 dict->SetString("host_port_pair", host_port_pair.ToString()); | 416 dict->SetString("host_port_pair", host_port_pair.ToString()); |
| 417 dict->SetString("alternative_service", alternative_service_string); | 417 dict->SetString("alternative_service", alternative_service_string); |
| 418 dict_list->Append(dict); | 418 dict_list->Append(dict.Pass()); |
| 419 } | 419 } |
| 420 return dict_list; | 420 return dict_list; |
| 421 } | 421 } |
| 422 | 422 |
| 423 const SettingsMap& HttpServerPropertiesImpl::GetSpdySettings( | 423 const SettingsMap& HttpServerPropertiesImpl::GetSpdySettings( |
| 424 const HostPortPair& host_port_pair) { | 424 const HostPortPair& host_port_pair) { |
| 425 SpdySettingsMap::iterator it = spdy_settings_map_.Get(host_port_pair); | 425 SpdySettingsMap::iterator it = spdy_settings_map_.Get(host_port_pair); |
| 426 if (it == spdy_settings_map_.end()) { | 426 if (it == spdy_settings_map_.end()) { |
| 427 CR_DEFINE_STATIC_LOCAL(SettingsMap, kEmptySettingsMap, ()); | 427 CR_DEFINE_STATIC_LOCAL(SettingsMap, kEmptySettingsMap, ()); |
| 428 return kEmptySettingsMap; | 428 return kEmptySettingsMap; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 594 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); | 594 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); |
| 595 base::MessageLoop::current()->PostDelayedTask( | 595 base::MessageLoop::current()->PostDelayedTask( |
| 596 FROM_HERE, | 596 FROM_HERE, |
| 597 base::Bind( | 597 base::Bind( |
| 598 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, | 598 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, |
| 599 weak_ptr_factory_.GetWeakPtr()), | 599 weak_ptr_factory_.GetWeakPtr()), |
| 600 delay); | 600 delay); |
| 601 } | 601 } |
| 602 | 602 |
| 603 } // namespace net | 603 } // namespace net |
| OLD | NEW |