summaryrefslogtreecommitdiffstats
path: root/chrome/browser/io_thread.h
diff options
context:
space:
mode:
authoreroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-16 23:10:33 +0000
committereroman@chromium.org <eroman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-16 23:10:33 +0000
commit869336177906f183c223f304c8455b424d64b54f (patch)
tree44afa6f07a120acc8c383a857b9e504df74c04ae /chrome/browser/io_thread.h
parent93bd86a6b4678b9dfc5b263107a90131974ef529 (diff)
downloadchromium_src-869336177906f183c223f304c8455b424d64b54f.zip
chromium_src-869336177906f183c223f304c8455b424d64b54f.tar.gz
chromium_src-869336177906f183c223f304c8455b424d64b54f.tar.bz2
Cleanup: Move the ProxyScriptFetcher registry from being a global in net, to living in IOThread.
I had to make some other changes to make this fit well: moved ProxyScriptFetcherImpl to its own set of files, and added a IOThread::Get() accessor to avoid plumbing through several layers in connection_tester. I find the registry living in IOThread is preferable, as globals in net/ limit the ability to run on safely on multiple threads, and also leads to confusion on what needs to be called at shutdown. Review URL: http://codereview.chromium.org/3823001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62876 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/io_thread.h')
-rw-r--r--chrome/browser/io_thread.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index 79891c9..2baec87 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -6,6 +6,8 @@
#define CHROME_BROWSER_IO_THREAD_H_
#pragma once
+#include <set>
+
#include "base/basictypes.h"
#include "base/ref_counted.h"
#include "base/scoped_ptr.h"
@@ -16,6 +18,7 @@
class ChromeNetLog;
class ListValue;
+class URLRequestContext;
namespace chrome_browser_net {
class ConnectInterceptor;
@@ -26,6 +29,7 @@ namespace net {
class DnsRRResolver;
class HostResolver;
class HttpAuthHandlerFactory;
+class ProxyScriptFetcher;
class URLSecurityManager;
} // namespace net
@@ -66,12 +70,22 @@ class IOThread : public BrowserProcessSubThread {
// IOThread's message loop.
void ChangedToOnTheRecord();
+ // Creates a ProxyScriptFetcherImpl which will be automatically aborted
+ // during shutdown.
+ // This is used to avoid cycles between the ProxyScriptFetcher and the
+ // URLRequestContext that owns it (indirectly via the ProxyService).
+ net::ProxyScriptFetcher* CreateAndRegisterProxyScriptFetcher(
+ URLRequestContext* url_request_context);
+
protected:
virtual void Init();
virtual void CleanUp();
virtual void CleanUpAfterMessageLoopDestruction();
private:
+ class ManagedProxyScriptFetcher;
+ typedef std::set<ManagedProxyScriptFetcher*> ProxyScriptFetchers;
+
net::HttpAuthHandlerFactory* CreateDefaultAuthHandlerFactory(
net::HostResolver* resolver);
@@ -115,6 +129,9 @@ class IOThread : public BrowserProcessSubThread {
chrome_browser_net::ConnectInterceptor* speculative_interceptor_;
chrome_browser_net::Predictor* predictor_;
+ // List of live ProxyScriptFetchers.
+ ProxyScriptFetchers fetchers_;
+
DISALLOW_COPY_AND_ASSIGN(IOThread);
};