js/ipc/JavaScriptTypes.ipdlh
author David Keeler <dkeeler@mozilla.com>
Wed, 08 Oct 2014 09:48:15 -0700
changeset 209464 3ae75c8b8f640c99186f04e7ffbacd4450b57e4b
parent 209134 2279791b5c6e8d55675db58f38ccfcba7c568ca9
child 211320 8f34e100ffeae9f08d07a5e293533822c0656d52
permissions -rw-r--r--
bug 1058812 - (3/3) mozilla::pkix: test handling unsupported signature algorithms r=briansmith

/* -*- 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;

using struct mozilla::void_t from "ipc/IPCMessageUtils.h";

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;
};

struct LocalObject
{
    uint64_t serializedId;
};

struct RemoteObject
{
    uint64_t serializedId;
};

union ObjectVariant
{
    LocalObject;
    RemoteObject;
};

struct WellKnownSymbol
{
    uint32_t which;
};

struct RegisteredSymbol
{
    nsString key;
};

union SymbolVariant
{
    WellKnownSymbol;
    RegisteredSymbol;
};

struct UndefinedVariant {};
struct NullVariant {};

union JSVariant
{
    UndefinedVariant;
    NullVariant;
    ObjectVariant;
    SymbolVariant;
    nsString;   /* StringValue(x) */
    double;     /* NumberValue(x) */
    bool;       /* BooleanValue(x) */
    JSIID;      /* XPC nsIID */
};

union JSIDVariant
{
    SymbolVariant;
    nsString;
    int32_t;
};

struct ReturnSuccess
{
};

struct ReturnStopIteration
{
};

struct ReturnException
{
    JSVariant exn;
};

union ReturnStatus
{
    ReturnSuccess;
    ReturnStopIteration;
    ReturnException;
};

union JSParam
{
    void_t;     /* value is strictly an xpc out param */
    JSVariant;  /* actual value to pass through */
};

union GetterSetter
{
    uint64_t;
    ObjectVariant;
};

struct PPropertyDescriptor
{
    ObjectVariant obj;
    uint32_t attrs;
    JSVariant value;

    // 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.
    //  2 - Unknown
    GetterSetter getter;
    GetterSetter setter;
};

struct CpowEntry
{
  nsString name;
  JSVariant value;
};

}
}