Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9250)

Unified Diff: chromeos/network/device_state.cc

Issue 2871653002: Remove raw base::DictionaryValue::SetWithoutPathExpansion in //chromeos (Closed)
Patch Set: Minor Fix Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromeos/network/device_state.cc
diff --git a/chromeos/network/device_state.cc b/chromeos/network/device_state.cc
index 9f69f60ba2b7eb7cbda761504d82b075ff9751be..d8b9da82203024c5907e1276fd1997803f6ae5d0 100644
--- a/chromeos/network/device_state.cc
+++ b/chromeos/network/device_state.cc
@@ -5,8 +5,10 @@
#include "chromeos/network/device_state.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/stringprintf.h"
+#include "base/values.h"
#include "chromeos/network/network_event_log.h"
#include "chromeos/network/shill_property_util.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
@@ -30,7 +32,8 @@ DeviceState::~DeviceState() {
bool DeviceState::PropertyChanged(const std::string& key,
const base::Value& value) {
// All property values get stored in |properties_|.
- properties_.SetWithoutPathExpansion(key, value.DeepCopy());
+ properties_.SetWithoutPathExpansion(key,
+ base::MakeUnique<base::Value>(value));
if (ManagedStatePropertyChanged(key, value))
return true;
@@ -122,8 +125,8 @@ void DeviceState::IPConfigPropertiesChanged(
ip_config->Clear();
} else {
NET_LOG_EVENT("IPConfig Added: " + ip_config_path, path());
- ip_config = new base::DictionaryValue;
- ip_configs_.SetWithoutPathExpansion(ip_config_path, ip_config);
+ ip_config = ip_configs_.SetDictionaryWithoutPathExpansion(
+ ip_config_path, base::MakeUnique<base::DictionaryValue>());
}
ip_config->MergeDictionary(&properties);
}
« no previous file with comments | « chromeos/dbus/shill_service_client_unittest.cc ('k') | chromeos/network/managed_network_configuration_handler_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698