<!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>[172828] 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/172828">172828</a></dd>
<dt>Author</dt> <dd>vjaquez@igalia.com</dd>
<dt>Date</dt> <dd>2014-08-21 03:51:03 -0700 (Thu, 21 Aug 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[GTK] WebkitWebProcess crashing navigating away from ogg video element
https://bugs.webkit.org/show_bug.cgi?id=135348

Reviewed by Philippe Normand.

Source/WebCore:

Let GraphicsLayerTextureMapper know it needs to detach the platform
layer when a MediaPlayerPrivateGStreamerBase is destroyed.

No new test since media/restore-from-page-cache.html covers it.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):

Source/WebKit2:

When a page is cached, by default doesn't recreate the backing store
(an optimization added in <a href="http://trac.webkit.org/projects/webkit/changeset/89316">r89316</a>).

Not all the ports uses that optimization. For example IOS port doesn't
use it (<a href="http://trac.webkit.org/projects/webkit/changeset/161185">r161185</a>).

In the case of the GTK port, the MediaPlayerPrivateGStreamer, not only
processes video buffers, also display them, because it is a
TextureMapperPlatformLayer too.

Nevertheless, in <a href="http://trac.webkit.org/projects/webkit/changeset/153937">r153937</a>, when a page is cached, the player is
destroyed. But our player has a backing store and the render tree
doesn't know that the player has gone. Hence, when the page is redraw,
the TextureMapper tree visits the video element, which doesn't exist
anymore, a segmentation fault occurs.

So, as our media player renders, and as we cannot trust that the
player exists when a page is painted, we cannot rely in the <a href="http://trac.webkit.org/projects/webkit/changeset/89316">r89316</a>
optimization.

Disabling the backing stores optimization fixes the problem.

Covered by existing tests.

* WebProcess/soup/WebProcessSoup.cpp:
(WebKit::WebProcess::platformSetCacheModel): Enable the backing store
clearing when page caching for GTK.

LayoutTests:

