Bug 1613643 - Fix build failure by Err(). a=bustage-fix-for-mingw CLOSED TREE

Differential Revision: https://phabricator.services.mozilla.com/D61822

--HG--
extra : rebase_source : 805991e6c97422c8442db2d4b5fa82135256538a
extra : amend_source : b1a8096bf8294c7d15f689ce2cdd728ad7d96d41
This commit is contained in:
Kagami Sascha Rosylight 2020-02-06 16:13:29 +01:00
Родитель 491fc8cf22
Коммит eafc671c89
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -273,6 +273,7 @@ WindowsUIUtils::UpdateTabletModeState() {
return NS_OK;
}
#ifndef __MINGW32__
struct HStringDeleter {
typedef HSTRING pointer;
void operator()(pointer aString) { WindowsDeleteString(aString); }
@ -286,21 +287,20 @@ mozilla::Result<HStringUniquePtr, HRESULT> ConvertToWindowsString(
HRESULT hr = WindowsCreateString(PromiseFlatString(aStr).get(), aStr.Length(),
&rawStr);
if (FAILED(hr)) {
return Err(hr);
return mozilla::Err(hr);
}
return HStringUniquePtr(rawStr);
}
#ifndef __MINGW32__
mozilla::Result<Ok, nsresult> RequestShare(
const std::function<HRESULT(IDataRequestedEventArgs* pArgs)>& aCallback) {
if (!IsWin10OrLater()) {
return Err(NS_ERROR_FAILURE);
return mozilla::Err(NS_ERROR_FAILURE);
}
HWND hwnd = GetForegroundWindow();
if (!hwnd) {
return Err(NS_ERROR_FAILURE);
return mozilla::Err(NS_ERROR_FAILURE);
}
ComPtr<IDataTransferManagerInterop> dtmInterop;
@ -313,7 +313,7 @@ mozilla::Result<Ok, nsresult> RequestShare(
IID_PPV_ARGS(&dtmInterop));
if (FAILED(hr) ||
FAILED(dtmInterop->GetForWindow(hwnd, IID_PPV_ARGS(&dtm)))) {
return Err(NS_ERROR_FAILURE);
return mozilla::Err(NS_ERROR_FAILURE);
}
auto callback = Callback<
@ -326,7 +326,7 @@ mozilla::Result<Ok, nsresult> RequestShare(
EventRegistrationToken dataRequestedToken;
if (FAILED(dtm->add_DataRequested(callback.Get(), &dataRequestedToken)) ||
FAILED(dtmInterop->ShowShareUIForWindow(hwnd))) {
return Err(NS_ERROR_FAILURE);
return mozilla::Err(NS_ERROR_FAILURE);
}
return Ok();
@ -336,8 +336,8 @@ mozilla::Result<Ok, nsresult> RequestShare(
RefPtr<SharePromise> WindowsUIUtils::Share(nsAutoString aTitle,
nsAutoString aText,
nsAutoString aUrl) {
auto promiseHolder = MakeRefPtr<
mozilla::media::Refcountable<MozPromiseHolder<SharePromise>>>();
auto promiseHolder = mozilla::MakeRefPtr<
mozilla::media::Refcountable<mozilla::MozPromiseHolder<SharePromise>>>();
RefPtr<SharePromise> promise = promiseHolder->Ensure(__func__);
#ifndef __MINGW32__