RESOLVED FIXED185324
Activate ARC for libwebrtc Objective C files
https://bugs.webkit.org/show_bug.cgi?id=185324
Summary Activate ARC for libwebrtc Objective C files
youenn fablet
Reported 2018-05-04 14:09:58 PDT
Activate ARC for libwebrtc Objective C files
Attachments
Patch (15.26 KB, patch)
2018-05-04 14:13 PDT, youenn fablet
no flags
Patch (15.84 KB, patch)
2018-05-04 15:02 PDT, youenn fablet
no flags
Patch (15.23 KB, patch)
2018-05-07 13:37 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2018-05-04 14:13:17 PDT
youenn fablet
Comment 2 2018-05-04 15:02:49 PDT
Radar WebKit Bug Importer
Comment 3 2018-05-07 11:53:28 PDT
David Kilzer (:ddkilzer)
Comment 4 2018-05-07 12:55:10 PDT
Comment on attachment 339600 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=339600&action=review Okay, after reviewing all of this, I suggest you just back out the -fobjc-arc changes to libwebrtc.xcodeproj/project.pbxproj and simply change Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig instead: DYLIB_INSTALL_NAME_BASE_WK_RELOCATABLE_FRAMEWORKS_ = $(DYLIB_INSTALL_NAME_BASE); DYLIB_INSTALL_NAME_BASE_WK_RELOCATABLE_FRAMEWORKS_YES = @loader_path/../../../; +CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; Keep the rest of the changes to the source code; I don't think you'll need to change anything else to enable ARC. > Source/ThirdParty/libwebrtc/ChangeLog:24 > + * libwebrtc.xcodeproj/project.pbxproj: These files also need -fobjc-arc under the Source/webrtc/sdk directory: NSString+StdString.mm - Fix leak in -[NSString(StdString) stringForString:(const std::string&)]. RTCUIApplicationStatusObserver.m - The __weak modifier won't do what you think it should without it. UIDevice+RTCDevice.mm - Fix leak in +[UIDevice(RTCDevice) machineName]. RTCI420Buffer.mm - Consistency for Objective-C++ files under sdk/objc/Framework/Classes/Video/ (in case a future merge introduces a real -fobjc-arc requirement). This Objective-C++ code in sdk/WebKit doesn't need -fobjc-arc, although it should probably have -fobc-arc added in case the upstream code changes in the future: decoder.mm encoder.mm encoder_vcp.mm These files don't require -fobjc-arc, but won't hurt to enable it under Source/webrtc/rtc_base (in case future upstream changes require it): logging_mac.mm noop.mm thread_darwin.mm One of these three files in Source/webrtc/modules/audio_device/ios requires -fobjc-arc (the others don't now, but might need it with future upstream changes): audio_device_ios.mm - Fix leak in RTCAudioSessionDelegateAdapter when AudioDeviceIOS is deallocated. audio_device_not_implemented_ios.mm - Not needed. voice_processing_audio_unit.mm - Not needed.
David Kilzer (:ddkilzer)
Comment 5 2018-05-07 12:56:11 PDT
Comment on attachment 339600 [details] Patch So r=me if you back out the changes to libwebrtc.xcodeproj/project.pbxproj and just change Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig to enable ARC for all Objective-C source instead.
youenn fablet
Comment 6 2018-05-07 13:20:12 PDT
(In reply to David Kilzer (:ddkilzer) from comment #5) > Comment on attachment 339600 [details] > Patch > > So r=me if you back out the changes to libwebrtc.xcodeproj/project.pbxproj > and just change > Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig to enable ARC > for all Objective-C source instead. Thanks for the review! I will try enabling ARC for all source code. FWIW, decoder.mm, encoder.mm and encoder_vcp.mm do not need arc, these are the legacy non ARC codecs and are no longer in upstreamed libwebrtc tree. I will update the project to no longer compile these.
youenn fablet
Comment 7 2018-05-07 13:37:57 PDT
David Kilzer (:ddkilzer)
Comment 8 2018-05-07 14:53:52 PDT
Comment on attachment 339746 [details] Patch r=me if this passes EWS.
WebKit Commit Bot
Comment 9 2018-05-07 14:58:06 PDT
Comment on attachment 339746 [details] Patch Clearing flags on attachment: 339746 Committed r231459: <https://trac.webkit.org/changeset/231459>
WebKit Commit Bot
Comment 10 2018-05-07 14:58:07 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.