Bug 1941128 - Turn off network.dns.native_https_query on Mac again
[gecko.git] / dom / bindings / test / TestInterfaceIterableSingle.h
blob68104d1d154ecb97a5090d089a6b6dd8cf9bdefc
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/. */
7 #ifndef mozilla_dom_TestInterfaceIterableSingle_h
8 #define mozilla_dom_TestInterfaceIterableSingle_h
10 #include "nsCOMPtr.h"
11 #include "nsWrapperCache.h"
12 #include "nsTArray.h"
14 class nsPIDOMWindowInner;
16 namespace mozilla {
18 class ErrorResult;
20 namespace dom {
22 class GlobalObject;
24 // Implementation of test binding for webidl iterable interfaces, using
25 // primitives for value type
26 class TestInterfaceIterableSingle final : public nsISupports,
27 public nsWrapperCache {
28 public:
29 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
30 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceIterableSingle)
32 explicit TestInterfaceIterableSingle(nsPIDOMWindowInner* aParent);
33 nsPIDOMWindowInner* GetParentObject() const;
34 virtual JSObject* WrapObject(JSContext* aCx,
35 JS::Handle<JSObject*> aGivenProto) override;
36 static already_AddRefed<TestInterfaceIterableSingle> Constructor(
37 const GlobalObject& aGlobal, ErrorResult& rv);
39 uint32_t Length() const;
40 int32_t IndexedGetter(uint32_t aIndex, bool& aFound) const;
42 private:
43 virtual ~TestInterfaceIterableSingle() = default;
44 nsCOMPtr<nsPIDOMWindowInner> mParent;
45 nsTArray<int32_t> mValues;
48 } // namespace dom
49 } // namespace mozilla
51 #endif // mozilla_dom_TestInterfaceIterableSingle_h