<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[159827] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/159827">159827</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2013-11-27 17:05:35 -0800 (Wed, 27 Nov 2013)</dd>
</dl>
<h3>Log Message</h3>
<pre>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.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwincairoTestExpectations">trunk/LayoutTests/platform/wincairo/TestExpectations</a></li>
<li><a href="#trunkLayoutTestspluginsresourcesorangemov">trunk/LayoutTests/plugins/resources/orange.mov</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreDerivedSourcesmake">trunk/Source/WebCore/DerivedSources.make</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefileam">trunk/Source/WebCore/GNUmakefile.am</a></li>
<li><a href="#trunkSourceWebCoreGNUmakefilelistam">trunk/Source/WebCore/GNUmakefile.list.am</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCoreCommonprops">trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturesh">trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMBindingh">trunk/Source/WebCore/bindings/js/JSDOMBinding.h</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSPluginElementFunctionscpp">trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLEmbedElementcpp">trunk/Source/WebCore/html/HTMLEmbedElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementcpp">trunk/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaElementh">trunk/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLObjectElementcpp">trunk/Source/WebCore/html/HTMLObjectElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInElementcpp">trunk/Source/WebCore/html/HTMLPlugInElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInElementh">trunk/Source/WebCore/html/HTMLPlugInElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementcpp">trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLPlugInImageElementh">trunk/Source/WebCore/html/HTMLPlugInImageElement.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLVideoElementh">trunk/Source/WebCore/html/HTMLVideoElement.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayercpp">trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerh">trunk/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh">trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationh">trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFh">trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingscpp">trunk/Source/WebCore/testing/InternalSettings.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsh">trunk/Source/WebCore/testing/InternalSettings.h</a></li>
<li><a href="#trunkSourceWebCoretestingInternalSettingsidl">trunk/Source/WebCore/testing/InternalSettings.idl</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestspluginsquicktimepluginreplacementexpectedtxt">trunk/LayoutTests/plugins/quicktime-plugin-replacement-expected.txt</a></li>
<li><a href="#trunkLayoutTestspluginsquicktimepluginreplacementhtml">trunk/LayoutTests/plugins/quicktime-plugin-replacement.html</a></li>
<li>trunk/Source/WebCore/Modules/plugins/</li>
<li><a href="#trunkSourceWebCoreModulespluginsPluginReplacementh">trunk/Source/WebCore/Modules/plugins/PluginReplacement.h</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementcpp">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.cpp</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementcss">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.css</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementh">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementidl">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.idl</a></li>
<li><a href="#trunkSourceWebCoreModulespluginsQuickTimePluginReplacementjs">trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.js</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/LayoutTests/ChangeLog        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2013-11-27 Eric Carlson <eric.carlson@apple.com>
+
+ 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.
+
+ * 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.
+
</ins><span class="cx"> 2013-11-27 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
</span><span class="cx">
</span><span class="cx"> Adding MediaConstraintsMock class
</span></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -1751,3 +1751,6 @@
</span><span class="cx"> webkit.org/b/124890 platform/efl/accessibility/media-emits-object-replacement.html [ Failure ]
</span><span class="cx">
</span><span class="cx"> webkit.org/b/124894 accessibility/fieldset-element.html [ Missing ]
</span><ins>+
+# QuickTime plug-in not relevant to this port
+plugins/quicktime-plugin-replacement.html [ Skip ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -511,6 +511,9 @@
</span><span class="cx"> # crypto.subtle is not yet enabled
</span><span class="cx"> crypto/subtle [ Skip ]
</span><span class="cx">
</span><ins>+# QuickTime plug-in not relevant to this port
+plugins/quicktime-plugin-replacement.html [ Skip ]
+
</ins><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span><span class="cx"> # End of Expected failures
</span><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span></span></pre></div>
<a id="trunkLayoutTestsplatformwincairoTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/wincairo/TestExpectations        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -2853,3 +2853,6 @@
</span><span class="cx">
</span><span class="cx"> # crypto.subtle is not yet enabled
</span><span class="cx"> crypto/subtle [ Skip ]
</span><ins>+
+# QuickTime plug-in not relevant to this port
+plugins/quicktime-plugin-replacement.html [ Skip ]
</ins></span></pre></div>
<a id="trunkLayoutTestspluginsquicktimepluginreplacementexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/plugins/quicktime-plugin-replacement-expected.txt (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/quicktime-plugin-replacement-expected.txt         (rev 0)
+++ trunk/LayoutTests/plugins/quicktime-plugin-replacement-expected.txt        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,63 @@
</span><ins>+
+EVENT(qt_begin)
+EVENT(qt_validated)
+EVENT(qt_canplay)
+EVENT(qt_canplaythrough)
+
+** Test to make sure <video> element is in the shadow DOM.
+shadowElement = internals.shadowRoot(embed).firstChild
+PASS shadowElement.tagName is "VIDEO"
+PASS internals.shadowPseudoId(shadowElement) is "-webkit-plugin-replacement"
+
+** Test for the presence of overridden methods.
+PASS embed.SetURL is a function.
+PASS embed.GetURL is a function.
+PASS embed.Play is a function.
+PASS embed.Stop is a function.
+PASS embed.GetRate is a function.
+PASS embed.SetRate is a function.
+PASS embed.IsFullScreen is a function.
+PASS embed.ExitFullScreen is a function.
+PASS embed.GetPluginStatus is a function.
+PASS embed.GetTime is a function.
+PASS embed.SetTime is a function.
+PASS embed.SeekToDate is a function.
+PASS embed.GetDate is a function.
+PASS embed.GetDuration is a function.
+PASS embed.GetTimeScale is a function.
+PASS embed.GetMaxTimeLoaded is a function.
+PASS embed.GetMaxBytesLoaded is a function.
+PASS embed.GetMovieSize is a function.
+PASS embed.GetTimedMetadataUpdates is a function.
+PASS embed.GetAccessLog is a function.
+PASS embed.GetErrorLog is a function.
+
+** Test overridden methods.
+PASS embed.GetURL().indexOf('resources/orange.mov') != -1 is true
+PASS embed.GetDuration() is 300000
+PASS embed.GetMovieSize() is 24962
+PASS embed.GetMaxTimeLoaded() is 300000
+PASS embed.GetMaxBytesLoaded() is 24962
+PASS embed.GetMovieSize() is 24962
+PASS embed.GetPluginStatus() is "Playable"
+PASS new Date(embed.GetDate()) - new Date() is within 100 of 0
+embed.SetTime(embed.GetTimeScale() * 2)
+
+PASS embed.GetTime() is 60000
+embed.Play()
+
+EVENT(qt_play)
+PASS embed.GetRate() is 1
+embed.Stop()
+
+EVENT(qt_pause)
+PASS embed.GetRate() is 0
+
+embed.SetURL('')
+EVENT(qt_begin)
+EVENT(qt_error)
+PASS embed.GetURL() is ""
+PASS embed.GetPluginStatus() is "Error"
+
+END TEST.
+
</ins></span></pre></div>
<a id="trunkLayoutTestspluginsquicktimepluginreplacementhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/plugins/quicktime-plugin-replacement.html (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/plugins/quicktime-plugin-replacement.html         (rev 0)
+++ trunk/LayoutTests/plugins/quicktime-plugin-replacement.html        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,124 @@
</span><ins>+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../resources/js-test-pre.js"></script>
+ <script>
+ var embed;
+ var src = "resources/orange.mov";
+
+ function logEvent(event)
+ {
+ debug("<i>EVENT(" + event.type + ")</i>");
+ }
+
+ function seeked()
+ {
+ debug("");
+ shouldEvaluateTo("embed.GetTime()", embed.GetTimeScale() * 2);
+ evalAndLog("embed.Play()");
+ }
+
+ function playing(event)
+ {
+ debug("");
+ logEvent(event);
+ shouldEvaluateTo("embed.GetRate()", 1);
+ evalAndLog("embed.Stop()");
+ }
+
+ function paused(event)
+ {
+ debug("");
+ logEvent(event)
+ shouldEvaluateTo("embed.GetRate()", 0);
+
+ debug("");
+ evalAndLog("embed.SetURL('')");
+ }
+
+ function error(event)
+ {
+ logEvent(event)
+ shouldBeEqualToString("embed.GetURL()", "");
+ shouldBeEqualToString("embed.GetPluginStatus()", "Error");
+ debug("<br>END TEST.");
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+
+ function test(event)
+ {
+ logEvent(event)
+
+ if (window.internals) {
+ debug("<br>** Test to make sure &lt;video&gt; element is in the shadow DOM.");
+ evalAndLog("shadowElement = internals.shadowRoot(embed).firstChild");
+ shouldBeEqualToString("shadowElement.tagName", "VIDEO");
+ shouldBeEqualToString("internals.shadowPseudoId(shadowElement)", "-webkit-plugin-replacement");
+ } else {
+ debug("");
+ testFailed("This test must be run in DRT.");
+ debug("");
+ }
+
+ debug("<br>** Test for the presence of overridden methods.");
+ var methods = [ "SetURL", "GetURL", "Play", "Stop", "GetRate", "SetRate", "IsFullScreen",
+ "ExitFullScreen", "GetPluginStatus", "GetTime", "SetTime", "SeekToDate", "GetDate",
+ "GetDuration", "GetTimeScale", "GetMaxTimeLoaded", "GetMaxBytesLoaded",
+ "GetMovieSize", "GetTimedMetadataUpdates", "GetAccessLog", "GetErrorLog"
+ ];
+ for (i = 0; i < methods.length; ++i) {
+ var type = typeof embed[methods[i]];
+ if (type == "function")
+ testPassed("embed." + methods[i] + " is a function.");
+ else
+ testFailed("embed." + methods[i] + " should be a function but is \"" + type + "\".");
+ }
+
+ debug("<br>** Test overridden methods.");
+ shouldBeTrue("embed.GetURL().indexOf('" + src + "') != -1");
+ shouldEvaluateTo("embed.GetDuration()", 300000);
+ shouldEvaluateTo("embed.GetMovieSize()", 24962);
+ shouldEvaluateTo("embed.GetMaxTimeLoaded()", 300000);
+ shouldEvaluateTo("embed.GetMaxBytesLoaded()", 24962);
+ shouldEvaluateTo("embed.GetMovieSize()", 24962);
+ shouldBeEqualToString("embed.GetPluginStatus()", "Playable");
+
+ // "GetDate()" should return the current date, clear seconds and milliseconds
+ var now = new Date();
+ shouldBeCloseTo("new Date(embed.GetDate()) - new Date()", 0, 100);
+
+ evalAndLog("embed.SetTime(embed.GetTimeScale() * 2)");
+ setTimeout(seeked, 500);
+ }
+
+ function setup()
+ {
+ if (window.testRunner) {
+ window.testRunner.waitUntilDone();
+ window.testRunner.dumpAsText()
+ window.internals.settings.setPluginReplacementEnabled(true);
+ }
+ div = document.getElementById("parent");
+ div.innerHTML = '<embed src="' + src + '" width="640" height="480" postdomevents=true>';
+
+ var events = [ "qt_begin", "qt_validated", "qt_enterfullscreen", "qt_exitfullscreen",
+ "qt_loadedmetada", "qt_canplay", "qt_ended", "qt_timedmetadataupdated"
+ ];
+ embed = div.firstChild;
+ for (i = 0; i < events.length; ++i)
+ embed.addEventListener(events[i], logEvent, true);
+ embed.addEventListener("qt_canplaythrough", test, true);
+ embed.addEventListener("qt_play", playing, true);
+ embed.addEventListener("qt_pause", paused, true);
+ embed.addEventListener("qt_error", error, true);
+ }
+ </script>
+ </head>
+
+ <body onload="setup()">
+ <div id=parent></div>
+ <p>
+ <div id=console></div>
+ </body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestspluginsresourcesorangemov"></a>
<div class="binary"><h4>Modified: trunk/LayoutTests/plugins/resources/orange.mov</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/CMakeLists.txt        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -11,6 +11,7 @@
</span><span class="cx"> "${WEBCORE_DIR}/Modules/navigatorcontentutils"
</span><span class="cx"> "${WEBCORE_DIR}/Modules/networkinfo"
</span><span class="cx"> "${WEBCORE_DIR}/Modules/notifications"
</span><ins>+ "${WEBCORE_DIR}/Modules/plugins"
</ins><span class="cx"> "${WEBCORE_DIR}/Modules/proximity"
</span><span class="cx"> "${WEBCORE_DIR}/Modules/quota"
</span><span class="cx"> "${WEBCORE_DIR}/Modules/vibration"
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/ChangeLog        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -1,3 +1,109 @@
</span><ins>+2013-11-27 Eric Carlson <eric.carlson@apple.com>
+
+ 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.
+
+ 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:
+
</ins><span class="cx"> 2013-11-27 Thiago de Barros Lacerda <thiago.lacerda@openbossa.org>
</span><span class="cx">
</span><span class="cx"> Adding MediaConstraintsMock class
</span></span></pre></div>
<a id="trunkSourceWebCoreDerivedSourcesmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/DerivedSources.make (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/DerivedSources.make        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/DerivedSources.make        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> $(WebCore)/Modules/mediasource \
</span><span class="cx"> $(WebCore)/Modules/mediastream \
</span><span class="cx"> $(WebCore)/Modules/notifications \
</span><ins>+ $(WebCore)/Modules/plugins \
</ins><span class="cx"> $(WebCore)/Modules/quota \
</span><span class="cx"> $(WebCore)/Modules/speech \
</span><span class="cx"> $(WebCore)/Modules/webaudio \
</span><span class="lines">@@ -141,6 +142,7 @@
</span><span class="cx"> $(WebCore)/Modules/notifications/NotificationCenter.idl \
</span><span class="cx"> $(WebCore)/Modules/notifications/NotificationPermissionCallback.idl \
</span><span class="cx"> $(WebCore)/Modules/notifications/WorkerGlobalScopeNotifications.idl \
</span><ins>+ $(WebCore)/Modules/plugins/QuickTimePluginReplacement.idl \
</ins><span class="cx"> $(WebCore)/Modules/quota/DOMWindowQuota.idl \
</span><span class="cx"> $(WebCore)/Modules/quota/NavigatorStorageQuota.idl \
</span><span class="cx"> $(WebCore)/Modules/quota/StorageInfo.idl \
</span><span class="lines">@@ -870,6 +872,10 @@
</span><span class="cx">         USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/Modules/mediacontrols/mediaControlsApple.css
</span><span class="cx"> endif
</span><span class="cx">
</span><ins>+ifeq ($(OS),MACOS)
+        USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/Modules/plugins/QuickTimePluginReplacement.css
+endif
+
</ins><span class="cx"> UserAgentStyleSheets.h : css/make-css-file-arrays.pl bindings/scripts/preprocessor.pm $(USER_AGENT_STYLE_SHEETS) $(PLATFORM_FEATURE_DEFINES)
</span><span class="cx">         perl -I$(WebCore)/bindings/scripts $< --defines "$(FEATURE_DEFINES)" $@ UserAgentStyleSheetsData.cpp $(USER_AGENT_STYLE_SHEETS)
</span><span class="cx">
</span><span class="lines">@@ -883,6 +889,9 @@
</span><span class="cx">         USER_AGENT_SCRIPTS := $(USER_AGENT_SCRIPTS) $(WebCore)/Modules/mediacontrols/mediaControlsApple.js
</span><span class="cx"> endif
</span><span class="cx">
</span><ins>+ifeq ($(OS),MACOS)
+        USER_AGENT_SCRIPTS := $(USER_AGENT_SCRIPTS) $(WebCore)/Modules/plugins/QuickTimePluginReplacement.js
+endif
</ins><span class="cx">
</span><span class="cx"> UserAgentScripts.h : css/make-css-file-arrays.pl bindings/scripts/preprocessor.pm $(USER_AGENT_SCRIPTS) $(PLATFORM_FEATURE_DEFINES)
</span><span class="cx">         perl -I$(WebCore)/bindings/scripts $< --defines "$(FEATURE_DEFINES)" $@ UserAgentScriptsData.cpp $(USER_AGENT_SCRIPTS)
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.am (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.am        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/GNUmakefile.am        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -19,6 +19,7 @@
</span><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/mediastream \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/navigatorcontentutils \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/notifications \
</span><ins>+        -I$(srcdir)/Source/WebCore/Modules/plugins \
</ins><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/proximity \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/quota \
</span><span class="cx">         -I$(srcdir)/Source/WebCore/Modules/webaudio \
</span></span></pre></div>
<a id="trunkSourceWebCoreGNUmakefilelistam"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/GNUmakefile.list.am (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/GNUmakefile.list.am        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/GNUmakefile.list.am        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -1977,6 +1977,7 @@
</span><span class="cx">         Source/WebCore/Modules/notifications/NotificationPermissionCallback.h \
</span><span class="cx">         Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.cpp \
</span><span class="cx">         Source/WebCore/Modules/notifications/WorkerGlobalScopeNotifications.h \
</span><ins>+        Source/WebCore/Modules/plugins/PluginReplacement.h \
</ins><span class="cx">         Source/WebCore/Modules/proximity/DeviceProximityClient.h \
</span><span class="cx">         Source/WebCore/Modules/proximity/DeviceProximityController.cpp \
</span><span class="cx">         Source/WebCore/Modules/proximity/DeviceProximityController.h \
</span></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsPluginReplacementh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/PluginReplacement.h (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/PluginReplacement.h         (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/PluginReplacement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,91 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginReplacement_h
+#define PluginReplacement_h
+
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace JSC {
+class JSObject;
+}
+
+namespace WebCore {
+
+class HTMLPlugInElement;
+class RenderElement;
+class RenderStyle;
+class ShadowRoot;
+
+class PluginReplacement : public RefCounted<PluginReplacement> {
+public:
+ virtual ~PluginReplacement() { }
+
+ virtual bool installReplacement(ShadowRoot*) = 0;
+ virtual JSC::JSObject* scriptObject() { return 0; }
+
+ virtual bool willCreateRenderer() { return false; }
+ virtual RenderElement* createRenderer(HTMLPlugInElement&, PassRef<RenderStyle>) = 0;
+
+protected:
+ PluginReplacement() { }
+};
+
+typedef PassRefPtr<PluginReplacement> (*CreatePluginReplacement)(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
+typedef bool (*PluginReplacementSupportsType)(const String&);
+typedef bool (*PluginReplacementSupportsFileExtension)(const String&);
+
+class ReplacementPlugin {
+public:
+ ReplacementPlugin(CreatePluginReplacement constructor, PluginReplacementSupportsType supportsType, PluginReplacementSupportsFileExtension supportsFileExtension)
+ : m_constructor(constructor)
+ , m_supportsType(supportsType)
+ , m_supportsFileExtension(supportsFileExtension)
+ {
+ }
+
+ explicit ReplacementPlugin(const ReplacementPlugin& other)
+ : m_constructor(other.m_constructor)
+ , m_supportsType(other.m_supportsType)
+ , m_supportsFileExtension(other.m_supportsFileExtension)
+ {
+ }
+
+ PassRefPtr<PluginReplacement> create(HTMLPlugInElement& element, const Vector<String>& paramNames, const Vector<String>& paramValues) const { return m_constructor(element, paramNames, paramValues); }
+ bool supportsType(const String& mimeType) const { return m_supportsType(mimeType); }
+ bool supportsFileExtension(const String& extension) const { return m_supportsFileExtension(extension); }
+
+private:
+ CreatePluginReplacement m_constructor;
+ PluginReplacementSupportsType m_supportsType;
+ PluginReplacementSupportsFileExtension m_supportsFileExtension;
+};
+
+typedef void (*PluginReplacementRegistrar)(const ReplacementPlugin&);
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.cpp (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.cpp         (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,238 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+
+#if ENABLE(MEDIA_CONTROLS_SCRIPT)
+
+#include "QuickTimePluginReplacement.h"
+
+#include "Event.h"
+#include "HTMLPlugInElement.h"
+#include "HTMLVideoElement.h"
+#include "JSDOMBinding.h"
+#include "JSDOMGlobalObject.h"
+#include "JSHTMLVideoElement.h"
+#include "JSQuickTimePluginReplacement.h"
+#include "Logging.h"
+#include "MainFrame.h"
+#include "Page.h"
+#include "RenderElement.h"
+#include "ScriptController.h"
+#include "ScriptObject.h"
+#include "ScriptSourceCode.h"
+#include "UserAgentScripts.h"
+#include <JavaScriptCore/APICast.h>
+#include <JavaScriptCore/JSBase.h>
+#include <JavaScriptCore/JSCJSValueInlines.h>
+
+using namespace JSC;
+
+namespace WebCore {
+
+static String quickTimePluginReplacementScript()
+{
+ DEFINE_STATIC_LOCAL(String, script, (QuickTimePluginReplacementJavaScript, sizeof(QuickTimePluginReplacementJavaScript)));
+ return script;
+}
+
+void QuickTimePluginReplacement::registerPluginReplacement(PluginReplacementRegistrar registrar)
+{
+ registrar(ReplacementPlugin(create, supportsMimeType, supportsFileExtension));
+}
+
+PassRefPtr<PluginReplacement> QuickTimePluginReplacement::create(HTMLPlugInElement& plugin, const Vector<String>& paramNames, const Vector<String>& paramValues)
+{
+ return adoptRef(new QuickTimePluginReplacement(plugin, paramNames, paramValues));
+}
+
+bool QuickTimePluginReplacement::supportsMimeType(const String& mimeType)
+{
+ static const char* types[] = {
+ "application/vnd.apple.mpegurl", "application/x-mpegurl", "audio/3gpp", "audio/3gpp2", "audio/aac", "audio/aiff",
+ "audio/amr", "audio/basic", "audio/mp3", "audio/mp4", "audio/mpeg", "audio/mpeg3", "audio/mpegurl", "audio/scpls",
+ "audio/wav", "audio/x-aac", "audio/x-aiff", "audio/x-caf", "audio/x-m4a", "audio/x-m4b", "audio/x-m4p",
+ "audio/x-m4r", "audio/x-mp3", "audio/x-mpeg", "audio/x-mpeg3", "audio/x-mpegurl", "audio/x-scpls", "audio/x-wav",
+ "video/3gpp", "video/3gpp2", "video/mp4", "video/quicktime", "video/x-m4v"
+ };
+ DEFINE_STATIC_LOCAL(HashSet<String>, typeHash, ());
+ if (!typeHash.size()) {
+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(types); ++i)
+ typeHash.add(types[i]);
+ }
+
+ return typeHash.contains(mimeType);
+}
+
+bool QuickTimePluginReplacement::supportsFileExtension(const String& extension)
+{
+ static const char* extensions[] = {
+ "3g2", "3gp", "3gp2", "3gpp", "aac", "adts", "aif", "aifc", "aiff", "AMR", "au", "bwf", "caf", "cdda", "m3u",
+ "m3u8", "m4a", "m4b", "m4p", "m4r", "m4v", "mov", "mp3", "mp3", "mp4", "mpeg", "mpg", "mqv", "pls", "qt",
+ "snd", "swa", "ts", "ulw", "wav"
+ };
+ DEFINE_STATIC_LOCAL(HashSet<String>, extensionHash, ());
+ if (!extensionHash.size()) {
+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(extensions); ++i)
+ extensionHash.add(extensions[i]);
+ }
+
+ return extensionHash.contains(extension);
+}
+
+QuickTimePluginReplacement::QuickTimePluginReplacement(HTMLPlugInElement& plugin, const Vector<String>& paramNames, const Vector<String>& paramValues)
+ :PluginReplacement()
+ , m_parentElement(&plugin)
+ , m_names(paramNames)
+ , m_values(paramValues)
+ , m_scriptObject(nullptr)
+{
+}
+
+QuickTimePluginReplacement::~QuickTimePluginReplacement()
+{
+ m_parentElement = nullptr;
+ m_scriptObject = nullptr;
+ m_mediaElement = nullptr;
+}
+
+RenderElement* QuickTimePluginReplacement::createRenderer(HTMLPlugInElement& plugin, PassRef<RenderStyle> style)
+{
+ ASSERT_UNUSED(plugin, m_parentElement == &plugin);
+
+ if (m_mediaElement)
+ return m_mediaElement->createRenderer(std::move(style));
+
+ return 0;
+}
+
+DOMWrapperWorld& QuickTimePluginReplacement::isolatedWorld()
+{
+ static DOMWrapperWorld& isolatedWorld = *DOMWrapperWorld::create(JSDOMWindow::commonVM()).leakRef();
+ return isolatedWorld;
+}
+
+bool QuickTimePluginReplacement::ensureReplacementScriptInjected()
+{
+ Page* page = m_parentElement->document().page();
+ if (!page)
+ return false;
+
+ DOMWrapperWorld& world = isolatedWorld();
+ ScriptController& scriptController = page->mainFrame().script();
+ JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptController.globalObject(world));
+ ExecState* exec = globalObject->globalExec();
+
+ JSValue replacementFunction = globalObject->get(exec, Identifier(exec, "createPluginReplacement"));
+ if (replacementFunction.isFunction())
+ return true;
+
+ scriptController.evaluateInWorld(ScriptSourceCode(quickTimePluginReplacementScript()), world);
+ if (exec->hadException()) {
+ LOG(Plugins, "%p - Exception when evaluating QuickTime plugin replacement script", this);
+ exec->clearException();
+ return false;
+ }
+
+ return true;
+}
+
+bool QuickTimePluginReplacement::installReplacement(ShadowRoot* root)
+{
+ Page* page = m_parentElement->document().page();
+
+ if (!ensureReplacementScriptInjected())
+ return false;
+
+ DOMWrapperWorld& world = isolatedWorld();
+ ScriptController& scriptController = page->mainFrame().script();
+ JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(scriptController.globalObject(world));
+ ExecState* exec = globalObject->globalExec();
+ JSLockHolder lock(exec);
+
+ // Lookup the "createPluginReplacement" function.
+ JSValue replacementFunction = globalObject->get(exec, Identifier(exec, "createPluginReplacement"));
+ if (replacementFunction.isUndefinedOrNull())
+ return false;
+ JSObject* replacementObject = replacementFunction.toObject(exec);
+ CallData callData;
+ CallType callType = replacementObject->methodTable()->getCallData(replacementObject, callData);
+ if (callType == CallTypeNone)
+ return false;
+
+ MarkedArgumentBuffer argList;
+ argList.append(toJS(exec, globalObject, root));
+ argList.append(toJS(exec, globalObject, m_parentElement));
+ argList.append(toJS(exec, globalObject, this));
+ argList.append(toJS<String>(exec, globalObject, m_names));
+ argList.append(toJS<String>(exec, globalObject, m_values));
+ JSValue replacement = call(exec, replacementObject, callType, callData, globalObject, argList);
+ if (exec->hadException()) {
+ exec->clearException();
+ return false;
+ }
+
+ // Get the <video> created to replace the plug-in.
+ JSValue value = replacement.get(exec, Identifier(exec, "video"));
+ if (!exec->hadException() && !value.isUndefinedOrNull())
+ m_mediaElement = toHTMLVideoElement(value);
+
+ if (!m_mediaElement) {
+ LOG(Plugins, "%p - Failed to find <video> element created by QuickTime plugin replacement script.", this);
+ exec->clearException();
+ return false;
+ }
+
+ // Get the scripting interface.
+ value = replacement.get(exec, Identifier(exec, "scriptObject"));
+ if (!exec->hadException() && !value.isUndefinedOrNull())
+ m_scriptObject = value.toObject(exec);
+
+ if (!m_scriptObject) {
+ LOG(Plugins, "%p - Failed to find script object created by QuickTime plugin replacement.", this);
+ exec->clearException();
+ return false;
+ }
+
+ return true;
+}
+
+unsigned long long QuickTimePluginReplacement::movieSize() const
+{
+ if (m_mediaElement)
+ return m_mediaElement->fileSize();
+
+ return 0;
+}
+
+void QuickTimePluginReplacement::postEvent(const String& eventName)
+{
+ Ref<HTMLPlugInElement> protect(*m_parentElement);
+ RefPtr<Event> event = Event::create(eventName, false, true);
+ m_parentElement->dispatchEvent(event.get());
+}
+
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementcss"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.css (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.css         (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.css        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+embed::-webkit-plugin-replacement,
+object::-webkit-plugin-replacement
+{
+ position: relative;
+ display: inline-block;
+ width: 100%;
+ height: 100%;
+}
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h         (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,76 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef QuickTimePluginReplacement_h
+#define QuickTimePluginReplacement_h
+
+#include "PluginReplacement.h"
+#include "ScriptState.h"
+#include "ScriptValue.h"
+#include <wtf/RefCounted.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class HTMLPlugInElement;
+class HTMLVideoElement;
+class RenderElement;
+class RenderStyle;
+class ShadowRoot;
+
+class QuickTimePluginReplacement : public PluginReplacement {
+public:
+ static void registerPluginReplacement(PluginReplacementRegistrar);
+ static bool supportsMimeType(const String&);
+ static bool supportsFileExtension(const String&);
+
+ static PassRefPtr<PluginReplacement> create(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
+ ~QuickTimePluginReplacement();
+
+ virtual bool installReplacement(ShadowRoot*) OVERRIDE;
+ virtual JSC::JSObject* scriptObject() OVERRIDE { return m_scriptObject; }
+
+ virtual bool willCreateRenderer() OVERRIDE { return m_mediaElement; }
+ virtual RenderElement* createRenderer(HTMLPlugInElement&, PassRef<RenderStyle>) OVERRIDE;
+
+ unsigned long long movieSize() const;
+ void postEvent(const String&);
+
+private:
+ QuickTimePluginReplacement(HTMLPlugInElement&, const Vector<String>& paramNames, const Vector<String>& paramValues);
+
+ bool ensureReplacementScriptInjected();
+ DOMWrapperWorld& isolatedWorld();
+
+ HTMLPlugInElement* m_parentElement;
+ RefPtr<HTMLVideoElement> m_mediaElement;
+ const Vector<String> m_names;
+ const Vector<String> m_values;
+ JSC::JSObject* m_scriptObject;
+};
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementidl"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.idl (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.idl         (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.idl        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+ NoInterfaceObject,
+ OperationsNotDeletable,
+ JSGenerateToJSObject,
+] interface QuickTimePluginReplacement {
+ readonly attribute unsigned long long movieSize;
+ void postEvent(DOMString eventName);
+};
</ins></span></pre></div>
<a id="trunkSourceWebCoreModulespluginsQuickTimePluginReplacementjs"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.js (0 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.js         (rev 0)
+++ trunk/Source/WebCore/Modules/plugins/QuickTimePluginReplacement.js        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -0,0 +1,328 @@
</span><ins>+
+function createPluginReplacement(root, parent, host, attributeNames, attributeValues)
+{
+ return new Replacement(root, parent, host, attributeNames, attributeValues);
+};
+
+function Replacement(root, parent, host, attributeNames, attributeValues)
+{
+ this.root = root;
+ this.parent = parent;
+ this.host = host;
+ this.listeners = {};
+ this.scriptObject = {};
+
+ this.autoExitFullScreen = true;
+ this.postEvents = false;
+ this.height = 0;
+ this.width = 0;
+ this.src = '';
+ this.autohref = false;
+ this.href = '';
+ this.qtsrc = '';
+ this.target = '';
+
+ this.createVideoElement(attributeNames, attributeValues);
+ this.createScriptInterface();
+};
+
+Replacement.prototype = {
+
+ HandledVideoEvents: {
+ loadstart: 'handleLoadStart',
+ error: 'handleError',
+ loadedmetadata: 'handleLoadedMetaData',
+ canplay: 'qt_canplay',
+ canplaythrough: 'qt_canplaythrough',
+ play: 'qt_play',
+ pause: 'qt_pause',
+ ended: 'handleEnded',
+ webkitfullscreenchange: 'handleFullscreenChange',
+ },
+
+ AttributeMap: {
+ autoexitfullscreen: 'autoExitFullScreen',
+ postdomevents: 'postEvents',
+ height: 'height',
+ width: 'width',
+ src: 'src',
+ airplay: 'x-webkit-airplay=',
+ href: 'href',
+ target: 'target',
+ },
+
+ MethodMap: {
+ SetURL : 'setURL',
+ GetURL : 'url',
+ Play : 'play',
+ Stop : 'pause',
+ GetRate : 'rate',
+ SetRate : 'setRate',
+ IsFullScreen : 'isFullScreen',
+ ExitFullScreen : 'exitFullScreen',
+ GetPluginStatus : 'pluginStatus',
+ GetTime : 'currentTime',
+ SetTime : 'setCurrentTime',
+ SeekToDate : 'seekToDate',
+ GetDate : 'date',
+ GetDuration : 'duration',
+ GetTimeScale : 'timeScale',
+ GetMaxTimeLoaded : 'maxTimeLoaded',
+ GetMaxBytesLoaded : 'maxBytesLoaded',
+ GetMovieSize : 'movieSize',
+ GetTimedMetadataUpdates : 'timedMetadataUpdates',
+ GetAccessLog : 'accessLog',
+ GetErrorLog : 'errorLog',
+ },
+
+ TimeScale: 30000,
+
+ createVideoElement: function(attributeNames, attributeValues)
+ {
+ var video = this.video = document.createElement('video');
+
+ for (name in this.HandledVideoEvents)
+ video.addEventListener(name, this, false);
+
+ for (i = 0; i < attributeNames.length; i++) {
+ var property = this.AttributeMap[attributeNames[i]];
+ if (this[property] != undefined)
+ this[property] = attributeValues[i];
+ }
+
+ video.setAttribute('pseudo', '-webkit-plugin-replacement');
+ video.setAttribute('controls', 'controls');
+ this.setStatus('Waiting');
+
+ var src = this.src;
+ if (this.href && this.target) {
+ src = this.resolveRelativeToUrl(this.href, this.src);
+ video.poster = this.src;
+ video.setAttribute('preload', 'none');
+ }
+
+ if (src.length)
+ this.setURL(src);
+
+ this.root.appendChild(video);
+ },
+
+ resolveRelativeToUrl: function(url, baseUrl)
+ {
+ if (url.indexOf('://') != -1)
+ return url;
+ if (baseUrl.indexOf('://') == -1)
+ baseUrl = this.resolveRelativeToUrl(baseUrl, document.baseURI);
+
+ var base = document.createElement('base');
+ base.href = baseUrl;
+ document.head.appendChild(base);
+
+ var resolver = document.createElement('a');
+ resolver.href = url;
+ url = resolver.href;
+
+ document.head.removeChild(base);
+ base = null;
+
+ return url;
+ },
+
+ createScriptInterface: function()
+ {
+ for (name in this.MethodMap) {
+ var methodName = this.MethodMap[name];
+ this.scriptObject[name] = this[methodName].bind(this);
+ }
+ },
+
+ handleEvent: function(event)
+ {
+ if (event.target !== this.video)
+ return;
+
+ try {
+ var eventData = this.HandledVideoEvents[event.type];
+ if (!eventData)
+ return;
+
+ if (this[eventData] && this[eventData] instanceof Function)
+ this[eventData].call(this, event);
+ else
+ this.postEvent(eventData);
+ } catch(e) {
+ if (window.console)
+ console.error(e);
+ }
+ },
+
+ postEvent: function(eventName)
+ {
+ try {
+ if (this.postEvents)
+ this.host.postEvent(eventName);
+ } catch(e) { }
+ },
+
+ setStatus: function(status)
+ {
+ this.status = status;
+ },
+
+ handleLoadedMetaData: function(event)
+ {
+ this.setStatus('Playable');
+ this.postEvent('qt_validated');
+ this.postEvent('qt_loadedfirstframe');
+ this.postEvent('qt_loadedmetadata');
+ },
+
+ handleFullscreenChange: function(event)
+ {
+ this.postEvent(this.isFullScreen() ? 'qt_enterfullscreen' : 'qt_exitfullscreen');
+ },
+
+ handleError: function(event)
+ {
+ this.setStatus('Error');
+ this.postEvent('qt_error');
+ },
+
+ handleLoadStart:function(event)
+ {
+ if (this.video.poster)
+ this.setStatus('Waiting');
+ else
+ this.setStatus('Loading');
+ this.postEvent('qt_begin');
+ },
+
+ handleEnded: function(event)
+ {
+ this.postEvent('qt_ended');
+ if (this.isFullScreen() && this.autoExitFullScreen)
+ document.webkitExitFullscreen();
+ },
+
+ isFullScreen: function()
+ {
+ return document.webkitCurrentFullScreenElement === this.video;
+ },
+
+ setURL: function(url)
+ {
+ this.setStatus('Validating');
+ this.video.src = url;
+ },
+
+ url: function()
+ {
+ return this.video.currentSrc;
+ },
+
+ play: function()
+ {
+ this.video.play();
+ },
+
+ pause: function()
+ {
+ this.video.playbackRate = 0;
+ this.video.pause();
+ },
+
+ rate: function()
+ {
+ return this.video.paused ? 0 : 1;
+ },
+
+ setRate: function(rate)
+ {
+ if (rate)
+ this.video.play();
+ else
+ this.video.pause();
+ },
+
+ exitFullScreen: function()
+ {
+ document.webkitExitFullscreen();
+ },
+
+ pluginStatus: function()
+ {
+ return this.status;
+ },
+
+ currentTime: function()
+ {
+ return this.video.currentTime * this.TimeScale;
+ },
+
+ setCurrentTime: function(time)
+ {
+ this.video.currentTime = time / this.TimeScale;
+ },
+
+ seekToDate: function()
+ {
+ // FIXME: not implemented yet.
+ },
+
+ date: function()
+ {
+ return new Date();
+ },
+
+ duration: function()
+ {
+ return this.video.duration * this.TimeScale;
+ },
+
+ timeScale: function()
+ {
+ // Note: QuickTime movies and MPEG-4 files have a timescale, but it is not exposed by all media engines.
+ // 30000 works well with common frame rates, eg. 29.97 NTSC can be represented accurately as a time
+ // scale of 30000 and frame duration of 1001.
+ return 30000;
+ },
+
+ maxTimeLoaded: function()
+ {
+ return this.video.duration * this.TimeScale;
+ },
+
+ maxBytesLoaded: function()
+ {
+ var percentLoaded = this.video.buffered.end(0) / this.video.duration;
+ return percentLoaded * this.movieSize();
+ },
+
+ movieSize: function()
+ {
+ try {
+ return this.host.movieSize;
+ } catch(e) { }
+
+ return 0;
+ },
+
+ timedMetadataUpdates: function()
+ {
+ // FIXME: not implemented yet.
+ return null;
+ },
+
+ accessLog: function()
+ {
+ // FIXME: not implemented yet.
+ return null;
+ },
+
+ errorLog: function()
+ {
+ // FIXME: not implemented yet.
+ return null;
+ },
+};
+
</ins></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -18695,6 +18695,7 @@
</span><span class="cx"> <ClInclude Include="..\Modules\notifications\NotificationCenter.h" />
</span><span class="cx"> <ClInclude Include="..\Modules\notifications\NotificationClient.h" />
</span><span class="cx"> <ClInclude Include="..\Modules\notifications\WorkerGlobalScopeNotifications.h" />
</span><ins>+ <ClInclude Include="..\Modules\plugins\PluginReplacement.h" />
</ins><span class="cx"> <ClInclude Include="..\Modules\webdatabase\AbstractDatabaseServer.h" />
</span><span class="cx"> <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatement.h" />
</span><span class="cx"> <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatementBackend.h" />
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCoreCommonprops"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCoreCommon.props        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -7,7 +7,7 @@
</span><span class="cx"> </PropertyGroup>
</span><span class="cx"> <ItemDefinitionGroup>
</span><span class="cx"> <ClCompile>
</span><del>- <AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</del><ins>+ <AdditionalIncludeDirectories>$(ProjectDir)..;$(ProjectDir)..\Modules\mediacontrols;$(ProjectDir)..\Modules\mediastream;$(ProjectDir)..\Modules\filesystem;$(ProjectDir)..\Modules\geolocation;$(ProjectDir)..\Modules\indexeddb;$(ProjectDir)..\Modules\mediasource;$(ProjectDir)..\Modules\navigatorcontentutils;$(ProjectDir)..\Modules\plugins;$(ProjectDir)..\Modules\speech;$(ProjectDir)..\Modules\proximity;$(ProjectDir)..\Modules\quota;$(ProjectDir)..\Modules\notifications;$(ProjectDir)..\Modules\webdatabase;$(ProjectDir)..\Modules\websockets;$(ProjectDir)..\accessibility;$(ProjectDir)..\accessibility\win;$(ProjectDir)..\bridge;$(ProjectDir)..\bridge\c;$(ProjectDir)..\bridge\jsc;$(ProjectDir)..\css;$(ProjectDir)..\editing;$(ProjectDir)..\fileapi;$(ProjectDir)..\rendering;$(ProjectDir)..\rendering\line;$(ProjectDir)..\rendering\mathml;$(ProjectDir)..\rendering\shapes;$(ProjectDir)..\rendering\style;$(ProjectDir)..\rendering\svg;$(ProjectDir)..\bindings;$(ProjectDir)..\bindings\generic;$(ProjectDir)..\bindings\js;$(ProjectDir)..\bindings\js\specialization;$(ProjectDir)..\dom;$(ProjectDir)..\dom\default;$(ProjectDir)..\history;$(ProjectDir)..\html;$(ProjectDir)..\html\canvas;$(ProjectDir)..\html\forms;$(ProjectDir)..\html\parser;$(ProjectDir)..\html\shadow;$(ProjectDir)..\html\track;$(ProjectDir)..\inspector;$(ProjectDir)..\loader;$(ProjectDir)..\loader\appcache;$(ProjectDir)..\loader\archive;$(ProjectDir)..\loader\archive\cf;$(ProjectDir)..\loader\cache;$(ProjectDir)..\loader\icon;$(ProjectDir)..\mathml;$(ProjectDir)..\page;$(ProjectDir)..\page\animation;$(ProjectDir)..\page\scrolling;$(ProjectDir)..\page\win;$(ProjectDir)..\platform;$(ProjectDir)..\platform\animation;$(ProjectDir)..\platform\mock;$(ProjectDir)..\platform\sql;$(ProjectDir)..\platform\win;$(ProjectDir)..\platform\network;$(ProjectDir)..\platform\network\win;$(ProjectDir)..\platform\cf;$(ProjectDir)..\platform\graphics;$(ProjectDir)..\platform\graphics\ca;$(ProjectDir)..\platform\graphics\cpu\arm\filters;$(ProjectDir)..\platform\graphics\filters;$(ProjectDir)..\platform\graphics\filters\arm;$(ProjectDir)..\platform\graphics\opentype;$(ProjectDir)..\platform\graphics\transforms;$(ProjectDir)..\platform\text;$(ProjectDir)..\platform\text\transcoder;$(ProjectDir)..\platform\graphics\win;$(ProjectDir)..\xml;$(ProjectDir)..\xml\parser;$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\WebCore\DerivedSources;$(ProjectDir)..\plugins;$(ProjectDir)..\plugins\win;$(ProjectDir)..\svg\animation;$(ProjectDir)..\svg\graphics;$(ProjectDir)..\svg\properties;$(ProjectDir)..\svg\graphics\filters;$(ProjectDir)..\svg;$(ProjectDir)..\testing;$(ProjectDir)..\crypto;$(ProjectDir)..\wml;$(ProjectDir)..\storage;$(ProjectDir)..\style;$(ProjectDir)..\websockets;$(ProjectDir)..\workers;$(ConfigurationBuildDir)\include;$(ConfigurationBuildDir)\include\private;$(ConfigurationBuildDir)\include\JavaScriptCore;$(ConfigurationBuildDir)\include\private\JavaScriptCore;$(ProjectDir)..\ForwardingHeaders;$(ProjectDir)..\platform\graphics\gpu;$(ProjectDir)..\platform\graphics\egl;$(ProjectDir)..\platform\graphics\surfaces;$(ProjectDir)..\platform\graphics\surfaces\egl;$(ProjectDir)..\platform\graphics\opengl;$(WebKit_Libraries)\include;$(WebKit_Libraries)\include\private;$(WebKit_Libraries)\include\private\JavaScriptCore;$(WebKit_Libraries)\include\sqlite;$(WebKit_Libraries)\include\JavaScriptCore;$(WebKit_Libraries)\include\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ins><span class="cx"> <PreprocessorDefinitions>DISABLE_3D_RENDERING;WEBCORE_CONTEXT_MENUS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</span><span class="cx"> <PrecompiledHeader>Use</PrecompiledHeader>
</span><span class="cx"> <PrecompiledHeaderFile>WebCorePrefix.h</PrecompiledHeaderFile>
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -146,6 +146,9 @@
</span><span class="cx">                 07277E5317D018CC0015534D /* JSMediaStreamTrack.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4717D018CC0015534D /* JSMediaStreamTrack.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 07277E5417D018CC0015534D /* JSMediaStreamTrackEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07277E4817D018CC0015534D /* JSMediaStreamTrackEvent.cpp */; };
</span><span class="cx">                 07277E5517D018CC0015534D /* JSMediaStreamTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07277E4917D018CC0015534D /* JSMediaStreamTrackEvent.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                072AE1E5183C0741000A5988 /* PluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 072AE1DF183C0741000A5988 /* PluginReplacement.h */; };
+                072AE1E6183C0741000A5988 /* QuickTimePluginReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 072AE1E0183C0741000A5988 /* QuickTimePluginReplacement.cpp */; };
+                072AE1E8183C0741000A5988 /* QuickTimePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 072AE1E2183C0741000A5988 /* QuickTimePluginReplacement.h */; };
</ins><span class="cx">                 072C8B11131C518600A4FCE9 /* MediaPlayerPrivateAVFoundation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 076F0D0912B8192700C26AA4 /* MediaPlayerPrivateAVFoundation.cpp */; };
</span><span class="cx">                 072CA86116CB4DC3008AE131 /* CaptionUserPreferences.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 072CA86016CB4DC3008AE131 /* CaptionUserPreferences.cpp */; };
</span><span class="cx">                 0735EE6A0F40C5E4004A2604 /* MediaPlayerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -187,6 +190,8 @@
</span><span class="cx">                 07846342145B151A00A58DF1 /* JSTrackEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */; };
</span><span class="cx">                 07846343145B151A00A58DF1 /* JSTrackEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 07846341145B151A00A58DF1 /* JSTrackEvent.h */; };
</span><span class="cx">                 07846385145B1B8E00A58DF1 /* JSTrackCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */; };
</span><ins>+                 077664FC183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 077664FA183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp */; };
+                 077664FD183E6B5C00133B92 /* JSQuickTimePluginReplacement.h in Headers */ = {isa = PBXBuildFile; fileRef = 077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */; };
</ins><span class="cx">                 078E08FE17D14CEE00420AA1 /* MediaConstraintsImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B4A17CEC32700848E51 /* MediaConstraintsImpl.cpp */; };
</span><span class="cx">                 078E08FF17D14CEE00420AA1 /* MediaStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B4C17CEC32700848E51 /* MediaStream.cpp */; };
</span><span class="cx">                 078E090017D14CEE00420AA1 /* MediaStreamEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 07221B4F17CEC32700848E51 /* MediaStreamEvent.cpp */; };
</span><span class="lines">@@ -6765,6 +6770,12 @@
</span><span class="cx">                 072847E316EBC5B00043CFA4 /* PlatformTextTrackMenu.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformTextTrackMenu.h; sourceTree = "<group>"; };
</span><span class="cx">                 0729B14E17CFCCA0004F1D60 /* MediaStreamCenterMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamCenterMac.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 0729B14F17CFCCA0004F1D60 /* MediaStreamCenterMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamCenterMac.h; sourceTree = "<group>"; };
</span><ins>+                072AE1DF183C0741000A5988 /* PluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginReplacement.h; path = plugins/PluginReplacement.h; sourceTree = "<group>"; };
+                072AE1E0183C0741000A5988 /* QuickTimePluginReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = QuickTimePluginReplacement.cpp; path = plugins/QuickTimePluginReplacement.cpp; sourceTree = "<group>"; };
+                072AE1E1183C0741000A5988 /* QuickTimePluginReplacement.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; name = QuickTimePluginReplacement.css; path = plugins/QuickTimePluginReplacement.css; sourceTree = "<group>"; };
+                072AE1E2183C0741000A5988 /* QuickTimePluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QuickTimePluginReplacement.h; path = plugins/QuickTimePluginReplacement.h; sourceTree = "<group>"; };
+                072AE1E3183C0741000A5988 /* QuickTimePluginReplacement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = QuickTimePluginReplacement.idl; path = plugins/QuickTimePluginReplacement.idl; sourceTree = "<group>"; };
+                072AE1E4183C0741000A5988 /* QuickTimePluginReplacement.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = QuickTimePluginReplacement.js; path = plugins/QuickTimePluginReplacement.js; sourceTree = "<group>"; };
</ins><span class="cx">                 072CA86016CB4DC3008AE131 /* CaptionUserPreferences.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CaptionUserPreferences.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 0735EE690F40C5E4004A2604 /* MediaPlayerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaPlayerProxy.h; sourceTree = "<group>"; };
</span><span class="cx">                 07367DDD172CA67F00D861B9 /* InbandTextTrackPrivateLegacyAVFObjC.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InbandTextTrackPrivateLegacyAVFObjC.h; path = objc/InbandTextTrackPrivateLegacyAVFObjC.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -6803,6 +6814,8 @@
</span><span class="cx">                 0779BF0C18453168000B6AE7 /* HTMLMediaElementMediaStream.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLMediaElementMediaStream.idl; sourceTree = "<group>"; };
</span><span class="cx">                 0783228218013ED700999E0C /* MediaStreamAudioSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaStreamAudioSource.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 0783228318013ED800999E0C /* MediaStreamAudioSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MediaStreamAudioSource.h; sourceTree = "<group>"; };
</span><ins>+                 077664FA183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSQuickTimePluginReplacement.cpp; path = JSQuickTimePluginReplacement.cpp; sourceTree = "<group>"; };
+                 077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSQuickTimePluginReplacement.h; path = JSQuickTimePluginReplacement.h; sourceTree = "<group>"; };
</ins><span class="cx">                 07846340145B151A00A58DF1 /* JSTrackEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSTrackEvent.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 07846341145B151A00A58DF1 /* JSTrackEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTrackEvent.h; sourceTree = "<group>"; };
</span><span class="cx">                 07846384145B1B8E00A58DF1 /* JSTrackCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSTrackCustom.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -13755,6 +13768,19 @@
</span><span class="cx">                         path = mac;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="cx">                 };
</span><ins>+                072AE1DE183C0513000A5988 /* plugins */ = {
+                        isa = PBXGroup;
+                        children = (
+                                072AE1DF183C0741000A5988 /* PluginReplacement.h */,
+                                072AE1E0183C0741000A5988 /* QuickTimePluginReplacement.cpp */,
+                                072AE1E1183C0741000A5988 /* QuickTimePluginReplacement.css */,
+                                072AE1E2183C0741000A5988 /* QuickTimePluginReplacement.h */,
+                                072AE1E3183C0741000A5988 /* QuickTimePluginReplacement.idl */,
+                                072AE1E4183C0741000A5988 /* QuickTimePluginReplacement.js */,
+                        );
+                        name = plugins;
+                        sourceTree = "<group>";
+                };
</ins><span class="cx">                 076F0D0812B8192700C26AA4 /* avfoundation */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><span class="lines">@@ -14100,6 +14126,8 @@
</span><span class="cx">                 14DFB33F0A7DF7630018F769 /* Derived Sources */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                077664FA183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp */,
+                                077664FB183E6B5C00133B92 /* JSQuickTimePluginReplacement.h */,
</ins><span class="cx">                                 A83B79100CCB001B000B0825 /* Core */,
</span><span class="cx">                                 E1FF8F61180745C600132674 /* Crypto */,
</span><span class="cx">                                 A83B790E0CCAFF97000B0825 /* CSS */,
</span><span class="lines">@@ -16954,6 +16982,7 @@
</span><span class="cx">                 971145FE14EF006E00674FD9 /* Modules */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                072AE1DE183C0513000A5988 /* plugins */,
</ins><span class="cx">                                 CDA98DBD16014E0800FEA3B1 /* encryptedmedia */,
</span><span class="cx">                                 971145FF14EF007900674FD9 /* geolocation */,
</span><span class="cx">                                 9712A55315004E3C0048AF10 /* indexeddb */,
</span><span class="lines">@@ -21996,6 +22025,7 @@
</span><span class="cx">                                 29489FC712C00F0300D83F0F /* AccessibilityScrollView.h in Headers */,
</span><span class="cx">                                 0709FC4E1025DEE30059CDBA /* AccessibilitySlider.h in Headers */,
</span><span class="cx">                                 51D719D7181106E00016DC51 /* IDBHistograms.h in Headers */,
</span><ins>+                                072AE1E8183C0741000A5988 /* QuickTimePluginReplacement.h in Headers */,
</ins><span class="cx">                                 29D7BCFA1444AF7D0070619C /* AccessibilitySpinButton.h in Headers */,
</span><span class="cx">                                 AAC08CF315F941FD00F1E188 /* AccessibilitySVGRoot.h in Headers */,
</span><span class="cx">                                 29A8122B0FBB9C1D00510293 /* AccessibilityTable.h in Headers */,
</span><span class="lines">@@ -22192,6 +22222,7 @@
</span><span class="cx">                                 FD315FFF12B0267600C1A359 /* ChannelMergerNode.h in Headers */,
</span><span class="cx">                                 FD31600212B0267600C1A359 /* ChannelSplitterNode.h in Headers */,
</span><span class="cx">                                 6550B6A0099DF0270090D781 /* CharacterData.h in Headers */,
</span><ins>+                                077664FD183E6B5C00133B92 /* JSQuickTimePluginReplacement.h in Headers */,
</ins><span class="cx">                                 97B8FFD116AE7F960038388D /* CharacterReferenceParserInlines.h in Headers */,
</span><span class="cx">                                 E164FAA318315BF400DB4E61 /* CryptoKeyRSA.h in Headers */,
</span><span class="cx">                                 B2C3DA2A0D006C1D00EF6F26 /* CharsetData.h in Headers */,
</span><span class="lines">@@ -24892,6 +24923,7 @@
</span><span class="cx">                                 E180811716FCF9CB00B80D07 /* SynchronousLoaderClient.h in Headers */,
</span><span class="cx">                                 5DA97ECD168E787B000E3676 /* SystemVersionMac.h in Headers */,
</span><span class="cx">                                 A8CFF0510A154F09000A4234 /* TableLayout.h in Headers */,
</span><ins>+                                072AE1E5183C0741000A5988 /* PluginReplacement.h in Headers */,
</ins><span class="cx">                                 BCE3BEC30D222B1D007E06E4 /* TagNodeList.h in Headers */,
</span><span class="cx">                                 F55B3DD61251F12D003EF269 /* TelephoneInputType.h in Headers */,
</span><span class="cx">                                 C65046A9167BFB5500CC2A4D /* TemplateContentDocumentFragment.h in Headers */,
</span><span class="lines">@@ -27042,6 +27074,7 @@
</span><span class="cx">                                 8485227B1190162C006EDC7F /* JSSVGHKernElement.cpp in Sources */,
</span><span class="cx">                                 B2FA3D9E0AB75A6F000E5AC4 /* JSSVGImageElement.cpp in Sources */,
</span><span class="cx">                                 B2FA3DA00AB75A6F000E5AC4 /* JSSVGLength.cpp in Sources */,
</span><ins>+                                077664FC183E6B5C00133B92 /* JSQuickTimePluginReplacement.cpp in Sources */,
</ins><span class="cx">                                 08E4FE460E2BD41400F4CAE0 /* JSSVGLengthCustom.cpp in Sources */,
</span><span class="cx">                                 B2FA3DA20AB75A6F000E5AC4 /* JSSVGLengthList.cpp in Sources */,
</span><span class="cx">                                 B2FA3DA40AB75A6F000E5AC4 /* JSSVGLinearGradientElement.cpp in Sources */,
</span><span class="lines">@@ -27248,6 +27281,7 @@
</span><span class="cx">                                 0705850217FA10D0005F2BCB /* JSAllVideoCapabilities.cpp in Sources */,
</span><span class="cx">                                 9759E93E14EF1CF80026A2DD /* LoadableTextTrack.cpp in Sources */,
</span><span class="cx">                                 656D37330ADBA5DE00A4554D /* LoaderNSURLExtras.mm in Sources */,
</span><ins>+                                072AE1E6183C0741000A5988 /* QuickTimePluginReplacement.cpp in Sources */,
</ins><span class="cx">                                 7EE6846812D26E3800E79415 /* LoaderRunLoopCF.cpp in Sources */,
</span><span class="cx">                                 51ABF64D16392E2800132A7A /* LoaderStrategy.cpp in Sources */,
</span><span class="cx">                                 06E81EEC0AB5DA9700C87837 /* LocalCurrentGraphicsContext.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsgenericRuntimeEnabledFeaturesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/bindings/generic/RuntimeEnabledFeatures.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -228,6 +228,9 @@
</span><span class="cx"> // The lang attribute support is incomplete and should only be turned on for tests.
</span><span class="cx"> void setLangAttributeAwareFormControlUIEnabled(bool isEnabled) { m_isLangAttributeAwareFormControlUIEnabled = isEnabled; }
</span><span class="cx">
</span><ins>+ void setPluginReplacementEnabled(bool isEnabled) { m_isPluginReplacementEnabled = isEnabled; }
+ bool pluginReplacementEnabled() const { return m_isPluginReplacementEnabled; }
+
</ins><span class="cx"> static RuntimeEnabledFeatures& sharedFeatures();
</span><span class="cx">
</span><span class="cx"> private:
</span><span class="lines">@@ -250,6 +253,8 @@
</span><span class="cx"> bool m_isCSSRegionsEnabled;
</span><span class="cx"> bool m_isCSSCompositingEnabled;
</span><span class="cx"> bool m_isLangAttributeAwareFormControlUIEnabled;
</span><ins>+ bool m_isPluginReplacementEnabled;
+
</ins><span class="cx"> #if ENABLE(SCRIPTED_SPEECH)
</span><span class="cx"> bool m_isScriptedSpeechEnabled;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMBindingh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMBinding.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/bindings/js/JSDOMBinding.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -392,6 +392,11 @@
</span><span class="cx"> return array;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+inline JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject*, const String& value)
+{
+ return jsStringOrNull(exec, value);
+}
+
</ins><span class="cx"> template <class T>
</span><span class="cx"> struct JSValueTraits {
</span><span class="cx"> static inline JSC::JSValue arrayJSValue(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, const T& value)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSPluginElementFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/bindings/js/JSPluginElementFunctions.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -82,7 +82,11 @@
</span><span class="cx">
</span><span class="cx"> HTMLPlugInElement& pluginElement = toHTMLPlugInElement(element);
</span><span class="cx">
</span><del>- // First, see if we can ask the plug-in view for its script object.
</del><ins>+ // First, see if the element has a plug-in replacement with a script.
+ if (JSObject* scriptObject = pluginElement.scriptObjectForPluginReplacement())
+ return scriptObject;
+
+ // Next, see if we can ask the plug-in view for its script object.
</ins><span class="cx"> if (JSObject* scriptObject = pluginScriptObjectFromPluginViewBase(pluginElement, jsHTMLElement->globalObject()))
</span><span class="cx"> return scriptObject;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLEmbedElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLEmbedElement.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLEmbedElement.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLEmbedElement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -170,9 +170,8 @@
</span><span class="cx"> if (!renderer()) // Do not load the plugin if beforeload removed this element or its renderer.
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- SubframeLoader& loader = document().frame()->loader().subframeLoader();
</del><span class="cx"> // FIXME: beforeLoad could have detached the renderer! Just like in the <object> case above.
</span><del>- loader.requestObject(*this, m_url, getNameAttribute(), m_serviceType, paramNames, paramValues);
</del><ins>+ requestObject(m_url, m_serviceType, paramNames, paramValues);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool HTMLEmbedElement::rendererIsNeeded(const RenderStyle& style)
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -5300,6 +5300,14 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+unsigned long long HTMLMediaElement::fileSize() const
+{
+ if (m_player)
+ return m_player->fileSize();
+
+ return 0;
</ins><span class="cx"> }
</span><span class="cx">
</span><ins>+}
+
</ins><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaElement.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -393,6 +393,8 @@
</span><span class="cx"> bool shouldUseVideoPluginProxy() const;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+ unsigned long long fileSize() const;
+
</ins><span class="cx"> protected:
</span><span class="cx"> HTMLMediaElement(const QualifiedName&, Document&, bool);
</span><span class="cx"> virtual ~HTMLMediaElement();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLObjectElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLObjectElement.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLObjectElement.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLObjectElement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -307,8 +307,9 @@
</span><span class="cx"> if (!renderer()) // Do not load the plugin if beforeload removed this element or its renderer.
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- SubframeLoader& loader = document().frame()->loader().subframeLoader();
- bool success = beforeLoadAllowedLoad && hasValidClassId() && loader.requestObject(*this, url, getNameAttribute(), serviceType, paramNames, paramValues);
</del><ins>+ bool success = beforeLoadAllowedLoad && hasValidClassId();
+ if (success)
+ success = requestObject(url, serviceType, paramNames, paramValues);
</ins><span class="cx"> if (!success && hasFallbackContent())
</span><span class="cx"> renderFallbackContent();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInElement.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInElement.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -35,19 +35,30 @@
</span><span class="cx"> #include "FrameLoader.h"
</span><span class="cx"> #include "FrameTree.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><ins>+#include "Logging.h"
+#include "MIMETypeRegistry.h"
</ins><span class="cx"> #include "Page.h"
</span><ins>+#include "PluginData.h"
+#include "PluginReplacement.h"
</ins><span class="cx"> #include "PluginViewBase.h"
</span><span class="cx"> #include "RenderEmbeddedObject.h"
</span><span class="cx"> #include "RenderSnapshottedPlugIn.h"
</span><span class="cx"> #include "RenderWidget.h"
</span><ins>+#include "RuntimeEnabledFeatures.h"
</ins><span class="cx"> #include "ScriptController.h"
</span><span class="cx"> #include "Settings.h"
</span><ins>+#include "ShadowRoot.h"
+#include "SubframeLoader.h"
</ins><span class="cx"> #include "Widget.h"
</span><span class="cx">
</span><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx"> #include "npruntime_impl.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if PLATFORM(MAC)
+#include "QuickTimePluginReplacement.h"
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> using namespace HTMLNames;
</span><span class="lines">@@ -55,6 +66,7 @@
</span><span class="cx"> HTMLPlugInElement::HTMLPlugInElement(const QualifiedName& tagName, Document& document)
</span><span class="cx"> : HTMLFrameOwnerElement(tagName, document)
</span><span class="cx"> , m_inBeforeLoadEventHandler(false)
</span><ins>+ , m_swapRendererTimer(this, &HTMLPlugInElement::swapRendererTimerFired)
</ins><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx"> , m_NPObject(0)
</span><span class="cx"> #endif
</span><span class="lines">@@ -262,4 +274,138 @@
</span><span class="cx">
</span><span class="cx"> #endif /* ENABLE(NETSCAPE_PLUGIN_API) */
</span><span class="cx">
</span><ins>+RenderElement* HTMLPlugInElement::createRenderer(PassRef<RenderStyle> style)
+{
+ if (m_pluginReplacement && m_pluginReplacement->willCreateRenderer())
+ return m_pluginReplacement->createRenderer(*this, std::move(style));
+
+ return new RenderEmbeddedObject(*this, std::move(style));
</ins><span class="cx"> }
</span><ins>+
+void HTMLPlugInElement::swapRendererTimerFired(Timer<HTMLPlugInElement>*)
+{
+ ASSERT(displayState() == PreparingPluginReplacement || displayState() == DisplayingSnapshot);
+ if (userAgentShadowRoot())
+ return;
+
+ // Create a shadow root, which will trigger the code to add a snapshot container
+ // and reattach, thus making a new Renderer.
+ ensureUserAgentShadowRoot();
+}
+
+void HTMLPlugInElement::setDisplayState(DisplayState state)
+{
+ m_displayState = state;
+
+ if ((state == DisplayingSnapshot || displayState() == PreparingPluginReplacement) && !m_swapRendererTimer.isActive())
+ m_swapRendererTimer.startOneShot(0);
+}
+
+void HTMLPlugInElement::didAddUserAgentShadowRoot(ShadowRoot* root)
+{
+ if (!m_pluginReplacement || !document().page() || displayState() != PreparingPluginReplacement)
+ return;
+
+ root->setResetStyleInheritance(true);
+ if (m_pluginReplacement->installReplacement(root)) {
+ setDisplayState(DisplayingPluginReplacement);
+ Style::reattachRenderTree(*this);
+ }
+}
+
+#if PLATFORM(MAC)
+static void registrar(const ReplacementPlugin&);
+#endif
+
+static Vector<ReplacementPlugin*>& registeredPluginReplacements()
+{
+ DEFINE_STATIC_LOCAL(Vector<ReplacementPlugin*>, registeredReplacements, ());
+ static bool enginesQueried = false;
+
+ if (enginesQueried)
+ return registeredReplacements;
+ enginesQueried = true;
+
+#if PLATFORM(MAC)
+ QuickTimePluginReplacement::registerPluginReplacement(registrar);
+#endif
+
+ return registeredReplacements;
+}
+
+#if PLATFORM(MAC)
+static void registrar(const ReplacementPlugin& replacement)
+{
+ registeredPluginReplacements().append(new ReplacementPlugin(replacement));
+}
+#endif
+
+static ReplacementPlugin* pluginReplacementForType(const URL& url, const String& mimeType)
+{
+ Vector<ReplacementPlugin*>& replacements = registeredPluginReplacements();
+ if (replacements.isEmpty())
+ return nullptr;
+
+ String extension;
+ String lastPathComponent = url.lastPathComponent();
+ size_t dotOffset = lastPathComponent.reverseFind('.');
+ if (dotOffset != notFound)
+ extension = lastPathComponent.substring(dotOffset + 1);
+
+ String type = mimeType;
+ if (type.isEmpty() && url.protocolIsData())
+ type = mimeTypeFromDataURL(url.string());
+
+ if (type.isEmpty() && !extension.isEmpty()) {
+ for (size_t i = 0; i < replacements.size(); i++)
+ if (replacements[i]->supportsFileExtension(extension))
+ return replacements[i];
+ }
+
+ if (type.isEmpty()) {
+ if (extension.isEmpty())
+ return nullptr;
+ type = MIMETypeRegistry::getMediaMIMETypeForExtension(extension);
+ }
+
+ if (type.isEmpty())
+ return nullptr;
+
+ for (unsigned i = 0; i < replacements.size(); i++)
+ if (replacements[i]->supportsType(type))
+ return replacements[i];
+
+ return nullptr;
+}
+
+bool HTMLPlugInElement::requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
+{
+ if (!RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
+ return false;
+
+ if (m_pluginReplacement)
+ return true;
+
+ URL completedURL;
+ if (!url.isEmpty())
+ completedURL = document().completeURL(url);
+
+ ReplacementPlugin* replacement = pluginReplacementForType(completedURL, mimeType);
+ if (!replacement)
+ return false;
+
+ LOG(Plugins, "%p - Found plug-in replacement for %s.", this, completedURL.string().utf8().data());
+
+ m_pluginReplacement = replacement->create(*this, paramNames, paramValues);
+ setDisplayState(PreparingPluginReplacement);
+ return true;
+}
+
+JSC::JSObject* HTMLPlugInElement::scriptObjectForPluginReplacement()
+{
+ if (m_pluginReplacement)
+ return m_pluginReplacement->scriptObject();
+ return nullptr;
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInElement.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInElement.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLPlugInElement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><ins>+class PluginReplacement;
</ins><span class="cx"> class RenderEmbeddedObject;
</span><span class="cx"> class RenderWidget;
</span><span class="cx"> class Widget;
</span><span class="lines">@@ -57,14 +58,18 @@
</span><span class="cx"> DisplayingSnapshot,
</span><span class="cx"> Restarting,
</span><span class="cx"> RestartingWithPendingMouseClick,
</span><del>- Playing
</del><ins>+ Playing,
+ PreparingPluginReplacement,
+ DisplayingPluginReplacement,
</ins><span class="cx"> };
</span><span class="cx"> DisplayState displayState() const { return m_displayState; }
</span><del>- virtual void setDisplayState(DisplayState state) { m_displayState = state; }
</del><ins>+ virtual void setDisplayState(DisplayState);
</ins><span class="cx"> virtual void updateSnapshot(PassRefPtr<Image>) { }
</span><span class="cx"> virtual void dispatchPendingMouseClick() { }
</span><span class="cx"> virtual bool isRestartedPlugin() const { return false; }
</span><span class="cx">
</span><ins>+ JSC::JSObject* scriptObjectForPluginReplacement();
+
</ins><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx"> NPObject* getNPObject();
</span><span class="cx"> #endif
</span><span class="lines">@@ -91,12 +96,19 @@
</span><span class="cx">
</span><span class="cx"> virtual void defaultEventHandler(Event*) OVERRIDE;
</span><span class="cx">
</span><ins>+ virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues);
+ virtual RenderElement* createRenderer(PassRef<RenderStyle>) OVERRIDE;
+ virtual void didAddUserAgentShadowRoot(ShadowRoot*) OVERRIDE;
+
</ins><span class="cx"> // Subclasses should use guardedDispatchBeforeLoadEvent instead of calling dispatchBeforeLoadEvent directly.
</span><span class="cx"> bool guardedDispatchBeforeLoadEvent(const String& sourceURL);
</span><span class="cx">
</span><span class="cx"> bool m_inBeforeLoadEventHandler;
</span><span class="cx">
</span><span class="cx"> private:
</span><ins>+ void swapRendererTimerFired(Timer<HTMLPlugInElement>*);
+ bool shouldOverridePlugin(const String& url, const String& mimeType);
+
</ins><span class="cx"> bool dispatchBeforeLoadEvent(const String& sourceURL); // Not implemented, generates a compile error if subclasses call this by mistake.
</span><span class="cx">
</span><span class="cx"> virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
</span><span class="lines">@@ -109,6 +121,8 @@
</span><span class="cx"> virtual bool isPluginElement() const OVERRIDE FINAL;
</span><span class="cx">
</span><span class="cx"> RefPtr<JSC::Bindings::Instance> m_instance;
</span><ins>+ Timer<HTMLPlugInElement> m_swapRendererTimer;
+ RefPtr<PluginReplacement> m_pluginReplacement;
</ins><span class="cx"> #if ENABLE(NETSCAPE_PLUGIN_API)
</span><span class="cx"> NPObject* m_NPObject;
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -108,7 +108,6 @@
</span><span class="cx"> , m_shouldPreferPlugInsForImages(preferPlugInsForImagesOption == ShouldPreferPlugInsForImages)
</span><span class="cx"> , m_needsDocumentActivationCallbacks(false)
</span><span class="cx"> , m_simulatedMouseClickTimer(this, &HTMLPlugInImageElement::simulatedMouseClickTimerFired, simulatedMouseClickTimerDelay)
</span><del>- , m_swapRendererTimer(this, &HTMLPlugInImageElement::swapRendererTimerFired)
</del><span class="cx"> , m_removeSnapshotTimer(this, &HTMLPlugInImageElement::removeSnapshotTimerFired)
</span><span class="cx"> , m_createdDuringUserGesture(ScriptController::processingUserGesture())
</span><span class="cx"> , m_isRestartedPlugin(false)
</span><span class="lines">@@ -139,9 +138,6 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> HTMLPlugInElement::setDisplayState(state);
</span><del>-
- if (state == DisplayingSnapshot)
- m_swapRendererTimer.startOneShot(0);
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RenderEmbeddedObject* HTMLPlugInImageElement::renderEmbeddedObject() const
</span><span class="lines">@@ -196,6 +192,9 @@
</span><span class="cx">
</span><span class="cx"> RenderElement* HTMLPlugInImageElement::createRenderer(PassRef<RenderStyle> style)
</span><span class="cx"> {
</span><ins>+ if (displayState() >= PreparingPluginReplacement)
+ return HTMLPlugInElement::createRenderer(std::move(style));
+
</ins><span class="cx"> // Once a PlugIn Element creates its renderer, it needs to be told when the Document goes
</span><span class="cx"> // inactive or reactivates so it can clear the renderer before going into the page cache.
</span><span class="cx"> if (!m_needsDocumentActivationCallbacks) {
</span><span class="lines">@@ -221,7 +220,7 @@
</span><span class="cx"> return image;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return new RenderEmbeddedObject(*this, std::move(style));
</del><ins>+ return HTMLPlugInElement::createRenderer(std::move(style));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool HTMLPlugInImageElement::willRecalcStyle(Style::Change)
</span><span class="lines">@@ -363,8 +362,12 @@
</span><span class="cx">
</span><span class="cx"> void HTMLPlugInImageElement::didAddUserAgentShadowRoot(ShadowRoot* root)
</span><span class="cx"> {
</span><ins>+ HTMLPlugInElement::didAddUserAgentShadowRoot(root);
+ if (displayState() >= PreparingPluginReplacement)
+ return;
+
</ins><span class="cx"> Page* page = document().page();
</span><del>- if (!page)
</del><ins>+ if (page)
</ins><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> // Reset any author styles that may apply as we only want explicit
</span><span class="lines">@@ -409,17 +412,6 @@
</span><span class="cx"> return node && snapshotLabel && (node == snapshotLabel.get() || node->isDescendantOf(snapshotLabel.get()));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void HTMLPlugInImageElement::swapRendererTimerFired(Timer<HTMLPlugInImageElement>*)
-{
- ASSERT(displayState() == DisplayingSnapshot);
- if (userAgentShadowRoot())
- return;
-
- // Create a shadow root, which will trigger the code to add a snapshot container
- // and reattach, thus making a new Renderer.
- ensureUserAgentShadowRoot();
-}
-
</del><span class="cx"> void HTMLPlugInImageElement::removeSnapshotTimerFired(Timer<HTMLPlugInImageElement>*)
</span><span class="cx"> {
</span><span class="cx"> m_snapshotImage = nullptr;
</span><span class="lines">@@ -496,7 +488,7 @@
</span><span class="cx"> LOG(Plugins, "%p User clicked on snapshotted plug-in. Restart.", this);
</span><span class="cx"> restartSnapshottedPlugIn();
</span><span class="cx"> if (forwardEvent)
</span><del>- setDisplayState(HTMLPlugInElement::RestartingWithPendingMouseClick);
</del><ins>+ setDisplayState(RestartingWithPendingMouseClick);
</ins><span class="cx"> restartSimilarPlugIns();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -732,4 +724,13 @@
</span><span class="cx"> HTMLPlugInElement::defaultEventHandler(event);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+bool HTMLPlugInImageElement::requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues)
+{
+ if (HTMLPlugInElement::requestObject(url, mimeType, paramNames, paramValues))
+ return true;
+
+ SubframeLoader& loader = document().frame()->loader().subframeLoader();
+ return loader.requestObject(*this, url, getNameAttribute(), mimeType, paramNames, paramValues);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLPlugInImageElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class HTMLImageLoader;
</span><ins>+class HTMLVideoElement;
</ins><span class="cx"> class FrameLoader;
</span><span class="cx"> class Image;
</span><span class="cx"> class MouseEvent;
</span><span class="lines">@@ -123,6 +124,7 @@
</span><span class="cx"> virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
</span><span class="cx">
</span><span class="cx"> virtual bool isRestartedPlugin() const OVERRIDE { return m_isRestartedPlugin; }
</span><ins>+ virtual bool requestObject(const String& url, const String& mimeType, const Vector<String>& paramNames, const Vector<String>& paramValues) OVERRIDE;
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> virtual RenderElement* createRenderer(PassRef<RenderStyle>) OVERRIDE;
</span><span class="lines">@@ -138,8 +140,6 @@
</span><span class="cx"> virtual void dispatchPendingMouseClick() OVERRIDE;
</span><span class="cx"> void simulatedMouseClickTimerFired(DeferrableOneShotTimer<HTMLPlugInImageElement>*);
</span><span class="cx">
</span><del>- void swapRendererTimerFired(Timer<HTMLPlugInImageElement>*);
-
</del><span class="cx"> void restartSimilarPlugIns();
</span><span class="cx">
</span><span class="cx"> virtual bool isPlugInImageElement() const OVERRIDE { return true; }
</span><span class="lines">@@ -154,7 +154,6 @@
</span><span class="cx"> RefPtr<RenderStyle> m_customStyleForPageCache;
</span><span class="cx"> RefPtr<MouseEvent> m_pendingClickEventFromSnapshot;
</span><span class="cx"> DeferrableOneShotTimer<HTMLPlugInImageElement> m_simulatedMouseClickTimer;
</span><del>- Timer<HTMLPlugInImageElement> m_swapRendererTimer;
</del><span class="cx"> Timer<HTMLPlugInImageElement> m_removeSnapshotTimer;
</span><span class="cx"> RefPtr<Image> m_snapshotImage;
</span><span class="cx"> bool m_createdDuringUserGesture;
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLVideoElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLVideoElement.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLVideoElement.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/html/HTMLVideoElement.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -72,12 +72,12 @@
</span><span class="cx"> bool shouldDisplayPosterImage() const { return displayMode() == Poster || displayMode() == PosterWaitingForVideo; }
</span><span class="cx">
</span><span class="cx"> URL posterImageURL() const;
</span><ins>+ virtual RenderElement* createRenderer(PassRef<RenderStyle>) OVERRIDE;
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> HTMLVideoElement(const QualifiedName&, Document&, bool);
</span><span class="cx">
</span><span class="cx"> virtual bool rendererIsNeeded(const RenderStyle&) OVERRIDE;
</span><del>- virtual RenderElement* createRenderer(PassRef<RenderStyle>) OVERRIDE;
</del><span class="cx"> virtual void didAttachRenderers() OVERRIDE;
</span><span class="cx"> virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERRIDE;
</span><span class="cx"> virtual bool isPresentationAttribute(const QualifiedName&) const OVERRIDE;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -1225,6 +1225,14 @@
</span><span class="cx"> return m_private->extraMemoryCost();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+unsigned long long MediaPlayer::fileSize() const
+{
+ if (!m_private)
+ return 0;
+
+ return m_private->fileSize();
+}
+
</ins><span class="cx"> void MediaPlayerFactorySupport::callRegisterMediaEngine(MediaEngineRegister registerMediaEngine)
</span><span class="cx"> {
</span><span class="cx"> registerMediaEngine(addMediaEngine);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayer.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayer.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -508,6 +508,8 @@
</span><span class="cx">
</span><span class="cx"> size_t extraMemoryCost() const;
</span><span class="cx">
</span><ins>+ unsigned long long fileSize() const;
+
</ins><span class="cx"> private:
</span><span class="cx"> MediaPlayer(MediaPlayerClient*);
</span><span class="cx"> MediaPlayerFactory* nextBestMediaEngine(MediaPlayerFactory*) const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlayerPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/MediaPlayerPrivate.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -213,6 +213,8 @@
</span><span class="cx"> virtual String languageOfPrimaryAudioTrack() const { return emptyString(); }
</span><span class="cx">
</span><span class="cx"> virtual size_t extraMemoryCost() const { return 0; }
</span><ins>+
+ virtual unsigned long long fileSize() const { return 0; }
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -921,7 +921,8 @@
</span><span class="cx"> if (!duration)
</span><span class="cx"> return 0;
</span><span class="cx">
</span><del>- return totalBytes() * buffered()->totalDuration() / duration;
</del><ins>+ unsigned long long extra = totalBytes() * buffered()->totalDuration() / duration;
+ return static_cast<unsigned>(extra);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateAVFoundation::clearTextTracks()
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationMediaPlayerPrivateAVFoundationh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -190,6 +190,7 @@
</span><span class="cx">
</span><span class="cx"> virtual bool supportsFullscreen() const;
</span><span class="cx"> virtual bool supportsScanning() const { return true; }
</span><ins>+ unsigned long long fileSize() const { return totalBytes(); }
</ins><span class="cx">
</span><span class="cx"> // Required interfaces for concrete derived classes.
</span><span class="cx"> virtual void createAVAssetForURL(const String&) = 0;
</span><span class="lines">@@ -225,7 +226,7 @@
</span><span class="cx"> virtual void updateRate() = 0;
</span><span class="cx"> virtual float rate() const = 0;
</span><span class="cx"> virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance) = 0;
</span><del>- virtual unsigned totalBytes() const = 0;
</del><ins>+ virtual unsigned long long totalBytes() const = 0;
</ins><span class="cx"> virtual PassRefPtr<TimeRanges> platformBufferedTimeRanges() const = 0;
</span><span class="cx"> virtual double platformMaxTimeSeekable() const = 0;
</span><span class="cx"> virtual double platformMinTimeSeekable() const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -721,7 +721,7 @@
</span><span class="cx"> return maxTimeLoaded;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-unsigned MediaPlayerPrivateAVFoundationCF::totalBytes() const
</del><ins>+unsigned long long MediaPlayerPrivateAVFoundationCF::totalBytes() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable() || !avAsset(m_avfWrapper))
</span><span class="cx"> return 0;
</span><span class="lines">@@ -734,8 +734,7 @@
</span><span class="cx"> totalMediaSize += AVCFAssetTrackGetTotalSampleDataLength(assetTrack);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- // FIXME: It doesn't seem safe to cast an int64_t to unsigned.
- return static_cast<unsigned>(totalMediaSize);
</del><ins>+ return static_cast<unsigned long long>(totalMediaSize);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MediaPlayerPrivateAVFoundation::AssetStatus MediaPlayerPrivateAVFoundationCF::assetStatus() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationcfMediaPlayerPrivateAVFoundationCFh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -77,7 +77,7 @@
</span><span class="cx"> virtual void updateRate();
</span><span class="cx"> virtual float rate() const;
</span><span class="cx"> virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance);
</span><del>- virtual unsigned totalBytes() const;
</del><ins>+ virtual unsigned long long totalBytes() const;
</ins><span class="cx"> virtual PassRefPtr<TimeRanges> platformBufferedTimeRanges() const;
</span><span class="cx"> virtual double platformMinTimeSeekable() const;
</span><span class="cx"> virtual double platformMaxTimeSeekable() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx"> virtual void updateRate();
</span><span class="cx"> virtual float rate() const;
</span><span class="cx"> virtual void seekToTime(double time, double negativeTolerance, double positiveTolerance);
</span><del>- virtual unsigned totalBytes() const;
</del><ins>+ virtual unsigned long long totalBytes() const;
</ins><span class="cx"> virtual PassRefPtr<TimeRanges> platformBufferedTimeRanges() const;
</span><span class="cx"> virtual double platformMinTimeSeekable() const;
</span><span class="cx"> virtual double platformMaxTimeSeekable() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlayerPrivateAVFoundationObjCmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -803,7 +803,7 @@
</span><span class="cx"> return maxTimeLoaded;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-unsigned MediaPlayerPrivateAVFoundationObjC::totalBytes() const
</del><ins>+unsigned long long MediaPlayerPrivateAVFoundationObjC::totalBytes() const
</ins><span class="cx"> {
</span><span class="cx"> if (!metaDataAvailable())
</span><span class="cx"> return 0;
</span><span class="lines">@@ -812,7 +812,7 @@
</span><span class="cx"> for (AVPlayerItemTrack *thisTrack in m_cachedTracks.get())
</span><span class="cx"> totalMediaSize += [[thisTrack assetTrack] totalSampleDataLength];
</span><span class="cx">
</span><del>- return static_cast<unsigned>(totalMediaSize);
</del><ins>+ return totalMediaSize;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void MediaPlayerPrivateAVFoundationObjC::setAsset(id asset)
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.cpp (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.cpp        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/testing/InternalSettings.cpp        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -94,6 +94,7 @@
</span><span class="cx"> , m_originalTimeWithoutMouseMovementBeforeHidingControls(settings.timeWithoutMouseMovementBeforeHidingControls())
</span><span class="cx"> , m_useLegacyBackgroundSizeShorthandBehavior(settings.useLegacyBackgroundSizeShorthandBehavior())
</span><span class="cx"> , m_autoscrollForDragAndDropEnabled(settings.autoscrollForDragAndDropEnabled())
</span><ins>+ , m_pluginReplacementEnabled(RuntimeEnabledFeatures::sharedFeatures().pluginReplacementEnabled())
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -156,6 +157,7 @@
</span><span class="cx"> settings.setTimeWithoutMouseMovementBeforeHidingControls(m_originalTimeWithoutMouseMovementBeforeHidingControls);
</span><span class="cx"> settings.setUseLegacyBackgroundSizeShorthandBehavior(m_useLegacyBackgroundSizeShorthandBehavior);
</span><span class="cx"> settings.setAutoscrollForDragAndDropEnabled(m_autoscrollForDragAndDropEnabled);
</span><ins>+ RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(m_pluginReplacementEnabled);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // We can't use RefCountedSupplement because that would try to make InternalSettings RefCounted
</span><span class="lines">@@ -528,4 +530,9 @@
</span><span class="cx"> settings()->setFontFallbackPrefersPictographs(preferPictographs);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void InternalSettings::setPluginReplacementEnabled(bool enabled)
+{
+ RuntimeEnabledFeatures::sharedFeatures().setPluginReplacementEnabled(enabled);
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.h (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.h        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/testing/InternalSettings.h        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx"> bool m_originalTimeWithoutMouseMovementBeforeHidingControls;
</span><span class="cx"> bool m_useLegacyBackgroundSizeShorthandBehavior;
</span><span class="cx"> bool m_autoscrollForDragAndDropEnabled;
</span><ins>+ bool m_pluginReplacementEnabled;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> static PassRefPtr<InternalSettings> create(Page* page)
</span><span class="lines">@@ -136,6 +137,7 @@
</span><span class="cx"> void setUseLegacyBackgroundSizeShorthandBehavior(bool enabled, ExceptionCode&);
</span><span class="cx"> void setAutoscrollForDragAndDropEnabled(bool enabled, ExceptionCode&);
</span><span class="cx"> void setFontFallbackPrefersPictographs(bool preferPictographs, ExceptionCode&);
</span><ins>+ void setPluginReplacementEnabled(bool);
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> explicit InternalSettings(Page*);
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalSettingsidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/InternalSettings.idl (159826 => 159827)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/InternalSettings.idl        2013-11-28 00:22:43 UTC (rev 159826)
+++ trunk/Source/WebCore/testing/InternalSettings.idl        2013-11-28 01:05:35 UTC (rev 159827)
</span><span class="lines">@@ -60,4 +60,5 @@
</span><span class="cx"> [RaisesException] void setUseLegacyBackgroundSizeShorthandBehavior(boolean enabled);
</span><span class="cx"> [RaisesException] void setAutoscrollForDragAndDropEnabled(boolean enabled);
</span><span class="cx"> [RaisesException] void setFontFallbackPrefersPictographs(boolean preferPictographs);
</span><ins>+ void setPluginReplacementEnabled(boolean enabled);
</ins><span class="cx"> };
</span></span></pre>
</div>
</div>
</body>
</html>