summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_impl.cc
diff options
context:
space:
mode:
authorrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-18 20:58:01 +0000
committerrvargas@google.com <rvargas@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-18 20:58:01 +0000
commit875ee82945cfb42b16891c2aa5cca7101fc121e4 (patch)
tree87695916e983accc2f7ed06b1339728ffe6d6bb3 /chrome/browser/browser_process_impl.cc
parent03de43e619d7b65ec012e21fbcedd8041be5d776 (diff)
downloadchromium_src-875ee82945cfb42b16891c2aa5cca7101fc121e4.zip
chromium_src-875ee82945cfb42b16891c2aa5cca7101fc121e4.tar.gz
chromium_src-875ee82945cfb42b16891c2aa5cca7101fc121e4.tar.bz2
Create a dedicated cache thread and use it to create the
Http cache. BUG=26730 TEST=none Review URL: http://codereview.chromium.org/1989014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47564 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r--chrome/browser/browser_process_impl.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 9c118bb..f630571 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -78,6 +78,7 @@ BrowserProcessImpl::BrowserProcessImpl(const CommandLine& command_line)
created_file_thread_(false),
created_db_thread_(false),
created_process_launcher_thread_(false),
+ created_cache_thread_(false),
created_profile_manager_(false),
created_local_state_(false),
created_icon_manager_(false),
@@ -155,6 +156,9 @@ BrowserProcessImpl::~BrowserProcessImpl() {
// request before going away.
io_thread_.reset();
+ // The IO thread was the only user of this thread.
+ cache_thread_.reset();
+
// Stop the process launcher thread after the IO thread, in case the IO thread
// posted a task to terminate a process on the process launcher thread.
process_launcher_thread_.reset();
@@ -378,6 +382,19 @@ void BrowserProcessImpl::CreateProcessLauncherThread() {
process_launcher_thread_.swap(thread);
}
+void BrowserProcessImpl::CreateCacheThread() {
+ DCHECK(!created_cache_thread_ && !cache_thread_.get());
+ created_cache_thread_ = true;
+
+ scoped_ptr<base::Thread> thread(
+ new BrowserProcessSubThread(ChromeThread::CACHE));
+ base::Thread::Options options;
+ options.message_loop_type = MessageLoop::TYPE_IO;
+ if (!thread->StartWithOptions(options))
+ return;
+ cache_thread_.swap(thread);
+}
+
void BrowserProcessImpl::CreateProfileManager() {
DCHECK(!created_profile_manager_ && profile_manager_.get() == NULL);
created_profile_manager_ = true;