js/xpconnect/idl/mozIJSSubScriptLoader.idl

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 *
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #include "nsISupports.idl"
michael@0 8
michael@0 9 interface nsIURI;
michael@0 10 interface nsIPrincipal;
michael@0 11 interface nsIObserver;
michael@0 12
michael@0 13 [scriptable, uuid(19533e7b-f321-4ef1-bc59-6e812dc2a733)]
michael@0 14 interface mozIJSSubScriptLoader : nsISupports
michael@0 15 {
michael@0 16 /**
michael@0 17 * This method should only be called from JS!
michael@0 18 * In JS, the signature looks like:
michael@0 19 * rv loadSubScript (url [, obj] [, charset]);
michael@0 20 * @param url the url of the sub-script, it MUST be either a file:,
michael@0 21 * resource:, or chrome: url, and MUST be local.
michael@0 22 * @param obj an optional object to evaluate the script onto, it
michael@0 23 * defaults to the global object of the caller.
michael@0 24 * @param charset optionally specifies the character encoding of
michael@0 25 * the file. If absent, the file is interpreted
michael@0 26 * as ASCII.
michael@0 27 * @retval rv the value returned by the sub-script
michael@0 28 */
michael@0 29 [implicit_jscontext]
michael@0 30 jsval loadSubScript(in AString url, [optional] in jsval obj, [optional] in AString charset);
michael@0 31
michael@0 32 /**
michael@0 33 * This method should only be called from JS!
michael@0 34 * In JS, the signature looks like:
michael@0 35 * rv = loadSubScript (url, optionsObject)
michael@0 36 * @param url the url of the sub-script, it MUST be either a file:,
michael@0 37 * resource:, or chrome: url, and MUST be local.
michael@0 38 * @param optionsObject an object with parameters. Valid parameters are:
michael@0 39 * - charset: specifying the character encoding of the file (default: ASCII)
michael@0 40 * - target: an object to evaluate onto (default: global object of the caller)
michael@0 41 * - ignoreCache: if set to true, will bypass the cache for reading the file.
michael@0 42 * @retval rv the value returned by the sub-script
michael@0 43 */
michael@0 44 [implicit_jscontext]
michael@0 45 jsval loadSubScriptWithOptions(in AString url, in jsval options);
michael@0 46
michael@0 47 /*
michael@0 48 * Compiles a JS script off the main thread and calls back the
michael@0 49 * observer once it's done.
michael@0 50 * The script will be cached in temporary or persistent storage depending
michael@0 51 * on the principal used.
michael@0 52 * We fire the notification callback in all cases - there is no fatal
michael@0 53 * error there.
michael@0 54 * @param uri the uri of the script to load.
michael@0 55 * @param principal the principal from which we get the app id if any.
michael@0 56 * @param observer this observer will be called once the script has
michael@0 57 * been precompiled. The notification topic will be
michael@0 58 * 'script-precompiled' and the subject the uri of the
michael@0 59 * script as a nsIURI.
michael@0 60 */
michael@0 61 void precompileScript(in nsIURI uri,
michael@0 62 in nsIPrincipal principal,
michael@0 63 in nsIObserver observer);
michael@0 64 };

mercurial