Bug 134329 - [Mac] allow host application to canonicalize media urls
Summary: [Mac] allow host application to canonicalize media urls
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2014-06-25 20:31 PDT by Eric Carlson
Modified: 2014-06-26 09:46 PDT (History)
8 users (show)

See Also:


Attachments
Proposed patch. (2.21 KB, patch)
2014-06-25 20:40 PDT, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2014-06-25 20:31:54 PDT
OSX and iOS applications can modify load request with an NSURLProtocol subclass. This is supported for data that is loaded with WebCore's resource loader classes but because WebCore on iOS and OS X uses the system media engines to load media data, we should canonicalize a media url before passing it to the media framework.
Comment 1 Eric Carlson 2014-06-25 20:40:27 PDT
Created attachment 233869 [details]
Proposed patch.
Comment 2 Jer Noble 2014-06-25 21:19:02 PDT
Comment on attachment 233869 [details]
Proposed patch.

Before you check this in, is there a way to make it conditional on whether a custom protocol handler is installed for the scheme in question?
Comment 3 Jer Noble 2014-06-25 21:30:00 PDT
Drat, looks like there's not API for determining if there's a custom NSURLProtocol registered for a given scheme.  Carry on.
Comment 4 WebKit Commit Bot 2014-06-26 07:06:16 PDT
Comment on attachment 233869 [details]
Proposed patch.

Clearing flags on attachment: 233869

Committed r170478: <http://trac.webkit.org/changeset/170478>
Comment 5 WebKit Commit Bot 2014-06-26 07:06:21 PDT
All reviewed patches have been landed.  Closing bug.
Comment 6 Darin Adler 2014-06-26 09:46:18 PDT
Comment on attachment 233869 [details]
Proposed patch.

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

> Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:754
> -    NSURL *cocoaURL = URL(ParsedURLString, url);
> +    NSURL *cocoaURL = canonicalURL(url);

Where does the guarantee that this URL string came from a URL object come from? Can we change this to pass in the URL if we really need to rely on it being a parsed URL? Generally we need to avoid the pattern of using ParsedURLString.