Add checkout_nacl gclient flag (default true) (attempt #3).

This is a straight (merged) re-land of {#507355}, since
the bug in gclient that this tickled was fixed.

See https://groups.google.com/a/chromium.org/d/msg/chromium-dev/tO8kIrDtQc8/bCRO-UXxBQAJ
for discussion.

TBR=phajdan.jr@chromium.org, bradnelson@chromium.org
BUG=756688

Change-Id: Ife1ed0f30285828e37170306e2723fd70f591d6d
Reviewed-on: https://chromium-review.googlesource.com/750363
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513416}
diff --git a/DEPS b/DEPS
index cc6b30dd..861e7f8 100644
--- a/DEPS
+++ b/DEPS
@@ -26,6 +26,11 @@
 #  git commit -a
 #  git cl upload
 
+gclient_gn_args_file = 'src/build/config/gclient_args.gni'
+gclient_gn_args = [
+  'checkout_nacl',
+]
+
 
 vars = {
   # By default, we should check out everything needed to run on the main
@@ -34,6 +39,10 @@
   # purposes.
   'checkout_configuration': 'default',
 
+  # Check out and download nacl by default. This can be disabled e.g. with
+  # custom_vars.
+  'checkout_nacl': True,
+
   # By default, do not check out src-internal. This can be overridden e.g. with
   # custom_vars.
   'checkout_src_internal': False,
@@ -215,8 +224,10 @@
   'src/media/cdm/api':
     Var('chromium_git') + '/chromium/cdm.git' + '@' + 'ea5df8e78fbd0a4c24cc3a1f3faefefcd1b45237',
 
-  'src/native_client':
-    Var('chromium_git') + '/native_client/src/native_client.git' + '@' + Var('nacl_revision'),
+  'src/native_client': {
+      'url': Var('chromium_git') + '/native_client/src/native_client.git' + '@' + Var('nacl_revision'),
+      'condition': 'checkout_nacl',
+  },
 
   'src/third_party/SPIRV-Tools/src':
     Var('chromium_git') + '/external/github.com/KhronosGroup/SPIRV-Tools.git' + '@' + '9166854ac93ef81b026e943ccd230fed6c8b8d3c',
@@ -353,7 +364,7 @@
   # GNU binutils assembler for x86-32.
   'src/third_party/gnu_binutils': {
       'url': Var('chromium_git') + '/native_client/deps/third_party/gnu_binutils.git' + '@' + 'f4003433b61b25666565690caf3d7a7a1a4ec436',
-      'condition': 'checkout_win',
+      'condition': 'checkout_nacl and checkout_win',
   },
 
   'src/third_party/gperf': {
@@ -470,7 +481,7 @@
   # GNU binutils assembler for x86-64.
   'src/third_party/mingw-w64/mingw/bin': {
       'url': Var('chromium_git') + '/native_client/deps/third_party/mingw-w64/mingw/bin.git' + '@' + '3cc8b140b883a9fe4986d12cfd46c16a093d3527',
-      'condition': 'checkout_win',
+      'condition': 'checkout_nacl and checkout_win',
   },
 
   # Graphics buffer allocator for Chrome OS.
@@ -493,7 +504,7 @@
   # Binaries for nacl sdk.
   'src/third_party/nacl_sdk_binaries': {
       'url': Var('chromium_git') + '/chromium/deps/nacl_sdk_binaries.git' + '@' + '759dfca03bdc774da7ecbf974f6e2b84f43699a5',
-      'condition': 'checkout_win',
+      'condition': 'checkout_nacl and checkout_win',
   },
 
   'src/third_party/netty-tcnative/src': {
@@ -714,6 +725,7 @@
     # anywhere from 30 minutes to 4 hours depending on platform to build.
     'name': 'nacltools',
     'pattern': '.',
+    'condition': 'checkout_nacl',
     'action': [
         'python',
         'src/build/download_nacl_toolchains.py',