Closed
Bug 1299096
Opened 8 years ago
Closed 8 years ago
Remove the event-based play() method out from nsIDOMHTMLMediaElement.idl
Categories
(Core :: Audio/Video: Playback, defect, P3)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla53
Tracking | Status | |
---|---|---|
firefox53 | --- | fixed |
People
(Reporter: kaku, Assigned: kaku)
References
Details
Attachments
(1 file)
We are going to implement the promise-based play() method in the HTMLMediaElement.webidl (bug 1244768). Follow-up bug 1244768 comment 50, we want to remove the event-based play() method out from nsIDOMHTMLMediaElement.idl here.
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → kaku
Updated•8 years ago
|
Priority: -- → P3
Comment hidden (mozreview-request) |
Comment 2•8 years ago
|
||
Need a DOM peer to review that change.
Assignee | ||
Comment 3•8 years ago
|
||
Assignee | ||
Updated•8 years ago
|
Attachment #8818195 -
Flags: review?(bzbarsky)
Comment 4•8 years ago
|
||
mozreview-review |
Comment on attachment 8818195 [details]
Bug 1299096 - Remove the event-based play() method out from nsIDOMHTMLMediaElement.idl;
https://reviewboard.mozilla.org/r/98328/#review99578
r=me with the comments below fixed. I wish mozreview still had footers...
::: dom/html/HTMLMediaElement.cpp:893
(Diff revision 1)
> - nsresult rv = mOwner->Play();
> - if (NS_WARN_IF(NS_FAILED(rv))) {
> + ErrorResult rv;
> + RefPtr<Promise> toBeIgnored = mOwner->Play(rv);
> + MOZ_ASSERT_IF(toBeIgnored && toBeIgnored->State() == Promise::PromiseState::Rejected,
> + rv.Failed());
> + if (NS_WARN_IF(rv.Failed())) {
> + rv.StealNSResult();
This is a slightly odd pattern. Is the goal to have that warning from the NS_WARN_IF?
Because if the idea is to ignore the ErorResult, just make it an IgnoredErrorResult so it will suppress the exception automatically in its destructor. If you want to warn if rv.Failed(), I'd do it like so:
if (rv.Failed()) {
NS_WARNING(some-useful-text-here);
}
and drop the explicit return in trailing position in a void function...
Attachment #8818195 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 5•8 years ago
|
||
mozreview-review-reply |
Comment on attachment 8818195 [details]
Bug 1299096 - Remove the event-based play() method out from nsIDOMHTMLMediaElement.idl;
https://reviewboard.mozilla.org/r/98328/#review99578
> This is a slightly odd pattern. Is the goal to have that warning from the NS_WARN_IF?
>
> Because if the idea is to ignore the ErorResult, just make it an IgnoredErrorResult so it will suppress the exception automatically in its destructor. If you want to warn if rv.Failed(), I'd do it like so:
>
> if (rv.Failed()) {
> NS_WARNING(some-useful-text-here);
> }
>
> and drop the explicit return in trailing position in a void function...
Thanks for the review. I will modify the code to keep the warning.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 7•8 years ago
|
||
Comment 8•8 years ago
|
||
> Thanks for the review. I will modify the code to keep the warning.
Is there a reason you decided to use a manual SuppressException call instead of using IgnoredErrorResult like I suggested?
Flags: needinfo?(kaku)
Assignee | ||
Comment 9•8 years ago
|
||
(In reply to Boris Zbarsky [:bz] (still a bit busy) from comment #8)
> > Thanks for the review. I will modify the code to keep the warning.
>
> Is there a reason you decided to use a manual SuppressException call instead
> of using IgnoredErrorResult like I suggested?
No, sorry, I was confused somehow, and I think the right way is using IgnoredErrorResult, warning if it is failed and then suppress the exception automatically in the destructor. Will update the patch again.
Thanks for reminding.
Flags: needinfo?(kaku)
Comment hidden (mozreview-request) |
Assignee | ||
Comment 11•8 years ago
|
||
Updated•8 years ago
|
Attachment #8818195 -
Flags: review?(jwwang)
Comment hidden (mozreview-request) |
Assignee | ||
Comment 13•8 years ago
|
||
Comment 15•8 years ago
|
||
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3b46fcc012e5
Remove the event-based play() method out from nsIDOMHTMLMediaElement.idl; r=bz
Keywords: checkin-needed
Comment 16•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox53:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Updated•8 years ago
|
Keywords: dev-doc-needed,
site-compat
Comment 17•8 years ago
|
||
I guess this change won't affect site-compat.
Keywords: dev-doc-needed,
site-compat
You need to log in
before you can comment on or make changes to this bug.
Description
•