dom/base/nsIScriptChannel.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsISupports.idl"
michael@0 7
michael@0 8 /**
michael@0 9 * An interface representing a channel which will have to execute some sort of
michael@0 10 * program provided via its URI to compute the data it should return.
michael@0 11 *
michael@0 12 * If a channel implements this interface, the execution of the program in
michael@0 13 * question will be restricted in the following ways:
michael@0 14 *
michael@0 15 * - If the channel does not have an owner principal, the program will not be
michael@0 16 * executed at all, no matter what. This is necessary because in this
michael@0 17 * circumstance we have no way to tell whether script execution is allowed at
michael@0 18 * all for the originating security context of this channel.
michael@0 19 * - If the channel has an owner principal, how it is executed is controlled by
michael@0 20 * this interface. However if the owner principal does not subsume the
michael@0 21 * principal of the environment in which the program is to be executed the
michael@0 22 * execution will be forced to happen in a sandbox.
michael@0 23 */
michael@0 24 [scriptable, uuid(33234b99-9588-4c7d-9da6-86b8b7cba565)]
michael@0 25 interface nsIScriptChannel : nsISupports
michael@0 26 {
michael@0 27 /**
michael@0 28 * Possible ways of executing the program.
michael@0 29 */
michael@0 30
michael@0 31 /**
michael@0 32 * Don't execute at all.
michael@0 33 */
michael@0 34 const unsigned long NO_EXECUTION = 0;
michael@0 35
michael@0 36 /**
michael@0 37 * Execute in a sandbox, no matter how the various principals involved are
michael@0 38 * related to each other.
michael@0 39 */
michael@0 40 const unsigned long EXECUTE_IN_SANDBOX = 1;
michael@0 41
michael@0 42 /**
michael@0 43 * Execute against the target environment if the principals allow it.
michael@0 44 */
michael@0 45 const unsigned long EXECUTE_NORMAL = 2;
michael@0 46
michael@0 47 /**
michael@0 48 * Whether and how the program represented by this channel is to be executed.
michael@0 49 * The default value if this property has never been set on this channel MUST
michael@0 50 * be either EXECUTE_IN_SANDBOX or NO_EXECUTION.
michael@0 51 *
michael@0 52 * @throws NS_ERROR_INVALID_ARG when set to an unrecognized value.
michael@0 53 */
michael@0 54 attribute unsigned long executionPolicy;
michael@0 55
michael@0 56 /**
michael@0 57 * Control whether the program should be executed synchronosly when
michael@0 58 * the channel's AsyncOpen method is called or whether it should be
michael@0 59 * executed asynchronously. In both cases, any data that the
michael@0 60 * channel returns will be returned asynchronously; the only thing
michael@0 61 * this property affects is when the program executes.
michael@0 62 *
michael@0 63 * The default value of this property is TRUE.
michael@0 64 *
michael@0 65 * Setting this property after asyncOpen has been called on the
michael@0 66 * channel has no effect.
michael@0 67 */
michael@0 68 attribute boolean executeAsync;
michael@0 69 };

mercurial