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 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 const scoped_refptr<ProxyResolverScriptData>& /*script_data*/, | 209 const scoped_refptr<ProxyResolverScriptData>& /*script_data*/, |
210 const CompletionCallback& /*callback*/) OVERRIDE { | 210 const CompletionCallback& /*callback*/) OVERRIDE { |
211 return ERR_NOT_IMPLEMENTED; | 211 return ERR_NOT_IMPLEMENTED; |
212 } | 212 } |
213 }; | 213 }; |
214 | 214 |
215 // ProxyResolver that simulates a PAC script which returns | 215 // ProxyResolver that simulates a PAC script which returns |
216 // |pac_string| for every single URL. | 216 // |pac_string| for every single URL. |
217 class ProxyResolverFromPacString : public ProxyResolver { | 217 class ProxyResolverFromPacString : public ProxyResolver { |
218 public: | 218 public: |
219 ProxyResolverFromPacString(const std::string& pac_string) | 219 explicit ProxyResolverFromPacString(const std::string& pac_string) |
220 : ProxyResolver(false /*expects_pac_bytes*/), | 220 : ProxyResolver(false /*expects_pac_bytes*/), |
221 pac_string_(pac_string) {} | 221 pac_string_(pac_string) {} |
222 | 222 |
223 virtual int GetProxyForURL(const GURL& url, | 223 virtual int GetProxyForURL(const GURL& url, |
224 ProxyInfo* results, | 224 ProxyInfo* results, |
225 const CompletionCallback& callback, | 225 const CompletionCallback& callback, |
226 RequestHandle* request, | 226 RequestHandle* request, |
227 const BoundNetLog& net_log) OVERRIDE { | 227 const BoundNetLog& net_log) OVERRIDE { |
228 results->UsePacString(pac_string_); | 228 results->UsePacString(pac_string_); |
229 return OK; | 229 return OK; |
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1561 OnCompletion(result_); | 1561 OnCompletion(result_); |
1562 } | 1562 } |
1563 } | 1563 } |
1564 | 1564 |
1565 void SyncProxyServiceHelper::OnCompletion(int rv) { | 1565 void SyncProxyServiceHelper::OnCompletion(int rv) { |
1566 result_ = rv; | 1566 result_ = rv; |
1567 event_.Signal(); | 1567 event_.Signal(); |
1568 } | 1568 } |
1569 | 1569 |
1570 } // namespace net | 1570 } // namespace net |
OLD | NEW |