Bumping manifests a=b2g-bump
[gecko.git] / dom / bindings / RootedDictionary.h
blob8dfe83d73edabc684291541ca33f12cd2b1bc44e
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"
12 #include "jsapi.h"
14 namespace mozilla {
15 namespace dom {
17 template<typename T>
18 class MOZ_STACK_CLASS RootedDictionary : public T,
19 private JS::CustomAutoRooter
21 public:
22 explicit RootedDictionary(JSContext* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) :
23 T(),
24 JS::CustomAutoRooter(cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)
28 virtual void trace(JSTracer *trc) MOZ_OVERRIDE
30 this->TraceDictionary(trc);
34 template<typename T>
35 class MOZ_STACK_CLASS NullableRootedDictionary : public Nullable<T>,
36 private JS::CustomAutoRooter
38 public:
39 explicit NullableRootedDictionary(JSContext* cx MOZ_GUARD_OBJECT_NOTIFIER_PARAM) :
40 Nullable<T>(),
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);
53 } // namespace dom
54 } // namespace mozilla
56 #endif /* mozilla_dom_RootedDictionary_h__ */