OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "remoting/base/auto_thread.h" | 5 #include "remoting/base/auto_thread.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
10 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 10 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 #if defined(OS_WIN) | 24 #if defined(OS_WIN) |
25 scoped_ptr<base::win::ScopedCOMInitializer> CreateComInitializer( | 25 scoped_ptr<base::win::ScopedCOMInitializer> CreateComInitializer( |
26 AutoThread::ComInitType type) { | 26 AutoThread::ComInitType type) { |
27 scoped_ptr<base::win::ScopedCOMInitializer> initializer; | 27 scoped_ptr<base::win::ScopedCOMInitializer> initializer; |
28 if (type == AutoThread::COM_INIT_MTA) { | 28 if (type == AutoThread::COM_INIT_MTA) { |
29 initializer.reset(new base::win::ScopedCOMInitializer( | 29 initializer.reset(new base::win::ScopedCOMInitializer( |
30 base::win::ScopedCOMInitializer::kMTA)); | 30 base::win::ScopedCOMInitializer::kMTA)); |
31 } else if (type == AutoThread::COM_INIT_STA) { | 31 } else if (type == AutoThread::COM_INIT_STA) { |
32 initializer.reset(new base::win::ScopedCOMInitializer()); | 32 initializer.reset(new base::win::ScopedCOMInitializer()); |
33 } | 33 } |
34 return initializer.Pass(); | 34 return initializer; |
35 } | 35 } |
36 #endif | 36 #endif |
37 | 37 |
38 } | 38 } |
39 | 39 |
40 // Used to pass data to ThreadMain. This structure is allocated on the stack | 40 // Used to pass data to ThreadMain. This structure is allocated on the stack |
41 // from within StartWithType. | 41 // from within StartWithType. |
42 struct AutoThread::StartupData { | 42 struct AutoThread::StartupData { |
43 // Fields describing the desired thread behaviour. | 43 // Fields describing the desired thread behaviour. |
44 base::MessageLoop::Type loop_type; | 44 base::MessageLoop::Type loop_type; |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 CreateComInitializer(com_init_type_)); | 206 CreateComInitializer(com_init_type_)); |
207 #endif | 207 #endif |
208 | 208 |
209 message_loop.Run(); | 209 message_loop.Run(); |
210 | 210 |
211 // Assert that MessageLoop::QuitWhenIdle was called by AutoThread::QuitThread. | 211 // Assert that MessageLoop::QuitWhenIdle was called by AutoThread::QuitThread. |
212 DCHECK(was_quit_properly_); | 212 DCHECK(was_quit_properly_); |
213 } | 213 } |
214 | 214 |
215 } // namespace base | 215 } // namespace base |
OLD | NEW |