|
Use unique_ptr<DictionaryValue> in ProxyConfigDictionary
ProxyConfigDictionary uses raw pointers to DictionaryValue to pass
ownership. This CL changes that to unique_ptr:
* to improve code clarity
* to go one step towards removing the obsolete raw-pointer-based
API of base::Value, and
* to fix a leak in ProxyConfigServiceImpl::GetActiveProxyConfigDictionary.
The problem with ProxyConfigServiceImpl::GetActiveProxyConfigDictionary was
the line:
return base::MakeUnique<ProxyConfigDictionary>(
ProxyConfigDictionary::CreateDirect());
In the old code, CreateDirect() would return an owning raw pointer, but
the ProxyConfigDictionary constructor would only make a Value::DeepCopy of
it and let it be, never freeing that memory.
This CL fixes the issue by switching the result of CreateDirect to be a
unique_ptr. One way to do that would to do
return base::MakeUnique<ProxyConfigDictionary>(
ProxyConfigDictionary::CreateDirect().get());
but that would be an unnecessary copy. Instead, this CL added a version
of the ProxyConfigDictionary constructor which accepts a unique_ptr
and avoids the copy. As a side effect, that particular line in
GetActiveProxyConfigDictionary did not have to be changed at all.
BUG= 697817
TBR=bartfab@chromium.org
Review-Url: https://codereview.chromium.org/2785883003
Cr-Commit-Position: refs/heads/master@{#461076}
Committed: https://chromium.googlesource.com/chromium/src/+/6f6e2669be3bd68c883ebe591099a18666a36ba0
Total comments: 6
Total comments: 3
Total comments: 2
Total comments: 2
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+158 lines, -147 lines) |
Patch |
|
M |
chrome/browser/chromeos/arc/intent_helper/arc_settings_service_browsertest.cc
|
View
|
1
2
|
3 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/chromeos/proxy_config_service_impl_unittest.cc
|
View
|
|
1 chunk |
+6 lines, -6 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/proxy/proxy_api.cc
|
View
|
1
2
|
2 chunks |
+6 lines, -4 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/proxy/proxy_api_helpers.h
|
View
|
1
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/proxy/proxy_api_helpers.cc
|
View
|
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/proxy/proxy_api_helpers_unittest.cc
|
View
|
1
2
|
6 chunks |
+17 lines, -16 lines |
0 comments
|
Download
|
|
M |
chrome/browser/extensions/api/proxy/proxy_apitest.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
chrome/browser/prefs/chrome_command_line_pref_store.cc
|
View
|
|
1 chunk |
+7 lines, -9 lines |
0 comments
|
Download
|
|
M |
chrome/browser/prefs/chrome_command_line_pref_store_unittest.cc
|
View
|
1
2
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
chrome/browser/prefs/proxy_policy_unittest.cc
|
View
|
1
2
|
8 chunks |
+12 lines, -8 lines |
0 comments
|
Download
|
|
M |
chrome/browser/ui/webui/options/preferences_browsertest.cc
|
View
|
1
2
3
4
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chromeos/network/onc/onc_translator_shill_to_onc.cc
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chromeos/network/onc/onc_utils.h
|
View
|
1
2
3
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
chromeos/network/onc/onc_utils.cc
|
View
|
1
2
3
|
3 chunks |
+9 lines, -9 lines |
0 comments
|
Download
|
|
M |
chromeos/network/onc/onc_utils_unittest.cc
|
View
|
1
2
3
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
chromeos/network/proxy/proxy_config_handler.cc
|
View
|
1
2
|
3 chunks |
+4 lines, -2 lines |
0 comments
|
Download
|
|
M |
chromeos/network/proxy/proxy_config_service_impl.cc
|
View
|
1
2
|
1 chunk |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
chromeos/network/proxy/ui_proxy_config.h
|
View
|
1
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
chromeos/network/proxy/ui_proxy_config.cc
|
View
|
|
2 chunks |
+3 lines, -2 lines |
0 comments
|
Download
|
|
M |
chromeos/network/proxy/ui_proxy_config_service.cc
|
View
|
1
2
|
2 chunks |
+2 lines, -1 line |
0 comments
|
Download
|
|
M |
components/policy/core/browser/proxy_policy_handler.cc
|
View
|
|
2 chunks |
+10 lines, -12 lines |
2 comments
|
Download
|
|
M |
components/policy/core/browser/proxy_policy_handler_unittest.cc
|
View
|
1
2
|
1 chunk |
+1 line, -1 line |
0 comments
|
Download
|
|
M |
components/proxy_config/pref_proxy_config_tracker_impl.cc
|
View
|
1
2
|
4 chunks |
+6 lines, -5 lines |
0 comments
|
Download
|
|
M |
components/proxy_config/pref_proxy_config_tracker_impl_unittest.cc
|
View
|
|
7 chunks |
+13 lines, -21 lines |
0 comments
|
Download
|
|
M |
components/proxy_config/proxy_config_dictionary.h
|
View
|
1
2
|
3 chunks |
+9 lines, -9 lines |
0 comments
|
Download
|
|
M |
components/proxy_config/proxy_config_dictionary.cc
|
View
|
1
2
|
8 chunks |
+16 lines, -12 lines |
0 comments
|
Download
|
|
M |
components/proxy_config/proxy_config_dictionary_unittest.cc
|
View
|
1
2
|
6 chunks |
+16 lines, -16 lines |
0 comments
|
Download
|
Total messages: 41 (25 generated)
|