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 <utility> |
8 | 9 |
9 #include "base/bind.h" | 10 #include "base/bind.h" |
10 #include "base/location.h" | 11 #include "base/location.h" |
11 #include "base/logging.h" | 12 #include "base/logging.h" |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/metrics/histogram_macros.h" | 14 #include "base/metrics/histogram_macros.h" |
14 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
15 #include "base/stl_util.h" | 16 #include "base/stl_util.h" |
16 #include "base/strings/string_util.h" | 17 #include "base/strings/string_util.h" |
17 #include "base/strings/stringprintf.h" | 18 #include "base/strings/stringprintf.h" |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 alternative_service_string.append(" (broken)"); | 554 alternative_service_string.append(" (broken)"); |
554 } | 555 } |
555 alternative_service_list->Append( | 556 alternative_service_list->Append( |
556 new base::StringValue(alternative_service_string)); | 557 new base::StringValue(alternative_service_string)); |
557 } | 558 } |
558 if (alternative_service_list->empty()) | 559 if (alternative_service_list->empty()) |
559 continue; | 560 continue; |
560 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 561 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
561 dict->SetString("host_port_pair", host_port_pair.ToString()); | 562 dict->SetString("host_port_pair", host_port_pair.ToString()); |
562 dict->Set("alternative_service", | 563 dict->Set("alternative_service", |
563 scoped_ptr<base::Value>(alternative_service_list.Pass())); | 564 scoped_ptr<base::Value>(std::move(alternative_service_list))); |
564 dict_list->Append(dict.Pass()); | 565 dict_list->Append(std::move(dict)); |
565 } | 566 } |
566 return dict_list.Pass(); | 567 return std::move(dict_list); |
567 } | 568 } |
568 | 569 |
569 const SettingsMap& HttpServerPropertiesImpl::GetSpdySettings( | 570 const SettingsMap& HttpServerPropertiesImpl::GetSpdySettings( |
570 const HostPortPair& host_port_pair) { | 571 const HostPortPair& host_port_pair) { |
571 SpdySettingsMap::iterator it = spdy_settings_map_.Get(host_port_pair); | 572 SpdySettingsMap::iterator it = spdy_settings_map_.Get(host_port_pair); |
572 if (it == spdy_settings_map_.end()) { | 573 if (it == spdy_settings_map_.end()) { |
573 CR_DEFINE_STATIC_LOCAL(SettingsMap, kEmptySettingsMap, ()); | 574 CR_DEFINE_STATIC_LOCAL(SettingsMap, kEmptySettingsMap, ()); |
574 return kEmptySettingsMap; | 575 return kEmptySettingsMap; |
575 } | 576 } |
576 return it->second; | 577 return it->second; |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
795 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); | 796 base::TimeDelta delay = when > now ? when - now : base::TimeDelta(); |
796 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( | 797 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
797 FROM_HERE, | 798 FROM_HERE, |
798 base::Bind( | 799 base::Bind( |
799 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, | 800 &HttpServerPropertiesImpl::ExpireBrokenAlternateProtocolMappings, |
800 weak_ptr_factory_.GetWeakPtr()), | 801 weak_ptr_factory_.GetWeakPtr()), |
801 delay); | 802 delay); |
802 } | 803 } |
803 | 804 |
804 } // namespace net | 805 } // namespace net |
OLD | NEW |