Re: [webkit-dev] Objective-C code in libwebrtc already assuming ARC?

2018-06-06 Thread Darin Adler
> On Jun 6, 2018, at 9:39 AM, Dan Bernstein  wrote:
> 
> libwebrtc.xcconfig sets CLANG_ENABLE_OBJC_ARC to YES for the libwebrtc 
> target. Since RTCVideoCodecH264.mm is part of that target the file is 
> compiled with ARC.

OK, great. That’s what I missed.

I’ll get rid of the stray -fobjc-arc in 
ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj for 
voice_processing_audio_unit.mm as a cleanup step.

Should we also set it in ThirdParty/libwebrtc/Configurations/Base.xcconfig or 
is there a good argument against doing that? I am considering setting it there 
and removing it from libwebrtc.xcconfig since eventually all the Base.xcconfig 
will have it. Or maybe we generally keep all the Base.xcconfig files in sync 
with each other?

— Darin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Objective-C code in libwebrtc already assuming ARC?

2018-06-06 Thread Dan Bernstein

> On Jun 6, 2018, at 9:28 AM, Darin Adler  wrote:
> 
> Hi folks.
> 
> As some of you have probably noticed, I’ve begun making changes with the goal 
> of preparing us to move most Objective-C code in WebKit to ARC. In doing so, 
> I have been exploring the existing code in the tree and the various projects 
> in our source tree. The nine projects with configuration files that I have 
> looked at are:
> 
> JavaScriptCore, ANGLE, libwebrtc, WebCore, WebCore/PAL, WebInspectorUI, 
> WebKit, WebKitLegacy/mac, and bmalloc.
> 
> These projects all currently have CLANG_ENABLE_OBJC_WEAK in their 
> configuration files, and moving them to ARC involves adding 
> CLANG_ENABLE_OBJC_ARC, and then doing lots of other work to ensure the 
> projects still work properly, including possibly turning off ARC for certain 
> source files that are best keep working with manual retain and release. Some 
> of them such as ANGLE, bmalloc, and WebInspectorUI, have no Objective-C code, 
> or almost none, so they should be easy to “convert".
> 
> But when investigating libwebrtc I discovered a non-tribal amount of code 
> that already seems to assume ARC but to be compiled with ARC disabled. One 
> example is these two methods:
> 
> -[RTCVideoEncoderFactoryH264 supportedCodecs]
> -[RTCVideoDecoderFactoryH264 supportedCodecs]
> 
> If we are compiling this without ARC and executing calls to these methods, 
> then I think we will have storage leaks.
> 
> As far as I can tell, the only source file in libwebrtc that is currently 
> compiled with ARC enabled is voice_processing_audio_unit.mm but perhaps I am 
> overlooking something.
> 
> Do we need to turn ARC on for the entire libwebrtc project?

Hi Darin,

libwebrtc.xcconfig sets CLANG_ENABLE_OBJC_ARC to YES for the libwebrtc target. 
Since RTCVideoCodecH264.mm is part of that target the file is compiled with ARC.

> 
> — Darin
> ___
> webkit-dev mailing list
> webkit-dev@lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev

___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Objective-C code in libwebrtc already assuming ARC?

2018-06-06 Thread youenn fablet
Dave suggested the same approach in
https://bugs.webkit.org/show_bug.cgi?id=185324.
ARC should be enabled for the whole libwebrtc project in WebKit ToT.
   Y
Le mer. 6 juin 2018 à 09:28, Darin Adler  a écrit :

> Hi folks.
>
> As some of you have probably noticed, I’ve begun making changes with the
> goal of preparing us to move most Objective-C code in WebKit to ARC. In
> doing so, I have been exploring the existing code in the tree and the
> various projects in our source tree. The nine projects with configuration
> files that I have looked at are:
>
> JavaScriptCore, ANGLE, libwebrtc, WebCore, WebCore/PAL, WebInspectorUI,
> WebKit, WebKitLegacy/mac, and bmalloc.
>
> These projects all currently have CLANG_ENABLE_OBJC_WEAK in their
> configuration files, and moving them to ARC involves adding
> CLANG_ENABLE_OBJC_ARC, and then doing lots of other work to ensure the
> projects still work properly, including possibly turning off ARC for
> certain source files that are best keep working with manual retain and
> release. Some of them such as ANGLE, bmalloc, and WebInspectorUI, have no
> Objective-C code, or almost none, so they should be easy to “convert".
>
> But when investigating libwebrtc I discovered a non-tribal amount of code
> that already seems to assume ARC but to be compiled with ARC disabled. One
> example is these two methods:
>
> -[RTCVideoEncoderFactoryH264 supportedCodecs]
> -[RTCVideoDecoderFactoryH264 supportedCodecs]
>
> If we are compiling this without ARC and executing calls to these methods,
> then I think we will have storage leaks.
>
> As far as I can tell, the only source file in libwebrtc that is currently
> compiled with ARC enabled is voice_processing_audio_unit.mm but perhaps I
> am overlooking something.
>
> Do we need to turn ARC on for the entire libwebrtc project?
>
> — Darin
> ___
> webkit-dev mailing list
> webkit-dev@lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-dev
>
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


Re: [webkit-dev] Objective-C code in libwebrtc already assuming ARC?

2018-06-06 Thread Darin Adler
> On Jun 6, 2018, at 9:28 AM, Darin Adler  wrote:
> 
> best keep working with manual retain and release

best kept working

> a non-tribal amount of code that already seems to assume ARC

a non-trivial amount

— Darin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev


[webkit-dev] Objective-C code in libwebrtc already assuming ARC?

2018-06-06 Thread Darin Adler
Hi folks.

As some of you have probably noticed, I’ve begun making changes with the goal 
of preparing us to move most Objective-C code in WebKit to ARC. In doing so, I 
have been exploring the existing code in the tree and the various projects in 
our source tree. The nine projects with configuration files that I have looked 
at are:

JavaScriptCore, ANGLE, libwebrtc, WebCore, WebCore/PAL, WebInspectorUI, WebKit, 
WebKitLegacy/mac, and bmalloc.

These projects all currently have CLANG_ENABLE_OBJC_WEAK in their configuration 
files, and moving them to ARC involves adding CLANG_ENABLE_OBJC_ARC, and then 
doing lots of other work to ensure the projects still work properly, including 
possibly turning off ARC for certain source files that are best keep working 
with manual retain and release. Some of them such as ANGLE, bmalloc, and 
WebInspectorUI, have no Objective-C code, or almost none, so they should be 
easy to “convert".

But when investigating libwebrtc I discovered a non-tribal amount of code that 
already seems to assume ARC but to be compiled with ARC disabled. One example 
is these two methods:

-[RTCVideoEncoderFactoryH264 supportedCodecs]
-[RTCVideoDecoderFactoryH264 supportedCodecs]

If we are compiling this without ARC and executing calls to these methods, then 
I think we will have storage leaks.

As far as I can tell, the only source file in libwebrtc that is currently 
compiled with ARC enabled is voice_processing_audio_unit.mm but perhaps I am 
overlooking something.

Do we need to turn ARC on for the entire libwebrtc project?

— Darin
___
webkit-dev mailing list
webkit-dev@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-dev