Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: base/threading/com_thread_win.cc

Issue 11048029: Allow Thread to initialize COM for Windows consumers who need it (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/threading/com_thread.h ('k') | base/threading/thread.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/threading/com_thread.h"
6
7 namespace base {
8
9 ComThread::ComThread(const char* name, bool use_mta)
10 : Thread(name),
11 use_mta_(use_mta) {
12 }
13
14 ComThread::~ComThread() {
15 Stop();
16 }
17
18 bool ComThread::Start() {
19 if (!use_mta_)
Jamie 2012/10/03 23:46:04 Is this test correct? It's doing the opposite to w
Peter Kasting 2012/10/03 23:47:12 No, it's wrong. Sigh. Thanks :(
20 return Thread::Start();
21
22 // STA COM objects require a UI message loop in order to pump Windows
23 // messages, which they may use for various purposes.
24 Thread::Options thread_options(MessageLoop::TYPE_UI, 0);
25 return StartWithOptions(thread_options);
26 }
27
28 void ComThread::Init() {
29 com_initializer_.reset(use_mta_ ?
30 new win::ScopedCOMInitializer(win::ScopedCOMInitializer::kMTA) :
31 new win::ScopedCOMInitializer());
32 }
33
34 void ComThread::CleanUp() {
35 com_initializer_.reset();
36 }
37
38 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/com_thread.h ('k') | base/threading/thread.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698