| Index: mojo/edk/system/shared_buffer_dispatcher.cc
|
| diff --git a/mojo/edk/system/shared_buffer_dispatcher.cc b/mojo/edk/system/shared_buffer_dispatcher.cc
|
| index 576a4283210a889c7d7b8f65747d818a7f39be46..4474c70ef9e8f0a25dfaca01bff7f02d846fea8a 100644
|
| --- a/mojo/edk/system/shared_buffer_dispatcher.cc
|
| +++ b/mojo/edk/system/shared_buffer_dispatcher.cc
|
| @@ -232,6 +232,29 @@ MojoResult SharedBufferDispatcher::DuplicateBufferHandleImplNoLock(
|
| return MOJO_RESULT_OK;
|
| }
|
|
|
| +MojoResult SharedBufferDispatcher::GetBufferInformationImplNoLock(
|
| + UserPointer<MojoBufferInformation> info,
|
| + uint32_t info_num_bytes) {
|
| + mutex().AssertHeld();
|
| +
|
| + // Note: If/when |MojoBufferInformation| is extended beyond its initial
|
| + // definition, more work will be necessary. (See the definition of
|
| + // |MojoGetBufferInformation()| in mojo/public/c/system/buffer.h.)
|
| + static_assert(sizeof(MojoBufferInformation) == 16u,
|
| + "MojoBufferInformation has been extended!");
|
| +
|
| + if (info_num_bytes < sizeof(MojoBufferInformation))
|
| + return MOJO_RESULT_INVALID_ARGUMENT;
|
| +
|
| + MojoBufferInformation model_info = {
|
| + sizeof(MojoBufferInformation), // |struct_size|.
|
| + MOJO_BUFFER_INFORMATION_FLAG_NONE, // |flags|.
|
| + static_cast<uint64_t>(shared_buffer_->GetNumBytes()), // |num_bytes|.
|
| + };
|
| + info.Put(model_info);
|
| + return MOJO_RESULT_OK;
|
| +}
|
| +
|
| MojoResult SharedBufferDispatcher::MapBufferImplNoLock(
|
| uint64_t offset,
|
| uint64_t num_bytes,
|
|
|