Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0f6f236889c04d89a01f63becf0c9cb3a7c46c54
      
https://github.com/WebKit/WebKit/commit/0f6f236889c04d89a01f63becf0c9cb3a7c46c54
  Author: Richard Robinson <[email protected]>
  Date:   2025-12-28 (Sun, 28 Dec 2025)

  Changed paths:
    M Source/JavaScriptCore/runtime/JSStringJoiner.h
    M Source/WTF/WTF.xcodeproj/project.pbxproj
    M Source/WTF/wtf/MediaTime.cpp
    M Source/WTF/wtf/MediaTime.h
    M Source/WTF/wtf/ObjectIdentifier.cpp
    M Source/WTF/wtf/ObjectIdentifier.h
    M Source/WTF/wtf/Seconds.cpp
    M Source/WTF/wtf/Seconds.h
    M Source/WTF/wtf/URL.cpp
    M Source/WTF/wtf/URL.h
    M Source/WTF/wtf/text/TextStream.cpp
    M Source/WTF/wtf/text/TextStream.h
    R Source/WTF/wtf/text/TextStreamCocoa.h
    M Source/WTF/wtf/text/cocoa/TextStreamCocoa.mm
    M Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp
    M Source/WebCore/Modules/indexeddb/server/MemoryBackingStoreTransaction.h
    M Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h
    M Source/WebCore/Modules/indexeddb/shared/IDBResourceIdentifier.h
    M Source/WebCore/Modules/push-api/PushDatabase.h
    M Source/WebCore/Modules/push-api/PushSubscriptionData.h
    M Source/WebCore/Modules/push-api/PushSubscriptionIdentifier.h
    M Source/WebCore/Modules/speech/SpeechRecognizer.h
    M Source/WebCore/Modules/streams/ReadableStreamBYOBRequest.h
    M Source/WebCore/platform/SleepDisabler.h
    M Source/WebCore/platform/graphics/ImageFrameWorkQueue.cpp
    M Source/WebCore/platform/graphics/InbandGenericCue.h
    M Source/WebGPU/WebGPU/CommandEncoder.swift
    M Source/WebKit/Platform/IPC/HandleMessage.h
    M Source/WebKit/Platform/IPC/ObjectIdentifierReferenceTracker.h
    M Source/WebKit/Shared/API/APIFrameHandle.h
    M 
Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm
    M 
Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.h
    M Source/WebKit/Shared/WebGPU/WebGPUPipelineDescriptorBase.h
    M Source/WebKit/UIProcess/API/APIDataTask.h
    M Source/WebKit/UIProcess/Extensions/WebExtensionMessagePort.h
    M Source/WebKit/WebProcess/Inspector/ServiceWorkerDebuggableProxy.h
    M Tools/TestWebKitAPI/Tests/WTF/cocoa/TextStreamCocoa.mm

  Log Message:
  -----------
  [Swift in WebKit] Swift modules that depend on WTF occasionally need to 
erroneously import `wtf.Core.text.TextStream`
https://bugs.webkit.org/show_bug.cgi?id=304720
rdar://167226128

Reviewed by Mike Wyrzykowski.

Currently, `CommandEncoder.swift` needs to import `wtf.Core.text.TextStream` 
even though it doesn't
actually use any WTF types itself, let alone TextStream. This is because 
CommandEncoder uses the
Swift bit-shift `<<` operator function in parts of its implementation. Because 
`TextStream` overloads
the C++ `<<` operator function, this results in the compuler needing to access 
the full `TextStream`
type so that it can perform overload resolution on the `<<` functions.

Now, this wouldn't normally be a problem (aside from being pretty non-intuitive 
at first glance). However,
it _is_ a problem because the full definition of `TextStream` is not nominally 
visible in all cases
when accessing WTF. This _itself_ is because of a layering violation in WTF 
which effectively results in
dependency cycle between WTF types, which is mostly benign except in this case.

Specifically, some other WTF (transitively) depend on TextStream, and 
TextStream may transitively depend
on them. Since TextStream's consumers are all above WTF itself, it makes sense 
to re-layer this architecture
such that TextStream is at the "top" of WTF, and may depend on any WTF types 
without issue, and no other
WTF type may depend on TextStream (and has no reason to do so).

* Source/WTF/WTF.xcodeproj/project.pbxproj:
* Source/WTF/wtf/MediaTime.cpp:
(WTF::operator<<): Deleted.
* Source/WTF/wtf/MediaTime.h:
* Source/WTF/wtf/ObjectIdentifier.cpp:
(WTF::operator<<): Deleted.
* Source/WTF/wtf/ObjectIdentifier.h:
* Source/WTF/wtf/Seconds.cpp:
(WTF::operator<<): Deleted.
* Source/WTF/wtf/Seconds.h:
* Source/WTF/wtf/URL.cpp:
(WTF::operator<<): Deleted.
* Source/WTF/wtf/URL.h:
* Source/WTF/wtf/text/TextStream.cpp:
(WTF::operator<<):
* Source/WTF/wtf/text/TextStream.h:
* Source/WTF/wtf/text/TextStreamCocoa.h: Removed.
* Source/WTF/wtf/text/cocoa/TextStreamCocoa.mm:
* Source/WebCore/Modules/indexeddb/server/UniqueIDBDatabaseTransaction.h:
* Source/WebCore/Modules/indexeddb/shared/IDBResourceIdentifier.h:
* Source/WebCore/Modules/push-api/PushDatabase.h:
* Source/WebCore/Modules/push-api/PushSubscriptionData.h:
* Source/WebCore/Modules/push-api/PushSubscriptionIdentifier.h:
* Source/WebCore/platform/SleepDisabler.h:
* Source/WebCore/platform/graphics/InbandGenericCue.h:
* Source/WebGPU/WebGPU/CommandEncoder.swift:
* Source/WebKit/Platform/IPC/HandleMessage.h:
* Source/WebKit/Platform/IPC/ObjectIdentifierReferenceTracker.h:
* Source/WebKit/Shared/EntryPointUtilities/Cocoa/XPCService/XPCServiceMain.mm:
* Source/WebKit/Shared/WebGPU/WebGPUPipelineDescriptorBase.h:
* Source/WebKit/WebProcess/Inspector/ServiceWorkerDebuggableProxy.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to