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

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

Issue 2494833002: Revert of Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 case MessagePortTag: { 229 case MessagePortTag: {
230 uint32_t index = 0; 230 uint32_t index = 0;
231 if (!readUint32(&index) || !m_transferredMessagePorts || 231 if (!readUint32(&index) || !m_transferredMessagePorts ||
232 index >= m_transferredMessagePorts->size()) 232 index >= m_transferredMessagePorts->size())
233 return nullptr; 233 return nullptr;
234 return (*m_transferredMessagePorts)[index].get(); 234 return (*m_transferredMessagePorts)[index].get();
235 } 235 }
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 nonce = 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) || !readUint64(&nonce))
243 !readUint64(&nonceHigh) || !readUint64(&nonceLow))
244 return nullptr; 243 return nullptr;
245 OffscreenCanvas* canvas = OffscreenCanvas::create(width, height); 244 OffscreenCanvas* canvas = OffscreenCanvas::create(width, height);
246 canvas->setAssociatedCanvasId(canvasId); 245 canvas->setAssociatedCanvasId(canvasId);
247 canvas->setSurfaceId(clientId, sinkId, localId, nonceHigh, nonceLow); 246 canvas->setSurfaceId(clientId, sinkId, localId, nonce);
248 return canvas; 247 return canvas;
249 } 248 }
250 default: 249 default:
251 break; 250 break;
252 } 251 }
253 return nullptr; 252 return nullptr;
254 } 253 }
255 254
256 File* V8ScriptValueDeserializer::readFile() { 255 File* V8ScriptValueDeserializer::readFile() {
257 if (version() < 3) 256 if (version() < 3)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 "Unable to deserialize cloned data."); 332 "Unable to deserialize cloned data.");
334 return v8::MaybeLocal<v8::Object>(); 333 return v8::MaybeLocal<v8::Object>();
335 } 334 }
336 v8::Local<v8::Object> creationContext = m_scriptState->context()->Global(); 335 v8::Local<v8::Object> creationContext = m_scriptState->context()->Global();
337 v8::Local<v8::Value> wrapper = toV8(wrappable, creationContext, isolate); 336 v8::Local<v8::Value> wrapper = toV8(wrappable, creationContext, isolate);
338 DCHECK(wrapper->IsObject()); 337 DCHECK(wrapper->IsObject());
339 return wrapper.As<v8::Object>(); 338 return wrapper.As<v8::Object>();
340 } 339 }
341 340
342 } // namespace blink 341 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698