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

Unified Diff: third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp

Issue 2251493003: Adding nullability support to ImageBitmapRenderingContext.transferImageBitmap (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing final comments. Created 4 years, 4 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/modules/imagebitmap/ImageBitmapRenderingContext.cpp
diff --git a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
index 20b6491e85010f2bf0c79c649415f7e6e0351a80..d81cff3ba8f59b5efce3496fa93ca88b3ff45c3c 100644
--- a/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
+++ b/third_party/WebKit/Source/modules/imagebitmap/ImageBitmapRenderingContext.cpp
@@ -27,6 +27,11 @@ void ImageBitmapRenderingContext::setCanvasGetContextResult(RenderingContext& re
void ImageBitmapRenderingContext::transferFromImageBitmap(ImageBitmap* imageBitmap)
{
+ if (!imageBitmap) {
+ m_image.release();
+ return;
+ }
+
m_image = imageBitmap->bitmapImage();
if (!m_image)
return;

Powered by Google App Engine
This is Rietveld 408576698