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

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

Issue 1841833002: Deal gracefully with null {GraphicsContext,SkPictureBuilder}.endRecording() results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't end recording twice in DrawingRecorder. Created 4 years, 9 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: third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
index b5efd8f4c2ab2b5305f4b89571e55755193a9b90..bbf09f9f940d466698cc8ffc6f08737c3e0735ae 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
@@ -335,7 +335,12 @@ void InspectorLayerTreeAgent::makeSnapshot(ErrorString* errorString, const Strin
GraphicsContext context(layer->getPaintController());
context.beginRecording(interestRect);
layer->getPaintController().paintArtifact().replay(context);
- RefPtr<PictureSnapshot> snapshot = adoptRef(new PictureSnapshot(context.endRecording()));
+
+ RefPtr<const SkPicture> recording = context.endRecording();
+ if (!recording)
caseq 2016/04/04 21:38:33 This actually needs to set errorString to somethin
wkorman 2016/04/04 22:20:04 Ah, thanks for catching. I think we are ok because
+ return;
+
+ RefPtr<PictureSnapshot> snapshot = adoptRef(new PictureSnapshot(recording));
*snapshotId = String::number(++s_lastSnapshotId);
bool newEntry = m_snapshotById.add(*snapshotId, snapshot).isNewEntry;

Powered by Google App Engine
This is Rietveld 408576698