OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_resolver_mac.h" | 5 #include "net/proxy/proxy_resolver_mac.h" |
6 | 6 |
7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 int GetProxyForURL(const GURL& url, | 73 int GetProxyForURL(const GURL& url, |
74 ProxyInfo* results, | 74 ProxyInfo* results, |
75 const CompletionCallback& callback, | 75 const CompletionCallback& callback, |
76 RequestHandle* request, | 76 RequestHandle* request, |
77 const BoundNetLog& net_log) override; | 77 const BoundNetLog& net_log) override; |
78 | 78 |
79 void CancelRequest(RequestHandle request) override; | 79 void CancelRequest(RequestHandle request) override; |
80 | 80 |
81 LoadState GetLoadState(RequestHandle request) const override; | 81 LoadState GetLoadState(RequestHandle request) const override; |
82 | 82 |
83 void CancelSetPacScript() override; | |
84 | |
85 int SetPacScript(const scoped_refptr<ProxyResolverScriptData>& script_data, | |
86 const CompletionCallback& /*callback*/) override; | |
87 | |
88 private: | 83 private: |
89 const scoped_refptr<ProxyResolverScriptData> script_data_; | 84 const scoped_refptr<ProxyResolverScriptData> script_data_; |
90 }; | 85 }; |
91 | 86 |
92 ProxyResolverMac::ProxyResolverMac( | 87 ProxyResolverMac::ProxyResolverMac( |
93 const scoped_refptr<ProxyResolverScriptData>& script_data) | 88 const scoped_refptr<ProxyResolverScriptData>& script_data) |
94 : ProxyResolver(false /*expects_pac_bytes*/), script_data_(script_data) { | 89 : script_data_(script_data) { |
95 } | 90 } |
96 | 91 |
97 ProxyResolverMac::~ProxyResolverMac() {} | 92 ProxyResolverMac::~ProxyResolverMac() {} |
98 | 93 |
99 // Gets the proxy information for a query URL from a PAC. Implementation | 94 // Gets the proxy information for a query URL from a PAC. Implementation |
100 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/ | 95 // inspired by http://developer.apple.com/samplecode/CFProxySupportTool/ |
101 int ProxyResolverMac::GetProxyForURL(const GURL& query_url, | 96 int ProxyResolverMac::GetProxyForURL(const GURL& query_url, |
102 ProxyInfo* results, | 97 ProxyInfo* results, |
103 const CompletionCallback& /*callback*/, | 98 const CompletionCallback& /*callback*/, |
104 RequestHandle* /*request*/, | 99 RequestHandle* /*request*/, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 203 |
209 void ProxyResolverMac::CancelRequest(RequestHandle request) { | 204 void ProxyResolverMac::CancelRequest(RequestHandle request) { |
210 NOTREACHED(); | 205 NOTREACHED(); |
211 } | 206 } |
212 | 207 |
213 LoadState ProxyResolverMac::GetLoadState(RequestHandle request) const { | 208 LoadState ProxyResolverMac::GetLoadState(RequestHandle request) const { |
214 NOTREACHED(); | 209 NOTREACHED(); |
215 return LOAD_STATE_IDLE; | 210 return LOAD_STATE_IDLE; |
216 } | 211 } |
217 | 212 |
218 void ProxyResolverMac::CancelSetPacScript() { | |
219 NOTREACHED(); | |
220 } | |
221 | |
222 int ProxyResolverMac::SetPacScript( | |
223 const scoped_refptr<ProxyResolverScriptData>& script_data, | |
224 const CompletionCallback& /*callback*/) { | |
225 NOTREACHED(); | |
226 return ERR_NOT_IMPLEMENTED; | |
227 } | |
228 | |
229 } // namespace | 213 } // namespace |
230 | 214 |
231 ProxyResolverFactoryMac::ProxyResolverFactoryMac() | 215 ProxyResolverFactoryMac::ProxyResolverFactoryMac() |
232 : ProxyResolverFactory(false /*expects_pac_bytes*/) { | 216 : ProxyResolverFactory(false /*expects_pac_bytes*/) { |
233 } | 217 } |
234 | 218 |
235 int ProxyResolverFactoryMac::CreateProxyResolver( | 219 int ProxyResolverFactoryMac::CreateProxyResolver( |
236 const scoped_refptr<ProxyResolverScriptData>& pac_script, | 220 const scoped_refptr<ProxyResolverScriptData>& pac_script, |
237 scoped_ptr<ProxyResolver>* resolver, | 221 scoped_ptr<ProxyResolver>* resolver, |
238 const CompletionCallback& callback, | 222 const CompletionCallback& callback, |
239 scoped_ptr<Request>* request) { | 223 scoped_ptr<Request>* request) { |
240 resolver->reset(new ProxyResolverMac(pac_script)); | 224 resolver->reset(new ProxyResolverMac(pac_script)); |
241 return OK; | 225 return OK; |
242 } | 226 } |
243 | 227 |
244 } // namespace net | 228 } // namespace net |
OLD | NEW |