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

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

Issue 939503004: Add LoadState reporting to the mojo proxy resolver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proxy-resolver-mojo
Patch Set: rebase Created 5 years, 9 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/mojo_proxy_resolver_impl_unittest.cc ('k') | net/proxy/proxy_resolver_mojo.cc » ('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/logging.h" 9 #include "base/logging.h"
9 #include "base/memory/ref_counted.h" 10 #include "base/memory/ref_counted.h"
10 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
11 #include "net/base/completion_callback.h" 12 #include "net/base/completion_callback.h"
12 #include "net/base/load_states.h" 13 #include "net/base/load_states.h"
13 #include "net/base/net_export.h" 14 #include "net/base/net_export.h"
14 #include "net/proxy/proxy_resolver_script_data.h" 15 #include "net/proxy/proxy_resolver_script_data.h"
15 #include "url/gurl.h" 16 #include "url/gurl.h"
16 17
17 namespace net { 18 namespace net {
18 19
19 class BoundNetLog; 20 class BoundNetLog;
20 class ProxyInfo; 21 class ProxyInfo;
21 22
22 // Interface for "proxy resolvers". A ProxyResolver fills in a list of proxies 23 // Interface for "proxy resolvers". A ProxyResolver fills in a list of proxies
23 // to use for a particular URL. Generally the backend for a ProxyResolver is 24 // to use for a particular URL. Generally the backend for a ProxyResolver is
24 // 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
25 // requests at a time. 26 // requests at a time.
26 class NET_EXPORT_PRIVATE ProxyResolver { 27 class NET_EXPORT_PRIVATE ProxyResolver {
27 public: 28 public:
28 // Opaque pointer type, to return a handle to cancel outstanding requests. 29 // Opaque pointer type, to return a handle to cancel outstanding requests.
29 typedef void* RequestHandle; 30 typedef void* RequestHandle;
30 31
32 using LoadStateChangedCallback =
33 const base::Callback<void(RequestHandle, LoadState)>;
34
31 // See |expects_pac_bytes()| for the meaning of |expects_pac_bytes|. 35 // See |expects_pac_bytes()| for the meaning of |expects_pac_bytes|.
32 explicit ProxyResolver(bool expects_pac_bytes) 36 explicit ProxyResolver(bool expects_pac_bytes)
33 : expects_pac_bytes_(expects_pac_bytes) {} 37 : expects_pac_bytes_(expects_pac_bytes) {}
34 38
35 virtual ~ProxyResolver() {} 39 virtual ~ProxyResolver() {}
36 40
37 // Gets a list of proxy servers to use for |url|. If the request will 41 // Gets a list of proxy servers to use for |url|. If the request will
38 // complete asynchronously returns ERR_IO_PENDING and notifies the result 42 // complete asynchronously returns ERR_IO_PENDING and notifies the result
39 // by running |callback|. If the result code is OK then 43 // by running |callback|. If the result code is OK then
40 // the request was successful and |results| contains the proxy 44 // the request was successful and |results| contains the proxy
(...skipping 28 matching lines...) Expand all
69 73
70 private: 74 private:
71 const bool expects_pac_bytes_; 75 const bool expects_pac_bytes_;
72 76
73 DISALLOW_COPY_AND_ASSIGN(ProxyResolver); 77 DISALLOW_COPY_AND_ASSIGN(ProxyResolver);
74 }; 78 };
75 79
76 } // namespace net 80 } // namespace net
77 81
78 #endif // NET_PROXY_PROXY_RESOLVER_H_ 82 #endif // NET_PROXY_PROXY_RESOLVER_H_
OLDNEW
« no previous file with comments | « net/proxy/mojo_proxy_resolver_impl_unittest.cc ('k') | net/proxy/proxy_resolver_mojo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698