<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Add basic Media Session support to HTMLMediaElement"
href="https://bugs.webkit.org/show_bug.cgi?id=145581#c16">Comment # 16</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Add basic Media Session support to HTMLMediaElement"
href="https://bugs.webkit.org/show_bug.cgi?id=145581">bug 145581</a>
from <span class="vcard"><a class="email" href="mailto:mrajca@apple.com" title="Matt Rajca <mrajca@apple.com>"> <span class="fn">Matt Rajca</span></a>
</span></b>
<pre>(In reply to <a href="show_bug.cgi?id=145581#c15">comment #15</a>)
<span class="quote">> Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=254206&action=diff" name="attach_254206" title="Patch (speculative Windows build fix)">attachment 254206</a> <a href="attachment.cgi?id=254206&action=edit" title="Patch (speculative Windows build fix)">[details]</a></span>
> Patch (speculative Windows build fix)
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=254206&action=review">https://bugs.webkit.org/attachment.cgi?id=254206&action=review</a>
>
> >>> Source/WebCore/Modules/mediasession/HTMLMediaElementMediaSession.h:42
> >>> + static void setSession(HTMLMediaElement* element, MediaSession* session) { element->setSession(session); }
> >>
> >> These should all take HTMLMediaElement&, not HTMLMediaElement*.
> >
> > Per the Media Session spec, we should be able to set the session to null, which we won't be able to do with references.
>
> Then all the function bodies in this class, all of which unconditionally
> dereference the element pointer, are incorrect.
>
> Setting a session to null would depend on the type MediaSession*, not
> HTMLMediaElement*.</span >
I misread the original feedback. MediaSessions might be null, but HTMLMediaElements will never be null (when jsHTMLMediaElementSession calls these functions it will always pass in a HTMLMediaElement). We could use references, but those aren't compatible with the bindings generated. So I will leave pointers to HTMLMediaElements but add assertions (which is what we do in HTMLMediaElementMediaSource).</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>