Bug 1936278 - Prevent search mode chiclet from being dismissed when clicking in page...
[gecko.git] / dom / bindings / RootedSequence.h
blobc41a48f8e153a2d73e254294787f490c4dbc393a
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozilla_dom_RootedSequence_h__
8 #define mozilla_dom_RootedSequence_h__
10 #include "mozilla/dom/BindingDeclarations.h"
11 #include "js/RootingAPI.h"
13 namespace mozilla::dom::binding_detail {
15 template <typename T>
16 class MOZ_RAII RootedAutoSequence final : public AutoSequence<T>,
17 private JS::CustomAutoRooter {
18 public:
19 template <typename CX>
20 explicit RootedAutoSequence(const CX& cx)
21 : AutoSequence<T>(), JS::CustomAutoRooter(cx) {}
23 virtual void trace(JSTracer* trc) override { DoTraceSequence(trc, *this); }
26 } // namespace mozilla::dom::binding_detail
28 #endif /* mozilla_dom_RootedSequence_h__ */