<!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>[187862] releases/WebKitGTK/webkit-2.8/Source</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/187862">187862</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2015-08-04 06:51:03 -0700 (Tue, 04 Aug 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/187338">r187338</a> - [GStreamer] Crashes during plugin installation
https://bugs.webkit.org/show_bug.cgi?id=144099
Reviewed by Philippe Normand.
Source/WebCore:
Add new methods to MediaPlayerClient and ChromeClient to request
the API layer to start the installer when there are missing media
plugins.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::requestInstallMissingPlugins): Pass
the request to the ChromeClient.
* html/HTMLMediaElement.h:
* page/ChromeClient.h:
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::requestInstallMissingPlugins):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
Invalidate any pending request to install missing media plugins.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): In case of
missing plugins message, start a request to install them if
supported by GST.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
(WebCore::MediaPlayerRequestInstallMissingPluginsCallback::create):
(WebCore::MediaPlayerRequestInstallMissingPluginsCallback::MediaPlayerRequestInstallMissingPluginsCallback):
(WebCore::MediaPlayerRequestInstallMissingPluginsCallback::invalidate):
(WebCore::MediaPlayerRequestInstallMissingPluginsCallback::complete):
Source/WebKit2:
Move the missing plugins installation to the UI process, ensuring
there's a single installer running and cancelling the request when
the page is closed or the media player is deleted.
* PlatformEfl.cmake: Add new files to compilation.
* PlatformGTK.cmake: Ditto.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in: Add
RequestInstallMissingMediaPlugins message.
* UIProcess/gstreamer/WebPageProxyGStreamer.cpp: Added.
(WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Call
gst_install_plugins_async() and send
DidEndRequestInstallMissingMediaPlugins message back to the web
process when done.
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::requestInstallMissingMediaPlugins): Call
WebPage::requestInstallMissingMediaPlugins().
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::close): Invalidate the install missing plugins
request callback.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Add
DidEndRequestInstallMissingMediaPlugins message.
* WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp: Added.
(WebKit::WebPage::requestInstallMissingMediaPlugins): Send
RequestInstallMissingMediaPlugins to the UI process or complete
the request early if there's already a request in progress.
(WebKit::WebPage::didEndRequestInstallMissingMediaPlugins):
Complete the request.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCoreChangeLog">releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCorehtmlHTMLMediaElementcpp">releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLMediaElement.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCorehtmlHTMLMediaElementh">releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLMediaElement.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCorepageChromeClienth">releases/WebKitGTK/webkit-2.8/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCoreplatformgraphicsMediaPlayerh">releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/MediaPlayer.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp">releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerh">releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2ChangeLog">releases/WebKitGTK/webkit-2.8/Source/WebKit2/ChangeLog</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2PlatformEflcmake">releases/WebKitGTK/webkit-2.8/Source/WebKit2/PlatformEfl.cmake</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2PlatformGTKcmake">releases/WebKitGTK/webkit-2.8/Source/WebKit2/PlatformGTK.cmake</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2UIProcessWebPageProxyh">releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2UIProcessWebPageProxymessagesin">releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebCoreSupportWebChromeClienth">releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebPageWebPagecpp">releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebPageWebPageh">releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebPageWebPagemessagesin">releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#releasesWebKitGTKwebkit28SourceWebCoreplatformgraphicsgstreamerMediaPlayerRequestInstallMissingPluginsCallbackh">releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h</a></li>
<li>releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/gstreamer/</li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2UIProcessgstreamerWebPageProxyGStreamercpp">releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp</a></li>
<li>releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/gstreamer/</li>
<li><a href="#releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebPagegstreamerWebPageGStreamercpp">releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="releasesWebKitGTKwebkit28SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -1,3 +1,33 @@
</span><ins>+2015-07-24 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GStreamer] Crashes during plugin installation
+ https://bugs.webkit.org/show_bug.cgi?id=144099
+
+ Reviewed by Philippe Normand.
+
+ Add new methods to MediaPlayerClient and ChromeClient to request
+ the API layer to start the installer when there are missing media
+ plugins.
+
+ * html/HTMLMediaElement.cpp:
+ (WebCore::HTMLMediaElement::requestInstallMissingPlugins): Pass
+ the request to the ChromeClient.
+ * html/HTMLMediaElement.h:
+ * page/ChromeClient.h:
+ * platform/graphics/MediaPlayer.h:
+ (WebCore::MediaPlayerClient::requestInstallMissingPlugins):
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
+ Invalidate any pending request to install missing media plugins.
+ (WebCore::MediaPlayerPrivateGStreamer::handleMessage): In case of
+ missing plugins message, start a request to install them if
+ supported by GST.
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+ (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::create):
+ (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::MediaPlayerRequestInstallMissingPluginsCallback):
+ (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::invalidate):
+ (WebCore::MediaPlayerRequestInstallMissingPluginsCallback::complete):
+
</ins><span class="cx"> 2015-07-22 Jinyoung Hur <hur.ims@navercorp.com>
</span><span class="cx">
</span><span class="cx"> [WinCairo] SVG path not rendered with all-zero dasharray
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCorehtmlHTMLMediaElementcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLMediaElement.cpp (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLMediaElement.cpp        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLMediaElement.cpp        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -5821,6 +5821,16 @@
</span><span class="cx"> return potentiallyPlaying() ? requestedPlaybackRate() : 0;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if USE(GSTREAMER)
+void HTMLMediaElement::requestInstallMissingPlugins(const String& details, MediaPlayerRequestInstallMissingPluginsCallback& callback)
+{
+ if (!document().page())
+ return;
+
+ document().page()->chrome().client().requestInstallMissingMediaPlugins(details, callback);
+}
+#endif
+
</ins><span class="cx"> void HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture()
</span><span class="cx"> {
</span><span class="cx"> m_mediaSession->removeBehaviorRestriction(HTMLMediaSession::RequireUserGestureForLoad);
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCorehtmlHTMLMediaElementh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLMediaElement.h (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLMediaElement.h        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLMediaElement.h        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -616,6 +616,11 @@
</span><span class="cx"> virtual double mediaPlayerRequestedPlaybackRate() const override final;
</span><span class="cx">
</span><span class="cx"> void loadTimerFired();
</span><ins>+
+#if USE(GSTREAMER)
+ virtual void requestInstallMissingPlugins(const String&, MediaPlayerRequestInstallMissingPluginsCallback&) override final;
+#endif
+
</ins><span class="cx"> void progressEventTimerFired();
</span><span class="cx"> void playbackProgressTimerFired();
</span><span class="cx"> void scanTimerFired();
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/page/ChromeClient.h (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/page/ChromeClient.h        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/page/ChromeClient.h        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -84,6 +84,10 @@
</span><span class="cx"> class ViewportConstraints;
</span><span class="cx"> class Widget;
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO) && USE(GSTREAMER)
+class MediaPlayerRequestInstallMissingPluginsCallback;
+#endif
+
</ins><span class="cx"> struct DateTimeChooserParameters;
</span><span class="cx"> struct FrameLoadRequest;
</span><span class="cx"> struct GraphicsDeviceAdapter;
</span><span class="lines">@@ -437,6 +441,12 @@
</span><span class="cx">
</span><span class="cx"> virtual bool shouldDispatchFakeMouseMoveEvents() const { return true; }
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
+ virtual void requestInstallMissingMediaPlugins(const String& /*details*/, MediaPlayerRequestInstallMissingPluginsCallback&) { };
+#endif
+#endif
+
</ins><span class="cx"> protected:
</span><span class="cx"> virtual ~ChromeClient() { }
</span><span class="cx"> };
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCoreplatformgraphicsMediaPlayerh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/MediaPlayer.h (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/MediaPlayer.h        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/MediaPlayer.h        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -139,6 +139,10 @@
</span><span class="cx"> struct GraphicsDeviceAdapter;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if USE(GSTREAMER)
+class MediaPlayerRequestInstallMissingPluginsCallback;
+#endif
+
</ins><span class="cx"> class MediaPlayerClient {
</span><span class="cx"> public:
</span><span class="cx"> virtual ~MediaPlayerClient() { }
</span><span class="lines">@@ -267,6 +271,10 @@
</span><span class="cx"> virtual void mediaPlayerEngineFailedToLoad() const { }
</span><span class="cx">
</span><span class="cx"> virtual double mediaPlayerRequestedPlaybackRate() const { return 0; }
</span><ins>+
+#if USE(GSTREAMER)
+ virtual void requestInstallMissingPlugins(const String&, MediaPlayerRequestInstallMissingPluginsCallback&) { };
+#endif
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> class MediaPlayerSupportsTypeClient {
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamercpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include "URL.h"
</span><span class="cx"> #include "MIMETypeRegistry.h"
</span><span class="cx"> #include "MediaPlayer.h"
</span><ins>+#include "MediaPlayerRequestInstallMissingPluginsCallback.h"
</ins><span class="cx"> #include "NotImplemented.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "TimeRanges.h"
</span><span class="lines">@@ -123,12 +124,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-static void mediaPlayerPrivatePluginInstallerResultFunction(GstInstallPluginsReturn result, gpointer userData)
-{
- MediaPlayerPrivateGStreamer* player = reinterpret_cast<MediaPlayerPrivateGStreamer*>(userData);
- player->handlePluginInstallerResult(result);
-}
-
</del><span class="cx"> void MediaPlayerPrivateGStreamer::setAudioStreamProperties(GObject* object)
</span><span class="cx"> {
</span><span class="cx"> if (g_strcmp0(G_OBJECT_TYPE_NAME(object), "GstPulseSink"))
</span><span class="lines">@@ -220,7 +215,6 @@
</span><span class="cx"> , m_audioSourceProvider(AudioSourceProviderGStreamer::create())
</span><span class="cx"> #endif
</span><span class="cx"> , m_requestedState(GST_STATE_VOID_PENDING)
</span><del>- , m_missingPlugins(false)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -249,6 +243,10 @@
</span><span class="cx"> reinterpret_cast<gpointer>(setAudioStreamPropertiesCallback), this);
</span><span class="cx">
</span><span class="cx"> m_readyTimerHandler.cancel();
</span><ins>+ if (m_missingPluginsCallback) {
+ m_missingPluginsCallback->invalidate();
+ m_missingPluginsCallback = nullptr;
+ }
</ins><span class="cx">
</span><span class="cx"> if (m_playBin) {
</span><span class="cx"> GRefPtr<GstBus> bus = adoptGRef(gst_pipeline_get_bus(GST_PIPELINE(m_playBin.get())));
</span><span class="lines">@@ -936,7 +934,7 @@
</span><span class="cx"> case GST_MESSAGE_ERROR:
</span><span class="cx"> if (m_resetPipeline)
</span><span class="cx"> break;
</span><del>- if (m_missingPlugins)
</del><ins>+ if (m_missingPluginsCallback)
</ins><span class="cx"> break;
</span><span class="cx"> gst_message_parse_error(message, &err.outPtr(), &debug.outPtr());
</span><span class="cx"> ERROR_MEDIA_MESSAGE("Error %d: %s (url=%s)", err->code, err->message, m_url.string().utf8().data());
</span><span class="lines">@@ -1031,11 +1029,18 @@
</span><span class="cx"> break;
</span><span class="cx"> case GST_MESSAGE_ELEMENT:
</span><span class="cx"> if (gst_is_missing_plugin_message(message)) {
</span><del>- gchar* detail = gst_missing_plugin_message_get_installer_detail(message);
- gchar* detailArray[2] = {detail, 0};
- GstInstallPluginsReturn result = gst_install_plugins_async(detailArray, 0, mediaPlayerPrivatePluginInstallerResultFunction, this);
- m_missingPlugins = result == GST_INSTALL_PLUGINS_STARTED_OK;
- g_free(detail);
</del><ins>+ GUniquePtr<char> detail(gst_missing_plugin_message_get_installer_detail(message));
+ if (gst_install_plugins_supported()) {
+ m_missingPluginsCallback = MediaPlayerRequestInstallMissingPluginsCallback::create([this](uint32_t result) {
+ m_missingPluginsCallback = nullptr;
+ if (result != GST_INSTALL_PLUGINS_SUCCESS)
+ return;
+
+ changePipelineState(GST_STATE_READY);
+ changePipelineState(GST_STATE_PAUSED);
+ });
+ m_player->client().requestInstallMissingPlugins(String::fromUTF8(detail.get()), *m_missingPluginsCallback);
+ }
</ins><span class="cx"> }
</span><span class="cx"> #if ENABLE(VIDEO_TRACK) && USE(GSTREAMER_MPEGTS)
</span><span class="cx"> else {
</span><span class="lines">@@ -1060,15 +1065,6 @@
</span><span class="cx"> return TRUE;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MediaPlayerPrivateGStreamer::handlePluginInstallerResult(GstInstallPluginsReturn result)
-{
- m_missingPlugins = false;
- if (result == GST_INSTALL_PLUGINS_SUCCESS) {
- changePipelineState(GST_STATE_READY);
- changePipelineState(GST_STATE_PAUSED);
- }
-}
-
</del><span class="cx"> void MediaPlayerPrivateGStreamer::processBufferingStats(GstMessage* message)
</span><span class="cx"> {
</span><span class="cx"> m_buffering = true;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -58,6 +58,7 @@
</span><span class="cx"> class AudioTrackPrivateGStreamer;
</span><span class="cx"> class InbandMetadataTextTrackPrivateGStreamer;
</span><span class="cx"> class InbandTextTrackPrivateGStreamer;
</span><ins>+class MediaPlayerRequestInstallMissingPluginsCallback;
</ins><span class="cx"> class VideoTrackPrivateGStreamer;
</span><span class="cx">
</span><span class="cx"> class MediaPlayerPrivateGStreamer : public MediaPlayerPrivateGStreamerBase {
</span><span class="lines">@@ -234,7 +235,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> GstState m_requestedState;
</span><span class="cx"> GRefPtr<GstElement> m_autoAudioSink;
</span><del>- bool m_missingPlugins;
</del><ins>+ RefPtr<MediaPlayerRequestInstallMissingPluginsCallback> m_missingPluginsCallback;
</ins><span class="cx"> #if ENABLE(VIDEO_TRACK)
</span><span class="cx"> Vector<RefPtr<AudioTrackPrivateGStreamer>> m_audioTracks;
</span><span class="cx"> Vector<RefPtr<InbandTextTrackPrivateGStreamer>> m_textTracks;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebCoreplatformgraphicsgstreamerMediaPlayerRequestInstallMissingPluginsCallbackh"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h (0 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/Source/WebCore/platform/graphics/gstreamer/MediaPlayerRequestInstallMissingPluginsCallback.h        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -0,0 +1,61 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * aint with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef MediaPlayerRequestInstallMissingPluginsCallback_h
+#define MediaPlayerRequestInstallMissingPluginsCallback_h
+
+#if ENABLE(VIDEO) && USE(GSTREAMER)
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class MediaPlayerRequestInstallMissingPluginsCallback : public RefCounted<MediaPlayerRequestInstallMissingPluginsCallback> {
+ WTF_MAKE_FAST_ALLOCATED();
+public:
+ static Ref<MediaPlayerRequestInstallMissingPluginsCallback> create(std::function<void (uint32_t)>&& function)
+ {
+ return adoptRef(*new MediaPlayerRequestInstallMissingPluginsCallback(WTF::move(function)));
+ }
+
+ void invalidate()
+ {
+ m_function = nullptr;
+ }
+
+ void complete(uint32_t result)
+ {
+ if (!m_function)
+ return;
+ m_function(result);
+ m_function = nullptr;
+ }
+
+private:
+ MediaPlayerRequestInstallMissingPluginsCallback(std::function<void (uint32_t)>&& function)
+ : m_function(WTF::move(function))
+ {
+ }
+
+ std::function<void (uint32_t)> m_function;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(VIDEO) && USE(GSTREAMER)
+#endif // MediaPlayerRequestInstallMissingPluginsCallback_h
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/ChangeLog (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/ChangeLog        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/ChangeLog        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2015-07-24 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GStreamer] Crashes during plugin installation
+ https://bugs.webkit.org/show_bug.cgi?id=144099
+
+ Reviewed by Philippe Normand.
+
+ Move the missing plugins installation to the UI process, ensuring
+ there's a single installer running and cancelling the request when
+ the page is closed or the media player is deleted.
+
+ * PlatformEfl.cmake: Add new files to compilation.
+ * PlatformGTK.cmake: Ditto.
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in: Add
+ RequestInstallMissingMediaPlugins message.
+ * UIProcess/gstreamer/WebPageProxyGStreamer.cpp: Added.
+ (WebKit::WebPageProxy::requestInstallMissingMediaPlugins): Call
+ gst_install_plugins_async() and send
+ DidEndRequestInstallMissingMediaPlugins message back to the web
+ process when done.
+ * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+ (WebKit::WebChromeClient::requestInstallMissingMediaPlugins): Call
+ WebPage::requestInstallMissingMediaPlugins().
+ * WebProcess/WebCoreSupport/WebChromeClient.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::close): Invalidate the install missing plugins
+ request callback.
+ * WebProcess/WebPage/WebPage.h:
+ * WebProcess/WebPage/WebPage.messages.in: Add
+ DidEndRequestInstallMissingMediaPlugins message.
+ * WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp: Added.
+ (WebKit::WebPage::requestInstallMissingMediaPlugins): Send
+ RequestInstallMissingMediaPlugins to the UI process or complete
+ the request early if there's already a request in progress.
+ (WebKit::WebPage::didEndRequestInstallMissingMediaPlugins):
+ Complete the request.
+
</ins><span class="cx"> 2015-07-21 Andreas Kling <akling@apple.com>
</span><span class="cx">
</span><span class="cx"> API::Session should clean up its storage in the network process when destroyed.
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2PlatformEflcmake"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/PlatformEfl.cmake (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/PlatformEfl.cmake        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/PlatformEfl.cmake        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -174,6 +174,8 @@
</span><span class="cx"> UIProcess/efl/WebUIPopupMenuClient.cpp
</span><span class="cx"> UIProcess/efl/WebViewEfl.cpp
</span><span class="cx">
</span><ins>+ UIProcess/gstreamer/WebPageProxyGStreamer.cpp
+
</ins><span class="cx"> UIProcess/soup/WebCookieManagerProxySoup.cpp
</span><span class="cx"> UIProcess/soup/WebProcessPoolSoup.cpp
</span><span class="cx">
</span><span class="lines">@@ -206,6 +208,8 @@
</span><span class="cx"> WebProcess/WebPage/efl/WebInspectorUIEfl.cpp
</span><span class="cx"> WebProcess/WebPage/efl/WebPageEfl.cpp
</span><span class="cx">
</span><ins>+ WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp
+
</ins><span class="cx"> WebProcess/efl/ExtensionManagerEfl.cpp
</span><span class="cx"> WebProcess/efl/SeccompFiltersWebProcessEfl.cpp
</span><span class="cx"> WebProcess/efl/WebProcessMainEfl.cpp
</span><span class="lines">@@ -269,6 +273,7 @@
</span><span class="cx"> ${EO_INCLUDE_DIRS}
</span><span class="cx"> ${EVAS_INCLUDE_DIRS}
</span><span class="cx"> ${GLIB_INCLUDE_DIRS}
</span><ins>+ ${GSTREAMER_INCLUDE_DIRS}
</ins><span class="cx"> ${HARFBUZZ_INCLUDE_DIRS}
</span><span class="cx"> ${LIBSOUP_INCLUDE_DIRS}
</span><span class="cx"> ${LIBXML2_INCLUDE_DIR}
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2PlatformGTKcmake"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/PlatformGTK.cmake (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/PlatformGTK.cmake        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/PlatformGTK.cmake        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -270,6 +270,8 @@
</span><span class="cx">
</span><span class="cx"> UIProcess/cairo/BackingStoreCairo.cpp
</span><span class="cx">
</span><ins>+ UIProcess/gstreamer/WebPageProxyGStreamer.cpp
+
</ins><span class="cx"> UIProcess/gtk/DragAndDropHandler.cpp
</span><span class="cx"> UIProcess/gtk/ExperimentalFeatures.cpp
</span><span class="cx"> UIProcess/gtk/GestureController.cpp
</span><span class="lines">@@ -320,6 +322,8 @@
</span><span class="cx">
</span><span class="cx"> WebProcess/WebPage/atk/WebPageAccessibilityObjectAtk.cpp
</span><span class="cx">
</span><ins>+ WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp
+
</ins><span class="cx"> WebProcess/WebPage/gtk/PrinterListGtk.cpp
</span><span class="cx"> WebProcess/WebPage/gtk/WebInspectorUIGtk.cpp
</span><span class="cx"> WebProcess/WebPage/gtk/WebPageGtk.cpp
</span><span class="lines">@@ -474,6 +478,7 @@
</span><span class="cx"> ${CAIRO_INCLUDE_DIRS}
</span><span class="cx"> ${ENCHANT_INCLUDE_DIRS}
</span><span class="cx"> ${GEOCLUE_INCLUDE_DIRS}
</span><ins>+ ${GSTREAMER_INCLUDE_DIRS}
</ins><span class="cx"> ${HARFBUZZ_INCLUDE_DIRS}
</span><span class="cx"> ${LIBSOUP_INCLUDE_DIRS}
</span><span class="cx"> )
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/WebPageProxy.h (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/WebPageProxy.h        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/WebPageProxy.h        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -1377,6 +1377,12 @@
</span><span class="cx"> void didPerformActionMenuHitTest(const ActionMenuHitTestResult&, bool forImmediateAction, const UserData&);
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
+ void requestInstallMissingMediaPlugins(const String& details);
+#endif
+#endif
+
</ins><span class="cx"> PageClient& m_pageClient;
</span><span class="cx"> std::unique_ptr<API::LoaderClient> m_loaderClient;
</span><span class="cx"> std::unique_ptr<API::PolicyClient> m_policyClient;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/WebPageProxy.messages.in (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -421,4 +421,8 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> DidPerformActionMenuHitTest(struct WebKit::ActionMenuHitTestResult result, bool forImmediateAction, WebKit::UserData userData)
</span><span class="cx"> #endif
</span><ins>+
+#if ENABLE(VIDEO) && USE(GSTREAMER)
+ RequestInstallMissingMediaPlugins(String details)
+#endif
</ins><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2UIProcessgstreamerWebPageProxyGStreamercpp"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp (0 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/UIProcess/gstreamer/WebPageProxyGStreamer.cpp        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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"
+#include "WebPageProxy.h"
+
+#if ENABLE(VIDEO) && USE(GSTREAMER)
+
+#include "WebPageMessages.h"
+#include <gst/pbutils/install-plugins.h>
+
+namespace WebKit {
+
+void WebPageProxy::requestInstallMissingMediaPlugins(const String& details)
+{
+ CString detail = details.utf8();
+ const char* detailArray[2] = { detail.data(), nullptr };
+ ref();
+ // FIXME: Use a proper GstInstallPluginsContext instead of nullptr.
+ GstInstallPluginsReturn result = gst_install_plugins_async(detailArray, nullptr, [](GstInstallPluginsReturn result, gpointer userData) {
+ RefPtr<WebPageProxy> page = adoptRef(static_cast<WebPageProxy*>(userData));
+ if (page->isValid())
+ page->send(Messages::WebPage::DidEndRequestInstallMissingMediaPlugins(static_cast<uint32_t>(result)));
+ }, this);
+
+ if (result != GST_INSTALL_PLUGINS_STARTED_OK) {
+ // If the installer didn't start, the callback will not be called, so remove the ref manually.
+ deref();
+ send(Messages::WebPage::DidEndRequestInstallMissingMediaPlugins(static_cast<uint32_t>(result)));
+ WTFLogAlways("Missing GStreamer Plugin: %s\n", detail.data());
+ }
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(VIDEO) && USE(GSTREAMER)
</ins></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -1102,4 +1102,13 @@
</span><span class="cx"> return m_page->shouldDispatchFakeMouseMoveEvents();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
+void WebChromeClient::requestInstallMissingMediaPlugins(const String& details, WebCore::MediaPlayerRequestInstallMissingPluginsCallback& callback)
+{
+ m_page->requestInstallMissingMediaPlugins(details, callback);
+}
+#endif
+#endif // ENABLE(VIDEO)
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -310,6 +310,12 @@
</span><span class="cx">
</span><span class="cx"> virtual bool shouldDispatchFakeMouseMoveEvents() const override;
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
+ virtual void requestInstallMissingMediaPlugins(const String&, WebCore::MediaPlayerRequestInstallMissingPluginsCallback&) override;
+#endif
+#endif
+
</ins><span class="cx"> String m_cachedToolTip;
</span><span class="cx"> mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
</span><span class="cx"> mutable bool m_cachedMainFrameHasHorizontalScrollbar;
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -213,6 +213,10 @@
</span><span class="cx"> #include "CoordinatedLayerTreeHostMessages.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO) && USE(GSTREAMER)
+#include <WebCore/MediaPlayerRequestInstallMissingPluginsCallback.h>
+#endif
+
</ins><span class="cx"> using namespace JSC;
</span><span class="cx"> using namespace WebCore;
</span><span class="cx">
</span><span class="lines">@@ -1013,6 +1017,13 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO) && USE(GSTREAMER)
+ if (m_installMediaPluginsCallback) {
+ m_installMediaPluginsCallback->invalidate();
+ m_installMediaPluginsCallback = nullptr;
+ }
+#endif
+
</ins><span class="cx"> m_sandboxExtensionTracker.invalidate();
</span><span class="cx">
</span><span class="cx"> #if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC)
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.h (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -139,6 +139,10 @@
</span><span class="cx"> struct Highlight;
</span><span class="cx"> struct KeypressCommand;
</span><span class="cx"> struct TextCheckingResult;
</span><ins>+
+#if ENABLE(VIDEO) && USE(GSTREAMER)
+class MediaPlayerRequestInstallMissingPluginsCallback;
+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -865,6 +869,12 @@
</span><span class="cx">
</span><span class="cx"> void setPageActivityState(WebCore::PageActivityState::Flags);
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO)
+#if USE(GSTREAMER)
+ void requestInstallMissingMediaPlugins(const String& details, WebCore::MediaPlayerRequestInstallMissingPluginsCallback&);
+#endif
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx"> WebPage(uint64_t pageID, const WebPageCreationParameters&);
</span><span class="cx">
</span><span class="lines">@@ -1092,6 +1102,10 @@
</span><span class="cx">
</span><span class="cx"> void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
</span><span class="cx">
</span><ins>+#if ENABLE(VIDEO) && USE(GSTREAMER)
+ void didEndRequestInstallMissingMediaPlugins(uint32_t result);
+#endif
+
</ins><span class="cx"> uint64_t m_pageID;
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<WebCore::Page> m_page;
</span><span class="lines">@@ -1337,6 +1351,10 @@
</span><span class="cx">
</span><span class="cx"> bool m_mainFrameProgressCompleted;
</span><span class="cx"> bool m_shouldDispatchFakeMouseMoveEvents;
</span><ins>+
+#if ENABLE(VIDEO) && USE(GSTREAMER)
+ RefPtr<WebCore::MediaPlayerRequestInstallMissingPluginsCallback> m_installMediaPluginsCallback;
+#endif
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (187861 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2015-08-04 13:50:19 UTC (rev 187861)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -409,4 +409,8 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> SetShouldDispatchFakeMouseMoveEvents(bool shouldDispatchFakeMouseMoveEvents)
</span><ins>+
+#if ENABLE(VIDEO) && USE(GSTREAMER)
+ DidEndRequestInstallMissingMediaPlugins(uint32_t result)
+#endif
</ins><span class="cx"> }
</span></span></pre></div>
<a id="releasesWebKitGTKwebkit28SourceWebKit2WebProcessWebPagegstreamerWebPageGStreamercpp"></a>
<div class="addfile"><h4>Added: releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp (0 => 187862)</h4>
<pre class="diff"><span>
<span class="info">--- releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp         (rev 0)
+++ releases/WebKitGTK/webkit-2.8/Source/WebKit2/WebProcess/WebPage/gstreamer/WebPageGStreamer.cpp        2015-08-04 13:51:03 UTC (rev 187862)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * 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 INC. AND ITS CONTRIBUTORS ``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 INC. OR ITS 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"
+#include "WebPage.h"
+
+#if ENABLE(VIDEO) && USE(GSTREAMER)
+
+#include "WebPageProxyMessages.h"
+#include <WebCore/MediaPlayerRequestInstallMissingPluginsCallback.h>
+#include <gst/pbutils/install-plugins.h>
+
+namespace WebKit {
+
+void WebPage::requestInstallMissingMediaPlugins(const String& details, WebCore::MediaPlayerRequestInstallMissingPluginsCallback& callback)
+{
+ if (m_installMediaPluginsCallback) {
+ callback.complete(GST_INSTALL_PLUGINS_INSTALL_IN_PROGRESS);
+ return;
+ }
+
+ m_installMediaPluginsCallback = &callback;
+ send(Messages::WebPageProxy::RequestInstallMissingMediaPlugins(details));
+}
+
+void WebPage::didEndRequestInstallMissingMediaPlugins(uint32_t result)
+{
+ if (!m_installMediaPluginsCallback)
+ return;
+
+ m_installMediaPluginsCallback->complete(result);
+ m_installMediaPluginsCallback = nullptr;
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(VIDEO) && USE(GSTREAMER)
</ins></span></pre>
</div>
</div>
</body>
</html>