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

Unified Diff: components/proxy_config/proxy_config_dictionary.h

Issue 2785883003: Use unique_ptr<DictionaryValue> in ProxyConfigDictionary (Closed)
Patch Set: 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: components/proxy_config/proxy_config_dictionary.h
diff --git a/components/proxy_config/proxy_config_dictionary.h b/components/proxy_config/proxy_config_dictionary.h
index 1faa121a392dba5ab9402874799120bab38510ca..447f8d8dd658bdd727d82d70eff8a09ab0c4102b 100644
--- a/components/proxy_config/proxy_config_dictionary.h
+++ b/components/proxy_config/proxy_config_dictionary.h
@@ -31,6 +31,7 @@ class ProxyServer;
// See proxy_config_dictionary.cc for the structure of the respective strings.
class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
public:
+ explicit ProxyConfigDictionary(std::unique_ptr<base::DictionaryValue> dict);
// Creates a deep copy of |dict| and leaves ownership to caller.
explicit ProxyConfigDictionary(const base::DictionaryValue* dict);
~ProxyConfigDictionary();
@@ -44,14 +45,15 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
const base::DictionaryValue& GetDictionary() const;
- static base::DictionaryValue* CreateDirect();
- static base::DictionaryValue* CreateAutoDetect();
- static base::DictionaryValue* CreatePacScript(const std::string& pac_url,
- bool pac_mandatory);
- static base::DictionaryValue* CreateFixedServers(
+ static std::unique_ptr<base::DictionaryValue> CreateDirect();
+ static std::unique_ptr<base::DictionaryValue> CreateAutoDetect();
+ static std::unique_ptr<base::DictionaryValue> CreatePacScript(
+ const std::string& pac_url,
+ bool pac_mandatory);
+ static std::unique_ptr<base::DictionaryValue> CreateFixedServers(
const std::string& proxy_server,
const std::string& bypass_list);
- static base::DictionaryValue* CreateSystem();
+ static std::unique_ptr<base::DictionaryValue> CreateSystem();
// Encodes the proxy server as "<url-scheme>=<proxy-scheme>://<proxy>".
// Used to generate the |proxy_server| arg for CreateFixedServers().
@@ -60,7 +62,7 @@ class PROXY_CONFIG_EXPORT ProxyConfigDictionary {
std::string* spec);
private:
- static base::DictionaryValue* CreateDictionary(
+ static std::unique_ptr<base::DictionaryValue> CreateDictionary(
ProxyPrefs::ProxyMode mode,
const std::string& pac_url,
bool pac_mandatory,

Powered by Google App Engine
This is Rietveld 408576698