OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "mojo/public/utility/bindings_support_impl.h" | 5 #include "mojo/public/utility/bindings_support_impl.h" |
6 | 6 |
7 #include <assert.h> | 7 #include <assert.h> |
8 | 8 |
9 #include "mojo/public/bindings/lib/buffer.h" | 9 #include "mojo/public/bindings/lib/buffer.h" |
10 #include "mojo/public/utility/run_loop.h" | 10 #include "mojo/public/utility/run_loop.h" |
11 #include "mojo/public/utility/run_loop_handler.h" | 11 #include "mojo/public/utility/run_loop_handler.h" |
12 #include "mojo/public/utility/thread_local.h" | 12 #include "mojo/public/utility/thread_local.h" |
13 | 13 |
14 namespace mojo { | 14 namespace mojo { |
15 namespace utility { | |
16 namespace internal { | 15 namespace internal { |
17 namespace { | 16 namespace { |
18 | 17 |
19 ThreadLocalPointer<Buffer>* tls_buffer = NULL; | 18 ThreadLocalPointer<Buffer>* tls_buffer = NULL; |
20 | 19 |
21 // RunLoopHandler implementation used for a request to AsyncWait(). There are | 20 // RunLoopHandler implementation used for a request to AsyncWait(). There are |
22 // two ways RunLoopHandlerImpl is deleted: | 21 // two ways RunLoopHandlerImpl is deleted: |
23 // . when the handle is ready (or errored). | 22 // . when the handle is ready (or errored). |
24 // . when BindingsSupport::CancelWait() is invoked. | 23 // . when BindingsSupport::CancelWait() is invoked. |
25 class RunLoopHandlerImpl : public RunLoopHandler { | 24 class RunLoopHandlerImpl : public RunLoopHandler { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 run_loop->AddHandler(run_loop_handler, handle, flags, | 101 run_loop->AddHandler(run_loop_handler, handle, flags, |
103 MOJO_DEADLINE_INDEFINITE); | 102 MOJO_DEADLINE_INDEFINITE); |
104 return run_loop_handler; | 103 return run_loop_handler; |
105 } | 104 } |
106 | 105 |
107 void BindingsSupportImpl::CancelWait(AsyncWaitID async_wait_id) { | 106 void BindingsSupportImpl::CancelWait(AsyncWaitID async_wait_id) { |
108 delete static_cast<RunLoopHandlerImpl*>(async_wait_id); | 107 delete static_cast<RunLoopHandlerImpl*>(async_wait_id); |
109 } | 108 } |
110 | 109 |
111 } // namespace internal | 110 } // namespace internal |
112 } // namespace utility | |
113 } // namespace mojo | 111 } // namespace mojo |
OLD | NEW |