tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

IUnknownImpl.cpp (774B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=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 
      8 #include "IUnknownImpl.h"
      9 
     10 #include "nsDebug.h"
     11 
     12 namespace mozilla {
     13 namespace a11y {
     14 
     15 HRESULT
     16 GetHRESULT(nsresult aResult) {
     17  switch (aResult) {
     18    case NS_OK:
     19      return S_OK;
     20 
     21    case NS_ERROR_INVALID_ARG:
     22      return E_INVALIDARG;
     23 
     24    case NS_ERROR_OUT_OF_MEMORY:
     25      return E_OUTOFMEMORY;
     26 
     27    case NS_ERROR_NOT_IMPLEMENTED:
     28      return E_NOTIMPL;
     29 
     30    default:
     31      return E_FAIL;
     32  }
     33 }
     34 
     35 }  // namespace a11y
     36 }  // namespace mozilla