Bug 200289 - ObjC RTCCVPixelBuffer should be prefixed to not conflict with other apps
Summary: ObjC RTCCVPixelBuffer should be prefixed to not conflict with other apps
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-07-30 17:17 PDT by youenn fablet
Modified: 2019-08-01 15:51 PDT (History)
6 users (show)

See Also:


Attachments
Patch (1.60 KB, patch)
2019-07-31 11:38 PDT, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2019-07-30 17:17:16 PDT
ObjC RTCCVPixelBuffer should be prefixed to not conflict with other apps
Comment 1 youenn fablet 2019-07-30 17:17:42 PDT
<rdar://problem/49554670>
Comment 2 youenn fablet 2019-07-31 11:38:41 PDT
Created attachment 375231 [details]
Patch
Comment 3 Darin Adler 2019-07-31 14:52:23 PDT
Comment on attachment 375231 [details]
Patch

Why only this class? What about all the other classes defined in libwebrtc?
Comment 4 youenn fablet 2019-07-31 14:57:05 PDT
(In reply to Darin Adler from comment #3)
> Comment on attachment 375231 [details]
> Patch
> 
> Why only this class? What about all the other classes defined in libwebrtc?

The other classes are prefixed.
I missed that one when switching the implementation to use the ObjC libwebrtc factories.
It would be nice to have some kind of build checks that enforces that libwebrtc does not define any ObjC RTCXX interface.
Comment 5 WebKit Commit Bot 2019-07-31 15:26:49 PDT
Comment on attachment 375231 [details]
Patch

Clearing flags on attachment: 375231

Committed r248077: <https://trac.webkit.org/changeset/248077>
Comment 6 WebKit Commit Bot 2019-07-31 15:26:50 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Darin Adler 2019-07-31 16:01:00 PDT
(In reply to youenn fablet from comment #4) 
> It would be nice to have some kind of build checks that enforces that
> libwebrtc does not define any ObjC RTCXX interface.

Should be easy to add that.
Comment 8 David Kilzer (:ddkilzer) 2019-07-31 19:08:53 PDT
(In reply to Darin Adler from comment #7)
> (In reply to youenn fablet from comment #4) 
> > It would be nice to have some kind of build checks that enforces that
> > libwebrtc does not define any ObjC RTCXX interface.
> 
> Should be easy to add that.

You should be able to do something like this in a build phase script that only runs for Engineering builds (other build phase scripts do this in WebCore):

$ xcrun nm -U /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libwebrtc.dylib | grep _OBJC_CLASS_ | grep -v '_OBJC_CLASS_$_WK_'
000000000063b360 s _OBJC_CLASS_$_RTCCVPixelBuffer
000000000063b748 s _OBJC_CLASS_$_RTCVideoDecoderVP8
000000000063b9f0 s _OBJC_CLASS_$_RTCWrappedNativeVideoDecoder
000000000063ba40 s _OBJC_CLASS_$_RTCWrappedNativeVideoEncoder

That was from macOS 10.4.4 Mojave.  Looks like we missed four classes there.

If the output from that shell command is empty, we're good.
Comment 9 youenn fablet 2019-07-31 19:27:21 PDT
> You should be able to do something like this in a build phase script that
> only runs for Engineering builds (other build phase scripts do this in
> WebCore):

Thanks

> $ xcrun nm -U
> /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.
> framework/Versions/A/Frameworks/libwebrtc.dylib | grep _OBJC_CLASS_ | grep
> -v '_OBJC_CLASS_$_WK_'
> 000000000063b360 s _OBJC_CLASS_$_RTCCVPixelBuffer
> 000000000063b748 s _OBJC_CLASS_$_RTCVideoDecoderVP8
> 000000000063b9f0 s _OBJC_CLASS_$_RTCWrappedNativeVideoDecoder
> 000000000063ba40 s _OBJC_CLASS_$_RTCWrappedNativeVideoEncoder
> 
> That was from macOS 10.4.4 Mojave.  Looks like we missed four classes there.
> 
> If the output from that shell command is empty, we're good.

It only includes RTCCVPixelBuffer in recent builds so we should be good.