Fix circular dependencies in webrtc_common.

One reason for the circular deps is that common_types.h is a
historical dumping ground for various structs and defines that
are believed to be generally useful. I tried moving things out
that did not appear to be used downstream (StreamCounters,
RtpCounters etc) and moved the things that seemed used
(RtpHeader + supporting structs) to a new file api/rtp_headers.h.
This makes their place in the api more clear while moving out
the things that don't belong in the API in the first place.

I had to extract out typedefs.h from webrtc_common to resolve
another circular dependency. I believe checks includes typedefs,
but common depends on checks.

Bug: webrtc:7745
Change-Id: I725d49616b1ec0cdc8b74be7c078f7a4d46f084b
Reviewed-on: https://webrtc-review.googlesource.com/33001
Commit-Queue: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21295}
diff --git a/rtc_base/BUILD.gn b/rtc_base/BUILD.gn
index e64e444..0949f4e 100644
--- a/rtc_base/BUILD.gn
+++ b/rtc_base/BUILD.gn
@@ -96,13 +96,18 @@
   ]
   deps = [
     ":safe_compare",
-    "..:webrtc_common",
+    "..:typedefs",
   ]
 }
 
-rtc_source_set("type_traits") {
+rtc_source_set("rate_limiter") {
   sources = [
-    "type_traits.h",
+    "rate_limiter.cc",
+    "rate_limiter.h",
+  ]
+  deps = [
+    ":rtc_base_approved",
+    "../system_wrappers",
   ]
 }
 
@@ -121,14 +126,25 @@
   ]
 }
 
-rtc_source_set("rate_limiter") {
+rtc_source_set("stringutils") {
   sources = [
-    "rate_limiter.cc",
-    "rate_limiter.h",
+    "stringutils.cc",
+    "stringutils.h",
   ]
   deps = [
-    ":rtc_base_approved",
-    "../system_wrappers",
+    ":checks",
+  ]
+}
+
+rtc_source_set("type_traits") {
+  sources = [
+    "type_traits.h",
+  ]
+}
+
+rtc_source_set("deprecation") {
+  sources = [
+    "deprecation.h",
   ]
 }
 
@@ -146,7 +162,9 @@
   deps = [
     ":checks",
     ":safe_compare",
+    ":stringutils",
     ":type_traits",
+    "../:typedefs",
   ]
 
   sources = [
@@ -171,7 +189,6 @@
     "copyonwritebuffer.h",
     "criticalsection.cc",
     "criticalsection.h",
-    "deprecation.h",
     "event_tracer.cc",
     "event_tracer.h",
     "file.cc",
@@ -216,8 +233,6 @@
     "stringencode.cc",
     "stringencode.h",
     "stringize_macros.h",
-    "stringutils.cc",
-    "stringutils.h",
     "swap_queue.h",
     "template_util.h",
     "thread_annotations.h",
@@ -526,6 +541,7 @@
   defines = []
   deps = [
     ":checks",
+    ":stringutils",
     "..:webrtc_common",
     "../api:optional",
   ]
@@ -845,6 +861,7 @@
   deps = [
     ":checks",
     ":rtc_base",
+    ":stringutils",
     "../test:field_trial",
     "../test:test_support",
   ]
@@ -956,6 +973,7 @@
       ":rtc_base_tests_utils",
       ":rtc_task_queue",
       ":safe_compare",
+      ":stringutils",
       "../api:array_view",
       "../system_wrappers:system_wrappers",
       "../test:test_support",
@@ -1080,6 +1098,7 @@
       ":checks",
       ":rtc_base_tests_main",
       ":rtc_base_tests_utils",
+      ":stringutils",
       "../api:optional",
       "../test:test_support",
     ]