OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/edk/system/message_pipe_dispatcher.h" | 5 #include "mojo/edk/system/message_pipe_dispatcher.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 rv.satisfiable_signals |= MOJO_HANDLE_SIGNAL_WRITABLE; | 632 rv.satisfiable_signals |= MOJO_HANDLE_SIGNAL_WRITABLE; |
633 rv.satisfiable_signals |= MOJO_HANDLE_SIGNAL_READABLE; | 633 rv.satisfiable_signals |= MOJO_HANDLE_SIGNAL_READABLE; |
634 } else { | 634 } else { |
635 rv.satisfied_signals |= MOJO_HANDLE_SIGNAL_PEER_CLOSED; | 635 rv.satisfied_signals |= MOJO_HANDLE_SIGNAL_PEER_CLOSED; |
636 } | 636 } |
637 rv.satisfiable_signals |= MOJO_HANDLE_SIGNAL_PEER_CLOSED; | 637 rv.satisfiable_signals |= MOJO_HANDLE_SIGNAL_PEER_CLOSED; |
638 return rv; | 638 return rv; |
639 } | 639 } |
640 | 640 |
641 void MessagePipeDispatcher::OnPortStatusChanged() { | 641 void MessagePipeDispatcher::OnPortStatusChanged() { |
642 RequestContext request_context; | 642 DCHECK(RequestContext::current()); |
643 | 643 |
644 base::AutoLock lock(signal_lock_); | 644 base::AutoLock lock(signal_lock_); |
645 | 645 |
646 // We stop observing our port as soon as it's transferred, but this can race | 646 // We stop observing our port as soon as it's transferred, but this can race |
647 // with events which are raised right before that happens. This is fine to | 647 // with events which are raised right before that happens. This is fine to |
648 // ignore. | 648 // ignore. |
649 if (port_transferred_) | 649 if (port_transferred_) |
650 return; | 650 return; |
651 | 651 |
652 #if !defined(NDEBUG) | 652 #if !defined(NDEBUG) |
(...skipping 15 matching lines...) Expand all Loading... |
668 DVLOG(1) << "Peer closure detected on message pipe " << pipe_id_ | 668 DVLOG(1) << "Peer closure detected on message pipe " << pipe_id_ |
669 << " endpoint " << endpoint_ << " [port=" << port_.name() << "]"; | 669 << " endpoint " << endpoint_ << " [port=" << port_.name() << "]"; |
670 } | 670 } |
671 #endif | 671 #endif |
672 | 672 |
673 awakables_.AwakeForStateChange(GetHandleSignalsStateNoLock()); | 673 awakables_.AwakeForStateChange(GetHandleSignalsStateNoLock()); |
674 } | 674 } |
675 | 675 |
676 } // namespace edk | 676 } // namespace edk |
677 } // namespace mojo | 677 } // namespace mojo |
OLD | NEW |