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/cpp/bindings/lib/connector.h" | 5 #include "mojo/public/cpp/bindings/lib/connector.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 void Connector::ResumeIncomingMethodCallProcessing() { | 126 void Connector::ResumeIncomingMethodCallProcessing() { |
127 DCHECK(thread_checker_.CalledOnValidThread()); | 127 DCHECK(thread_checker_.CalledOnValidThread()); |
128 | 128 |
129 if (!paused_) | 129 if (!paused_) |
130 return; | 130 return; |
131 | 131 |
132 paused_ = false; | 132 paused_ = false; |
133 WaitToReadMore(); | 133 WaitToReadMore(); |
134 } | 134 } |
135 | 135 |
| 136 void Connector::SetAllowSyncDispatch(bool allowed) { |
| 137 DCHECK(thread_checker_.CalledOnValidThread()); |
| 138 handle_watcher_.SetAllowSyncDispatch(allowed); |
| 139 } |
| 140 |
136 bool Connector::Accept(Message* message) { | 141 bool Connector::Accept(Message* message) { |
137 DCHECK(lock_ || thread_checker_.CalledOnValidThread()); | 142 DCHECK(lock_ || thread_checker_.CalledOnValidThread()); |
138 | 143 |
139 // It shouldn't hurt even if |error_| may be changed by a different thread at | 144 // It shouldn't hurt even if |error_| may be changed by a different thread at |
140 // the same time. The outcome is that we may write into |message_pipe_| after | 145 // the same time. The outcome is that we may write into |message_pipe_| after |
141 // encountering an error, which should be fine. | 146 // encountering an error, which should be fine. |
142 if (error_) | 147 if (error_) |
143 return false; | 148 return false; |
144 | 149 |
145 MayAutoLock locker(lock_.get()); | 150 MayAutoLock locker(lock_.get()); |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 if (!paused_) | 400 if (!paused_) |
396 WaitToReadMore(); | 401 WaitToReadMore(); |
397 } else { | 402 } else { |
398 error_ = true; | 403 error_ = true; |
399 connection_error_handler_.Run(); | 404 connection_error_handler_.Run(); |
400 } | 405 } |
401 } | 406 } |
402 | 407 |
403 } // namespace internal | 408 } // namespace internal |
404 } // namespace mojo | 409 } // namespace mojo |
OLD | NEW |