⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181537 in webkit


Ignore:
Timestamp:
Mar 16, 2015, 3:41:58 AM (11 years ago)
Author:
Carlos Garcia Campos
Message:

Users of Heap::deprecatedReportExtraMemory should switch to reportExtraMemoryAllocated+reportExtraMemoryVisited
https://bugs.webkit.org/show_bug.cgi?id=142595

Reviewed by Andreas Kling.

Fixed this bug for canvas.

  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::memoryCost): Factored out the helper function
required by our IDL generator.

(WebCore::HTMLCanvasElement::createImageBuffer): Use
reportExtraMemoryAllocated.

  • html/HTMLCanvasElement.h:
  • html/HTMLCanvasElement.idl: Adopt the IDL for reporting cost in the

right way during GC. This will match our reportExtraMemoryAllocated
with a reportExtraMemoryVisited during GC.

Location:
releases/WebKitGTK/webkit-2.8/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/ChangeLog

    r181536 r181537  
     12015-03-11  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Users of Heap::deprecatedReportExtraMemory should switch to reportExtraMemoryAllocated+reportExtraMemoryVisited
     4        https://bugs.webkit.org/show_bug.cgi?id=142595
     5
     6        Reviewed by Andreas Kling.
     7
     8        Fixed this bug for canvas.
     9
     10        * html/HTMLCanvasElement.cpp:
     11        (WebCore::HTMLCanvasElement::memoryCost): Factored out the helper function
     12        required by our IDL generator.
     13
     14        (WebCore::HTMLCanvasElement::createImageBuffer): Use
     15        reportExtraMemoryAllocated.
     16
     17        * html/HTMLCanvasElement.h:
     18
     19        * html/HTMLCanvasElement.idl: Adopt the IDL for reporting cost in the
     20        right way during GC. This will match our reportExtraMemoryAllocated
     21        with a reportExtraMemoryVisited during GC.
     22
    1232015-03-11  Commit Queue  <commit-queue@webkit.org>
    224
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLCanvasElement.cpp

    r181534 r181537  
    543543}
    544544
     545size_t HTMLCanvasElement::memoryCost() const
     546{
     547    if (!m_imageBuffer)
     548        return 0;
     549    return 4 * m_imageBuffer->internalSize().width() * m_imageBuffer->internalSize().height();
     550}
     551
    545552void HTMLCanvasElement::createImageBuffer() const
    546553{
     
    580587
    581588    JSC::JSLockHolder lock(scriptExecutionContext()->vm());
    582     size_t numBytes = 4 * m_imageBuffer->internalSize().width() * m_imageBuffer->internalSize().height();
    583     // FIXME: Adopt reportExtraMemoryVisited, and switch to reportExtraMemoryAllocated.
    584     // https://bugs.webkit.org/show_bug.cgi?id=142595
    585     scriptExecutionContext()->vm().heap.deprecatedReportExtraMemory(numBytes);
     589    scriptExecutionContext()->vm().heap.reportExtraMemoryAllocated(memoryCost());
    586590
    587591#if USE(IOSURFACE_CANVAS_BACKING_STORE) || ENABLE(ACCELERATED_2D_CANVAS)
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLCanvasElement.h

    r177996 r181537  
    136136    bool shouldAccelerate(const IntSize&) const;
    137137
     138    size_t memoryCost() const;
     139
    138140private:
    139141    HTMLCanvasElement(const QualifiedName&, Document&);
  • releases/WebKitGTK/webkit-2.8/Source/WebCore/html/HTMLCanvasElement.idl

    r165676 r181537  
    2727[
    2828    JSGenerateToNativeObject,
     29    ReportExtraMemoryCost
    2930] interface HTMLCanvasElement : HTMLElement {
    3031
Note: See TracChangeset for help on using the changeset viewer.