MozSharedMap.webidl (1516B)
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 7 typedef any StructuredClonable; 8 9 [ChromeOnly, Exposed=Window] 10 interface MozSharedMapChangeEvent : Event { 11 [Cached, Constant] 12 readonly attribute sequence<DOMString> changedKeys; 13 }; 14 15 dictionary MozSharedMapChangeEventInit : EventInit { 16 required sequence<DOMString> changedKeys; 17 }; 18 19 [ChromeOnly, Exposed=Window] 20 interface MozSharedMap : EventTarget { 21 boolean has(DOMString name); 22 23 [Throws] 24 StructuredClonable get(DOMString name); 25 26 iterable<DOMString, StructuredClonable>; 27 }; 28 29 [ChromeOnly, Exposed=Window] 30 interface MozWritableSharedMap : MozSharedMap { 31 /** 32 * Sets the given key to the given structured-clonable value. The value is 33 * synchronously structured cloned, and the serialized value is saved in the 34 * map. 35 * 36 * Unless flush() is called, the new value will be broadcast to content 37 * processes after a short delay. 38 */ 39 [Throws] 40 undefined set(DOMString name, StructuredClonable value); 41 42 /** 43 * Removes the given key from the map. 44 * 45 * Unless flush() is called, the removal will be broadcast to content 46 * processes after a short delay. 47 */ 48 undefined delete(DOMString name); 49 50 /** 51 * Broadcasts any pending changes to all content processes. 52 */ 53 undefined flush(); 54 };