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

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

Issue 2102973004: Do not load alternative service from disk for non-https servers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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
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 <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after
690 const url::SchemeHostPort& server, 690 const url::SchemeHostPort& server,
691 const base::DictionaryValue& server_pref_dict, 691 const base::DictionaryValue& server_pref_dict,
692 AlternativeServiceMap* alternative_service_map) { 692 AlternativeServiceMap* alternative_service_map) {
693 DCHECK(alternative_service_map->Peek(server) == 693 DCHECK(alternative_service_map->Peek(server) ==
694 alternative_service_map->end()); 694 alternative_service_map->end());
695 const base::ListValue* alternative_service_list; 695 const base::ListValue* alternative_service_list;
696 if (!server_pref_dict.GetListWithoutPathExpansion( 696 if (!server_pref_dict.GetListWithoutPathExpansion(
697 kAlternativeServiceKey, &alternative_service_list)) { 697 kAlternativeServiceKey, &alternative_service_list)) {
698 return true; 698 return true;
699 } 699 }
700 if (server.scheme() != "https") {
701 return false;
702 }
700 703
701 AlternativeServiceInfoVector alternative_service_info_vector; 704 AlternativeServiceInfoVector alternative_service_info_vector;
702 for (const auto& alternative_service_list_item : *alternative_service_list) { 705 for (const auto& alternative_service_list_item : *alternative_service_list) {
703 const base::DictionaryValue* alternative_service_dict; 706 const base::DictionaryValue* alternative_service_dict;
704 if (!alternative_service_list_item->GetAsDictionary( 707 if (!alternative_service_list_item->GetAsDictionary(
705 &alternative_service_dict)) 708 &alternative_service_dict))
706 return false; 709 return false;
707 AlternativeServiceInfo alternative_service_info; 710 AlternativeServiceInfo alternative_service_info;
708 if (!ParseAlternativeServiceDict(*alternative_service_dict, 711 if (!ParseAlternativeServiceDict(*alternative_service_dict,
709 server.Serialize(), 712 server.Serialize(),
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
1246 quic_servers_dict); 1249 quic_servers_dict);
1247 } 1250 }
1248 1251
1249 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { 1252 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() {
1250 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); 1253 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread());
1251 if (!setting_prefs_) 1254 if (!setting_prefs_)
1252 ScheduleUpdateCacheOnPrefThread(); 1255 ScheduleUpdateCacheOnPrefThread();
1253 } 1256 }
1254 1257
1255 } // namespace net 1258 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_manager.h ('k') | net/http/http_server_properties_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698