Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(213)

Side by Side Diff: mojo/edk/system/raw_channel.cc

Issue 1589693002: Avoid shutdown leak. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « mojo/edk/system/message_pipe_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698