[Mac, iOS] REGRESSION: WK2 YouTube support
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 May 2014 21:59:51 +0000 (21:59 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 May 2014 21:59:51 +0000 (21:59 +0000)
commit43455e7a03df0866bed492dabdd2404aca286a8e
tree651aacaf17ef48b35510d1a957902a42ea9a8ba1
parentcf11f123d897786109938cdc890111fa7c0b94a5
[Mac, iOS] REGRESSION: WK2 YouTube support
https://bugs.webkit.org/show_bug.cgi?id=132568
<rdar://problem/11464344>

Reviewed by Darin Adler.

Source/WebCore:
Move the custom YouTube loader code out of the WebFrameLoaderClient into a
PluginReplacement-based class.

* Modules/plugins/PluginReplacement.h:
(WebCore::PluginReplacement::supportsURL): New predicate so we can restrict
use of a plugin to a particular category of URLs.
* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::QuickTimePluginReplacement): Updated for new registrar signature.
* Modules/plugins/YouTubePluginReplacement.h: Added.
(WebCore::YouTubePluginReplacement::parentElement):
* Modules/plugins/YouTubePluginReplacement.cpp: Added.
(WebCore::YouTubePluginReplacement::registerPluginReplacement):
(WebCore::YouTubePluginReplacement::create):
(WebCore::YouTubePluginReplacement::supportsMimeType):
(WebCore::YouTubePluginReplacement::supportsFileExtension):
(WebCore::kit):
(WebCore::YouTubePluginReplacement::YouTubePluginReplacement):
(WebCore::YouTubePluginReplacement::createElementRenderer):
(WebCore::objectForKey):
(WebCore::YouTubePluginReplacement::installReplacement):
(WebCore::createYouTubeURL):
(WebCore::processAndCreateYouTubeURL):
(WebCore::YouTubePluginReplacement::youTubeURL):
* WebCore.exp.in: Add new export from WebCore.
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLPlugInElement.cpp:
(WebCore::pluginReplacementForType): Update to also check that the URL is supported
by the plugin.
(WebCore::registeredPluginReplacements): Add new YouTubePluginReplacement to registry.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::createElementRenderer): Remove custom YouTube code
now that this logic is handled in the plugin replacement class.
(WebCore::HTMLPlugInImageElement::createShadowIFrameSubtree): Deleted.
* html/HTMLPlugInImageElement.h:
* html/shadow/YouTubeEmbedShadowElement.cpp:
(WebCore::YouTubeEmbedShadowElement::YouTubeEmbedShadowElement):
(WebCore::YouTubeEmbedShadowElement::shadowPseudoId): Use correct pseudoID for the
plugin replacement architecture.
* html/shadow/YouTubeEmbedShadowElement.h:
* platform/mac/WebCoreNSURLExtras.h:
* platform/mac/WebCoreNSURLExtras.mm:
(WebCore::unescapedQueryValue): Moved from WebKit/Misc/WebNSURLExtras.
(WebCore::queryKeysAndValues): Ditto.

Source/WebKit/mac:
* Misc/WebNSURLExtras.h:
* Misc/WebNSURLExtras.mm: Remove code that has been converted to C++
and added to YouTubePluginReplacement.cpp.
(-[NSURL _webkit_youTubeURL]):
(-[NSString _webkit_queryKeysAndValues]):
(createYouTubeURL): Deleted.
(-[NSString _webkit_unescapedQueryValue]): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168442 268f45cc-cd09-0410-ab3c-d52691b4dbfc
17 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/plugins/PluginReplacement.h
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h
Source/WebCore/Modules/plugins/QuickTimePluginReplacement.mm
Source/WebCore/Modules/plugins/YouTubePluginReplacement.cpp [new file with mode: 0644]
Source/WebCore/Modules/plugins/YouTubePluginReplacement.h [new file with mode: 0644]
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLPlugInElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.cpp
Source/WebCore/html/HTMLPlugInImageElement.h
Source/WebCore/html/shadow/YouTubeEmbedShadowElement.cpp
Source/WebCore/html/shadow/YouTubeEmbedShadowElement.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebNSURLExtras.h
Source/WebKit/mac/Misc/WebNSURLExtras.mm
Source/WebKit/mac/WebCoreSupport/WebFrameLoaderClient.mm