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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLFramebuffer.cpp

Issue 2273683003: Use visitDOMWrapper to preserve WebGL JS object wrappers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 { 415 {
416 int index = static_cast<int>(drawBuffer - GL_DRAW_BUFFER0_EXT); 416 int index = static_cast<int>(drawBuffer - GL_DRAW_BUFFER0_EXT);
417 ASSERT(index >= 0); 417 ASSERT(index >= 0);
418 if (index < static_cast<int>(m_drawBuffers.size())) 418 if (index < static_cast<int>(m_drawBuffers.size()))
419 return m_drawBuffers[index]; 419 return m_drawBuffers[index];
420 if (drawBuffer == GL_DRAW_BUFFER0_EXT) 420 if (drawBuffer == GL_DRAW_BUFFER0_EXT)
421 return GL_COLOR_ATTACHMENT0; 421 return GL_COLOR_ATTACHMENT0;
422 return GL_NONE; 422 return GL_NONE;
423 } 423 }
424 424
425 ScopedPersistent<v8::Array>* WebGLFramebuffer::getPersistentCache() 425 void WebGLFramebuffer::visitChildDOMWrappers(v8::Isolate* isolate, const v8::Per sistent<v8::Object>& wrapper)
426 { 426 {
427 return &m_attachmentWrappers; 427 trySetWrapperReferencesInAllWorlds(wrapper, this, isolate);
Ken Russell (switch to Gerrit) 2016/09/01 21:03:53 I'd suggest leaving this responsibility to the cal
Kai Ninomiya 2016/09/02 18:29:22 Done.
428
429 for (const auto& kv : m_attachments) {
430 trySetWrapperReferencesInAllWorlds(wrapper, kv.value->object(), isolate) ;
431 }
428 } 432 }
429 433
430 DEFINE_TRACE(WebGLFramebuffer) 434 DEFINE_TRACE(WebGLFramebuffer)
431 { 435 {
432 visitor->trace(m_attachments); 436 visitor->trace(m_attachments);
433 WebGLContextObject::trace(visitor); 437 WebGLContextObject::trace(visitor);
434 } 438 }
435 439
436 } // namespace blink 440 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698