js/ipc/PObjectWrapper.ipdl
author Mike Habicher <mikeh@mozilla.com>
Tue, 23 Oct 2012 18:30:28 -0400
changeset 113615 c6d650bf29adb92131aab7106b68ed1822247ccd
parent 96742 f4157e8c410708d76703f19e4dfb61859bfe32d8
permissions -rw-r--r--
Bug 795379 - Add support for getting and setting video recording profiles. r=jst, a=blocking-basecamp

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

}}