Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b"

This reverts commit 75d3e86468813c450c36d2320bbd7a8b2e2ba9c4.

Android mojo_shell fails to run.  It can'd find the
AndroidHandler class.  Unclear what part of this change is causing
this.  jamesr and I spent a while trying to figure out, but we're
reverting this for now to unblock the rest of the team working
on android development.

Hopefully the paris team will be able to bail us out here when
they wake. :)

R=jamesr@chromium.org,qsr@chromium.org,davemoore@chromium.org

Review URL: https://codereview.chromium.org/951673002
diff --git a/build/all.gyp b/build/all.gyp
index 8ad63b3..93cac8c 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -519,6 +519,7 @@
           'target_name': 'chromium_builder_nacl_win_integration',
           'type': 'none',
           'dependencies': [
+            'chromium_builder_qa', # needed for pyauto
             'chromium_builder_tests',
           ],
         }, # target_name: chromium_builder_nacl_win_integration
@@ -635,10 +636,42 @@
           ],
         }, # target_name: chromium_gpu_debug_builder
         {
+          'target_name': 'chromium_builder_qa',
+          'type': 'none',
+          'dependencies': [
+            '../chrome/chrome.gyp:chrome',
+            # Dependencies of pyauto_functional tests.
+            '../remoting/remoting.gyp:remoting_webapp',
+          ],
+          'conditions': [
+            ['OS=="mac"', {
+              'dependencies': [
+                '../remoting/remoting.gyp:remoting_me2me_host_archive',
+              ],
+            }],
+            ['OS=="win"', {
+              'dependencies': [
+                '../chrome/chrome.gyp:crash_service',
+              ],
+            }],
+            ['OS=="win" and target_arch=="ia32"', {
+              'dependencies': [
+                '../chrome/chrome.gyp:crash_service_win64',
+              ],
+            }],
+            ['OS=="win" and component != "shared_library" and wix_exists == "True" and sas_dll_exists == "True"', {
+              'dependencies': [
+                '../remoting/remoting.gyp:remoting_host_installation',
+              ],
+            }],
+          ],
+        }, # target_name: chromium_builder_qa
+        {
           'target_name': 'chromium_builder_perf_av',
           'type': 'none',
           'dependencies': [
             'blink_tests', # to run layout tests
+            'chromium_builder_qa',  # needed for perf pyauto tests
           ],
         },  # target_name: chromium_builder_perf_av
         {
@@ -1060,6 +1093,10 @@
           ],
         },
         {
+          'target_name': 'chromium_builder_win_cf',
+          'type': 'none',
+        },
+        {
           'target_name': 'chromium_builder_dbg_tsan_win',
           'type': 'none',
           'dependencies': [
diff --git a/build/android/android_exports.gyp b/build/android/android_exports.gyp
index bf3424d..c259eee 100644
--- a/build/android/android_exports.gyp
+++ b/build/android/android_exports.gyp
@@ -2,20 +2,13 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-# This target is only used when android_webview_build==1 - it implements a
-# whitelist for exported symbols to minimise the binary size and prevent us
-# accidentally exposing things we don't mean to expose.
-
 {
-  'variables': {
-    'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_webview_export_whitelist.lst',
-  },
   'targets': [
     {
       'target_name': 'android_exports',
       'type': 'none',
       'inputs': [
-        '<(DEPTH)/build/android/android_webview_export_whitelist.lst',
+        '<(DEPTH)/build/android/android_exports.lst',
       ],
       'outputs': [
         '<(android_linker_script)',
@@ -35,6 +28,9 @@
               # Only export symbols that are specified in version script.
               '-Wl,--version-script=<(android_linker_script)',
             ],
+            'ldflags!': [
+              '-Wl,--exclude-libs=ALL',
+            ],
           },
         }],
       ],
diff --git a/build/android/android_webview_export_whitelist.lst b/build/android/android_exports.lst
similarity index 72%
rename from build/android/android_webview_export_whitelist.lst
rename to build/android/android_exports.lst
index 2a56a75..6eee232 100644
--- a/build/android/android_webview_export_whitelist.lst
+++ b/build/android/android_exports.lst
@@ -2,8 +2,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-# Exports specification for android_webview_build==1, which uses a whitelist to
-# enforce only specific symbols being exported.
+# Default exports specification for chromium shared libraries on android.
 # Check ld version script manual:
 # https://sourceware.org/binutils/docs-2.24/ld/VERSION.html#VERSION
 
diff --git a/build/android/android_no_jni_exports.lst b/build/android/android_no_jni_exports.lst
deleted file mode 100644
index ffc6cf7..0000000
--- a/build/android/android_no_jni_exports.lst
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2014 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# This script makes all JNI exported symbols local, to prevent the JVM from
-# being able to find them, enforcing use of manual JNI function registration.
-# This is used for all Android binaries by default, unless they explicitly state
-# that they want JNI exported symbols to remain visible, as we need to ensure
-# the manual registration path is correct to maintain compatibility with the
-# crazy linker.
-# Check ld version script manual:
-# https://sourceware.org/binutils/docs-2.24/ld/VERSION.html#VERSION
-
-{
-  local:
-    Java_*;
-};
diff --git a/build/android/buildbot/bb_device_status_check.py b/build/android/buildbot/bb_device_status_check.py
index 3bec158..6de2723 100755
--- a/build/android/buildbot/bb_device_status_check.py
+++ b/build/android/buildbot/bb_device_status_check.py
@@ -337,12 +337,11 @@
         zip(*[DeviceInfo(dev, options) for dev in devices]))
 
   # Write device info to file for buildbot info display.
-  if os.path.exists('/home/chrome-bot'):
-    with open('/home/chrome-bot/.adb_device_info', 'w') as f:
-      for device in json_data:
-        f.write('%s %s %s %.1fC %s%%\n' % (device['serial'], device['type'],
-            device['build'], float(device['battery']['temperature']) / 10,
-            device['battery']['level']))
+  with open('/home/chrome-bot/.adb_device_info', 'w') as f:
+    for device in json_data:
+      f.write('%s %s %s %.1fC %s%%\n' % (device['serial'], device['type'],
+          device['build'], float(device['battery']['temperature']) / 10,
+          device['battery']['level']))
 
   err_msg = CheckForMissingDevices(options, devices) or []
 
diff --git a/build/android/findbugs_filter/findbugs_known_bugs.txt b/build/android/findbugs_filter/findbugs_known_bugs.txt
index 9afba51..09c12b2 100644
--- a/build/android/findbugs_filter/findbugs_known_bugs.txt
+++ b/build/android/findbugs_filter/findbugs_known_bugs.txt
@@ -5,4 +5,3 @@
 M D UuF: Unused public or protected field: org.chromium.chrome.browser.document.PendingDocumentData.webContents  In PendingDocumentData.java
 M D UuF: Unused public or protected field: org.chromium.chrome.browser.document.PendingDocumentData.originalIntent  In PendingDocumentData.java
 M D UuF: Unused public or protected field: org.chromium.chrome.browser.document.PendingDocumentData.url  In PendingDocumentData.java
-M D UuF: Unused public or protected field: org.chromium.chrome.browser.document.PendingDocumentData.requestId  In PendingDocumentData.java
diff --git a/build/android/provision_devices.py b/build/android/provision_devices.py
index 824e642..65054fe 100755
--- a/build/android/provision_devices.py
+++ b/build/android/provision_devices.py
@@ -178,7 +178,7 @@
     if options.disable_network:
       device_settings.ConfigureContentSettings(
           device, device_settings.NETWORK_DISABLED_SETTINGS)
-    if options.min_battery_level is not None:
+    if options.wait_for_battery:
       try:
         battery_info = device.old_interface.GetBatteryInfo()
       except Exception as e:
@@ -241,11 +241,24 @@
   logging.getLogger().addHandler(custom_handler)
   logging.getLogger().setLevel(logging.INFO)
 
+  # TODO(perezju): This script used to rely on the builder name to determine
+  # the desired device configuration for perf bots. To safely phase this out,
+  # we now:
+  # - expose these configuration settings as command line options
+  # - set default values for these options based on the builder name, thus
+  #   matching the previous behaviour of the script on all bots.
+  # - explicitly adding these options on the perf bots will also maintain the
+  #   script behaviour, namely:
+  #     --wait-for-battery --disable-network --disable-java-debug
+  # - after all perf-bot recipes are updated, we can remove the following
+  #   builder-name-sniffing code and replace |is_perf| with |False|.
+  is_perf = 'perf' in os.environ.get('BUILDBOT_BUILDERNAME', '').lower()
+
   # Recommended options on perf bots:
   # --disable-network
   #     TODO(tonyg): We eventually want network on. However, currently radios
   #     can cause perfbots to drain faster than they charge.
-  # --min-battery-level 95
+  # --wait-for-battery
   #     Some perf bots run benchmarks with USB charging disabled which leads
   #     to gradual draining of the battery. We must wait for a full charge
   #     before starting a run in order to keep the devices online.
@@ -261,15 +274,20 @@
                       help='when wiping the device, max number of seconds to'
                       ' wait after each reboot '
                       '(default: %s)' % _DEFAULT_TIMEOUTS.HELP_TEXT)
-  parser.add_argument('--min-battery-level', type=int, metavar='NUM',
-                      help='wait for the device to reach this minimum battery'
-                      ' level before trying to continue')
+  parser.add_argument('--wait-for-battery', action='store_true',
+                      default=is_perf,
+                      help='wait for the battery on the devices to charge')
+  parser.add_argument('--min-battery-level', default=95, type=int,
+                      metavar='NUM',
+                      help='when waiting for battery, minimum battery level'
+                      ' required to continue (default: %(default)s)')
   parser.add_argument('--disable-location', action='store_true',
                       help='disable Google location services on devices')
   parser.add_argument('--disable-network', action='store_true',
+                      default=is_perf,
                       help='disable network access on devices')
   parser.add_argument('--disable-java-debug', action='store_false',
-                      dest='enable_java_debug', default=True,
+                      dest='enable_java_debug', default=not is_perf,
                       help='disable Java property asserts and JNI checking')
   parser.add_argument('-t', '--target', default='Debug',
                       help='the build target (default: %(default)s)')
diff --git a/build/android/pylib/base/base_test_result.py b/build/android/pylib/base/base_test_result.py
index 58200f6..508b988 100644
--- a/build/android/pylib/base/base_test_result.py
+++ b/build/android/pylib/base/base_test_result.py
@@ -77,10 +77,6 @@
     """Get the test duration."""
     return self._duration
 
-  def SetLog(self, log):
-    """Set the test log."""
-    self._log = log
-
   def GetLog(self):
     """Get the test log."""
     return self._log
diff --git a/build/android/pylib/device/adb_wrapper.py b/build/android/pylib/device/adb_wrapper.py
index c954508..f29f5c7 100644
--- a/build/android/pylib/device/adb_wrapper.py
+++ b/build/android/pylib/device/adb_wrapper.py
@@ -299,14 +299,14 @@
           cmd, 'path does not specify an accessible directory in the device',
           device_serial=self._device_serial)
 
-  def Logcat(self, clear=False, dump=False, filter_specs=None,
+  def Logcat(self, clear=False, dump=False, filter_spec=None,
              logcat_format=None, timeout=None, retries=_DEFAULT_RETRIES):
     """Get an iterable over the logcat output.
 
     Args:
       clear: If true, clear the logcat.
       dump: If true, dump the current logcat contents.
-      filter_specs: If set, a list of specs to filter the logcat.
+      filter_spec: If set, spec to filter the logcat.
       logcat_format: If set, the format in which the logcat should be output.
         Options include "brief", "process", "tag", "thread", "raw", "time",
         "threadtime", and "long"
@@ -328,14 +328,14 @@
       use_iter = False
     if logcat_format:
       cmd.extend(['-v', logcat_format])
-    if filter_specs:
-      cmd.extend(filter_specs)
+    if filter_spec is not None:
+      cmd.append(filter_spec)
 
     if use_iter:
       return self._IterRunDeviceAdbCmd(cmd, timeout)
     else:
       timeout = timeout if timeout is not None else _DEFAULT_TIMEOUT
-      return self._RunDeviceAdbCmd(cmd, timeout, retries).splitlines()
+      return self._RunDeviceAdbCmd(cmd, timeout, retries)
 
   def Forward(self, local, remote, timeout=_DEFAULT_TIMEOUT,
               retries=_DEFAULT_RETRIES):
diff --git a/build/android/pylib/device/device_utils.py b/build/android/pylib/device/device_utils.py
index fb882e7..eba5e02 100644
--- a/build/android/pylib/device/device_utils.py
+++ b/build/android/pylib/device/device_utils.py
@@ -8,8 +8,6 @@
 """
 # pylint: disable=unused-argument
 
-import collections
-import itertools
 import logging
 import multiprocessing
 import os
@@ -1308,54 +1306,14 @@
       retries: number of retries
 
     Returns:
-      A dict containing memory usage statistics for the PID. May include:
-        Size, Rss, Pss, Shared_Clean, Shared_Dirty, Private_Clean,
-        Private_Dirty, VmHWM
+      A 2-tuple containing:
+        - A dict containing the overall memory usage statistics for the PID.
+        - A dict containing memory usage statistics broken down by mapping.
 
     Raises:
       CommandTimeoutError on timeout.
     """
-    result = collections.defaultdict(int)
-
-    try:
-      result.update(self._GetMemoryUsageForPidFromSmaps(pid))
-    except device_errors.CommandFailedError:
-      logging.exception('Error getting memory usage from smaps')
-
-    try:
-      result.update(self._GetMemoryUsageForPidFromStatus(pid))
-    except device_errors.CommandFailedError:
-      logging.exception('Error getting memory usage from status')
-
-    return result
-
-  def _GetMemoryUsageForPidFromSmaps(self, pid):
-    SMAPS_COLUMNS = (
-        'Size', 'Rss', 'Pss', 'Shared_Clean', 'Shared_Dirty', 'Private_Clean',
-        'Private_Dirty')
-
-    showmap_out = self.RunShellCommand(
-        ['showmap', str(pid)], as_root=True, check_return=True)
-    if not showmap_out:
-      raise device_errors.CommandFailedError('No output from showmap')
-
-    split_totals = showmap_out[-1].split()
-    if (not split_totals
-        or len(split_totals) != 9
-        or split_totals[-1] != 'TOTAL'):
-      raise device_errors.CommandFailedError(
-          'Invalid output from showmap: %s' % '\n'.join(showmap_out))
-
-    return dict(itertools.izip(SMAPS_COLUMNS, (int(n) for n in split_totals)))
-
-  def _GetMemoryUsageForPidFromStatus(self, pid):
-    for line in self.ReadFile(
-        '/proc/%s/status' % str(pid), as_root=True).splitlines():
-      if line.startswith('VmHWM:'):
-        return {'VmHWM': int(line.split()[1])}
-    else:
-      raise device_errors.CommandFailedError(
-          'Could not find memory peak value for pid %s', str(pid))
+    return self.old_interface.GetMemoryUsageForPid(pid)
 
   @decorators.WithTimeoutAndRetriesFromInstance()
   def GetLogcatMonitor(self, timeout=None, retries=None, *args, **kwargs):
@@ -1428,8 +1386,6 @@
     """
     if not devices:
       devices = adb_wrapper.AdbWrapper.GetDevices()
-      if not devices:
-        raise device_errors.NoDevicesError()
     devices = [d if isinstance(d, cls) else cls(d) for d in devices]
     if async:
       return parallelizer.Parallelizer(devices)
diff --git a/build/android/pylib/device/device_utils_test.py b/build/android/pylib/device/device_utils_test.py
index 3f4ef59..8a25f25 100755
--- a/build/android/pylib/device/device_utils_test.py
+++ b/build/android/pylib/device/device_utils_test.py
@@ -39,7 +39,7 @@
 import mock # pylint: disable=F0401
 
 
-class DeviceUtilsInitTest(unittest.TestCase):
+class DeviceUtilsTest(unittest.TestCase):
 
   def testInitWithStr(self):
     serial_as_str = str('0123456789abcdef')
@@ -121,6 +121,79 @@
     self.mocked = mocked
 
 
+class DeviceUtilsOldImplTest(unittest.TestCase):
+
+  class AndroidCommandsCalls(object):
+
+    def __init__(self, test_case, cmd_ret, comp):
+      self._cmds = cmd_ret
+      self._comp = comp
+      self._run_command = _PatchedFunction()
+      self._test_case = test_case
+      self._total_received = 0
+
+    def __enter__(self):
+      self._run_command.patched = mock.patch(
+          'run_command.RunCommand',
+          side_effect=lambda c, **kw: self._ret(c))
+      self._run_command.mocked = self._run_command.patched.__enter__()
+
+    def _ret(self, actual_cmd):
+      if sys.exc_info()[0] is None:
+        on_failure_fmt = ('\n'
+                          '  received command: %s\n'
+                          '  expected command: %s')
+        self._test_case.assertGreater(
+            len(self._cmds), self._total_received,
+            msg=on_failure_fmt % (actual_cmd, None))
+        expected_cmd, ret = self._cmds[self._total_received]
+        self._total_received += 1
+        self._test_case.assertTrue(
+            self._comp(expected_cmd, actual_cmd),
+            msg=on_failure_fmt % (actual_cmd, expected_cmd))
+        return ret
+      return ''
+
+    def __exit__(self, exc_type, exc_val, exc_tb):
+      self._run_command.patched.__exit__(exc_type, exc_val, exc_tb)
+      if exc_type is None:
+        on_failure = "adb commands don't match.\nExpected:%s\nActual:%s" % (
+            ''.join('\n  %s' % c for c, _ in self._cmds),
+            ''.join('\n  %s' % a[0]
+                    for _, a, kw in self._run_command.mocked.mock_calls))
+        self._test_case.assertEqual(
+          len(self._cmds), len(self._run_command.mocked.mock_calls),
+          msg=on_failure)
+        for (expected_cmd, _r), (_n, actual_args, actual_kwargs) in zip(
+            self._cmds, self._run_command.mocked.mock_calls):
+          self._test_case.assertEqual(1, len(actual_args), msg=on_failure)
+          self._test_case.assertTrue(self._comp(expected_cmd, actual_args[0]),
+                                     msg=on_failure)
+          self._test_case.assertTrue('timeout_time' in actual_kwargs,
+                                     msg=on_failure)
+          self._test_case.assertTrue('retry_count' in actual_kwargs,
+                                     msg=on_failure)
+
+  def assertNoAdbCalls(self):
+    return type(self).AndroidCommandsCalls(self, [], str.__eq__)
+
+  def assertCalls(self, cmd, ret, comp=str.__eq__):
+    return type(self).AndroidCommandsCalls(self, [(cmd, ret)], comp)
+
+  def assertCallsSequence(self, cmd_ret, comp=str.__eq__):
+    return type(self).AndroidCommandsCalls(self, cmd_ret, comp)
+
+  def setUp(self):
+    self._get_adb_path_patch = mock.patch('pylib.constants.GetAdbPath',
+                                          mock.Mock(return_value='adb'))
+    self._get_adb_path_patch.start()
+    self.device = device_utils.DeviceUtils(
+        '0123456789abcdef', default_timeout=1, default_retries=0)
+
+  def tearDown(self):
+    self._get_adb_path_patch.stop()
+
+
 def _AdbWrapperMock(test_serial):
   adb = mock.Mock(spec=adb_wrapper.AdbWrapper)
   adb.__str__ = mock.Mock(return_value=test_serial)
@@ -128,7 +201,7 @@
   return adb
 
 
-class DeviceUtilsTest(mock_calls.TestCase):
+class DeviceUtilsNewImplTest(mock_calls.TestCase):
 
   def setUp(self):
     self.adb = _AdbWrapperMock('0123456789abcdef')
@@ -157,7 +230,7 @@
         msg, str(self.device)))
 
 
