[webkit-changes] [WebKit/WebKit] c047b9: AX: Improve smart pointer hygiene in AXObjectCache...

Matthieu Dubet noreply at github.com
Wed Oct 25 11:26:07 PDT 2023


  Branch: refs/heads/safari-7615-branch
  Home:   https://github.com/WebKit/WebKit
  Commit: c047b91f5ccbf117f84571a8cede6e73a4cd50df
      https://github.com/WebKit/WebKit/commit/c047b91f5ccbf117f84571a8cede6e73a4cd50df
  Author: Tyler Wilcock <tyler_w at apple.com>
  Date:   2023-06-29 (Thu, 29 Jun 2023)

  Changed paths:
    M Source/WebCore/accessibility/AXLogger.cpp
    M Source/WebCore/accessibility/AXObjectCache.cpp
    M Source/WebCore/accessibility/AXObjectCache.h
    M Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp

  Log Message:
  -----------
  AX: Improve smart pointer hygiene in AXObjectCache and AXIsolatedObject::updateBackingStore
rdar://111341681

Reviewed by Chris Fleizach.

Per https://github.com/WebKit/WebKit/wiki/Smart-Pointer-Usage-Guidelines, continue refactoring
to replace raw pointer usage with smart pointers where appropriate.

* Source/WebCore/accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::remove):
(WebCore::AXObjectCache::deferNodeAddedOrRemoved):
(WebCore::AXObjectCache::prepareForDocumentDestruction):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* Source/WebCore/accessibility/AXObjectCache.h:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp:

Canonical link: https://commits.webkit.org/259548.864@safari-7615-branch


  Commit: cb256ae0cae91f997c7c4f4f5a3794060a701af9
      https://github.com/WebKit/WebKit/commit/cb256ae0cae91f997c7c4f4f5a3794060a701af9
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-06-30 (Fri, 30 Jun 2023)

  Changed paths:
    M Source/WebKit/Shared/WebBackForwardListItem.h
    M Source/WebKit/UIProcess/WebBackForwardCache.cpp
    M Source/WebKit/UIProcess/WebBackForwardCache.h

  Log Message:
  -----------
  Crash under WebKit::WebBackForwardCache::removeEntry()
https://bugs.webkit.org/show_bug.cgi?id=258698
rdar://111524465

Reviewed by Ryosuke Niwa.

In WebBackForwardCache::removeEntry(), the call to `item.setBackForwardCacheEntry(nullptr)`
may cause the `item` to get destroyed. However, we were using `item` on the next line for
logging purpose. To fix the bug, I am moving the logging before the setBackForwardCacheEntry()
call.

for hardening purposes, I am also updating m_itemsWithCachedPage to contain WeakPtrs instead
of raw pointers.

* Source/WebKit/Shared/WebBackForwardListItem.h:
* Source/WebKit/UIProcess/WebBackForwardCache.cpp:
(WebKit::WebBackForwardCache::removeEntry):
(WebKit::WebBackForwardCache::removeEntriesMatching):
(WebKit::WebBackForwardCache::clear):
* Source/WebKit/UIProcess/WebBackForwardCache.h:

Canonical link: https://commits.webkit.org/259548.865@safari-7615-branch


  Commit: a530db24b43e57af8ea04efdc1b1c29be827691e
      https://github.com/WebKit/WebKit/commit/a530db24b43e57af8ea04efdc1b1c29be827691e
  Author: Dan Robson <dan_robson at apple.com>
  Date:   2023-07-06 (Thu, 06 Jul 2023)

  Changed paths:
    M Source/WebCore/editing/Editor.cpp
    M Source/WebCore/loader/EmptyClients.cpp
    M Source/WebCore/page/EditorClient.h
    M Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebEditorClient.h
    M Source/WebKit/WebProcess/WebPage/WebPage.cpp
    M Source/WebKit/WebProcess/WebPage/WebPage.h
    M Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.h
    M Source/WebKitLegacy/mac/WebCoreSupport/WebEditorClient.mm
    M Tools/TestWebKitAPI/Tests/ios/KeyboardInputTestsIOS.mm

  Log Message:
  -----------
  Apply patch. rdar://problem/111258989

Identifier: 259548.866 at safari-7615-branch


  Commit: 00e4693e9f619fe20d2693a2664a09d0b584781a
      https://github.com/WebKit/WebKit/commit/00e4693e9f619fe20d2693a2664a09d0b584781a
  Author: Matthieu Dubet <m_dubet at apple.com>
  Date:   2023-07-10 (Mon, 10 Jul 2023)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/js/001-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/js/001.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/conditional-rules-expected.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/conditional-rules-ref.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/conditional-rules.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/cssom-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/delete-other-rule-crash.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/implicit-nesting-expected.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/implicit-nesting-ref.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/implicit-nesting.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/invalid-inner-rules.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nesting-basic-expected.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nesting-basic-ref.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nesting-basic.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing-expected.txt
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/serialize-group-rules-with-decls.tentative.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/supports-rule.html
    A LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/top-level-is-scope.html
    M LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/w3c-import.log
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/mac/TestExpectations

  Log Message:
  -----------
  [WPT] Rebase css-nesting tests from main branch
rdar://108628398

Reviewed by Jonathan Bedard.

* LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/js/001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-conditional/js/001.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/conditional-rules-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/conditional-rules-ref.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/conditional-rules.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/cssom-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/delete-other-rule-crash.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/implicit-nesting-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/implicit-nesting-ref.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/implicit-nesting.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/invalid-inner-rules.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nesting-basic-expected.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nesting-basic-ref.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/nesting-basic.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/parsing-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/serialize-group-rules-with-decls.tentative.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/supports-rule.html:
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/top-level-is-scope.html: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/css-nesting/w3c-import.log:
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/mac/TestExpectations:

Canonical link: https://commits.webkit.org/259548.867@safari-7615-branch


Compare: https://github.com/WebKit/WebKit/compare/08761da690e5...00e4693e9f61


More information about the webkit-changes mailing list