[webkit-changes] [WebKit/WebKit] d29755: [Cocoa] It should be easier to log Objective-C types

aestes noreply at github.com
Mon Sep 18 08:52:35 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d29755985713f08f487db90cb1ebb8bf45c5d4cd
      https://github.com/WebKit/WebKit/commit/d29755985713f08f487db90cb1ebb8bf45c5d4cd
  Author: Andy Estes <aestes at apple.com>
  Date:   2023-09-18 (Mon, 18 Sep 2023)

  Changed paths:
    M Source/WTF/wtf/Logger.h
    M Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm
    M Source/WebCore/platform/cocoa/WebAVPlayerLayer.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/InbandChapterTrackPrivateAVFObjC.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm
    M Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
    M Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm
    M Source/WebCore/platform/mediastream/ios/ReplayKitCaptureSource.mm
    M Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm
    M Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WTF/cocoa/LoggerCocoa.mm

  Log Message:
  -----------
  [Cocoa] It should be easier to log Objective-C types
https://bugs.webkit.org/show_bug.cgi?id=261666
rdar://115640396

Reviewed by Tim Horton.

Added the following WTF::LogArgument specializations and adopted them throughout WebCore:
- NSError, returning `-localizedDescription`
- NSObject and NSProxy, returning `-description`
- id, returning `-description` if the object responds to it, otherwise returning the object's address

Added test cases to TestWTF.

* Source/WTF/wtf/Logger.h:
(WTF::LogArgument::toString):
(WTF::LogArgument<id>::toString):
* Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm:
(WebCore::SharedRoutingArbitrator::beginRoutingArbitrationForToken):
* Source/WebCore/platform/cocoa/WebAVPlayerLayer.mm:
(-[WebAVPlayerLayer setVideoGravity:]):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequests):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest):
(WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
(WebCore::CDMSessionAVContentKeySession::update):
* Source/WebCore/platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
(WebCore::CDMSessionAVFoundationObjC::generateKeyRequest):
(WebCore::CDMSessionAVFoundationObjC::playerDidReceiveError):
* Source/WebCore/platform/graphics/avfoundation/objc/InbandChapterTrackPrivateAVFObjC.mm:
(WebCore::InbandChapterTrackPrivateAVFObjC::processChapters):
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
(WebCore::MediaPlayerPrivateAVFoundationObjC::assetStatus const):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateVideoLayerGravity):
* Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
* Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferParserAVFObjC.mm:
(WebCore::SourceBufferParserAVFObjC::didParseStreamDataAsAsset):
(WebCore::SourceBufferParserAVFObjC::didFailToParseStreamDataWithError):
* Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::layerDidReceiveError):
* Source/WebCore/platform/graphics/cocoa/MediaPlayerPrivateWebM.mm:
(WebCore::MediaPlayerPrivateWebM::ensureLayer):
(WebCore::MediaPlayerPrivateWebM::addAudioRenderer):
* Source/WebCore/platform/mediastream/ios/ReplayKitCaptureSource.mm:
(WebCore::ReplayKitCaptureSource::start):
(WebCore::ReplayKitCaptureSource::stop):
* Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::setSessionSizeFrameRateAndZoom):
(WebCore::AVVideoCaptureSource::setupCaptureSession):
(WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
(WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
* Source/WebCore/platform/mediastream/mac/ScreenCaptureKitCaptureSource.mm:
(WebCore::ScreenCaptureKitCaptureSource::sessionFailedWithError):
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WTF/cocoa/LoggerCocoa.mm: Added.
(-[TestWTFLogger description]):
(-[TestWTFLoggerProxy initWithTarget:]):
(-[TestWTFLoggerProxy forwardInvocation:]):
(-[TestWTFLoggerProxy methodSignatureForSelector:]):
(TEST):

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




More information about the webkit-changes mailing list