JSActor.webidl (1753B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 8 interface mixin JSActor { 9 [Throws] 10 undefined sendAsyncMessage(DOMString messageName, 11 optional any obj, 12 optional any transferables); 13 14 /** 15 * Note that transfers are currently not supported by sendQuery. See Bug 1579536. 16 */ 17 [NewObject] 18 Promise<any> sendQuery(DOMString messageName, 19 optional any obj); 20 21 readonly attribute UTF8String name; 22 }; 23 24 /** 25 * WebIDL callback interface version of the nsIObserver interface for use when 26 * calling the observe method on JSActors. 27 * 28 * NOTE: This isn't marked as ChromeOnly, as it has no interface object, and 29 * thus cannot be conditionally exposed. 30 */ 31 [Exposed=Window] 32 callback interface MozObserverCallback { 33 undefined observe(nsISupports subject, ByteString topic, DOMString? data); 34 }; 35 36 /** 37 * WebIDL callback interface calling the `didDestroy`, and 38 * `actorCreated` methods on JSActors. 39 */ 40 [MOZ_CAN_RUN_SCRIPT_BOUNDARY] 41 callback MozJSActorCallback = undefined(); 42 43 /** 44 * The didDestroy method, if present, will be called after the actor is no 45 * longer able to receive any more messages. 46 * The actorCreated method, if present, will be called immediately after the 47 * actor has been created and initialized. 48 */ 49 [GenerateInit] 50 dictionary MozJSActorCallbacks { 51 [ChromeOnly] MozJSActorCallback didDestroy; 52 [ChromeOnly] MozJSActorCallback actorCreated; 53 };