| 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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 | 442 |
| 443 double probability = 1; | 443 double probability = 1; |
| 444 if (port_alternate_protocol_dict->HasKey("probability") && | 444 if (port_alternate_protocol_dict->HasKey("probability") && |
| 445 !port_alternate_protocol_dict->GetDoubleWithoutPathExpansion( | 445 !port_alternate_protocol_dict->GetDoubleWithoutPathExpansion( |
| 446 "probability", &probability)) { | 446 "probability", &probability)) { |
| 447 DVLOG(1) << "Malformed Alternate-Protocol server: " << server_str; | 447 DVLOG(1) << "Malformed Alternate-Protocol server: " << server_str; |
| 448 detected_corrupted_prefs = true; | 448 detected_corrupted_prefs = true; |
| 449 continue; | 449 continue; |
| 450 } | 450 } |
| 451 | 451 |
| 452 net::AlternateProtocolInfo port_alternate_protocol(port, | 452 net::AlternateProtocolInfo port_alternate_protocol( |
| 453 protocol, | 453 static_cast<uint16>(port), protocol, probability); |
| 454 probability); | |
| 455 alternate_protocol_map->Put(server, port_alternate_protocol); | 454 alternate_protocol_map->Put(server, port_alternate_protocol); |
| 456 ++count; | 455 ++count; |
| 457 } while (false); | 456 } while (false); |
| 458 | 457 |
| 459 // Get SupportsQuic. | 458 // Get SupportsQuic. |
| 460 DCHECK(supports_quic_map->find(server) == supports_quic_map->end()); | 459 DCHECK(supports_quic_map->find(server) == supports_quic_map->end()); |
| 461 const base::DictionaryValue* supports_quic_dict = NULL; | 460 const base::DictionaryValue* supports_quic_dict = NULL; |
| 462 if (!server_pref_dict->GetDictionaryWithoutPathExpansion( | 461 if (!server_pref_dict->GetDictionaryWithoutPathExpansion( |
| 463 "supports_quic", &supports_quic_dict)) { | 462 "supports_quic", &supports_quic_dict)) { |
| 464 continue; | 463 continue; |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 completion.Run(); | 789 completion.Run(); |
| 791 } | 790 } |
| 792 | 791 |
| 793 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { | 792 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { |
| 794 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); | 793 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); |
| 795 if (!setting_prefs_) | 794 if (!setting_prefs_) |
| 796 ScheduleUpdateCacheOnPrefThread(); | 795 ScheduleUpdateCacheOnPrefThread(); |
| 797 } | 796 } |
| 798 | 797 |
| 799 } // namespace net | 798 } // namespace net |
| OLD | NEW |