summaryrefslogtreecommitdiff
path: root/chromium/net/http/http_server_properties_manager.cc
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-05-17 17:24:03 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-22 07:51:41 +0000
commit774f54339e5db91f785733232d3950366db65d07 (patch)
tree068e1b47bd1af94d77094ed12b604a6b83d9c22a /chromium/net/http/http_server_properties_manager.cc
parentf7eaed5286974984ba5f9e3189d8f49d03e99f81 (diff)
downloadqtwebengine-chromium-774f54339e5db91f785733232d3950366db65d07.tar.gz
BASELINE: Update Chromium to 102.0.5005.57
Change-Id: I885f714bb40ee724c28f94ca6bd8dbdb39915158 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/net/http/http_server_properties_manager.cc')
-rw-r--r--chromium/net/http/http_server_properties_manager.cc24
1 files changed, 8 insertions, 16 deletions
diff --git a/chromium/net/http/http_server_properties_manager.cc b/chromium/net/http/http_server_properties_manager.cc
index a6836ff2555..3513f4fd685 100644
--- a/chromium/net/http/http_server_properties_manager.cc
+++ b/chromium/net/http/http_server_properties_manager.cc
@@ -7,10 +7,12 @@
#include <utility>
#include "base/bind.h"
+#include "base/containers/adapters.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/tick_clock.h"
+#include "base/time/time.h"
#include "base/values.h"
#include "net/base/features.h"
#include "net/base/host_port_pair.h"
@@ -18,7 +20,7 @@
#include "net/base/port_util.h"
#include "net/base/privacy_mode.h"
#include "net/http/http_server_properties.h"
-#include "net/third_party/quiche/src/quic/platform/api/quic_hostname_utils.h"
+#include "net/third_party/quiche/src/quiche/quic/platform/api/quic_hostname_utils.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
#include "url/scheme_host_port.h"
@@ -717,11 +719,7 @@ void HttpServerPropertiesManager::WriteToPrefs(
// Convert |server_info_map| to a dictionary Value and add it to
// |http_server_properties_dict|.
base::Value servers_list(base::Value::Type::LIST);
- for (auto map_it = server_info_map.rbegin(); map_it != server_info_map.rend();
- ++map_it) {
- const HttpServerProperties::ServerInfoMapKey key = map_it->first;
- const HttpServerProperties::ServerInfo& server_info = map_it->second;
-
+ for (const auto& [key, server_info] : base::Reversed(server_info_map)) {
// If can't convert the NetworkIsolationKey to a value, don't save to disk.
// Generally happens because the key is for a unique origin.
base::Value network_isolation_key_value;
@@ -844,10 +842,7 @@ void HttpServerPropertiesManager::SaveQuicServerInfoMapToServerPrefs(
if (quic_server_info_map.empty())
return;
base::Value quic_servers_list(base::Value::Type::LIST);
- for (auto it = quic_server_info_map.rbegin();
- it != quic_server_info_map.rend(); ++it) {
- const HttpServerProperties::QuicServerInfoMapKey& key = it->first;
-
+ for (const auto& [key, server_info] : base::Reversed(quic_server_info_map)) {
base::Value network_isolation_key_value;
// Don't save entries with ephemeral NIKs.
if (!key.network_isolation_key.ToValue(&network_isolation_key_value))
@@ -858,7 +853,7 @@ void HttpServerPropertiesManager::SaveQuicServerInfoMapToServerPrefs(
QuicServerIdToString(key.server_id));
quic_server_pref_dict.SetKey(kNetworkIsolationKey,
std::move(network_isolation_key_value));
- quic_server_pref_dict.SetStringKey(kServerInfoKey, it->second);
+ quic_server_pref_dict.SetStringKey(kServerInfoKey, server_info);
quic_servers_list.Append(std::move(quic_server_pref_dict));
}
@@ -886,11 +881,8 @@ void HttpServerPropertiesManager::SaveBrokenAlternativeServicesToPrefs(
std::map<BrokenAlternativeService, size_t> json_list_index_map;
if (!recently_broken_alternative_services.empty()) {
- for (auto it = recently_broken_alternative_services.rbegin();
- it != recently_broken_alternative_services.rend(); ++it) {
- const BrokenAlternativeService& broken_alt_service = it->first;
- int broken_count = it->second;
-
+ for (const auto& [broken_alt_service, broken_count] :
+ base::Reversed(recently_broken_alternative_services)) {
base::Value entry_dict(base::Value::Type::DICTIONARY);
if (!TryAddBrokenAlternativeServiceFieldsToDictionaryValue(
broken_alt_service, &entry_dict)) {