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

Unified Diff: chromeos/network/proxy/proxy_config_handler.cc

Issue 2785883003: Use unique_ptr<DictionaryValue> in ProxyConfigDictionary (Closed)
Patch Set: Fix compilation Created 3 years, 9 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/proxy/proxy_config_handler.cc
diff --git a/chromeos/network/proxy/proxy_config_handler.cc b/chromeos/network/proxy/proxy_config_handler.cc
index ed96a8b3889022971b3251e793b1803ef72b1925..f12cbf4c2f96ea5c597b4983f8488fb67644f824 100644
--- a/chromeos/network/proxy/proxy_config_handler.cc
+++ b/chromeos/network/proxy/proxy_config_handler.cc
@@ -4,6 +4,8 @@
#include "chromeos/network/proxy/proxy_config_handler.h"
+#include <utility>
+
#include "base/bind.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
@@ -60,7 +62,7 @@ std::unique_ptr<ProxyConfigDictionary> GetProxyConfigForNetwork(
std::unique_ptr<base::DictionaryValue> proxy_dict =
onc::ConvertOncProxySettingsToProxyConfig(*proxy_policy);
- return base::MakeUnique<ProxyConfigDictionary>(proxy_dict.get());
+ return base::MakeUnique<ProxyConfigDictionary>(std::move(proxy_dict));
}
if (network.profile_path().empty())
@@ -90,7 +92,7 @@ std::unique_ptr<ProxyConfigDictionary> GetProxyConfigForNetwork(
const base::DictionaryValue& value = network.proxy_config();
if (value.empty())
return std::unique_ptr<ProxyConfigDictionary>();
- return base::MakeUnique<ProxyConfigDictionary>(&value);
+ return base::MakeUnique<ProxyConfigDictionary>(value.CreateDeepCopy());
}
void SetProxyConfigForNetwork(const ProxyConfigDictionary& proxy_config,

Powered by Google App Engine
This is Rietveld 408576698