ServiceWorkerJobQueue.h 1005 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* -*- Mode: C++; tab-width: 8; 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. #ifndef mozilla_dom_workers_serviceworkerjobqueue_h
  6. #define mozilla_dom_workers_serviceworkerjobqueue_h
  7. #include "mozilla/RefPtr.h"
  8. #include "nsTArray.h"
  9. namespace mozilla {
  10. namespace dom {
  11. namespace workers {
  12. class ServiceWorkerJob;
  13. class ServiceWorkerJobQueue final
  14. {
  15. class Callback;
  16. nsTArray<RefPtr<ServiceWorkerJob>> mJobList;
  17. ~ServiceWorkerJobQueue();
  18. void
  19. JobFinished(ServiceWorkerJob* aJob);
  20. void
  21. RunJob();
  22. public:
  23. ServiceWorkerJobQueue();
  24. void
  25. ScheduleJob(ServiceWorkerJob* aJob);
  26. void
  27. CancelAll();
  28. NS_INLINE_DECL_REFCOUNTING(ServiceWorkerJobQueue)
  29. };
  30. } // namespace workers
  31. } // namespace dom
  32. } // namespace mozilla
  33. #endif // mozilla_dom_workers_serviceworkerjobqueue_h