Chromium Code Reviews| 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(); |