tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

WebTaskScheduling.webidl (1464B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
      4 
      5 enum TaskPriority {
      6  "user-blocking",
      7  "user-visible",
      8  "background"
      9 };
     10 
     11 dictionary TaskSignalAnyInit {
     12  (TaskPriority or TaskSignal) priority = "user-visible";
     13 };
     14 
     15 [Exposed=(Window, Worker), Pref="dom.enable_web_task_scheduling"]
     16 interface TaskSignal : AbortSignal {
     17  [NewObject] static TaskSignal _any(sequence<AbortSignal> signals, optional TaskSignalAnyInit init = {});
     18 
     19  readonly attribute TaskPriority priority;
     20 
     21  attribute EventHandler onprioritychange;
     22 };
     23 
     24 
     25 dictionary SchedulerPostTaskOptions {
     26  AbortSignal signal;
     27  TaskPriority priority;
     28  [EnforceRange] unsigned long long delay = 0;
     29 };
     30 
     31 callback SchedulerPostTaskCallback = any ();
     32 
     33 [Exposed=(Window, Worker), Pref="dom.enable_web_task_scheduling"]
     34 interface Scheduler {
     35  [UseCounter]
     36  Promise<any> postTask(
     37    SchedulerPostTaskCallback callback,
     38    optional SchedulerPostTaskOptions options = {}
     39  );
     40 
     41  [BinaryName="yieldImpl"]
     42  Promise<undefined> yield();
     43 };
     44 
     45 dictionary TaskControllerInit {
     46  TaskPriority priority = "user-visible";
     47 };
     48 
     49 [Exposed=(Window,Worker), Pref="dom.enable_web_task_scheduling"]
     50 interface TaskController : AbortController {
     51  [Throws]
     52  constructor(optional TaskControllerInit init = {});
     53 
     54  [Throws]
     55  undefined setPriority(TaskPriority priority);
     56 };