[GTK] WebkitWebProcess crashing navigating away from ogg video element
authorvjaquez@igalia.com <vjaquez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Aug 2014 10:51:03 +0000 (10:51 +0000)
committervjaquez@igalia.com <vjaquez@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Aug 2014 10:51:03 +0000 (10:51 +0000)
commit5fb4f7b5ff7dab3b08336fae64b6eb3002c1d6d5
tree3f430346e0f450e031463f2c65c1ffa82ee605ee
parent79a8a64c786030dd32ef76165068f4f1ccce71b0
[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 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.

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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@172828 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/soup/WebProcessSoup.cpp