| 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 #include "mojo/edk/system/raw_channel.h" | 5 #include "mojo/edk/system/raw_channel.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 #include <string.h> | 9 #include <string.h> |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 719 write_buffer_->data_offset_ = 0; | 719 write_buffer_->data_offset_ = 0; |
| 720 } | 720 } |
| 721 } | 721 } |
| 722 | 722 |
| 723 void RawChannel::CallOnReadCompleted(IOResult io_result, size_t bytes_read) { | 723 void RawChannel::CallOnReadCompleted(IOResult io_result, size_t bytes_read) { |
| 724 base::AutoLock locker(read_lock_); | 724 base::AutoLock locker(read_lock_); |
| 725 OnReadCompletedNoLock(io_result, bytes_read); | 725 OnReadCompletedNoLock(io_result, bytes_read); |
| 726 } | 726 } |
| 727 | 727 |
| 728 void RawChannel::WillDestroyCurrentMessageLoop() { | 728 void RawChannel::WillDestroyCurrentMessageLoop() { |
| 729 base::AutoLock locker(read_lock_); | 729 { |
| 730 OnReadCompletedNoLock(IO_FAILED_SHUTDOWN, 0); | 730 base::AutoLock locker(read_lock_); |
| 731 OnReadCompletedNoLock(IO_FAILED_SHUTDOWN, 0); |
| 732 } |
| 733 // The PostTask inside Shutdown() will never be called, so manually call it |
| 734 // here to avoid leaks in LSAN builds. |
| 735 Shutdown(); |
| 731 } | 736 } |
| 732 | 737 |
| 733 } // namespace edk | 738 } // namespace edk |
| 734 } // namespace mojo | 739 } // namespace mojo |
| OLD | NEW |