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

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

Issue 1943123002: Make it possible to write a message pipe endpoint's peer into it. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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
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/shared_buffer_dispatcher.h" 5 #include "mojo/edk/system/shared_buffer_dispatcher.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return MOJO_RESULT_OK; 209 return MOJO_RESULT_OK;
210 } 210 }
211 211
212 void SharedBufferDispatcher::CloseImplNoLock() { 212 void SharedBufferDispatcher::CloseImplNoLock() {
213 mutex().AssertHeld(); 213 mutex().AssertHeld();
214 DCHECK(shared_buffer_); 214 DCHECK(shared_buffer_);
215 shared_buffer_ = nullptr; 215 shared_buffer_ = nullptr;
216 } 216 }
217 217
218 RefPtr<Dispatcher> 218 RefPtr<Dispatcher>
219 SharedBufferDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() { 219 SharedBufferDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock(
220 MessagePipe* /*message_pipe*/,
221 unsigned /*port*/) {
220 mutex().AssertHeld(); 222 mutex().AssertHeld();
223
224 CancelAllAwakablesNoLock();
225
221 DCHECK(shared_buffer_); 226 DCHECK(shared_buffer_);
222 return CreateInternal(std::move(shared_buffer_)); 227 return CreateInternal(std::move(shared_buffer_));
223 } 228 }
224 229
225 MojoResult SharedBufferDispatcher::DuplicateBufferHandleImplNoLock( 230 MojoResult SharedBufferDispatcher::DuplicateBufferHandleImplNoLock(
226 UserPointer<const MojoDuplicateBufferHandleOptions> options, 231 UserPointer<const MojoDuplicateBufferHandleOptions> options,
227 RefPtr<Dispatcher>* new_dispatcher) { 232 RefPtr<Dispatcher>* new_dispatcher) {
228 mutex().AssertHeld(); 233 mutex().AssertHeld();
229 234
230 MojoDuplicateBufferHandleOptions validated_options; 235 MojoDuplicateBufferHandleOptions validated_options;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 platform_handles->push_back(std::move(platform_handle)); 326 platform_handles->push_back(std::move(platform_handle));
322 *actual_size = sizeof(SerializedSharedBufferDispatcher); 327 *actual_size = sizeof(SerializedSharedBufferDispatcher);
323 328
324 shared_buffer_ = nullptr; 329 shared_buffer_ = nullptr;
325 330
326 return true; 331 return true;
327 } 332 }
328 333
329 } // namespace system 334 } // namespace system
330 } // namespace mojo 335 } // namespace mojo
OLDNEW
« mojo/edk/system/dispatcher.h ('K') | « mojo/edk/system/shared_buffer_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698