js/ipc/PObjectWrapper.ipdl
author Vicamo Yang <vyang@mozilla.com>
Fri, 08 Mar 2013 00:12:44 +0800
changeset 124114 23d5f8aff7c5c38ac9f59cc86d353a81aed45bf1
parent 94475 f4157e8c410708d76703f19e4dfb61859bfe32d8
permissions -rw-r--r--
Bug 833291 - Part 4/7: fix deleteMessage(). r=hsinyi

/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 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 protocol PContextWrapper;

include "mozilla/jsipc/CPOWTypes.h";

using mozilla::void_t;
using JSType;
using JSBool;

namespace mozilla {
namespace jsipc {

union JSVariant {
    void_t;
    nullable PObjectWrapper;
    nsString;
    int;
    double;
    bool; // We'd like to use JSBool here, but IPC::ParamTraits would
          // treat JSBool as int.
};

union OperationStatus {
    JSBool;
    JSVariant; // Exception thrown.
};

rpc protocol PObjectWrapper
{
    manager PContextWrapper;

child:
    __delete__(); // unroot

    rpc AddProperty(nsString id)
        returns (OperationStatus status);

    rpc GetProperty(nsString id)
        returns (OperationStatus status,
                 JSVariant vp);

    rpc SetProperty(nsString id,
                    JSVariant v)
        returns (OperationStatus status,
                 JSVariant vp);

    rpc DelProperty(nsString id)
        returns (OperationStatus status,
                 JSVariant vp);

    rpc NewEnumerateInit()
        returns (OperationStatus status,
                 JSVariant statep,
                 int idp);

    rpc NewEnumerateNext(JSVariant in_state)
        returns (OperationStatus status,
                 JSVariant statep,
                 nsString idp);

    async NewEnumerateDestroy(JSVariant in_state);

    rpc NewResolve(nsString id,
                   int flags)
        returns (OperationStatus status,
                 nullable PObjectWrapper obj2);

    rpc Convert(JSType type)
        returns (OperationStatus status,
                 JSVariant vp);

    rpc Call(PObjectWrapper receiver,
             JSVariant[] argv)
        returns (OperationStatus status,
                 JSVariant rval);

    rpc Construct(JSVariant[] argv)
        returns (OperationStatus status,
                 nullable PObjectWrapper rval);

    rpc HasInstance(JSVariant v)
        returns (OperationStatus status,
                 JSBool bp);
};

}}