* platform/gtk/TestExpectations: Enable
media/restore-from-page-cache.html,
plugins/netscape-plugin-page-cache-works.html and
animations/resume-after-page-cache.html. They should pass correctly.
Skip compositing/iframes/page-cache-layer-tree.html since we disable
that optimization.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerBasecpp">trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcesssoupWebProcessSoupcpp">trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (172827 => 172828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-08-21 09:32:35 UTC (rev 172827)
+++ trunk/LayoutTests/ChangeLog        2014-08-21 10:51:03 UTC (rev 172828)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2014-08-21  Víctor Manuel Jáquez Leal  &lt;vjaquez@igalia.com&gt;
+
+        [GTK] WebkitWebProcess crashing navigating away from ogg video element
+        https://bugs.webkit.org/show_bug.cgi?id=135348
+
+        Reviewed by Philippe Normand.
+
+        * platform/gtk/TestExpectations: Enable
+        media/restore-from-page-cache.html,
+        plugins/netscape-plugin-page-cache-works.html and
+        animations/resume-after-page-cache.html. They should pass correctly.
+        Skip compositing/iframes/page-cache-layer-tree.html since we disable
+        that optimization.
+
</ins><span class="cx"> 2014-08-21  Shivakumar JM  &lt;shiva.jm@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [EFL][WK2] Websocket Layout Tests passed in latest build.
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (172827 => 172828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2014-08-21 09:32:35 UTC (rev 172827)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2014-08-21 10:51:03 UTC (rev 172828)
</span><span class="lines">@@ -580,8 +580,6 @@
</span><span class="cx"> webkit.org/b/89650 [ Debug ] svg/W3C-SVG-1.1/animate-elem-85-t.svg [ Failure Pass ]
</span><span class="cx"> webkit.org/b/89650 svg/W3C-SVG-1.1/struct-dom-06-b.svg [ Failure Pass ]
</span><span class="cx"> 
</span><del>-webkit.org/b/80158 plugins/netscape-plugin-page-cache-works.html [ Failure Pass ]
-
</del><span class="cx"> webkit.org/b/89811 media/media-blocked-by-beforeload.html [ Failure Pass ]
</span><span class="cx"> webkit.org/b/84856 media/media-controller-playback.html [ Crash Failure Timeout Pass ]
</span><span class="cx"> 
</span><span class="lines">@@ -678,8 +676,6 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/119041 css3/calc/img-size.html [ ImageOnlyFailure Pass ]
</span><span class="cx"> 
</span><del>-webkit.org/b/119042 animations/resume-after-page-cache.html [ Failure Pass Crash ]
-
</del><span class="cx"> # These tests started to time out (or time out more often) since the FTL merge
</span><span class="cx"> webkit.org/b/119253 [ Release ] css3/autoclose-braces-and-parentheses.html [ Timeout Pass ]
</span><span class="cx"> webkit.org/b/119253 [ Debug ] js/dfg-osr-entry-hoisted-clobbered-structure-check.html [ Timeout Pass ]
</span><span class="lines">@@ -2006,7 +2002,6 @@
</span><span class="cx"> webkit.org/b/132126 media/track/track-cues-cuechange.html [ Timeout Pass ]
</span><span class="cx"> webkit.org/b/132126 media/track/track-cues-enter-exit.html [ Timeout Pass ]
</span><span class="cx"> webkit.org/b/132126 media/video-poster-background.html [ ImageOnlyFailure ]
</span><del>-webkit.org/b/132126 media/restore-from-page-cache.html [ Crash ]
</del><span class="cx"> 
</span><span class="cx"> webkit.org/b/132233 fast/regions/clip-to-padding-box-vertical-lr.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span><span class="lines">@@ -2094,6 +2089,9 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/132421 fast/multicol/fixed-stack.html [ Pass ]
</span><span class="cx"> 
</span><ins>+# The backing store is cleared when page cached in GTK
+webkit.org/b/135348 compositing/iframes/page-cache-layer-tree.html [ Skip ]
+
</ins><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span><span class="cx"> # End of Tests failing
</span><span class="cx"> #////////////////////////////////////////////////////////////////////////////////////////
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (172827 => 172828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-08-21 09:32:35 UTC (rev 172827)
+++ trunk/Source/WebCore/ChangeLog        2014-08-21 10:51:03 UTC (rev 172828)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2014-08-21  Víctor Manuel Jáquez Leal  &lt;vjaquez@igalia.com&gt;
+
+        [GTK] WebkitWebProcess crashing navigating away from ogg video element
+        https://bugs.webkit.org/show_bug.cgi?id=135348
+
+        Reviewed by Philippe Normand.
+
+        Let GraphicsLayerTextureMapper know it needs to detach the platform
+        layer when a MediaPlayerPrivateGStreamerBase is destroyed.
+
+        No new test since media/restore-from-page-cache.html covers it.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
+        (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
+
</ins><span class="cx"> 2014-08-20  Benjamin Poulain  &lt;benjamin@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         CSS: Implement the :placeholder-shown pseudo-class from Selectors Level 4
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsgstreamerMediaPlayerPrivateGStreamerBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp (172827 => 172828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp        2014-08-21 09:32:35 UTC (rev 172827)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp        2014-08-21 10:51:03 UTC (rev 172828)
</span><span class="lines">@@ -121,6 +121,11 @@
</span><span class="cx">         g_signal_handler_disconnect(m_volumeElement.get(), m_muteSignalHandler);
</span><span class="cx">         m_muteSignalHandler = 0;
</span><span class="cx">     }
</span><ins>+
+#if USE(ACCELERATED_COMPOSITING) &amp;&amp; USE(TEXTURE_MAPPER_GL) &amp;&amp; !USE(COORDINATED_GRAPHICS)
+    if (client())
+        client()-&gt;platformLayerWillBeDestroyed();
+#endif
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Returns the size of the video
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (172827 => 172828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-08-21 09:32:35 UTC (rev 172827)
+++ trunk/Source/WebKit2/ChangeLog        2014-08-21 10:51:03 UTC (rev 172828)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2014-08-21  Víctor Manuel Jáquez Leal  &lt;vjaquez@igalia.com&gt;
+
+        [GTK] WebkitWebProcess crashing navigating away from ogg video element
+        https://bugs.webkit.org/show_bug.cgi?id=135348
+
+        Reviewed by Philippe Normand.
+
+        When a page is cached, by default doesn't recreate the backing store
+        (an optimization added in r89316).
+
+        Not all the ports uses that optimization. For example IOS port doesn't
+        use it (r161185).
+
+        In the case of the GTK port, the MediaPlayerPrivateGStreamer, not only
+        processes video buffers, also display them, because it is a
+        TextureMapperPlatformLayer too.
+
+        Nevertheless, in r153937, when a page is cached, the player is
+        destroyed. But our player has a backing store and the render tree
+        doesn't know that the player has gone. Hence, when the page is redraw,
+        the TextureMapper tree visits the video element, which doesn't exist
+        anymore, a segmentation fault occurs.
+
+        So, as our media player renders, and as we cannot trust that the
+        player exists when a page is painted, we cannot rely in the r89316
+        optimization.
+
+        Disabling the backing stores optimization fixes the problem.
+
+        Covered by existing tests.
+
+        * WebProcess/soup/WebProcessSoup.cpp:
+        (WebKit::WebProcess::platformSetCacheModel): Enable the backing store
+        clearing when page caching for GTK.
+
</ins><span class="cx"> 2014-08-20  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Introducing WEBCORE_EXPORT macro.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcesssoupWebProcessSoupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp (172827 => 172828)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp        2014-08-21 09:32:35 UTC (rev 172827)
+++ trunk/Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp        2014-08-21 10:51:03 UTC (rev 172828)
</span><span class="lines">@@ -110,6 +110,10 @@
</span><span class="cx">     WebCore::memoryCache()-&gt;setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
</span><span class="cx">     WebCore::pageCache()-&gt;setCapacity(pageCacheCapacity);
</span><span class="cx"> 
</span><ins>+#if PLATFORM(GTK)
+    WebCore::pageCache()-&gt;setShouldClearBackingStores(true);
+#endif
+
</ins><span class="cx">     if (!usesNetworkProcess()) {
</span><span class="cx">         if (urlCacheDiskCapacity &gt; soup_cache_get_max_size(cache))
</span><span class="cx">             soup_cache_set_max_size(cache, urlCacheDiskCapacity);
</span></span></pre>
</div>
</div>

</body>
</html>