Skip to content

Commit

Permalink
Bug 1414121. P1 - let mozDumpDebugInfo() return a promise. r=bz
Browse files Browse the repository at this point in the history
MozReview-Commit-ID: Klfr3AYdSCG

--HG--
extra : rebase_source : 9f2c89306a274b1d563f53413df668d9b11c7b90
extra : source : 93969bf54c26fd097807f1280db5b6deb20c01db
  • Loading branch information
jwwang committed Nov 3, 2017
1 parent 60c5093 commit 7fd4aab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion dom/html/HTMLMediaElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1605,12 +1605,19 @@ HTMLMediaElement::MozRequestDebugInfo(ErrorResult& aRv)
return promise.forget();
}

void
already_AddRefed<Promise>
HTMLMediaElement::MozDumpDebugInfo()
{
ErrorResult rv;
RefPtr<Promise> promise = CreateDOMPromise(rv);
if (NS_WARN_IF(rv.Failed())) {
return nullptr;
}
if (mDecoder) {
mDecoder->DumpDebugInfo();
}
promise->MaybeResolveWithUndefined();
return promise.forget();
}

void
Expand Down
2 changes: 1 addition & 1 deletion dom/html/HTMLMediaElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ class HTMLMediaElement : public nsGenericHTMLElement,
// data from decoder/reader/MDSM. Used for debugging purposes.
already_AddRefed<Promise> MozRequestDebugInfo(ErrorResult& aRv);

void MozDumpDebugInfo();
already_AddRefed<Promise> MozDumpDebugInfo();

// For use by mochitests. Enabling pref "media.test.video-suspend"
void SetVisible(bool aVisible);
Expand Down
2 changes: 1 addition & 1 deletion dom/webidl/HTMLMediaElement.webidl
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ partial interface HTMLMediaElement {
Promise<DOMString> mozRequestDebugInfo();

[Pref="media.test.dumpDebugInfo"]
void mozDumpDebugInfo();
Promise<void> mozDumpDebugInfo();

attribute MediaStream? srcObject;

Expand Down

0 comments on commit 7fd4aab

Please sign in to comment.