browser/app/winlauncher/test/moz.build
author Aaron Klotz <aklotz@mozilla.com>
Tue, 20 Nov 2018 20:27:06 +0000
changeset 503807 0ff2e89a18191e32118e7c0aed5b554cf1a00ec6
parent 486123 64c7e3b34869ce65e1ece5ff6bc61dcd17d94fe9
child 503808 7a3593c06bf77e7054d153180360f19a24c3f00b
permissions -rw-r--r--
Bug 1508468: Convert launcher process to use mozilla::Result for error propagation; r=mhowell This patch does a couple of things: * I added a new class, |WindowsError| to WinHeaderOnlyUtils. The idea here is to encapsulate as much of the Windows error gamut as possible into one class. Since Win32 errors and NTSTATUS codes may both be encoded as HRESULTs, I used the latter type to store the error. It also contains functions for converting between the various error code formats, as well as stringification via FormatMessage. * I added |LauncherError| which also includes file and line number information, which I believe will be important for launcher process failure diagnostics. (Instantiation of LauncherErrors obviously must be done via macros to capture __FILE__ and __LINE__). * I then converted all of the launcher process code (and its few depenencies) to utilize this new functionality via the new |LauncherResult| type. * If we detect an error in one of the top-level launcher process functions, we pass it to |HandleLauncherError| for processing. This function currently just throws up a |MessageBox| like the previous code did, with the intention of enhancing that further in the future. Differential Revision: https://phabricator.services.mozilla.com/D12365

# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

DisableStlWrapping()

GeckoCppUnitTests(['TestNativeNt'])

LOCAL_INCLUDES += [
    '/browser/app/winlauncher',
]

OS_LIBS += [
    'mincore',
    'ntdll',
]

if CONFIG['CC_TYPE'] == 'clang-cl':
    AllowCompilerWarnings()  # workaround for bug 1090497