[webkit-changes] [WebKit/WebKit] 50b0cd: REGRESSION(268154 at main): [ macOS ] TestWebKitAPI.W...

Chris Dumez noreply at github.com
Tue Sep 26 18:58:28 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 50b0cd282f38a8dbfdc330d43c4b4de536b56715
      https://github.com/WebKit/WebKit/commit/50b0cd282f38a8dbfdc330d43c4b4de536b56715
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-09-26 (Tue, 26 Sep 2023)

  Changed paths:
    M Source/WTF/wtf/ListHashSet.h
    M Source/WTF/wtf/WeakListHashSet.h
    M Source/WebKit/UIProcess/WebProcessProxy.cpp
    M Tools/TestWebKitAPI/Tests/WTF/ListHashSet.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/WebContentProcessDidTerminate.mm

  Log Message:
  -----------
  REGRESSION(268154 at main): [ macOS ] TestWebKitAPI.WKNavigation.WebProcessLimit is a constant failure
https://bugs.webkit.org/show_bug.cgi?id=262134
rdar://116069794

Reviewed by Ryosuke Niwa.

In 268154 at main, I updated WebProcessProxy::markProcessAsRecentlyUsed() to call:
```
liveProcessesLRU().appendOrMoveToLast(*this);
```

instead of
```
if (liveProcessesLRU().contains(this))
    liveProcessesLRU().appendOrMoveToLast(this);
```

I was trying to avoid a double HashMap lookup and mistakenly thought that the
process was always in liveProcessesLRU(). However, it turns out that dummy
WebProcessProxy objects (which don't have a backing process) are not part of
liveProcessesLRU() and were now getting inserted, causing the API test to fail.

To address the issue while avoiding the double HashMap lookup, I am introducing
a ListHashSet::moveToLastIfPresent() operation. I now use this in
markProcessAsRecentlyUsed().

* Source/WTF/wtf/ListHashSet.h:
(WTF::U>::moveToLastIfPresent):
* Source/WTF/wtf/WeakListHashSet.h:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::markProcessAsRecentlyUsed):
* Tools/TestWebKitAPI/Tests/WTF/ListHashSet.cpp:
(TestWebKitAPI::TEST):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/WebContentProcessDidTerminate.mm:
(TEST):

Canonical link: https://commits.webkit.org/268492@main




More information about the webkit-changes mailing list