[Chromium] Using WebViewPlugins with --force-compositing-mode causes an ASSERT to...
authorfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2012 00:09:12 +0000 (00:09 +0000)
committerfsamuel@chromium.org <fsamuel@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2012 00:09:12 +0000 (00:09 +0000)
commitad251686b5db1d917772130fcff540d1bd93d149
tree18daf0938d8ab3c5a5f6c586194fe831005328be
parenta7ea109a27c2d13e6ed28aa83d720067d650845e
[Chromium] Using WebViewPlugins with --force-compositing-mode causes an ASSERT to fail
https://bugs.webkit.org/show_bug.cgi?id=81954

Reviewed by James Robinson.

A static variable s_inPaintContents is set when painting, and it ensures
that we don't delete GraphicsLayers or create GraphicsLayers while painting.

However, because this variable is static, it does not permit the existence
of multiple WebViews in different stages (one laying out and one painting).

This manifests itself if one attempts to use the --force-compositing-mode
in Chromium and attempts to navigate to a page with a missing or old plugin
or a browser plugin (which uses a WebViewPlugin as a placeholder until it's
done loading).

The solution to simplify debugging is to make this flag per-Page.
We can access Page from RenderLayerBacking which is a GraphicsLayerClient.
We add a new method GraphicsLayerClient::verifyNotPainting with a default
(do nothing) implementation and override it in RenderLayerBacking to
test the flag set in Page.

* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(Page):
(WebCore::Page::setIsPainting):
(WebCore::Page::isPainting):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
(WebCore::GraphicsLayer::~GraphicsLayer):
(WebCore::GraphicsLayer::paintGraphicsLayerContents):
* platform/graphics/GraphicsLayerClient.h:
(GraphicsLayerClient):
(WebCore::GraphicsLayerClient::verifyNotPainting):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::paintContents):
(WebCore):
(WebCore::RenderLayerBacking::verifyNotPainting):
* rendering/RenderLayerBacking.h:
(RenderLayerBacking):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayerClient.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h