accessible/src/windows/msaa/IUnknownImpl.cpp

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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  */
     8 #include "IUnknownImpl.h"
    10 #include "nsDebug.h"
    12 #ifdef MOZ_CRASHREPORTER
    13 #include "nsExceptionHandler.h"
    14 #endif
    16 namespace mozilla {
    17 namespace a11y {
    19 HRESULT
    20 GetHRESULT(nsresult aResult)
    21 {
    22   switch (aResult) {
    23     case NS_OK:
    24       return S_OK;
    26     case NS_ERROR_INVALID_ARG:
    27       return E_INVALIDARG;
    29     case NS_ERROR_OUT_OF_MEMORY:
    30       return E_OUTOFMEMORY;
    32     case NS_ERROR_NOT_IMPLEMENTED:
    33       return E_NOTIMPL;
    35     default:
    36       return E_FAIL;
    37   }
    38 }
    40 int
    41 FilterExceptions(unsigned int aCode, EXCEPTION_POINTERS* aExceptionInfo)
    42 {
    43   if (aCode == EXCEPTION_ACCESS_VIOLATION) {
    44 #ifdef MOZ_CRASHREPORTER
    45     // MSAA swallows crashes (because it is COM-based) but we still need to
    46     // learn about those crashes so we can fix them. Make sure to pass them to
    47     // the crash reporter.
    48     CrashReporter::WriteMinidumpForException(aExceptionInfo);
    49 #endif
    50   } else {
    51     NS_NOTREACHED("We should only be catching crash exceptions");
    52   }
    54   return EXCEPTION_CONTINUE_SEARCH;
    55 }
    57 } // namespace a11y
    58 } // namespace mozilla

mercurial