Changeset 189979 in webkit


Ignore:
Timestamp:
Sep 18, 2015 1:37:41 PM (9 years ago)
Author:
Chris Dumez
Message:

WebContent crash in WebCore::MemoryPressureHandler::releaseCriticalMemory() with GuardMalloc when preparing to suspend
https://bugs.webkit.org/show_bug.cgi?id=149350

Reviewed by Antti Koivisto.

in MemoryPressureHandler::releaseCriticalMemory(), iterate over a copy of
Document::allDocuments() instead of iterating over allDocuments() directly.
Also make sure the Documents are ref'd inside the copy.

This is needed because clearing the StyleResolver of a Document may cause
Documents to be unref'd and removed from the allDocument() HashSet.

No new tests, already covered by existing tests.

  • platform/MemoryPressureHandler.cpp:

(WebCore::MemoryPressureHandler::releaseCriticalMemory):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r189978 r189979  
     12015-09-18  Chris Dumez  <cdumez@apple.com>
     2
     3        WebContent crash in WebCore::MemoryPressureHandler::releaseCriticalMemory() with GuardMalloc when preparing to suspend
     4        https://bugs.webkit.org/show_bug.cgi?id=149350
     5
     6        Reviewed by Antti Koivisto.
     7
     8        in MemoryPressureHandler::releaseCriticalMemory(), iterate over a copy of
     9        Document::allDocuments() instead of iterating over allDocuments() directly.
     10        Also make sure the Documents are ref'd inside the copy.
     11
     12        This is needed because clearing the StyleResolver of a Document may cause
     13        Documents to be unref'd and removed from the allDocument() HashSet.
     14
     15        No new tests, already covered by existing tests.
     16
     17        * platform/MemoryPressureHandler.cpp:
     18        (WebCore::MemoryPressureHandler::releaseCriticalMemory):
     19
    1202015-09-18  Brent Fulgham  <bfulgham@apple.com>
    221
  • trunk/Source/WebCore/platform/MemoryPressureHandler.cpp

    r188619 r189979  
    130130    {
    131131        ReliefLogger log("Discard StyleResolvers");
    132         for (auto* document : Document::allDocuments())
     132        Vector<RefPtr<Document>> documents;
     133        copyToVector(Document::allDocuments(), documents);
     134        for (auto& document : documents)
    133135            document->clearStyleResolver();
    134136    }
Note: See TracChangeset for help on using the changeset viewer.