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

Side by Side Diff: jingle/glue/thread_wrapper.cc

Issue 2733283002: Require explicit selection of traits for LazyInstance (Closed)
Patch Set: l10n again Created 3 years, 9 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
« no previous file with comments | « ipc/ipc_sync_channel.cc ('k') | mojo/public/cpp/bindings/lib/message.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ipc/ipc_sync_channel.cc ('k') | mojo/public/cpp/bindings/lib/message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698