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

Unified Diff: net/proxy/proxy_resolver_factory.h

Issue 1102463002: Add a MockAsyncProxyResolverFactory and update some tests to use it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@proxy-factory-refactor
Patch Set: rebase Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver_unittest.cc ('k') | net/proxy/proxy_resolver_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_resolver_factory.h
diff --git a/net/proxy/proxy_resolver_factory.h b/net/proxy/proxy_resolver_factory.h
index 67a591c02acab2a5f8bdcd3f1d6a352bcc3aa45c..9bfd618122002f9d08331d541101e57c7796ff08 100644
--- a/net/proxy/proxy_resolver_factory.h
+++ b/net/proxy/proxy_resolver_factory.h
@@ -5,6 +5,8 @@
#ifndef NET_PROXY_PROXY_RESOLVER_FACTORY_H_
#define NET_PROXY_PROXY_RESOLVER_FACTORY_H_
+#include <set>
+
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
@@ -33,7 +35,8 @@ class NET_EXPORT ProxyResolverFactory {
// it returns ERR_IO_PENDING and notifies the result by running |callback|.
// If the result is OK, then |resolver| contains the ProxyResolver. In the
// case of asynchronous completion |*request| is written to, and can be
- // deleted to cancel the request.
+ // deleted to cancel the request. All requests in progress are cancelled if
+ // the ProxyResolverFactory is deleted.
virtual int CreateProxyResolver(
const scoped_refptr<ProxyResolverScriptData>& pac_script,
scoped_ptr<ProxyResolver>* resolver,
@@ -65,6 +68,13 @@ class NET_EXPORT LegacyProxyResolverFactory : public ProxyResolverFactory {
scoped_ptr<Request>* request) override;
virtual scoped_ptr<ProxyResolver> CreateProxyResolver() = 0;
+
+ private:
+ class Job;
+
+ void RemoveJob(Job* job);
+
+ std::set<Job*> jobs_;
};
} // namespace net
« no previous file with comments | « net/proxy/multi_threaded_proxy_resolver_unittest.cc ('k') | net/proxy/proxy_resolver_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698