Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(690)

Side by Side Diff: net/proxy/proxy_resolver.h

Issue 1157163003: Remove ProxyResolver::(Cancel)SetPacScript and LegacyProxyResolverFactory. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v8-proxy-resolver-refactor
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver_unittest.cc ('k') | net/proxy/proxy_resolver_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef NET_PROXY_PROXY_RESOLVER_H_ 5 #ifndef NET_PROXY_PROXY_RESOLVER_H_
6 #define NET_PROXY_PROXY_RESOLVER_H_ 6 #define NET_PROXY_PROXY_RESOLVER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
(...skipping 14 matching lines...) Expand all
25 // a PAC script, but it doesn't need to be. ProxyResolver can service multiple 25 // a PAC script, but it doesn't need to be. ProxyResolver can service multiple
26 // requests at a time. 26 // requests at a time.
27 class NET_EXPORT_PRIVATE ProxyResolver { 27 class NET_EXPORT_PRIVATE ProxyResolver {
28 public: 28 public:
29 // Opaque pointer type, to return a handle to cancel outstanding requests. 29 // Opaque pointer type, to return a handle to cancel outstanding requests.
30 typedef void* RequestHandle; 30 typedef void* RequestHandle;
31 31
32 using LoadStateChangedCallback = 32 using LoadStateChangedCallback =
33 base::Callback<void(RequestHandle, LoadState)>; 33 base::Callback<void(RequestHandle, LoadState)>;
34 34
35 // See |expects_pac_bytes()| for the meaning of |expects_pac_bytes|. 35 ProxyResolver() {}
36 explicit ProxyResolver(bool expects_pac_bytes)
37 : expects_pac_bytes_(expects_pac_bytes) {}
38 36
39 virtual ~ProxyResolver() {} 37 virtual ~ProxyResolver() {}
40 38
41 // Gets a list of proxy servers to use for |url|. If the request will 39 // Gets a list of proxy servers to use for |url|. If the request will
42 // complete asynchronously returns ERR_IO_PENDING and notifies the result 40 // complete asynchronously returns ERR_IO_PENDING and notifies the result
43 // by running |callback|. If the result code is OK then 41 // by running |callback|. If the result code is OK then
44 // the request was successful and |results| contains the proxy 42 // the request was successful and |results| contains the proxy
45 // resolution information. In the case of asynchronous completion 43 // resolution information. In the case of asynchronous completion
46 // |*request| is written to, and can be passed to CancelRequest(). 44 // |*request| is written to, and can be passed to CancelRequest().
47 virtual int GetProxyForURL(const GURL& url, 45 virtual int GetProxyForURL(const GURL& url,
48 ProxyInfo* results, 46 ProxyInfo* results,
49 const CompletionCallback& callback, 47 const CompletionCallback& callback,
50 RequestHandle* request, 48 RequestHandle* request,
51 const BoundNetLog& net_log) = 0; 49 const BoundNetLog& net_log) = 0;
52 50
53 // Cancels |request|. 51 // Cancels |request|.
54 virtual void CancelRequest(RequestHandle request) = 0; 52 virtual void CancelRequest(RequestHandle request) = 0;
55 53
56 // Gets the LoadState for |request|. 54 // Gets the LoadState for |request|.
57 virtual LoadState GetLoadState(RequestHandle request) const = 0; 55 virtual LoadState GetLoadState(RequestHandle request) const = 0;
58 56
59 // The PAC script backend can be specified to the ProxyResolver either via
60 // URL, or via the javascript text itself. If |expects_pac_bytes| is true,
61 // then the ProxyResolverScriptData passed to SetPacScript() should
62 // contain the actual script bytes rather than just the URL.
63 bool expects_pac_bytes() const { return expects_pac_bytes_; }
64
65 virtual void CancelSetPacScript() = 0;
66
67 // Called to set the PAC script backend to use.
68 // Returns ERR_IO_PENDING in the case of asynchronous completion, and notifies
69 // the result through |callback|.
70 virtual int SetPacScript(
71 const scoped_refptr<ProxyResolverScriptData>& pac_script,
72 const CompletionCallback& callback) = 0;
73
74 private: 57 private:
75 const bool expects_pac_bytes_;
76
77 DISALLOW_COPY_AND_ASSIGN(ProxyResolver); 58 DISALLOW_COPY_AND_ASSIGN(ProxyResolver);
78 }; 59 };
79 60
80 } // namespace net 61 } // namespace net
81 62
82 #endif // NET_PROXY_PROXY_RESOLVER_H_ 63 #endif // NET_PROXY_PROXY_RESOLVER_H_
OLDNEW
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver_unittest.cc ('k') | net/proxy/proxy_resolver_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698