ScriptLoadRequestList.h (1452B)
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */ 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 js_loader_ScriptLoadRequestList_h 8 #define js_loader_ScriptLoadRequestList_h 9 10 #include "mozilla/LinkedList.h" 11 #include "nsCOMPtr.h" 12 13 namespace JS { 14 namespace loader { 15 16 class ScriptLoadRequest; 17 18 class ScriptLoadRequestList : private mozilla::LinkedList<ScriptLoadRequest> { 19 using super = mozilla::LinkedList<ScriptLoadRequest>; 20 21 public: 22 ~ScriptLoadRequestList(); 23 24 void CancelRequestsAndClear(); 25 26 #ifdef DEBUG 27 bool Contains(ScriptLoadRequest* aElem) const; 28 #endif // DEBUG 29 30 using super::getFirst; 31 using super::isEmpty; 32 33 void AppendElement(ScriptLoadRequest* aElem); 34 35 already_AddRefed<ScriptLoadRequest> Steal(ScriptLoadRequest* aElem); 36 37 already_AddRefed<ScriptLoadRequest> StealFirst(); 38 39 void Remove(ScriptLoadRequest* aElem); 40 }; 41 42 void ImplCycleCollectionUnlink(ScriptLoadRequestList& aField); 43 44 void ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, 45 ScriptLoadRequestList& aField, 46 const char* aName, uint32_t aFlags); 47 48 } // namespace loader 49 } // namespace JS 50 51 #endif // js_loader_ScriptLoadRequestList_h