Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: net/http/http_server_properties_manager.cc

Issue 701163002: Introduce AlternateProtocolInfo.is_broken. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_server_properties_impl_unittest.cc ('k') | net/http/http_stream_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
739 ++it) { 739 ++it) {
740 net::SpdySettingsIds id = it->first; 740 net::SpdySettingsIds id = it->first;
741 uint32 value = it->second.second; 741 uint32 value = it->second.second;
742 std::string key = base::StringPrintf("%u", id); 742 std::string key = base::StringPrintf("%u", id);
743 spdy_settings_dict->SetInteger(key, value); 743 spdy_settings_dict->SetInteger(key, value);
744 } 744 }
745 server_pref_dict->SetWithoutPathExpansion("settings", spdy_settings_dict); 745 server_pref_dict->SetWithoutPathExpansion("settings", spdy_settings_dict);
746 } 746 }
747 747
748 // Save alternate_protocol. 748 // Save alternate_protocol.
749 if (server_pref.alternate_protocol) { 749 const net::AlternateProtocolInfo* port_alternate_protocol =
750 server_pref.alternate_protocol;
751 if (port_alternate_protocol && !port_alternate_protocol->is_broken) {
750 base::DictionaryValue* port_alternate_protocol_dict = 752 base::DictionaryValue* port_alternate_protocol_dict =
751 new base::DictionaryValue; 753 new base::DictionaryValue;
752 const net::AlternateProtocolInfo* port_alternate_protocol =
753 server_pref.alternate_protocol;
754 port_alternate_protocol_dict->SetInteger("port", 754 port_alternate_protocol_dict->SetInteger("port",
755 port_alternate_protocol->port); 755 port_alternate_protocol->port);
756 const char* protocol_str = 756 const char* protocol_str =
757 net::AlternateProtocolToString(port_alternate_protocol->protocol); 757 net::AlternateProtocolToString(port_alternate_protocol->protocol);
758 port_alternate_protocol_dict->SetString("protocol_str", protocol_str); 758 port_alternate_protocol_dict->SetString("protocol_str", protocol_str);
759 port_alternate_protocol_dict->SetDouble( 759 port_alternate_protocol_dict->SetDouble(
760 "probability", port_alternate_protocol->probability); 760 "probability", port_alternate_protocol->probability);
761 server_pref_dict->SetWithoutPathExpansion( 761 server_pref_dict->SetWithoutPathExpansion(
762 "alternate_protocol", port_alternate_protocol_dict); 762 "alternate_protocol", port_alternate_protocol_dict);
763 } 763 }
(...skipping 25 matching lines...) Expand all
789 completion.Run(); 789 completion.Run();
790 } 790 }
791 791
792 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { 792 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() {
793 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); 793 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread());
794 if (!setting_prefs_) 794 if (!setting_prefs_)
795 ScheduleUpdateCacheOnPrefThread(); 795 ScheduleUpdateCacheOnPrefThread();
796 } 796 }
797 797
798 } // namespace net 798 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_impl_unittest.cc ('k') | net/http/http_stream_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698