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

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
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 bool ComThread::Start() {
10 if (!use_mta_)
11 return Thread::Start();
12
13 // STA COM objects require a UI message loop in order to pump Windows
14 // messages, which they may use for various purposes.
15 Thread::Options thread_options(MessageLoop::TYPE_UI, 0);
16 return StartWithOptions(thread_options);
17 }
18
19 void ComThread::Init() {
20 com_initializer_.reset(use_mta_ ?
21 new win::ScopedCOMInitializer(win::ScopedCOMInitializer::kMTA) :
22 new win::ScopedCOMInitializer());
23 }
24
25 void ComThread::CleanUp() {
26 com_initializer_.reset();
27 }
28
29 } // namespace base
OLDNEW
« no previous file with comments | « base/threading/com_thread.h ('k') | base/threading/thread.h » ('j') | chrome_frame/utils.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698