Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(940)

Unified Diff: Source/core/inspector/InspectorLayerTreeAgent.cpp

Issue 1167063002: DevTools: return error when trying to load an empty (0 x 0) picture (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/inspector/InspectorLayerTreeAgent.cpp
diff --git a/Source/core/inspector/InspectorLayerTreeAgent.cpp b/Source/core/inspector/InspectorLayerTreeAgent.cpp
index 822b43720bcc4fd8db140b863da31498c1ff7071..88d9a0da8e9ce4473a29bf6f7760164b2f3f3943 100644
--- a/Source/core/inspector/InspectorLayerTreeAgent.cpp
+++ b/Source/core/inspector/InspectorLayerTreeAgent.cpp
@@ -367,9 +367,14 @@ void InspectorLayerTreeAgent::loadSnapshot(ErrorString* errorString, const RefPt
}
RefPtr<PictureSnapshot> snapshot = PictureSnapshot::load(decodedTiles);
if (!snapshot) {
- *errorString = "Invalida snapshot format";
+ *errorString = "Invalid snapshot format";
return;
}
+ if (snapshot->isEmpty()) {
+ *errorString = "Empty snapshot";
+ return;
+ }
+
*snapshotId = String::number(++s_lastSnapshotId);
bool newEntry = m_snapshotById.add(*snapshotId, snapshot).isNewEntry;
ASSERT_UNUSED(newEntry, newEntry);

Powered by Google App Engine
This is Rietveld 408576698