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_TestingDeprecatedInterface_h
8 #define mozilla_dom_TestingDeprecatedInterface_h
10 #include "js/TypeDecls.h"
11 #include "mozilla/AlreadyAddRefed.h"
12 #include "mozilla/Assertions.h"
14 #include "nsCycleCollectionParticipant.h"
15 #include "nsISupports.h"
16 #include "nsWrapperCache.h"
18 class nsIGlobalObject
;
24 class TestingDeprecatedInterface final
: public nsISupports
,
25 public nsWrapperCache
{
27 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
28 NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(TestingDeprecatedInterface
)
30 static already_AddRefed
<TestingDeprecatedInterface
> Constructor(
31 const GlobalObject
& aGlobal
);
33 JSObject
* WrapObject(JSContext
* aCx
,
34 JS::Handle
<JSObject
*> aGivenProto
) override
;
36 nsIGlobalObject
* GetParentObject() const { return mGlobal
; }
38 void DeprecatedMethod() const;
40 bool DeprecatedAttribute() const;
43 explicit TestingDeprecatedInterface(nsIGlobalObject
* aGlobal
);
44 ~TestingDeprecatedInterface();
46 nsCOMPtr
<nsIGlobalObject
> mGlobal
;
50 } // namespace mozilla
52 #endif // mozilla_dom_TestingDeprecatedInterface_h