BaseQueuingStrategy.h (1090B)
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_BaseQueuingStrategy_h 8 #define mozilla_dom_BaseQueuingStrategy_h 9 10 #include "nsCycleCollectionParticipant.h" 11 #include "nsIGlobalObject.h" 12 13 namespace mozilla::dom { 14 15 class BaseQueuingStrategy : public nsISupports { 16 public: 17 NS_DECL_CYCLE_COLLECTING_ISUPPORTS 18 NS_DECL_CYCLE_COLLECTION_CLASS(BaseQueuingStrategy) 19 20 BaseQueuingStrategy(nsISupports* aGlobal, double aHighWaterMark) 21 : mGlobal(do_QueryInterface(aGlobal)), mHighWaterMark(aHighWaterMark) {} 22 23 nsIGlobalObject* GetParentObject() const; 24 25 double HighWaterMark() const { return mHighWaterMark; } 26 27 protected: 28 virtual ~BaseQueuingStrategy() = default; 29 30 protected: 31 nsCOMPtr<nsIGlobalObject> mGlobal; 32 double mHighWaterMark = 0.0; 33 }; 34 35 } // namespace mozilla::dom 36 37 #endif