-class DeviceUtilsIsOnlineTest(DeviceUtilsTest):
+class DeviceUtilsIsOnlineTest(DeviceUtilsNewImplTest):
 
   def testIsOnline_true(self):
     with self.assertCall(self.call.adb.GetState(), 'device'):
@@ -172,7 +245,7 @@
       self.assertFalse(self.device.IsOnline())
 
 
-class DeviceUtilsHasRootTest(DeviceUtilsTest):
+class DeviceUtilsHasRootTest(DeviceUtilsNewImplTest):
 
   def testHasRoot_true(self):
     with self.assertCall(self.call.adb.Shell('ls /root'), 'foo\n'):
@@ -183,7 +256,7 @@
       self.assertFalse(self.device.HasRoot())
 
 
-class DeviceUtilsEnableRootTest(DeviceUtilsTest):
+class DeviceUtilsEnableRootTest(DeviceUtilsNewImplTest):
 
   def testEnableRoot_succeeds(self):
     with self.assertCalls(
@@ -206,7 +279,7 @@
         self.device.EnableRoot()
 
 
-class DeviceUtilsIsUserBuildTest(DeviceUtilsTest):
+class DeviceUtilsIsUserBuildTest(DeviceUtilsNewImplTest):
 
   def testIsUserBuild_yes(self):
     with self.assertCall(
@@ -219,7 +292,7 @@
       self.assertFalse(self.device.IsUserBuild())
 
 
-class DeviceUtilsGetExternalStoragePathTest(DeviceUtilsTest):
+class DeviceUtilsGetExternalStoragePathTest(DeviceUtilsNewImplTest):
 
   def testGetExternalStoragePath_succeeds(self):
     with self.assertCall(
@@ -233,7 +306,7 @@
         self.device.GetExternalStoragePath()
 
 
-class DeviceUtilsGetApplicationPathTest(DeviceUtilsTest):
+class DeviceUtilsGetApplicationPathTest(DeviceUtilsNewImplTest):
 
   def testGetApplicationPath_exists(self):
     with self.assertCalls(
@@ -260,7 +333,7 @@
 
 
 @mock.patch('time.sleep', mock.Mock())
-class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsTest):
+class DeviceUtilsWaitUntilFullyBootedTest(DeviceUtilsNewImplTest):
 
   def testWaitUntilFullyBooted_succeedsNoWifi(self):
     with self.assertCalls(
@@ -370,7 +443,7 @@
 
 
 @mock.patch('time.sleep', mock.Mock())
-class DeviceUtilsRebootTest(DeviceUtilsTest):
+class DeviceUtilsRebootTest(DeviceUtilsNewImplTest):
 
   def testReboot_nonBlocking(self):
     with self.assertCalls(
@@ -396,7 +469,7 @@
       self.device.Reboot(block=True, wifi=True)
 
 
-class DeviceUtilsInstallTest(DeviceUtilsTest):
+class DeviceUtilsInstallTest(DeviceUtilsNewImplTest):
 
   def testInstall_noPriorInstall(self):
     with self.assertCalls(
@@ -453,7 +526,7 @@
         self.device.Install('/fake/test/app.apk', retries=0)
 
 
-class DeviceUtilsRunShellCommandTest(DeviceUtilsTest):
+class DeviceUtilsRunShellCommandTest(DeviceUtilsNewImplTest):
 
   def setUp(self):
     super(DeviceUtilsRunShellCommandTest, self).setUp()
@@ -583,7 +656,7 @@
                         self.device.RunShellCommand(cmd, check_return=False))
 
 
-class DeviceUtilsGetDevicePieWrapper(DeviceUtilsTest):
+class DeviceUtilsGetDevicePieWrapper(DeviceUtilsNewImplTest):
 
   def testGetDevicePieWrapper_jb(self):
     with self.assertCall(
@@ -602,7 +675,7 @@
 
 
 @mock.patch('time.sleep', mock.Mock())
-class DeviceUtilsKillAllTest(DeviceUtilsTest):
+class DeviceUtilsKillAllTest(DeviceUtilsNewImplTest):
 
   def testKillAll_noMatchingProcesses(self):
     with self.assertCall(self.call.adb.Shell('ps'),
@@ -653,7 +726,7 @@
           self.device.KillAll('some.process', signum=signal.SIGTERM))
 
 
-class DeviceUtilsStartActivityTest(DeviceUtilsTest):
+class DeviceUtilsStartActivityTest(DeviceUtilsNewImplTest):
 
   def testStartActivity_actionOnly(self):
     test_intent = intent.Intent(action='android.intent.action.VIEW')
@@ -817,7 +890,7 @@
       self.device.StartActivity(test_intent)
 
 
-class DeviceUtilsStartInstrumentationTest(DeviceUtilsTest):
+class DeviceUtilsStartInstrumentationTest(DeviceUtilsNewImplTest):
 
   def testStartInstrumentation_nothing(self):
     with self.assertCalls(
@@ -859,7 +932,7 @@
           finish=False, raw=False, extras={'foo': 'Foo', 'bar': 'Bar'})
 
 
-class DeviceUtilsBroadcastIntentTest(DeviceUtilsTest):
+class DeviceUtilsBroadcastIntentTest(DeviceUtilsNewImplTest):
 
   def testBroadcastIntent_noExtras(self):
     test_intent = intent.Intent(action='test.package.with.an.INTENT')
@@ -887,7 +960,7 @@
       self.device.BroadcastIntent(test_intent)
 
 
-class DeviceUtilsGoHomeTest(DeviceUtilsTest):
+class DeviceUtilsGoHomeTest(DeviceUtilsNewImplTest):
 
   def testGoHome(self):
     with self.assertCall(
@@ -897,7 +970,7 @@
       self.device.GoHome()
 
 
-class DeviceUtilsForceStopTest(DeviceUtilsTest):
+class DeviceUtilsForceStopTest(DeviceUtilsNewImplTest):
 
   def testForceStop(self):
     with self.assertCall(
@@ -906,7 +979,7 @@
       self.device.ForceStop('this.is.a.test.package')
 
 
-class DeviceUtilsClearApplicationStateTest(DeviceUtilsTest):
+class DeviceUtilsClearApplicationStateTest(DeviceUtilsNewImplTest):
 
   def testClearApplicationState_packageDoesntExist(self):
     with self.assertCalls(
@@ -939,14 +1012,14 @@
       self.device.ClearApplicationState('this.package.exists')
 
 
-class DeviceUtilsSendKeyEventTest(DeviceUtilsTest):
+class DeviceUtilsSendKeyEventTest(DeviceUtilsNewImplTest):
 
   def testSendKeyEvent(self):
     with self.assertCall(self.call.adb.Shell('input keyevent 66'), ''):
       self.device.SendKeyEvent(66)
 
 
-class DeviceUtilsPushChangedFilesIndividuallyTest(DeviceUtilsTest):
+class DeviceUtilsPushChangedFilesIndividuallyTest(DeviceUtilsNewImplTest):
 
   def testPushChangedFilesIndividually_empty(self):
     test_files = []
@@ -968,7 +1041,7 @@
       self.device._PushChangedFilesIndividually(test_files)
 
 
-class DeviceUtilsPushChangedFilesZippedTest(DeviceUtilsTest):
+class DeviceUtilsPushChangedFilesZippedTest(DeviceUtilsNewImplTest):
 
   def testPushChangedFilesZipped_empty(self):
     test_files = []
@@ -1007,7 +1080,7 @@
          ('/test/host/path/file2', '/test/device/path/file2')])
 
 
-class DeviceUtilsFileExistsTest(DeviceUtilsTest):
+class DeviceUtilsFileExistsTest(DeviceUtilsNewImplTest):
 
   def testFileExists_usingTest_fileExists(self):
     with self.assertCall(
@@ -1023,7 +1096,7 @@
       self.assertFalse(self.device.FileExists('/does/not/exist'))
 
 
-class DeviceUtilsPullFileTest(DeviceUtilsTest):
+class DeviceUtilsPullFileTest(DeviceUtilsNewImplTest):
 
   def testPullFile_existsOnDevice(self):
     with mock.patch('os.path.exists', return_value=True):
@@ -1044,7 +1117,7 @@
                                '/test/file/host/path')
 
 
-class DeviceUtilsReadFileTest(DeviceUtilsTest):
+class DeviceUtilsReadFileTest(DeviceUtilsNewImplTest):
 
   def testReadFile_exists(self):
     with self.assertCall(
@@ -1072,7 +1145,7 @@
                                as_root=True))
 
 
-class DeviceUtilsWriteFileTest(DeviceUtilsTest):
+class DeviceUtilsWriteFileTest(DeviceUtilsNewImplTest):
 
   def testWriteFileWithPush_success(self):
     tmp_host = MockTempFile('/tmp/file/on.host')
@@ -1135,7 +1208,7 @@
       self.device.WriteFile('/test/file', 'contents', as_root=True)
 
 
-class DeviceUtilsLsTest(DeviceUtilsTest):
+class DeviceUtilsLsTest(DeviceUtilsNewImplTest):
 
   def testLs_directory(self):
     result = [('.', adb_wrapper.DeviceStat(16889, 4096, 1417436123)),
@@ -1153,7 +1226,7 @@
                         self.device.Ls('/data/local/tmp/testfile.txt'))
 
 
-class DeviceUtilsStatTest(DeviceUtilsTest):
+class DeviceUtilsStatTest(DeviceUtilsNewImplTest):
 
   def testStat_file(self):
     result = [('.', adb_wrapper.DeviceStat(16889, 4096, 1417436123)),
@@ -1183,7 +1256,7 @@
         self.device.Stat('/data/local/tmp/does.not.exist.txt')
 
 
-class DeviceUtilsSetJavaAssertsTest(DeviceUtilsTest):
+class DeviceUtilsSetJavaAssertsTest(DeviceUtilsNewImplTest):
 
   def testSetJavaAsserts_enable(self):
     with self.assertCalls(
@@ -1223,7 +1296,7 @@
       self.assertFalse(self.device.SetJavaAsserts(True))
 
 
-class DeviceUtilsGetPropTest(DeviceUtilsTest):
+class DeviceUtilsGetPropTest(DeviceUtilsNewImplTest):
 
   def testGetProp_exists(self):
     with self.assertCall(
@@ -1257,7 +1330,7 @@
                                            cache=True, retries=3))
 
 
-class DeviceUtilsSetPropTest(DeviceUtilsTest):
+class DeviceUtilsSetPropTest(DeviceUtilsNewImplTest):
 
   def testSetProp(self):
     with self.assertCall(
@@ -1278,7 +1351,7 @@
         self.device.SetProp('test.property', 'new_value', check=True)
 
 
-class DeviceUtilsGetPidsTest(DeviceUtilsTest):
+class DeviceUtilsGetPidsTest(DeviceUtilsNewImplTest):
 
   def testGetPids_noMatches(self):
     with self.assertCall(self.call.adb.Shell('ps'),
@@ -1314,7 +1387,7 @@
           self.device.GetPids('exact.match'))
 
 
-class DeviceUtilsTakeScreenshotTest(DeviceUtilsTest):
+class DeviceUtilsTakeScreenshotTest(DeviceUtilsNewImplTest):
 
   def testTakeScreenshot_fileNameProvided(self):
     with self.assertCalls(
@@ -1328,18 +1401,22 @@
       self.device.TakeScreenshot('/test/host/screenshot.png')
 
 
-class DeviceUtilsGetMemoryUsageForPidTest(DeviceUtilsTest):
+class DeviceUtilsGetMemoryUsageForPidTest(DeviceUtilsOldImplTest):
 
   def setUp(self):
     super(DeviceUtilsGetMemoryUsageForPidTest, self).setUp()
+    self.device.old_interface._privileged_command_runner = (
+        self.device.old_interface.RunShellCommand)
+    self.device.old_interface._protected_file_access_method_initialized = True
 
   def testGetMemoryUsageForPid_validPid(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['showmap', '1234'], as_root=True, check_return=True),
-         ['100 101 102 103 104 105 106 107 TOTAL']),
-        (self.call.device.ReadFile('/proc/1234/status', as_root=True),
-         'VmHWM: 1024 kB\n')):
+    with self.assertCallsSequence([
+        ("adb -s 0123456789abcdef shell 'showmap 1234'",
+         '100 101 102 103 104 105 106 107 TOTAL\r\n'),
+        ("adb -s 0123456789abcdef shell "
+            "'cat \"/proc/1234/status\" 2> /dev/null'",
+         'VmHWM: 1024 kB')
+        ]):
       self.assertEqual(
           {
             'Size': 100,
@@ -1353,36 +1430,14 @@
           },
           self.device.GetMemoryUsageForPid(1234))
 
-  def testGetMemoryUsageForPid_noSmaps(self):
+  def testGetMemoryUsageForPid_invalidPid(self):
     with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['showmap', '4321'], as_root=True, check_return=True),
-         ['cannot open /proc/4321/smaps: No such file or directory']),
-        (self.call.device.ReadFile('/proc/4321/status', as_root=True),
-         'VmHWM: 1024 kb\n')):
-      self.assertEquals({'VmHWM': 1024}, self.device.GetMemoryUsageForPid(4321))
-
-  def testGetMemoryUsageForPid_noStatus(self):
-    with self.assertCalls(
-        (self.call.device.RunShellCommand(
-            ['showmap', '4321'], as_root=True, check_return=True),
-         ['100 101 102 103 104 105 106 107 TOTAL']),
-        (self.call.device.ReadFile('/proc/4321/status', as_root=True),
-         self.CommandError())):
-      self.assertEquals(
-          {
-            'Size': 100,
-            'Rss': 101,
-            'Pss': 102,
-            'Shared_Clean': 103,
-            'Shared_Dirty': 104,
-            'Private_Clean': 105,
-            'Private_Dirty': 106,
-          },
-          self.device.GetMemoryUsageForPid(4321))
+        "adb -s 0123456789abcdef shell 'showmap 4321'",
+        'cannot open /proc/4321/smaps: No such file or directory\r\n'):
+      self.assertEqual({}, self.device.GetMemoryUsageForPid(4321))
 
 
-class DeviceUtilsStrTest(DeviceUtilsTest):
+class DeviceUtilsStrTest(DeviceUtilsNewImplTest):
 
   def testStr_returnsSerial(self):
     with self.assertCalls(
@@ -1404,12 +1459,6 @@
           and serial == str(device),
           'Expected a DeviceUtils object with serial %s' % serial)
 
-  def testParallel_noDevices(self):
-    with self.assertCall(
-        mock.call.pylib.device.adb_wrapper.AdbWrapper.GetDevices(), []):
-      with self.assertRaises(device_errors.NoDevicesError):
-        device_utils.DeviceUtils.parallel()
-
 
 if __name__ == '__main__':
   logging.getLogger().setLevel(logging.DEBUG)
diff --git a/build/android/pylib/device/logcat_monitor.py b/build/android/pylib/device/logcat_monitor.py
index 1d4cc24..7ede49c 100644
--- a/build/android/pylib/device/logcat_monitor.py
+++ b/build/android/pylib/device/logcat_monitor.py
@@ -22,20 +22,18 @@
   # Format: <DATE> <TIME> <PID> <TID> <LEVEL> <COMPONENT>: <MESSAGE>
   _THREADTIME_RE_FORMAT = r'\S* +\S* +(%s) +(%s) +(%s) +(%s): +(%s)$'
 
-  def __init__(self, adb, clear=True, filter_specs=None):
+  def __init__(self, adb, clear=True):
     """Create a LogcatMonitor instance.
 
     Args:
       adb: An instance of adb_wrapper.AdbWrapper.
       clear: If True, clear the logcat when monitoring starts.
-      filter_specs: An optional list of '<tag>[:priority]' strings.
     """
     if isinstance(adb, adb_wrapper.AdbWrapper):
       self._adb = adb
     else:
       raise ValueError('Unsupported type passed for argument "device"')
     self._clear = clear
-    self._filter_specs = filter_specs
     self._logcat_out = None
     self._logcat_out_file = None
     self._logcat_proc = None
@@ -78,7 +76,7 @@
     #    returned.
     #  - failure_regex matches a line, in which case None is returned
     #  - the timeout is hit, in which case a CommandTimeoutError is raised.
-    for l in self._adb.Logcat(filter_specs=self._filter_specs):
+    for l in self._adb.Logcat():
       m = success_regex.search(l)
       if m:
         return m
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py
index 3f56e6d..45e6ee4 100644
--- a/build/android/pylib/instrumentation/instrumentation_test_instance.py
+++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py
@@ -23,10 +23,6 @@
     os.path.join(constants.DIR_SOURCE_ROOT, 'build', 'util', 'lib', 'common'))
 import unittest_util
 
-# Ref: http://developer.android.com/reference/android/app/Activity.html
-_ACTIVITY_RESULT_CANCELED = 0
-_ACTIVITY_RESULT_OK = -1
-
 _DEFAULT_ANNOTATIONS = [
     'Smoke', 'SmallTest', 'MediumTest', 'LargeTest',
     'EnormousTest', 'IntegrationTest']
@@ -58,69 +54,48 @@
   return (code, bundle, statuses)
 
 
-def GenerateTestResults(
-    result_code, result_bundle, statuses, start_ms, duration_ms):
-  """Generate test results from |statuses|.
+def GenerateTestResult(test_name, instr_statuses, start_ms, duration_ms):
+  """Generate the result of |test| from |instr_statuses|.
 
   Args:
-    result_code: The overall status code as an integer.
-    result_bundle: The summary bundle dump as a dict.
-    statuses: A list of 2-tuples containing:
+    test_name: The name of the test as "class#method"
+    instr_statuses: A list of 2-tuples containing:
       - the status code as an integer
       - the bundle dump as a dict mapping string keys to string values
       Note that this is the same as the third item in the 3-tuple returned by
       |_ParseAmInstrumentRawOutput|.
     start_ms: The start time of the test in milliseconds.
     duration_ms: The duration of the test in milliseconds.
-
   Returns:
-    A list containing an instance of InstrumentationTestResult for each test
-    parsed.
+    An InstrumentationTestResult object.
   """
+  log = ''
+  result_type = base_test_result.ResultType.UNKNOWN
 
-  results = []
-
-  current_result = None
-
-  for status_code, bundle in statuses:
-    test_class = bundle.get('class', '')
-    test_method = bundle.get('test', '')
-    if test_class and test_method:
-      test_name = '%s#%s' % (test_class, test_method)
-    else:
-      continue
-
+  for status_code, bundle in instr_statuses:
     if status_code == instrumentation_parser.STATUS_CODE_START:
-      if current_result:
-        results.append(current_result)
-      current_result = test_result.InstrumentationTestResult(
-          test_name, base_test_result.ResultType.UNKNOWN, start_ms, duration_ms)
+      pass
+    elif status_code == instrumentation_parser.STATUS_CODE_OK:
+      bundle_test = '%s#%s' % (bundle.get('class', ''), bundle.get('test', ''))
+      skipped = bundle.get('test_skipped', '')
+
+      if (test_name == bundle_test and
+          result_type == base_test_result.ResultType.UNKNOWN):
+        result_type = base_test_result.ResultType.PASS
+      elif skipped.lower() in ('true', '1', 'yes'):
+        result_type = base_test_result.ResultType.SKIP
+        logging.info('Skipped ' + test_name)
     else:
-      if status_code == instrumentation_parser.STATUS_CODE_OK:
-        if bundle.get('test_skipped', '').lower() in ('true', '1', 'yes'):
-          current_result.SetType(base_test_result.ResultType.SKIP)
-        elif current_result.GetType() == base_test_result.ResultType.UNKNOWN:
-          current_result.SetType(base_test_result.ResultType.PASS)
-      else:
-        if status_code not in (instrumentation_parser.STATUS_CODE_ERROR,
-                               instrumentation_parser.STATUS_CODE_FAILURE):
-          logging.error('Unrecognized status code %d. Handling as an error.',
-                        status_code)
-        current_result.SetType(base_test_result.ResultType.FAIL)
-        if 'stack' in bundle:
-          current_result.SetLog(bundle['stack'])
+      if status_code not in (instrumentation_parser.STATUS_CODE_ERROR,
+                             instrumentation_parser.STATUS_CODE_FAILURE):
+        logging.error('Unrecognized status code %d. Handling as an error.',
+                      status_code)
+      result_type = base_test_result.ResultType.FAIL
+      if 'stack' in bundle:
+        log = bundle['stack']
 
-  if current_result:
-    if current_result.GetType() == base_test_result.ResultType.UNKNOWN:
-      crashed = (result_code == _ACTIVITY_RESULT_CANCELED
-                 and any(_NATIVE_CRASH_RE.search(l)
-                         for l in result_bundle.itervalues()))
-      if crashed:
-        current_result.SetType(base_test_result.ResultType.CRASH)
-
-    results.append(current_result)
-
-  return results
+  return test_result.InstrumentationTestResult(
+      test_name, result_type, start_ms, duration_ms, log=log)
 
 
 class InstrumentationTestInstance(test_instance.TestInstance):
@@ -446,14 +421,37 @@
     return inflated_tests
 
   @staticmethod
+  def GenerateMultiTestResult(errors, statuses):
+    results = []
+    skip_counter = 1
+    for status_code, bundle in statuses:
+      if status_code != instrumentation_parser.STATUS_CODE_START:
+        # TODO(rnephew): Make skipped tests still output test name. This is only
+        # there to give skipped tests a unique name so they are counted
+        if 'test_skipped' in bundle:
+          test_name = str(skip_counter)
+          skip_counter += 1
+        else:
+          test_name = '%s#%s' % (bundle.get('class', ''),
+                                 bundle.get('test', ''))
+
+        results.append(
+            GenerateTestResult(test_name, [(status_code, bundle)], 0, 0))
+    for error in errors.itervalues():
+      if _NATIVE_CRASH_RE.search(error):
+        results.append(
+            base_test_result.BaseTestResult(
+            'Crash detected', base_test_result.ResultType.CRASH))
+
+    return results
+
+  @staticmethod
   def ParseAmInstrumentRawOutput(raw_output):
     return ParseAmInstrumentRawOutput(raw_output)
 
   @staticmethod
-  def GenerateTestResults(
-      result_code, result_bundle, statuses, start_ms, duration_ms):
-    return GenerateTestResults(result_code, result_bundle, statuses,
-                               start_ms, duration_ms)
+  def GenerateTestResult(test_name, instr_statuses, start_ms, duration_ms):
+    return GenerateTestResult(test_name, instr_statuses, start_ms, duration_ms)
 
   #override
   def TearDown(self):
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance_test.py b/build/android/pylib/instrumentation/instrumentation_test_instance_test.py
index 752e4d3..693f175 100755
--- a/build/android/pylib/instrumentation/instrumentation_test_instance_test.py
+++ b/build/android/pylib/instrumentation/instrumentation_test_instance_test.py
@@ -27,12 +27,15 @@
     options = mock.Mock()
     options.tool = ''
 
-  def testGenerateTestResults_noStatus(self):
-    results = instrumentation_test_instance.GenerateTestResults(
-        None, None, [], 0, 1000)
-    self.assertEqual([], results)
+  def testGenerateTestResult_noStatus(self):
+    result = instrumentation_test_instance.GenerateTestResult(
+        'test.package.TestClass#testMethod', [], 0, 1000)
+    self.assertEqual('test.package.TestClass#testMethod', result.GetName())
+    self.assertEqual(base_test_result.ResultType.UNKNOWN, result.GetType())
+    self.assertEqual('', result.GetLog())
+    self.assertEqual(1000, result.GetDuration())
 
-  def testGenerateTestResults_testPassed(self):
+  def testGenerateTestResult_testPassed(self):
     statuses = [
       (1, {
         'class': 'test.package.TestClass',
@@ -43,52 +46,65 @@
         'test': 'testMethod',
       }),
     ]
-    results = instrumentation_test_instance.GenerateTestResults(
-        None, None, statuses, 0, 1000)
-    self.assertEqual(1, len(results))
-    self.assertEqual(base_test_result.ResultType.PASS, results[0].GetType())
+    result = instrumentation_test_instance.GenerateTestResult(
+        'test.package.TestClass#testMethod', statuses, 0, 1000)
+    self.assertEqual(base_test_result.ResultType.PASS, result.GetType())
 
-  def testGenerateTestResults_testSkipped_true(self):
+  def testGenerateTestResult_testSkipped_first(self):
+    statuses = [
+      (0, {
+        'test_skipped': 'true',
+      }),
+      (1, {
+        'class': 'test.package.TestClass',
+        'test': 'testMethod',
+      }),
+      (0, {
+        'class': 'test.package.TestClass',
+        'test': 'testMethod',
+      }),
+    ]
+    result = instrumentation_test_instance.GenerateTestResult(
+        'test.package.TestClass#testMethod', statuses, 0, 1000)
+    self.assertEqual(base_test_result.ResultType.SKIP, result.GetType())
+
+  def testGenerateTestResult_testSkipped_last(self):
     statuses = [
       (1, {
         'class': 'test.package.TestClass',
         'test': 'testMethod',
       }),
       (0, {
+        'class': 'test.package.TestClass',
+        'test': 'testMethod',
+      }),
+      (0, {
         'test_skipped': 'true',
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
-      }),
-      (0, {
-        'class': 'test.package.TestClass',
-        'test': 'testMethod',
       }),
     ]
-    results = instrumentation_test_instance.GenerateTestResults(
-        None, None, statuses, 0, 1000)
-    self.assertEqual(1, len(results))
-    self.assertEqual(base_test_result.ResultType.SKIP, results[0].GetType())
+    result = instrumentation_test_instance.GenerateTestResult(
+        'test.package.TestClass#testMethod', statuses, 0, 1000)
+    self.assertEqual(base_test_result.ResultType.SKIP, result.GetType())
 
-  def testGenerateTestResults_testSkipped_false(self):
+  def testGenerateTestResult_testSkipped_false(self):
     statuses = [
+      (0, {
+        'test_skipped': 'false',
+      }),
       (1, {
         'class': 'test.package.TestClass',
         'test': 'testMethod',
       }),
       (0, {
-        'test_skipped': 'false',
-      }),
-      (0, {
         'class': 'test.package.TestClass',
         'test': 'testMethod',
       }),
     ]
-    results = instrumentation_test_instance.GenerateTestResults(
-        None, None, statuses, 0, 1000)
-    self.assertEqual(1, len(results))
-    self.assertEqual(base_test_result.ResultType.PASS, results[0].GetType())
+    result = instrumentation_test_instance.GenerateTestResult(
+        'test.package.TestClass#testMethod', statuses, 0, 1000)
+    self.assertEqual(base_test_result.ResultType.PASS, result.GetType())
 
-  def testGenerateTestResults_testFailed(self):
+  def testGenerateTestResult_testFailed(self):
     statuses = [
       (1, {
         'class': 'test.package.TestClass',
@@ -99,10 +115,9 @@
         'test': 'testMethod',
       }),
     ]
-    results = instrumentation_test_instance.GenerateTestResults(
-        None, None, statuses, 0, 1000)
-    self.assertEqual(1, len(results))
-    self.assertEqual(base_test_result.ResultType.FAIL, results[0].GetType())
+    result = instrumentation_test_instance.GenerateTestResult(
+        'test.package.TestClass#testMethod', statuses, 0, 1000)
+    self.assertEqual(base_test_result.ResultType.FAIL, result.GetType())
 
 
 if __name__ == '__main__':
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py
index f3983fd..5f095a5 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -320,16 +320,9 @@
         '%s/%s' % (self.test_pkg.GetPackageName(), self.options.test_runner),
         raw=True, extras=extras, timeout=timeout, retries=3)
 
-  def _GenerateTestResult(self, test, instr_result_code, instr_result_bundle,
-                          statuses, start_ms, duration_ms):
-    results = instrumentation_test_instance.GenerateTestResults(
-        instr_result_code, instr_result_bundle, statuses, start_ms, duration_ms)
-    for r in results:
-      if r.GetName() == test:
-        return r
-    logging.error('Could not find result for test: %s', test)
-    return test_result.InstrumentationTestResult(
-        test, base_test_result.ResultType.UNKNOWN, start_ms, duration_ms)
+  def _GenerateTestResult(self, test, instr_statuses, start_ms, duration_ms):
+    return instrumentation_test_instance.GenerateTestResult(
+        test, instr_statuses, start_ms, duration_ms)
 
   #override
   def RunTest(self, test):
@@ -352,10 +345,9 @@
       duration_ms = time_ms() - start_ms
 
       # Parse the test output
-      result_code, result_bundle, statuses = (
+      _, _, statuses = (
           instrumentation_test_instance.ParseAmInstrumentRawOutput(raw_output))
-      result = self._GenerateTestResult(
-          test, result_code, result_bundle, statuses, start_ms, duration_ms)
+      result = self._GenerateTestResult(test, statuses, start_ms, duration_ms)
       if local_device_instrumentation_test_run.DidPackageCrashOnDevice(
           self.test_pkg.GetPackageName(), self.device):
         result.SetType(base_test_result.ResultType.CRASH)
diff --git a/build/android/pylib/linker/test_case.py b/build/android/pylib/linker/test_case.py
index c7b0f50..8ebf803 100644
--- a/build/android/pylib/linker/test_case.py
+++ b/build/android/pylib/linker/test_case.py
@@ -123,7 +123,7 @@
   """
 
   # 1. Start recording logcat with appropriate filters.
-  with device.GetLogcatMonitor(filter_specs=_LOGCAT_FILTERS) as logmon:
+  with device.GetLogcatMonitor(filters=_LOGCAT_FILTERS) as logmon:
 
     # 2. Force-start activity.
     device.StartActivity(
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
index ac3f5b1..2ed16ee 100644
--- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py
+++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -124,19 +124,16 @@
 
     # TODO(jbudorick): Make instrumentation tests output a JSON so this
     # doesn't have to parse the output.
-    logging.debug('output from %s:', test_name)
+    logging.info('output from %s:' % test_name)
     for l in output:
-      logging.debug('  %s', l)
+      logging.info('  %s' % l)
 
-    result_code, result_bundle, statuses = (
-        self._test_instance.ParseAmInstrumentRawOutput(output))
-    results = self._test_instance.GenerateTestResults(
-        result_code, result_bundle, statuses, start_ms, duration_ms)
+    _, _, statuses = self._test_instance.ParseAmInstrumentRawOutput(output)
+    result = self._test_instance.GenerateTestResult(
+        test_name, statuses, start_ms, duration_ms)
     if DidPackageCrashOnDevice(self._test_instance.test_package, device):
-      for r in results:
-        if r.GetType() == base_test_result.ResultType.UNKNOWN:
-          r.SetType(base_test_result.ResultType.CRASH)
-    return results
+      result.SetType(base_test_result.ResultType.CRASH)
+    return result
 
   #override
   def _ShouldShard(self):
diff --git a/build/android/pylib/local/device/local_device_test_run.py b/build/android/pylib/local/device/local_device_test_run.py
index fa24eb1..8c322cb 100644
--- a/build/android/pylib/local/device/local_device_test_run.py
+++ b/build/android/pylib/local/device/local_device_test_run.py
@@ -70,11 +70,10 @@
     if unknown_tests:
       results.AddResults(
           base_test_result.BaseTestResult(
-              u, base_test_result.ResultType.UNKNOWN)
-          for u in unknown_tests)
+              t, base_test_result.ResultType.UNKNOWN)
+          for t in tests)
     if failed_tests:
       results.AddResults(all_fail_results[f] for f in failed_tests)
-
     return results
 
   def GetTool(self, device):
diff --git a/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py b/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py
index 709a30c..5138d46 100644
--- a/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py
+++ b/build/android/pylib/remote/device/remote_device_instrumentation_test_run.py
@@ -40,11 +40,10 @@
           base_test_result.ResultType.FAIL))
       return r
 
