2013-07-03 11:24:32 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
* vim: set ts=4 sw=4 et tw=80:
|
|
|
|
*
|
|
|
|
* 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 DOMTypes;
|
|
|
|
|
2013-10-01 23:25:07 +04:00
|
|
|
using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
|
2013-07-03 11:24:32 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace jsipc {
|
|
|
|
|
|
|
|
struct JSIID
|
|
|
|
{
|
|
|
|
uint32_t m0;
|
|
|
|
uint16_t m1;
|
|
|
|
uint16_t m2;
|
|
|
|
uint8_t m3_0;
|
|
|
|
uint8_t m3_1;
|
|
|
|
uint8_t m3_2;
|
|
|
|
uint8_t m3_3;
|
|
|
|
uint8_t m3_4;
|
|
|
|
uint8_t m3_5;
|
|
|
|
uint8_t m3_6;
|
|
|
|
uint8_t m3_7;
|
|
|
|
};
|
|
|
|
|
2014-05-17 03:40:36 +04:00
|
|
|
struct LocalObject
|
2014-05-17 03:40:36 +04:00
|
|
|
{
|
2014-09-25 15:13:29 +04:00
|
|
|
uint64_t serializedId;
|
2014-05-17 03:40:36 +04:00
|
|
|
};
|
|
|
|
|
2014-05-17 03:40:36 +04:00
|
|
|
struct RemoteObject
|
|
|
|
{
|
2014-09-25 15:13:29 +04:00
|
|
|
uint64_t serializedId;
|
2014-11-05 04:39:34 +03:00
|
|
|
bool isCallable;
|
|
|
|
bool isConstructor;
|
2015-03-11 00:36:01 +03:00
|
|
|
bool isDOMObject;
|
2014-11-05 04:40:08 +03:00
|
|
|
nsCString objectTag;
|
2014-05-17 03:40:36 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
union ObjectVariant
|
|
|
|
{
|
|
|
|
LocalObject;
|
|
|
|
RemoteObject;
|
|
|
|
};
|
|
|
|
|
2014-10-07 13:29:03 +04:00
|
|
|
struct WellKnownSymbol
|
|
|
|
{
|
|
|
|
uint32_t which;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct RegisteredSymbol
|
|
|
|
{
|
|
|
|
nsString key;
|
|
|
|
};
|
|
|
|
|
|
|
|
union SymbolVariant
|
|
|
|
{
|
|
|
|
WellKnownSymbol;
|
|
|
|
RegisteredSymbol;
|
|
|
|
};
|
|
|
|
|
2014-05-17 03:40:36 +04:00
|
|
|
struct UndefinedVariant {};
|
|
|
|
struct NullVariant {};
|
|
|
|
|
2014-10-20 20:47:27 +04:00
|
|
|
union ObjectOrNullVariant
|
|
|
|
{
|
|
|
|
ObjectVariant;
|
|
|
|
NullVariant;
|
|
|
|
};
|
|
|
|
|
2013-07-03 11:24:32 +04:00
|
|
|
union JSVariant
|
|
|
|
{
|
2014-05-17 03:40:36 +04:00
|
|
|
UndefinedVariant;
|
|
|
|
NullVariant;
|
|
|
|
ObjectVariant;
|
2014-10-07 13:29:03 +04:00
|
|
|
SymbolVariant;
|
2013-07-03 11:24:32 +04:00
|
|
|
nsString; /* StringValue(x) */
|
|
|
|
double; /* NumberValue(x) */
|
|
|
|
bool; /* BooleanValue(x) */
|
|
|
|
JSIID; /* XPC nsIID */
|
|
|
|
};
|
|
|
|
|
2014-10-07 13:29:02 +04:00
|
|
|
union JSIDVariant
|
|
|
|
{
|
2014-10-07 13:29:03 +04:00
|
|
|
SymbolVariant;
|
2014-10-07 13:29:02 +04:00
|
|
|
nsString;
|
|
|
|
int32_t;
|
|
|
|
};
|
|
|
|
|
2013-09-30 23:20:51 +04:00
|
|
|
struct ReturnSuccess
|
2013-07-03 11:24:32 +04:00
|
|
|
{
|
2013-09-30 23:20:51 +04:00
|
|
|
};
|
|
|
|
|
2016-07-26 13:30:42 +03:00
|
|
|
struct ReturnDeadCPOW
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
2013-09-30 23:20:51 +04:00
|
|
|
struct ReturnException
|
|
|
|
{
|
|
|
|
JSVariant exn;
|
|
|
|
};
|
|
|
|
|
2015-01-30 20:37:07 +03:00
|
|
|
struct ReturnObjectOpResult
|
|
|
|
{
|
|
|
|
uint32_t code;
|
|
|
|
};
|
|
|
|
|
2013-09-30 23:20:51 +04:00
|
|
|
union ReturnStatus
|
|
|
|
{
|
|
|
|
ReturnSuccess;
|
2016-07-26 13:30:42 +03:00
|
|
|
ReturnDeadCPOW;
|
2013-09-30 23:20:51 +04:00
|
|
|
ReturnException;
|
2015-01-30 20:37:07 +03:00
|
|
|
ReturnObjectOpResult;
|
2013-07-03 11:24:32 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
union JSParam
|
|
|
|
{
|
|
|
|
void_t; /* value is strictly an xpc out param */
|
|
|
|
JSVariant; /* actual value to pass through */
|
|
|
|
};
|
|
|
|
|
2014-05-17 03:40:36 +04:00
|
|
|
union GetterSetter
|
|
|
|
{
|
|
|
|
uint64_t;
|
|
|
|
ObjectVariant;
|
|
|
|
};
|
|
|
|
|
2013-07-03 11:24:32 +04:00
|
|
|
struct PPropertyDescriptor
|
|
|
|
{
|
2014-10-20 20:47:27 +04:00
|
|
|
ObjectOrNullVariant obj;
|
2014-05-17 03:40:36 +04:00
|
|
|
uint32_t attrs;
|
|
|
|
JSVariant value;
|
2013-07-03 11:24:32 +04:00
|
|
|
|
|
|
|
// How to interpret these values depends on whether JSPROP_GETTER/SETTER
|
|
|
|
// are set. If set, the corresponding value is a CPOW or 0 for NULL.
|
|
|
|
// Otherwise, the following table is used:
|
|
|
|
//
|
|
|
|
// 0 - NULL
|
|
|
|
// 1 - Default getter or setter.
|
2014-09-10 21:54:20 +04:00
|
|
|
// 2 - Unknown
|
2014-05-17 03:40:36 +04:00
|
|
|
GetterSetter getter;
|
|
|
|
GetterSetter setter;
|
2013-07-03 11:24:32 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
struct CpowEntry
|
|
|
|
{
|
|
|
|
nsString name;
|
|
|
|
JSVariant value;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|