Fix style violations in common_types.h and config.h

Mostly, it's about moving constructors and descructors to the .cc
files, so that they won't be inlined everywhere.

The reason this CL is so big is that a lot of code was using
common_types.h without declaring a dependency on webrtc_common, which
broke the build once common_types.h started to depend on
common_types.cc.

BUG=163
R=kjellander@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/26089004

Cr-Commit-Position: refs/heads/master@{#8516}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8516 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/BUILD.gn b/webrtc/modules/audio_coding/BUILD.gn
index a90f5be..6e280da 100644
--- a/webrtc/modules/audio_coding/BUILD.gn
+++ b/webrtc/modules/audio_coding/BUILD.gn
@@ -72,6 +72,7 @@
     ":neteq",
     ":pcm16b",
     ":red",
+    "../..:webrtc_common",
     "../../common_audio",
     "../../system_wrappers",
   ]
@@ -89,6 +90,7 @@
   ]
   configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
+  deps = [ "../..:webrtc_common" ]
 }
 
 source_set("audio_encoder_interface") {
@@ -98,6 +100,7 @@
   ]
   configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
+  deps = [ "../..:webrtc_common" ]
 }
 
 config("cng_config") {
@@ -439,12 +442,6 @@
     "codecs/isac/main/source/transform.c",
   ]
 
-  if (is_clang) {
-    # Suppress warnings from Chrome's Clang plugins.
-    # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
-  }
-
   if (is_linux) {
     libs = [ "m" ]
   }
@@ -518,12 +515,6 @@
     "codecs/isac/fix/source/transform_tables.c",
   ]
 
-  if (is_clang) {
-    # Suppress warnings from Chrome's Clang plugins.
-    # See http://code.google.com/p/webrtc/issues/detail?id=163 for details.
-    configs -= [ "//build/config/clang:find_bad_constructs" ]
-  }
-
   if (!is_win) {
     defines = [ "WEBRTC_LINUX" ]
   }
@@ -786,6 +777,7 @@
     ":isac",
     ":isacfix",
     ":pcm16b",
+    "../..:webrtc_common",
     "../../common_audio",
     "../../system_wrappers",
     rtc_opus_dir,
diff --git a/webrtc/modules/audio_coding/main/acm2/audio_coding_module.gypi b/webrtc/modules/audio_coding/main/acm2/audio_coding_module.gypi
index 44b6bb7..edbcaa9 100644
--- a/webrtc/modules/audio_coding/main/acm2/audio_coding_module.gypi
+++ b/webrtc/modules/audio_coding/main/acm2/audio_coding_module.gypi
@@ -17,6 +17,7 @@
       'iSACFix',
       'PCM16B',
       'red',
+      '<(webrtc_root)/common.gyp:webrtc_common',
       '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
       '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
     ],
