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_macros.h" | 8 #include "base/metrics/histogram_macros.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 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 for (SpdySettingsMap::const_iterator it = main_map.begin(); | 877 for (SpdySettingsMap::const_iterator it = main_map.begin(); |
878 it != main_map.end() && count < kMaxSpdySettingsHostsToPersist; | 878 it != main_map.end() && count < kMaxSpdySettingsHostsToPersist; |
879 ++it, ++count) { | 879 ++it, ++count) { |
880 spdy_settings_map->Put(it->first, it->second); | 880 spdy_settings_map->Put(it->first, it->second); |
881 } | 881 } |
882 | 882 |
883 AlternativeServiceMap* alternative_service_map = | 883 AlternativeServiceMap* alternative_service_map = |
884 new AlternativeServiceMap(kMaxAlternateProtocolHostsToPersist); | 884 new AlternativeServiceMap(kMaxAlternateProtocolHostsToPersist); |
885 const AlternativeServiceMap& map = | 885 const AlternativeServiceMap& map = |
886 http_server_properties_impl_->alternative_service_map(); | 886 http_server_properties_impl_->alternative_service_map(); |
| 887 UMA_HISTOGRAM_COUNTS("Net.CountOfAlternateProtocolServers.Memory", |
| 888 map.size()); |
887 count = 0; | 889 count = 0; |
888 typedef std::map<std::string, bool> CanonicalHostPersistedMap; | 890 typedef std::map<std::string, bool> CanonicalHostPersistedMap; |
889 CanonicalHostPersistedMap persisted_map; | 891 CanonicalHostPersistedMap persisted_map; |
890 for (AlternativeServiceMap::const_iterator it = map.begin(); | 892 for (AlternativeServiceMap::const_iterator it = map.begin(); |
891 it != map.end() && count < kMaxAlternateProtocolHostsToPersist; ++it) { | 893 it != map.end() && count < kMaxAlternateProtocolHostsToPersist; ++it) { |
892 const HostPortPair& server = it->first; | 894 const HostPortPair& server = it->first; |
893 AlternativeServiceInfoVector notbroken_alternative_service_info_vector; | 895 AlternativeServiceInfoVector notbroken_alternative_service_info_vector; |
894 for (const AlternativeServiceInfo& alternative_service_info : it->second) { | 896 for (const AlternativeServiceInfo& alternative_service_info : it->second) { |
895 if (!IsAlternateProtocolValid( | 897 if (!IsAlternateProtocolValid( |
896 alternative_service_info.alternative_service.protocol)) { | 898 alternative_service_info.alternative_service.protocol)) { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 quic_servers_dict); | 1179 quic_servers_dict); |
1178 } | 1180 } |
1179 | 1181 |
1180 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { | 1182 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { |
1181 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); | 1183 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); |
1182 if (!setting_prefs_) | 1184 if (!setting_prefs_) |
1183 ScheduleUpdateCacheOnPrefThread(); | 1185 ScheduleUpdateCacheOnPrefThread(); |
1184 } | 1186 } |
1185 | 1187 |
1186 } // namespace net | 1188 } // namespace net |
OLD | NEW |