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

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

Issue 1439053002: Change ProxyResolver::GetProxyForURL() to take a scoped_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Last fixes Created 4 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_V8_TRACING_H_ 5 #ifndef NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_
6 #define NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ 6 #define NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 private: 44 private:
45 DISALLOW_COPY_AND_ASSIGN(Bindings); 45 DISALLOW_COPY_AND_ASSIGN(Bindings);
46 }; 46 };
47 47
48 virtual ~ProxyResolverV8Tracing() {} 48 virtual ~ProxyResolverV8Tracing() {}
49 49
50 // Gets a list of proxy servers to use for |url|. This request always 50 // Gets a list of proxy servers to use for |url|. This request always
51 // runs asynchronously and notifies the result by running |callback|. If the 51 // runs asynchronously and notifies the result by running |callback|. If the
52 // result code is OK then the request was successful and |results| contains 52 // result code is OK then the request was successful and |results| contains
53 // the proxy resolution information. If |request| is non-null, |*request| is 53 // the proxy resolution information. Request can be cancelled by resetting
54 // written to, and can be passed to CancelRequest(). 54 // |*request|.
55 virtual void GetProxyForURL(const GURL& url, 55 virtual void GetProxyForURL(const GURL& url,
56 ProxyInfo* results, 56 ProxyInfo* results,
57 const CompletionCallback& callback, 57 const CompletionCallback& callback,
58 ProxyResolver::RequestHandle* request, 58 scoped_ptr<ProxyResolver::Request>* request,
59 scoped_ptr<Bindings> bindings) = 0; 59 scoped_ptr<Bindings> bindings) = 0;
60
61 // Cancels |request|.
62 virtual void CancelRequest(ProxyResolver::RequestHandle request) = 0;
63
64 // Gets the LoadState for |request|.
65 virtual LoadState GetLoadState(
66 ProxyResolver::RequestHandle request) const = 0;
67 }; 60 };
68 61
69 // A factory for ProxyResolverV8Tracing instances. The default implementation, 62 // A factory for ProxyResolverV8Tracing instances. The default implementation,
70 // returned by Create(), creates ProxyResolverV8Tracing instances that execute 63 // returned by Create(), creates ProxyResolverV8Tracing instances that execute
71 // ProxyResolverV8 on a single helper thread, and do some magic to avoid 64 // ProxyResolverV8 on a single helper thread, and do some magic to avoid
72 // blocking in DNS. For more details see the design document: 65 // blocking in DNS. For more details see the design document:
73 // https://docs.google.com/a/google.com/document/d/16Ij5OcVnR3s0MH4Z5XkhI9VTPoMJ daBn9rKreAmGOdE/edit?pli=1 66 // https://docs.google.com/a/google.com/document/d/16Ij5OcVnR3s0MH4Z5XkhI9VTPoMJ daBn9rKreAmGOdE/edit?pli=1
74 class NET_EXPORT ProxyResolverV8TracingFactory { 67 class NET_EXPORT ProxyResolverV8TracingFactory {
75 public: 68 public:
76 ProxyResolverV8TracingFactory() {} 69 ProxyResolverV8TracingFactory() {}
77 virtual ~ProxyResolverV8TracingFactory() = default; 70 virtual ~ProxyResolverV8TracingFactory() = default;
78 71
79 virtual void CreateProxyResolverV8Tracing( 72 virtual void CreateProxyResolverV8Tracing(
80 const scoped_refptr<ProxyResolverScriptData>& pac_script, 73 const scoped_refptr<ProxyResolverScriptData>& pac_script,
81 scoped_ptr<ProxyResolverV8Tracing::Bindings> bindings, 74 scoped_ptr<ProxyResolverV8Tracing::Bindings> bindings,
82 scoped_ptr<ProxyResolverV8Tracing>* resolver, 75 scoped_ptr<ProxyResolverV8Tracing>* resolver,
83 const CompletionCallback& callback, 76 const CompletionCallback& callback,
84 scoped_ptr<ProxyResolverFactory::Request>* request) = 0; 77 scoped_ptr<ProxyResolverFactory::Request>* request) = 0;
85 78
86 static scoped_ptr<ProxyResolverV8TracingFactory> Create(); 79 static scoped_ptr<ProxyResolverV8TracingFactory> Create();
87 80
88 private: 81 private:
89 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8TracingFactory); 82 DISALLOW_COPY_AND_ASSIGN(ProxyResolverV8TracingFactory);
90 }; 83 };
91 84
92 } // namespace net 85 } // namespace net
93 86
94 #endif // NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_ 87 #endif // NET_PROXY_PROXY_RESOLVER_V8_TRACING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698