2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2013-11-05 18:16:24 +04:00
|
|
|
/* 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/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
2018-02-08 10:26:05 +03:00
|
|
|
* https://html.spec.whatwg.org/multipage/workers.html
|
2013-11-05 18:16:24 +04:00
|
|
|
*
|
|
|
|
* © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and Opera
|
|
|
|
* Software ASA.
|
|
|
|
* You are granted a license to use, reproduce and create derivative works of
|
|
|
|
* this document.
|
|
|
|
*/
|
|
|
|
|
2019-09-12 14:01:17 +03:00
|
|
|
[Exposed=(Window,DedicatedWorker,SharedWorker)]
|
2013-11-05 18:16:24 +04:00
|
|
|
interface Worker : EventTarget {
|
2019-09-12 14:01:17 +03:00
|
|
|
[Throws]
|
|
|
|
constructor(USVString scriptURL, optional WorkerOptions options = {});
|
|
|
|
|
2013-11-05 18:16:24 +04:00
|
|
|
void terminate();
|
|
|
|
|
|
|
|
[Throws]
|
2018-10-29 18:26:30 +03:00
|
|
|
void postMessage(any message, sequence<object> transfer);
|
|
|
|
[Throws]
|
2019-07-03 10:52:35 +03:00
|
|
|
void postMessage(any message, optional PostMessageOptions aOptions = {});
|
2013-11-05 18:16:24 +04:00
|
|
|
|
|
|
|
attribute EventHandler onmessage;
|
2017-09-13 06:59:06 +03:00
|
|
|
attribute EventHandler onmessageerror;
|
2013-11-05 18:16:24 +04:00
|
|
|
};
|
|
|
|
|
2019-09-24 18:22:26 +03:00
|
|
|
Worker includes AbstractWorker;
|
2013-11-05 18:16:24 +04:00
|
|
|
|
2017-05-17 17:48:54 +03:00
|
|
|
dictionary WorkerOptions {
|
|
|
|
// WorkerType type = "classic"; TODO: Bug 1247687
|
|
|
|
// RequestCredentials credentials = "omit"; // credentials is only used if type is "module" TODO: Bug 1247687
|
|
|
|
DOMString name = "";
|
|
|
|
};
|
|
|
|
|
2019-09-12 14:01:17 +03:00
|
|
|
[Func="mozilla::dom::ChromeWorker::WorkerAvailable",
|
2018-10-21 03:02:53 +03:00
|
|
|
Exposed=(Window,DedicatedWorker,SharedWorker)]
|
2013-11-05 18:16:24 +04:00
|
|
|
interface ChromeWorker : Worker {
|
2019-09-12 14:01:17 +03:00
|
|
|
[Throws]
|
|
|
|
constructor(USVString scriptURL);
|
2013-11-05 18:16:24 +04:00
|
|
|
};
|