IUnknownImpl.cpp 737 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* -*- Mode: C++; tab-width: 2; 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. */
  6. #include "IUnknownImpl.h"
  7. #include "nsDebug.h"
  8. namespace mozilla {
  9. namespace a11y {
  10. HRESULT
  11. GetHRESULT(nsresult aResult)
  12. {
  13. switch (aResult) {
  14. case NS_OK:
  15. return S_OK;
  16. case NS_ERROR_INVALID_ARG:
  17. return E_INVALIDARG;
  18. case NS_ERROR_OUT_OF_MEMORY:
  19. return E_OUTOFMEMORY;
  20. case NS_ERROR_NOT_IMPLEMENTED:
  21. return E_NOTIMPL;
  22. default:
  23. return E_FAIL;
  24. }
  25. }
  26. } // namespace a11y
  27. } // namespace mozilla