Chromium Code Reviews| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "mojo/public/cpp/bindings/error_handler.h" | 9 #include "mojo/public/cpp/bindings/error_handler.h" |
| 10 #include "mojo/public/cpp/environment/logging.h" | 10 #include "mojo/public/cpp/environment/logging.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 191 void Connector::CancelWait() { | 191 void Connector::CancelWait() { |
| 192 if (!async_wait_id_) | 192 if (!async_wait_id_) |
| 193 return; | 193 return; |
| 194 | 194 |
| 195 waiter_->CancelWait(async_wait_id_); | 195 waiter_->CancelWait(async_wait_id_); |
| 196 async_wait_id_ = 0; | 196 async_wait_id_ = 0; |
| 197 } | 197 } |
| 198 | 198 |
| 199 void Connector::NotifyError() { | 199 void Connector::NotifyError() { |
| 200 error_ = true; | 200 error_ = true; |
| 201 // The error handler might destroyed |this|. Also, after an error, all method | 201 CancelWait(); |
|
qsr
2014/08/22 08:28:59
What is the code path where we can be waiting? Fro
sky
2014/08/22 15:06:00
WaitForIncomingMessage is public and can be invoke
viettrungluu
2014/08/22 15:30:57
Do we have a test for this case?
darin (slow to review)
2014/08/22 16:11:27
Would probably be good to add a comment explaining
| |
| 202 // should end early. | |
| 203 if (destroyed_flag_) { | |
| 204 *destroyed_flag_ = true; // Propagate flag. | |
|
darin (slow to review)
2014/08/21 23:47:26
The "Propagate flag" comment makes me wonder if th
| |
| 205 } | |
| 206 if (error_handler_) | 202 if (error_handler_) |
| 207 error_handler_->OnConnectionError(); | 203 error_handler_->OnConnectionError(); |
|
qsr
2014/08/22 08:28:59
I think we need to handle the case where the error
sky
2014/08/22 15:06:00
Unless I'm missing something, that's fine. The des
qsr
2014/08/22 15:21:25
Sorry about this. You are right.
| |
| 208 } | 204 } |
| 209 | 205 |
| 210 } // namespace internal | 206 } // namespace internal |
| 211 } // namespace mojo | 207 } // namespace mojo |
| OLD | NEW |