2014-02-25 01:09:03 +04:00
|
|
|
/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
|
2012-08-02 10:02:29 +04:00
|
|
|
/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
include protocol PBlob;
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
using struct mozilla::void_t
|
|
|
|
from "ipc/IPCMessageUtils.h";
|
|
|
|
|
|
|
|
using struct mozilla::SerializedStructuredCloneBuffer
|
|
|
|
from "ipc/IPCMessageUtils.h";
|
2012-08-02 10:02:29 +04:00
|
|
|
|
2014-10-21 04:49:00 +04:00
|
|
|
using struct nsID
|
|
|
|
from "nsID.h";
|
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
union OptionalID
|
|
|
|
{
|
|
|
|
nsID;
|
|
|
|
void_t;
|
|
|
|
};
|
|
|
|
|
2016-02-01 00:48:00 +03:00
|
|
|
struct MessagePortIdentifier
|
|
|
|
{
|
|
|
|
nsID uuid;
|
|
|
|
nsID destinationUuid;
|
|
|
|
uint32_t sequenceId;
|
|
|
|
bool neutered;
|
|
|
|
};
|
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
struct ClonedMessageData
|
|
|
|
{
|
|
|
|
SerializedStructuredCloneBuffer data;
|
|
|
|
PBlob[] blobs;
|
2016-02-01 00:48:00 +03:00
|
|
|
MessagePortIdentifier[] identfiers;
|
2012-08-02 10:02:29 +04:00
|
|
|
};
|
|
|
|
|
2014-10-21 04:49:00 +04:00
|
|
|
union BlobData
|
|
|
|
{
|
|
|
|
// For remote blobs.
|
|
|
|
nsID;
|
|
|
|
|
|
|
|
// For memory-backed blobs.
|
|
|
|
uint8_t[];
|
|
|
|
|
|
|
|
// For multiplex blobs.
|
|
|
|
BlobData[];
|
|
|
|
};
|
|
|
|
|
|
|
|
union OptionalBlobData
|
|
|
|
{
|
|
|
|
BlobData;
|
|
|
|
void_t;
|
|
|
|
};
|
|
|
|
|
2012-08-03 10:25:30 +04:00
|
|
|
struct NormalBlobConstructorParams
|
|
|
|
{
|
|
|
|
nsString contentType;
|
|
|
|
uint64_t length;
|
2014-10-21 04:49:00 +04:00
|
|
|
|
|
|
|
// This must be of type BlobData in a child->parent message, and will always
|
|
|
|
// be of type void_t in a parent->child message.
|
|
|
|
OptionalBlobData optionalBlobData;
|
2012-08-03 10:25:30 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct FileBlobConstructorParams
|
|
|
|
{
|
|
|
|
nsString name;
|
|
|
|
nsString contentType;
|
|
|
|
uint64_t length;
|
2015-04-27 14:17:19 +03:00
|
|
|
int64_t modDate;
|
2014-10-21 04:49:00 +04:00
|
|
|
|
|
|
|
// This must be of type BlobData in a child->parent message, and will always
|
|
|
|
// be of type void_t in a parent->child message.
|
|
|
|
OptionalBlobData optionalBlobData;
|
2012-08-03 10:25:30 +04:00
|
|
|
};
|
|
|
|
|
2013-07-10 21:07:51 +04:00
|
|
|
struct SlicedBlobConstructorParams
|
|
|
|
{
|
|
|
|
PBlob source;
|
2014-10-08 03:09:55 +04:00
|
|
|
nsID id;
|
2013-07-10 21:07:51 +04:00
|
|
|
uint64_t begin;
|
|
|
|
uint64_t end;
|
|
|
|
nsString contentType;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MysteryBlobConstructorParams
|
|
|
|
{
|
|
|
|
// Nothing is known about this type of blob.
|
|
|
|
};
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
struct KnownBlobConstructorParams
|
|
|
|
{
|
|
|
|
nsID id;
|
|
|
|
};
|
|
|
|
|
2014-10-21 04:49:00 +04:00
|
|
|
// This may only be used for same-process inter-thread communication!
|
|
|
|
struct SameProcessBlobConstructorParams
|
|
|
|
{
|
2015-05-12 15:11:03 +03:00
|
|
|
// This member should be reinterpret_cast'd to mozilla::dom::BlobImpl. It
|
2014-10-21 04:49:00 +04:00
|
|
|
// carries a reference.
|
2015-05-12 15:11:03 +03:00
|
|
|
intptr_t addRefedBlobImpl;
|
2014-10-21 04:49:00 +04:00
|
|
|
};
|
|
|
|
|
2014-09-27 03:21:57 +04:00
|
|
|
union AnyBlobConstructorParams
|
2013-07-10 21:07:51 +04:00
|
|
|
{
|
2014-10-08 03:09:55 +04:00
|
|
|
// These types may be sent to/from parent and child.
|
2013-07-10 21:07:51 +04:00
|
|
|
NormalBlobConstructorParams;
|
|
|
|
FileBlobConstructorParams;
|
2014-10-21 04:49:00 +04:00
|
|
|
SameProcessBlobConstructorParams;
|
2014-10-08 03:09:55 +04:00
|
|
|
|
|
|
|
// This type may only be sent from parent to child.
|
2013-07-10 21:07:51 +04:00
|
|
|
MysteryBlobConstructorParams;
|
2014-10-08 03:09:55 +04:00
|
|
|
|
|
|
|
// These types may only be sent from child to parent.
|
|
|
|
SlicedBlobConstructorParams;
|
2014-09-27 03:21:57 +04:00
|
|
|
KnownBlobConstructorParams;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ChildBlobConstructorParams
|
|
|
|
{
|
|
|
|
nsID id;
|
|
|
|
|
2014-10-08 03:09:55 +04:00
|
|
|
// May not be SlicedBlobConstructorParams or KnownBlobConstructorParams.
|
2014-09-27 03:21:57 +04:00
|
|
|
AnyBlobConstructorParams blobParams;
|
2013-07-10 21:07:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ParentBlobConstructorParams
|
|
|
|
{
|
2014-09-27 03:21:57 +04:00
|
|
|
// May not be MysteryBlobConstructorParams.
|
|
|
|
AnyBlobConstructorParams blobParams;
|
2013-07-10 21:07:51 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
union BlobConstructorParams
|
|
|
|
{
|
|
|
|
ChildBlobConstructorParams;
|
|
|
|
ParentBlobConstructorParams;
|
|
|
|
};
|
|
|
|
|
2015-04-08 21:48:11 +03:00
|
|
|
union IPCDataTransferData
|
|
|
|
{
|
2015-04-16 22:38:12 +03:00
|
|
|
nsString; // text
|
|
|
|
nsCString; // images
|
|
|
|
PBlob; // files
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IPCDataTransferImage
|
|
|
|
{
|
|
|
|
uint32_t width;
|
|
|
|
uint32_t height;
|
|
|
|
uint32_t stride;
|
|
|
|
uint8_t format;
|
2015-04-08 21:48:11 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct IPCDataTransferItem
|
|
|
|
{
|
|
|
|
nsCString flavor;
|
2015-04-16 22:38:12 +03:00
|
|
|
// The image details are only used when transferring images.
|
|
|
|
IPCDataTransferImage imageDetails;
|
2015-04-08 21:48:11 +03:00
|
|
|
IPCDataTransferData data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IPCDataTransfer
|
|
|
|
{
|
|
|
|
IPCDataTransferItem[] items;
|
|
|
|
};
|
|
|
|
|
2012-08-02 10:02:29 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|