Coordinated Graphics: Reorder messages to CoordinatedLayerTreeHostProxy
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2012 00:42:34 +0000 (00:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Dec 2012 00:42:34 +0000 (00:42 +0000)
https://bugs.webkit.org/show_bug.cgi?id=103843

Patch by Huang Dongsung <luxtella@company100.net> on 2012-12-13
Reviewed by Noam Rosenthal.

Clarify LayerTreeRenderer::setRootLayerID() can be called only once during its
lifecycle. LayerTreeRenderer, CoordinatedLayerTreeHost and CoordinatedLayerTreeHostProxy
have the same lifecycle to WebPage and the root layer is reused even if loading
new page, so it is impossible to call LayerTreeRenderer::setRootLayerID() more
than twice.

* UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
(WebKit::LayerTreeRenderer::setRootLayerID):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@137685 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp

index ca266ef..f5e229b 100644 (file)
@@ -1,3 +1,19 @@
+2012-12-13  Huang Dongsung  <luxtella@company100.net>
+
+        Coordinated Graphics: Reorder messages to CoordinatedLayerTreeHostProxy
+        https://bugs.webkit.org/show_bug.cgi?id=103843
+
+        Reviewed by Noam Rosenthal.
+
+        Clarify LayerTreeRenderer::setRootLayerID() can be called only once during its
+        lifecycle. LayerTreeRenderer, CoordinatedLayerTreeHost and CoordinatedLayerTreeHostProxy
+        have the same lifecycle to WebPage and the root layer is reused even if loading
+        new page, so it is impossible to call LayerTreeRenderer::setRootLayerID() more
+        than twice.
+
+        * UIProcess/CoordinatedGraphics/LayerTreeRenderer.cpp:
+        (WebKit::LayerTreeRenderer::setRootLayerID):
+
 2012-12-13  Alexey Proskuryakov  <ap@apple.com>
 
         <rdar://problem/12838354> DOM cookie access functions should respect private browsing
index 7c63452..1d5e74e 100644 (file)
@@ -392,16 +392,12 @@ WebCore::GraphicsLayer* LayerTreeRenderer::ensureLayer(CoordinatedLayerID id)
 
 void LayerTreeRenderer::setRootLayerID(CoordinatedLayerID layerID)
 {
-    if (layerID == m_rootLayerID)
-        return;
+    ASSERT(layerID != InvalidCoordinatedLayerID);
+    ASSERT(m_rootLayerID == InvalidCoordinatedLayerID);
 
     m_rootLayerID = layerID;
-
     m_rootLayer->removeAllChildren();
 
-    if (!layerID)
-        return;
-
     GraphicsLayer* layer = ensureLayer(layerID);
     m_rootLayer->addChild(layer);
 }