Hook up GN to the GYP build system.

This is a reland of 236542 and 238454 (runs GN in GYP mode before actually running GYP), plus some additions

Move GYP_DEFINES parsing to Python for GN.

I pass in a GN-compatible list of variable sets on the command line from Python. This allows us to parse chromium.gyp_env and src/*/supplemental.gypi in Python like normal without having to duplicate Python dictionary parsing in GN.

Currently, GN does not produce any files used by the build, these will be added in a second step.

BUG=321352
TBR=bradnelson@google.com

Review URL: https://codereview.chromium.org/101573004

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238475 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 238475
[Mojo] Move JS bindings out of public

This CL moves the implementation of Mojo's JavaScript bindings out of the
"public" directory. The public directory is intended to be free of dependencies
on other parts of Chromium, but the JavaScript bindings depend on V8 and base.
Now, the bindings are just a subdirectory of mojo/apps/js, which is their only
client. This makes mojo.js more of a self-contained app.

R=darin@chromium.org

Review URL: https://codereview.chromium.org/100573003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238476 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 238476
Merge branch 'master' into pullgn2

Conflicts:
	tools/gn/bin/win/gn.exe.sha1

iPull GN binary at 238460

Pull Windows GN binary @238460 (debug build).

This is to help debuf issues since it will have proper stack traces.

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238479 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 238479
Fix flaky AudioStreamHandler initialization.

AudioStreamHandler was calling into the AudioManager on the wrong
thread.  On OSX this will lead to undefined behavior since the
CoreAudio API is not thread safe.

Sadly due to antique unit tests, we don't have the proper DCHECKs
in place to catch bad behavior automatically.  I've filed the bug
below to track this effort.

In this case we can simply use a fixed buffer size since ASH is
using MakeAudioOutputStreamProxy() which will take care of any
necessary rebuffering and resampling.

BUG=325373
TEST=none
R=scherkus@chromium.org

Review URL: https://codereview.chromium.org/102693003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238484 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 238484
Fix crash during build/gyp_chromium time.

Without GYP_DEFINES set, build/gyp_chromium would crash with

Generating gyp files from GN...
Traceback (most recent call last):
  File "./build/gyp_chromium", line 207, in <module>
    if not RunGN(supplemental_includes):
  File "./build/gyp_chromium", line 147, in RunGN
    gyp_vars = GetVarsStringForGN(supplemental_includes)
  File "./build/gyp_chromium", line 79, in GetVarsStringForGN
    items = shlex.split(env_string)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 279, in split
    return list(lex)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 269, in next
    token = self.get_token()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 96, in get_token
    raw = self.read_token()
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shlex.py", line 124, in read_token
    nextchar = self.instream.read(1)
AttributeError: 'list' object has no attribute 'read'

This was broken by r238475

BUG=321352

Review URL: https://codereview.chromium.org/103253002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238486 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 238486