Title: [137866] trunk/Source/WebKit2
- Revision
- 137866
- Author
- [email protected]
- Date
- 2012-12-16 18:28:03 -0800 (Sun, 16 Dec 2012)
Log Message
Coordinated Graphics: Small refactor of CoordinatedLayerTreeHost and CoordinatedGraphicsLayer.
https://bugs.webkit.org/show_bug.cgi?id=104880
Patch by Huang Dongsung <[email protected]> on 2012-12-16
Reviewed by Noam Rosenthal.
This patch changes two points.
1. Remove layerByIDMap() in CoordinatedGraphicsLayer because it is unused.
2. Remove code swapping m_registeredLayers in CoordinatedLayerTreeHost because
setCoordinator(0) does not call detachLayer().
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
(WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
(WebKit::CoordinatedLayerTreeHost::~CoordinatedLayerTreeHost):
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (137865 => 137866)
--- trunk/Source/WebKit2/ChangeLog 2012-12-17 02:18:42 UTC (rev 137865)
+++ trunk/Source/WebKit2/ChangeLog 2012-12-17 02:28:03 UTC (rev 137866)
@@ -1,3 +1,21 @@
+2012-12-16 Huang Dongsung <[email protected]>
+
+ Coordinated Graphics: Small refactor of CoordinatedLayerTreeHost and CoordinatedGraphicsLayer.
+ https://bugs.webkit.org/show_bug.cgi?id=104880
+
+ Reviewed by Noam Rosenthal.
+
+ This patch changes two points.
+ 1. Remove layerByIDMap() in CoordinatedGraphicsLayer because it is unused.
+ 2. Remove code swapping m_registeredLayers in CoordinatedLayerTreeHost because
+ setCoordinator(0) does not call detachLayer().
+
+ * WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp:
+ (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
+ (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
+ * WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp:
+ (WebKit::CoordinatedLayerTreeHost::~CoordinatedLayerTreeHost):
+
2012-12-16 Anders Carlsson <[email protected]>
Remove the random crash thread
Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp (137865 => 137866)
--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp 2012-12-17 02:18:42 UTC (rev 137865)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedGraphicsLayer.cpp 2012-12-17 02:28:03 UTC (rev 137866)
@@ -44,12 +44,6 @@
namespace WebCore {
-static HashMap<CoordinatedLayerID, CoordinatedGraphicsLayer*>& layerByIDMap()
-{
- static HashMap<CoordinatedLayerID, CoordinatedGraphicsLayer*> globalMap;
- return globalMap;
-}
-
static CoordinatedLayerID toCoordinatedLayerID(GraphicsLayer* layer)
{
return layer ? toCoordinatedGraphicsLayer(layer)->id() : 0;
@@ -128,13 +122,10 @@
{
static CoordinatedLayerID nextLayerID = 1;
m_id = nextLayerID++;
- layerByIDMap().add(id(), this);
}
CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer()
{
- layerByIDMap().remove(id());
-
if (m_coordinator) {
purgeBackingStores();
m_coordinator->detachLayer(this);
Modified: trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp (137865 => 137866)
--- trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp 2012-12-17 02:18:42 UTC (rev 137865)
+++ trunk/Source/WebKit2/WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.cpp 2012-12-17 02:28:03 UTC (rev 137866)
@@ -73,12 +73,8 @@
#endif
purgeBackingStores();
- // Prevent setCoordinatedGraphicsLayerClient(0) -> detachLayer() from modifying the set while we iterate it.
- HashSet<WebCore::CoordinatedGraphicsLayer*> registeredLayers;
- registeredLayers.swap(m_registeredLayers);
-
- HashSet<WebCore::CoordinatedGraphicsLayer*>::iterator end = registeredLayers.end();
- for (HashSet<WebCore::CoordinatedGraphicsLayer*>::iterator it = registeredLayers.begin(); it != end; ++it)
+ HashSet<WebCore::CoordinatedGraphicsLayer*>::iterator end = m_registeredLayers.end();
+ for (HashSet<WebCore::CoordinatedGraphicsLayer*>::iterator it = m_registeredLayers.begin(); it != end; ++it)
(*it)->setCoordinator(0);
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes