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 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 message_pipe_ = std::move(dummy_pipe.handle0); | 332 message_pipe_ = std::move(dummy_pipe.handle0); |
333 } else { | 333 } else { |
334 CancelWait(); | 334 CancelWait(); |
335 } | 335 } |
336 | 336 |
337 if (force_async_handler) { | 337 if (force_async_handler) { |
338 if (!paused_) | 338 if (!paused_) |
339 WaitToReadMore(); | 339 WaitToReadMore(); |
340 } else { | 340 } else { |
341 error_ = true; | 341 error_ = true; |
342 connection_error_handler_.Run(); | 342 if (!connection_error_handler_.is_null()) |
| 343 connection_error_handler_.Run(); |
343 } | 344 } |
344 } | 345 } |
345 | 346 |
346 void Connector::EnsureSyncWatcherExists() { | 347 void Connector::EnsureSyncWatcherExists() { |
347 if (sync_watcher_) | 348 if (sync_watcher_) |
348 return; | 349 return; |
349 sync_watcher_.reset(new SyncHandleWatcher( | 350 sync_watcher_.reset(new SyncHandleWatcher( |
350 message_pipe_.get(), MOJO_HANDLE_SIGNAL_READABLE, | 351 message_pipe_.get(), MOJO_HANDLE_SIGNAL_READABLE, |
351 base::Bind(&Connector::OnSyncHandleWatcherHandleReady, | 352 base::Bind(&Connector::OnSyncHandleWatcherHandleReady, |
352 base::Unretained(this)))); | 353 base::Unretained(this)))); |
353 } | 354 } |
354 | 355 |
355 } // namespace internal | 356 } // namespace internal |
356 } // namespace mojo | 357 } // namespace mojo |
OLD | NEW |