nsClassInfoImpl.cpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "nsIClassInfoImpl.h"
  6. NS_IMETHODIMP_(MozExternalRefCountType)
  7. GenericClassInfo::AddRef()
  8. {
  9. return 2;
  10. }
  11. NS_IMETHODIMP_(MozExternalRefCountType)
  12. GenericClassInfo::Release()
  13. {
  14. return 1;
  15. }
  16. NS_IMPL_QUERY_INTERFACE(GenericClassInfo, nsIClassInfo)
  17. NS_IMETHODIMP
  18. GenericClassInfo::GetInterfaces(uint32_t* aCount, nsIID*** aArray)
  19. {
  20. return mData->getinterfaces(aCount, aArray);
  21. }
  22. NS_IMETHODIMP
  23. GenericClassInfo::GetScriptableHelper(nsIXPCScriptable** aHelper)
  24. {
  25. if (mData->getscriptablehelper) {
  26. return mData->getscriptablehelper(aHelper);
  27. }
  28. return NS_ERROR_NOT_IMPLEMENTED;
  29. }
  30. NS_IMETHODIMP
  31. GenericClassInfo::GetContractID(char** aContractID)
  32. {
  33. NS_ERROR("GetContractID not implemented");
  34. *aContractID = nullptr;
  35. return NS_ERROR_NOT_IMPLEMENTED;
  36. }
  37. NS_IMETHODIMP
  38. GenericClassInfo::GetClassDescription(char** aDescription)
  39. {
  40. *aDescription = nullptr;
  41. return NS_ERROR_NOT_IMPLEMENTED;
  42. }
  43. NS_IMETHODIMP
  44. GenericClassInfo::GetClassID(nsCID** aClassID)
  45. {
  46. NS_ERROR("GetClassID not implemented");
  47. *aClassID = nullptr;
  48. return NS_ERROR_NOT_IMPLEMENTED;
  49. }
  50. NS_IMETHODIMP
  51. GenericClassInfo::GetFlags(uint32_t* aFlags)
  52. {
  53. *aFlags = mData->flags;
  54. return NS_OK;
  55. }
  56. NS_IMETHODIMP
  57. GenericClassInfo::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc)
  58. {
  59. *aClassIDNoAlloc = mData->cid;
  60. return NS_OK;
  61. }