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 "jingle/glue/thread_wrapper.h" | 5 #include "jingle/glue/thread_wrapper.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 done_event(base::WaitableEvent::ResetPolicy::MANUAL, | 24 done_event(base::WaitableEvent::ResetPolicy::MANUAL, |
25 base::WaitableEvent::InitialState::NOT_SIGNALED) { | 25 base::WaitableEvent::InitialState::NOT_SIGNALED) { |
26 DCHECK(sending_thread); | 26 DCHECK(sending_thread); |
27 } | 27 } |
28 | 28 |
29 JingleThreadWrapper* sending_thread; | 29 JingleThreadWrapper* sending_thread; |
30 rtc::Message message; | 30 rtc::Message message; |
31 base::WaitableEvent done_event; | 31 base::WaitableEvent done_event; |
32 }; | 32 }; |
33 | 33 |
34 base::LazyInstance<base::ThreadLocalPointer<JingleThreadWrapper> > | 34 base::LazyInstance<base::ThreadLocalPointer<JingleThreadWrapper>>:: |
35 g_jingle_thread_wrapper = LAZY_INSTANCE_INITIALIZER; | 35 DestructorAtExit g_jingle_thread_wrapper = LAZY_INSTANCE_INITIALIZER; |
36 | 36 |
37 // static | 37 // static |
38 void JingleThreadWrapper::EnsureForCurrentMessageLoop() { | 38 void JingleThreadWrapper::EnsureForCurrentMessageLoop() { |
39 if (JingleThreadWrapper::current() == nullptr) { | 39 if (JingleThreadWrapper::current() == nullptr) { |
40 base::MessageLoop* message_loop = base::MessageLoop::current(); | 40 base::MessageLoop* message_loop = base::MessageLoop::current(); |
41 std::unique_ptr<JingleThreadWrapper> wrapper = | 41 std::unique_ptr<JingleThreadWrapper> wrapper = |
42 JingleThreadWrapper::WrapTaskRunner(message_loop->task_runner()); | 42 JingleThreadWrapper::WrapTaskRunner(message_loop->task_runner()); |
43 message_loop->AddDestructionObserver(wrapper.release()); | 43 message_loop->AddDestructionObserver(wrapper.release()); |
44 } | 44 } |
45 | 45 |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 | 325 |
326 void JingleThreadWrapper::Stop() { | 326 void JingleThreadWrapper::Stop() { |
327 NOTREACHED(); | 327 NOTREACHED(); |
328 } | 328 } |
329 | 329 |
330 void JingleThreadWrapper::Run() { | 330 void JingleThreadWrapper::Run() { |
331 NOTREACHED(); | 331 NOTREACHED(); |
332 } | 332 } |
333 | 333 |
334 } // namespace jingle_glue | 334 } // namespace jingle_glue |
OLD | NEW |