OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "bindings/core/v8/serialization/V8ScriptValueDeserializer.h" | 5 #include "bindings/core/v8/serialization/V8ScriptValueDeserializer.h" |
6 | 6 |
7 #include "bindings/core/v8/ToV8.h" | 7 #include "bindings/core/v8/ToV8.h" |
8 #include "core/dom/CompositorProxy.h" | 8 #include "core/dom/CompositorProxy.h" |
9 #include "core/dom/DOMArrayBuffer.h" | 9 #include "core/dom/DOMArrayBuffer.h" |
10 #include "core/dom/DOMSharedArrayBuffer.h" | 10 #include "core/dom/DOMSharedArrayBuffer.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 case OffscreenCanvasTransferTag: { | 236 case OffscreenCanvasTransferTag: { |
237 uint32_t width = 0, height = 0, canvasId = 0, clientId = 0, sinkId = 0, | 237 uint32_t width = 0, height = 0, canvasId = 0, clientId = 0, sinkId = 0, |
238 localId = 0; | 238 localId = 0; |
239 uint64_t nonceHigh = 0, nonceLow = 0; | 239 uint64_t nonceHigh = 0, nonceLow = 0; |
240 if (!readUint32(&width) || !readUint32(&height) || | 240 if (!readUint32(&width) || !readUint32(&height) || |
241 !readUint32(&canvasId) || !readUint32(&clientId) || | 241 !readUint32(&canvasId) || !readUint32(&clientId) || |
242 !readUint32(&sinkId) || !readUint32(&localId) || | 242 !readUint32(&sinkId) || !readUint32(&localId) || |
243 !readUint64(&nonceHigh) || !readUint64(&nonceLow)) | 243 !readUint64(&nonceHigh) || !readUint64(&nonceLow)) |
244 return nullptr; | 244 return nullptr; |
245 OffscreenCanvas* canvas = OffscreenCanvas::create(width, height); | 245 OffscreenCanvas* canvas = OffscreenCanvas::create(width, height); |
246 canvas->setAssociatedCanvasId(canvasId); | 246 canvas->setPlaceholderCanvasId(canvasId); |
247 canvas->setSurfaceId(clientId, sinkId, localId, nonceHigh, nonceLow); | 247 canvas->setSurfaceId(clientId, sinkId, localId, nonceHigh, nonceLow); |
248 return canvas; | 248 return canvas; |
249 } | 249 } |
250 default: | 250 default: |
251 break; | 251 break; |
252 } | 252 } |
253 return nullptr; | 253 return nullptr; |
254 } | 254 } |
255 | 255 |
256 File* V8ScriptValueDeserializer::readFile() { | 256 File* V8ScriptValueDeserializer::readFile() { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 "Unable to deserialize cloned data."); | 333 "Unable to deserialize cloned data."); |
334 return v8::MaybeLocal<v8::Object>(); | 334 return v8::MaybeLocal<v8::Object>(); |
335 } | 335 } |
336 v8::Local<v8::Object> creationContext = m_scriptState->context()->Global(); | 336 v8::Local<v8::Object> creationContext = m_scriptState->context()->Global(); |
337 v8::Local<v8::Value> wrapper = toV8(wrappable, creationContext, isolate); | 337 v8::Local<v8::Value> wrapper = toV8(wrappable, creationContext, isolate); |
338 DCHECK(wrapper->IsObject()); | 338 DCHECK(wrapper->IsObject()); |
339 return wrapper.As<v8::Object>(); | 339 return wrapper.As<v8::Object>(); |
340 } | 340 } |
341 | 341 |
342 } // namespace blink | 342 } // namespace blink |
OLD | NEW |