Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / bindings / test / TestInterfaceSetlike.h
blobc99a0240ea863ea968bbddf8a3cc020dd3468fff
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_TestInterfaceSetlike_h
8 #define mozilla_dom_TestInterfaceSetlike_h
10 #include "nsWrapperCache.h"
11 #include "nsCOMPtr.h"
13 class nsPIDOMWindowInner;
15 namespace mozilla {
17 class ErrorResult;
19 namespace dom {
21 class GlobalObject;
23 // Implementation of test binding for webidl setlike interfaces, using
24 // primitives for key type.
25 class TestInterfaceSetlike final : public nsISupports, public nsWrapperCache {
26 public:
27 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
28 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestInterfaceSetlike)
29 explicit TestInterfaceSetlike(JSContext* aCx, nsPIDOMWindowInner* aParent);
30 nsPIDOMWindowInner* GetParentObject() const;
31 virtual JSObject* WrapObject(JSContext* aCx,
32 JS::Handle<JSObject*> aGivenProto) override;
33 static already_AddRefed<TestInterfaceSetlike> Constructor(
34 const GlobalObject& aGlobal, ErrorResult& rv);
36 private:
37 virtual ~TestInterfaceSetlike() = default;
38 nsCOMPtr<nsPIDOMWindowInner> mParent;
41 } // namespace dom
42 } // namespace mozilla
44 #endif // mozilla_dom_TestInterfaceSetlike_h