/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set ts=8 sts=2 et sw=2 tw=80: */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** Classes that hold strong references to JS GC things such as `JSObjects` and `JS::Values` (e.g. `JS::Heap<JSObject*> mFoo;`) must use these, generally by calling `HoldJSObjects(this)` and `DropJSObjects(this)` in the ctor and dtor respectively.
For classes that are wrapper cached and hold no other strong references to JS GC things, there's no need to call these; it will be taken care of automatically by nsWrapperCache.
**/ template <class T> void HoldJSObjects(T* aHolder) {
static_assert(!std::is_base_of<nsCycleCollectionParticipant, T>::value, "Don't call this on the CC participant but on the object that " "it's for (in an Unlink implementation it's usually stored in " "a variable named 'tmp').");
HoldDropJSObjectsHelper<T>::Hold(aHolder);
}
template <class T> void DropJSObjects(T* aHolder) {
static_assert(!std::is_base_of<nsCycleCollectionParticipant, T>::value, "Don't call this on the CC participant but on the object that " "it's for (in an Unlink implementation it's usually stored in " "a variable named 'tmp').");
HoldDropJSObjectsHelper<T>::Drop(aHolder);
}
} // namespace mozilla
#endif// mozilla_HoldDropJSObjects_h
¤ Dauer der Verarbeitung: 0.1 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.