| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/proxy/proxy_service.h" | 5 #include "net/proxy/proxy_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 // any "previous" configuration. | 295 // any "previous" configuration. |
| 296 if (old_config->is_valid()) | 296 if (old_config->is_valid()) |
| 297 dict->Set("old_config", old_config->ToValue()); | 297 dict->Set("old_config", old_config->ToValue()); |
| 298 dict->Set("new_config", new_config->ToValue()); | 298 dict->Set("new_config", new_config->ToValue()); |
| 299 return std::move(dict); | 299 return std::move(dict); |
| 300 } | 300 } |
| 301 | 301 |
| 302 std::unique_ptr<base::Value> NetLogBadProxyListCallback( | 302 std::unique_ptr<base::Value> NetLogBadProxyListCallback( |
| 303 const ProxyRetryInfoMap* retry_info, | 303 const ProxyRetryInfoMap* retry_info, |
| 304 NetLogCaptureMode /* capture_mode */) { | 304 NetLogCaptureMode /* capture_mode */) { |
| 305 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 305 auto dict = base::MakeUnique<base::DictionaryValue>(); |
| 306 base::ListValue* list = new base::ListValue(); | 306 auto list = base::MakeUnique<base::ListValue>(); |
| 307 | 307 |
| 308 for (ProxyRetryInfoMap::const_iterator iter = retry_info->begin(); | 308 for (ProxyRetryInfoMap::const_iterator iter = retry_info->begin(); |
| 309 iter != retry_info->end(); ++iter) { | 309 iter != retry_info->end(); ++iter) { |
| 310 list->AppendString(iter->first); | 310 list->AppendString(iter->first); |
| 311 } | 311 } |
| 312 dict->Set("bad_proxy_list", list); | 312 dict->Set("bad_proxy_list", std::move(list)); |
| 313 return std::move(dict); | 313 return std::move(dict); |
| 314 } | 314 } |
| 315 | 315 |
| 316 // Returns NetLog parameters on a successfuly proxy resolution. | 316 // Returns NetLog parameters on a successfuly proxy resolution. |
| 317 std::unique_ptr<base::Value> NetLogFinishedResolvingProxyCallback( | 317 std::unique_ptr<base::Value> NetLogFinishedResolvingProxyCallback( |
| 318 const ProxyInfo* result, | 318 const ProxyInfo* result, |
| 319 NetLogCaptureMode /* capture_mode */) { | 319 NetLogCaptureMode /* capture_mode */) { |
| 320 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 320 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 321 dict->SetString("pac_string", result->ToPacString()); | 321 dict->SetString("pac_string", result->ToPacString()); |
| 322 return std::move(dict); | 322 return std::move(dict); |
| (...skipping 1348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 State previous_state = ResetProxyConfig(false); | 1671 State previous_state = ResetProxyConfig(false); |
| 1672 if (previous_state != STATE_NONE) | 1672 if (previous_state != STATE_NONE) |
| 1673 ApplyProxyConfigIfAvailable(); | 1673 ApplyProxyConfigIfAvailable(); |
| 1674 } | 1674 } |
| 1675 | 1675 |
| 1676 void ProxyService::OnDNSChanged() { | 1676 void ProxyService::OnDNSChanged() { |
| 1677 OnIPAddressChanged(); | 1677 OnIPAddressChanged(); |
| 1678 } | 1678 } |
| 1679 | 1679 |
| 1680 } // namespace net | 1680 } // namespace net |
| OLD | NEW |