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

Unified Diff: remoting/base/auto_thread.h

Issue 11348087: Add AutoThread types for Windows that initialize COM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | remoting/base/auto_thread.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/base/auto_thread.h
diff --git a/remoting/base/auto_thread.h b/remoting/base/auto_thread.h
index 4a349766bf082463cb65d9a738974359040d00ff..755df4752d8b87b4eefd3d6b3f19be8026a2323d 100644
--- a/remoting/base/auto_thread.h
+++ b/remoting/base/auto_thread.h
@@ -29,13 +29,25 @@ namespace remoting {
// (3.b) MessageLoop::DestructionObserver::WillDestroyCurrentMessageLoop
class AutoThread : base::PlatformThread::Delegate {
public:
+ // Used to specify the type of MessageLoop to create on the new thread.
+ // On Windows the thread may be intialized for single or multi-threaded COM.
+ enum Type {
Sergey Ulanov 2012/11/16 19:23:33 Do we really need this type? Maybe better to add i
Wez 2012/11/16 19:54:54 This class is already different enough from base::
+ TYPE_DEFAULT,
+ TYPE_IO,
+ TYPE_UI,
+#if defined(OS_WIN)
+ TYPE_UI_COM_STA,
+ TYPE_UI_COM_MTA
alexeypa (please no reviews) 2012/11/16 18:16:09 MTA does not need a message pump AFAIR. It is not
Wez 2012/11/16 19:54:54 Quite right; fixed.
+#endif
+ };
+
// Create an AutoThread with the specified message-loop |type| and |name|.
// The supplied AutoThreadTaskRunner will be used to join and delete the
// new thread when no references to it remain.
static scoped_refptr<AutoThreadTaskRunner> CreateWithType(
alexeypa (please no reviews) 2012/11/16 18:16:09 Add a variant CreateWithTypeAndInitializeCom?
Wez 2012/11/16 19:54:54 If I switch the interface to the ugly init_com_wit
const char* name,
scoped_refptr<AutoThreadTaskRunner> joiner,
- MessageLoop::Type type);
+ Type type);
static scoped_refptr<AutoThreadTaskRunner> Create(
const char* name,
scoped_refptr<AutoThreadTaskRunner> joiner);
@@ -56,7 +68,7 @@ class AutoThread : base::PlatformThread::Delegate {
//
// NOTE: You must not call this MessageLoop's Quit method directly. The
// thread will exit when no references to the TaskRunner remain.
- scoped_refptr<AutoThreadTaskRunner> StartWithType(MessageLoop::Type type);
+ scoped_refptr<AutoThreadTaskRunner> StartWithType(Type type);
// Shorthand for StartWithType(MessageLoop::TYPE_DEFAULT).
scoped_refptr<AutoThreadTaskRunner> Start();
« no previous file with comments | « no previous file | remoting/base/auto_thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698