| 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 859 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 870 this, &SyncProxyServiceHelper::StartAsyncReconsider, url, net_log)); | 870 this, &SyncProxyServiceHelper::StartAsyncReconsider, url, net_log)); |
| 871 | 871 |
| 872 event_.Wait(); | 872 event_.Wait(); |
| 873 | 873 |
| 874 if (result_ == net::OK) { | 874 if (result_ == net::OK) { |
| 875 *proxy_info = proxy_info_; | 875 *proxy_info = proxy_info_; |
| 876 } | 876 } |
| 877 return result_; | 877 return result_; |
| 878 } | 878 } |
| 879 | 879 |
| 880 SyncProxyServiceHelper::~SyncProxyServiceHelper() {} |
| 881 |
| 880 void SyncProxyServiceHelper::StartAsyncResolve(const GURL& url, | 882 void SyncProxyServiceHelper::StartAsyncResolve(const GURL& url, |
| 881 const BoundNetLog& net_log) { | 883 const BoundNetLog& net_log) { |
| 882 result_ = proxy_service_->ResolveProxy( | 884 result_ = proxy_service_->ResolveProxy( |
| 883 url, &proxy_info_, &callback_, NULL, net_log); | 885 url, &proxy_info_, &callback_, NULL, net_log); |
| 884 if (result_ != net::ERR_IO_PENDING) { | 886 if (result_ != net::ERR_IO_PENDING) { |
| 885 OnCompletion(result_); | 887 OnCompletion(result_); |
| 886 } | 888 } |
| 887 } | 889 } |
| 888 | 890 |
| 889 void SyncProxyServiceHelper::StartAsyncReconsider(const GURL& url, | 891 void SyncProxyServiceHelper::StartAsyncReconsider(const GURL& url, |
| 890 const BoundNetLog& net_log) { | 892 const BoundNetLog& net_log) { |
| 891 result_ = proxy_service_->ReconsiderProxyAfterError( | 893 result_ = proxy_service_->ReconsiderProxyAfterError( |
| 892 url, &proxy_info_, &callback_, NULL, net_log); | 894 url, &proxy_info_, &callback_, NULL, net_log); |
| 893 if (result_ != net::ERR_IO_PENDING) { | 895 if (result_ != net::ERR_IO_PENDING) { |
| 894 OnCompletion(result_); | 896 OnCompletion(result_); |
| 895 } | 897 } |
| 896 } | 898 } |
| 897 | 899 |
| 898 void SyncProxyServiceHelper::OnCompletion(int rv) { | 900 void SyncProxyServiceHelper::OnCompletion(int rv) { |
| 899 result_ = rv; | 901 result_ = rv; |
| 900 event_.Signal(); | 902 event_.Signal(); |
| 901 } | 903 } |
| 902 | 904 |
| 903 } // namespace net | 905 } // namespace net |
| OLD | NEW |