[ObjC ARC] Converts ios/chrome/browser/metrics:metrics_internal to ARC.

Automatically generated ARCMigrate commit
Notable issues:None
BUG=624363
TEST=None

Review-Url: https://codereview.chromium.org/2820383002
Cr-Commit-Position: refs/heads/master@{#469004}
diff --git a/ios/chrome/browser/metrics/BUILD.gn b/ios/chrome/browser/metrics/BUILD.gn
index 88a7db5..91c6ea4 100644
--- a/ios/chrome/browser/metrics/BUILD.gn
+++ b/ios/chrome/browser/metrics/BUILD.gn
@@ -83,6 +83,7 @@
 }
 
 source_set("metrics_internal") {
+  configs += [ "//build/config/compiler:enable_arc" ]
   sources = [
     "first_user_action_recorder.cc",
     "first_user_action_recorder.h",
diff --git a/ios/chrome/browser/metrics/new_tab_page_uma.mm b/ios/chrome/browser/metrics/new_tab_page_uma.mm
index 8405afa1..a11fc2d 100644
--- a/ios/chrome/browser/metrics/new_tab_page_uma.mm
+++ b/ios/chrome/browser/metrics/new_tab_page_uma.mm
@@ -13,6 +13,10 @@
 #import "ios/chrome/browser/tabs/tab_model_list.h"
 #include "url/gurl.h"
 
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
 namespace new_tab_page_uma {
 
 bool IsCurrentlyOnNTP(ios::ChromeBrowserState* browserState) {
diff --git a/ios/chrome/browser/metrics/size_class_recorder.mm b/ios/chrome/browser/metrics/size_class_recorder.mm
index 8e90ebe..fa94ae2 100644
--- a/ios/chrome/browser/metrics/size_class_recorder.mm
+++ b/ios/chrome/browser/metrics/size_class_recorder.mm
@@ -9,6 +9,10 @@
 #include "base/metrics/histogram_macros.h"
 #import "ios/chrome/browser/ui/ui_util.h"
 
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
 namespace ios_internal {
 
 // Converts a UIKit size class to a size class for reporting.
@@ -89,7 +93,6 @@
 
 - (void)dealloc {
   [[NSNotificationCenter defaultCenter] removeObserver:self];
-  [super dealloc];
 }
 
 - (void)horizontalSizeClassDidChange:(UIUserInterfaceSizeClass)newSizeClass {
diff --git a/ios/chrome/browser/metrics/tab_usage_recorder.h b/ios/chrome/browser/metrics/tab_usage_recorder.h
index 8b991251..b5a3e21 100644
--- a/ios/chrome/browser/metrics/tab_usage_recorder.h
+++ b/ios/chrome/browser/metrics/tab_usage_recorder.h
@@ -191,7 +191,7 @@
 
   // Keep track of the current tab, but only if it has been evicted.
   // This is kept as a pointer value only - it should never be dereferenced.
-  void* evicted_tab_;
+  __unsafe_unretained Tab* evicted_tab_;
 
   // State of |evicted_tab_| at the time it became the current tab.
   TabStateWhenSelected evicted_tab_state_;
@@ -199,11 +199,11 @@
   // Keep track of the tab last selected when this tab model was switched
   // away from to another mode (e.g. to incognito).
   // Kept as a pointer value only - it should never be dereferenced.
-  void* mode_switch_tab_;
+  __unsafe_unretained Tab* mode_switch_tab_;
 
   // Keep track of a tab that was created to be immediately selected.  It should
   // not contribute to the "StatusWhenSwitchedBackToForeground" metric.
-  void* tab_created_selected_;
+  __unsafe_unretained Tab* tab_created_selected_;
 
   // Keep track of when the evicted tab starts to reload, so that the total
   // time it takes to reload can be recorded.
diff --git a/ios/chrome/browser/metrics/tab_usage_recorder.mm b/ios/chrome/browser/metrics/tab_usage_recorder.mm
index 14405ac..b8cd3ba 100644
--- a/ios/chrome/browser/metrics/tab_usage_recorder.mm
+++ b/ios/chrome/browser/metrics/tab_usage_recorder.mm
@@ -10,6 +10,10 @@
 #import "ios/chrome/browser/tabs/tab.h"
 #import "ios/web/web_state/ui/crw_web_controller.h"
 
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
 const char kTabUsageHistogramPrefix[] = "Tab";
 
 // The histogram recording the state of the tab the user switches to.