-    result_code, result_bundle, statuses = (
-        self._test_instance.ParseAmInstrumentRawOutput(
-            self._results['results']['output'].splitlines()))
-    result = self._test_instance.GenerateTestResults(
-        result_code, result_bundle, statuses, 0, 0)
+    _, errors, parsed_output = self._test_instance.ParseAmInstrumentRawOutput(
+        self._results['results']['output'].splitlines())
+    logging.debug(errors)
+    result = self._test_instance.GenerateMultiTestResult(errors, parsed_output)
 
     if isinstance(result, base_test_result.BaseTestResult):
       r.AddResult(result)
diff --git a/build/android/pylib/uiautomator/test_runner.py b/build/android/pylib/uiautomator/test_runner.py
index d7a4bdf..02f5d6a 100644
--- a/build/android/pylib/uiautomator/test_runner.py
+++ b/build/android/pylib/uiautomator/test_runner.py
@@ -79,11 +79,8 @@
     return self.device.RunShellCommand(cmd, timeout=timeout, retries=0)
 
   #override
-  def _GenerateTestResult(self, test, _result_code, _result_bundle, statuses,
-                          start_ms, duration_ms):
+  def _GenerateTestResult(self, test, instr_statuses, start_ms, duration_ms):
     # uiautomator emits its summary status with INSTRUMENTATION_STATUS_CODE,
     # not INSTRUMENTATION_CODE, so we have to drop if off the list of statuses.
