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

Unified Diff: chromeos/network/device_state.cc

Issue 2843813002: Remove SetWithoutPathExpansion (Closed)
Patch Set: Fix CrOS Error Created 3 years, 8 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..942283c15db60b18d4da319b7453a94a2ad956aa 100644
--- a/chromeos/network/device_state.cc
+++ b/chromeos/network/device_state.cc
@@ -5,6 +5,7 @@
#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 "chromeos/network/network_event_log.h"
@@ -30,7 +31,7 @@ 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, value.CreateDeepCopy());
if (ManagedStatePropertyChanged(key, value))
return true;
@@ -122,8 +123,9 @@ 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_configs_.SetWithoutPathExpansion(
+ ip_config_path, base::MakeUnique<base::DictionaryValue>());
+ ip_configs_.GetDictionaryWithoutPathExpansion(ip_config_path, &ip_config);
}
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