TestingDeprecatedInterface.h (1503B)
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/. */ 6 7 #ifndef mozilla_dom_TestingDeprecatedInterface_h 8 #define mozilla_dom_TestingDeprecatedInterface_h 9 10 #include "js/TypeDecls.h" 11 #include "mozilla/AlreadyAddRefed.h" 12 #include "nsCOMPtr.h" 13 #include "nsCycleCollectionParticipant.h" 14 #include "nsISupports.h" 15 #include "nsWrapperCache.h" 16 17 class nsIGlobalObject; 18 19 namespace mozilla::dom { 20 class GlobalObject; 21 22 class TestingDeprecatedInterface final : public nsISupports, 23 public nsWrapperCache { 24 public: 25 NS_DECL_CYCLE_COLLECTING_ISUPPORTS 26 NS_DECL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestingDeprecatedInterface) 27 28 static already_AddRefed<TestingDeprecatedInterface> Constructor( 29 const GlobalObject& aGlobal); 30 31 JSObject* WrapObject(JSContext* aCx, 32 JS::Handle<JSObject*> aGivenProto) override; 33 34 nsIGlobalObject* GetParentObject() const { return mGlobal; } 35 36 void DeprecatedMethod() const; 37 38 bool DeprecatedAttribute() const; 39 40 private: 41 explicit TestingDeprecatedInterface(nsIGlobalObject* aGlobal); 42 ~TestingDeprecatedInterface(); 43 44 nsCOMPtr<nsIGlobalObject> mGlobal; 45 }; 46 47 } // namespace mozilla::dom 48 49 #endif // mozilla_dom_TestingDeprecatedInterface_h