Commit 76a80a33 authored by Tarun Bansal's avatar Tarun Bansal Committed by Commit Bot

Allow network quality prefs in Webview

Change-Id: I6da1c02731a1d7b8498ff27abe58212c2eec9bac
Bug: 1126190
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2417303Reviewed-by: default avatarChangwan Ryu <changwan@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Commit-Queue: Tarun Bansal <tbansal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812384}
parent 5f8cb09e
...@@ -44,6 +44,7 @@ ...@@ -44,6 +44,7 @@
#include "components/variations/service/safe_seed_manager.h" #include "components/variations/service/safe_seed_manager.h"
#include "components/variations/service/variations_service.h" #include "components/variations/service/variations_service.h"
#include "content/public/common/content_switch_dependent_feature_overrides.h" #include "content/public/common/content_switch_dependent_feature_overrides.h"
#include "net/nqe/pref_names.h"
#include "services/preferences/tracked/segregated_pref_store.h" #include "services/preferences/tracked/segregated_pref_store.h"
namespace android_webview { namespace android_webview {
...@@ -80,6 +81,7 @@ const char* const kPersistentPrefsAllowlist[] = { ...@@ -80,6 +81,7 @@ const char* const kPersistentPrefsAllowlist[] = {
// Unsent logs metadata. // Unsent logs metadata.
metrics::prefs::kMetricsInitialLogsMetadata, metrics::prefs::kMetricsInitialLogsMetadata,
metrics::prefs::kMetricsOngoingLogsMetadata, metrics::prefs::kMetricsOngoingLogsMetadata,
net::nqe::kNetworkQualities,
// Current and past country codes, to filter variations studies by country. // Current and past country codes, to filter variations studies by country.
variations::prefs::kVariationsCountry, variations::prefs::kVariationsCountry,
variations::prefs::kVariationsPermanentConsistencyCountry, variations::prefs::kVariationsPermanentConsistencyCountry,
......
...@@ -802,6 +802,8 @@ component("net") { ...@@ -802,6 +802,8 @@ component("net") {
"nqe/observation_buffer.cc", "nqe/observation_buffer.cc",
"nqe/observation_buffer.h", "nqe/observation_buffer.h",
"nqe/peer_to_peer_connections_count_observer.h", "nqe/peer_to_peer_connections_count_observer.h",
"nqe/pref_names.cc",
"nqe/pref_names.h",
"nqe/rtt_throughput_estimates_observer.h", "nqe/rtt_throughput_estimates_observer.h",
"nqe/socket_watcher.cc", "nqe/socket_watcher.cc",
"nqe/socket_watcher.h", "nqe/socket_watcher.h",
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/nqe/pref_names.h"
namespace net {
namespace nqe {
const char kNetworkQualities[] = "net.network_qualities";
} // namespace nqe
} // namespace net
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef NET_NQE_PREF_NAMES_H_
#define NET_NQE_PREF_NAMES_H_
#include "net/base/net_export.h"
namespace net {
namespace nqe {
// Prefs for persisting network qualities.
NET_EXPORT_PRIVATE extern const char kNetworkQualities[];
} // namespace nqe
} // namespace net
#endif // NET_NQE_PREF_NAMES_H_
...@@ -16,12 +16,10 @@ ...@@ -16,12 +16,10 @@
#include "components/prefs/pref_service.h" #include "components/prefs/pref_service.h"
#include "net/http/http_server_properties.h" #include "net/http/http_server_properties.h"
#include "net/nqe/network_quality_estimator.h" #include "net/nqe/network_quality_estimator.h"
#include "net/nqe/pref_names.h"
namespace { namespace {
// Prefs for persisting network qualities.
const char kNetworkQualities[] = "net.network_qualities";
// PrefDelegateImpl writes the provided dictionary value to the network quality // PrefDelegateImpl writes the provided dictionary value to the network quality
// estimator prefs on the disk. // estimator prefs on the disk.
class PrefDelegateImpl class PrefDelegateImpl
...@@ -29,7 +27,7 @@ class PrefDelegateImpl ...@@ -29,7 +27,7 @@ class PrefDelegateImpl
public: public:
// |pref_service| is used to read and write prefs from/to the disk. // |pref_service| is used to read and write prefs from/to the disk.
explicit PrefDelegateImpl(PrefService* pref_service) explicit PrefDelegateImpl(PrefService* pref_service)
: pref_service_(pref_service), path_(kNetworkQualities) { : pref_service_(pref_service), path_(net::nqe::kNetworkQualities) {
DCHECK(pref_service_); DCHECK(pref_service_);
} }
~PrefDelegateImpl() override {} ~PrefDelegateImpl() override {}
...@@ -102,7 +100,7 @@ void NetworkQualitiesPrefDelegate::ClearPrefs() { ...@@ -102,7 +100,7 @@ void NetworkQualitiesPrefDelegate::ClearPrefs() {
// static // static
void NetworkQualitiesPrefDelegate::RegisterPrefs(PrefRegistrySimple* registry) { void NetworkQualitiesPrefDelegate::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterDictionaryPref(kNetworkQualities); registry->RegisterDictionaryPref(net::nqe::kNetworkQualities);
} }
std::map<net::nqe::internal::NetworkID, std::map<net::nqe::internal::NetworkID,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment