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

Unified Diff: mojo/system/shared_buffer_dispatcher.cc

Issue 227383006: Mojo: Allow dispatchers to attach PlatformHandles to the MessageInTransit on serialization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/system/message_pipe_dispatcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/system/shared_buffer_dispatcher.cc
diff --git a/mojo/system/shared_buffer_dispatcher.cc b/mojo/system/shared_buffer_dispatcher.cc
index 519d3c6e1e99409947600a6a144fb060867bfacd..3c94c8aca5a067772f2866e170a04a00a030656f 100644
--- a/mojo/system/shared_buffer_dispatcher.cc
+++ b/mojo/system/shared_buffer_dispatcher.cc
@@ -71,12 +71,14 @@ SharedBufferDispatcher::~SharedBufferDispatcher() {
}
void SharedBufferDispatcher::CloseImplNoLock() {
+ lock().AssertAcquired();
DCHECK(shared_buffer_);
shared_buffer_ = NULL;
}
scoped_refptr<Dispatcher>
SharedBufferDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() {
+ lock().AssertAcquired();
DCHECK(shared_buffer_);
scoped_refptr<RawSharedBuffer> shared_buffer;
shared_buffer.swap(shared_buffer_);
@@ -86,6 +88,7 @@ scoped_refptr<Dispatcher>
MojoResult SharedBufferDispatcher::DuplicateBufferHandleImplNoLock(
const MojoDuplicateBufferHandleOptions* options,
scoped_refptr<Dispatcher>* new_dispatcher) {
+ lock().AssertAcquired();
if (options) {
// The |struct_size| field must be valid to read.
if (!VerifyUserPointer<uint32_t>(&options->struct_size, 1))
@@ -108,6 +111,7 @@ MojoResult SharedBufferDispatcher::MapBufferImplNoLock(
uint64_t num_bytes,
MojoMapBufferFlags flags,
scoped_ptr<RawSharedBufferMapping>* mapping) {
+ lock().AssertAcquired();
DCHECK(shared_buffer_);
if (offset > static_cast<uint64_t>(std::numeric_limits<size_t>::max()))
« no previous file with comments | « mojo/system/message_pipe_dispatcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698