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

Unified Diff: chromeos/network/policy_util.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/policy_util.cc
diff --git a/chromeos/network/policy_util.cc b/chromeos/network/policy_util.cc
index ebea93e02b28221da0e237f715118fb0890355af..a895881e52d80ea70a7e5530b28f67a8f324349f 100644
--- a/chromeos/network/policy_util.cc
+++ b/chromeos/network/policy_util.cc
@@ -7,6 +7,7 @@
#include <utility>
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "chromeos/network/network_profile.h"
#include "chromeos/network/network_ui_data.h"
@@ -164,8 +165,9 @@ base::DictionaryValue* GetOrCreateDictionary(const std::string& key,
base::DictionaryValue* dict) {
base::DictionaryValue* inner_dict = NULL;
if (!dict->GetDictionaryWithoutPathExpansion(key, &inner_dict)) {
- inner_dict = new base::DictionaryValue;
- dict->SetWithoutPathExpansion(key, inner_dict);
+ dict->SetWithoutPathExpansion(key,
+ base::MakeUnique<base::DictionaryValue>());
+ dict->GetDictionaryWithoutPathExpansion(key, &inner_dict);
}
return inner_dict;
}
« no previous file with comments | « chromeos/network/onc/onc_utils.cc ('k') | components/content_settings/core/browser/content_settings_pref.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698