mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
Bug 1108767
- Add MediaPromise::{Resolve,Reject}IfExists. r=cpearce
This commit is contained in:
parent
0f8a47ff4f
commit
dc54f0958e
@ -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