Index: third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp |
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp |
index 78686ddbeb7e681f45b353460e4bddddadec50e0..f143d25720079fb6e9fbe46b92f409591d3cfd6e 100644 |
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp |
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp |
@@ -312,9 +312,10 @@ void SerializedScriptValueWriter::writeImageData(uint32_t width, uint32_t height |
doWriteImageData(width, height, pixelData, pixelDataLength); |
} |
-void SerializedScriptValueWriter::writeImageBitmap(uint32_t width, uint32_t height, const uint8_t* pixelData, uint32_t pixelDataLength) |
+void SerializedScriptValueWriter::writeImageBitmap(uint32_t width, uint32_t height, uint32_t isOriginClean, const uint8_t* pixelData, uint32_t pixelDataLength) |
{ |
append(ImageBitmapTag); |
+ append(isOriginClean); |
doWriteImageData(width, height, pixelData, pixelDataLength); |
} |
@@ -1145,7 +1146,7 @@ ScriptValueSerializer::StateBase* ScriptValueSerializer::writeAndGreyImageBitmap |
} else { |
greyObject(object); |
std::unique_ptr<uint8_t[]> pixelData = imageBitmap->copyBitmapData(PremultiplyAlpha); |
- m_writer.writeImageBitmap(imageBitmap->width(), imageBitmap->height(), pixelData.get(), imageBitmap->width() * imageBitmap->height() * 4); |
+ m_writer.writeImageBitmap(imageBitmap->width(), imageBitmap->height(), static_cast<uint32_t>(imageBitmap->originClean()), pixelData.get(), imageBitmap->width() * imageBitmap->height() * 4); |
} |
return nullptr; |
} |
@@ -1781,12 +1782,15 @@ bool SerializedScriptValueReader::readImageData(v8::Local<v8::Value>* value) |
bool SerializedScriptValueReader::readImageBitmap(v8::Local<v8::Value>* value) |
{ |
+ uint32_t isOriginClean; |
+ if (!doReadUint32(&isOriginClean)) |
+ return false; |
ImageData* imageData = doReadImageData(); |
if (!imageData) |
return false; |
ImageBitmapOptions options; |
options.setPremultiplyAlpha("none"); |
- ImageBitmap* imageBitmap = ImageBitmap::create(imageData, IntRect(0, 0, imageData->width(), imageData->height()), options, true); |
+ ImageBitmap* imageBitmap = ImageBitmap::create(imageData, IntRect(0, 0, imageData->width(), imageData->height()), options, true, isOriginClean); |
if (!imageBitmap) |
return false; |
*value = toV8(imageBitmap, m_scriptState->context()->Global(), isolate()); |