mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1108767 - Add MediaPromise::{Resolve,Reject}IfExists. r=cpearce
This commit is contained in:
parent
72252dd9bc
commit
e9cb8ab7de
@ -316,6 +316,14 @@ public:
|
||||
mPromise = nullptr;
|
||||
}
|
||||
|
||||
void ResolveIfExists(typename PromiseType::ResolveValueType aResolveValue,
|
||||
const char* aMethodName)
|
||||
{
|
||||
if (!IsEmpty()) {
|
||||
Resolve(aResolveValue, aMethodName);
|
||||
}
|
||||
}
|
||||
|
||||
void Reject(typename PromiseType::RejectValueType aRejectValue,
|
||||
const char* aMethodName)
|
||||
{
|
||||
@ -327,6 +335,14 @@ public:
|
||||
mPromise = nullptr;
|
||||
}
|
||||
|
||||
void RejectIfExists(typename PromiseType::RejectValueType aRejectValue,
|
||||
const char* aMethodName)
|
||||
{
|
||||
if (!IsEmpty()) {
|
||||
Reject(aRejectValue, aMethodName);
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
Monitor* mMonitor;
|
||||
nsRefPtr<PromiseType> mPromise;
|
||||
|
Loading…
Reference in New Issue
Block a user