Reland of GN: Enable ARC for Mac and iOS in rtc_* templates (patchset #1 id:1 of https://codereview.webrtc.org/2827223003/ )

Reason for revert:
Relanding after fixing ARC issue.

Original issue's description:
> Revert of GN: Enable ARC for Mac and iOS in rtc_* templates (patchset #3 id:40001 of https://codereview.webrtc.org/2781713004/ )
>
> Reason for revert:
> Breaks mac build
>
> Original issue's description:
> > GN: Enable ARC for Mac and iOS in rtc_* templates
> >
> > Remove all uses of retain/release and NSAutoreleasePool.
> >
> > This makes transformation to Bazel easier.
> >
> > This CL subsumes https://codereview.webrtc.org/2778163002 and depends on https://codereview.webrtc.org/2784483002/
> >
> > BUG=webrtc:6412
> >
> > Review-Url: https://codereview.webrtc.org/2781713004
> > Cr-Commit-Position: refs/heads/master@{#17780}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/6bda02b51dc00401d2a0d04be996ed10e5acac47
>
> TBR=kjellander@webrtc.org,magjed@webrtc.org,stefan@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6412
>
> Review-Url: https://codereview.webrtc.org/2827223003
> Cr-Commit-Position: refs/heads/master@{#17784}
> Committed: https://chromium.googlesource.com/external/webrtc/+/7c8786ae8f2d8481f74b0ab16eb91a8101fe51dc

TBR=kjellander@webrtc.org,magjed@webrtc.org,stefan@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6412

Review-Url: https://codereview.webrtc.org/2834273002
Cr-Commit-Position: refs/heads/master@{#17836}
diff --git a/webrtc/sdk/BUILD.gn b/webrtc/sdk/BUILD.gn
index 77a9f55..721580d 100644
--- a/webrtc/sdk/BUILD.gn
+++ b/webrtc/sdk/BUILD.gn
@@ -50,14 +50,12 @@
       "objc/Framework/Headers/WebRTC/RTCSSLAdapter.h",
       "objc/Framework/Headers/WebRTC/RTCTracing.h",
     ]
-    configs += [
-      "..:common_objc",
-      "//build/config/compiler:enable_arc",
-    ]
-    public_configs = [ ":rtc_sdk_common_objc_config" ]
     deps = [
       "../base:rtc_base",
     ]
+    configs += [ "..:common_objc" ]
+
+    public_configs = [ ":rtc_sdk_common_objc_config" ]
     if (is_ios) {
       sources += [
         "objc/Framework/Classes/RTCCameraPreviewView.m",
@@ -195,13 +193,6 @@
       "objc/Framework/Headers/WebRTC/RTCVideoTrack.h",
     ]
 
-    configs += [
-      "..:common_objc",
-      "//build/config/compiler:enable_arc",
-    ]
-
-    public_configs = [ ":rtc_sdk_common_objc_config" ]
-
     deps = [
       ":webrtc_h264_video_toolbox",
       "../api:video_frame_api",
@@ -245,6 +236,10 @@
       ]
     }
 
+    configs += [ "..:common_objc" ]
+
+    public_configs = [ ":rtc_sdk_common_objc_config" ]
+
     if (!build_with_chromium && is_clang) {
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
       suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
@@ -368,13 +363,6 @@
         "@rpath/$output_name.framework/$output_name",
       ]
 
-      configs += [
-        "..:common_objc",
-        "//build/config/compiler:enable_arc",
-      ]
-
-      public_configs = [ ":rtc_sdk_common_objc_config" ]
-
       deps = [
         ":rtc_sdk_peerconnection_objc",
         "../system_wrappers:field_trial_default",
@@ -390,6 +378,10 @@
         "VideoToolbox.framework",
       ]
 
+      configs += [ "..:common_objc" ]
+
+      public_configs = [ ":rtc_sdk_common_objc_config" ]
+
       if (!build_with_chromium && is_clang) {
         # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163)
         configs -= [ "//build/config/clang:find_bad_constructs" ]
@@ -416,10 +408,7 @@
       "objc/Framework/Classes/h264_video_toolbox_nalu.h",
     ]
 
-    configs += [
-      "//webrtc:common_objc",
-      "//build/config/compiler:enable_arc",
-    ]
+    configs += [ "//webrtc:common_objc" ]
 
     deps = [
       ":rtc_sdk_common_objc",
diff --git a/webrtc/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm b/webrtc/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm
index bd2db30..1797fea 100644
--- a/webrtc/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm
+++ b/webrtc/sdk/objc/Framework/UnitTests/RTCPeerConnectionTest.mm
@@ -53,11 +53,13 @@
   RTCMediaConstraints *contraints = [[RTCMediaConstraints alloc] initWithMandatoryConstraints:@{}
       optionalConstraints:nil];
   RTCPeerConnectionFactory *factory = [[RTCPeerConnectionFactory alloc] init];
-  RTCPeerConnection *peerConnection = [factory peerConnectionWithConfiguration:config
-      constraints:contraints delegate:nil];
 
-  RTCConfiguration *newConfig = peerConnection.configuration;
-
+  RTCConfiguration *newConfig;
+  @autoreleasepool {
+    RTCPeerConnection *peerConnection =
+        [factory peerConnectionWithConfiguration:config constraints:contraints delegate:nil];
+    newConfig = peerConnection.configuration;
+  }
   EXPECT_EQ([config.iceServers count], [newConfig.iceServers count]);
   RTCIceServer *newServer = newConfig.iceServers[0];
   RTCIceServer *origServer = config.iceServers[0];
diff --git a/webrtc/sdk/objc/Framework/UnitTests/avformatmappertests.mm b/webrtc/sdk/objc/Framework/UnitTests/avformatmappertests.mm
index 624eec3..cbc2e50 100644
--- a/webrtc/sdk/objc/Framework/UnitTests/avformatmappertests.mm
+++ b/webrtc/sdk/objc/Framework/UnitTests/avformatmappertests.mm
@@ -97,7 +97,6 @@
     CFRelease(_format);
     _format = nil;
   }
-  [super dealloc];
 }
 
 // Redefinition of AVCaptureDevice methods we want to mock.