Bug 1333289. Part 1 - add a function to the webidl to retrieve debugging data in an asynchronous way. r=bz

MozReview-Commit-ID: AXTpOYaq56A
This commit is contained in:
JW Wang
2017-01-18 16:14:57 +08:00
parent 48a0567c4b
commit b094aaadf4
3 changed files with 21 additions and 0 deletions

View File

@@ -1471,6 +1471,21 @@ HTMLMediaElement::GetMozDebugReaderData(nsAString& aString)
}
}
already_AddRefed<Promise>
HTMLMediaElement::MozRequestDebugInfo(ErrorResult& aRv)
{
RefPtr<Promise> promise = CreateDOMPromise(aRv);
if (NS_WARN_IF(aRv.Failed())) {
return nullptr;
}
// TODO: collect data from MDSM which must be done off the main thread.
nsAutoString result;
GetMozDebugReaderData(result);
promise->MaybeResolve(result);
return promise.forget();
}
void
HTMLMediaElement::MozDumpDebugInfo()
{