Bug 134329

Summary: [Mac] allow host application to canonicalize media urls
Product: WebKit Reporter: Eric Carlson <eric.carlson>
Component: MediaAssignee: Eric Carlson <eric.carlson>
Status: RESOLVED FIXED    
Severity: Normal CC: bunhere, cdumez, commit-queue, glenn, gyuyoung.kim, jer.noble, philipj, sergio
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Proposed patch. none

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.