1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/ipc/JavaScriptTypes.ipdlh Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,91 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- 1.5 + * vim: set ts=4 sw=4 et tw=80: 1.6 + * 1.7 + * This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.10 + 1.11 +include DOMTypes; 1.12 + 1.13 +using struct mozilla::void_t from "ipc/IPCMessageUtils.h"; 1.14 + 1.15 +namespace mozilla { 1.16 +namespace jsipc { 1.17 + 1.18 +struct JSIID 1.19 +{ 1.20 + uint32_t m0; 1.21 + uint16_t m1; 1.22 + uint16_t m2; 1.23 + uint8_t m3_0; 1.24 + uint8_t m3_1; 1.25 + uint8_t m3_2; 1.26 + uint8_t m3_3; 1.27 + uint8_t m3_4; 1.28 + uint8_t m3_5; 1.29 + uint8_t m3_6; 1.30 + uint8_t m3_7; 1.31 +}; 1.32 + 1.33 +union JSVariant 1.34 +{ 1.35 + void_t; /* |undefined| */ 1.36 + nsString; /* StringValue(x) */ 1.37 + uint64_t; /* ID that maps to a JSObject (cpow on parent, original on child). */ 1.38 + double; /* NumberValue(x) */ 1.39 + bool; /* BooleanValue(x) */ 1.40 + JSIID; /* XPC nsIID */ 1.41 +}; 1.42 + 1.43 +struct ReturnSuccess 1.44 +{ 1.45 +}; 1.46 + 1.47 +struct ReturnStopIteration 1.48 +{ 1.49 +}; 1.50 + 1.51 +struct ReturnException 1.52 +{ 1.53 + JSVariant exn; 1.54 +}; 1.55 + 1.56 +union ReturnStatus 1.57 +{ 1.58 + ReturnSuccess; 1.59 + ReturnStopIteration; 1.60 + ReturnException; 1.61 +}; 1.62 + 1.63 +union JSParam 1.64 +{ 1.65 + void_t; /* value is strictly an xpc out param */ 1.66 + JSVariant; /* actual value to pass through */ 1.67 +}; 1.68 + 1.69 +struct PPropertyDescriptor 1.70 +{ 1.71 + uint64_t objId; 1.72 + uint32_t attrs; 1.73 + JSVariant value; 1.74 + 1.75 + // How to interpret these values depends on whether JSPROP_GETTER/SETTER 1.76 + // are set. If set, the corresponding value is a CPOW or 0 for NULL. 1.77 + // Otherwise, the following table is used: 1.78 + // 1.79 + // 0 - NULL 1.80 + // 1 - Default getter or setter. 1.81 + // 2 - js_GetterOnlyPropertyStub (setter only) 1.82 + // 3 - Unknown 1.83 + uint64_t getter; 1.84 + uint64_t setter; 1.85 +}; 1.86 + 1.87 +struct CpowEntry 1.88 +{ 1.89 + nsString name; 1.90 + JSVariant value; 1.91 +}; 1.92 + 1.93 +} 1.94 +}