2012-08-16 08:02:32 +04:00
|
|
|
/* 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/. */
|
|
|
|
|
2016-05-18 01:01:25 +03:00
|
|
|
include ProtocolTypes;
|
2014-10-21 04:49:00 +04:00
|
|
|
|
2019-01-28 12:49:13 +03:00
|
|
|
include protocol PChildToParentStream;
|
|
|
|
include protocol PParentToChildStream;
|
|
|
|
|
2014-10-21 04:49:00 +04:00
|
|
|
using struct mozilla::void_t
|
|
|
|
from "ipc/IPCMessageUtils.h";
|
2014-10-07 23:26:59 +04:00
|
|
|
|
2012-08-16 08:02:32 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace ipc {
|
|
|
|
|
2017-01-21 02:43:07 +03:00
|
|
|
struct HeaderEntry
|
|
|
|
{
|
|
|
|
nsCString name;
|
|
|
|
nsCString value;
|
|
|
|
};
|
|
|
|
|
2012-08-16 08:02:32 +04:00
|
|
|
struct StringInputStreamParams
|
|
|
|
{
|
|
|
|
nsCString data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct FileInputStreamParams
|
|
|
|
{
|
2014-03-25 22:37:13 +04:00
|
|
|
uint32_t fileDescriptorIndex;
|
2012-08-16 08:02:32 +04:00
|
|
|
int32_t behaviorFlags;
|
|
|
|
int32_t ioFlags;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MultiplexInputStreamParams
|
|
|
|
{
|
|
|
|
InputStreamParams[] streams;
|
|
|
|
uint32_t currentStream;
|
|
|
|
nsresult status;
|
|
|
|
bool startedReadingCurrent;
|
|
|
|
};
|
|
|
|
|
2017-02-22 11:41:05 +03:00
|
|
|
struct SlicedInputStreamParams
|
|
|
|
{
|
|
|
|
InputStreamParams stream;
|
|
|
|
uint64_t start;
|
|
|
|
uint64_t length;
|
|
|
|
uint64_t curPos;
|
|
|
|
bool closed;
|
|
|
|
};
|
|
|
|
|
2017-04-24 13:09:40 +03:00
|
|
|
struct IPCBlobInputStreamParams
|
|
|
|
{
|
|
|
|
nsID id;
|
2017-09-11 18:29:44 +03:00
|
|
|
uint64_t start;
|
|
|
|
uint64_t length;
|
2017-04-24 13:09:40 +03:00
|
|
|
};
|
|
|
|
|
2019-01-28 12:49:13 +03:00
|
|
|
union IPCRemoteStreamType
|
|
|
|
{
|
|
|
|
PChildToParentStream;
|
|
|
|
PParentToChildStream;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct IPCRemoteStreamParams
|
|
|
|
{
|
|
|
|
// If this is true, the stream will send data only when the first operation
|
|
|
|
// is done on the destination side. The benefit of this is that we do not
|
|
|
|
// send data if not needed. On the other hand, it could have a performance
|
|
|
|
// issue.
|
|
|
|
bool delayedStart;
|
|
|
|
|
|
|
|
IPCRemoteStreamType stream;
|
|
|
|
|
|
|
|
int64_t length;
|
|
|
|
};
|
|
|
|
|
2012-08-16 08:02:32 +04:00
|
|
|
union InputStreamParams
|
|
|
|
{
|
|
|
|
StringInputStreamParams;
|
|
|
|
FileInputStreamParams;
|
2012-08-23 06:13:54 +04:00
|
|
|
BufferedInputStreamParams;
|
|
|
|
MIMEInputStreamParams;
|
2012-08-16 08:02:32 +04:00
|
|
|
MultiplexInputStreamParams;
|
2017-02-22 11:41:05 +03:00
|
|
|
SlicedInputStreamParams;
|
2017-04-24 13:09:40 +03:00
|
|
|
IPCBlobInputStreamParams;
|
2018-05-31 19:12:25 +03:00
|
|
|
InputStreamLengthWrapperParams;
|
2019-01-28 12:49:13 +03:00
|
|
|
IPCRemoteStreamParams;
|
2012-08-16 08:02:32 +04:00
|
|
|
};
|
|
|
|
|
2012-08-23 06:13:54 +04:00
|
|
|
struct BufferedInputStreamParams
|
|
|
|
{
|
2019-03-12 18:52:26 +03:00
|
|
|
InputStreamParams? optionalStream;
|
2012-08-23 06:13:54 +04:00
|
|
|
uint32_t bufferSize;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MIMEInputStreamParams
|
|
|
|
{
|
2019-03-12 18:52:26 +03:00
|
|
|
InputStreamParams? optionalStream;
|
2017-01-21 02:43:07 +03:00
|
|
|
HeaderEntry[] headers;
|
2012-08-23 06:13:54 +04:00
|
|
|
bool startedReading;
|
|
|
|
};
|
|
|
|
|
2018-05-31 19:12:25 +03:00
|
|
|
struct InputStreamLengthWrapperParams
|
|
|
|
{
|
|
|
|
InputStreamParams stream;
|
|
|
|
int64_t length;
|
|
|
|
bool consumed;
|
|
|
|
};
|
|
|
|
|
2012-08-16 08:02:32 +04:00
|
|
|
} // namespace ipc
|
|
|
|
} // namespace mozilla
|