diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-23 04:33:52 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-23 04:33:52 +0000 |
commit | 458e9521995681381912ece90eb2a8ea210ae07d (patch) | |
tree | d5eeabdee1104f65f42990bbd7edc238a57480d5 /chrome_frame/urlmon_url_request.cc | |
parent | 1822c9949f19195ca0000f0be929a5398a7c24e6 (diff) | |
download | chromium_src-458e9521995681381912ece90eb2a8ea210ae07d.zip chromium_src-458e9521995681381912ece90eb2a8ea210ae07d.tar.gz chromium_src-458e9521995681381912ece90eb2a8ea210ae07d.tar.bz2 |
Add methods to base::Thread to allow Windows consumers to ask for COM to be intialized on the Thread.
This makes one functional change: when COM is initialized in STA mode, the Thread is forced to use a TYPE_UI message loop. Most of the modified consumers here didn't previously do that, but after discussion with cpu and siggi, it seems safest, even though it's more heavyweight.
BUG=none
TEST=none
Review URL: https://codereview.chromium.org/11048029
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163503 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request.cc')
-rw-r--r-- | chrome_frame/urlmon_url_request.cc | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index 535debb..6d33e551 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -15,6 +15,7 @@ #include "base/string_number_conversions.h" #include "base/stringprintf.h" #include "base/threading/platform_thread.h" +#include "base/threading/thread.h" #include "base/utf_string_conversions.h" #include "chrome/common/automation_messages.h" #include "chrome_frame/bind_context_info.h" @@ -1401,8 +1402,8 @@ UrlmonUrlRequestManager::UrlmonUrlRequestManager() privileged_mode_(false), container_(NULL), background_worker_thread_enabled_(true) { - background_thread_.reset(new ResourceFetcherThread( - "cf_iexplore_background_thread")); + background_thread_.reset(new base::Thread("cf_iexplore_background_thread")); + background_thread_->init_com_with_mta(false); background_worker_thread_enabled_ = GetConfigBool(true, kUseBackgroundThreadForSubResources); if (background_worker_thread_enabled_) { @@ -1445,19 +1446,3 @@ void UrlmonUrlRequestManager::AddPrivacyDataForUrl( 0); } } - -UrlmonUrlRequestManager::ResourceFetcherThread::ResourceFetcherThread( - const char* name) : base::Thread(name) { -} - -UrlmonUrlRequestManager::ResourceFetcherThread::~ResourceFetcherThread() { - Stop(); -} - -void UrlmonUrlRequestManager::ResourceFetcherThread::Init() { - com_initializer_.reset(new base::win::ScopedCOMInitializer()); -} - -void UrlmonUrlRequestManager::ResourceFetcherThread::CleanUp() { - com_initializer_.reset(); -} |