1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-*/
2 /* vim: set ts=2 sw=2 et tw=79: */
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_RootedDictionary_h__
8 #define mozilla_dom_RootedDictionary_h__
10 #include "mozilla/GuardObjects.h"
11 #include "mozilla/dom/Nullable.h"
18 class MOZ_STACK_CLASS RootedDictionary
: public T
,
19 private JS::CustomAutoRooter
22 RootedDictionary(JSContext
* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM
) :
24 JS::CustomAutoRooter(cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT
)
28 virtual void trace(JSTracer
*trc
) MOZ_OVERRIDE
30 this->TraceDictionary(trc
);
35 class MOZ_STACK_CLASS NullableRootedDictionary
: public Nullable
<T
>,
36 private JS::CustomAutoRooter
39 NullableRootedDictionary(JSContext
* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM
) :
41 JS::CustomAutoRooter(cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT
)
45 virtual void trace(JSTracer
*trc
) MOZ_OVERRIDE
47 if (!this->IsNull()) {
48 this->Value().TraceDictionary(trc
);
54 } // namespace mozilla
56 #endif /* mozilla_dom_RootedDictionary_h__ */