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

Side by Side Diff: Source/core/html/HTMLCanvasElement.cpp

Issue 303803002: Prevent <canvas> destructor from causing nested garbage collection (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2006, 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Alp Toker <alp@atoker.com> 3 * Copyright (C) 2007 Alp Toker <alp@atoker.com>
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 m_externallyAllocatedMemory = externallyAllocatedMemory; 560 m_externallyAllocatedMemory = externallyAllocatedMemory;
561 } 561 }
562 562
563 GraphicsContext* HTMLCanvasElement::drawingContext() const 563 GraphicsContext* HTMLCanvasElement::drawingContext() const
564 { 564 {
565 return buffer() ? m_imageBuffer->context() : 0; 565 return buffer() ? m_imageBuffer->context() : 0;
566 } 566 }
567 567
568 GraphicsContext* HTMLCanvasElement::existingDrawingContext() const 568 GraphicsContext* HTMLCanvasElement::existingDrawingContext() const
569 { 569 {
570 if (m_didFailToCreateImageBuffer) { 570 if (!hasImageBuffer())
571 ASSERT(!hasImageBuffer());
572 return 0; 571 return 0;
573 }
574 572
575 return drawingContext(); 573 return drawingContext();
576 } 574 }
577 575
578 ImageBuffer* HTMLCanvasElement::buffer() const 576 ImageBuffer* HTMLCanvasElement::buffer() const
579 { 577 {
580 if (!hasImageBuffer() && !m_didFailToCreateImageBuffer) 578 if (!hasImageBuffer() && !m_didFailToCreateImageBuffer)
581 const_cast<HTMLCanvasElement*>(this)->createImageBuffer(); 579 const_cast<HTMLCanvasElement*>(this)->createImageBuffer();
582 return m_imageBuffer.get(); 580 return m_imageBuffer.get();
583 } 581 }
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 { 693 {
696 return !originClean(); 694 return !originClean();
697 } 695 }
698 696
699 FloatSize HTMLCanvasElement::sourceSize() const 697 FloatSize HTMLCanvasElement::sourceSize() const
700 { 698 {
701 return FloatSize(width(), height()); 699 return FloatSize(width(), height());
702 } 700 }
703 701
704 } 702 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698