Allow the QuickTime plug-in to be replaced by script in an isolated word
https://bugs.webkit.org/show_bug.cgi?id=124900

Reviewed by Dean Jackson.

Source/WebCore: 

Test: plugins/quicktime-plugin-replacement.html

* CMakeLists.txt: Add new Modules path.
* DerivedSources.make: Add new files.
* GNUmakefile.am: Add new Modules path.
* GNUmakefile.list.am: Add new header.
* WebCore.vcxproj/WebCore.vcxproj: Add new header.
* WebCore.vcxproj/WebCoreCommon.props: Add new Modules path.
* WebCore.xcodeproj/project.pbxproj: Add new files.

* Modules/plugins: Added.
* Modules/plugins/PluginReplacement.h: Added. Defines the interface for a plug-in replacement.

Create a replacement for the QuickTime plug-in.
* Modules/plugins/QuickTimePluginReplacement.cpp: Added.
* Modules/plugins/QuickTimePluginReplacement.css: Added.
* Modules/plugins/QuickTimePluginReplacement.h: Added.
* Modules/plugins/QuickTimePluginReplacement.idl: Added.
* Modules/plugins/QuickTimePluginReplacement.js: Added.

Allow plug-in replacement to be enabled at runtime.
* bindings/generic/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setPluginReplacementEnabled):
(WebCore::RuntimeEnabledFeatures::pluginReplacementEnabled):

* bindings/js/JSDOMBinding.h:
(WebCore::toJS): Add toJS(... const String& ...).

* bindings/js/JSPluginElementFunctions.cpp:
(WebCore::pluginScriptObject): Give a plug-in replacement a first shot at defining the
    script interface.

* html/HTMLEmbedElement.cpp:
(WebCore::HTMLEmbedElement::updateWidget): Call base class requestObject.

* html/HTMLMediaElement.cpp:
(HTMLMediaElement::fileSize): New, passthrough to media engine.
* html/HTMLMediaElement.h:

* html/HTMLObjectElement.cpp:
(WebCore::HTMLObjectElement::updateWidget): Call base class requestObject.

Moved some logic that was previously used only for creating a plug-in snapshot to the base
class so it can be shared by a plug-in replacement.
* html/HTMLPlugInElement.cpp:
(WebCore::HTMLPlugInElement::HTMLPlugInElement): Initialize timer used to swap renderers.
(WebCore::HTMLPlugInElement::createRenderer): Allow plug-in replacement to create the renderer.
(WebCore::HTMLPlugInElement::swapRendererTimerFired): Create a shadow root.
(WebCore::HTMLPlugInElement::setDisplayState): Set the new state, prime the swap renderer 
    timer if necessary.
(WebCore::HTMLPlugInElement::didAddUserAgentShadowRoot): Tell the plug-in replacement to
    install itself in the new shadow DOM.
(WebCore::registeredPluginReplacements): Return vector of all registered plug-in replacements.
(WebCore::registerPluginReplacement): Add a plug-in replacement.
(WebCore::pluginReplacementForType): Find a plug-in replacement for a MIME type.
(WebCore::HTMLPlugInElement::requestObject): If there is a plug-in replacement for the MIME type,
    create it and set the display state.
(WebCore::HTMLPlugInElement::scriptObjectForPluginReplacement): Return the script object for 
    the current plug-in replacement, if any.
* html/HTMLPlugInElement.h:

Move some plug-in snapshot code into the base class.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): No need to initialize timer.
(WebCore::HTMLPlugInImageElement::setDisplayState): Call base class.
(WebCore::HTMLPlugInImageElement::createRenderer): Ditto.
(WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Ditto.
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Remove unnecessary class name.
(WebCore::HTMLPlugInImageElement::requestObject): New.
* html/HTMLPlugInImageElement.h:

* html/HTMLVideoElement.h: Make createRenderer public so the QuickTime plug-in replacement can
    call it.

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::fileSize): New.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:

* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::extraMemoryCost): totalBytes returns an unsigned long long.
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::fileSize):

* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::totalBytes): Return an unsigned long long.
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes): Ditto.

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup): Backup the plug-in replacement runtime setting.
(WebCore::InternalSettings::Backup::restoreTo): Restore it.
(WebCore::InternalSettings::setPluginReplacementEnabled): Set it.
* testing/InternalSettings.h:
* testing/InternalSettings.idl:

LayoutTests: 

* platform/efl/TestExpectations: Skip the new test.
* platform/gtk/TestExpectations: Ditto.
* platform/wincairo/TestExpectations: Ditto.
* plugins/quicktime-plugin-replacement.html: Added.
* plugins/quicktime-plugin-replacement-expected.txt: Added.
* plugins/resources/orange.mov: Replace movie compressed with ancient (and deprecated) 
    animated gif codec with one compressed with H.264 codec.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] The remote inspector does not show the base page.
https://bugs.webkit.org/show_bug.cgi?id=124942

Patch by László Langó <lango@inf.u-szeged.hu> on 2013-11-27
Reviewed by Gyuyoung Kim.

On EFL the remote inspector does not show the base page about
which pages are available for debug. This should be fixed for
further inspector development.

* Source/PlatformEfl.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make WKProcessGroup work with WKObject wrapping
https://bugs.webkit.org/show_bug.cgi?id=124952

Reviewed by Dan Bernstein.

* Shared/Cocoa/APIObject.mm:
(API::Object::newObject):
Add support for WKProcessGroup.

* UIProcess/API/mac/WKProcessGroup.mm:
(-[WKProcessGroup initWithInjectedBundleURL:]):
(-[WKProcessGroup dealloc]):
(-[WKProcessGroup API::]):
(-[WKProcessGroup _contextRef]):
(-[WKProcessGroup _geolocationProvider]):
Convert from wrapping the C-SPI type to storing the bits of the wrapped object inline

* UIProcess/API/mac/WKProcessGroupInternal.h: Added.
(WebKit::wrapper):
Add wrapper() helper and declare conformance to the WKObject protocol.

* UIProcess/WebContext.cpp:
(WebKit::WebContext::create):
(WebKit::WebContext::WebContext):
* UIProcess/WebContext.h:
Make the WebContext constructor public (for use with Object::constructInWrapper) and remove unused ProcessModel parameter.

* WebKit2.xcodeproj/project.pbxproj:
Add new file.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159829 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add accessors for the WKProcessGroup and WKBrowsingContextGroup on the WKBrowsingContextController
https://bugs.webkit.org/show_bug.cgi?id=124953

Reviewed by Dan Bernstein.

* UIProcess/API/mac/WKBrowsingContextController.h:
* UIProcess/API/mac/WKBrowsingContextController.mm:
(-[WKBrowsingContextController processGroup]):
(-[WKBrowsingContextController browsingContextGroup]):
Add accessors.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159830 268f45cc-cd09-0410-ab3c-d52691b4dbfc