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

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

Issue 2143033005: Transfer components of SurfaceId in OffscreenCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 895dab34faf786d1d7c4ce58979d9bc398bbe805..7cf58c174eff2e4cb1bcb79cc2b53ae22dbfb19c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptValueSerializer.cpp
@@ -361,13 +361,16 @@ void SerializedScriptValueWriter::writeTransferredImageBitmap(uint32_t index)
doWriteUint32(index);
}
-void SerializedScriptValueWriter::writeTransferredOffscreenCanvas(uint32_t index, uint32_t width, uint32_t height, uint32_t id)
+void SerializedScriptValueWriter::writeTransferredOffscreenCanvas(uint32_t index, uint32_t width, uint32_t height, uint32_t id, uint32_t clientId, uint32_t localId, uint64_t nonce)
{
append(OffscreenCanvasTransferTag);
doWriteUint32(index);
doWriteUint32(width);
doWriteUint32(height);
doWriteUint32(id);
+ doWriteUint32(clientId);
+ doWriteUint32(localId);
+ doWriteUint32(nonce);
xidachen 2016/07/14 20:19:55 Here you need doWriteUint64 instead of 32.
xlai (Olivia) 2016/07/14 23:39:18 Done.
}
void SerializedScriptValueWriter::writeTransferredSharedArrayBuffer(uint32_t index)
@@ -1176,7 +1179,7 @@ ScriptValueSerializer::StateBase* ScriptValueSerializer::writeTransferredOffscre
return handleError(Status::DataCloneError, "An OffscreenCanvas is detached and could not be cloned.", next);
if (offscreenCanvas->renderingContext())
return handleError(Status::DataCloneError, "An OffscreenCanvas with a context could not be cloned.", next);
- m_writer.writeTransferredOffscreenCanvas(index, offscreenCanvas->width(), offscreenCanvas->height(), offscreenCanvas->getAssociatedCanvasId());
+ m_writer.writeTransferredOffscreenCanvas(index, offscreenCanvas->width(), offscreenCanvas->height(), offscreenCanvas->getAssociatedCanvasId(), offscreenCanvas->clientId(), offscreenCanvas->localId(), offscreenCanvas->nonce());
return nullptr;
}
@@ -1531,7 +1534,7 @@ bool SerializedScriptValueReader::readWithTag(SerializationTag tag, v8::Local<v8
case OffscreenCanvasTransferTag: {
if (!m_version)
return false;
- uint32_t index, width, height, id;
+ uint32_t index, width, height, id, clientId, localId, nonce;
if (!doReadUint32(&index))
return false;
if (!doReadUint32(&width))
@@ -1540,7 +1543,13 @@ bool SerializedScriptValueReader::readWithTag(SerializationTag tag, v8::Local<v8
return false;
if (!doReadUint32(&id))
return false;
- if (!deserializer.tryGetTransferredOffscreenCanvas(index, width, height, id, value))
+ if (!doReadUint32(&clientId))
+ return false;
+ if (!doReadUint32(&localId))
+ return false;
+ if (!doReadUint32(&nonce))
xidachen 2016/07/14 20:19:55 doReadUint64 instead of 32 because nounce is uint_
xlai (Olivia) 2016/07/14 23:39:18 Done.
+ return false;
+ if (!deserializer.tryGetTransferredOffscreenCanvas(index, width, height, id, clientId, localId, nonce, value))
return false;
break;
}
@@ -2332,10 +2341,11 @@ bool ScriptValueDeserializer::tryGetTransferredSharedArrayBuffer(uint32_t index,
return true;
}
-bool ScriptValueDeserializer::tryGetTransferredOffscreenCanvas(uint32_t index, uint32_t width, uint32_t height, uint32_t id, v8::Local<v8::Value>* object)
+bool ScriptValueDeserializer::tryGetTransferredOffscreenCanvas(uint32_t index, uint32_t width, uint32_t height, uint32_t id, uint32_t clientId, uint32_t localId, uint64_t nonce, v8::Local<v8::Value>* object)
{
OffscreenCanvas* offscreenCanvas = OffscreenCanvas::create(width, height);
offscreenCanvas->setAssociatedCanvasId(id);
+ offscreenCanvas->setSurfaceId(clientId, localId, nonce);
*object = toV8(offscreenCanvas, m_reader.getScriptState());
if ((*object).IsEmpty())
return false;

Powered by Google App Engine
This is Rietveld 408576698