WebTaskController.h (1325B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim:expandtab:shiftwidth=2:tabstop=2: 3 */ 4 /* This Source Code Form is subject to the terms of the Mozilla Public 5 * License, v. 2.0. If a copy of the MPL was not distributed with this 6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 7 8 #ifndef mozilla_dom_WebTaskController_h 9 #define mozilla_dom_WebTaskController_h 10 11 #include "mozilla/dom/AbortController.h" 12 #include "mozilla/dom/WebTaskSchedulingBinding.h" 13 #include "nsWrapperCache.h" 14 15 namespace mozilla::dom { 16 class WebTaskController : public AbortController { 17 public: 18 explicit WebTaskController(nsIGlobalObject* aGlobal, TaskPriority aPriority); 19 20 static already_AddRefed<WebTaskController> Constructor( 21 const GlobalObject& aGlobal, const TaskControllerInit& aInit, 22 ErrorResult& aRv); 23 24 virtual JSObject* WrapObject(JSContext* aCx, 25 JS::Handle<JSObject*> aGivenProto) override; 26 27 void SetPriority(TaskPriority aPriority, ErrorResult& aRv); 28 29 private: 30 // https://wicg.github.io/scheduling-apis/#tasksignal-signal-priority-change 31 void SignalPriorityChange(TaskSignal* aTaskSignal, TaskPriority aPriority, 32 ErrorResult& aRv); 33 34 ~WebTaskController() = default; 35 }; 36 } // namespace mozilla::dom 37 38 #endif