Chromium Code Reviews| 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/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 28 // Time to wait before starting an update the preferences from the | 28 // Time to wait before starting an update the preferences from the |
| 29 // http_server_properties_impl_ cache. Scheduling another update during this | 29 // http_server_properties_impl_ cache. Scheduling another update during this |
| 30 // period will reset the timer. | 30 // period will reset the timer. |
| 31 const int64_t kUpdatePrefsDelayMs = 60000; | 31 const int64_t kUpdatePrefsDelayMs = 60000; |
| 32 | 32 |
| 33 // "version" 0 indicates, http_server_properties doesn't have "version" | 33 // "version" 0 indicates, http_server_properties doesn't have "version" |
| 34 // property. | 34 // property. |
| 35 const int kMissingVersion = 0; | 35 const int kMissingVersion = 0; |
| 36 | 36 |
| 37 // The version number of persisted http_server_properties. | 37 // The version number of persisted http_server_properties. |
| 38 const int kVersionNumber = 4; | 38 const int kVersionNumber = 5; |
| 39 | 39 |
| 40 // Persist 200 MRU AlternateProtocolHostPortPairs. | 40 // Persist 200 MRU AlternateProtocolHostPortPairs. |
| 41 const int kMaxAlternateProtocolHostsToPersist = 200; | 41 const int kMaxAlternateProtocolHostsToPersist = 200; |
| 42 | 42 |
| 43 // Persist 200 MRU SpdySettingsHostPortPairs. | 43 // Persist 200 MRU SpdySettingsHostPortPairs. |
| 44 const int kMaxSpdySettingsHostsToPersist = 200; | 44 const int kMaxSpdySettingsHostsToPersist = 200; |
| 45 | 45 |
| 46 // Persist 300 MRU SupportsSpdyServerHostPortPairs. | 46 // Persist 300 MRU SupportsSpdyServerHostPortPairs. |
| 47 const int kMaxSupportsSpdyServerHostsToPersist = 300; | 47 const int kMaxSupportsSpdyServerHostsToPersist = 300; |
| 48 | 48 |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 454 if (version < 4) { | 454 if (version < 4) { |
| 455 // The properties for a given server is in | 455 // The properties for a given server is in |
| 456 // http_server_properties_dict["servers"][server]. | 456 // http_server_properties_dict["servers"][server]. |
| 457 // Before Version 4, server data was stored in the following format in | 457 // Before Version 4, server data was stored in the following format in |
| 458 // alphabetical order. | 458 // alphabetical order. |
| 459 // | 459 // |
| 460 // "http_server_properties": { | 460 // "http_server_properties": { |
| 461 // "servers": { | 461 // "servers": { |
| 462 // "0-edge-chat.facebook.com:443" : {...}, | 462 // "0-edge-chat.facebook.com:443" : {...}, |
| 463 // "0.client-channel.google.com:443" : {...}, | 463 // "0.client-channel.google.com:443" : {...}, |
| 464 // "yt3.ggpht.com:443" : {...}, | 464 // "yt3.ggpht.com:80" : {...}, |
| 465 // ... | 465 // ... |
| 466 // }, ... | 466 // }, ... |
| 467 // }, | 467 // }, |
| 468 if (!http_server_properties_dict.GetDictionaryWithoutPathExpansion( | 468 if (!http_server_properties_dict.GetDictionaryWithoutPathExpansion( |
| 469 kServersKey, &servers_dict)) { | 469 kServersKey, &servers_dict)) { |
| 470 DVLOG(1) << "Malformed http_server_properties for servers."; | 470 DVLOG(1) << "Malformed http_server_properties for servers."; |
| 471 return; | 471 return; |
| 472 } | 472 } |
| 473 } else { | 473 } else { |
| 474 // From Version 4 onwards, data was stored in the following format. | 474 // For Version 4, data was stored in the following format. |
| 475 // |servers| are saved in MRU order. | 475 // |servers| are saved in MRU order. |
| 476 // | 476 // |
| 477 // "http_server_properties": { | 477 // "http_server_properties": { |
| 478 // "servers": [ | 478 // "servers": [ |
| 479 // {"yt3.ggpht.com:443" : {...}}, | 479 // {"yt3.ggpht.com:443" : {...}}, |
| 480 // {"0.client-channel.google.com:443" : {...}}, | 480 // {"0.client-channel.google.com:443" : {...}}, |
| 481 // {"0-edge-chat.facebook.com:443" : {...}}, | 481 // {"0-edge-chat.facebook.com:80" : {...}}, |
| 482 // ... | 482 // ... |
| 483 // ], ... | 483 // ], ... |
| 484 // }, | 484 // }, |
| 485 // For Version 5, data was stored in the following format. | |
| 486 // |servers| are saved in MRU order. |servers| are in the format flattened | |
| 487 // representation of (scheme/host/port) where port might be ignored if is | |
| 488 // default with scheme. | |
| 489 // | |
| 490 // "http_server_properties": { | |
| 491 // "servers": [ | |
| 492 // {"https://yt3.ggpht.com" : {...}}, | |
| 493 // {"http:0.client-channel.google.com:443" : {...}}, | |
|
Ryan Hamilton
2016/04/18 17:33:45
should this be :// instead of : ? (and below)
Zhongyi Shi
2016/04/18 19:54:38
yeah, sorry for those typos.
| |
| 494 // {"http:0-edge-chat.facebook.com" : {...}}, | |
| 495 // ... | |
| 496 // ], ... | |
| 497 // }, | |
| 485 if (!http_server_properties_dict.GetListWithoutPathExpansion( | 498 if (!http_server_properties_dict.GetListWithoutPathExpansion( |
| 486 kServersKey, &servers_list)) { | 499 kServersKey, &servers_list)) { |
| 487 DVLOG(1) << "Malformed http_server_properties for servers list."; | 500 DVLOG(1) << "Malformed http_server_properties for servers list."; |
| 488 return; | 501 return; |
| 489 } | 502 } |
| 490 } | 503 } |
| 491 | 504 |
| 492 IPAddress* addr = new IPAddress; | 505 IPAddress* addr = new IPAddress; |
| 493 ReadSupportsQuic(http_server_properties_dict, addr); | 506 ReadSupportsQuic(http_server_properties_dict, addr); |
| 494 | 507 |
| 495 // String is "scheme://host:port" tuple of spdy server. | 508 // String is "scheme://host:port" tuple of spdy server. |
| 496 scoped_ptr<ServerList> spdy_servers(new ServerList); | 509 scoped_ptr<ServerList> spdy_servers(new ServerList); |
| 497 scoped_ptr<SpdySettingsMap> spdy_settings_map( | 510 scoped_ptr<SpdySettingsMap> spdy_settings_map( |
| 498 new SpdySettingsMap(kMaxSpdySettingsHostsToPersist)); | 511 new SpdySettingsMap(kMaxSpdySettingsHostsToPersist)); |
| 499 scoped_ptr<AlternativeServiceMap> alternative_service_map( | 512 scoped_ptr<AlternativeServiceMap> alternative_service_map( |
| 500 new AlternativeServiceMap(kMaxAlternateProtocolHostsToPersist)); | 513 new AlternativeServiceMap(kMaxAlternateProtocolHostsToPersist)); |
| 501 scoped_ptr<ServerNetworkStatsMap> server_network_stats_map( | 514 scoped_ptr<ServerNetworkStatsMap> server_network_stats_map( |
| 502 new ServerNetworkStatsMap(kMaxServerNetworkStatsHostsToPersist)); | 515 new ServerNetworkStatsMap(kMaxServerNetworkStatsHostsToPersist)); |
| 503 scoped_ptr<QuicServerInfoMap> quic_server_info_map( | 516 scoped_ptr<QuicServerInfoMap> quic_server_info_map( |
| 504 new QuicServerInfoMap(QuicServerInfoMap::NO_AUTO_EVICT)); | 517 new QuicServerInfoMap(QuicServerInfoMap::NO_AUTO_EVICT)); |
| 505 | 518 |
| 506 if (version < 4) { | 519 if (version < 4) { |
| 507 if (!AddServersData(*servers_dict, spdy_servers.get(), | 520 if (!AddServersData(*servers_dict, spdy_servers.get(), |
| 508 spdy_settings_map.get(), alternative_service_map.get(), | 521 spdy_settings_map.get(), alternative_service_map.get(), |
| 509 server_network_stats_map.get())) { | 522 server_network_stats_map.get(), version)) { |
| 510 detected_corrupted_prefs = true; | 523 detected_corrupted_prefs = true; |
| 511 } | 524 } |
| 512 } else { | 525 } else { |
| 513 for (base::ListValue::const_iterator it = servers_list->begin(); | 526 for (base::ListValue::const_iterator it = servers_list->begin(); |
| 514 it != servers_list->end(); ++it) { | 527 it != servers_list->end(); ++it) { |
| 515 if (!(*it)->GetAsDictionary(&servers_dict)) { | 528 if (!(*it)->GetAsDictionary(&servers_dict)) { |
| 516 DVLOG(1) << "Malformed http_server_properties for servers dictionary."; | 529 DVLOG(1) << "Malformed http_server_properties for servers dictionary."; |
| 517 detected_corrupted_prefs = true; | 530 detected_corrupted_prefs = true; |
| 518 continue; | 531 continue; |
| 519 } | 532 } |
| 520 if (!AddServersData( | 533 if (!AddServersData(*servers_dict, spdy_servers.get(), |
| 521 *servers_dict, spdy_servers.get(), spdy_settings_map.get(), | 534 spdy_settings_map.get(), |
| 522 alternative_service_map.get(), server_network_stats_map.get())) { | 535 alternative_service_map.get(), |
| 536 server_network_stats_map.get(), version)) { | |
| 523 detected_corrupted_prefs = true; | 537 detected_corrupted_prefs = true; |
| 524 } | 538 } |
| 525 } | 539 } |
| 526 } | 540 } |
| 527 | 541 |
| 528 if (!AddToQuicServerInfoMap(http_server_properties_dict, | 542 if (!AddToQuicServerInfoMap(http_server_properties_dict, |
| 529 quic_server_info_map.get())) { | 543 quic_server_info_map.get())) { |
| 530 detected_corrupted_prefs = true; | 544 detected_corrupted_prefs = true; |
| 531 } | 545 } |
| 532 | 546 |
| 533 network_task_runner_->PostTask( | 547 network_task_runner_->PostTask( |
| 534 FROM_HERE, | 548 FROM_HERE, |
| 535 base::Bind( | 549 base::Bind( |
| 536 &HttpServerPropertiesManager::UpdateCacheFromPrefsOnNetworkThread, | 550 &HttpServerPropertiesManager::UpdateCacheFromPrefsOnNetworkThread, |
| 537 base::Unretained(this), base::Owned(spdy_servers.release()), | 551 base::Unretained(this), base::Owned(spdy_servers.release()), |
| 538 base::Owned(spdy_settings_map.release()), | 552 base::Owned(spdy_settings_map.release()), |
| 539 base::Owned(alternative_service_map.release()), base::Owned(addr), | 553 base::Owned(alternative_service_map.release()), base::Owned(addr), |
| 540 base::Owned(server_network_stats_map.release()), | 554 base::Owned(server_network_stats_map.release()), |
| 541 base::Owned(quic_server_info_map.release()), | 555 base::Owned(quic_server_info_map.release()), |
| 542 detected_corrupted_prefs)); | 556 detected_corrupted_prefs)); |
| 543 } | 557 } |
| 544 | 558 |
| 545 bool HttpServerPropertiesManager::AddServersData( | 559 bool HttpServerPropertiesManager::AddServersData( |
| 546 const base::DictionaryValue& servers_dict, | 560 const base::DictionaryValue& servers_dict, |
| 547 ServerList* spdy_servers, | 561 ServerList* spdy_servers, |
| 548 SpdySettingsMap* spdy_settings_map, | 562 SpdySettingsMap* spdy_settings_map, |
| 549 AlternativeServiceMap* alternative_service_map, | 563 AlternativeServiceMap* alternative_service_map, |
| 550 ServerNetworkStatsMap* network_stats_map) { | 564 ServerNetworkStatsMap* network_stats_map, |
| 565 int version) { | |
| 551 for (base::DictionaryValue::Iterator it(servers_dict); !it.IsAtEnd(); | 566 for (base::DictionaryValue::Iterator it(servers_dict); !it.IsAtEnd(); |
| 552 it.Advance()) { | 567 it.Advance()) { |
| 553 // TODO(zhongyi): get server's scheme/host/port when servers_dict migrates | 568 // Get server's scheme/host/pair. |
| 554 // to SchemeHostPort. | |
| 555 // Get server's host/pair. | |
| 556 const std::string& server_str = it.key(); | 569 const std::string& server_str = it.key(); |
| 557 // TODO(zhongyi): fill in the scheme field when servers_dict has scheme. | 570 std::string spdy_server_url = server_str; |
| 558 std::string spdy_server_url = "https://" + server_str; | 571 if (version < 5) { |
| 572 // For old version disk data, always use HTTPS as the scheme. | |
| 573 spdy_server_url.insert(0, "https://"); | |
| 574 } | |
| 559 url::SchemeHostPort spdy_server((GURL(spdy_server_url))); | 575 url::SchemeHostPort spdy_server((GURL(spdy_server_url))); |
| 560 if (spdy_server.host().empty()) { | 576 if (spdy_server.host().empty()) { |
| 561 DVLOG(1) << "Malformed http_server_properties for server: " << server_str; | 577 DVLOG(1) << "Malformed http_server_properties for server: " << server_str; |
| 562 return false; | 578 return false; |
| 563 } | 579 } |
| 564 | 580 |
| 565 const base::DictionaryValue* server_pref_dict = nullptr; | 581 const base::DictionaryValue* server_pref_dict = nullptr; |
| 566 if (!it.value().GetAsDictionary(&server_pref_dict)) { | 582 if (!it.value().GetAsDictionary(&server_pref_dict)) { |
| 567 DVLOG(1) << "Malformed http_server_properties server: " << server_str; | 583 DVLOG(1) << "Malformed http_server_properties server: " << server_str; |
| 568 return false; | 584 return false; |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1030 | 1046 |
| 1031 // All maps and lists are in MRU order. | 1047 // All maps and lists are in MRU order. |
| 1032 void HttpServerPropertiesManager::UpdatePrefsOnPrefThread( | 1048 void HttpServerPropertiesManager::UpdatePrefsOnPrefThread( |
| 1033 base::ListValue* spdy_server_list, | 1049 base::ListValue* spdy_server_list, |
| 1034 SpdySettingsMap* spdy_settings_map, | 1050 SpdySettingsMap* spdy_settings_map, |
| 1035 AlternativeServiceMap* alternative_service_map, | 1051 AlternativeServiceMap* alternative_service_map, |
| 1036 IPAddress* last_quic_address, | 1052 IPAddress* last_quic_address, |
| 1037 ServerNetworkStatsMap* server_network_stats_map, | 1053 ServerNetworkStatsMap* server_network_stats_map, |
| 1038 QuicServerInfoMap* quic_server_info_map, | 1054 QuicServerInfoMap* quic_server_info_map, |
| 1039 const base::Closure& completion) { | 1055 const base::Closure& completion) { |
| 1040 typedef base::MRUCache<HostPortPair, ServerPref> ServerPrefMap; | 1056 typedef base::MRUCache<url::SchemeHostPort, ServerPref> ServerPrefMap; |
| 1041 ServerPrefMap server_pref_map(ServerPrefMap::NO_AUTO_EVICT); | 1057 ServerPrefMap server_pref_map(ServerPrefMap::NO_AUTO_EVICT); |
| 1042 | 1058 |
| 1043 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); | 1059 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); |
| 1044 | 1060 |
| 1045 // Add servers that support spdy to server_pref_map in the MRU order. | 1061 // Add servers that support spdy to server_pref_map in the MRU order. |
| 1046 for (size_t index = spdy_server_list->GetSize(); index > 0; --index) { | 1062 for (size_t index = spdy_server_list->GetSize(); index > 0; --index) { |
| 1047 std::string s; | 1063 std::string server_str; |
| 1048 if (spdy_server_list->GetString(index - 1, &s)) { | 1064 if (spdy_server_list->GetString(index - 1, &server_str)) { |
| 1049 HostPortPair server = HostPortPair::FromString(s); | 1065 url::SchemeHostPort server((GURL(server_str))); |
| 1050 ServerPrefMap::iterator it = server_pref_map.Get(server); | 1066 ServerPrefMap::iterator it = server_pref_map.Get(server); |
| 1051 if (it == server_pref_map.end()) { | 1067 if (it == server_pref_map.end()) { |
| 1052 ServerPref server_pref; | 1068 ServerPref server_pref; |
| 1053 server_pref.supports_spdy = true; | 1069 server_pref.supports_spdy = true; |
| 1054 server_pref_map.Put(server, server_pref); | 1070 server_pref_map.Put(server, server_pref); |
| 1055 } else { | 1071 } else { |
| 1056 it->second.supports_spdy = true; | 1072 it->second.supports_spdy = true; |
| 1057 } | 1073 } |
| 1058 } | 1074 } |
| 1059 } | 1075 } |
| 1060 | 1076 |
| 1061 // Add servers that have SpdySettings to server_pref_map in the MRU order. | 1077 // Add servers that have SpdySettings to server_pref_map in the MRU order. |
| 1062 for (SpdySettingsMap::reverse_iterator map_it = spdy_settings_map->rbegin(); | 1078 for (SpdySettingsMap::reverse_iterator map_it = spdy_settings_map->rbegin(); |
| 1063 map_it != spdy_settings_map->rend(); ++map_it) { | 1079 map_it != spdy_settings_map->rend(); ++map_it) { |
| 1064 // TODO(zhongyi): use memory data once disk data is migrated. | 1080 const url::SchemeHostPort server = map_it->first; |
| 1065 const url::SchemeHostPort spdy_server = map_it->first; | |
| 1066 const HostPortPair server(spdy_server.host(), spdy_server.port()); | |
| 1067 ServerPrefMap::iterator it = server_pref_map.Get(server); | 1081 ServerPrefMap::iterator it = server_pref_map.Get(server); |
| 1068 if (it == server_pref_map.end()) { | 1082 if (it == server_pref_map.end()) { |
| 1069 ServerPref server_pref; | 1083 ServerPref server_pref; |
| 1070 server_pref.settings_map = &map_it->second; | 1084 server_pref.settings_map = &map_it->second; |
| 1071 server_pref_map.Put(server, server_pref); | 1085 server_pref_map.Put(server, server_pref); |
| 1072 } else { | 1086 } else { |
| 1073 it->second.settings_map = &map_it->second; | 1087 it->second.settings_map = &map_it->second; |
| 1074 } | 1088 } |
| 1075 } | 1089 } |
| 1076 | 1090 |
| 1077 // Add alternative services to server_pref_map in the MRU order. | 1091 // Add alternative services to server_pref_map in the MRU order. |
| 1078 for (AlternativeServiceMap::const_reverse_iterator map_it = | 1092 for (AlternativeServiceMap::const_reverse_iterator map_it = |
| 1079 alternative_service_map->rbegin(); | 1093 alternative_service_map->rbegin(); |
| 1080 map_it != alternative_service_map->rend(); ++map_it) { | 1094 map_it != alternative_service_map->rend(); ++map_it) { |
| 1081 // TODO(zhongyi): migrate to SHP once server_pref_map is migrated. | 1095 const url::SchemeHostPort server = map_it->first; |
| 1082 const HostPortPair server(map_it->first.host(), map_it->first.port()); | |
| 1083 ServerPrefMap::iterator it = server_pref_map.Get(server); | 1096 ServerPrefMap::iterator it = server_pref_map.Get(server); |
| 1084 if (it == server_pref_map.end()) { | 1097 if (it == server_pref_map.end()) { |
| 1085 ServerPref server_pref; | 1098 ServerPref server_pref; |
| 1086 server_pref.alternative_service_info_vector = &map_it->second; | 1099 server_pref.alternative_service_info_vector = &map_it->second; |
| 1087 server_pref_map.Put(server, server_pref); | 1100 server_pref_map.Put(server, server_pref); |
| 1088 } else { | 1101 } else { |
| 1089 it->second.alternative_service_info_vector = &map_it->second; | 1102 it->second.alternative_service_info_vector = &map_it->second; |
| 1090 } | 1103 } |
| 1091 } | 1104 } |
| 1092 | 1105 |
| 1093 // Add ServerNetworkStats servers to server_pref_map in the MRU order. | 1106 // Add ServerNetworkStats servers to server_pref_map in the MRU order. |
| 1094 for (ServerNetworkStatsMap::const_reverse_iterator map_it = | 1107 for (ServerNetworkStatsMap::const_reverse_iterator map_it = |
| 1095 server_network_stats_map->rbegin(); | 1108 server_network_stats_map->rbegin(); |
| 1096 map_it != server_network_stats_map->rend(); ++map_it) { | 1109 map_it != server_network_stats_map->rend(); ++map_it) { |
| 1097 // TODO(zhongyi): use memory data once disk data is migrated. | 1110 const url::SchemeHostPort server = map_it->first; |
| 1098 const url::SchemeHostPort spdy_server = map_it->first; | |
| 1099 const HostPortPair server(spdy_server.host(), spdy_server.port()); | |
| 1100 ServerPrefMap::iterator it = server_pref_map.Get(server); | 1111 ServerPrefMap::iterator it = server_pref_map.Get(server); |
| 1101 if (it == server_pref_map.end()) { | 1112 if (it == server_pref_map.end()) { |
| 1102 ServerPref server_pref; | 1113 ServerPref server_pref; |
| 1103 server_pref.server_network_stats = &map_it->second; | 1114 server_pref.server_network_stats = &map_it->second; |
| 1104 server_pref_map.Put(server, server_pref); | 1115 server_pref_map.Put(server, server_pref); |
| 1105 } else { | 1116 } else { |
| 1106 it->second.server_network_stats = &map_it->second; | 1117 it->second.server_network_stats = &map_it->second; |
| 1107 } | 1118 } |
| 1108 } | 1119 } |
| 1109 | 1120 |
| 1110 // Persist properties to the prefs in the MRU order. | 1121 // Persist properties to the prefs in the MRU order. |
| 1111 base::DictionaryValue http_server_properties_dict; | 1122 base::DictionaryValue http_server_properties_dict; |
| 1112 base::ListValue* servers_list = new base::ListValue; | 1123 base::ListValue* servers_list = new base::ListValue; |
| 1113 for (ServerPrefMap::const_reverse_iterator map_it = server_pref_map.rbegin(); | 1124 for (ServerPrefMap::const_reverse_iterator map_it = server_pref_map.rbegin(); |
| 1114 map_it != server_pref_map.rend(); ++map_it) { | 1125 map_it != server_pref_map.rend(); ++map_it) { |
| 1115 const HostPortPair& server = map_it->first; | 1126 const url::SchemeHostPort server = map_it->first; |
| 1116 const ServerPref& server_pref = map_it->second; | 1127 const ServerPref& server_pref = map_it->second; |
| 1117 | 1128 |
| 1118 base::DictionaryValue* servers_dict = new base::DictionaryValue; | 1129 base::DictionaryValue* servers_dict = new base::DictionaryValue; |
| 1119 base::DictionaryValue* server_pref_dict = new base::DictionaryValue; | 1130 base::DictionaryValue* server_pref_dict = new base::DictionaryValue; |
| 1120 | 1131 |
| 1121 // Save supports_spdy. | 1132 // Save supports_spdy. |
| 1122 if (server_pref.supports_spdy) | 1133 if (server_pref.supports_spdy) |
| 1123 server_pref_dict->SetBoolean(kSupportsSpdyKey, server_pref.supports_spdy); | 1134 server_pref_dict->SetBoolean(kSupportsSpdyKey, server_pref.supports_spdy); |
| 1124 SaveSpdySettingsToServerPrefs(server_pref.settings_map, server_pref_dict); | 1135 SaveSpdySettingsToServerPrefs(server_pref.settings_map, server_pref_dict); |
| 1125 SaveAlternativeServiceToServerPrefs( | 1136 SaveAlternativeServiceToServerPrefs( |
| 1126 server_pref.alternative_service_info_vector, server_pref_dict); | 1137 server_pref.alternative_service_info_vector, server_pref_dict); |
| 1127 SaveNetworkStatsToServerPrefs(server_pref.server_network_stats, | 1138 SaveNetworkStatsToServerPrefs(server_pref.server_network_stats, |
| 1128 server_pref_dict); | 1139 server_pref_dict); |
| 1129 | 1140 |
| 1130 servers_dict->SetWithoutPathExpansion(server.ToString(), server_pref_dict); | 1141 servers_dict->SetWithoutPathExpansion(server.Serialize(), server_pref_dict); |
| 1131 bool value = servers_list->AppendIfNotPresent(servers_dict); | 1142 bool value = servers_list->AppendIfNotPresent(servers_dict); |
| 1132 DCHECK(value); // Should never happen. | 1143 DCHECK(value); // Should never happen. |
| 1133 } | 1144 } |
| 1134 | 1145 |
| 1135 http_server_properties_dict.SetWithoutPathExpansion(kServersKey, | 1146 http_server_properties_dict.SetWithoutPathExpansion(kServersKey, |
| 1136 servers_list); | 1147 servers_list); |
| 1137 SetVersion(&http_server_properties_dict, kVersionNumber); | 1148 SetVersion(&http_server_properties_dict, kVersionNumber); |
| 1138 | 1149 |
| 1139 SaveSupportsQuicToPrefs(last_quic_address, &http_server_properties_dict); | 1150 SaveSupportsQuicToPrefs(last_quic_address, &http_server_properties_dict); |
| 1140 | 1151 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1252 quic_servers_dict); | 1263 quic_servers_dict); |
| 1253 } | 1264 } |
| 1254 | 1265 |
| 1255 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { | 1266 void HttpServerPropertiesManager::OnHttpServerPropertiesChanged() { |
| 1256 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); | 1267 DCHECK(pref_task_runner_->RunsTasksOnCurrentThread()); |
| 1257 if (!setting_prefs_) | 1268 if (!setting_prefs_) |
| 1258 ScheduleUpdateCacheOnPrefThread(); | 1269 ScheduleUpdateCacheOnPrefThread(); |
| 1259 } | 1270 } |
| 1260 | 1271 |
| 1261 } // namespace net | 1272 } // namespace net |
| OLD | NEW |