summaryrefslogtreecommitdiffstats
path: root/chrome/browser/io_thread.h
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-28 15:56:41 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-28 15:56:41 +0000
commit2e5b60a280076017d700e56a5cb81ec62149a9bc (patch)
treee1f212d0f3cbdb7c04f4fd8fc67e1fcd26c350da /chrome/browser/io_thread.h
parente04be707101e60bb5512c69a64ce5b64a1c4eeba (diff)
downloadchromium_src-2e5b60a280076017d700e56a5cb81ec62149a9bc.zip
chromium_src-2e5b60a280076017d700e56a5cb81ec62149a9bc.tar.gz
chromium_src-2e5b60a280076017d700e56a5cb81ec62149a9bc.tar.bz2
Have content/ create and destroy its own threads. (Re-land)
Change embedding API and embedders to allow for this. Push inheritance of base::Thread down to content::BrowserThreadImpl so that content::BrowserThread is just a namespace for API functions. This change temporarily disables chrome_frame_net_tests as agreed by the CF lead, see bug 105435. TBR=ben@chromium.org (IWYU change only) BUG=98716,104578,105435 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=111695 Reverted (problems on official bot): r111698 Review URL: http://codereview.chromium.org/8477004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/io_thread.h')
-rw-r--r--chrome/browser/io_thread.h47
1 files changed, 37 insertions, 10 deletions
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index b8be74b..41be0c9 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -9,13 +9,26 @@
#include <string>
#include "base/basictypes.h"
+#include "base/compiler_specific.h"
+#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
#include "chrome/browser/net/ssl_config_service_manager.h"
#include "chrome/browser/prefs/pref_member.h"
-#include "content/browser/browser_process_sub_thread.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/browser_thread_delegate.h"
#include "net/base/network_change_notifier.h"
+// TODO(joi): Remove these in a follow-up change and IWYU in files
+// that were getting them directly or indirectly from here.
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/message_loop.h"
+#include "base/message_loop_proxy.h"
+#include "base/synchronization/lock.h"
+#include "base/threading/thread.h"
+
+class BrowserProcessImpl;
class ChromeNetLog;
class ExtensionEventRouterForwarder;
class MediaInternals;
@@ -43,7 +56,10 @@ class URLRequestContextGetter;
class URLSecurityManager;
} // namespace net
-class IOThread : public content::BrowserProcessSubThread {
+// Contains state associated with, initialized and cleaned up on, and
+// primarily used on, the IO thread. Also acts as a convenience
+// accessor to the Thread object for the IO thread.
+class IOThread : public content::BrowserThreadDelegate {
public:
struct Globals {
Globals();
@@ -109,26 +125,37 @@ class IOThread : public content::BrowserProcessSubThread {
// called on the IO thread.
void ClearHostCache();
- protected:
+ // Convenience method similar to base::Thread, giving access to the
+ // actual IO thread.
+ // TODO(joi): Remove this in follow-up changes.
+ MessageLoop* message_loop() const;
+
+ private:
+ // BrowserThreadDelegate implementation, runs on the IO thread.
+ // This handles initialization and destruction of state that must
+ // live on the IO thread.
virtual void Init() OVERRIDE;
virtual void CleanUp() OVERRIDE;
- private:
// Provide SystemURLRequestContextGetter with access to
// InitSystemRequestContext().
friend class SystemURLRequestContextGetter;
- static void RegisterPrefs(PrefService* local_state);
-
- net::HttpAuthHandlerFactory* CreateDefaultAuthHandlerFactory(
- net::HostResolver* resolver);
-
+ // Global state must be initialized on the IO thread, then this
+ // method must be invoked on the UI thread.
void InitSystemRequestContext();
// Lazy initialization of system request context for
- // SystemURLRequestContextGetter. To be called on IO thread.
+ // SystemURLRequestContextGetter. To be called on IO thread only
+ // after global state has been initialized on the IO thread, and
+ // SystemRequestContext state has been initialized on the UI thread.
void InitSystemRequestContextOnIOThread();
+ static void RegisterPrefs(PrefService* local_state);
+
+ net::HttpAuthHandlerFactory* CreateDefaultAuthHandlerFactory(
+ net::HostResolver* resolver);
+
// Returns an SSLConfigService instance.
net::SSLConfigService* GetSSLConfigService();