Changeset 138211 in webkit


Ignore:
Timestamp:
Dec 19, 2012 5:43:15 PM (11 years ago)
Author:
kerz@chromium.org
Message:

Merge 138174

REGRESSION(r137607): PluginDocument loads consume huge amounts of memory
https://bugs.webkit.org/show_bug.cgi?id=105359

Reviewed by Alexey Proskuryakov.

No new tests, verified manually that http://www.scb.se/statistik/_publikationer/NR0001_2012K02_TI_A28TI1203.pdf
no longer consumes several GB of memory.

  • loader/ResourceLoader.cpp:

(WebCore::ResourceLoader::setShouldBufferData): shouldBufferData is an enum, not a boolean, so this is reversed.

  • loader/cache/CachedRawResource.cpp:

(WebCore::CachedRawResource::data): If the dataReceived() callback tells us to stop buffering data, be sure to

notify the ResourceLoader and clear the data buffer.

TBR=Nate Chapin
Review URL: https://codereview.chromium.org/11571073

Location:
branches/chromium/1364/Source/WebCore/loader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/chromium/1364/Source/WebCore/loader/ResourceLoader.cpp

    r137631 r138211  
    195195
    196196    // Reset any already buffered data
    197     if (!shouldBufferData)
     197    if (shouldBufferData == DoNotBufferData)
    198198        m_resourceData = 0;
    199199}
  • branches/chromium/1364/Source/WebCore/loader/cache/CachedRawResource.cpp

    r137607 r138211  
    5757        incrementalDataLength = data->size() - previousDataLength;
    5858    }
    59    
     59
    6060    if (m_options.shouldBufferData == BufferData) {
    6161        if (data)
     
    6363        m_data = data;
    6464    }
    65    
     65
     66    DataBufferingPolicy dataBufferingPolicy = m_options.shouldBufferData;
    6667    if (incrementalDataLength) {
    6768        CachedResourceClientWalker<CachedRawResourceClient> w(m_clients);
     
    7071    }
    7172    CachedResource::data(m_data, allDataReceived);
     73
     74    if (dataBufferingPolicy == BufferData && m_options.shouldBufferData == DoNotBufferData) {
     75        if (m_loader)
     76            m_loader->setShouldBufferData(DoNotBufferData);
     77        clear();
     78    }
    7279}
    7380
Note: See TracChangeset for help on using the changeset viewer.