OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 MessageReceiver* responder) override; | 82 MessageReceiver* responder) override; |
83 | 83 |
84 // Blocks the current thread until the first incoming method call, i.e., | 84 // Blocks the current thread until the first incoming method call, i.e., |
85 // either a call to a client method or a callback method, or |deadline|. | 85 // either a call to a client method or a callback method, or |deadline|. |
86 bool WaitForIncomingMessage(MojoDeadline deadline) { | 86 bool WaitForIncomingMessage(MojoDeadline deadline) { |
87 DCHECK(thread_checker_.CalledOnValidThread()); | 87 DCHECK(thread_checker_.CalledOnValidThread()); |
88 return connector_.WaitForIncomingMessage(deadline); | 88 return connector_.WaitForIncomingMessage(deadline); |
89 } | 89 } |
90 | 90 |
91 // See Binding for details of pause/resume. | 91 // See Binding for details of pause/resume. |
| 92 // Note: This doesn't strictly pause incoming calls. If there are |
| 93 // queued messages, they may be dispatched during pause. |
92 void PauseIncomingMethodCallProcessing() { | 94 void PauseIncomingMethodCallProcessing() { |
93 DCHECK(thread_checker_.CalledOnValidThread()); | 95 DCHECK(thread_checker_.CalledOnValidThread()); |
94 connector_.PauseIncomingMethodCallProcessing(); | 96 connector_.PauseIncomingMethodCallProcessing(); |
95 } | 97 } |
96 void ResumeIncomingMethodCallProcessing() { | 98 void ResumeIncomingMethodCallProcessing() { |
97 DCHECK(thread_checker_.CalledOnValidThread()); | 99 DCHECK(thread_checker_.CalledOnValidThread()); |
98 connector_.ResumeIncomingMethodCallProcessing(); | 100 connector_.ResumeIncomingMethodCallProcessing(); |
99 } | 101 } |
100 | 102 |
101 // Sets this object to testing mode. | 103 // Sets this object to testing mode. |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 bool encountered_error_; | 170 bool encountered_error_; |
169 base::Closure error_handler_; | 171 base::Closure error_handler_; |
170 base::ThreadChecker thread_checker_; | 172 base::ThreadChecker thread_checker_; |
171 base::WeakPtrFactory<Router> weak_factory_; | 173 base::WeakPtrFactory<Router> weak_factory_; |
172 }; | 174 }; |
173 | 175 |
174 } // namespace internal | 176 } // namespace internal |
175 } // namespace mojo | 177 } // namespace mojo |
176 | 178 |
177 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ | 179 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_ROUTER_H_ |
OLD | NEW |