js/xpconnect/idl/nsIAddonInterposition.idl
author B2G Bumper Bot <release+b2gbumper@mozilla.com>
Fri, 27 Mar 2015 07:15:32 -0700
changeset 236084 b97da99a15ec103276ffa425f398e22a14cd9fbd
parent 193941 3fadc02e2e841c3bb5f6fd7db6fc4fa9593817fa
child 242704 2063e368fa07a69eaa50829d0e6c37ce80c30a04
permissions -rw-r--r--
Bumping gaia.json for 1 gaia revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/9e79307fd6bc Author: Ryan VanderMeulen <rvandermeulen@mozilla.com> Desc: Bug 1148392 - Disable Player_test.js and playlist_test.js for permafailing after a recent TC change.

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * 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 "nsISupports.idl"

/**
 * This interface allows Firefox to expose different implementations of its own
 * classes to add-ons. Once an interposition is created, it must be assigned to
 * an add-on using Cu.setAddonInterposition (JS) or xpc::SetAddonInterposition
 * (C++). In both cases, the arguments should be the add-on ID and the
 * interposition object (which must be an nsIAddonInterposition). This must
 * happen before any compartments are created for the given add-on.
 *
 * Every time the add-on accesses a property on any object outside its own set
 * of compartments, XPConnect will call the interposition's
 * interpose method. If the interposition wants to replace the given
 * property, it should return a replacement property descriptor for it. If not,
 * it should return null.
 */
[scriptable,uuid(e5453950-d95a-11e3-9c1a-0800200c9a66)]
interface nsIAddonInterposition : nsISupports
{
    /**
     * Returns a replacement property descriptor for a browser object.
     *
     * @param addonId The ID of the add-on accessing the property.
     * @param target The browser object being accessed.
     * @param iface The IID of the interface the property is associated with. This
     *              parameter is only available for XPCWrappedNative targets. As
     *              such, it's only useful as an optimization to avoid
     *              instanceof checks on the target.
     * @param prop The name of the property being accessed.
     * @return A property descriptor or null.
     */
    jsval interpose(in jsval addonId,
                    in jsval target,
                    in nsIIDPtr iface,
                    in jsval prop);
};