#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "third_party/blink/renderer/core/mojo/mojo_handle.h"
#include "base/numerics/safe_math.h"
#include "mojo/public/c/system/message_pipe.h"
#include "mojo/public/cpp/bindings/message.h"
#include "mojo/public/cpp/system/message_pipe.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_create_shared_buffer_result.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_discard_data_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_duplicate_buffer_handle_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_map_buffer_result.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_read_data_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_read_data_result.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_read_message_flags.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_read_message_result.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_write_data_options.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_mojo_write_data_result.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_union_arraybuffer_arraybufferview.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/mojo/mojo_watcher.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer_view.h"
#include "third_party/blink/renderer/platform/bindings/script_state.h"
static const size_t kHandleVectorInlineCapacity = …;
namespace blink {
mojo::ScopedHandle MojoHandle::TakeHandle() { … }
MojoHandle::MojoHandle(mojo::ScopedHandle handle)
: … { … }
void MojoHandle::close() { … }
MojoWatcher* MojoHandle::watch(ScriptState* script_state,
const MojoHandleSignals* signals,
V8MojoWatchCallback* callback) { … }
MojoResult MojoHandle::writeMessage(
const V8BufferSource* buffer,
const HeapVector<Member<MojoHandle>>& handles) { … }
MojoReadMessageResult* MojoHandle::readMessage(
const MojoReadMessageFlags* flags_dict) { … }
MojoWriteDataResult* MojoHandle::writeData(
const V8BufferSource* buffer,
const MojoWriteDataOptions* options_dict) { … }
MojoReadDataResult* MojoHandle::queryData() const { … }
MojoReadDataResult* MojoHandle::discardData(
unsigned num_bytes,
const MojoDiscardDataOptions* options_dict) { … }
MojoReadDataResult* MojoHandle::readData(
const V8BufferSource* buffer,
const MojoReadDataOptions* options_dict) const { … }
MojoMapBufferResult* MojoHandle::mapBuffer(unsigned offset,
unsigned num_bytes) { … }
MojoCreateSharedBufferResult* MojoHandle::duplicateBufferHandle(
const MojoDuplicateBufferHandleOptions* options_dict) { … }
}