Bug 219961

Summary: [Cocoa] WebM format reader doesn't work with a url in a <source> element
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, darin, ews-watchlist, glenn, jer.noble, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch
none
Patch
ews-feeder: commit-queue-
Patch for landing
ews-feeder: commit-queue-
Patch for landing
ews-feeder: commit-queue-
Patch for landing
none
Final patch for landing
none
Address post-review comments.
none
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch none

Description Eric Carlson 2020-12-16 14:07:20 PST
The WebM format reader doesn't work if the source url is in a <source> element
Comment 1 Radar WebKit Bug Importer 2020-12-16 14:07:35 PST
<rdar://problem/72399014>
Comment 2 Eric Carlson 2020-12-16 17:21:45 PST
Created attachment 416374 [details]
Patch
Comment 3 Eric Carlson 2020-12-16 17:27:34 PST
Created attachment 416375 [details]
Patch
Comment 4 Eric Carlson 2020-12-16 17:35:00 PST
Created attachment 416376 [details]
Patch
Comment 5 Eric Carlson 2020-12-17 06:31:34 PST
Created attachment 416417 [details]
Patch
Comment 6 Andy Estes 2020-12-17 07:21:13 PST
Comment on attachment 416417 [details]
Patch

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

> Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp:484
> +    if (!os_variant_allows_internal_security_policies("com.apple.WebKit"))

Since the value won't change at runtime, can you break this out into a helper function that caches the result of os_variant_allows_internal_security_policies() in a static bool? This was my mistake from earlier, but maybe you can fix it while you're here :)
Comment 7 Andy Estes 2020-12-17 07:24:46 PST
Comment on attachment 416417 [details]
Patch

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

> Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp:447
> +bool SourceBufferParserWebM::m_formatReaderEnabled = false;

Since globals are initialized to 0 by default, no need for the ` = false` here.
Comment 8 Eric Carlson 2020-12-17 08:04:23 PST
Created attachment 416419 [details]
Patch
Comment 9 Eric Carlson 2020-12-17 08:41:14 PST
Created attachment 416420 [details]
Patch for landing
Comment 10 Eric Carlson 2020-12-17 09:03:31 PST
Created attachment 416425 [details]
Patch for landing
Comment 11 Eric Carlson 2020-12-17 09:28:50 PST
Created attachment 416428 [details]
Patch for landing
Comment 12 Eric Carlson 2020-12-17 11:33:48 PST
Created attachment 416443 [details]
Final patch for landing
Comment 13 EWS 2020-12-17 12:14:50 PST
Committed r270939: <https://trac.webkit.org/changeset/270939>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 416443 [details].
Comment 14 Darin Adler 2020-12-17 12:32:22 PST
Comment on attachment 416443 [details]
Final patch for landing

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

> Source/WebCore/platform/graphics/cocoa/SourceBufferParserWebM.cpp:483
> +#endif
> +
> +#if USE(APPLE_INTERNAL_SDK)

This should be elif so we don’t compile multiple return statements.
Comment 15 Eric Carlson 2020-12-17 13:50:19 PST
Reopening to attach new patch.
Comment 16 Eric Carlson 2020-12-17 13:50:19 PST
Created attachment 416465 [details]
Address post-review comments.
Comment 17 EWS 2020-12-17 15:15:12 PST
Committed r270952: <https://trac.webkit.org/changeset/270952>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 416465 [details].
Comment 18 Darin Adler 2020-12-17 15:57:56 PST
Comment on attachment 416419 [details]
Patch

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

> Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:105
> +    static auto cache = makeNeverDestroyed([this] {
> +        UNUSED_PARAM(this);

Why do we capture "this"?
Comment 19 Eric Carlson 2020-12-17 16:17:03 PST
Comment on attachment 416419 [details]
Patch

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

>> Source/WebCore/platform/graphics/avfoundation/objc/AVAssetMIMETypeCache.mm:105
>> +        UNUSED_PARAM(this);
> 
> Why do we capture "this"?

That was left over from a earlier version of the patch, but it was removed before landing.
Comment 20 Ryan Haddad 2020-12-21 12:49:26 PST
Reverted r270939 and r270952 for reason:

Caused layout test timeouts on internal bots

Committed r271038: <https://trac.webkit.org/changeset/271038>
Comment 21 Ryan Haddad 2020-12-21 12:49:28 PST
Reverted r270939 and r270952 for reason:

Caused layout test timeouts on internal bots

Committed r271038: <https://trac.webkit.org/changeset/271038>
Comment 22 Ryan Haddad 2020-12-21 13:03:46 PST
Details in rdar://72484508
Comment 23 Eric Carlson 2021-01-05 16:23:31 PST
Created attachment 417051 [details]
Patch
Comment 24 Eric Carlson 2021-01-05 17:05:02 PST
Created attachment 417058 [details]
Patch
Comment 25 Eric Carlson 2021-01-05 17:13:42 PST
Created attachment 417060 [details]
Patch
Comment 26 Eric Carlson 2021-01-05 17:23:53 PST
Created attachment 417061 [details]
Patch
Comment 27 Eric Carlson 2021-01-05 17:33:16 PST
Created attachment 417062 [details]
Patch
Comment 28 EWS 2021-01-05 23:26:41 PST
Committed r271194: <https://trac.webkit.org/changeset/271194>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417062 [details].