-    summary_code, summary_bundle = statuses[-1]
     return super(TestRunner, self)._GenerateTestResult(
-        test, summary_code, summary_bundle, statuses[:-1], start_ms,
-        duration_ms)
+        test, instr_statuses[:-1], start_ms, duration_ms)
diff --git a/build/common.gypi b/build/common.gypi
index 55dad68..3a071c8 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -584,6 +584,9 @@
 
       # If no directory is specified then a temporary directory will be used.
       'test_isolation_outdir%': '',
+      # True if isolate should fail if the isolate files refer to files
+      # that are missing.
+      'test_isolation_fail_on_missing': 1,
 
       'wix_path%': '<(DEPTH)/third_party/wix',
 
@@ -627,9 +630,6 @@
       # Enable LTO on code compiled with -O2.
       'use_lto_o2%': 0,
 
-      # Allowed level of identical code folding in the gold linker.
-      'gold_icf_level%': 'safe',
-
       # Libxkbcommon usage.
       'use_xkbcommon%': 0,
 
@@ -1157,6 +1157,7 @@
     'use_canvas_skia%': '<(use_canvas_skia)',
     'test_isolation_mode%': '<(test_isolation_mode)',
     'test_isolation_outdir%': '<(test_isolation_outdir)',
+    'test_isolation_fail_on_missing': '<(test_isolation_fail_on_missing)',
     'enable_basic_printing%': '<(enable_basic_printing)',
     'enable_print_preview%': '<(enable_print_preview)',
     'enable_spellcheck%': '<(enable_spellcheck)',
@@ -1198,7 +1199,6 @@
     'gomadir%': '<(gomadir)',
     'use_lto%': '<(use_lto)',
     'use_lto_o2%': '<(use_lto_o2)',
-    'gold_icf_level%': '<(gold_icf_level)',
     'video_hole%': '<(video_hole)',
     'support_pre_M6_history_database%': '<(support_pre_M6_history_database)',
     'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
@@ -1802,6 +1802,9 @@
 
         # Copy it out one scope.
         'android_webview_build%': '<(android_webview_build)',
+
+        # Default android linker script for shared library exports.
+        'android_linker_script%': '<(SHARED_INTERMEDIATE_DIR)/android_exports.lst',
       }],  # OS=="android"
       ['embedded==1', {
         'use_system_fontconfig%': 0,
@@ -1828,6 +1831,7 @@
         'jni_generator_jarjar_file': '../android_webview/build/jarjar-rules.txt',
       }],
       ['OS=="linux" and target_arch!="mipsel"', {
+        # TODO(thakis): This is here to measure perf for a while.
         'clang%': 1,
       }],  # OS=="mac"
       ['OS=="mac"', {
@@ -2140,13 +2144,23 @@
         'clang_chrome_plugins_flags': [
           '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)'
         ],
+        'conditions': [
+          # TODO(dcheng): https://crbug.com/417463 -- work to enable this flag
+          # on all platforms is currently underway.
+          ['OS=="android" or OS=="linux" or OS=="mac" or OS=="ios"', {
+            'clang_chrome_plugins_flags': [
+              '-Xclang',
+              '-plugin-arg-find-bad-constructs',
+              '-Xclang',
+              'strict-virtual-specifiers',
+            ],
+          }],
+        ],
       }],
       ['asan==1 or msan==1 or lsan==1 or tsan==1', {
         'clang%': 1,
         'use_allocator%': 'none',
         'use_sanitizer_options%': 1,
-        # Disable ICF in the linker to avoid debug info loss.
-        'gold_icf_level%': 'none',
       }],
       ['asan==1 and OS=="linux" and chromeos==0', {
         'use_custom_libcxx%': 1,
@@ -2461,14 +2475,6 @@
         '-Wno-unnamed-type-template-args',
       ],
 
-      # By default, Android targets have their exported JNI symbols stripped,
-      # so we test the manual JNI registration code paths that are required
-      # when using the crazy linker. To allow use of native JNI exports (lazily
-      # resolved by the JVM), targets can enable this variable, which will stop
-      # the stripping from happening. Only targets which do not need to be
-      # compatible with the crazy linker are permitted to set this.
-      'use_native_jni_exports%': 0,
-
       'conditions': [
         ['OS=="win" and component=="shared_library"', {
           # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
@@ -3511,7 +3517,7 @@
         ],
       },
     }],
