[chromium] Add diagnostic CRASH calls for tiler crashes
authorenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 May 2012 01:13:55 +0000 (01:13 +0000)
committerenne@google.com <enne@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 19 May 2012 01:13:55 +0000 (01:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86930

Reviewed by James Robinson.

These lines would normally crash on their own due to null pointers,
but having an explicit CRASH call will help us differentiate what the
real problem might be in the crash report.

* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::createTile):
(WebCore::TiledLayerChromium::updateTiles):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp

index 3fc99f7..a16fe90 100644 (file)
@@ -1,3 +1,18 @@
+2012-05-18  Adrienne Walker  <enne@google.com>
+
+        [chromium] Add diagnostic CRASH calls for tiler crashes
+        https://bugs.webkit.org/show_bug.cgi?id=86930
+
+        Reviewed by James Robinson.
+
+        These lines would normally crash on their own due to null pointers,
+        but having an explicit CRASH call will help us differentiate what the
+        real problem might be in the crash report.
+
+        * platform/graphics/chromium/TiledLayerChromium.cpp:
+        (WebCore::TiledLayerChromium::createTile):
+        (WebCore::TiledLayerChromium::updateTiles):
+
 2012-05-18  Aaron Colwell  <acolwell@chromium.org>
 
         Update Media Source implementation to reflect changes in 0.5 spec.
index 6c27358..7e558d0 100644 (file)
@@ -261,6 +261,13 @@ UpdatableTile* TiledLayerChromium::createTile(int i, int j)
     m_tiler->addTile(tile.release(), i, j);
 
     addedTile->dirtyRect = m_tiler->tileRect(addedTile);
+
+    // Temporary diagnostic crash.
+    if (!addedTile)
+        CRASH();
+    if (!tileAt(i, j))
+        CRASH();
+
     return addedTile;
 }
 
@@ -363,6 +370,10 @@ void TiledLayerChromium::updateTiles(bool idle, int left, int top, int right, in
             if (!tile)
                 tile = createTile(i, j);
 
+            // Temporary diagnostic crash
+            if (!m_tiler)
+                CRASH();
+
             if (!tile->managedTexture()->isValid(m_tiler->tileSize(), m_textureFormat)) {
                 // Sets the dirty rect to a full-sized tile with border texels.
                 tile->dirtyRect = m_tiler->tileRect(tile);
@@ -412,6 +423,8 @@ void TiledLayerChromium::updateTiles(bool idle, int left, int top, int right, in
     for (int j = top; j <= bottom; ++j) {
         for (int i = left; i <= right; ++i) {
             UpdatableTile* tile = tileAt(i, j);
+            if (!tile)
+                CRASH();
             if (tile->updated)
                 tile->copyAndClearDirty();
             else if (!idle && occlusion && tile->isDirty())