blob: 78feb6941130f01f8c712607f7c0abd724fe469d [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module mojo_base.mojom;
struct BigBufferSharedMemoryRegion {
handle<shared_buffer> buffer_handle;
uint32 size;
// A helper union to be used when messages want to accept arbitrarily large
// chunks of byte data. Beyond a certain size threshold, shared memory will be
// used in lieu of an inline byte array. If shared memory could not be allocated
// by the sender and the contents of the buffer would be too large to inline,
// this will instead take on the value of |invalid_buffer=true| indicating that
// the buffer does not represent any contents intended by the sender.
union BigBuffer {
array<uint8> bytes;
BigBufferSharedMemoryRegion shared_memory;
bool invalid_buffer;