[webkit-changes] [WebKit/WebKit] bee110: Refactor the "All CoreIPC types" variant to work f...

Brady Eidson noreply at github.com
Mon Nov 20 08:26:21 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bee110f477b92fc7cded601ae4c995908b1e47d6
      https://github.com/WebKit/WebKit/commit/bee110f477b92fc7cded601ae4c995908b1e47d6
  Author: Brady Eidson <beidson at apple.com>
  Date:   2023-11-20 (Mon, 20 Nov 2023)

  Changed paths:
    M Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCArray.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCDDScannerResult.h
    M Source/WebKit/Shared/Cocoa/CoreIPCDDScannerResult.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCDictionary.h
    M Source/WebKit/Shared/Cocoa/CoreIPCDictionary.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCFont.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.h
    M Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.mm
    M Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.serialization.in
    A Source/WebKit/Shared/Cocoa/CoreIPCTypes.h
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj

  Log Message:
  -----------
  Refactor the "All CoreIPC types" variant to work forward-delcared
https://bugs.webkit.org/show_bug.cgi?id=265114

Reviewed by Dan Glastonbury.

CoreIPCNSObject and some of the other CoreIPC wrappers have a circular dependency.
This is because of the variant of all wrappers that CoreIPCNSCFObject holds.

The circular dependency will become untenable in upcoming patches, so this is a straight refactor.
It does the following:
1 - Forward declares all the types for the variant instead of include their headers
2 - Because the types are forward declared, the variant can no longer be a direct member of
    CoreIPCNSCFObject. So make it a UniqueRef<> instead
3 - Add a new "CoreIPCTypes.h" convenience header that *does* include all the wrapper headers.
4 - Include CoreIPCTypes.h in each .mm file that needs to work with the variant directly.

* Source/WebKit/Shared/Cocoa/ArgumentCodersCocoa.mm:
* Source/WebKit/Shared/Cocoa/CoreIPCArray.mm:
* Source/WebKit/Shared/Cocoa/CoreIPCDDScannerResult.h:
* Source/WebKit/Shared/Cocoa/CoreIPCDDScannerResult.mm:
* Source/WebKit/Shared/Cocoa/CoreIPCDictionary.h:
* Source/WebKit/Shared/Cocoa/CoreIPCDictionary.mm:
* Source/WebKit/Shared/Cocoa/CoreIPCFont.mm:
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.h:
(WebKit::CoreIPCNSCFObject::CoreIPCNSCFObject): Deleted.
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.mm:
(WebKit::valueFromID):
(WebKit::CoreIPCNSCFObject::CoreIPCNSCFObject):
(WebKit::CoreIPCNSCFObject::toID const):
(IPC::ArgumentCoder<UniqueRef<WebKit::ObjectValue>>::encode):
(IPC::ArgumentCoder<UniqueRef<WebKit::ObjectValue>>::decode):
* Source/WebKit/Shared/Cocoa/CoreIPCNSCFObject.serialization.in:
* Source/WebKit/Shared/Cocoa/CoreIPCTypes.h: Copied from Source/WebKit/Shared/Cocoa/CoreIPCArray.mm.
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

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




More information about the webkit-changes mailing list