tor-browser

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

CountQueuingStrategy.h (1642B)


      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/. */
      6 
      7 #ifndef mozilla_dom_CountQueuingStrategy_h
      8 #define mozilla_dom_CountQueuingStrategy_h
      9 
     10 #include "js/TypeDecls.h"
     11 #include "mozilla/ErrorResult.h"
     12 #include "mozilla/dom/BaseQueuingStrategy.h"
     13 #include "mozilla/dom/BindingDeclarations.h"
     14 #include "mozilla/dom/QueuingStrategyBinding.h"
     15 #include "nsCycleCollectionParticipant.h"
     16 #include "nsIGlobalObject.h"
     17 #include "nsWrapperCache.h"
     18 
     19 namespace mozilla::dom {
     20 
     21 class CountQueuingStrategy final : public BaseQueuingStrategy,
     22                                   public nsWrapperCache {
     23 public:
     24  NS_DECL_ISUPPORTS_INHERITED
     25  NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS_INHERITED(CountQueuingStrategy,
     26                                                        BaseQueuingStrategy)
     27 
     28 public:
     29  explicit CountQueuingStrategy(nsISupports* aGlobal, double aHighWaterMark)
     30      : BaseQueuingStrategy(aGlobal, aHighWaterMark) {}
     31 
     32 protected:
     33  ~CountQueuingStrategy() override = default;
     34 
     35 public:
     36  JSObject* WrapObject(JSContext* aCx,
     37                       JS::Handle<JSObject*> aGivenProto) override;
     38 
     39  static already_AddRefed<CountQueuingStrategy> Constructor(
     40      const GlobalObject& aGlobal, const QueuingStrategyInit& aInit);
     41 
     42  already_AddRefed<Function> GetSize(ErrorResult& aRv);
     43 };
     44 
     45 }  // namespace mozilla::dom
     46 
     47 #endif  // mozilla_dom_CountQueuingStrategy_h