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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp

Issue 2097393002: Pass origin clean flag of ImageBitmap when structure clone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: 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());
« no previous file with comments | « third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.h ('k') | third_party/WebKit/Source/core/frame/ImageBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698