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

Changeset 287629 in webkit


Ignore:
Timestamp:
Jan 5, 2022, 10:21:12 AM (5 years ago)
Author:
Russell Epstein
Message:

Cherry-pick r287048. rdar://problem/87125012

Adhere to DisplayList iterator's API contract in MemoryDisplayList::~InMemoryDisplayList()
​https://bugs.webkit.org/show_bug.cgi?id=234264

Patch by Gabriel Nava Marino <​gnavamarino@apple.com> on 2021-12-14
Reviewed by Myles C. Maxfield.

The client is not adhearing to the DisplayList Iterator's API contract in MemoryDisplayList::~InMemoryDisplayList():
"Part of the iterator's API contract is that if the item is nullopt, you're not allowed to keep
iterating - doing this will lead to an infinite loop."

Here we now do so by breaking out of iteration if the item is nullopt.

  • platform/graphics/displaylists/InMemoryDisplayList.cpp: (WebCore::DisplayList::InMemoryDisplayList::~InMemoryDisplayList):

git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@287048 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-612-branch/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-612-branch/Source/WebCore/ChangeLog

    r287627 r287629  
     12022-01-05  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r287048. rdar://problem/87125012
     4
     5    Adhere to DisplayList iterator's API contract in MemoryDisplayList::~InMemoryDisplayList()
     6    https://bugs.webkit.org/show_bug.cgi?id=234264
     7   
     8    Patch by Gabriel Nava Marino <gnavamarino@apple.com> on 2021-12-14
     9    Reviewed by Myles C. Maxfield.
     10   
     11    The client is not adhearing to the DisplayList Iterator's API contract in MemoryDisplayList::~InMemoryDisplayList():
     12    "Part of the iterator's API contract is that if the item is nullopt, you're not allowed to keep
     13    iterating - doing this will lead to an infinite loop."
     14   
     15    Here we now do so by breaking out of iteration if the item is nullopt.
     16   
     17    * platform/graphics/displaylists/InMemoryDisplayList.cpp:
     18    (WebCore::DisplayList::InMemoryDisplayList::~InMemoryDisplayList):
     19   
     20    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@287048 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     21
     22    2021-12-14  Gabriel Nava Marino  <gnavamarino@apple.com>
     23
     24            Adhere to DisplayList iterator's API contract in MemoryDisplayList::~InMemoryDisplayList()
     25            https://bugs.webkit.org/show_bug.cgi?id=234264
     26
     27            Reviewed by Myles C. Maxfield.
     28
     29            The client is not adhearing to the DisplayList Iterator's API contract in MemoryDisplayList::~InMemoryDisplayList():
     30            "Part of the iterator's API contract is that if the item is nullopt, you're not allowed to keep
     31            iterating - doing this will lead to an infinite loop."
     32
     33            Here we now do so by breaking out of iteration if the item is nullopt.
     34
     35            * platform/graphics/displaylists/InMemoryDisplayList.cpp:
     36            (WebCore::DisplayList::InMemoryDisplayList::~InMemoryDisplayList):
     37
    1382022-01-05  Russell Epstein  <repstein@apple.com>
    239
  • branches/safari-612-branch/Source/WebCore/platform/graphics/displaylists/InMemoryDisplayList.cpp

    r278253 r287629  
    6464    auto end = this->end();
    6565    for (auto displayListItem : *this) {
     66        if (!displayListItem)
     67            break;
    6668        auto item = displayListItem->item;
    6769        ASSERT(item);
Note: See TracChangeset for help on using the changeset viewer.