Moved ByteBuffer/BitBuffer into rtc_base_approved.

Also pulls in constructormagic.h, byteorder.h, and basictypes.h.

BUG=
R=pthatcher@webrtc.org

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

Cr-Commit-Position: refs/heads/master@{#9062}
diff --git a/webrtc/base/BUILD.gn b/webrtc/base/BUILD.gn
index 6d05504..363f8c3 100644
--- a/webrtc/base/BUILD.gn
+++ b/webrtc/base/BUILD.gn
@@ -105,8 +105,13 @@
   public_configs = [ "..:common_inherited_config" ]
 
   sources = [
+    "bitbuffer.cc",
+    "bitbuffer.h",
     "buffer.cc",
     "buffer.h",
+    "bytebuffer.cc",
+    "bytebuffer.h",
+    "byteorder.h",
     "checks.cc",
     "checks.h",
     "event.cc",
@@ -136,6 +141,18 @@
     "timeutils.h",
     "trace_event.h",
   ]
+
+  if (build_with_chromium) {
+    sources += [
+      "../overrides/webrtc/base/basictypes.h",
+      "../overrides/webrtc/base/constructormagic.h",
+    ]
+  } else {
+    sources += [
+      "basictypes.h",
+      "constructormagic.h",
+    ]
+  }
 }
 
 static_library("rtc_base") {
@@ -181,11 +198,6 @@
     "base64.cc",
     "base64.h",
     "basicdefs.h",
-    "bitbuffer.cc",
-    "bitbuffer.h",
-    "bytebuffer.cc",
-    "bytebuffer.h",
-    "byteorder.h",
     "common.cc",
     "common.h",
     "cpumonitor.cc",
@@ -311,8 +323,6 @@
 
   if (build_with_chromium) {
     sources += [
-      "../overrides/webrtc/base/basictypes.h",
-      "../overrides/webrtc/base/constructormagic.h",
       "../overrides/webrtc/base/logging.cc",
       "../overrides/webrtc/base/logging.h",
     ]
@@ -337,12 +347,10 @@
       "atomicops.h",
       "bandwidthsmoother.cc",
       "bandwidthsmoother.h",
-      "basictypes.h",
       "bind.h",
       "bind.h.pump",
       "callback.h",
       "callback.h.pump",
-      "constructormagic.h",
       "filelock.cc",
       "filelock.h",
       "fileutils_mock.h",
diff --git a/webrtc/base/base.gyp b/webrtc/base/base.gyp
index 72f1b63..ce64bd0 100644
--- a/webrtc/base/base.gyp
+++ b/webrtc/base/base.gyp
@@ -29,10 +29,17 @@
       'target_name': 'rtc_base_approved',
       'type': 'static_library',
       'sources': [
+        'basictypes.h',
+        'bitbuffer.cc',
+        'bitbuffer.h',
         'buffer.cc',
         'buffer.h',
+        'bytebuffer.cc',
+        'bytebuffer.h',
+        'byteorder.h',
         'checks.cc',
         'checks.h',
+        'constructormagic.h',
         'event.cc',
         'event.h',
         'event_tracer.cc',
@@ -59,6 +66,24 @@
         'timeutils.cc',
         'timeutils.h',
         'trace_event.h',
+        '../overrides/webrtc/base/basictypes.h',
+        '../overrides/webrtc/base/constructormagic.h',
+      ],
+      'conditions': [
+        ['build_with_chromium==1', {
+          'include_dirs': [
+            '../overrides',
+          ],
+          'sources!': [
+            'basictypes.h',
+            'constructormagic.h',
+          ],
+        }, {
+          'sources!': [
+            '../overrides/webrtc/base/basictypes.h',
+            '../overrides/webrtc/base/constructormagic.h',
+          ],
+        }],
       ],
     },
     {
@@ -99,17 +124,10 @@
         'base64.cc',
         'base64.h',
         'basicdefs.h',
-        'basictypes.h',
         'bind.h',
         'bind.h.pump',
-        'bitbuffer.cc',
-        'bitbuffer.h',
-        'bytebuffer.cc',
-        'bytebuffer.h',
-        'byteorder.h',
         'callback.h',
         'callback.h.pump',
-        'constructormagic.h',
         'common.cc',
         'common.h',
         'cpumonitor.cc',
@@ -325,8 +343,6 @@
         'worker.h',
         'x11windowpicker.cc',
         'x11windowpicker.h',
-        '../overrides/webrtc/base/basictypes.h',
-        '../overrides/webrtc/base/constructormagic.h',
         '../overrides/webrtc/base/logging.cc',
         '../overrides/webrtc/base/logging.h',
         '../overrides/webrtc/base/win32socketinit.cc',
@@ -365,7 +381,6 @@
             'atomicops.h',
             'bandwidthsmoother.cc',
             'bandwidthsmoother.h',
-            'basictypes.h',
             'bind.h',
             'bind.h.pump',
             'callback.h',
@@ -479,8 +494,6 @@
             }],
           ],
           'sources!': [
-            '../overrides/webrtc/base/basictypes.h',
-            '../overrides/webrtc/base/constructormagic.h',
             '../overrides/webrtc/base/win32socketinit.cc',
             '../overrides/webrtc/base/logging.cc',
             '../overrides/webrtc/base/logging.h',