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

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

Issue 2379653006: Replaced cc::SurfaceId::nonce_ with base::UnguessableToken (Closed)
Patch Set: Changed SurfaceManager::kRootSurfaceId to a private field to avoid static initialization 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 nonce = 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) || !readUint64(&nonce)) 242 !readUint32(&sinkId) || !readUint32(&localId) ||
243 !readUint64(&nonceHigh) || !readUint64(&nonceLow))
243 return nullptr; 244 return nullptr;
244 OffscreenCanvas* canvas = OffscreenCanvas::create(width, height); 245 OffscreenCanvas* canvas = OffscreenCanvas::create(width, height);
245 canvas->setAssociatedCanvasId(canvasId); 246 canvas->setAssociatedCanvasId(canvasId);
246 canvas->setSurfaceId(clientId, sinkId, localId, nonce); 247 canvas->setSurfaceId(clientId, sinkId, localId, nonceHigh, nonceLow);
247 return canvas; 248 return canvas;
248 } 249 }
249 default: 250 default:
250 break; 251 break;
251 } 252 }
252 return nullptr; 253 return nullptr;
253 } 254 }
254 255
255 File* V8ScriptValueDeserializer::readFile() { 256 File* V8ScriptValueDeserializer::readFile() {
256 if (version() < 3) 257 if (version() < 3)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 "Unable to deserialize cloned data."); 333 "Unable to deserialize cloned data.");
333 return v8::MaybeLocal<v8::Object>(); 334 return v8::MaybeLocal<v8::Object>();
334 } 335 }
335 v8::Local<v8::Object> creationContext = m_scriptState->context()->Global(); 336 v8::Local<v8::Object> creationContext = m_scriptState->context()->Global();
336 v8::Local<v8::Value> wrapper = toV8(wrappable, creationContext, isolate); 337 v8::Local<v8::Value> wrapper = toV8(wrappable, creationContext, isolate);
337 DCHECK(wrapper->IsObject()); 338 DCHECK(wrapper->IsObject());
338 return wrapper.As<v8::Object>(); 339 return wrapper.As<v8::Object>();
339 } 340 }
340 341
341 } // namespace blink 342 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698