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

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

Issue 1928043002: Add drawImage() originClean() getSecurityOrigin() to OffscreenCanvas (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ScriptValueSerializer.h" 5 #include "bindings/core/v8/ScriptValueSerializer.h"
6 6
7 #include "bindings/core/v8/Transferables.h" 7 #include "bindings/core/v8/Transferables.h"
8 #include "bindings/core/v8/V8ArrayBuffer.h" 8 #include "bindings/core/v8/V8ArrayBuffer.h"
9 #include "bindings/core/v8/V8ArrayBufferView.h" 9 #include "bindings/core/v8/V8ArrayBufferView.h"
10 #include "bindings/core/v8/V8Blob.h" 10 #include "bindings/core/v8/V8Blob.h"
(...skipping 2262 matching lines...) Expand 10 before | Expand all | Expand 10 after
2273 if (result.IsEmpty()) 2273 if (result.IsEmpty())
2274 return false; 2274 return false;
2275 m_arrayBuffers[index] = result; 2275 m_arrayBuffers[index] = result;
2276 } 2276 }
2277 *object = result; 2277 *object = result;
2278 return true; 2278 return true;
2279 } 2279 }
2280 2280
2281 bool ScriptValueDeserializer::tryGetTransferredOffscreenCanvas(uint32_t index, u int32_t width, uint32_t height, uint32_t id, v8::Local<v8::Value>* object) 2281 bool ScriptValueDeserializer::tryGetTransferredOffscreenCanvas(uint32_t index, u int32_t width, uint32_t height, uint32_t id, v8::Local<v8::Value>* object)
2282 { 2282 {
2283 OffscreenCanvas* offscreenCanvas = OffscreenCanvas::create(width, height); 2283 ExecutionContext* executionContext = ScriptState::current(v8::Isolate::GetCu rrent())->getExecutionContext();
haraken 2016/04/28 17:40:41 Use m_reader.scriptState() instead. (Please don't
xlai (Olivia) 2016/04/28 18:38:16 Oops I thought ScriptState::current() can be used
2284 OffscreenCanvas* offscreenCanvas = OffscreenCanvas::create(executionContext, width, height);
2284 offscreenCanvas->setAssociatedCanvasId(id); 2285 offscreenCanvas->setAssociatedCanvasId(id);
2285 *object = toV8(offscreenCanvas, m_reader.getScriptState()); 2286 *object = toV8(offscreenCanvas, m_reader.getScriptState());
2286 if ((*object).IsEmpty()) 2287 if ((*object).IsEmpty())
2287 return false; 2288 return false;
2288 return true; 2289 return true;
2289 } 2290 }
2290 2291
2291 bool ScriptValueDeserializer::tryGetObjectFromObjectReference(uint32_t reference , v8::Local<v8::Value>* object) 2292 bool ScriptValueDeserializer::tryGetObjectFromObjectReference(uint32_t reference , v8::Local<v8::Value>* object)
2292 { 2293 {
2293 if (reference >= m_objectPool.size()) 2294 if (reference >= m_objectPool.size())
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
2359 return false; 2360 return false;
2360 uint32_t objectReference = m_openCompositeReferenceStack[m_openCompositeRefe renceStack.size() - 1]; 2361 uint32_t objectReference = m_openCompositeReferenceStack[m_openCompositeRefe renceStack.size() - 1];
2361 m_openCompositeReferenceStack.shrink(m_openCompositeReferenceStack.size() - 1); 2362 m_openCompositeReferenceStack.shrink(m_openCompositeReferenceStack.size() - 1);
2362 if (objectReference >= m_objectPool.size()) 2363 if (objectReference >= m_objectPool.size())
2363 return false; 2364 return false;
2364 *object = m_objectPool[objectReference]; 2365 *object = m_objectPool[objectReference];
2365 return true; 2366 return true;
2366 } 2367 }
2367 2368
2368 } // namespace blink 2369 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/offscreencanvas/OffscreenCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698