Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 * vim: set ts=4 sw=4 et tw=80:
3 *
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 include DOMTypes;
10 using struct mozilla::void_t from "ipc/IPCMessageUtils.h";
12 namespace mozilla {
13 namespace jsipc {
15 struct JSIID
16 {
17 uint32_t m0;
18 uint16_t m1;
19 uint16_t m2;
20 uint8_t m3_0;
21 uint8_t m3_1;
22 uint8_t m3_2;
23 uint8_t m3_3;
24 uint8_t m3_4;
25 uint8_t m3_5;
26 uint8_t m3_6;
27 uint8_t m3_7;
28 };
30 union JSVariant
31 {
32 void_t; /* |undefined| */
33 nsString; /* StringValue(x) */
34 uint64_t; /* ID that maps to a JSObject (cpow on parent, original on child). */
35 double; /* NumberValue(x) */
36 bool; /* BooleanValue(x) */
37 JSIID; /* XPC nsIID */
38 };
40 struct ReturnSuccess
41 {
42 };
44 struct ReturnStopIteration
45 {
46 };
48 struct ReturnException
49 {
50 JSVariant exn;
51 };
53 union ReturnStatus
54 {
55 ReturnSuccess;
56 ReturnStopIteration;
57 ReturnException;
58 };
60 union JSParam
61 {
62 void_t; /* value is strictly an xpc out param */
63 JSVariant; /* actual value to pass through */
64 };
66 struct PPropertyDescriptor
67 {
68 uint64_t objId;
69 uint32_t attrs;
70 JSVariant value;
72 // How to interpret these values depends on whether JSPROP_GETTER/SETTER
73 // are set. If set, the corresponding value is a CPOW or 0 for NULL.
74 // Otherwise, the following table is used:
75 //
76 // 0 - NULL
77 // 1 - Default getter or setter.
78 // 2 - js_GetterOnlyPropertyStub (setter only)
79 // 3 - Unknown
80 uint64_t getter;
81 uint64_t setter;
82 };
84 struct CpowEntry
85 {
86 nsString name;
87 JSVariant value;
88 };
90 }
91 }