-    # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
+    # TODO(thakis): Enable this everywhere. http://crbug.com/371125
     ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_vptr==0', {
       'target_defaults': {
         'ldflags': [
@@ -4408,7 +4414,7 @@
                 'target_conditions': [
                   ['_toolset=="target"', {
                     'ldflags': [
-                      '-Wl,--icf=<(gold_icf_level)',
+                      '-Wl,--icf=safe',
                     ],
                   }],
                 ],
@@ -4588,15 +4594,9 @@
               '-Wl,--no-undefined',
             ],
             'conditions': [
-              ['component=="static_library" and android_webview_build==0', {
-                'target_conditions': [
-                  ['use_native_jni_exports==0', {
-                    # Use a linker version script to strip JNI exports from
-                    # binaries which have not specifically asked to use them.
-                    'ldflags': [
-                      '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
-                    ],
-                  }],
+              ['component=="static_library"', {
+                'ldflags': [
+                  '-Wl,--exclude-libs=ALL',
                 ],
               }],
               ['clang==1', {
@@ -4656,20 +4656,6 @@
                 'ldflags': [
                   '--sysroot=<(android_ndk_sysroot)',
                   '-nostdlib',
-                  # Don't allow visible symbols from libgcc or stlport to be
-                  # re-exported.
-                  '-Wl,--exclude-libs=libgcc.a',
-                  '-Wl,--exclude-libs=libstlport_static.a',
-                  # Don't allow visible symbols from libraries that contain
-                  # assembly code with symbols that aren't hidden properly.
-                  # http://crbug.com/448386
-                  '-Wl,--exclude-libs=libcommon_audio.a',
-                  '-Wl,--exclude-libs=libcommon_audio_neon.a',
-                  '-Wl,--exclude-libs=libcommon_audio_sse2.a',
-                  '-Wl,--exclude-libs=libiSACFix.a',
-                  '-Wl,--exclude-libs=libisac_neon.a',
-                  '-Wl,--exclude-libs=libopus.a',
-                  '-Wl,--exclude-libs=libvpx.a',
                 ],
                 'libraries': [
                   '-l<(android_stlport_library)',
@@ -4726,7 +4712,7 @@
               ['target_arch == "arm" and order_profiling==0', {
                 'ldflags': [
                   # Enable identical code folding to reduce size.
-                  '-Wl,--icf=<(gold_icf_level)',
+                  '-Wl,--icf=safe',
                 ],
               }],
               # NOTE: The stlport header include paths below are specified in
@@ -4786,6 +4772,9 @@
                 ],
               }],
               ['_type=="shared_library" or _type=="loadable_module"', {
+                'ldflags!': [
+                  '-Wl,--exclude-libs=ALL',
+                ],
                 'ldflags': [
                   '-Wl,-shared,-Bsymbolic',
                 ],
diff --git a/build/compiled_action.gni b/build/compiled_action.gni
index b6d0c4d..e5059aa 100644
--- a/build/compiled_action.gni
+++ b/build/compiled_action.gni
@@ -66,7 +66,7 @@
 # saves unnecessarily compiling your tool for the target platform. But if you
 # need a target build of your tool as well, just leave off the if statement.
 
-if (host_os == "win") {
+if (build_os == "win") {
   _host_executable_suffix = ".exe"
 } else {
   _host_executable_suffix = ""
diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
index 49b5cfe..5f93dd9 100644
--- a/build/config/BUILD.gn
+++ b/build/config/BUILD.gn
@@ -231,7 +231,7 @@
       # have to tell it to turn it off.
       defines += [ "_HAS_ITERATOR_DEBUGGING=0" ]
     }
-  } else if (is_linux && !is_android && current_cpu == "x64" &&
+  } else if (is_linux && !is_android && cpu_arch == "x64" &&
              !disable_iterator_debugging) {
     # Enable libstdc++ debugging facilities to help catch problems early, see
     # http://crbug.com/65151 .
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index a554f12..d806a17 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -16,53 +16,7 @@
 # KEEP IN ALPHABETICAL ORDER and write a good description for everything.
 # Use "is_*" names for intrinsic platform descriptions and build modes, and
 # "use_*" names for optional features libraries, and configurations.
-
-# TODO(dpranke): The os and cpu_arch variables exist for backwards
-# compatibility and should be deleted once all of the build files and
-# bots have been updated to use current_cpu/target_cpu and
-# current_os/target_os instead.
-
-if (target_os == "") {
-  if (defined(os)) {
-    # If os is defined, it was set in an args file and needs to be
-    # used for backwards-compatibility.
-    target_os = os
-  } else {
-    target_os = host_os
-  }
-}
-
-if (target_cpu == "") {
-  if (defined(cpu_arch)) {
-    # If cpu_arch is defined, it was set in an args file and needs to be
-    # used for backwards-compatibility.
-    target_cpu = cpu_arch
-  } else if (target_os == "android") {
-    # If we're building for Android, we should assume that we want to
-    # build for ARM by default, not the host_cpu (which is likely x64).
-    # This allows us to not have to specify both target_os and target_cpu
-    # on the command line.
-    target_cpu = "arm"
-  } else {
-    target_cpu = host_cpu
-  }
-}
-
-if (current_cpu == "") {
-  current_cpu = target_cpu
-}
-if (current_os == "") {
-  current_os = target_os
-}
-
 declare_args() {
-  # TODO(dpranke): These values are here for backwards compatibility and
-  # should be deleted when all of the builders and configs have been updated.
-  cpu_arch = target_cpu
-  os = target_os
-  build_cpu_arch = host_cpu
-  build_os = host_os
-
   # How many symbols to include in the build. This affects the performance of
   # the build since the symbols are large and dealing with them is slow.
   #   2 means regular build with symbols.
@@ -78,12 +32,11 @@
   is_debug = true
 
   # Whether we're a traditional desktop unix.
-  is_desktop_linux = current_os == "linux" && current_os != "chromeos"
+  is_desktop_linux = os == "linux" && os != "chromeos"
 
   # Set to true when compiling with the Clang compiler. Typically this is used
   # to configure warnings.
-  is_clang = current_os == "mac" || current_os == "ios" ||
-             current_os == "linux" || current_os == "chromeos"
+  is_clang = os == "mac" || os == "ios" || os == "linux" || os == "chromeos"
 
   # Selects the desired build flavor. Official builds get additional
   # processing to prepare for release. Normally you will want to develop and
@@ -107,23 +60,29 @@
   # Compile for Thread Sanitizer to find threading bugs.
   is_tsan = false
 
-  if (current_os == "chromeos") {
+  if (os == "chromeos") {
     # Allows the target toolchain to be injected as arguments. This is needed
     # to support the CrOS build system which supports per-build-configuration
     # toolchains.
     cros_use_custom_toolchain = false
   }
 
+  # TODO(cjhopman): Make target_arch work for all platforms.
+
+  # Architecture of the target device. For Android builds, this will be equal to
+  # the cpu_arch of the default toolchain. When checking the CPU architecture
+  # for source files and build dependencies you should almost alway use cpu_arch
+  # instead. cpu_arch is the architecture of the current toolchain and allows
+  # cross-compiles (compiling the same target for multiple toolchains in the
+  # same build) to work.
+  target_arch = "arm"
+
   # TODO(brettw) remove this flag (and therefore enable linking all targets) on
   # Windows when we have sufficient bot capacity. In the meantime, you can
   # enable linking for local compiles.
   link_chrome_on_windows = true
 }
 
-# TODO(dpranke): Remove these asserts when os and cpu_arch are removed.
-assert(current_cpu == cpu_arch)
-assert(current_os == os)
-
 # =============================================================================
 # OS DEFINITIONS
 # =============================================================================
@@ -139,10 +98,10 @@
 #   generally too different despite being based on the Linux kernel).
 #
 # Do not add more is_* variants here for random lesser-used Unix systems like
-# aix or one of the BSDs. If you need to check these, just check the
-# current_os value directly.
+# aix or one of the BSDs. If you need to check these, just check the os value
+# directly.
 
-if (current_os == "win") {
+if (os == "win") {
   is_android = false
   is_chromeos = false
   is_ios = false
@@ -151,7 +110,7 @@
   is_nacl = false
   is_posix = false
   is_win = true
-} else if (current_os == "mac") {
+} else if (os == "mac") {
   is_android = false
   is_chromeos = false
   is_ios = false
@@ -160,7 +119,7 @@
   is_nacl = false
   is_posix = true
   is_win = false
-} else if (current_os == "android") {
+} else if (os == "android") {
   is_android = true
   is_chromeos = false
   is_ios = false
@@ -169,7 +128,7 @@
   is_nacl = false
   is_posix = true
   is_win = false
-} else if (current_os == "chromeos") {
+} else if (os == "chromeos") {
   is_android = false
   is_chromeos = true
   is_ios = false
@@ -178,10 +137,9 @@
   is_nacl = false
   is_posix = true
   is_win = false
-} else if (current_os == "nacl") {
-  # current_os == "nacl" will be passed by the nacl toolchain definition.
-  # It is not set by default or on the command line. We treat is as a
-  # Posix variant.
+} else if (os == "nacl") {
+  # os == "nacl" will be passed by the nacl toolchain definition. It is not
+  # set by default or on the command line. We treat is as a Posix variant.
   is_android = false
   is_chromeos = false
   is_ios = false
@@ -190,7 +148,7 @@
   is_nacl = true
   is_posix = true
   is_win = false
-} else if (current_os == "ios") {
+} else if (os == "ios") {
   is_android = false
   is_chromeos = false
   is_ios = true
@@ -199,7 +157,7 @@
   is_nacl = false
   is_posix = true
   is_win = false
-} else if (current_os == "linux") {
+} else if (os == "linux") {
   is_android = false
   is_chromeos = false
   is_ios = false
@@ -211,6 +169,18 @@
 }
 
 # =============================================================================
+# CPU ARCHITECTURE
+# =============================================================================
+
+if (is_android) {
+  # TODO(cjhopman): enable this assert once bots are updated to not set
+  # cpu_arch.
+  #assert(cpu_arch == build_cpu_arch, "Android device target architecture should
+  #    be set with 'target_arch', not 'cpu_arch'")
+  cpu_arch = target_arch
+}
+
+# =============================================================================
 # SOURCES FILTERS
 # =============================================================================
 #
@@ -471,11 +441,6 @@
   _shared_library_configs += _windows_linker_configs
 } else if (is_mac) {
   _shared_library_configs += [ "//build/config/mac:mac_dynamic_flags" ]
-} else if (is_android) {
-  # Strip native JNI exports from shared libraries by default. Binaries that
-  # want this can remove this config.
-  _shared_library_configs +=
-      [ "//build/config/android:hide_native_jni_exports" ]
 }
 set_defaults("shared_library") {
   configs = _shared_library_configs
@@ -516,28 +481,28 @@
 
 if (is_win) {
   # On windows we use the same toolchain for host and target by default.
-  # TODO(dpranke): rename the toolchains to x64 and x86 to match current_cpu.
-  if (current_cpu == "x64") {
+  # TODO(dpranke): rename the toolchains to x64 and x86 to match cpu_arch.
+  if (cpu_arch == "x64") {
     host_toolchain = "//build/toolchain/win:64"
-  } else if (current_cpu == "x86") {
+  } else if (cpu_arch == "x86") {
     host_toolchain = "//build/toolchain/win:32"
   }
   set_default_toolchain("$host_toolchain")
 } else if (is_android) {
   # Use clang for the x86/64 Linux host builds.
-  if (host_cpu == "x86" || host_cpu == "x64") {
-    host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
+  if (build_cpu_arch == "x86" || build_cpu_arch == "x64") {
+    host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch"
   } else {
-    host_toolchain = "//build/toolchain/linux:$host_cpu"
+    host_toolchain = "//build/toolchain/linux:$build_cpu_arch"
   }
-  set_default_toolchain("//build/toolchain/android:$current_cpu")
+  set_default_toolchain("//build/toolchain/android:$cpu_arch")
 } else if (is_linux) {
   if (is_clang) {
-    host_toolchain = "//build/toolchain/linux:clang_$host_cpu"
-    set_default_toolchain("//build/toolchain/linux:clang_$current_cpu")
+    host_toolchain = "//build/toolchain/linux:clang_$build_cpu_arch"
+    set_default_toolchain("//build/toolchain/linux:clang_$cpu_arch")
   } else {
-    host_toolchain = "//build/toolchain/linux:$host_cpu"
-    set_default_toolchain("//build/toolchain/linux:$current_cpu")
+    host_toolchain = "//build/toolchain/linux:$build_cpu_arch"
+    set_default_toolchain("//build/toolchain/linux:$cpu_arch")
   }
   if (is_chromeos && cros_use_custom_toolchain) {
     set_default_toolchain("//build/toolchain/cros:target")
diff --git a/build/config/allocator.gni b/build/config/allocator.gni
index 4c9ae67..9fcfe49 100644
--- a/build/config/allocator.gni
+++ b/build/config/allocator.gni
@@ -3,7 +3,7 @@
 # found in the LICENSE file.
 
 # TODO(GYP): Make tcmalloc work on win.
-if (is_android || current_cpu == "mipsel" || is_mac || is_asan || is_win) {
+if (is_android || cpu_arch == "mipsel" || is_mac || is_asan || is_win) {
   _default_allocator = "none"
 } else {
   _default_allocator = "tcmalloc"
diff --git a/build/config/android/BUILD.gn b/build/config/android/BUILD.gn
index 5492693..0cc38b7 100644
--- a/build/config/android/BUILD.gn
+++ b/build/config/android/BUILD.gn
@@ -25,8 +25,3 @@
   cflags = [ "-fPIE" ]
   ldflags = [ "-pie" ]
 }
-
-config("hide_native_jni_exports") {
-  ldflags = [ "-Wl,--version-script=" +
-              rebase_path("//build/android/android_no_jni_exports.lst") ]
-}
diff --git a/build/config/android/config.gni b/build/config/android/config.gni
index cebf4de..0105a64 100644
--- a/build/config/android/config.gni
+++ b/build/config/android/config.gni
@@ -50,9 +50,9 @@
 
   # Defines the name the Android build gives to the current host CPU
   # architecture, which is different than the names GN uses.
-  if (host_cpu == "x64") {
+  if (build_cpu_arch == "x64") {
     android_host_arch = "x86_64"
-  } else if (host_cpu == "x86") {
+  } else if (build_cpu_arch == "x86") {
     android_host_arch = "x86"
   } else {
     assert(false, "Need Android toolchain support for your build CPU arch.")
@@ -60,7 +60,7 @@
 
   # Defines the name the Android build gives to the current host CPU
   # architecture, which is different than the names GN uses.
-  if (host_os == "linux") {
+  if (build_os == "linux") {
     android_host_os = "linux"
   } else {
     assert(false, "Need Android toolchain support for your build OS.")
@@ -119,32 +119,32 @@
   # Location of libgcc. This is only needed for the current GN toolchain, so we
   # only need to define the current one, rather than one for every platform
   # like the toolchain roots.
-  if (current_cpu == "x86") {
+  if (cpu_arch == "x86") {
     android_prebuilt_arch = "android-x86"
     _binary_prefix = "i686-linux-android"
     android_toolchain_root = "$x86_android_toolchain_root"
     android_libgcc_file = "$android_toolchain_root/lib/gcc/i686-linux-android/${_android_toolchain_version}/libgcc.a"
-  } else if (current_cpu == "arm") {
+  } else if (cpu_arch == "arm") {
     android_prebuilt_arch = "android-arm"
     _binary_prefix = "arm-linux-androideabi"
     android_toolchain_root = "$arm_android_toolchain_root"
     android_libgcc_file = "$android_toolchain_root/lib/gcc/arm-linux-androideabi/${_android_toolchain_version}/libgcc.a"
-  } else if (current_cpu == "mipsel") {
+  } else if (cpu_arch == "mipsel") {
     android_prebuilt_arch = "android-mips"
     _binary_prefix = "mipsel-linux-android"
     android_toolchain_root = "$mips_android_toolchain_root"
     android_libgcc_file = "$android_toolchain_root/lib/gcc/mipsel-linux-android/${_android_toolchain_version}/libgcc.a"
-  } else if (current_cpu == "x64") {
+  } else if (cpu_arch == "x64") {
     android_prebuilt_arch = "android-x86_64"
     _binary_prefix = "x86_64-linux-android"
     android_toolchain_root = "$x86_64_android_toolchain_root"
     android_libgcc_file = "$android_toolchain_root/lib/gcc/x86_64-linux-android/${_android_toolchain_version}/libgcc.a"
-  } else if (current_cpu == "arm64") {
+  } else if (cpu_arch == "arm64") {
     android_prebuilt_arch = "android-arm64"
     _binary_prefix = "aarch64-linux-android"
     android_toolchain_root = "$arm64_android_toolchain_root"
     android_libgcc_file = "$android_toolchain_root/lib/gcc/aarch64-linux-android/${_android_toolchain_version}/libgcc.a"
-  } else if (current_cpu == "mips64el") {
+  } else if (cpu_arch == "mips64el") {
     android_prebuilt_arch = "android-mips64"
     _binary_prefix = "mips64el-linux-android"
     android_toolchain_root = "$mips64_android_toolchain_root"
@@ -169,25 +169,25 @@
 
   # ABI ------------------------------------------------------------------------
 
-  if (current_cpu == "x86") {
+  if (cpu_arch == "x86") {
     android_app_abi = "x86"
-  } else if (current_cpu == "arm") {
+  } else if (cpu_arch == "arm") {
     import("//build/config/arm.gni")
     if (arm_version < 7) {
       android_app_abi = "armeabi"
     } else {
       android_app_abi = "armeabi-v7a"
     }
-  } else if (current_cpu == "mipsel") {
+  } else if (cpu_arch == "mipsel") {
     android_app_abi = "mips"
-  } else if (current_cpu == "x64") {
+  } else if (cpu_arch == "x64") {
     android_app_abi = "x86_64"
-  } else if (current_cpu == "arm64") {
+  } else if (cpu_arch == "arm64") {
     android_app_abi = "arm64-v8a"
-  } else if (current_cpu == "mips64el") {
+  } else if (cpu_arch == "mips64el") {
     android_app_abi = "mips64"
   } else {
-    assert(false, "Unknown Android ABI: " + current_cpu)
+    assert(false, "Unknown Android ABI: " + cpu_arch)
   }
 } else {
   if (!defined(is_android_webview_build)) {
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index 8ca0642..33dfa37 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -74,12 +74,6 @@
         rebase_path(jni_generator_jarjar_file, root_build_dir),
       ]
     }
-    if (!is_clang) {
-      # Clang builds currently fail with --native_exports_optional due to
-      # http://llvm.org/bugs/show_bug.cgi?id=22602 - only enable for gcc.
-      # http://crbug.com/442327
-      args += [ "--native_exports_optional" ]
-    }
   }
 
   config("jni_includes_${target_name}") {
@@ -190,12 +184,6 @@
         "--includes",
         rebase_path(jni_generator_include, root_build_dir),
       ]
-      if (!is_clang) {
-        # Clang builds currently fail with --native_exports_optional due to
-        # http://llvm.org/bugs/show_bug.cgi?id=22602 - only enable for gcc.
-        # http://crbug.com/442327
-        args += [ "--native_exports_optional" ]
-      }
     }
   }
 
@@ -358,7 +346,9 @@
 
   action("${target_name}__generate_enum") {
     # The sources aren't compiled so don't check their dependencies.
-    check_includes = false
+    # TODO(brettw) uncomment after GN binary rolled pas 314974 (which added
+    # support for this value on actions).
+    #check_includes = false
 
     sources = invoker.sources
     script = "//build/android/gyp/java_cpp_enum.py"
diff --git a/build/config/arm.gni b/build/config/arm.gni
index 778ecc1..d39c6e9 100644
--- a/build/config/arm.gni
+++ b/build/config/arm.gni
@@ -2,7 +2,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
-if (current_cpu == "arm") {
+if (cpu_arch == "arm") {
   declare_args() {
     # Version of the ARM processor when compiling on ARM. Ignored on non-ARM
     # platforms.
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 8cb4088..164b97d 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -3,10 +3,10 @@
 # found in the LICENSE file.
 
 import("//build/config/android/config.gni")
-if (current_cpu == "arm") {
+if (cpu_arch == "arm") {
   import("//build/config/arm.gni")
 }
-if (current_cpu == "mipsel" || current_cpu == "mips64el") {
+if (cpu_arch == "mipsel" || cpu_arch == "mips64el") {
   import("//build/config/mips.gni")
 }
 if (is_posix) {
@@ -24,7 +24,7 @@
   # These are not multi-arch so cannot be used except on x86 and x86-64 (the
   # only two architectures that are currently checked in). Turn this off when
   # you are using a custom toolchain and need to control -B in cflags.
-  linux_use_bundled_binutils = is_linux && current_cpu == "x64"
+  linux_use_bundled_binutils = is_linux && cpu_arch == "x64"
 
   # Compile in such a way as to enable profiling of the generated code. For
   # example, don't omit the frame pointer and leave in symbols.
@@ -39,7 +39,7 @@
 
   # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of
   # address space, and it doesn't support cross-compiling).
-  use_gold = is_linux && current_cpu == "x64"
+  use_gold = is_linux && cpu_arch == "x64"
 
   # use_debug_fission: whether to use split DWARF debug info
   # files. This can reduce link time significantly, but is incompatible
@@ -121,7 +121,7 @@
     }
 
     # Linker warnings.
-    if (!(is_chromeos && current_cpu == "arm") && !is_mac) {
+    if (!(is_chromeos && cpu_arch == "arm") && !is_mac) {
       # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
       ldflags += [ "-Wl,--fatal-warnings" ]
     }
@@ -172,12 +172,12 @@
     common_mac_flags = []
 
     # CPU architecture.
-    if (current_cpu == "x64") {
+    if (cpu_arch == "x64") {
       common_mac_flags += [
         "-arch",
         "x86_64",
       ]
-    } else if (current_cpu == "x86") {
+    } else if (cpu_arch == "x86") {
       common_mac_flags += [
         "-arch",
         "i386",
@@ -222,13 +222,13 @@
 
     # CPU architecture. We may or may not be doing a cross compile now, so for
     # simplicity we always explicitly set the architecture.
-    if (current_cpu == "x64") {
+    if (cpu_arch == "x64") {
       cflags += [
         "-m64",
         "-march=x86-64",
       ]
       ldflags += [ "-m64" ]
-    } else if (current_cpu == "x86") {
+    } else if (cpu_arch == "x86") {
       cflags += [ "-m32" ]
       ldflags += [ "-m32" ]
       if (is_clang) {
@@ -242,7 +242,7 @@
           "-mstackrealign",
         ]
       }
-    } else if (current_cpu == "arm") {
+    } else if (cpu_arch == "arm") {
       # Don't set the compiler flags for the WebView build. These will come
       # from the Android build system.
       if (!is_android_webview_build) {
@@ -275,7 +275,7 @@
           ]
         }
       }
-    } else if (current_cpu == "mipsel") {
+    } else if (cpu_arch == "mipsel") {
       # Don't set the compiler flags for the WebView build. These will come
       # from the Android build system.
       if (!is_android_webview_build) {
@@ -302,7 +302,7 @@
           ]
         }
       }
-    } else if (current_cpu == "mips64el") {
+    } else if (cpu_arch == "mips64el") {
       # Don't set the compiler flags for the WebView build. These will come
       # from the Android build system.
       if (!is_android_webview_build) {
@@ -437,7 +437,7 @@
     }
 
     # Use gold for Android for most CPU architectures.
-    if (current_cpu == "x86" || current_cpu == "x64" || current_cpu == "arm") {
+    if (cpu_arch == "x86" || cpu_arch == "x64" || cpu_arch == "arm") {
       ldflags += [ "-fuse-ld=gold" ]
       if (is_clang) {
         # Let clang find the ld.gold in the NDK.
@@ -449,17 +449,10 @@
     ldflags += [
       "-Wl,--no-undefined",
 
-      # Don't allow visible symbols from libgcc or stlport to be
-      # re-exported.
-      "-Wl,--exclude-libs=libgcc.a",
-      "-Wl,--exclude-libs=libstlport_static.a",
-
-      # Don't allow visible symbols from libraries that contain
-      # assembly code with symbols that aren't hidden properly.
-      # http://crbug.com/448386
-      "-Wl,--exclude-libs=libvpx_assembly_arm.a",
+      # Don't export symbols from statically linked libraries.
+      "-Wl,--exclude-libs=ALL",
     ]
-    if (current_cpu == "arm") {
+    if (cpu_arch == "arm") {
       ldflags += [
         # Enable identical code folding to reduce size.
         "-Wl,--icf=safe",
@@ -467,10 +460,10 @@
     }
 
     if (is_clang) {
-      if (current_cpu == "arm") {
+      if (cpu_arch == "arm") {
         cflags += [ "-target arm-linux-androideabi" ]
         ldflags += [ "-target arm-linux-androideabi" ]
-      } else if (current_cpu == "x86") {
+      } else if (cpu_arch == "x86") {
         cflags += [ "-target x86-linux-androideabi" ]
         ldflags += [ "-target x86-linux-androideabi" ]
       }
@@ -479,7 +472,7 @@
 }
 
 config("compiler_arm_fpu") {
-  if (current_cpu == "arm" && !is_android_webview_build) {
+  if (cpu_arch == "arm" && !is_android_webview_build) {
     cflags = [ "-mfpu=$arm_fpu" ]
   }
 }
@@ -577,7 +570,7 @@
       libs += [ "stlport_static" ]
     }
 
-    if (current_cpu == "mipsel") {
+    if (cpu_arch == "mipsel") {
       libs += [
         # ld linker is used for mips Android, and ld does not accept library
         # absolute path prefixed by "-l"; Since libgcc does not exist in mips
@@ -844,7 +837,7 @@
 
     # Suppress warnings about ABI changes on ARM (Clang doesn't give this
     # warning).
-    if (current_cpu == "arm" && !is_clang) {
+    if (cpu_arch == "arm" && !is_clang) {
       cflags += [ "-Wno-psabi" ]
     }
 
@@ -888,20 +881,6 @@
   }
 }
 
-# On Windows compiling on x64, VC will issue a warning when converting
-# size_t to int because it will truncate the value. Our code should not have
-# these warnings and one should use a static_cast or a checked_cast for the
-# conversion depending on the case. However, a lot of code still needs to be
-# fixed. Apply this config to such targets to disable the warning.
-#
-# Note that this can be applied regardless of platform and architecture to
-# clean up the call sites. This will only apply the flag when necessary.
-config("no_size_t_to_int_warning") {
-  if (is_win && current_cpu == "x64") {
-    cflags = [ "/wd4267" ]
-  }
-}
-
 # Optimization -----------------------------------------------------------------
 #
 # Note that BUILDCONFIG.gn sets up a variable "default_optimization_config"
diff --git a/build/config/features.gni b/build/config/features.gni
index ba69371..3811e27 100644
--- a/build/config/features.gni
+++ b/build/config/features.gni
@@ -74,9 +74,9 @@
 # currently.
 # Do not disable seccomp_bpf anywhere without talking to
 # security@chromium.org!
-use_seccomp_bpf = (is_linux || is_android) &&
-                  (current_cpu == "x86" || current_cpu == "x64" ||
-                   current_cpu == "arm" || current_cpu == "mipsel")
+use_seccomp_bpf =
+    (is_linux || is_android) && (cpu_arch == "x86" || cpu_arch == "x64" ||
+                                 cpu_arch == "arm" || cpu_arch == "mipsel")
 
 # Enable notifications everywhere except iOS.
 enable_notifications = !is_ios
diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn
index 202fd73..0453c84 100644
--- a/build/config/linux/BUILD.gn
+++ b/build/config/linux/BUILD.gn
@@ -180,17 +180,15 @@
   #ignore_libs = true  # Loader generated below.
 }
 
-if (is_desktop_linux) {
-  # This generates a target named "gio".
-  generate_library_loader("gio") {
-    name = "LibGioLoader"
-    output_h = "libgio.h"
-    output_cc = "libgio_loader.cc"
-    header = "<gio/gio.h>"
-    config = ":gio_config"
+# This generates a target named "gio".
+generate_library_loader("gio") {
+  name = "LibGioLoader"
+  output_h = "libgio.h"
+  output_cc = "libgio_loader.cc"
+  header = "<gio/gio.h>"
+  config = ":gio_config"
 
-    functions = gypi_values.libgio_functions
-  }
+  functions = gypi_values.libgio_functions
 }
 
 # This generates a target named "libpci".
diff --git a/build/config/linux/pkg_config.gni b/build/config/linux/pkg_config.gni
index 34ed1af..631d60a 100644
--- a/build/config/linux/pkg_config.gni
+++ b/build/config/linux/pkg_config.gni
@@ -43,7 +43,7 @@
     "-s",
     sysroot,
     "-a",
-    current_cpu,
+    cpu_arch,
   ]
 } else if (pkg_config != "") {
   pkg_config_args = [
diff --git a/build/config/mips.gni b/build/config/mips.gni
index 512552d..f544d94 100644
--- a/build/config/mips.gni
+++ b/build/config/mips.gni
@@ -3,11 +3,11 @@
 # found in the LICENSE file.
 
 # MIPS arch variant.
-if (current_cpu == "mipsel") {
+if (cpu_arch == "mipsel") {
   declare_args() {
     mips_arch_variant = "r1"
   }
-} else if (current_cpu == "mips64el") {
+} else if (cpu_arch == "mips64el") {
   if (is_android) {
     declare_args() {
       mips_arch_variant = "r6"
diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni
index 941c77a..a9b250c 100644
--- a/build/config/sysroot.gni
+++ b/build/config/sysroot.gni
@@ -16,17 +16,17 @@
 } else if (is_android) {
   import("//build/config/android/config.gni")
   if (!is_android_webview_build) {
-    if (current_cpu == "x86") {
+    if (cpu_arch == "x86") {
       sysroot = rebase_path("$android_ndk_root/$x86_android_sysroot_subdir")
-    } else if (current_cpu == "arm") {
+    } else if (cpu_arch == "arm") {
       sysroot = rebase_path("$android_ndk_root/$arm_android_sysroot_subdir")
-    } else if (current_cpu == "mipsel") {
+    } else if (cpu_arch == "mipsel") {
       sysroot = rebase_path("$android_ndk_root/$mips_android_sysroot_subdir")
-    } else if (current_cpu == "x64") {
+    } else if (cpu_arch == "x64") {
       sysroot = rebase_path("$android_ndk_root/$x86_64_android_sysroot_subdir")
-    } else if (current_cpu == "arm64") {
+    } else if (cpu_arch == "arm64") {
       sysroot = rebase_path("$android_ndk_root/$arm64_android_sysroot_subdir")
-    } else if (current_cpu == "mips64") {
+    } else if (cpu_arch == "mips64") {
       sysroot = rebase_path("$android_ndk_root/$mips64_android_sysroot_subdir")
     } else {
       sysroot = ""
@@ -37,17 +37,17 @@
 } else if (is_linux && is_chrome_branded && is_official_build && !is_chromeos) {
   # For official builds, use the sysroot checked into the internal source repo
   # so that the builds work on older versions of Linux.
-  if (current_cpu == "x64") {
+  if (cpu_arch == "x64") {
     sysroot =
         rebase_path("//chrome/installer/linux/debian_wheezy_amd64-sysroot")
-  } else if (current_cpu == "x86") {
+  } else if (cpu_arch == "x86") {
     sysroot = rebase_path("//chrome/installer/linux/debian_wheezy_i386-sysroot")
   } else {
     # Any other builds don't use a sysroot.
     sysroot = ""
   }
 } else if (is_linux && !is_chromeos) {
-  if (current_cpu == "mipsel") {
+  if (cpu_arch == "mipsel") {
     sysroot = rebase_path("//mipsel-sysroot/sysroot")
   } else {
     sysroot = ""
diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
index 201d45b..3f05108 100644
--- a/build/config/win/BUILD.gn
+++ b/build/config/win/BUILD.gn
@@ -31,7 +31,7 @@
 
 # Linker flags for Windows SDK setup, this is applied only to EXEs and DLLs.
 config("sdk_link") {
-  if (current_cpu == "x64") {
+  if (cpu_arch == "x64") {
     ldflags = [ "/MACHINE:X64" ]
     lib_dirs = [
       "$windows_sdk_path\Lib\winv6.3\um\x64",
diff --git a/build/download_sdk_extras.py b/build/download_sdk_extras.py
index d22d885..45e7199 100755
--- a/build/download_sdk_extras.py
+++ b/build/download_sdk_extras.py
@@ -9,8 +9,6 @@
 bucket named: <dir in SDK extras>_<package name>_<version>.zip. The file will
 be extracted in the android_tools/sdk/extras directory on the test bots. This
 script will not do anything for developers.
-
-TODO(navabi): Move this script (crbug.com/459819).
 """
 
 import json
@@ -56,13 +54,8 @@
     local_zip = '%s/%s' % (SDK_EXTRAS_PATH, package['zip'])
     if not os.path.exists(local_zip):
       package_zip = '%s/%s' % (SDK_EXTRAS_BUCKET, package['zip'])
-      try:
-        subprocess.check_call(['python', GSUTIL_PATH, '--force-version', '4.7',
-                               'cp', package_zip, local_zip])
-      except AccessDeniedException:
-        print ('WARNING: Bot does not have permission to download SDK packages.'
-               ' If this bot compiles for Android, it may have errors.')
-        return 0
+      subprocess.check_call(['python', GSUTIL_PATH, '--force-version', '4.7',
+                             'cp', package_zip, local_zip])
     # Always clean dir and extract zip to ensure correct contents.
     clean_and_extract(package['dir_name'], package['package'], package['zip'])
 
diff --git a/build/get_landmines.py b/build/get_landmines.py
index d7c98a5..7a918c8 100755
--- a/build/get_landmines.py
+++ b/build/get_landmines.py
@@ -62,7 +62,6 @@
   print 'Clobber to fix missing NaCl gyp dependencies (crbug.com/427427).'
   print 'Another clobber for missing NaCl gyp deps (crbug.com/427427).'
   print 'Clobber to fix GN not picking up increased ID range (crbug.com/444902)'
-  print 'Remove NaCl toolchains from the output dir (crbug.com/456902)'
 
 
 def main():
diff --git a/build/ios/OWNERS b/build/ios/OWNERS
index 4caf405..1c3e6c8 100644
--- a/build/ios/OWNERS
+++ b/build/ios/OWNERS
@@ -1,4 +1,3 @@
 rohitrao@chromium.org
 stuartmorgan@chromium.org
 
-per-file grit_whitelist.txt=*
diff --git a/build/ios/grit_whitelist.txt b/build/ios/grit_whitelist.txt
index 484f806..c1edfdf 100644
--- a/build/ios/grit_whitelist.txt
+++ b/build/ios/grit_whitelist.txt
@@ -130,7 +130,6 @@
 IDS_AUTOFILL_ADDRESS_LINE_SEPARATOR
 IDS_AUTOFILL_ADDRESS_SUMMARY_SEPARATOR
 IDS_AUTOFILL_CC_AMEX
-IDS_AUTOFILL_CC_AMEX_SHORT
 IDS_AUTOFILL_CC_DINERS
 IDS_AUTOFILL_CC_DISCOVER
 IDS_AUTOFILL_CC_GENERIC
@@ -720,7 +719,6 @@
 IDS_LIBADDRESSINPUT_UNRECOGNIZED_FORMAT_ZIP_CODE_EXAMPLE_AND_URL
 IDS_LIBADDRESSINPUT_VILLAGE_TOWNSHIP
 IDS_LIBADDRESSINPUT_ZIP_CODE_LABEL
-IDS_LINK_FROM_CLIPBOARD
 IDS_LOGIN_DIALOG_OK_BUTTON_LABEL
 IDS_LOGIN_DIALOG_PASSWORD_FIELD
 IDS_LOGIN_DIALOG_TITLE
diff --git a/build/isolate.gypi b/build/isolate.gypi
index fbb6d3c..d7070fe 100644
--- a/build/isolate.gypi
+++ b/build/isolate.gypi
@@ -109,6 +109,9 @@
         ["test_isolation_outdir!=''", {
           'action': [ '--isolate-server', '<(test_isolation_outdir)' ],
         }],
+        ['test_isolation_fail_on_missing == 0', {
+          'action': ['--ignore_broken_items'],
+        }],
         ["test_isolation_mode == 'prepare'", {
           'outputs': [
             '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated.gen.json',
diff --git a/build/jar_file_jni_generator.gypi b/build/jar_file_jni_generator.gypi
index 9472c10..4c01c8a 100644
--- a/build/jar_file_jni_generator.gypi
+++ b/build/jar_file_jni_generator.gypi
@@ -73,13 +73,5 @@
         '<(DEPTH)/build/android/android_exports.gyp:android_exports',
       ],
     }],
-    ['clang==0', {
-      # Clang builds currently fail with --native_exports_optional due to
-      # http://llvm.org/bugs/show_bug.cgi?id=22602 - only enable for gcc.
-      # http://crbug.com/442327
-      'variables': {
-        'native_exports%': '--native_exports_optional',
-      },
-    }],
   ],
 }
diff --git a/build/jni_generator.gypi b/build/jni_generator.gypi
index 853b5f6..6edc512 100644
--- a/build/jni_generator.gypi
+++ b/build/jni_generator.gypi
@@ -92,14 +92,6 @@
         '<(DEPTH)/build/android/android_exports.gyp:android_exports',
       ],
     }],
-    ['clang==0', {
-      # Clang builds currently fail with --native_exports_optional due to
-      # http://llvm.org/bugs/show_bug.cgi?id=22602 - only enable for gcc.
-      # http://crbug.com/442327
-      'variables': {
-        'native_exports%': '--native_exports_optional',
-      },
-    }],
   ],
 }
 
diff --git a/build/json_schema_api.gni b/build/json_schema_api.gni
index 68a9fdd..83846a2 100644
--- a/build/json_schema_api.gni
+++ b/build/json_schema_api.gni
@@ -183,7 +183,6 @@
       sources += get_target_outputs(":$schema_generator_name")
       public_deps += [ ":$schema_generator_name" ]
       deps += [ "//tools/json_schema_compiler:generated_api_util" ]
-      configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
     }
 
     if (bundle) {
diff --git a/build/sanitizers/tsan_suppressions.cc b/build/sanitizers/tsan_suppressions.cc
index 24c24d6..5704f2d 100644
--- a/build/sanitizers/tsan_suppressions.cc
+++ b/build/sanitizers/tsan_suppressions.cc
@@ -69,8 +69,8 @@
 "race:v8::Locker::Initialize\n"
 
 // http://crbug.com/223352
-"race:uprv_malloc_54\n"
-"race:uprv_realloc_54\n"
+"race:uprv_malloc_52\n"
+"race:uprv_realloc_52\n"
 
 // http://crbug.com/239359
 "race:media::TestInputCallback::OnData\n"
@@ -325,15 +325,6 @@
 // https://crbug.com/455665
 "race:mojo::common::*::tick_clock\n"
 
-// https://crbug.com/459429
-"race:randomnessPid\n"
-
-// https://crbug.com/460243
-"race:IPC::ChannelMojoHost::OnClientLaunched\n"
-
-// https://crbug.com/454655
-"race:content::BrowserTestBase::PostTaskToInProcessRendererAndWait\n"
-
 // End of suppressions.
 ;  // Please keep this semicolon.
 
diff --git a/build/secondary/third_party/cacheinvalidation/BUILD.gn b/build/secondary/third_party/cacheinvalidation/BUILD.gn
index feb93d7..088f89a 100644
--- a/build/secondary/third_party/cacheinvalidation/BUILD.gn
+++ b/build/secondary/third_party/cacheinvalidation/BUILD.gn
@@ -77,14 +77,17 @@
     "src/google/cacheinvalidation/include/types.h",
   ]
 
-  # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
-  configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
   public_configs = [ ":cacheinvalidation_config" ]
 
   deps = [
     "src/google/cacheinvalidation:cacheinvalidation_proto_cpp",
     "//base",
   ]
+
+  if (is_win) {
+    # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
+    cflags = [ "/wd4267" ]
+  }
 }
 
 test("cacheinvalidation_unittests") {
diff --git a/build/secondary/third_party/icu/BUILD.gn b/build/secondary/third_party/icu/BUILD.gn
index 53818c9..8b64f70 100644
--- a/build/secondary/third_party/icu/BUILD.gn
+++ b/build/secondary/third_party/icu/BUILD.gn
@@ -74,26 +74,6 @@
     "source/i18n/chnsecal.cpp",
     "source/i18n/choicfmt.cpp",
     "source/i18n/coleitr.cpp",
-    "source/i18n/collationbasedatabuilder.cpp",
-    "source/i18n/collationbuilder.cpp",
-    "source/i18n/collationcompare.cpp",
-    "source/i18n/collation.cpp",
-    "source/i18n/collationdatabuilder.cpp",
-    "source/i18n/collationdata.cpp",
-    "source/i18n/collationdatareader.cpp",
-    "source/i18n/collationdatawriter.cpp",
-    "source/i18n/collationfastlatinbuilder.cpp",
-    "source/i18n/collationfastlatin.cpp",
-    "source/i18n/collationfcd.cpp",
-    "source/i18n/collationiterator.cpp",
-    "source/i18n/collationkeys.cpp",
-    "source/i18n/collationroot.cpp",
-    "source/i18n/collationrootelements.cpp",
-    "source/i18n/collationruleparser.cpp",
-    "source/i18n/collationsets.cpp",
-    "source/i18n/collationsettings.cpp",
-    "source/i18n/collationtailoring.cpp",
-    "source/i18n/collationweights.cpp",
     "source/i18n/coll.cpp",
     "source/i18n/compactdecimalformat.cpp",
     "source/i18n/coptccal.cpp",
@@ -115,7 +95,6 @@
     "source/i18n/dcfmtsym.cpp",
     "source/i18n/decContext.c",
     "source/i18n/decfmtst.cpp",
-    "source/i18n/decimalformatpattern.cpp",
     "source/i18n/decimfmt.cpp",
     "source/i18n/decNumber.c",
     "source/i18n/digitlst.cpp",
@@ -126,7 +105,6 @@
     "source/i18n/dtrule.cpp",
     "source/i18n/esctrn.cpp",
     "source/i18n/ethpccal.cpp",
-    "source/i18n/filteredbrk.cpp",
     "source/i18n/fmtable_cnv.cpp",
     "source/i18n/fmtable.cpp",
     "source/i18n/format.cpp",
@@ -144,7 +122,6 @@
     "source/i18n/japancal.cpp",
     "source/i18n/locdspnm.cpp",
     "source/i18n/measfmt.cpp",
-    "source/i18n/measunit.cpp",
     "source/i18n/measure.cpp",
     "source/i18n/msgfmt.cpp",
     "source/i18n/name2uni.cpp",
@@ -160,7 +137,6 @@
     "source/i18n/plurfmt.cpp",
     "source/i18n/plurrule.cpp",
     "source/i18n/quant.cpp",
-    "source/i18n/quantityformatter.cpp",
     "source/i18n/rbnf.cpp",
     "source/i18n/rbt.cpp",
     "source/i18n/rbt_data.cpp",
@@ -173,17 +149,13 @@
     "source/i18n/regexst.cpp",
     "source/i18n/regextxt.cpp",
     "source/i18n/region.cpp",
-    "source/i18n/reldatefmt.cpp",
     "source/i18n/reldtfmt.cpp",
     "source/i18n/rematch.cpp",
     "source/i18n/remtrans.cpp",
     "source/i18n/repattrn.cpp",
-    "source/i18n/rulebasedcollator.cpp",
-    "source/i18n/scientificformathelper.cpp",
     "source/i18n/scriptset.cpp",
     "source/i18n/search.cpp",
     "source/i18n/selfmt.cpp",
-    "source/i18n/sharedbreakiterator.cpp",
     "source/i18n/simpletz.cpp",
     "source/i18n/smpdtfmt.cpp",
     "source/i18n/smpdtfst.cpp",
@@ -192,6 +164,7 @@
     "source/i18n/strrepl.cpp",
     "source/i18n/stsearch.cpp",
     "source/i18n/taiwncal.cpp",
+    "source/i18n/tblcoll.cpp",
     "source/i18n/timezone.cpp",
     "source/i18n/titletrn.cpp",
     "source/i18n/tmunit.cpp",
@@ -209,17 +182,21 @@
     "source/i18n/tzrule.cpp",
     "source/i18n/tztrans.cpp",
     "source/i18n/ucal.cpp",
-    "source/i18n/ucln_in.cpp",
+    "source/i18n/ucln_in.c",
+    "source/i18n/ucol_bld.cpp",
+    "source/i18n/ucol_cnt.cpp",
     "source/i18n/ucol.cpp",
     "source/i18n/ucoleitr.cpp",
+    "source/i18n/ucol_elm.cpp",
     "source/i18n/ucol_res.cpp",
     "source/i18n/ucol_sit.cpp",
+    "source/i18n/ucol_tok.cpp",
+    "source/i18n/ucol_wgt.cpp",
     "source/i18n/ucsdet.cpp",
     "source/i18n/ucurr.cpp",
     "source/i18n/udat.cpp",
     "source/i18n/udateintervalformat.cpp",
     "source/i18n/udatpg.cpp",
-    "source/i18n/uitercollationiterator.cpp",
     "source/i18n/ulocdata.c",
     "source/i18n/umsg.cpp",
     "source/i18n/unesctrn.cpp",
@@ -236,8 +213,6 @@
     "source/i18n/uspoof.cpp",
     "source/i18n/uspoof_impl.cpp",
     "source/i18n/uspoof_wsconf.cpp",
-    "source/i18n/utf16collationiterator.cpp",
-    "source/i18n/utf8collationiterator.cpp",
     "source/i18n/utmscale.c",
     "source/i18n/utrans.cpp",
     "source/i18n/vtzone.cpp",
@@ -311,9 +286,8 @@
     "source/common/errorcode.cpp",
     "source/common/filterednormalizer2.cpp",
     "source/common/icudataver.c",
-    "source/common/icuplug.cpp",
+    "source/common/icuplug.c",
     "source/common/listformatter.cpp",
-    "source/common/loadednormalizer2impl.cpp",
     "source/common/locavailable.cpp",
     "source/common/locbased.cpp",
     "source/common/locdispnames.cpp",
@@ -351,8 +325,6 @@
     "source/common/servnotf.cpp",
     "source/common/servrbf.cpp",
     "source/common/servslkf.cpp",
-    "source/common/sharedobject.cpp",
-    "source/common/simplepatternformatter.cpp",
     "source/common/stringpiece.cpp",
     "source/common/stringtriebuilder.cpp",
     "source/common/uarrsort.c",
@@ -370,7 +342,7 @@
     "source/common/ucharstrie.cpp",
     "source/common/ucharstrieiterator.cpp",
     "source/common/uchriter.cpp",
-    "source/common/ucln_cmn.cpp",
+    "source/common/ucln_cmn.c",
     "source/common/ucmndata.c",
     "source/common/ucnv2022.cpp",
     "source/common/ucnv_bld.cpp",
@@ -387,7 +359,7 @@
     "source/common/ucnvisci.c",
     "source/common/ucnvlat1.c",
     "source/common/ucnv_lmb.c",
-    "source/common/ucnvmbcs.cpp",
+    "source/common/ucnvmbcs.c",
     "source/common/ucnvscsu.c",
     "source/common/ucnvsel.cpp",
     "source/common/ucnv_set.c",
@@ -408,13 +380,11 @@
     "source/common/uiter.cpp",
     "source/common/ulist.c",
     "source/common/uloc.cpp",
-    "source/common/uloc_keytype.cpp",
     "source/common/uloc_tag.c",
     "source/common/umapfile.c",
     "source/common/umath.c",
     "source/common/umutex.cpp",
     "source/common/unames.cpp",
-    "source/common/unifiedcache.cpp",
     "source/common/unifilt.cpp",
     "source/common/unifunct.cpp",
     "source/common/uniset_closure.cpp",
@@ -429,6 +399,7 @@
     "source/common/unistr_titlecase_brkiter.cpp",
     "source/common/unormcmp.cpp",
     "source/common/unorm.cpp",
+    "source/common/unorm_it.c",
     "source/common/uobject.cpp",
     "source/common/uprops.cpp",
     "source/common/uresbund.cpp",
@@ -445,7 +416,7 @@
     "source/common/ustack.cpp",
     "source/common/ustrcase.cpp",
     "source/common/ustrcase_locale.cpp",
-    "source/common/ustr_cnv.cpp",
+    "source/common/ustr_cnv.c",
     "source/common/ustrenum.cpp",
     "source/common/ustrfmt.c",
     "source/common/ustring.cpp",
@@ -486,7 +457,6 @@
 
   if (is_win || icu_use_data_file) {
     sources += [ "source/stubdata/stubdata.c" ]
-    defines += [ "U_ICUDATAENTRY_IN_COMMON" ]
   }
 }
 
diff --git a/build/secondary/third_party/libjpeg_turbo/BUILD.gn b/build/secondary/third_party/libjpeg_turbo/BUILD.gn
index bf35d07..be16302 100644
--- a/build/secondary/third_party/libjpeg_turbo/BUILD.gn
+++ b/build/secondary/third_party/libjpeg_turbo/BUILD.gn
@@ -5,17 +5,17 @@
 # Do not use the targets in this file unless you need a certain libjpeg
 # implementation. Use the meta target //third_party:jpeg instead.
 
-if (current_cpu == "arm") {
+if (cpu_arch == "arm") {
   import("//build/config/arm.gni")
 }
 
-if (current_cpu == "x86" || current_cpu == "x64") {
+if (cpu_arch == "x86" || cpu_arch == "x64") {
   import("//third_party/yasm/yasm_assemble.gni")
 
   yasm_assemble("simd_asm") {
     defines = []
 
-    if (current_cpu == "x86") {
+    if (cpu_arch == "x86") {
       sources = [
         "simd/jccolmmx.asm",
         "simd/jccolss2.asm",
@@ -52,7 +52,7 @@
         "simd/jsimdcpu.asm",
       ]
       defines += [ "__x86__" ]
-    } else if (current_cpu == "x64") {
+    } else if (cpu_arch == "x64") {
       sources = [
         "simd/jccolss2-64.asm",
         "simd/jcgrass2-64.asm",
@@ -76,7 +76,7 @@
     if (is_win) {
       defines += [ "MSVC" ]
       include_dirs = [ "win" ]
-      if (current_cpu == "x86") {
+      if (cpu_arch == "x86") {
         defines += [ "WIN32" ]
       } else {
         defines += [ "WIN64" ]
@@ -92,7 +92,7 @@
 }
 
 source_set("simd") {
-  if (current_cpu == "x86") {
+  if (cpu_arch == "x86") {
     deps = [
       ":simd_asm",
     ]
@@ -102,14 +102,14 @@
     if (is_win) {
       cflags = [ "/wd4245" ]
     }
-  } else if (current_cpu == "x64") {
+  } else if (cpu_arch == "x64") {
     deps = [
       ":simd_asm",
     ]
     sources = [
       "simd/jsimd_x86_64.c",
     ]
-  } else if (current_cpu == "arm" && arm_version >= 7 &&
+  } else if (cpu_arch == "arm" && arm_version >= 7 &&
              (arm_use_neon || arm_optionally_use_neon)) {
     sources = [
       "simd/jsimd_arm.c",
diff --git a/build/secondary/third_party/libsrtp/BUILD.gn b/build/secondary/third_party/libsrtp/BUILD.gn
index d9b658e..506d19f 100644
--- a/build/secondary/third_party/libsrtp/BUILD.gn
+++ b/build/secondary/third_party/libsrtp/BUILD.gn
@@ -45,7 +45,7 @@
     ]
   }
 
-  if (current_cpu == "x64" || current_cpu == "x86" || current_cpu == "arm") {
+  if (cpu_arch == "x64" || cpu_arch == "x86" || cpu_arch == "arm") {
     defines += [
       # TODO(leozwang): CPU_RISC doesn"t work properly on android/arm
       # platform for unknown reasons, need to investigate the root cause
@@ -56,7 +56,7 @@
     ]
   }
 
-  if (current_cpu == "mipsel") {
+  if (cpu_arch == "mipsel") {
     defines += [ "CPU_RISC" ]
   }
 }
diff --git a/build/secondary/third_party/nss/BUILD.gn b/build/secondary/third_party/nss/BUILD.gn
index ee5f112..768a85d 100644
--- a/build/secondary/third_party/nss/BUILD.gn
+++ b/build/secondary/third_party/nss/BUILD.gn
@@ -217,10 +217,7 @@
         "//build/config/win:lean_and_mean",  # Won"t compile with lean and mean.
       ]
     }
-    configs += [
-      "//build/config/compiler:no_chromium_code",
-      "//build/config/compiler:no_size_t_to_int_warning",
-    ]
+    configs += [ "//build/config/compiler:no_chromium_code" ]
 
     cflags = []
     defines = [
@@ -231,7 +228,10 @@
     include_dirs = [ "nspr/pr/include/private" ]
 
     if (is_win) {
-      cflags = [ "/wd4554" ]  # Check precidence.
+      cflags = [
+        "/wd4554",  # Check precidence.
+        "/wd4267",  # Conversion from size_t to "type".
+      ]
       defines += [
         "XP_PC",
         "WIN32",
@@ -281,9 +281,9 @@
       ]
     }
 
-    if (current_cpu == "x86") {
+    if (cpu_arch == "x86") {
       defines += [ "_X86_" ]
-    } else if (current_cpu == "x64") {
+    } else if (cpu_arch == "x64") {
       defines += [ "_AMD64_" ]
     }
 
@@ -474,7 +474,7 @@
     ]
   }
 
-  if (is_win && current_cpu == "x86") {
+  if (is_win && cpu_arch == "x86") {
     source_set("nss_static_avx") {
       sources = [
         "nss/lib/freebl/intel-gcm-wrap.c",
@@ -882,10 +882,7 @@
     if (is_win) {
       configs -= [ "//build/config/win:unicode" ]  # Requires 8-bit mode.
     }
-    configs += [
-      "//build/config/compiler:no_chromium_code",
-      "//build/config/compiler:no_size_t_to_int_warning",
-    ]
+    configs += [ "//build/config/compiler:no_chromium_code" ]
     public_configs = [ ":nss_static_config" ]
 
     cflags = []
@@ -904,7 +901,10 @@
     ]
 
     if (is_win) {
-      cflags += [ "/wd4101" ]  # Unreferenced local variable.
+      cflags += [
+        "/wd4101",  # Unreferenced local variable.
+        "/wd4267",  # Conversion from size_t to "type".
+      ]
     }
 
     if (include_nss_libpkix) {
@@ -1094,7 +1094,7 @@
       defines += [ "NSS_DISABLE_ROOT_CERTS" ]
     }
 
-    if (current_cpu == "x64" && !is_win) {
+    if (cpu_arch == "x64" && !is_win) {
       sources -= [
         "nss/lib/freebl/chacha20/chacha20.c",
         "nss/lib/freebl/poly1305/poly1305.c",
@@ -1139,7 +1139,7 @@
         "WIN95",
       ]
 
-      if (current_cpu == "x86") {
+      if (cpu_arch == "x86") {
         defines += [
           "NSS_X86_OR_X64",
           "NSS_X86",
@@ -1153,7 +1153,7 @@
           "INTEL_GCM",
         ]
         sources -= [ "nss/lib/freebl/mpi/mpi_amd64.c" ]
-      } else if (current_cpu == "x64") {
+      } else if (cpu_arch == "x64") {
         sources -= [
           "nss/lib/freebl/intel-aes-x86-masm.asm",
           "nss/lib/freebl/mpi/mpi_amd64.c",
@@ -1204,7 +1204,7 @@
       "//third_party/sqlite",
     ]
 
-    if (is_win && current_cpu == "x86") {
+    if (is_win && cpu_arch == "x86") {
       deps += [ ":nss_static_avx" ]
     }
   }
diff --git a/build/toolchain/android/BUILD.gn b/build/toolchain/android/BUILD.gn
index 53ad506..e3d950a 100644
--- a/build/toolchain/android/BUILD.gn
+++ b/build/toolchain/android/BUILD.gn
@@ -18,7 +18,7 @@
 #      Subdirectory inside of android_ndk_sysroot where libs go.
 #  - tool_prefix
 #      Prefix to be added to the tool names.
-#  - toolchain_cpu
+#  - toolchain_cpu_arch
 #      Same as gcc_toolchain
 template("android_gcc_toolchain") {
   gcc_toolchain(target_name) {
@@ -51,7 +51,7 @@
     ld = cxx
 
     toolchain_os = "android"
-    toolchain_cpu = invoker.toolchain_cpu
+    toolchain_cpu_arch = invoker.toolchain_cpu_arch
 
     # We make the assumption that the gcc_toolchain will produce a soname with
     # the following definition.
@@ -85,7 +85,7 @@
   android_ndk_lib_dir = "usr/lib"
 
   tool_prefix = "$x86_android_toolchain_root/bin/i686-linux-android-"
-  toolchain_cpu = "x86"
+  toolchain_cpu_arch = "x86"
 }
 
 android_gcc_toolchain("arm") {
@@ -93,7 +93,7 @@
   android_ndk_lib_dir = "usr/lib"
 
   tool_prefix = "$arm_android_toolchain_root/bin/arm-linux-androideabi-"
-  toolchain_cpu = "arm"
+  toolchain_cpu_arch = "arm"
 }
 
 android_gcc_toolchain("mipsel") {
@@ -101,7 +101,7 @@
   android_ndk_lib_dir = "usr/lib"
 
   tool_prefix = "$mips_android_toolchain_root/bin/mipsel-linux-android-"
-  toolchain_cpu = "mipsel"
+  toolchain_cpu_arch = "mipsel"
 }
 
 android_gcc_toolchain("x64") {
@@ -109,7 +109,7 @@
   android_ndk_lib_dir = "usr/lib64"
 
   tool_prefix = "$x86_64_android_toolchain_root/bin/x86_64-linux-android-"
-  toolchain_cpu = "x86_64"
+  toolchain_cpu_arch = "x86_64"
 }
 
 android_gcc_toolchain("arm64") {
@@ -117,7 +117,7 @@
   android_ndk_lib_dir = "usr/lib"
 
   tool_prefix = "$arm64_android_toolchain_root/bin/arm-linux-androideabi-"
-  toolchain_cpu = "aarch64"
+  toolchain_cpu_arch = "aarch64"
 }
 
 android_gcc_toolchain("mips64el") {
@@ -125,5 +125,5 @@
   android_ndk_lib_dir = "usr/lib64"
 
   tool_prefix = "$mips64_android_toolchain_root/bin/mipsel-linux-android-"
-  toolchain_cpu = "mipsel64el"
+  toolchain_cpu_arch = "mipsel64el"
 }
diff --git a/build/toolchain/cros/BUILD.gn b/build/toolchain/cros/BUILD.gn
index 140958b..d360f72 100644
--- a/build/toolchain/cros/BUILD.gn
+++ b/build/toolchain/cros/BUILD.gn
@@ -29,7 +29,7 @@
   ar = "${cros_target_ar}"
   ld = cxx
 
-  toolchain_cpu = "${target_cpu}"
+  toolchain_cpu_arch = "${cpu_arch}"
   toolchain_os = "linux"
   is_clang = is_clang
 }
diff --git a/build/toolchain/gcc_toolchain.gni b/build/toolchain/gcc_toolchain.gni
index 5f49f68..5cca299 100644
--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -14,10 +14,10 @@
 #  - ar
 #  - ld
 # and the following which is used in the toolchain_args
-#  - toolchain_cpu  (What "current_cpu" should be set to when invoking a
-#                    build using this toolchain.)
-#  - toolchain_os  (What "current_os" should be set to when invoking a
-#                   build using this toolchain.)
+#  - toolchain_cpu_arch  (What "cpu_arch" should be set to when invoking a
+#                         build using this toolchain.)
+#  - toolchain_os  (What "os" should be set to when invoking a build using this
+#                   toolchain.)
 #
 # Optional parameters:
 #  - libs_section_prefix
@@ -40,8 +40,8 @@
     assert(defined(invoker.cxx), "gcc_toolchain() must specify a \"cxx\" value")
     assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value")
     assert(defined(invoker.ld), "gcc_toolchain() must specify a \"ld\" value")
-    assert(defined(invoker.toolchain_cpu),
-           "gcc_toolchain() must specify a \"toolchain_cpu\"")
+    assert(defined(invoker.toolchain_cpu_arch),
+           "gcc_toolchain() must specify a \"toolchain_cpu_arch\"")
     assert(defined(invoker.toolchain_os),
            "gcc_toolchain() must specify a \"toolchain_os\"")
 
@@ -204,19 +204,8 @@
     # When invoking this toolchain not as the default one, these args will be
     # passed to the build. They are ignored when this is the default toolchain.
     toolchain_args() {
-      current_cpu = invoker.toolchain_cpu
-      current_os = invoker.toolchain_os
-
-      # These values need to be passed through unchanged.
-      target_os = target_os
-      target_cpu = target_cpu
-
-      # TODO(dpranke): These values are here for backwards compatibility and
-      # should be deleted when all of the builders and configs have been
-      # updated.
-      cpu_arch = current_cpu
-      os = current_os
-
+      cpu_arch = invoker.toolchain_cpu_arch
+      os = invoker.toolchain_os
       if (defined(invoker.is_clang)) {
         is_clang = invoker.is_clang
       }
diff --git a/build/toolchain/linux/BUILD.gn b/build/toolchain/linux/BUILD.gn
index 7bcd9d0..1d17772 100644
--- a/build/toolchain/linux/BUILD.gn
+++ b/build/toolchain/linux/BUILD.gn
@@ -24,7 +24,7 @@
   ar = "arm-linux-gnueabi-ar"
   ld = cxx
 
-  toolchain_cpu = "arm"
+  toolchain_cpu_arch = "arm"
   toolchain_os = "linux"
   is_clang = false
 }
@@ -43,7 +43,7 @@
   ar = "ar"
   ld = cxx
 
-  toolchain_cpu = "x86"
+  toolchain_cpu_arch = "x86"
   toolchain_os = "linux"
   is_clang = true
 }
@@ -55,7 +55,7 @@
   ar = "ar"
   ld = cxx
 
-  toolchain_cpu = "x86"
+  toolchain_cpu_arch = "x86"
   toolchain_os = "linux"
   is_clang = false
 }
@@ -74,7 +74,7 @@
   ar = "ar"
   ld = cxx
 
-  toolchain_cpu = "x64"
+  toolchain_cpu_arch = "x64"
   toolchain_os = "linux"
   is_clang = true
 }
@@ -86,7 +86,7 @@
   ar = "ar"
   ld = cxx
 
-  toolchain_cpu = "x64"
+  toolchain_cpu_arch = "x64"
   toolchain_os = "linux"
   is_clang = false
 }
@@ -97,7 +97,7 @@
   ar = "mipsel-linux-gnu-ar"
   ld = cxx
 
-  toolchain_cpu = "mipsel"
+  toolchain_cpu_arch = "mipsel"
   toolchain_os = "linux"
   is_clang = false
 }
diff --git a/build/toolchain/mac/BUILD.gn b/build/toolchain/mac/BUILD.gn
index 18ee8b8..0560714 100644
--- a/build/toolchain/mac/BUILD.gn
+++ b/build/toolchain/mac/BUILD.gn
@@ -194,17 +194,14 @@
     }
 
     toolchain_args() {
-      current_os = invoker.toolchain_os
-
-      # TODO(dpranke): os is here for backwards compatibility.
-      os = current_os
+      os = invoker.toolchain_os
     }
   }
 }
 
 # Toolchain representing the target build (either mac or iOS).
 mac_clang_toolchain("clang") {
-  toolchain_os = current_os
+  toolchain_os = os
 }
 
 # This toolchain provides a way for iOS target compiles to reference targets
diff --git a/build/toolchain/nacl/BUILD.gn b/build/toolchain/nacl/BUILD.gn
index 5fa637c..b923608 100644
--- a/build/toolchain/nacl/BUILD.gn
+++ b/build/toolchain/nacl/BUILD.gn
@@ -54,7 +54,7 @@
   toolchain_args() {
     # Override the default OS detection. The build config will set the is_*
     # flags accordingly.
-    current_os = "nacl"
+    os = "nacl"
 
     # Component build not supported in NaCl, since it does not support shared
     # libraries.
diff --git a/build/toolchain/win/BUILD.gn b/build/toolchain/win/BUILD.gn
index e9461a4..b8f87e7 100644
--- a/build/toolchain/win/BUILD.gn
+++ b/build/toolchain/win/BUILD.gn
@@ -31,7 +31,7 @@
                                gyp_win_tool_path,
                                windows_sdk_path,
                                visual_studio_runtime_dirs,
-                               current_cpu,
+                               cpu_arch,
                              ],
                              "scope")
 
@@ -43,7 +43,7 @@
 concurrent_links = exec_script("../get_concurrent_links.py", [], "value")
 
 # Parameters:
-#  current_cpu: current_cpu to pass as a build arg
+#  cpu_arch: cpu_arch to pass as a build arg
 #  environment: File name of environment file.
 template("msvc_toolchain") {
   if (defined(invoker.concurrent_links)) {
@@ -62,7 +62,7 @@
                 "copy_dlls",
                 rebase_path(root_build_dir),
                 configuration,
-                invoker.current_cpu,
+                invoker.cpu_arch,
               ])
 
   if (use_goma) {
@@ -200,10 +200,7 @@
     # When invoking this toolchain not as the default one, these args will be
     # passed to the build. They are ignored when this is the default toolchain.
     toolchain_args() {
-      current_cpu = invoker.current_cpu
-
-      # TODO(dpranke): cpu_arch is here for backwards compatibility.
-      cpu_arch = current_cpu
+      cpu_arch = invoker.cpu_arch
     }
   }
 }
@@ -212,18 +209,16 @@
 # get it sorted out how we want to support them both in a single build.
 # Right now only one of these can be enabled at a time because the
 # runtime libraries get copied to root_build_dir and would collide.
-if (current_cpu == "x86") {
+if (cpu_arch == "x86") {
   msvc_toolchain("32") {
     environment = "environment.x86"
-
-    current_cpu = "x86"
+    cpu_arch = "x86"
   }
 }
 
-if (current_cpu == "x64") {
+if (cpu_arch == "x64") {
   msvc_toolchain("64") {
     environment = "environment.x64"
-
-    current_cpu = "x64"
+    cpu_arch = "x64"
   }
 }
diff --git a/build/toolchain/win/midl.gni b/build/toolchain/win/midl.gni
index 30bcbf7..ce310d1 100644
--- a/build/toolchain/win/midl.gni
+++ b/build/toolchain/win/midl.gni
@@ -56,10 +56,10 @@
       "$out_dir/$proxy_file",
     ]
 
-    if (current_cpu == "x86") {
+    if (cpu_arch == "x86") {
       win_tool_arch = "environment.x86"
       idl_target_platform = "win32"
-    } else if (current_cpu == "x64") {
+    } else if (cpu_arch == "x64") {
       win_tool_arch = "environment.x64"
       idl_target_platform = "x64"
     } else {
diff --git a/build/toolchain/win/setup_toolchain.py b/build/toolchain/win/setup_toolchain.py
index bc9bd1e..cc89638 100644
--- a/build/toolchain/win/setup_toolchain.py
+++ b/build/toolchain/win/setup_toolchain.py
@@ -51,23 +51,23 @@
   return env
 
 
-def _SetupScript(target_cpu, sdk_dir):
+def _SetupScript(target_arch, sdk_dir):
   """Returns a command (with arguments) to be used to set up the
   environment."""
   # Check if we are running in the SDK command line environment and use
-  # the setup script from the SDK if so. |target_cpu| should be either
+  # the setup script from the SDK if so. |target_arch| should be either
   # 'x86' or 'x64'.
-  assert target_cpu in ('x86', 'x64')
+  assert target_arch in ('x86', 'x64')
   if bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', 1))) and sdk_dir:
     return [os.path.normpath(os.path.join(sdk_dir, 'Bin/SetEnv.Cmd')),
-            '/' + target_cpu]
+            '/' + target_arch]
   else:
     # We only support x64-hosted tools.
     # TODO(scottmg|dpranke): Non-depot_tools toolchain: need to get Visual
     # Studio install location from registry.
     return [os.path.normpath(os.path.join(os.environ['GYP_MSVS_OVERRIDE_PATH'],
                                           'VC/vcvarsall.bat')),
-            'amd64_x86' if target_cpu == 'x86' else 'amd64']
+            'amd64_x86' if target_arch == 'x86' else 'amd64']
 
 
 def _FormatAsEnvironmentBlock(envvar_dict):
@@ -100,25 +100,25 @@
   if len(sys.argv) != 6:
     print('Usage setup_toolchain.py '
           '<visual studio path> <win tool path> <win sdk path> '
-          '<runtime dirs> <target_cpu>')
+          '<runtime dirs> <cpu_arch>')
     sys.exit(2)
   tool_source = sys.argv[2]
   win_sdk_path = sys.argv[3]
   runtime_dirs = sys.argv[4]
-  target_cpu = sys.argv[5]
+  cpu_arch = sys.argv[5]
 
   _CopyTool(tool_source)
 
-  cpus = ('x86', 'x64')
-  assert target_cpu in cpus
+  archs = ('x86', 'x64')
+  assert cpu_arch in archs
   vc_bin_dir = ''
 
   # TODO(scottmg|goma): Do we need an equivalent of
   # ninja_use_custom_environment_files?
 
-  for cpu in cpus:
+  for arch in archs:
     # Extract environment variables for subprocesses.
-    args = _SetupScript(cpu, win_sdk_path)
+    args = _SetupScript(arch, win_sdk_path)
     args.extend(('&&', 'set'))
     popen = subprocess.Popen(
         args, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
@@ -126,7 +126,7 @@
     env = _ExtractImportantEnvironment(variables)
     env['PATH'] = runtime_dirs + ';' + env['PATH']
 
-    if cpu == target_cpu:
+    if arch == cpu_arch:
       for path in env['PATH'].split(os.pathsep):
         if os.path.exists(os.path.join(path, 'cl.exe')):
           vc_bin_dir = os.path.realpath(path)
@@ -143,7 +143,7 @@
                                   sdk_dir=win_sdk_path)
       env['INCLUDE'] = additional_includes + env['INCLUDE']
     env_block = _FormatAsEnvironmentBlock(env)
-    with open('environment.' + cpu, 'wb') as f:
+    with open('environment.' + arch, 'wb') as f:
       f.write(env_block)
 
   assert vc_bin_dir
diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py
index 5b175eb..6f49e7c 100644
--- a/build/vs_toolchain.py
+++ b/build/vs_toolchain.py
@@ -129,11 +129,11 @@
                        source_x64)
 
 
-def CopyDlls(target_dir, configuration, target_cpu):
+def CopyDlls(target_dir, configuration, cpu_arch):
   """Copy the VS runtime DLLs into the requested directory as needed.
 
   configuration is one of 'Debug' or 'Release'.
-  target_cpu is one of 'x86' or 'x64'.
+  cpu_arch is one of 'x86' or 'x64'.
 
   The debug configuration gets both the debug and release DLLs; the
   release config only the latter.
@@ -143,7 +143,7 @@
     return
 
   x64_runtime, x86_runtime = vs2013_runtime_dll_dirs
-  runtime_dir = x64_runtime if target_cpu == 'x64' else x86_runtime
+  runtime_dir = x64_runtime if cpu_arch == 'x64' else x86_runtime
   _CopyRuntime(target_dir, runtime_dir, 'msvc%s120.dll')
   if configuration == 'Debug':
     _CopyRuntime(target_dir, runtime_dir, 'msvc%s120d.dll')
diff --git a/build/win/install-build-deps.py b/build/win/install-build-deps.py
new file mode 100755
index 0000000..d9e50b6
--- /dev/null
+++ b/build/win/install-build-deps.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import shutil
+import sys
+import os
+
+def patch_msbuild():
+  """VS2010 MSBuild has a ULDI bug that we patch here. See http://goo.gl/Pn8tj.
+  """
+  source_path = os.path.join(os.environ['ProgramFiles(x86)'],
+                             "MSBuild",
+                             "Microsoft.Cpp",
+                             "v4.0",
+                             "Microsoft.CppBuild.targets")
+  backup_path = source_path + ".backup"
+  if not os.path.exists(backup_path):
+    try:
+      print "Backing up %s..." % source_path
+      shutil.copyfile(source_path, backup_path)
+    except IOError:
+      print "Could not back up %s to %s. Run as Administrator?" % (
+          source_path, backup_path)
+      return 1
+
+  source = open(source_path).read()
+  base = ('''<Target Name="GetResolvedLinkObjs" Returns="@(ObjFullPath)" '''
+          '''DependsOnTargets="$(CommonBuildOnlyTargets);ComputeCLOutputs;'''
+          '''ResolvedLinkObjs"''')
+  find = base + '>'
+  replace = base + ''' Condition="'$(ConfigurationType)'=='StaticLibrary'">'''
+  result = source.replace(find, replace)
+
+  if result != source:
+    open(source_path, "w").write(result)
+    print "Patched %s." % source_path
+  return 0
+
+
+def main():
+  return patch_msbuild()
+
+
+if __name__ == "__main__":
+  sys.exit(main())