summaryrefslogtreecommitdiffstats
path: root/net/proxy/sync_host_resolver_bridge.h
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-03 21:00:14 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-03 21:00:14 +0000
commit1ac6af94287a2f821a43003b2be2ba21f319a66d (patch)
tree3398fd0b22e8f9bde49f5aa7f50ff3ab1a42a81c /net/proxy/sync_host_resolver_bridge.h
parentcc204b2cfb421e72bb9d6187fa88cb412576fc94 (diff)
downloadchromium_src-1ac6af94287a2f821a43003b2be2ba21f319a66d.zip
chromium_src-1ac6af94287a2f821a43003b2be2ba21f319a66d.tar.gz
chromium_src-1ac6af94287a2f821a43003b2be2ba21f319a66d.tar.bz2
Make HostResolver NonThreadSafe and not thread safe refcounted.
Required making SyncHostResolverBridge not use RefCountedThreadSafe. I refactored the innards to have a thread safe refcounted Core implementation. BUG=45298 Review URL: http://codereview.chromium.org/2122015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48867 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/sync_host_resolver_bridge.h')
-rw-r--r--net/proxy/sync_host_resolver_bridge.h38
1 files changed, 3 insertions, 35 deletions
diff --git a/net/proxy/sync_host_resolver_bridge.h b/net/proxy/sync_host_resolver_bridge.h
index d082043..4d25b4d 100644
--- a/net/proxy/sync_host_resolver_bridge.h
+++ b/net/proxy/sync_host_resolver_bridge.h
@@ -5,9 +5,7 @@
#ifndef NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_
#define NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_
-#include "base/lock.h"
#include "base/scoped_ptr.h"
-#include "base/waitable_event.h"
#include "net/base/host_resolver.h"
#include "net/proxy/single_threaded_proxy_resolver.h"
@@ -40,39 +38,10 @@ class SyncHostResolverBridge : public HostResolver {
void Shutdown();
private:
- // Called on |host_resolver_loop_|.
- void StartResolve(const HostResolver::RequestInfo& info,
- net::AddressList* addresses);
+ class Core;
- // Called on |host_resolver_loop_|.
- void OnResolveCompletion(int result);
-
- // Returns true if Shutdown() has been called.
- bool HasShutdown() const {
- AutoLock l(lock_);
- return has_shutdown_;
- }
-
- scoped_refptr<HostResolver> host_resolver_;
- MessageLoop* host_resolver_loop_;
-
- // Event to notify completion of resolve request.
- base::WaitableEvent event_;
-
- // Callback for when the resolve completes on host_resolver_loop_.
- net::CompletionCallbackImpl<SyncHostResolverBridge> callback_;
-
- // The result from the current request (set on |host_resolver_loop_|).
- int err_;
-
- // The currently outstanding request to |host_resolver_|, or NULL.
- HostResolver::RequestHandle outstanding_request_;
-
- // True if Shutdown() has been called. Must hold |lock_| to access it.
- bool has_shutdown_;
-
- // Mutex to guard accesses to |has_shutdown_|.
- mutable Lock lock_;
+ MessageLoop* const host_resolver_loop_;
+ scoped_refptr<Core> core_;
};
// Subclass of SingleThreadedProxyResolver that additionally calls
@@ -94,4 +63,3 @@ class SingleThreadedProxyResolverUsingBridgedHostResolver
} // namespace net
#endif // NET_PROXY_SYNC_HOST_RESOLVER_BRIDGE_H_
-