Bug 224038

Summary: Fix some missing exception checks in HTMLMediaElement methods.
Product: WebKit Reporter: Mark Lam <mark.lam>
Component: MediaAssignee: Mark Lam <mark.lam>
Status: RESOLVED FIXED    
Severity: Normal CC: calvaris, cdumez, changseok, eric.carlson, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, hi, jer.noble, mkwst, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch. eric.carlson: review+

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>.