Index: components/proxy_config/pref_proxy_config_tracker_impl.cc |
diff --git a/components/proxy_config/pref_proxy_config_tracker_impl.cc b/components/proxy_config/pref_proxy_config_tracker_impl.cc |
index 9c8da06904abb0db3520518b0269936b643a4e3a..f8077aa9032038126769864d3a64ebc23e3f82f1 100644 |
--- a/components/proxy_config/pref_proxy_config_tracker_impl.cc |
+++ b/components/proxy_config/pref_proxy_config_tracker_impl.cc |
@@ -6,6 +6,7 @@ |
#include <stddef.h> |
+#include <memory> |
#include <utility> |
#include "base/bind.h" |
@@ -207,8 +208,8 @@ net::ProxyConfigService::ConfigAvailability |
// static |
void PrefProxyConfigTrackerImpl::RegisterPrefs(PrefRegistrySimple* registry) { |
- std::unique_ptr<base::DictionaryValue> default_settings( |
- ProxyConfigDictionary::CreateSystem()); |
+ std::unique_ptr<base::DictionaryValue> default_settings = |
+ ProxyConfigDictionary::CreateSystem(); |
registry->RegisterDictionaryPref(proxy_config::prefs::kProxy, |
std::move(default_settings)); |
} |
@@ -216,8 +217,8 @@ void PrefProxyConfigTrackerImpl::RegisterPrefs(PrefRegistrySimple* registry) { |
// static |
void PrefProxyConfigTrackerImpl::RegisterProfilePrefs( |
user_prefs::PrefRegistrySyncable* pref_service) { |
- std::unique_ptr<base::DictionaryValue> default_settings( |
- ProxyConfigDictionary::CreateSystem()); |
+ std::unique_ptr<base::DictionaryValue> default_settings = |
+ ProxyConfigDictionary::CreateSystem(); |
pref_service->RegisterDictionaryPref(proxy_config::prefs::kProxy, |
std::move(default_settings)); |
pref_service->RegisterBooleanPref(proxy_config::prefs::kUseSharedProxies, |
@@ -239,7 +240,7 @@ ProxyPrefs::ConfigState PrefProxyConfigTrackerImpl::ReadPrefConfig( |
const base::DictionaryValue* dict = |
pref_service->GetDictionary(proxy_config::prefs::kProxy); |
DCHECK(dict); |
- ProxyConfigDictionary proxy_dict(dict); |
+ ProxyConfigDictionary proxy_dict(dict->CreateDeepCopy()); |
if (PrefConfigToNetConfig(proxy_dict, config)) { |
if (!pref->IsUserModifiable() || pref->HasUserSetting()) { |