Backed out 2 changesets (bug 1816628) for causing OS X mochitests-plain failures...
[gecko.git] / ipc / glue / LaunchError.cpp
blob04ae34cfa67363318f6cc2e96d3fd9c49e41a9b9
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=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/. */
7 #include "LaunchError.h"
9 #if defined(XP_WIN)
10 # include "mozilla/WinHeaderOnlyUtils.h"
11 #endif
13 namespace mozilla::ipc {
15 LaunchError::LaunchError(const char* aFunction, OsError aError)
16 : mFunction(aFunction), mError(aError) {}
18 #if defined(XP_WIN)
19 LaunchError::LaunchError(const char* aFunction, PRErrorCode aError)
20 : mFunction(aFunction), mError((int)aError) {}
22 LaunchError::LaunchError(const char* aFunction, DWORD aError)
23 : mFunction(aFunction),
24 mError(WindowsError::FromWin32Error(aError).AsHResult()) {}
25 #endif // defined(XP_WIN)
27 const char* LaunchError::FunctionName() const { return mFunction; }
29 OsError LaunchError::ErrorCode() const { return mError; }
31 } // namespace mozilla::ipc