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