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

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

Issue 2361253002: Support OffscreenCanvas transfer with V8-based structured clone. (Closed)
Patch Set: Merge branch 'master' into vs-offscreen-canvas Created 4 years, 3 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp
index 29ab92b1a292867027d19017d55ee5c33b329f90..604785f47e789e08afbcd552e2eb491a3fe4ab09 100644
--- a/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueDeserializer.cpp
@@ -10,6 +10,7 @@
#include "core/dom/MessagePort.h"
#include "core/frame/ImageBitmap.h"
#include "core/html/ImageData.h"
+#include "core/offscreencanvas/OffscreenCanvas.h"
#include "platform/RuntimeEnabledFeatures.h"
#include "wtf/CheckedNumeric.h"
@@ -149,6 +150,21 @@ ScriptWrappable* V8ScriptValueDeserializer::readDOMObject(SerializationTag tag)
return nullptr;
return (*m_transferredMessagePorts)[index].get();
}
+ case OffscreenCanvasTransferTag: {
+ uint32_t width = 0, height = 0, canvasId = 0, clientId = 0, localId = 0;
+ uint64_t nonce = 0;
+ if (!readUint32(&width)
+ || !readUint32(&height)
+ || !readUint32(&canvasId)
+ || !readUint32(&clientId)
+ || !readUint32(&localId)
+ || !readUint64(&nonce))
+ return nullptr;
+ OffscreenCanvas* canvas = OffscreenCanvas::create(width, height);
+ canvas->setAssociatedCanvasId(canvasId);
+ canvas->setSurfaceId(clientId, localId, nonce);
+ return canvas;
+ }
default:
break;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/serialization/V8ScriptValueSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698