OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 | 695 |
696 int ProxyService::DidFinishResolvingProxy(ProxyInfo* result, | 696 int ProxyService::DidFinishResolvingProxy(ProxyInfo* result, |
697 int result_code, | 697 int result_code, |
698 const BoundNetLog& net_log) { | 698 const BoundNetLog& net_log) { |
699 // Log the result of the proxy resolution. | 699 // Log the result of the proxy resolution. |
700 if (result_code == OK) { | 700 if (result_code == OK) { |
701 // When logging all events is enabled, dump the proxy list. | 701 // When logging all events is enabled, dump the proxy list. |
702 if (net_log.IsLoggingAllEvents()) { | 702 if (net_log.IsLoggingAllEvents()) { |
703 net_log.AddEvent( | 703 net_log.AddEvent( |
704 NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST, | 704 NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST, |
705 new NetLogStringParameter("pac_string", result->ToPacString())); | 705 make_scoped_refptr(new NetLogStringParameter( |
| 706 "pac_string", result->ToPacString()))); |
706 } | 707 } |
707 result->DeprioritizeBadProxies(proxy_retry_info_); | 708 result->DeprioritizeBadProxies(proxy_retry_info_); |
708 } else { | 709 } else { |
709 net_log.AddEvent( | 710 net_log.AddEvent( |
710 NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST, | 711 NetLog::TYPE_PROXY_SERVICE_RESOLVED_PROXY_LIST, |
711 new NetLogIntegerParameter("net_error", result_code)); | 712 make_scoped_refptr(new NetLogIntegerParameter( |
| 713 "net_error", result_code))); |
712 | 714 |
713 // Fall-back to direct when the proxy resolver fails. This corresponds | 715 // Fall-back to direct when the proxy resolver fails. This corresponds |
714 // with a javascript runtime error in the PAC script. | 716 // with a javascript runtime error in the PAC script. |
715 // | 717 // |
716 // This implicit fall-back to direct matches Firefox 3.5 and | 718 // This implicit fall-back to direct matches Firefox 3.5 and |
717 // Internet Explorer 8. For more information, see: | 719 // Internet Explorer 8. For more information, see: |
718 // | 720 // |
719 // http://www.chromium.org/developers/design-documents/proxy-settings-fallba
ck | 721 // http://www.chromium.org/developers/design-documents/proxy-settings-fallba
ck |
720 result->UseDirect(); | 722 result->UseDirect(); |
721 result_code = OK; | 723 result_code = OK; |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 OnCompletion(result_); | 938 OnCompletion(result_); |
937 } | 939 } |
938 } | 940 } |
939 | 941 |
940 void SyncProxyServiceHelper::OnCompletion(int rv) { | 942 void SyncProxyServiceHelper::OnCompletion(int rv) { |
941 result_ = rv; | 943 result_ = rv; |
942 event_.Signal(); | 944 event_.Signal(); |
943 } | 945 } |
944 | 946 |
945 } // namespace net | 947 } // namespace net |
OLD | NEW |