@@ -37,6 +38,7 @@
       ],
       'dependencies': [
         '<@(audio_coding_dependencies)',
+        '<(webrtc_root)/common.gyp:webrtc_common',
         'neteq',
       ],
       'include_dirs': [
@@ -122,6 +124,7 @@
           'dependencies': [
             'audio_coding_module',
             '<(DEPTH)/testing/gtest.gyp:gtest',
+            '<(webrtc_root)/common.gyp:webrtc_common',
             '<(webrtc_root)/test/test.gyp:test_support',
             '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
             '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
@@ -140,6 +143,7 @@
           'dependencies': [
             'audio_coding_module',
             '<(DEPTH)/testing/gtest.gyp:gtest',
+            '<(webrtc_root)/common.gyp:webrtc_common',
             '<(webrtc_root)/test/test.gyp:test_support',
             '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
             '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
diff --git a/webrtc/modules/audio_coding/neteq/neteq.gypi b/webrtc/modules/audio_coding/neteq/neteq.gypi
index a301c37..ccf30ee 100644
--- a/webrtc/modules/audio_coding/neteq/neteq.gypi
+++ b/webrtc/modules/audio_coding/neteq/neteq.gypi
@@ -38,6 +38,7 @@
       'type': 'static_library',
       'dependencies': [
         '<@(neteq_dependencies)',
+        '<(webrtc_root)/common.gyp:webrtc_common',
       ],
       'defines': [
         '<@(neteq_defines)',
diff --git a/webrtc/modules/audio_coding/neteq/neteq_tests.gypi b/webrtc/modules/audio_coding/neteq/neteq_tests.gypi
index ed9c84a..e053eb4 100644
--- a/webrtc/modules/audio_coding/neteq/neteq_tests.gypi
+++ b/webrtc/modules/audio_coding/neteq/neteq_tests.gypi
@@ -234,6 +234,7 @@
         'iLBC',
         'iSAC',
         'CNG',
+        '<(webrtc_root)/common.gyp:webrtc_common',
         '<(DEPTH)/testing/gtest.gyp:gtest',
       ],
       'direct_dependent_settings': {
diff --git a/webrtc/modules/audio_device/BUILD.gn b/webrtc/modules/audio_device/BUILD.gn
index 784c75c..0941223 100644
--- a/webrtc/modules/audio_device/BUILD.gn
+++ b/webrtc/modules/audio_device/BUILD.gn
@@ -178,6 +178,7 @@
   }
 
   deps = [
+    "../..:webrtc_common",
     "../../base:rtc_base_approved",
     "../../common_audio",
     "../../system_wrappers",
diff --git a/webrtc/modules/audio_device/audio_device.gypi b/webrtc/modules/audio_device/audio_device.gypi
index 816a26a..55ae10d 100644
--- a/webrtc/modules/audio_device/audio_device.gypi
+++ b/webrtc/modules/audio_device/audio_device.gypi
@@ -14,6 +14,7 @@
       'dependencies': [
         'webrtc_utility',
         '<(webrtc_root)/base/base.gyp:rtc_base_approved',
+        '<(webrtc_root)/common.gyp:webrtc_common',
         '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
         '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
       ],
diff --git a/webrtc/modules/audio_processing/BUILD.gn b/webrtc/modules/audio_processing/BUILD.gn
index 589b580..03afa08 100644
--- a/webrtc/modules/audio_processing/BUILD.gn
+++ b/webrtc/modules/audio_processing/BUILD.gn
@@ -126,7 +126,7 @@
   public_configs = [ "../..:common_inherited_config" ]
 
   defines = []
-  deps = []
+  deps = [ "../..:webrtc_common" ]
 
   if (aec_debug_dump) {
     defines += [ "WEBRTC_AEC_DEBUG_DUMP" ]
diff --git a/webrtc/modules/audio_processing/audio_processing.gypi b/webrtc/modules/audio_processing/audio_processing.gypi
index 3feb9d0..1a264bc 100644
--- a/webrtc/modules/audio_processing/audio_processing.gypi
+++ b/webrtc/modules/audio_processing/audio_processing.gypi
@@ -26,6 +26,7 @@
       },
       'dependencies': [
         '<(webrtc_root)/base/base.gyp:rtc_base_approved',
+        '<(webrtc_root)/common.gyp:webrtc_common',
         '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
         '<(webrtc_root)/modules/modules.gyp:iSAC',
         '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
diff --git a/webrtc/modules/media_file/BUILD.gn b/webrtc/modules/media_file/BUILD.gn
index 1394d67..9cb15ff 100644
--- a/webrtc/modules/media_file/BUILD.gn
+++ b/webrtc/modules/media_file/BUILD.gn
@@ -44,6 +44,7 @@
   }
 
   deps = [
+    "../..:webrtc_common",
     "../../system_wrappers",
     "../../common_audio",
   ]
diff --git a/webrtc/modules/media_file/media_file.gypi b/webrtc/modules/media_file/media_file.gypi
index 31875b66..6ff96e1 100644
--- a/webrtc/modules/media_file/media_file.gypi
+++ b/webrtc/modules/media_file/media_file.gypi
@@ -12,6 +12,7 @@
       'target_name': 'media_file',
       'type': 'static_library',
       'dependencies': [
+        '<(webrtc_root)/common.gyp:webrtc_common',
         '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
         '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
       ],
diff --git a/webrtc/modules/modules.gyp b/webrtc/modules/modules.gyp
index 8478946..3a2f3e7 100644
--- a/webrtc/modules/modules.gyp
+++ b/webrtc/modules/modules.gyp
@@ -79,6 +79,7 @@
             '<(DEPTH)/testing/gmock.gyp:gmock',
             '<(DEPTH)/testing/gtest.gyp:gtest',
             '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
+            '<(webrtc_root)/common.gyp:webrtc_common',
             '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
             '<(webrtc_root)/modules/modules.gyp:video_capture',
             '<(webrtc_root)/modules/video_coding/codecs/vp8/vp8.gyp:webrtc_vp8',
@@ -361,6 +362,7 @@
           'type': '<(gtest_target_type)',
           'dependencies': [
             '<(DEPTH)/testing/gtest.gyp:gtest',
+            '<(webrtc_root)/common.gyp:webrtc_common',
             '<(webrtc_root)/common_video/common_video.gyp:common_video',
             '<(webrtc_root)/modules/video_coding/codecs/vp8/vp8.gyp:webrtc_vp8',
             '<(webrtc_root)/modules/video_coding/codecs/vp9/vp9.gyp:webrtc_vp9',
diff --git a/webrtc/modules/remote_bitrate_estimator/BUILD.gn b/webrtc/modules/remote_bitrate_estimator/BUILD.gn
index d728500..fe06c6d 100644
--- a/webrtc/modules/remote_bitrate_estimator/BUILD.gn
+++ b/webrtc/modules/remote_bitrate_estimator/BUILD.gn
@@ -18,6 +18,7 @@
 
   deps = [
     ":rbe_components",
+    "../..:webrtc_common",
     "../../system_wrappers",
   ]
 }
@@ -42,6 +43,7 @@
 
   configs += [ "../..:common_config" ]
   public_configs = [ "../..:common_inherited_config" ]
+  deps = [ "../..:webrtc_common" ]
 
   if (is_clang) {
     # Suppress warnings from Chrome's Clang plugins.
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi
index fd19898..84e8324 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi
+++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi
@@ -15,6 +15,7 @@
       'target_name': 'remote_bitrate_estimator',
       'type': 'static_library',
       'dependencies': [
+        '<(webrtc_root)/common.gyp:webrtc_common',
         '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
       ],
       'sources': [
diff --git a/webrtc/modules/rtp_rtcp/BUILD.gn b/webrtc/modules/rtp_rtcp/BUILD.gn
index f343e09..528637f 100644
--- a/webrtc/modules/rtp_rtcp/BUILD.gn
+++ b/webrtc/modules/rtp_rtcp/BUILD.gn
@@ -104,6 +104,7 @@
   }
 
   deps = [
+    "../..:webrtc_common",
     "../../system_wrappers",
     "../pacing",
     "../remote_bitrate_estimator",
diff --git a/webrtc/modules/utility/BUILD.gn b/webrtc/modules/utility/BUILD.gn
index c1de77e..2cb290f 100644
--- a/webrtc/modules/utility/BUILD.gn
+++ b/webrtc/modules/utility/BUILD.gn
@@ -40,6 +40,7 @@
   }
 
   deps = [
+    "../..:webrtc_common",
     "../../common_audio",
     "../../system_wrappers",
     "../audio_coding",
diff --git a/webrtc/modules/video_capture/BUILD.gn b/webrtc/modules/video_capture/BUILD.gn
index a924ecd..b7e9d30 100644
--- a/webrtc/modules/video_capture/BUILD.gn
+++ b/webrtc/modules/video_capture/BUILD.gn
@@ -27,6 +27,7 @@
   ]
 
   deps = [
+    "../..:webrtc_common",
     "../../common_video",
     "../../system_wrappers",
     "../utility",
@@ -87,6 +88,7 @@
         "linux/video_capture_linux.cc",
         "linux/video_capture_linux.h",
       ]
+      deps += [ "../..:webrtc_common" ]
     }
     if (is_mac) {
       sources = [
diff --git a/webrtc/modules/video_capture/video_capture.gypi b/webrtc/modules/video_capture/video_capture.gypi
index ac3a9f1..3c9b93c 100644
--- a/webrtc/modules/video_capture/video_capture.gypi
+++ b/webrtc/modules/video_capture/video_capture.gypi
@@ -17,6 +17,7 @@
       'type': 'static_library',
       'dependencies': [
         'webrtc_utility',
+        '<(webrtc_root)/common.gyp:webrtc_common',
         '<(webrtc_root)/common_video/common_video.gyp:common_video',
         '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
       ],
@@ -55,6 +56,7 @@
           'type': 'static_library',
           'dependencies': [
             'video_capture_module',
+            '<(webrtc_root)/common.gyp:webrtc_common',
           ],
           'conditions': [
             ['OS=="linux"', {
diff --git a/webrtc/modules/video_coding/BUILD.gn b/webrtc/modules/video_coding/BUILD.gn
index 353eca2..b10b528 100644
--- a/webrtc/modules/video_coding/BUILD.gn
+++ b/webrtc/modules/video_coding/BUILD.gn
@@ -85,6 +85,7 @@
     ":webrtc_i420",
     ":webrtc_vp8",
     ":webrtc_vp9",
+    "../..:webrtc_common",
     "../../common_video",
     "../../system_wrappers",
   ]
@@ -170,6 +171,7 @@
 
   deps = [
     ":video_coding_utility",
+    "../..:webrtc_common",
     "../../common_video",
     "../../system_wrappers",
   ]
diff --git a/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi b/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi
index f7ad56e..53dc8e6 100644
--- a/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi
+++ b/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi
@@ -17,6 +17,7 @@
             'video_codecs_test_framework',
             'webrtc_video_coding',
             '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
+            '<(webrtc_root)/common.gyp:webrtc_common',
             '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
             '<(webrtc_root)/test/metrics.gyp:metrics',
             '<(webrtc_vp8_dir)/vp8.gyp:webrtc_vp8',
diff --git a/webrtc/modules/video_coding/codecs/vp8/vp8.gyp b/webrtc/modules/video_coding/codecs/vp8/vp8.gyp
index 3401f48..c92509c 100644
--- a/webrtc/modules/video_coding/codecs/vp8/vp8.gyp
+++ b/webrtc/modules/video_coding/codecs/vp8/vp8.gyp
@@ -15,6 +15,7 @@
       'target_name': 'webrtc_vp8',
       'type': 'static_library',
       'dependencies': [
+        '<(webrtc_root)/common.gyp:webrtc_common',
         '<(webrtc_root)/common_video/common_video.gyp:common_video',
         '<(webrtc_root)/modules/video_coding/utility/video_coding_utility.gyp:video_coding_utility',
         '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
diff --git a/webrtc/modules/video_coding/video_coding_test.gypi b/webrtc/modules/video_coding/video_coding_test.gypi
index c990c3a..07ebdff 100644
--- a/webrtc/modules/video_coding/video_coding_test.gypi
+++ b/webrtc/modules/video_coding/video_coding_test.gypi
@@ -17,6 +17,7 @@
          'webrtc_utility',
          '<(DEPTH)/testing/gtest.gyp:gtest',
          '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
+         '<(webrtc_root)/common.gyp:webrtc_common',
          '<(webrtc_root)/test/test.gyp:test_support',
          '<(webrtc_root)/test/metrics.gyp:metrics',
          '<(webrtc_root)/common_video/common_video.gyp:common_video',
diff --git a/webrtc/modules/video_render/BUILD.gn b/webrtc/modules/video_render/BUILD.gn
index 4112c05..1e3e3e5 100644
--- a/webrtc/modules/video_render/BUILD.gn
+++ b/webrtc/modules/video_render/BUILD.gn
@@ -23,6 +23,7 @@
   ]
 
   deps = [
+    "../..:webrtc_common",
     "../../common_video",
     "../../system_wrappers",
     "../utility",
@@ -87,6 +88,8 @@
         "linux/video_x11_render.h",
       ]
 
+      deps += [ "../..:webrtc_common" ]
+
       libs += [ "Xext" ]
     }
     if (is_mac) {
@@ -160,6 +163,8 @@
         "ios/video_render_ios_view.mm",
       ]
 
+      deps += [ "../..:webrtc_common" ]
+
       cflags += [ "-fobjc-arc" ]  # CLANG_ENABLE_OBJC_ARC = YES.
     }
 
diff --git a/webrtc/modules/video_render/video_render.gypi b/webrtc/modules/video_render/video_render.gypi
index ba37005..12ef354 100644
--- a/webrtc/modules/video_render/video_render.gypi
+++ b/webrtc/modules/video_render/video_render.gypi
@@ -17,6 +17,7 @@
       'type': 'static_library',
       'dependencies': [
         'webrtc_utility',
+        '<(webrtc_root)/common.gyp:webrtc_common',
         '<(webrtc_root)/common_video/common_video.gyp:common_video',
         '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
       ],
@@ -56,6 +57,7 @@
           'target_name': 'video_render_module_internal_impl',
           'type': 'static_library',
           'dependencies': [
+            '<(webrtc_root)/common.gyp:webrtc_common',
             'video_render_module',
           ],
           'sources': [
@@ -163,6 +165,7 @@
           'dependencies': [
             'video_render_module_internal_impl',
             'webrtc_utility',
+            '<(webrtc_root)/common.gyp:webrtc_common',
             '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
             '<(webrtc_root)/common_video/common_video.gyp:common_video',
           ],