Bug 224038 - Fix some missing exception checks in HTMLMediaElement methods.
Summary: Fix some missing exception checks in HTMLMediaElement methods.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-31 20:30 PDT by Mark Lam
Modified: 2021-04-01 08:36 PDT (History)
14 users (show)

See Also:


Attachments
proposed patch. (9.83 KB, patch)
2021-03-31 20:34 PDT, Mark Lam
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2021-03-31 20:30:29 PDT
rdar://69573092
Comment 1 Mark Lam 2021-03-31 20:34:41 PDT
Created attachment 424870 [details]
proposed patch.
Comment 2 Eric Carlson 2021-04-01 07:37:37 PDT
Comment on attachment 424870 [details]
proposed patch.

View in context: https://bugs.webkit.org/attachment.cgi?id=424870&action=review

> Source/WebCore/html/HTMLMediaElement.cpp:7277
> +        auto clearExceptionAndReturnFalse = [&] () -> bool {
> +            scope.clearException();
> +            return false;
> +        };

I think we might as well report the exception unless you know of a reason not to. Failing setup here will change the page behavior, so logging something may help us diagnose user problems.
Comment 3 Mark Lam 2021-04-01 08:36:41 PDT
Thanks for the review.

(In reply to Eric Carlson from comment #2)
> Comment on attachment 424870 [details]
> proposed patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=424870&action=review
> 
> > Source/WebCore/html/HTMLMediaElement.cpp:7277
> > +        auto clearExceptionAndReturnFalse = [&] () -> bool {
> > +            scope.clearException();
> > +            return false;
> > +        };
> 
> I think we might as well report the exception unless you know of a reason
> not to. Failing setup here will change the page behavior, so logging
> something may help us diagnose user problems.

I've applied this change.

Landed in r275361: <http://trac.webkit.org/r275361>.