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_ByteLengthQueuingStrategy_h
8 #define mozilla_dom_ByteLengthQueuingStrategy_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/FunctionBinding.h"
16 #include "mozilla/dom/QueuingStrategyBinding.h"
17 #include "nsCycleCollectionParticipant.h"
18 #include "nsWrapperCache.h"
19 #include "nsIGlobalObject.h"
21 namespace mozilla::dom
{
22 class ByteLengthQueuingStrategy final
: public BaseQueuingStrategy
,
23 public nsWrapperCache
{
25 NS_DECL_ISUPPORTS_INHERITED
26 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
27 ByteLengthQueuingStrategy
, BaseQueuingStrategy
)
30 explicit ByteLengthQueuingStrategy(nsISupports
* aGlobal
,
31 double aHighWaterMark
)
32 : BaseQueuingStrategy(aGlobal
, aHighWaterMark
) {}
35 ~ByteLengthQueuingStrategy() override
= default;
38 JSObject
* WrapObject(JSContext
* aCx
,
39 JS::Handle
<JSObject
*> aGivenProto
) override
;
41 static already_AddRefed
<ByteLengthQueuingStrategy
> Constructor(
42 const GlobalObject
& aGlobal
, const QueuingStrategyInit
& aInit
);
44 already_AddRefed
<Function
> GetSize(ErrorResult
& aRv
);
47 } // namespace mozilla::dom