Bug 1812348 [wpt PR 38171] - wake lock: Move tests in web_tests/wake-lock to either...
[gecko.git] / dom / streams / CountQueuingStrategy.h
blobbbf109efbc91129ac3489b991c12be9a8b13fa04
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_CountQueuingStrategy_h
8 #define mozilla_dom_CountQueuingStrategy_h
10 #include "js/TypeDecls.h"
11 #include "mozilla/Attributes.h"
12 #include "mozilla/ErrorResult.h"
13 #include "mozilla/dom/BaseQueuingStrategy.h"
14 #include "mozilla/dom/BindingDeclarations.h"
15 #include "mozilla/dom/QueuingStrategyBinding.h"
16 #include "nsCycleCollectionParticipant.h"
17 #include "nsWrapperCache.h"
18 #include "nsIGlobalObject.h"
20 namespace mozilla::dom {
22 class CountQueuingStrategy final : public BaseQueuingStrategy,
23 public nsWrapperCache {
24 public:
25 NS_DECL_ISUPPORTS_INHERITED
26 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_INHERITED(CountQueuingStrategy,
27 BaseQueuingStrategy)
29 public:
30 explicit CountQueuingStrategy(nsISupports* aGlobal, double aHighWaterMark)
31 : BaseQueuingStrategy(aGlobal, aHighWaterMark) {}
33 protected:
34 ~CountQueuingStrategy() override = default;
36 public:
37 JSObject* WrapObject(JSContext* aCx,
38 JS::Handle<JSObject*> aGivenProto) override;
40 static already_AddRefed<CountQueuingStrategy> Constructor(
41 const GlobalObject& aGlobal, const QueuingStrategyInit& aInit);
43 already_AddRefed<Function> GetSize(ErrorResult& aRv);
46 } // namespace mozilla::dom
48 #endif // mozilla_dom_CountQueuingStrategy_h