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

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

Issue 2068423002: Cleanup usage of canonical_suffixes in HttpServerPropertiesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ClearAlternativeServices
Patch Set: fix comments Created 4 years, 6 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
« no previous file with comments | « net/http/http_server_properties_impl_unittest.cc ('k') | no next file » | 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 <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 935 matching lines...) Expand 10 before | Expand all | Expand 10 after
946 } 946 }
947 if (IsAlternativeServiceBroken(alternative_service)) { 947 if (IsAlternativeServiceBroken(alternative_service)) {
948 continue; 948 continue;
949 } 949 }
950 notbroken_alternative_service_info_vector.push_back( 950 notbroken_alternative_service_info_vector.push_back(
951 alternative_service_info); 951 alternative_service_info);
952 } 952 }
953 if (notbroken_alternative_service_info_vector.empty()) { 953 if (notbroken_alternative_service_info_vector.empty()) {
954 continue; 954 continue;
955 } 955 }
956 std::string canonical_suffix = 956 const std::string* canonical_suffix =
957 http_server_properties_impl_->GetCanonicalSuffix(server.host()); 957 http_server_properties_impl_->GetCanonicalSuffix(server.host());
958 if (!canonical_suffix.empty()) { 958 if (canonical_suffix != nullptr) {
959 if (persisted_map.find(canonical_suffix) != persisted_map.end()) 959 if (persisted_map.find(*canonical_suffix) != persisted_map.end())
960 continue; 960 continue;
961 persisted_map[canonical_suffix] = true; 961 persisted_map[*canonical_suffix] = true;
962 } 962 }
963 alternative_service_map->Put(server, 963 alternative_service_map->Put(server,
964 notbroken_alternative_service_info_vector); 964 notbroken_alternative_service_info_vector);
965 ++count; 965 ++count;
966 } 966 }
967 967
968 ServerNetworkStatsMap* server_network_stats_map = 968 ServerNetworkStatsMap* server_network_stats_map =
969 new ServerNetworkStatsMap(kMaxServerNetworkStatsHostsToPersist); 969 new ServerNetworkStatsMap(kMaxServerNetworkStatsHostsToPersist);
970 const ServerNetworkStatsMap& network_stats_map = 970 const ServerNetworkStatsMap& network_stats_map =
971 http_server_properties_impl_->server_network_stats_map(); 971 http_server_properties_impl_->server_network_stats_map();
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 quic_servers_dict); 1252 quic_servers_dict);
1253 } 1253 }
1254 1254
1255 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { 1255 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() {
1256 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); 1256 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread());
1257 if (!setting_prefs_) 1257 if (!setting_prefs_)
1258 ScheduleUpdateCacheOnPrefThread(); 1258 ScheduleUpdateCacheOnPrefThread();
1259 } 1259 }
1260 1260
1261 } // namespace net 1261 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_server_properties_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698