summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/idl/mozIJSSubScriptLoader.idl
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /js/xpconnect/idl/mozIJSSubScriptLoader.idl
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/xpconnect/idl/mozIJSSubScriptLoader.idl')
-rw-r--r--js/xpconnect/idl/mozIJSSubScriptLoader.idl67
1 files changed, 67 insertions, 0 deletions
diff --git a/js/xpconnect/idl/mozIJSSubScriptLoader.idl b/js/xpconnect/idl/mozIJSSubScriptLoader.idl
new file mode 100644
index 000000000..1b5ed901b
--- /dev/null
+++ b/js/xpconnect/idl/mozIJSSubScriptLoader.idl
@@ -0,0 +1,67 @@
+/* -*- Mode: C++; tab-width: 4; 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"
+
+interface nsIURI;
+interface nsIPrincipal;
+interface nsIObserver;
+
+[scriptable, uuid(19533e7b-f321-4ef1-bc59-6e812dc2a733)]
+interface mozIJSSubScriptLoader : nsISupports
+{
+ /**
+ * This method should only be called from JS!
+ * In JS, the signature looks like:
+ * rv loadSubScript (url [, obj] [, charset]);
+ * @param url the url of the sub-script, it MUST be either a file:,
+ * resource:, or chrome: url, and MUST be local.
+ * @param obj an optional object to evaluate the script onto, it
+ * defaults to the global object of the caller.
+ * @param charset optionally specifies the character encoding of
+ * the file. If absent, the file is interpreted
+ * as ASCII.
+ * @retval rv the value returned by the sub-script
+ */
+ [implicit_jscontext]
+ jsval loadSubScript(in AString url, [optional] in jsval obj, [optional] in AString charset);
+
+ /**
+ * This method should only be called from JS!
+ * In JS, the signature looks like:
+ * rv = loadSubScript (url, optionsObject)
+ * @param url the url of the sub-script, it MUST be either a file:,
+ * resource:, or chrome: url, and MUST be local.
+ * @param optionsObject an object with parameters. Valid parameters are:
+ * - charset: specifying the character encoding of the file (default: ASCII)
+ * - target: an object to evaluate onto (default: global object of the caller)
+ * - ignoreCache: if set to true, will bypass the cache for reading the file.
+ * - async: if set to true, the script will be loaded
+ * asynchronously, and a Promise is returned which
+ * resolves to its result when execution is complete.
+ * @retval rv the value returned by the sub-script
+ */
+ [implicit_jscontext]
+ jsval loadSubScriptWithOptions(in AString url, in jsval options);
+
+ /*
+ * Compiles a JS script off the main thread and calls back the
+ * observer once it's done.
+ * The script will be cached in temporary or persistent storage depending
+ * on the principal used.
+ * We fire the notification callback in all cases - there is no fatal
+ * error there.
+ * @param uri the uri of the script to load.
+ * @param principal the principal from which we get the app id if any.
+ * @param observer this observer will be called once the script has
+ * been precompiled. The notification topic will be
+ * 'script-precompiled' and the subject the uri of the
+ * script as a nsIURI.
+ */
+ void precompileScript(in nsIURI uri,
+ in nsIPrincipal principal,
+ in nsIObserver observer);
+};