View | Details | Raw Unified | Return to bug 226476 | Differences between
and this patch

Collapse All | Expand All

(-)b/Mk/Uses/gecko.mk (-2 / +2 lines)
Lines 37-48 RUN_DEPENDS+= libxul>=45:www/libxul Link Here
37
.elif ${gecko_ARGS:Mfirefox}
37
.elif ${gecko_ARGS:Mfirefox}
38
38
39
_GECKO_DEFAULT_VERSION=	52
39
_GECKO_DEFAULT_VERSION=	52
40
_GECKO_VERSIONS=		52 59
40
_GECKO_VERSIONS=		52 60
41
_GECKO_TYPE=	firefox
41
_GECKO_TYPE=	firefox
42
42
43
# Dependence lines for different Firefox versions
43
# Dependence lines for different Firefox versions
44
52_DEPENDS=		${LOCALBASE}/lib/firefox/firefox:www/firefox-esr
44
52_DEPENDS=		${LOCALBASE}/lib/firefox/firefox:www/firefox-esr
45
59_DEPENDS=		${LOCALBASE}/lib/firefox/firefox:www/firefox
45
60_DEPENDS=		${LOCALBASE}/lib/firefox/firefox:www/firefox
46
46
47
.if exists(${LOCALBASE}/bin/firefox)
47
.if exists(${LOCALBASE}/bin/firefox)
48
_GECKO_INSTALLED_VER!=	${LOCALBASE}/bin/firefox --version 2>/dev/null
48
_GECKO_INSTALLED_VER!=	${LOCALBASE}/bin/firefox --version 2>/dev/null
(-)b/www/firefox-i18n/Makefile (-5 / +4 lines)
Lines 2-12 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	firefox-i18n
4
PORTNAME=	firefox-i18n
5
PORTVERSION=	59.0
5
PORTVERSION=	60.0b2
6
PORTREVISION=	1
7
CATEGORIES=	www
6
CATEGORIES=	www
8
MASTER_SITES=	MOZILLA/${PORTNAME:S|-i18n||}/releases/${DISTVERSION}/linux-i686/xpi \
7
MASTER_SITES=	MOZILLA/devedition/releases/${DISTVERSION}/linux-i686/xpi \
9
		MOZILLA/${PORTNAME:S|-i18n||}/candidates/${DISTVERSION}-candidates/build4/linux-i686/xpi
8
		MOZILLA/devedition/candidates/${DISTVERSION}-candidates/build1/linux-i686/xpi
10
PKGNAMEPREFIX=
9
PKGNAMEPREFIX=
11
DISTFILES=	${FIREFOX_I18N_:S/$/.xpi/}
10
DISTFILES=	${FIREFOX_I18N_:S/$/.xpi/}
12
DIST_SUBDIR=	xpi/${DISTNAME}
11
DIST_SUBDIR=	xpi/${DISTNAME}
Lines 16-22 COMMENT= Localized interface for Firefox Link Here
16
15
17
EXTRACT_DEPENDS=	zip:archivers/zip
16
EXTRACT_DEPENDS=	zip:archivers/zip
18
17
19
USES=		zip:infozip gecko:firefox,59,build
18
USES=		zip:infozip gecko:firefox,60,build
20
USE_XPI=	firefox
19
USE_XPI=	firefox
21
20
22
NO_ARCH=	yes
21
NO_ARCH=	yes
(-)b/www/firefox-i18n/Makefile.lang (-1 / +4 lines)
Lines 6-12 FIREFOX_I18N_ALL_= ach af an ar as ast az be bg bn-BD bn-IN br bs ca cak \ Link Here
6
			es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gn	\
6
			es-ES es-MX et eu fa ff fi fr fy-NL ga-IE gd gl gn	\
7
			gu-IN he hi-IN hr hsb hu hy-AM ia id is it ja ka kab	\
7
			gu-IN he hi-IN hr hsb hu hy-AM ia id is it ja ka kab	\
8
			kk km kn ko lij lt lv mai mk ml mr ms my nb-NO ne-NP nl	\
8
			kk km kn ko lij lt lv mai mk ml mr ms my nb-NO ne-NP nl	\
9
			nn-NO or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son	\
9
			nn-NO oc or pa-IN pl pt-BR pt-PT rm ro ru si sk sl son	\
10
			sq sr sv-SE ta te th tr uk ur uz vi xh zh-CN zh-TW
10
			sq sr sv-SE ta te th tr uk ur uz vi xh zh-CN zh-TW
11
11
12
.if defined(FIREFOX_I18N_ALL) || defined(PACKAGE_BUILDING) || target(package)
12
.if defined(FIREFOX_I18N_ALL) || defined(PACKAGE_BUILDING) || target(package)
Lines 225-230 FIREFOX_I18N+= nl Link Here
225
.if ${PORT_OPTIONS:MLANG_NN}
225
.if ${PORT_OPTIONS:MLANG_NN}
226
FIREFOX_I18N+=  nn-NO
226
FIREFOX_I18N+=  nn-NO
227
.endif
227
.endif
228
.if ${PORT_OPTIONS:MLANG_OC}
229
FIREFOX_I18N+=  oc
230
.endif
228
.if ${PORT_OPTIONS:MLANG_OR}
231
.if ${PORT_OPTIONS:MLANG_OR}
229
FIREFOX_I18N+=  or
232
FIREFOX_I18N+=  or
230
.endif
233
.endif
(-)b/www/firefox-i18n/Makefile.option (+2 lines)
Lines 73-78 OPTIONS_DEFINE= LANG_ACH \ Link Here
73
		LANG_NE \
73
		LANG_NE \
74
		LANG_NL \
74
		LANG_NL \
75
		LANG_NN \
75
		LANG_NN \
76
		LANG_OC \
76
		LANG_OR \
77
		LANG_OR \
77
		LANG_PA \
78
		LANG_PA \
78
		LANG_PL \
79
		LANG_PL \
Lines 122-127 LANG_LIJ_DESC?= Ligurian (Genoa) language support Link Here
122
LANG_MS_DESC?=	Malay language support
123
LANG_MS_DESC?=	Malay language support
123
LANG_MY_DESC?=	Burmese language support
124
LANG_MY_DESC?=	Burmese language support
124
LANG_NE_DESC?=	Nepali language support
125
LANG_NE_DESC?=	Nepali language support
126
LANG_OC_DESC?=	Occitan (lengadocian) language support
125
LANG_SW_DESC?=	Swahili language support
127
LANG_SW_DESC?=	Swahili language support
126
LANG_UR_DESC?=	Urdu (Pakistan) language support
128
LANG_UR_DESC?=	Urdu (Pakistan) language support
127
LANG_UZ_DESC?=	Uzbek language support
129
LANG_UZ_DESC?=	Uzbek language support
(-)b/www/firefox-i18n/distinfo (-195 / +197 lines)
Lines 1-195 Link Here
1
TIMESTAMP = 1520456550
1
TIMESTAMP = 1520432739
2
SHA256 (xpi/firefox-i18n-59.0/ach.xpi) = 1d3c6166b27b5e640733210faf4e7fa751d1acb8edd80448fd5cfb840c491987
2
SHA256 (xpi/firefox-i18n-60.0b2/ach.xpi) = 549dddc28203d1d9305ce994fc381711ce4fbed591bf8e81f2e7d827113db4d5
3
SIZE (xpi/firefox-i18n-59.0/ach.xpi) = 439224
3
SIZE (xpi/firefox-i18n-60.0b2/ach.xpi) = 449090
4
SHA256 (xpi/firefox-i18n-59.0/af.xpi) = 21ef31da94eb74b269e65c47961f93d17827a480756d282cf367f3ec4998866c
4
SHA256 (xpi/firefox-i18n-60.0b2/af.xpi) = f651b2abdb84a7d11cffab8dcf62f37491d3817f5726226f8c3736ff106c527f
5
SIZE (xpi/firefox-i18n-59.0/af.xpi) = 436729
5
SIZE (xpi/firefox-i18n-60.0b2/af.xpi) = 446394
6
SHA256 (xpi/firefox-i18n-59.0/an.xpi) = e544fcac272f5b3ee9365c53063164fb6f93e323c61fb0154e744fe046d0e348
6
SHA256 (xpi/firefox-i18n-60.0b2/an.xpi) = 059f8796c4f6ab4a1b3bf05e207b8ef90f2cce1218ec2392c032e93cc73042cc
7
SIZE (xpi/firefox-i18n-59.0/an.xpi) = 463403
7
SIZE (xpi/firefox-i18n-60.0b2/an.xpi) = 473114
8
SHA256 (xpi/firefox-i18n-59.0/ar.xpi) = 6443febaa553ae1f843a20ca5c78be7db122ffa98289f100cca883c86b17fb0a
8
SHA256 (xpi/firefox-i18n-60.0b2/ar.xpi) = 2a38a633aa50a6a6f2bb76060f6e479ad2a098a326aa74bed6f15fb95615b31c
9
SIZE (xpi/firefox-i18n-59.0/ar.xpi) = 486631
9
SIZE (xpi/firefox-i18n-60.0b2/ar.xpi) = 497449
10
SHA256 (xpi/firefox-i18n-59.0/as.xpi) = b8baf8448a59e13ae8ed5794f9a1b796f34029add488dc215023ff12c5549ccb
10
SHA256 (xpi/firefox-i18n-60.0b2/as.xpi) = d52da64632f045a5544e21693e26498457ed064bc95479c705a6a86789521349
11
SIZE (xpi/firefox-i18n-59.0/as.xpi) = 483300
11
SIZE (xpi/firefox-i18n-60.0b2/as.xpi) = 490528
12
SHA256 (xpi/firefox-i18n-59.0/ast.xpi) = 82876aa720ab6c98c5c1dd12fde7d62a47d1c42a87d70666b765144e620334e2
12
SHA256 (xpi/firefox-i18n-60.0b2/ast.xpi) = 17a0af0a95fa2040d3f26cd449c92bdac51ccd823deee13933be54031ae0b8b2
13
SIZE (xpi/firefox-i18n-59.0/ast.xpi) = 454341
13
SIZE (xpi/firefox-i18n-60.0b2/ast.xpi) = 464535
14
SHA256 (xpi/firefox-i18n-59.0/az.xpi) = e799b35e4a8d2272378b6f0fadee5777660af8d96e6cfa9b23d5d4e3a7088693
14
SHA256 (xpi/firefox-i18n-60.0b2/az.xpi) = 737639e42ea7a4ee34de4fade44db8d14740f94ee3510529f1a99b77bd85f857
15
SIZE (xpi/firefox-i18n-59.0/az.xpi) = 464267
15
SIZE (xpi/firefox-i18n-60.0b2/az.xpi) = 474699
16
SHA256 (xpi/firefox-i18n-59.0/be.xpi) = d4852d209ee8dfa9b88abc418f48cbb4df9599de9c4000455f50533ddc1dba08
16
SHA256 (xpi/firefox-i18n-60.0b2/be.xpi) = cbbd91eb437763799a17859bf339e96af3bfdbc26f397212182e0910bb80f047
17
SIZE (xpi/firefox-i18n-59.0/be.xpi) = 517058
17
SIZE (xpi/firefox-i18n-60.0b2/be.xpi) = 526494
18
SHA256 (xpi/firefox-i18n-59.0/bg.xpi) = ee011edf65e91faa21c8a75b8f9922484a899b4d6762f0a6a5f3b9f35521c2b3
18
SHA256 (xpi/firefox-i18n-60.0b2/bg.xpi) = 183042ae5dde5703cefc04e436005e29e4379d6701d13e64f564ed2cab83fe09
19
SIZE (xpi/firefox-i18n-59.0/bg.xpi) = 508611
19
SIZE (xpi/firefox-i18n-60.0b2/bg.xpi) = 518924
20
SHA256 (xpi/firefox-i18n-59.0/bn-BD.xpi) = 5c39189efa5daf9e8d6574b98bed66edad98bd0a4459955c666c5a9734c16d28
20
SHA256 (xpi/firefox-i18n-60.0b2/bn-BD.xpi) = 0e0b99ba805666a88f5352bd1003c21ae5e73b48e1c990b572bb57f531d7b286
21
SIZE (xpi/firefox-i18n-59.0/bn-BD.xpi) = 526351
21
SIZE (xpi/firefox-i18n-60.0b2/bn-BD.xpi) = 536619
22
SHA256 (xpi/firefox-i18n-59.0/bn-IN.xpi) = cdacc3c3002f4bb335b13bea1ddf22d0725938156afe257d45ad1a2e1148aa68
22
SHA256 (xpi/firefox-i18n-60.0b2/bn-IN.xpi) = 3771ee7e2423b2915b1f116d9ceb02eb2124d0d7e57560cc79ef436c4d97f5f8
23
SIZE (xpi/firefox-i18n-59.0/bn-IN.xpi) = 510795
23
SIZE (xpi/firefox-i18n-60.0b2/bn-IN.xpi) = 521938
24
SHA256 (xpi/firefox-i18n-59.0/br.xpi) = dfa4af49f1c379c1e299d252ba416310775c0f6a5802b1f26bb6610e20ab890d
24
SHA256 (xpi/firefox-i18n-60.0b2/br.xpi) = 33b6d07d848d8a57006d36f1e211ba6479d27c3eadd0780b4a2c8f631e133915
25
SIZE (xpi/firefox-i18n-59.0/br.xpi) = 451718
25
SIZE (xpi/firefox-i18n-60.0b2/br.xpi) = 461633
26
SHA256 (xpi/firefox-i18n-59.0/bs.xpi) = 75b095a9128248737edcb22a5c7926c51f1657762549453fe5dba045628baa97
26
SHA256 (xpi/firefox-i18n-60.0b2/bs.xpi) = 93f5937844ef793eefca086613a7c20f0d56e9053f931e3d62872afd968def47
27
SIZE (xpi/firefox-i18n-59.0/bs.xpi) = 457857
27
SIZE (xpi/firefox-i18n-60.0b2/bs.xpi) = 468560
28
SHA256 (xpi/firefox-i18n-59.0/ca.xpi) = 5171bf8d0c0f40bea63e81ae282cd41e42484b2ec06b904460c8669ee6454a3b
28
SHA256 (xpi/firefox-i18n-60.0b2/ca.xpi) = 4a83d7700e5919001766c0df8f04cac8ff307810370a7bddfb472d8f28cc62c9
29
SIZE (xpi/firefox-i18n-59.0/ca.xpi) = 464910
29
SIZE (xpi/firefox-i18n-60.0b2/ca.xpi) = 475509
30
SHA256 (xpi/firefox-i18n-59.0/cak.xpi) = eaae22a1be95e28d55aa849dc3699ebe5ee567574e38a306f26591da03a7e332
30
SHA256 (xpi/firefox-i18n-60.0b2/cak.xpi) = bafdb85ba5f777de7c6333523a9f259e50ded7e94e9a7208add22663e474c0fb
31
SIZE (xpi/firefox-i18n-59.0/cak.xpi) = 475232
31
SIZE (xpi/firefox-i18n-60.0b2/cak.xpi) = 485064
32
SHA256 (xpi/firefox-i18n-59.0/cs.xpi) = 2843a427be283937c15f98e31cb23025960822a8faf0d71d7ef30e20007cecae
32
SHA256 (xpi/firefox-i18n-60.0b2/cs.xpi) = e4536757219e593c0684ee1a52276a50fec15282a518a3c583452231b1c7c9ad
33
SIZE (xpi/firefox-i18n-59.0/cs.xpi) = 471573
33
SIZE (xpi/firefox-i18n-60.0b2/cs.xpi) = 480622
34
SHA256 (xpi/firefox-i18n-59.0/cy.xpi) = 9e83160f6142bc1189822957f7528f1a3ca4c221576cac1075dfed5731197516
34
SHA256 (xpi/firefox-i18n-60.0b2/cy.xpi) = 43b1a490160d42476d0b7081ad6222f843f25026336c707bfd890805d74c8192
35
SIZE (xpi/firefox-i18n-59.0/cy.xpi) = 454431
35
SIZE (xpi/firefox-i18n-60.0b2/cy.xpi) = 465635
36
SHA256 (xpi/firefox-i18n-59.0/da.xpi) = 5803ba7d12156ef86fcc951ceac1b53f3fbce938826d51bc6f15780c1242d935
36
SHA256 (xpi/firefox-i18n-60.0b2/da.xpi) = d9526782aebc6a9046508922a9a6bf197b9ab2ec28d26874097aae7d047b4444
37
SIZE (xpi/firefox-i18n-59.0/da.xpi) = 446947
37
SIZE (xpi/firefox-i18n-60.0b2/da.xpi) = 457683
38
SHA256 (xpi/firefox-i18n-59.0/de.xpi) = 80cb4b481073f71acaa6e6d760ebf0b599a33895eab236cf2cc3a8c000be0697
38
SHA256 (xpi/firefox-i18n-60.0b2/de.xpi) = 37b685289daf42a72aae47e3c2bf401236aec3e48a93d301feac659a18b5ebf5
39
SIZE (xpi/firefox-i18n-59.0/de.xpi) = 466271
39
SIZE (xpi/firefox-i18n-60.0b2/de.xpi) = 478046
40
SHA256 (xpi/firefox-i18n-59.0/dsb.xpi) = bcdb45e97f901fbff9b547a91a0b5c2a5bdadeea8ea5610ee5fceaf4484ef36f
40
SHA256 (xpi/firefox-i18n-60.0b2/dsb.xpi) = 01f70dac6ac7204b99dbc7ab8b715a87743865fc3ca6f199fb512bbaa2582e3f
41
SIZE (xpi/firefox-i18n-59.0/dsb.xpi) = 478973
41
SIZE (xpi/firefox-i18n-60.0b2/dsb.xpi) = 488763
42
SHA256 (xpi/firefox-i18n-59.0/el.xpi) = 466c2fef631c844ab1280e3879add57aacb98e2f30a7d8223f865d196deeb487
42
SHA256 (xpi/firefox-i18n-60.0b2/el.xpi) = e211e0e1d06c30b966f85c49c4bc5ad7e75f7375669ed0136efa1ac78e117890
43
SIZE (xpi/firefox-i18n-59.0/el.xpi) = 531406
43
SIZE (xpi/firefox-i18n-60.0b2/el.xpi) = 543012
44
SHA256 (xpi/firefox-i18n-59.0/en-GB.xpi) = cb42b3e458acc5ab249da6b55a9958585e4c064ddfb94b7bf49f9465626df0a4
44
SHA256 (xpi/firefox-i18n-60.0b2/en-GB.xpi) = 7e81107e8c2e74f2f8d6749a21f16878a3db6f4c1b86ceb34501433ec8f05014
45
SIZE (xpi/firefox-i18n-59.0/en-GB.xpi) = 434298
45
SIZE (xpi/firefox-i18n-60.0b2/en-GB.xpi) = 445086
46
SHA256 (xpi/firefox-i18n-59.0/en-US.xpi) = 44e49f00faf5c818ca025e4845f667b33c9542f5cc876fb5779c1d0fb87cc8b9
46
SHA256 (xpi/firefox-i18n-60.0b2/en-US.xpi) = 785f72065cab035368a0bd76f2a6df6808d55e0bd17f68e5a45325dfccdcb407
47
SIZE (xpi/firefox-i18n-59.0/en-US.xpi) = 432747
47
SIZE (xpi/firefox-i18n-60.0b2/en-US.xpi) = 441494
48
SHA256 (xpi/firefox-i18n-59.0/en-ZA.xpi) = 4816897d2e2f2f5f3d3a35a0f335cd34673f4cc57fe82178af7522055b508e9b
48
SHA256 (xpi/firefox-i18n-60.0b2/en-ZA.xpi) = c52aec301af2815de702d44a36c50a2be639bf68680ec140aab898305a320bff
49
SIZE (xpi/firefox-i18n-59.0/en-ZA.xpi) = 427364
49
SIZE (xpi/firefox-i18n-60.0b2/en-ZA.xpi) = 434598
50
SHA256 (xpi/firefox-i18n-59.0/eo.xpi) = c17ce4751c46e83a293d7272ca8cfeff8602b223226d8fb60aab74e9dae5e7ad
50
SHA256 (xpi/firefox-i18n-60.0b2/eo.xpi) = 3727f43f993c229eca69c115cb06dbe5d718c788c111c450cc7ad033d7114a31
51
SIZE (xpi/firefox-i18n-59.0/eo.xpi) = 453365
51
SIZE (xpi/firefox-i18n-60.0b2/eo.xpi) = 462981
52
SHA256 (xpi/firefox-i18n-59.0/es-AR.xpi) = 1a51d27cafa512ee25f9738f3b121f8d7e573ba277d1b834bae30a739c851e03
52
SHA256 (xpi/firefox-i18n-60.0b2/es-AR.xpi) = 7c08485084d4f0bbf1c24a13cfadbe803c7be5a3fbcff413a5d73864291c1083
53
SIZE (xpi/firefox-i18n-59.0/es-AR.xpi) = 461795
53
SIZE (xpi/firefox-i18n-60.0b2/es-AR.xpi) = 472501
54
SHA256 (xpi/firefox-i18n-59.0/es-CL.xpi) = f6c73332ed4ad8484aee9c87b70762ebf4795fbf340d87ee763879eb20788d14
54
SHA256 (xpi/firefox-i18n-60.0b2/es-CL.xpi) = c05fd2fb4ac0b2b389221d2dbd2fa0cc178ee79d0cfcedd1f225085f15e959fe
55
SIZE (xpi/firefox-i18n-59.0/es-CL.xpi) = 464652
55
SIZE (xpi/firefox-i18n-60.0b2/es-CL.xpi) = 475502
56
SHA256 (xpi/firefox-i18n-59.0/es-ES.xpi) = c1fc12302f57f526ef483ffb79a39c63b0f946b09fd1541989dd2b28ba7eb83c
56
SHA256 (xpi/firefox-i18n-60.0b2/es-ES.xpi) = 71e5b240cba1f4568f4ca20c72e20b286d63b0fe4ecff1ed653dc41bc35f16c4
57
SIZE (xpi/firefox-i18n-59.0/es-ES.xpi) = 348462
57
SIZE (xpi/firefox-i18n-60.0b2/es-ES.xpi) = 359479
58
SHA256 (xpi/firefox-i18n-59.0/es-MX.xpi) = 208182f94525a759cba128b892e80e99ee6dd1921906f8c054a8a515e283b35a
58
SHA256 (xpi/firefox-i18n-60.0b2/es-MX.xpi) = 685946d64122f9f035ec5e8f368ce3da49e0863c7e5e4679f37ff5df369f73ca
59
SIZE (xpi/firefox-i18n-59.0/es-MX.xpi) = 466310
59
SIZE (xpi/firefox-i18n-60.0b2/es-MX.xpi) = 476958
60
SHA256 (xpi/firefox-i18n-59.0/et.xpi) = 0414fc474c1457f8ec64a40d3f268aefe8ddc70cf85a07c5faba4b156f04353c
60
SHA256 (xpi/firefox-i18n-60.0b2/et.xpi) = 4290059a1dcf3ecc74c7761ce0143ce2f95d4023724609c74ab7c4ebd8dad6eb
61
SIZE (xpi/firefox-i18n-59.0/et.xpi) = 445393
61
SIZE (xpi/firefox-i18n-60.0b2/et.xpi) = 455969
62
SHA256 (xpi/firefox-i18n-59.0/eu.xpi) = 45a5df206d635e4b656c34e06e2c7df4b5614fd1584e7bd171432bff44cf155c
62
SHA256 (xpi/firefox-i18n-60.0b2/eu.xpi) = 9ba674684910eb87ee715aed2a0de7720ef906e0cede35fa176155faf24eca66
63
SIZE (xpi/firefox-i18n-59.0/eu.xpi) = 455235
63
SIZE (xpi/firefox-i18n-60.0b2/eu.xpi) = 464909
64
SHA256 (xpi/firefox-i18n-59.0/fa.xpi) = 375f9c9356891978d1b8558c63e34675ff3ed70dde54cbd70fbfee736a6dbe37
64
SHA256 (xpi/firefox-i18n-60.0b2/fa.xpi) = 352ed4d806025413324975a83d7be487a4afa9bf05df3157ccc56b69c74d3ef5
65
SIZE (xpi/firefox-i18n-59.0/fa.xpi) = 508096
65
SIZE (xpi/firefox-i18n-60.0b2/fa.xpi) = 519569
66
SHA256 (xpi/firefox-i18n-59.0/ff.xpi) = ef8313cd46c2e68af5388d4c705958db8e2b75c4156b2b5ee76b2822c5bb921e
66
SHA256 (xpi/firefox-i18n-60.0b2/ff.xpi) = 538203e58720cd17db3be93298874f52463974b73a742f76479b701940f19d59
67
SIZE (xpi/firefox-i18n-59.0/ff.xpi) = 455025
67
SIZE (xpi/firefox-i18n-60.0b2/ff.xpi) = 465513
68
SHA256 (xpi/firefox-i18n-59.0/fi.xpi) = 2d568720cd7f1d3106c6e1c8d02e838786a7643cdc8a74362a449127636346b6
68
SHA256 (xpi/firefox-i18n-60.0b2/fi.xpi) = 512fe170961119588d20fac84a68112ddabfc94607c8bfe562d94e83a4bc7efc
69
SIZE (xpi/firefox-i18n-59.0/fi.xpi) = 445181
69
SIZE (xpi/firefox-i18n-60.0b2/fi.xpi) = 456106
70
SHA256 (xpi/firefox-i18n-59.0/fr.xpi) = 7dad72da0d5ea4d30b70f34319a9446044d952bcdcaef8e50e8735328f86e857
70
SHA256 (xpi/firefox-i18n-60.0b2/fr.xpi) = dddc8c936ec3cb895058ed0c96c75e838cf46fb017f22fbd4e432c1314a9b3bd
71
SIZE (xpi/firefox-i18n-59.0/fr.xpi) = 473591
71
SIZE (xpi/firefox-i18n-60.0b2/fr.xpi) = 484398
72
SHA256 (xpi/firefox-i18n-59.0/fy-NL.xpi) = d1595e13a228471d0e675148d52855d0f18fb0352ac559323204dfa648233b44
72
SHA256 (xpi/firefox-i18n-60.0b2/fy-NL.xpi) = 6547fbce778ea7a5035e6b0a0c86394af24627261cc0537d26358859eaf65341
73
SIZE (xpi/firefox-i18n-59.0/fy-NL.xpi) = 462917
73
SIZE (xpi/firefox-i18n-60.0b2/fy-NL.xpi) = 473502
74
SHA256 (xpi/firefox-i18n-59.0/ga-IE.xpi) = 21c43c03c285a53f47a56be397dafed998b60fdc763d370465f692d90ba967b1
74
SHA256 (xpi/firefox-i18n-60.0b2/ga-IE.xpi) = 3b5bf250053f987dfd2b31947304c00c2b616fc92d25eec7a4204db59a7edf7f
75
SIZE (xpi/firefox-i18n-59.0/ga-IE.xpi) = 471906
75
SIZE (xpi/firefox-i18n-60.0b2/ga-IE.xpi) = 483197
76
SHA256 (xpi/firefox-i18n-59.0/gd.xpi) = 0ecf7b654d8ab199277c286849bc50e4289c30b7766e3a9de28a69cafa75aa6b
76
SHA256 (xpi/firefox-i18n-60.0b2/gd.xpi) = 574edc4c8e0a95a673be40e15c450a5d3ff95ff38ab25b61cae8a1dc41be11c6
77
SIZE (xpi/firefox-i18n-59.0/gd.xpi) = 461296
77
SIZE (xpi/firefox-i18n-60.0b2/gd.xpi) = 472666
78
SHA256 (xpi/firefox-i18n-59.0/gl.xpi) = eddfdf159b7dc97c2ab00d5c13208fb161521cbeeaefbcabd3925f68fd28db0a
78
SHA256 (xpi/firefox-i18n-60.0b2/gl.xpi) = 9947b0e5944747bbcffb27e22b78b41625ec43ae7dd848d13a035f9156610674
79
SIZE (xpi/firefox-i18n-59.0/gl.xpi) = 441613
79
SIZE (xpi/firefox-i18n-60.0b2/gl.xpi) = 449580
80
SHA256 (xpi/firefox-i18n-59.0/gn.xpi) = 14cb97943f1b501a77a843addd6b03c60518c8c30fb7337148f1803c492f91ad
80
SHA256 (xpi/firefox-i18n-60.0b2/gn.xpi) = 005de91c12db6c3ca749831386d3e6f19d434fd839e4698e39b0c8e55a7a2e19
81
SIZE (xpi/firefox-i18n-59.0/gn.xpi) = 469396
81
SIZE (xpi/firefox-i18n-60.0b2/gn.xpi) = 480555
82
SHA256 (xpi/firefox-i18n-59.0/gu-IN.xpi) = 3ffc20afbe2ad5a625079766ac286cb19f1052e874e3825169619364f8c843ba
82
SHA256 (xpi/firefox-i18n-60.0b2/gu-IN.xpi) = ce9f1814d78b66304764ae5a1e5aef53096283f93d215e367d244a7001b40a97
83
SIZE (xpi/firefox-i18n-59.0/gu-IN.xpi) = 521802
83
SIZE (xpi/firefox-i18n-60.0b2/gu-IN.xpi) = 532408
84
SHA256 (xpi/firefox-i18n-59.0/he.xpi) = 89ba85e80cf52e7743763804300a8b2e9c5e55b9d189954cf5d45c796ea77c04
84
SHA256 (xpi/firefox-i18n-60.0b2/he.xpi) = 4afbe27061e2d73688e9491826536a61af299f50102ca112dba19ec53e475c53
85
SIZE (xpi/firefox-i18n-59.0/he.xpi) = 472769
85
SIZE (xpi/firefox-i18n-60.0b2/he.xpi) = 484073
86
SHA256 (xpi/firefox-i18n-59.0/hi-IN.xpi) = 16a5e4fbbf1ddd8827afb2382b82b59039fb040b16bd36f9c214ddaa4bd82db0
86
SHA256 (xpi/firefox-i18n-60.0b2/hi-IN.xpi) = 7377f4fba4db1280476ded1acabc9d90e077af5329846c5645d76b4dc6c91748
87
SIZE (xpi/firefox-i18n-59.0/hi-IN.xpi) = 524277
87
SIZE (xpi/firefox-i18n-60.0b2/hi-IN.xpi) = 535739
88
SHA256 (xpi/firefox-i18n-59.0/hr.xpi) = 2966dafaea8224e7e9e599f048fb9725f28704af53bb5f0a311dc9ef485f7325
88
SHA256 (xpi/firefox-i18n-60.0b2/hr.xpi) = 65d7a46d5244335d5aa6f37565a6a1afef44cd10efe696ec4ffd3a4141205bd5
89
SIZE (xpi/firefox-i18n-59.0/hr.xpi) = 459976
89
SIZE (xpi/firefox-i18n-60.0b2/hr.xpi) = 471318
90
SHA256 (xpi/firefox-i18n-59.0/hsb.xpi) = 1311fdfe6784f73c1f7ead834a301e8818db253393510a0f6bc00e68ec5e4546
90
SHA256 (xpi/firefox-i18n-60.0b2/hsb.xpi) = 2e468ed6915531d4491f27136974c6f6ff5ced0455d8254028d349763cb0267d
91
SIZE (xpi/firefox-i18n-59.0/hsb.xpi) = 475939
91
SIZE (xpi/firefox-i18n-60.0b2/hsb.xpi) = 485668
92
SHA256 (xpi/firefox-i18n-59.0/hu.xpi) = c362521efa6a58d80eff294bd1d85939c42c6a29cbba6903a3d00525fd4ca9e0
92
SHA256 (xpi/firefox-i18n-60.0b2/hu.xpi) = f140fe6ae54a1afdd277a9c95d2f026d59ee8a122b103547ad6689c29b1fd940
93
SIZE (xpi/firefox-i18n-59.0/hu.xpi) = 476895
93
SIZE (xpi/firefox-i18n-60.0b2/hu.xpi) = 485990
94
SHA256 (xpi/firefox-i18n-59.0/hy-AM.xpi) = 4b28fd26b21abe6897399a72c4d99c765d3b08f55a1f36c184d33bf83d646668
94
SHA256 (xpi/firefox-i18n-60.0b2/hy-AM.xpi) = 8d86769cff8371158f9d0f7effdf21d6f775ac073d8f5090944b724d38a422ff
95
SIZE (xpi/firefox-i18n-59.0/hy-AM.xpi) = 508165
95
SIZE (xpi/firefox-i18n-60.0b2/hy-AM.xpi) = 519760
96
SHA256 (xpi/firefox-i18n-59.0/ia.xpi) = 4c7f6069edb4cfab47bad733621b23d192f4ef666556877d441f224ed5f91dd9
96
SHA256 (xpi/firefox-i18n-60.0b2/ia.xpi) = ee3e285752beb85777053d59fdb8a68197a48cba2d8639dc4c99a095eabcf4d6
97
SIZE (xpi/firefox-i18n-59.0/ia.xpi) = 448827
97
SIZE (xpi/firefox-i18n-60.0b2/ia.xpi) = 459870
98
SHA256 (xpi/firefox-i18n-59.0/id.xpi) = e11d14366748f021c336254f1557ca62d0bbd13ca308be097b28e68db5a8e02f
98
SHA256 (xpi/firefox-i18n-60.0b2/id.xpi) = d3a0e0acd8514c61669510023ffc7a5f3f4fa9fd77e8152ed6bbbda9b7372868
99
SIZE (xpi/firefox-i18n-59.0/id.xpi) = 441951
99
SIZE (xpi/firefox-i18n-60.0b2/id.xpi) = 452366
100
SHA256 (xpi/firefox-i18n-59.0/is.xpi) = 8bb7f3fb34c4fa15f297a99f5651f00a99844346a1d4469117c5dea0cd840843
100
SHA256 (xpi/firefox-i18n-60.0b2/is.xpi) = 6f317b4e2aec0158ade5e5006b9dda9c475d2dbb8e907bfc9621286351964abb
101
SIZE (xpi/firefox-i18n-59.0/is.xpi) = 451371
101
SIZE (xpi/firefox-i18n-60.0b2/is.xpi) = 462502
102
SHA256 (xpi/firefox-i18n-59.0/it.xpi) = 619b955412cd52f1379a64f9bbc23f78d595dd0139c0097ea3e93c4267eef051
102
SHA256 (xpi/firefox-i18n-60.0b2/it.xpi) = 467b86575b862c8d32c4b94ec4da8b8e45aa0e39f68ca445d3ecd3a6f721d807
103
SIZE (xpi/firefox-i18n-59.0/it.xpi) = 342522
103
SIZE (xpi/firefox-i18n-60.0b2/it.xpi) = 352060
104
SHA256 (xpi/firefox-i18n-59.0/ja.xpi) = e32dc966b1164b0a8bc5e8efbf660d8c462c9e50c93a978de88eb3915ab41247
104
SHA256 (xpi/firefox-i18n-60.0b2/ja.xpi) = adbe3d9abdb0252a108d3520a39064b800d9575c0a784210270f1b9089fbabca
105
SIZE (xpi/firefox-i18n-59.0/ja.xpi) = 508146
105
SIZE (xpi/firefox-i18n-60.0b2/ja.xpi) = 518877
106
SHA256 (xpi/firefox-i18n-59.0/ka.xpi) = d0cb6ec913abd01d5826032716cb12b780e591d273080972d3627ab5c51e2bbd
106
SHA256 (xpi/firefox-i18n-60.0b2/ka.xpi) = 054ff2854756f46568974a39231efe3c8b5b91b71c7ebb49583347dee634e83d
107
SIZE (xpi/firefox-i18n-59.0/ka.xpi) = 492567
107
SIZE (xpi/firefox-i18n-60.0b2/ka.xpi) = 502601
108
SHA256 (xpi/firefox-i18n-59.0/kab.xpi) = 3b56006aa799f9c6e402781843a4774a858532c1f53ba03f5918efa52a3dabac
108
SHA256 (xpi/firefox-i18n-60.0b2/kab.xpi) = 6dd3d4c4e98f04180274e3255e8117c59254912ef7e9055e75e0d749efe7bf7c
109
SIZE (xpi/firefox-i18n-59.0/kab.xpi) = 461838
109
SIZE (xpi/firefox-i18n-60.0b2/kab.xpi) = 471615
110
SHA256 (xpi/firefox-i18n-59.0/kk.xpi) = c1bbedcb92a43c18c654b098705d513d7663876a30875c322a61657e6046b72c
110
SHA256 (xpi/firefox-i18n-60.0b2/kk.xpi) = 08db6f8add96f8bef331ec2a31e8c84f0c6f5289a282de3b6177e5a091bc7086
111
SIZE (xpi/firefox-i18n-59.0/kk.xpi) = 517582
111
SIZE (xpi/firefox-i18n-60.0b2/kk.xpi) = 528173
112
SHA256 (xpi/firefox-i18n-59.0/km.xpi) = 9fa77a9347c77f23f52f0129a35fe290bb3d67e261817956ba265f3b68cacbe4
112
SHA256 (xpi/firefox-i18n-60.0b2/km.xpi) = 86f456a26c4b018816f2703388c1d6535440f5e6d14e8ebcf08c944d3bb9d474
113
SIZE (xpi/firefox-i18n-59.0/km.xpi) = 526357
113
SIZE (xpi/firefox-i18n-60.0b2/km.xpi) = 536932
114
SHA256 (xpi/firefox-i18n-59.0/kn.xpi) = b62f5139ee71ed4107e878a5fab2e58e1dd910598b85199d1162c67ffc426c85
114
SHA256 (xpi/firefox-i18n-60.0b2/kn.xpi) = fe63f6cacab0c61a11d6267e89254b5557c15dc93fc9fe9bb4d2817c4c533d3d
115
SIZE (xpi/firefox-i18n-59.0/kn.xpi) = 527877
115
SIZE (xpi/firefox-i18n-60.0b2/kn.xpi) = 537586
116
SHA256 (xpi/firefox-i18n-59.0/ko.xpi) = 1c498889480fa8ea9a065ba12b185283edc518d738c6db8ff780098b38bf817a
116
SHA256 (xpi/firefox-i18n-60.0b2/ko.xpi) = 6fefe78419ac5b72b7aca598ed289f40ab7d1f6a52fb827a39a21db4cd5f4e8a
117
SIZE (xpi/firefox-i18n-59.0/ko.xpi) = 487659
117
SIZE (xpi/firefox-i18n-60.0b2/ko.xpi) = 496535
118
SHA256 (xpi/firefox-i18n-59.0/lij.xpi) = 0312ca2b5aecd54f7456d8310542165f005f2e1bddc70bedb824541dcce4b65b
118
SHA256 (xpi/firefox-i18n-60.0b2/lij.xpi) = 5ac0991f943c2bc2127a49d22219a3b433826e9ea63dc9f1b4c15eb0a4c9bbf8
119
SIZE (xpi/firefox-i18n-59.0/lij.xpi) = 446604
119
SIZE (xpi/firefox-i18n-60.0b2/lij.xpi) = 457056
120
SHA256 (xpi/firefox-i18n-59.0/lt.xpi) = 7ba6037547b3e5f1d402ce698cd74dfbe6c2eca8013f9ebb9cda820233cca998
120
SHA256 (xpi/firefox-i18n-60.0b2/lt.xpi) = 2f113a23f1744bf822fbe30817ecf9fcf0a6702034bc0eeb05c1271dbb338e34
121
SIZE (xpi/firefox-i18n-59.0/lt.xpi) = 475141
121
SIZE (xpi/firefox-i18n-60.0b2/lt.xpi) = 484070
122
SHA256 (xpi/firefox-i18n-59.0/lv.xpi) = 85f32e9a7fd03423ae0b7339990c076b84409f95d9dc010089389666f891c1da
122
SHA256 (xpi/firefox-i18n-60.0b2/lv.xpi) = 0d7816b13aad0692deab0c00bf6b29fac49544021b746f6814acf147a978b29b
123
SIZE (xpi/firefox-i18n-59.0/lv.xpi) = 463653
123
SIZE (xpi/firefox-i18n-60.0b2/lv.xpi) = 475034
124
SHA256 (xpi/firefox-i18n-59.0/mai.xpi) = 2cc0ec3dc2a0296d17c0fd71060291caac8981c496acc524b26da7ef4cb62ed3
124
SHA256 (xpi/firefox-i18n-60.0b2/mai.xpi) = b7776297987d60df1cb4866b95f02ddb44c97c2b9a33665441517ccc98fc9e43
125
SIZE (xpi/firefox-i18n-59.0/mai.xpi) = 499908
125
SIZE (xpi/firefox-i18n-60.0b2/mai.xpi) = 507542
126
SHA256 (xpi/firefox-i18n-59.0/mk.xpi) = 0ffa52cdc876ceb990eb0b1d729ed5fa5fe92bfe2d65e9d4bfd759758ac216fa
126
SHA256 (xpi/firefox-i18n-60.0b2/mk.xpi) = df2f7c07c3869182d910ddb86af55151d536caf05d3482921ab272e5c0d4e7b0
127
SIZE (xpi/firefox-i18n-59.0/mk.xpi) = 484074
127
SIZE (xpi/firefox-i18n-60.0b2/mk.xpi) = 492047
128
SHA256 (xpi/firefox-i18n-59.0/ml.xpi) = ac845dba07dbbd76fe37c0bfc4dd5365e15254971f9588377a680e07745fed6f
128
SHA256 (xpi/firefox-i18n-60.0b2/ml.xpi) = c8e6f4fb2e0e51d36b6a92de063c08d897628c0b20a60f02bff9798b2bc2ca60
129
SIZE (xpi/firefox-i18n-59.0/ml.xpi) = 539733
129
SIZE (xpi/firefox-i18n-60.0b2/ml.xpi) = 550569
130
SHA256 (xpi/firefox-i18n-59.0/mr.xpi) = 8bafe1760d2a1cf0093256cd019dac2c097e79f1484bfe66a1f3f73076d3b6b3
130
SHA256 (xpi/firefox-i18n-60.0b2/mr.xpi) = 6ecc647bc64388aeeb5f32ac6dd9c4fd65a94de96534187c123704248fc71dfd
131
SIZE (xpi/firefox-i18n-59.0/mr.xpi) = 517960
131
SIZE (xpi/firefox-i18n-60.0b2/mr.xpi) = 529674
132
SHA256 (xpi/firefox-i18n-59.0/ms.xpi) = 00c44f109551b23f0a904402573c06edf4d8bf087cc0e91b52b006621883c9b5
132
SHA256 (xpi/firefox-i18n-60.0b2/ms.xpi) = 93417e8b0b409d7d82b9d0c790a8541cbec8758fe7882027fcdbcf04c2938c99
133
SIZE (xpi/firefox-i18n-59.0/ms.xpi) = 450073
133
SIZE (xpi/firefox-i18n-60.0b2/ms.xpi) = 459751
134
SHA256 (xpi/firefox-i18n-59.0/my.xpi) = 37708298e5bcf83d9570a5144b633709666b69840315c680bae3f7dd2a186001
134
SHA256 (xpi/firefox-i18n-60.0b2/my.xpi) = 2af1938050efed9f5022c1fc9bdc946921d2c6ed1ffbf0e7cd96ab0fff783b9f
135
SIZE (xpi/firefox-i18n-59.0/my.xpi) = 511892
135
SIZE (xpi/firefox-i18n-60.0b2/my.xpi) = 522045
136
SHA256 (xpi/firefox-i18n-59.0/nb-NO.xpi) = 90c61e5724b618b5fdfc65fc37d60686cd374f94a6567d6aa290c8733eb45c86
136
SHA256 (xpi/firefox-i18n-60.0b2/nb-NO.xpi) = 69b5e72319dae0ca4e78c2feec3db1d6249437497a172cf4330245b21a462803
137
SIZE (xpi/firefox-i18n-59.0/nb-NO.xpi) = 450275
137
SIZE (xpi/firefox-i18n-60.0b2/nb-NO.xpi) = 459984
138
SHA256 (xpi/firefox-i18n-59.0/ne-NP.xpi) = d6a3aebbb11faca5a07794648f13946a84807abb7325176b0da8b51e2c53f251
138
SHA256 (xpi/firefox-i18n-60.0b2/ne-NP.xpi) = b48dc523ee4d20b63ca75b8f3fc96dcfd7278d91bcff30cb6f99aa3c2a0b1377
139
SIZE (xpi/firefox-i18n-59.0/ne-NP.xpi) = 509175
139
SIZE (xpi/firefox-i18n-60.0b2/ne-NP.xpi) = 520386
140
SHA256 (xpi/firefox-i18n-59.0/nl.xpi) = 95cdc03247c2e59313c59bf819401fcf140bcf556367755f79207ce38345c123
140
SHA256 (xpi/firefox-i18n-60.0b2/nl.xpi) = 09dafbc4784f5549b1ef13a592095e9ef10f0b38a579cffbe56c6d2e48d790aa
141
SIZE (xpi/firefox-i18n-59.0/nl.xpi) = 458127
141
SIZE (xpi/firefox-i18n-60.0b2/nl.xpi) = 467152
142
SHA256 (xpi/firefox-i18n-59.0/nn-NO.xpi) = 87fa01ddab0d6545cced17229187b63bead047549ea7c73ba3947f9a555a8dd7
142
SHA256 (xpi/firefox-i18n-60.0b2/nn-NO.xpi) = d6bdaef137ca7ec4c2f5fd3a88faae0c4ea53c982ab74e4d4a202563df303943
143
SIZE (xpi/firefox-i18n-59.0/nn-NO.xpi) = 451469
143
SIZE (xpi/firefox-i18n-60.0b2/nn-NO.xpi) = 460479
144
SHA256 (xpi/firefox-i18n-59.0/or.xpi) = a00da5f2a4b7c13947a27b526c0d35673eff42d9cab0979c6670ca54ee8f68c7
144
SHA256 (xpi/firefox-i18n-60.0b2/oc.xpi) = dbc4bd23e387d0783de5a324df647bd4cd5a6a158e15dec08a0f7eaffc4ec256
145
SIZE (xpi/firefox-i18n-59.0/or.xpi) = 493180
145
SIZE (xpi/firefox-i18n-60.0b2/oc.xpi) = 477201
146
SHA256 (xpi/firefox-i18n-59.0/pa-IN.xpi) = e43dd78383255b594d8078c38d46e872565304427ab7bbeca47458477a34d4ef
146
SHA256 (xpi/firefox-i18n-60.0b2/or.xpi) = 1359d8ed163f48984309754fb89e74c693a78852d66eff45e4bacc88e10576ad
147
SIZE (xpi/firefox-i18n-59.0/pa-IN.xpi) = 492418
147
SIZE (xpi/firefox-i18n-60.0b2/or.xpi) = 500626
148
SHA256 (xpi/firefox-i18n-59.0/pl.xpi) = 323c5439304f6fbed7db49ae96ab513071551ef87e12bc11103b5b4be0d07289
148
SHA256 (xpi/firefox-i18n-60.0b2/pa-IN.xpi) = ffaa2b343cb628507905b2741ca518c2cb222ea498831662a3c6e190be8c2d03
149
SIZE (xpi/firefox-i18n-59.0/pl.xpi) = 358509
149
SIZE (xpi/firefox-i18n-60.0b2/pa-IN.xpi) = 503120
150
SHA256 (xpi/firefox-i18n-59.0/pt-BR.xpi) = 21bde4b1666858fb65682147fa235fe9688206a2e0d492affd019b3fd99e2c64
150
SHA256 (xpi/firefox-i18n-60.0b2/pl.xpi) = 001503aa9c381c6badb52f16e4dbc109e133aae4ec835dab077781f88e3f9a5f
151
SIZE (xpi/firefox-i18n-59.0/pt-BR.xpi) = 455913
151
SIZE (xpi/firefox-i18n-60.0b2/pl.xpi) = 369616
152
SHA256 (xpi/firefox-i18n-59.0/pt-PT.xpi) = d9008a9b59a265702ad5915149fa9960151bdd0699bafaf8c383ece97d182d9f
152
SHA256 (xpi/firefox-i18n-60.0b2/pt-BR.xpi) = abf591823004510a6b4e9ab091972518581c3e755e94e538006bb43a271ddeff
153
SIZE (xpi/firefox-i18n-59.0/pt-PT.xpi) = 459329
153
SIZE (xpi/firefox-i18n-60.0b2/pt-BR.xpi) = 465263
154
SHA256 (xpi/firefox-i18n-59.0/rm.xpi) = 88192d2d2b3824d45ff862ba285ce36499ae15daaf89d21037a8ebfc0500fe61
154
SHA256 (xpi/firefox-i18n-60.0b2/pt-PT.xpi) = 27ef71ed4121fd42931a85b2b86051c4db5b77ad7722164a5774258668eaea24
155
SIZE (xpi/firefox-i18n-59.0/rm.xpi) = 449756
155
SIZE (xpi/firefox-i18n-60.0b2/pt-PT.xpi) = 468269
156
SHA256 (xpi/firefox-i18n-59.0/ro.xpi) = 6fe642ecbb2d3f2c181fc8f1194c1b08cf1d6d1f76b8f205ffdfbab650f8827a
156
SHA256 (xpi/firefox-i18n-60.0b2/rm.xpi) = af51ff46f0c0b3912064a6490394eeef740c40e5bfb7c825f71da9663d78e2eb
157
SIZE (xpi/firefox-i18n-59.0/ro.xpi) = 453401
157
SIZE (xpi/firefox-i18n-60.0b2/rm.xpi) = 461202
158
SHA256 (xpi/firefox-i18n-59.0/ru.xpi) = 9905c2249e72bf8be629c59915298598ac6e63b90ba95ceee0795d077a4ad09b
158
SHA256 (xpi/firefox-i18n-60.0b2/ro.xpi) = a05bcd830bad022ca9cb4cd29bdc43072cc6ebc5aec089f74ba752aa3d0209a7
159
SIZE (xpi/firefox-i18n-59.0/ru.xpi) = 526521
159
SIZE (xpi/firefox-i18n-60.0b2/ro.xpi) = 464776
160
SHA256 (xpi/firefox-i18n-59.0/si.xpi) = 9608ae50405741a544270d2256035a8ae6484767fe737db8b98ac296ccdcda67
160
SHA256 (xpi/firefox-i18n-60.0b2/ru.xpi) = 8a0e831019164074986d9d64fd93ef13269ba4284eab51b40d6abbff3880b429
161
SIZE (xpi/firefox-i18n-59.0/si.xpi) = 492585
161
SIZE (xpi/firefox-i18n-60.0b2/ru.xpi) = 536435
162
SHA256 (xpi/firefox-i18n-59.0/sk.xpi) = ee8cc67c33edccc7b7291496fb20f2f850f6934f67a0694b1bb19774db254eb1
162
SHA256 (xpi/firefox-i18n-60.0b2/si.xpi) = 349712695adf495a12c97cc6162a364dac445bffdc6c8efd11b64141d39eb6cb
163
SIZE (xpi/firefox-i18n-59.0/sk.xpi) = 480811
163
SIZE (xpi/firefox-i18n-60.0b2/si.xpi) = 502052
164
SHA256 (xpi/firefox-i18n-59.0/sl.xpi) = 13a9308e3d93ecfb873f4fb9a4a6f14b77ac37a730c0700e7c0296ab81250de7
164
SHA256 (xpi/firefox-i18n-60.0b2/sk.xpi) = 42a99e56e26dee8ed94bb473a0d429ea628996845cbb35edbc356919b59f91c6
165
SIZE (xpi/firefox-i18n-59.0/sl.xpi) = 458823
165
SIZE (xpi/firefox-i18n-60.0b2/sk.xpi) = 489920
166
SHA256 (xpi/firefox-i18n-59.0/son.xpi) = 557087d226148a636c89313de04b7dfad71bca392dde28236163ca556f9322be
166
SHA256 (xpi/firefox-i18n-60.0b2/sl.xpi) = 2df3be84800ff89d753e2410bcc75e0ebe49e0b33c1518c51e96a1925143ffc8
167
SIZE (xpi/firefox-i18n-59.0/son.xpi) = 446398
167
SIZE (xpi/firefox-i18n-60.0b2/sl.xpi) = 468784
168
SHA256 (xpi/firefox-i18n-59.0/sq.xpi) = 492cbf457ad02ef8efdfc546207a2d6c9ea07df57741dcebf89bae235438ca55
168
SHA256 (xpi/firefox-i18n-60.0b2/son.xpi) = 0806aea637720be9350557a563166d4c624ad9b887e196627654a2c0227ecfbb
169
SIZE (xpi/firefox-i18n-59.0/sq.xpi) = 464461
169
SIZE (xpi/firefox-i18n-60.0b2/son.xpi) = 456084
170
SHA256 (xpi/firefox-i18n-59.0/sr.xpi) = 30dc2cc54bd0bb4c88bd4ec016eba9285fc1d14d27417b402c2a44967baa4fd5
170
SHA256 (xpi/firefox-i18n-60.0b2/sq.xpi) = 630c01008c219b121508cf31a174eeef57ed81c5ff9bd429835dabc6e57a9c52
171
SIZE (xpi/firefox-i18n-59.0/sr.xpi) = 486176
171
SIZE (xpi/firefox-i18n-60.0b2/sq.xpi) = 476118
172
SHA256 (xpi/firefox-i18n-59.0/sv-SE.xpi) = 69fc218bcf153772dbeb1000dc35849210d00ede91537b948b27876ec03ffddf
172
SHA256 (xpi/firefox-i18n-60.0b2/sr.xpi) = 5a021aea26cd7619306ed80acfe4ec7850b99b41c4337cbb37dc023ff61f1909
173
SIZE (xpi/firefox-i18n-59.0/sv-SE.xpi) = 458658
173
SIZE (xpi/firefox-i18n-60.0b2/sr.xpi) = 495336
174
SHA256 (xpi/firefox-i18n-59.0/ta.xpi) = d55bc8f1458d96d548d7ef3e01a1cec3dbd9c4b62f8dd539658d4ad90129fb58
174
SHA256 (xpi/firefox-i18n-60.0b2/sv-SE.xpi) = 1137f06cd3456adee9e4a5231c4f514f6058487aae02c207bbebe553739e48c2
175
SIZE (xpi/firefox-i18n-59.0/ta.xpi) = 512841
175
SIZE (xpi/firefox-i18n-60.0b2/sv-SE.xpi) = 467993
176
SHA256 (xpi/firefox-i18n-59.0/te.xpi) = 25368ecdd33ed9ec4ad5fd95f510afffc61740f2bbb33c814ec3a6863673dc39
176
SHA256 (xpi/firefox-i18n-60.0b2/ta.xpi) = 2e21a5e68c1c5c6a48a8fe4557d95352d0e840dfe89a88fe0d40ad04f9fe3a83
177
SIZE (xpi/firefox-i18n-59.0/te.xpi) = 527082
177
SIZE (xpi/firefox-i18n-60.0b2/ta.xpi) = 524089
178
SHA256 (xpi/firefox-i18n-59.0/th.xpi) = a7e8951f27666735eb6e2bb526c069ae26a7bf6ed2dde12c0b47a9adacc1c200
178
SHA256 (xpi/firefox-i18n-60.0b2/te.xpi) = aaa5184d4c123dbc014f744a9a7b35d44f73b58495133b93075a8bd3e8e1edcc
179
SIZE (xpi/firefox-i18n-59.0/th.xpi) = 498542
179
SIZE (xpi/firefox-i18n-60.0b2/te.xpi) = 537600
180
SHA256 (xpi/firefox-i18n-59.0/tr.xpi) = 50728d089f891362a4b1f0d036edbc556e8dbe922c2abdbb89ffe45d57d275f4
180
SHA256 (xpi/firefox-i18n-60.0b2/th.xpi) = 827f491959a495ecfa11394dc7e007e85f4d05de2aa7eabf24d3598c82369810
181
SIZE (xpi/firefox-i18n-59.0/tr.xpi) = 463592
181
SIZE (xpi/firefox-i18n-60.0b2/th.xpi) = 509974
182
SHA256 (xpi/firefox-i18n-59.0/uk.xpi) = 7b500089a303e93761054b3cda4e4a188ebe6ccc2a120e5c90fd5d4e7cf28cfe
182
SHA256 (xpi/firefox-i18n-60.0b2/tr.xpi) = 554e436af3db110d168b5825876cea060ae3b8ff5c18d257a333e7b82ca0c6f4
183
SIZE (xpi/firefox-i18n-59.0/uk.xpi) = 516924
183
SIZE (xpi/firefox-i18n-60.0b2/tr.xpi) = 473604
184
SHA256 (xpi/firefox-i18n-59.0/ur.xpi) = 9cc9ece7f94e13894651b4c342d226552e8544e8488e447da6c9f1ddf8884d31
184
SHA256 (xpi/firefox-i18n-60.0b2/uk.xpi) = ab52ce6f330ec911a2788bc97871f410bcf2552787112a61020d6ea8c6f2d244
185
SIZE (xpi/firefox-i18n-59.0/ur.xpi) = 507378
185
SIZE (xpi/firefox-i18n-60.0b2/uk.xpi) = 526375
186
SHA256 (xpi/firefox-i18n-59.0/uz.xpi) = 4ae7546f790afe6b931d137531a6ef6a7287f1959ed20758c62624e23d75fa53
186
SHA256 (xpi/firefox-i18n-60.0b2/ur.xpi) = 851dadfe1565b5d1089f4bfe6285b431fe9fd2517b413a7658d367d23230fc24
187
SIZE (xpi/firefox-i18n-59.0/uz.xpi) = 456922
187
SIZE (xpi/firefox-i18n-60.0b2/ur.xpi) = 516748
188
SHA256 (xpi/firefox-i18n-59.0/vi.xpi) = 778ee06852609372e0303a5354b6e8b1f2a22e999cbeedba6bf9d8d303c05bf9
188
SHA256 (xpi/firefox-i18n-60.0b2/uz.xpi) = 0e3d0cd0e7b8b839bbb84b42ab25f71b2ee7309fff37ad7156c1b778cf141b76
189
SIZE (xpi/firefox-i18n-59.0/vi.xpi) = 470067
189
SIZE (xpi/firefox-i18n-60.0b2/uz.xpi) = 467092
190
SHA256 (xpi/firefox-i18n-59.0/xh.xpi) = 41dfddbd064d2da408b93409bfacafd32226cd086a3da5e603a5a3fba4891656
190
SHA256 (xpi/firefox-i18n-60.0b2/vi.xpi) = 34fb0fd53dcb986e0d1925ef1fd0b6ea1337b41312e5172cc3e25ec6cb2aa362
191
SIZE (xpi/firefox-i18n-59.0/xh.xpi) = 460770
191
SIZE (xpi/firefox-i18n-60.0b2/vi.xpi) = 480501
192
SHA256 (xpi/firefox-i18n-59.0/zh-CN.xpi) = 03679d815dee18016aae33fba44eafe8116d025c5f5d99b9efbba29d65886b8f
192
SHA256 (xpi/firefox-i18n-60.0b2/xh.xpi) = dbb4a54b47fde3795083112451c49af0c2fb3c4a2ea919246a29ae521a023727
193
SIZE (xpi/firefox-i18n-59.0/zh-CN.xpi) = 483447
193
SIZE (xpi/firefox-i18n-60.0b2/xh.xpi) = 470331
194
SHA256 (xpi/firefox-i18n-59.0/zh-TW.xpi) = 40253d142f875a27e086c34737e0c437939cea29011160c7d7b252ad1f34f9d2
194
SHA256 (xpi/firefox-i18n-60.0b2/zh-CN.xpi) = 878d908213acbbbc0e718842998d0d7beb479946ba157617802e53dd01123c9f
195
SIZE (xpi/firefox-i18n-59.0/zh-TW.xpi) = 477087
195
SIZE (xpi/firefox-i18n-60.0b2/zh-CN.xpi) = 492500
196
SHA256 (xpi/firefox-i18n-60.0b2/zh-TW.xpi) = 49c06de4d7d2e925343a4409ef30977cf55d8844e358bce97df9b1f929602062
197
SIZE (xpi/firefox-i18n-60.0b2/zh-TW.xpi) = 493124
(-)b/www/firefox/Makefile (-9 / +8 lines)
Lines 2-29 Link Here
2
# $FreeBSD$
2
# $FreeBSD$
3
3
4
PORTNAME=	firefox
4
PORTNAME=	firefox
5
DISTVERSION=	59.0
5
DISTVERSION=	60.0b2
6
PORTREVISION=	3
7
PORTEPOCH=	1
6
PORTEPOCH=	1
8
CATEGORIES=	www ipv6
7
CATEGORIES=	www ipv6
9
MASTER_SITES=	https://hg.mozilla.org/releases/mozilla-release/archive/
8
MASTER_SITES=	https://hg.mozilla.org/releases/mozilla-beta/archive/
10
DISTNAME=	${MASTER_SITES:M*hg*:S,/archive/,,:T}-e9128973a480c8aedf3a2e1c67d3e168613fa17c
9
DISTNAME=	${MASTER_SITES:M*hg*:S,/archive/,,:T}-0938d48917b73d31fa8bfa4a7c3ccd79a3f4b3f5
11
DISTFILES=	${DISTNAME:C/.*-//}${EXTRACT_SUFX}
10
DISTFILES=	${DISTNAME:C/.*-//}${EXTRACT_SUFX}
12
DIST_SUBDIR=	firefox
11
DIST_SUBDIR=	firefox
13
12
14
MAINTAINER=	gecko@FreeBSD.org
13
MAINTAINER=	gecko@FreeBSD.org
15
COMMENT=	Web browser based on the browser portion of Mozilla
14
COMMENT=	Web browser based on the browser portion of Mozilla
16
15
17
BUILD_DEPENDS=	nspr>=4.18:devel/nspr \
16
BUILD_DEPENDS=	nspr>=4.19:devel/nspr \
18
		nss>=3.35:security/nss \
17
		nss>=3.36:security/nss \
19
		icu>=59.1,1:devel/icu \
18
		icu>=59.1,1:devel/icu \
20
		libevent>=2.1.8:devel/libevent \
19
		libevent>=2.1.8:devel/libevent \
21
		harfbuzz>=1.7.4:print/harfbuzz \
20
		harfbuzz>=1.7.6:print/harfbuzz \
22
		graphite2>=1.3.10:graphics/graphite2 \
21
		graphite2>=1.3.11:graphics/graphite2 \
23
		png>=1.6.34:graphics/png \
22
		png>=1.6.34:graphics/png \
24
		libvorbis>=1.3.5,3:audio/libvorbis \
23
		libvorbis>=1.3.5,3:audio/libvorbis \
25
		libvpx>=1.5.0:multimedia/libvpx \
24
		libvpx>=1.5.0:multimedia/libvpx \
26
		sqlite3>=3.21.0:databases/sqlite3 \
25
		sqlite3>=3.22.0:databases/sqlite3 \
27
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
26
		${PYTHON_PKGNAMEPREFIX}sqlite3>0:databases/py-sqlite3@${PY_FLAVOR} \
28
		v4l_compat>0:multimedia/v4l_compat \
27
		v4l_compat>0:multimedia/v4l_compat \
29
		autoconf-2.13:devel/autoconf213 \
28
		autoconf-2.13:devel/autoconf213 \
(-)b/www/firefox/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1520456550
1
TIMESTAMP = 1520432739
2
SHA256 (firefox/e9128973a480c8aedf3a2e1c67d3e168613fa17c.tar.bz2) = bd6c5a7635009cb1a95824287b9751f1012f8e13bec057811d882e0db75e1258
2
SHA256 (firefox/0938d48917b73d31fa8bfa4a7c3ccd79a3f4b3f5.tar.bz2) = 56a55346d8abb911dab2d1d53651c60a415b99e4a54b356ac28f3420e7ca19e1
3
SIZE (firefox/e9128973a480c8aedf3a2e1c67d3e168613fa17c.tar.bz2) = 304977546
3
SIZE (firefox/0938d48917b73d31fa8bfa4a7c3ccd79a3f4b3f5.tar.bz2) = 329655598
(-)b/www/firefox/files/patch-a-gyp-webrtc (+21490 lines)
Added Link Here
1
Revert bug 1393119, bug 1429819, bug 1436959 to unbreak WebRTC
2
3
diff --git media/webrtc/moz.build media/webrtc/moz.build
4
index 3aeb939a4e4b..115831cc69d5 100644
5
--- media/webrtc/moz.build
6
+++ media/webrtc/moz.build
7
@@ -11,7 +11,6 @@ with Files("signaling/**"):
8
     BUG_COMPONENT = ("Core", "WebRTC: Signaling")
9
 
10
 include('/build/gyp.mozbuild')
11
-include('/build/gn.mozbuild')
12
 
13
 webrtc_non_unified_sources = [
14
     'trunk/webrtc/common_audio/vad/vad_core.c',                                  # Because of name clash in the kInitCheck variable
15
@@ -57,6 +56,8 @@ webrtc_non_unified_sources = [
16
     'trunk/webrtc/video/overuse_frame_detector.cc',                              # Because of name clash with call_stats.cc on kWeightFactor
17
 ]
18
 
19
+GYP_DIRS += ['trunk']
20
+
21
 # Set gyp vars that webrtc needs when building under various analysis tools.
22
 # Primarily this prevents webrtc from setting NVALGRIND and breaking builds.
23
 gyp_vars_copy = gyp_vars.copy()
24
@@ -67,21 +68,12 @@ elif CONFIG['MOZ_ASAN']:
25
 elif CONFIG['MOZ_TSAN']:
26
     gyp_vars_copy.update(build_for_tool="tsan")
27
 
28
-GN_DIRS += ['trunk']
29
-
30
-gn_vars_copy = gn_vars.copy()
31
-
32
-GN_DIRS['trunk'].variables = gn_vars_copy
33
-GN_DIRS['trunk'].mozilla_flags = [
34
-    '-fobjc-arc',
35
-    '-mfpu=neon',
36
-    '-msse2',
37
-]
38
-
39
+GYP_DIRS['trunk'].input = 'trunk/peerconnection.gyp'
40
+GYP_DIRS['trunk'].variables = gyp_vars_copy
41
 # We allow warnings for third-party code that can be updated from upstream.
42
-GN_DIRS['trunk'].sandbox_vars['COMPILE_FLAGS'] = {'WARNINGS_AS_ERRORS': []}
43
-GN_DIRS['trunk'].sandbox_vars['FINAL_LIBRARY'] = 'webrtc'
44
-GN_DIRS['trunk'].non_unified_sources += webrtc_non_unified_sources
45
+GYP_DIRS['trunk'].sandbox_vars['COMPILE_FLAGS'] = {'WARNINGS_AS_ERRORS': []}
46
+GYP_DIRS['trunk'].sandbox_vars['FINAL_LIBRARY'] = 'webrtc'
47
+GYP_DIRS['trunk'].non_unified_sources += webrtc_non_unified_sources
48
 
49
 if CONFIG['MOZ_WEBRTC_SIGNALING']:
50
     DIRS += [
51
diff --git media/webrtc/trunk/build/OWNERS media/webrtc/trunk/build/OWNERS
52
index c644ca7d5fd5..72e8ffc0db8a 100644
53
--- media/webrtc/trunk/build/OWNERS
54
+++ media/webrtc/trunk/build/OWNERS
55
@@ -1,22 +1 @@
56
-agrieve@chromium.org
57
-dpranke@chromium.org
58
-jbudorick@chromium.org
59
-jochen@chromium.org
60
-scottmg@chromium.org
61
-thakis@chromium.org
62
-brucedawson@chromium.org
63
-
64
-per-file .gitignore=*
65
-per-file mac_toolchain.py=erikchen@chromium.org
66
-per-file mac_toolchain.py=justincohen@chromium.org
67
-per-file package_mac_toolchain.py=erikchen@chromium.org
68
-per-file package_mac_toolchain.py=justincohen@chromium.org
69
-per-file whitespace_file.txt=*
70
-per-file OWNERS.status=*
71
-
72
-# gn-dev is probably a better team here, but the tooling won't let us
73
-# have more than one team per component, and infra-dev is a catch-all
74
-# for other build-related lists.
75
-#
76
-# TEAM: infra-dev@chromium.org
77
-# COMPONENT: Build
78
+*
79
diff --git media/webrtc/trunk/build/common.croc media/webrtc/trunk/build/common.croc
80
index fde7a8b29821..7281bb4eb4d8 100644
81
--- media/webrtc/trunk/build/common.croc
82
+++ media/webrtc/trunk/build/common.croc
83
@@ -57,7 +57,7 @@
84
     },
85
     # Don't include output dirs
86
     {
87
-      'regexp' : '.*/(Debug|Release|out|xcodebuild)/',
88
+      'regexp' : '.*/(Debug|Release|sconsbuild|out|xcodebuild)/',
89
       'include' : 0,
90
     },
91
     # Don't include third-party source
92
@@ -89,7 +89,7 @@
93
     },
94
     {
95
       'stat' : '100.0 * files_instrumented / files_executable',
96
-      'format' : '*RESULT FilesInstrumentedPercent: files_instrumented_percent= %g percent',
97
+      'format' : '*RESULT FilesInstrumentedPercent: files_instrumented_percent= %g',
98
     },
99
     {
100
       'stat' : 'lines_executable',
101
@@ -111,16 +111,16 @@
102
     },
103
     {
104
       'stat' : '100.0 * lines_covered / lines_executable',
105
-      'format' : '*RESULT PercentCovered: percent_covered= %g percent',
106
+      'format' : '*RESULT PercentCovered: percent_covered= %g',
107
     },
108
     {
109
       'stat' : '100.0 * lines_covered / lines_executable',
110
-      'format' : '*RESULT PercentCoveredSource: percent_covered_source= %g percent',
111
+      'format' : '*RESULT PercentCoveredSource: percent_covered_source= %g',
112
       'group' : 'source',
113
     },
114
     {
115
       'stat' : '100.0 * lines_covered / lines_executable',
116
-      'format' : '*RESULT PercentCoveredTest: percent_covered_test= %g percent',
117
+      'format' : '*RESULT PercentCoveredTest: percent_covered_test= %g',
118
       'group' : 'test',
119
     },
120
   ],
121
diff --git media/webrtc/trunk/build/compiler_version.py media/webrtc/trunk/build/compiler_version.py
122
index 8db010811096..eae7b176dd21 100755
123
--- media/webrtc/trunk/build/compiler_version.py
124
+++ media/webrtc/trunk/build/compiler_version.py
125
@@ -14,115 +14,63 @@ import re
126
 import subprocess
127
 import sys
128
 
129
-
130
-compiler_version_cache = {}  # Map from (compiler, tool) -> version.
131
-
132
-
133
-def Usage(program_name):
134
-  print '%s MODE TOOL' % os.path.basename(program_name)
135
-  print 'MODE: host or target.'
136
-  print 'TOOL: assembler or compiler or linker.'
137
-  return 1
138
-
139
-
140
-def ParseArgs(args):
141
-  if len(args) != 2:
142
-    raise Exception('Invalid number of arguments')
143
-  mode = args[0]
144
-  tool = args[1]
145
-  if mode not in ('host', 'target'):
146
-    raise Exception('Invalid mode: %s' % mode)
147
-  if tool not in ('assembler',):
148
-    raise Exception('Invalid tool: %s' % tool)
149
-  return mode, tool
150
-
151
-
152
-def GetEnvironFallback(var_list, default):
153
-  """Look up an environment variable from a possible list of variable names."""
154
-  for var in var_list:
155
-    if var in os.environ:
156
-      return os.environ[var]
157
-  return default
158
-
159
-
160
-def GetVersion(compiler, tool):
161
-  tool_output = tool_error = None
162
-  cache_key = (compiler, tool)
163
-  cached_version = compiler_version_cache.get(cache_key)
164
-  if cached_version:
165
-    return cached_version
166
+def GetVersion(compiler):
167
   try:
168
     # Note that compiler could be something tricky like "distcc g++".
169
-    if tool == "assembler":
170
-      compiler = compiler + " -Xassembler --version -x assembler -c /dev/null"
171
-      # Unmodified: GNU assembler (GNU Binutils) 2.24
172
-      # Ubuntu: GNU assembler (GNU Binutils for Ubuntu) 2.22
173
-      # Fedora: GNU assembler version 2.23.2
174
-      version_re = re.compile(r"^GNU [^ ]+ .* (\d+).(\d+).*?$", re.M)
175
-    else:
176
-      raise Exception("Unknown tool %s" % tool)
177
-
178
-    # Force the locale to C otherwise the version string could be localized
179
-    # making regex matching fail.
180
-    env = os.environ.copy()
181
-    env["LC_ALL"] = "C"
182
-    pipe = subprocess.Popen(compiler, shell=True, env=env,
183
+    compiler = compiler + " -dumpversion"
184
+    pipe = subprocess.Popen(compiler, shell=True,
185
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
186
-    tool_output, tool_error = pipe.communicate()
187
+    gcc_output, gcc_error = pipe.communicate()
188
     if pipe.returncode:
189
       raise subprocess.CalledProcessError(pipe.returncode, compiler)
190
 
191
-    parsed_output = version_re.match(tool_output)
192
-    result = parsed_output.group(1) + parsed_output.group(2)
193
-    compiler_version_cache[cache_key] = result
194
-    return result
195
+    result = re.match(r"(\d+)\.(\d+)", gcc_output)
196
+    return result.group(1) + result.group(2)
197
   except Exception, e:
198
-    if tool_error:
199
-      sys.stderr.write(tool_error)
200
+    if gcc_error:
201
+      sys.stderr.write(gcc_error)
202
     print >> sys.stderr, "compiler_version.py failed to execute:", compiler
203
     print >> sys.stderr, e
204
     return ""
205
 
206
+def GetVersionFromEnvironment(compiler_env):
207
+  """ Returns the version of compiler
208
+
209
+  If the compiler was set by the given environment variable and exists,
210
+  return its version, otherwise None is returned.
211
+  """
212
+  cxx = os.getenv(compiler_env, None)
213
+  if cxx:
214
+    cxx_version = GetVersion(cxx)
215
+    if cxx_version != "":
216
+      return cxx_version
217
+  return None
218
+
219
+def main():
220
+  # Check if CXX_target or CXX environment variable exists an if it does use
221
+  # that compiler.
222
+  # TODO: Fix ninja (see http://crbug.com/140900) instead and remove this code
223
+  # In ninja's cross compile mode, the CXX_target is target compiler, while
224
+  # the CXX is host. The CXX_target needs be checked first, though the target
225
+  # and host compiler have different version, there seems no issue to use the
226
+  # target compiler's version number as gcc_version in Android.
227
+  cxx_version = GetVersionFromEnvironment("CXX_target")
228
+  if cxx_version:
229
+    print cxx_version
230
+    return 0
231
+
232
+  cxx_version = GetVersionFromEnvironment("CXX")
233
+  if cxx_version:
234
+    print cxx_version
235
+    return 0
236
+
237
+  # Otherwise we check the g++ version.
238
+  gccversion = GetVersion("g++")
239
+  if gccversion != "":
240
+    print gccversion
241
+    return 0
242
 
243
-def main(args):
244
-  try:
245
-    (mode, tool) = ParseArgs(args[1:])
246
-  except Exception, e:
247
-    sys.stderr.write(e.message + '\n\n')
248
-    return Usage(args[0])
249
-
250
-  ret_code, result = ExtractVersion(mode, tool)
251
-  if ret_code == 0:
252
-    print result
253
-  return ret_code
254
-
255
-
256
-def DoMain(args):
257
-  """Hook to be called from gyp without starting a separate python
258
-  interpreter."""
259
-  (mode, tool) = ParseArgs(args)
260
-  ret_code, result = ExtractVersion(mode, tool)
261
-  if ret_code == 0:
262
-    return result
263
-  raise Exception("Failed to extract compiler version for args: %s" % args)
264
-
265
-
266
-def ExtractVersion(mode, tool):
267
-  # Check if various CXX environment variables exist and use them if they
268
-  # exist. The preferences and fallback order is a close approximation of
269
-  # GenerateOutputForConfig() in GYP's ninja generator.
270
-  # The main difference being not supporting GYP's make_global_settings.
271
-  environments = ['CXX_target', 'CXX']
272
-  if mode == 'host':
273
-    environments = ['CXX_host'] + environments;
274
-  compiler = GetEnvironFallback(environments, 'c++')
275
-
276
-  if compiler:
277
-    compiler_version = GetVersion(compiler, tool)
278
-    if compiler_version != "":
279
-      return (0, compiler_version)
280
-  return (1, None)
281
-
282
+  return 1
283
 
284
 if __name__ == "__main__":
285
-  sys.exit(main(sys.argv))
286
+  sys.exit(main())
287
diff --git media/webrtc/trunk/build/copy_test_data_ios.py media/webrtc/trunk/build/copy_test_data_ios.py
288
index 6f0302f9506e..51307358355e 100755
289
--- media/webrtc/trunk/build/copy_test_data_ios.py
290
+++ media/webrtc/trunk/build/copy_test_data_ios.py
291
@@ -13,16 +13,13 @@ import sys
292
 class WrongNumberOfArgumentsException(Exception):
293
   pass
294
 
295
-def EscapePath(path):
296
-  """Returns a path with spaces escaped."""
297
-  return path.replace(" ", "\\ ")
298
-
299
 def ListFilesForPath(path):
300
   """Returns a list of all the files under a given path."""
301
   output = []
302
-  # Ignore revision control metadata directories.
303
-  if (os.path.basename(path).startswith('.git') or
304
-      os.path.basename(path).startswith('.svn')):
305
+  # Ignore dotfiles and dot directories.
306
+  # TODO(rohitrao): This will fail to exclude cases where the initial argument
307
+  # is a relative path that starts with a dot.
308
+  if os.path.basename(path).startswith('.'):
309
     return output
310
 
311
   # Files get returned without modification.
312
@@ -40,10 +37,13 @@ def ListFilesForPath(path):
313
 def CalcInputs(inputs):
314
   """Computes the full list of input files for a set of command-line arguments.
315
   """
316
-  # |inputs| is a list of paths, which may be directories.
317
+  # |inputs| is a list of strings, each of which may contain muliple paths
318
+  # separated by spaces.
319
   output = []
320
   for input in inputs:
321
-    output.extend(ListFilesForPath(input))
322
+    tokens = input.split()
323
+    for token in tokens:
324
+      output.extend(ListFilesForPath(token))
325
   return output
326
 
327
 def CopyFiles(relative_filenames, output_basedir):
328
@@ -77,15 +77,14 @@ def DoMain(argv):
329
     raise WrongNumberOfArgumentsException('<input_files> required.')
330
 
331
   files_to_copy = CalcInputs(arglist)
332
-  escaped_files = [EscapePath(x) for x in CalcInputs(arglist)]
333
   if options.list_inputs:
334
-    return '\n'.join(escaped_files)
335
+    return '\n'.join(files_to_copy)
336
 
337
   if not options.output_dir:
338
     raise WrongNumberOfArgumentsException('-o required.')
339
 
340
   if options.list_outputs:
341
-    outputs = [os.path.join(options.output_dir, x) for x in escaped_files]
342
+    outputs = [os.path.join(options.output_dir, x) for x in files_to_copy]
343
     return '\n'.join(outputs)
344
 
345
   CopyFiles(files_to_copy, options.output_dir)
346
diff --git media/webrtc/trunk/build/cp.py media/webrtc/trunk/build/cp.py
347
index 0f32536b624b..dd98e1db15d2 100755
348
--- media/webrtc/trunk/build/cp.py
349
+++ media/webrtc/trunk/build/cp.py
350
@@ -9,14 +9,13 @@ This module works much like the cp posix command - it takes 2 arguments:
351
 (src, dst) and copies the file with path |src| to |dst|.
352
 """
353
 
354
-import os
355
 import shutil
356
 import sys
357
 
358
 
359
 def Main(src, dst):
360
   # Use copy instead of copyfile to ensure the executable bit is copied.
361
-  return shutil.copy(src, os.path.normpath(dst))
362
+  return shutil.copy(src, dst)
363
 
364
 
365
 if __name__ == '__main__':
366
diff --git media/webrtc/trunk/build/dir_exists.py media/webrtc/trunk/build/dir_exists.py
367
index 70d367ec2690..0a89bc87bbf6 100755
368
--- media/webrtc/trunk/build/dir_exists.py
369
+++ media/webrtc/trunk/build/dir_exists.py
370
@@ -8,16 +8,8 @@ import os.path
371
 import sys
372
 
373
 def main():
374
-  sys.stdout.write(_is_dir(sys.argv[1]))
375
+  sys.stdout.write(str(os.path.isdir(sys.argv[1])))
376
   return 0
377
 
378
-def _is_dir(dir_name):
379
-  return str(os.path.isdir(dir_name))
380
-
381
-def DoMain(args):
382
-  """Hook to be called from gyp without starting a separate python
383
-  interpreter."""
384
-  return _is_dir(args[0])
385
-
386
 if __name__ == '__main__':
387
   sys.exit(main())
388
diff --git media/webrtc/trunk/build/download_nacl_toolchains.py media/webrtc/trunk/build/download_nacl_toolchains.py
389
index cccecce9ef95..c2007d0f1038 100755
390
--- media/webrtc/trunk/build/download_nacl_toolchains.py
391
+++ media/webrtc/trunk/build/download_nacl_toolchains.py
392
@@ -6,7 +6,6 @@
393
 """Shim to run nacl toolchain download script only if there is a nacl dir."""
394
 
395
 import os
396
-import shutil
397
 import sys
398
 
399
 
400
@@ -14,46 +13,50 @@ def Main(args):
401
   # Exit early if disable_nacl=1.
402
   if 'disable_nacl=1' in os.environ.get('GYP_DEFINES', ''):
403
     return 0
404
-  if 'OS=android' in os.environ.get('GYP_DEFINES', ''):
405
-    return 0
406
   script_dir = os.path.dirname(os.path.abspath(__file__))
407
   src_dir = os.path.dirname(script_dir)
408
   nacl_dir = os.path.join(src_dir, 'native_client')
409
   nacl_build_dir = os.path.join(nacl_dir, 'build')
410
-  package_version_dir = os.path.join(nacl_build_dir, 'package_version')
411
-  package_version = os.path.join(package_version_dir, 'package_version.py')
412
-  if not os.path.exists(package_version):
413
-    print "Can't find '%s'" % package_version
414
+  download_script = os.path.join(nacl_build_dir, 'download_toolchains.py')
415
+  if not os.path.exists(download_script):
416
+    print "Can't find '%s'" % download_script
417
     print 'Presumably you are intentionally building without NativeClient.'
418
     print 'Skipping NativeClient toolchain download.'
419
     sys.exit(0)
420
-  sys.path.insert(0, package_version_dir)
421
-  import package_version
422
+  sys.path.insert(0, nacl_build_dir)
423
+  import download_toolchains
424
 
425
+  # TODO (robertm): Finish getting PNaCl ready for prime time.
426
   # BUG:
427
   # We remove this --optional-pnacl argument, and instead replace it with
428
-  # --no-pnacl for most cases.  However, if the bot name is an sdk
429
+  # --no-pnacl for most cases.  However, if the bot name is the pnacl_sdk
430
   # bot then we will go ahead and download it.  This prevents increasing the
431
   # gclient sync time for developers, or standard Chrome bots.
432
   if '--optional-pnacl' in args:
433
     args.remove('--optional-pnacl')
434
+    # By default we don't use PNaCl toolchain yet, unless on ARM, where
435
+    # there is no other toolchain to build untrusted code at the moment.
436
+    # So analyze if we're building for ARM, or on SDK buildbot.
437
+    # TODO(olonho): we need to invent more reliable way to get build
438
+    # configuration info, to know if we're building for ARM.
439
     use_pnacl = False
440
+    if 'target_arch=arm' in os.environ.get('GYP_DEFINES', ''):
441
+      use_pnacl = True
442
     buildbot_name = os.environ.get('BUILDBOT_BUILDERNAME', '')
443
-    if 'pnacl' in buildbot_name and 'sdk' in buildbot_name:
444
+    if buildbot_name.find('pnacl') >= 0 and  buildbot_name.find('sdk') >= 0:
445
       use_pnacl = True
446
     if use_pnacl:
447
       print '\n*** DOWNLOADING PNACL TOOLCHAIN ***\n'
448
     else:
449
-      args = ['--exclude', 'pnacl_newlib'] + args
450
-
451
-  # Only download the ARM gcc toolchain if we are building for ARM
452
-  # TODO(olonho): we need to invent more reliable way to get build
453
-  # configuration info, to know if we're building for ARM.
454
-  if 'target_arch=arm' not in os.environ.get('GYP_DEFINES', ''):
455
-      args = ['--exclude', 'nacl_arm_newlib'] + args
456
+      args.append('--no-pnacl')
457
 
458
-  package_version.main(args)
459
+  # Append the name of the file to use as a version and hash source.
460
+  # NOTE:  While not recommended, it is possible to redirect this file to
461
+  # a chrome location to avoid branching NaCl if just a toolchain needs
462
+  # to be bumped.
463
+  args.append(os.path.join(nacl_dir,'TOOL_REVISIONS'))
464
 
465
+  download_toolchains.main(args)
466
   return 0
467
 
468
 
469
diff --git media/webrtc/trunk/build/extract_from_cab.py media/webrtc/trunk/build/extract_from_cab.py
470
index 080370ca9ade..1c928af36f93 100755
471
--- media/webrtc/trunk/build/extract_from_cab.py
472
+++ media/webrtc/trunk/build/extract_from_cab.py
473
@@ -12,7 +12,7 @@ import sys
474
 import tempfile
475
 
476
 def run_quiet(*args):
477
-  """Run 'expand' suppressing noisy output. Returns returncode from process."""
478
+  """Run 'expand' supressing noisy output. Returns returncode from process."""
479
   popen = subprocess.Popen(args, stdout=subprocess.PIPE)
480
   out, _ = popen.communicate()
481
   if popen.returncode:
482
diff --git media/webrtc/trunk/build/gdb-add-index media/webrtc/trunk/build/gdb-add-index
483
index 73367c835034..4975532213bc 100755
484
--- media/webrtc/trunk/build/gdb-add-index
485
+++ media/webrtc/trunk/build/gdb-add-index
486
@@ -4,181 +4,44 @@
487
 # found in the LICENSE file.
488
 #
489
 # Saves the gdb index for a given binary and its shared library dependencies.
490
-#
491
-# This will run gdb index in parallel on a number of binaries using SIGUSR1
492
-# as the communication mechanism to simulate a semaphore. Because of the
493
-# nature of this technique, using "set -e" is very difficult. The SIGUSR1
494
-# terminates a "wait" with an error which we need to interpret.
495
-#
496
-# When modifying this code, most of the real logic is in the index_one_file
497
-# function. The rest is cleanup + sempahore plumbing.
498
-
499
-function usage_exit {
500
-  echo "Usage: $0 [-f] [-r] [-n] <paths-to-binaries>..."
501
-  echo "  -f forces replacement of an existing index."
502
-  echo "  -r removes the index section."
503
-  echo "  -n don't extract the dependencies of each binary with lld."
504
-  echo "       e.g., $0 -n out/Debug/lib.unstripped/lib*"
505
-  echo
506
-  echo "  Set TOOLCHAIN_PREFIX to use a non-default set of binutils."
507
-  exit 1
508
-}
509
-
510
-# Cleanup temp directory and ensure all child jobs are dead-dead.
511
-function on_exit {
512
-  trap "" EXIT USR1  # Avoid reentrancy.
513
-
514
-  local jobs=$(jobs -p)
515
-  if [ -n "$jobs" ]; then
516
-    echo -n "Killing outstanding index jobs..."
517
-    kill -KILL $(jobs -p)
518
-    wait
519
-    echo "done"
520
-  fi
521
-
522
-  if [ -d "$directory" ]; then
523
-    echo -n "Removing temp directory $directory..."
524
-    rm -rf "$directory"
525
-    echo done
526
-  fi
527
-}
528
-
529
-# Add index to one binary.
530
-function index_one_file {
531
-  local file=$1
532
-  local basename=$(basename "$file")
533
-  local should_index_this_file="${should_index}"
534
-
535
-  local readelf_out=$(${TOOLCHAIN_PREFIX}readelf -S "$file")
536
-  if [[ $readelf_out =~ "gdb_index" ]]; then
537
-    if $remove_index; then
538
-      ${TOOLCHAIN_PREFIX}objcopy --remove-section .gdb_index "$file"
539
-      echo "Removed index from $basename."
540
-    else
541
-      echo "Skipped $basename -- already contains index."
542
-      should_index_this_file=false
543
-    fi
544
-  fi
545
-
546
-  if $should_index_this_file; then
547
-    local start=$(date +"%s%N")
548
-    echo "Adding index to $basename..."
549
-
550
-    ${TOOLCHAIN_PREFIX}gdb -batch "$file" -ex "save gdb-index $directory" \
551
-      -ex "quit"
552
-    local index_file="$directory/$basename.gdb-index"
553
-    if [ -f "$index_file" ]; then
554
-      ${TOOLCHAIN_PREFIX}objcopy --add-section .gdb_index="$index_file" \
555
-        --set-section-flags .gdb_index=readonly "$file" "$file"
556
-      local finish=$(date +"%s%N")
557
-      local elapsed=$(((finish - start) / 1000000))
558
-      echo "   ...$basename indexed. [${elapsed}ms]"
559
-    else
560
-      echo "   ...$basename unindexable."
561
-    fi
562
-  fi
563
-}
564
 
565
-# Functions that when combined, concurrently index all files in FILES_TO_INDEX
566
-# array. The global FILES_TO_INDEX is declared in the main body of the script.
567
-function async_index {
568
-  # Start a background subshell to run the index command.
569
-  {
570
-    index_one_file $1
571
-    kill -SIGUSR1 $$  # $$ resolves to the parent script.
572
-    exit 129  # See comment above wait loop at bottom.
573
-  } &
574
-}
575
+set -e
576
 
577
-cur_file_num=0
578
-function index_next {
579
-  if ((cur_file_num >= ${#files_to_index[@]})); then
580
-    return
581
-  fi
582
-
583
-  async_index "${files_to_index[cur_file_num]}"
584
-  ((cur_file_num += 1)) || true
585
-}
586
-
587
-########
588
-### Main body of the script.
589
-
590
-remove_index=false
591
-should_index=true
592
-should_index_deps=true
593
-files_to_index=()
594
-while (($# > 0)); do
595
-  case "$1" in
596
-    -h)
597
-      usage_exit
598
-      ;;
599
-    -f)
600
-      remove_index=true
601
-      ;;
602
-    -r)
603
-      remove_index=true
604
-      should_index=false
605
-      ;;
606
-    -n)
607
-      should_index_deps=false
608
-      ;;
609
-    -*)
610
-      echo "Invalid option: $1" >&2
611
-      usage_exit
612
-      ;;
613
-    *)
614
-      if [[ ! -f "$1" ]]; then
615
-        echo "Path $1 does not exist."
616
-        exit 1
617
-      fi
618
-      files_to_index+=("$1")
619
-      ;;
620
-  esac
621
-  shift
622
-done
623
-
624
-if ((${#files_to_index[@]} == 0)); then
625
-  usage_exit
626
+if [[ ! $# == 1 ]]; then
627
+  echo "Usage: $0 path-to-binary"
628
+  exit 1
629
 fi
630
 
631
-dependencies=()
632
-if $should_index_deps; then
633
-  for file in "${files_to_index[@]}"; do
634
-      # Append the shared library dependencies of this file that
635
-      # have the same dirname. The dirname is a signal that these
636
-      # shared libraries were part of the same build as the binary.
637
-      dependencies+=( \
638
-        $(ldd "$file" 2>/dev/null \
639
-          | grep $(dirname "$file") \
640
-          | sed "s/.*[ \t]\(.*\) (.*/\1/") \
641
-      )
642
-  done
643
+FILENAME="$1"
644
+if [[ ! -f "$FILENAME" ]]; then
645
+  echo "Path $FILENAME does not exist."
646
+  exit 1
647
 fi
648
-files_to_index+=("${dependencies[@]}")
649
-
650
-# Ensure we cleanup on on exit.
651
-trap on_exit EXIT INT
652
 
653
 # We're good to go! Create temp directory for index files.
654
-directory=$(mktemp -d)
655
-echo "Made temp directory $directory."
656
-
657
-# Start concurrent indexing.
658
-trap index_next USR1
659
-
660
-# 4 is an arbitrary default. When changing, remember we are likely IO bound
661
-# so basing this off the number of cores is not sensible.
662
-index_tasks=${INDEX_TASKS:-4}
663
-for ((i = 0; i < index_tasks; i++)); do
664
-  index_next
665
-done
666
-
667
-# Do a wait loop. Bash waits that terminate due a trap have an exit
668
-# code > 128. We also ensure that our subshell's "normal" exit occurs with
669
-# an exit code > 128. This allows us to do consider a > 128 exit code as
670
-# an indication that the loop should continue. Unfortunately, it also means
671
-# we cannot use set -e since technically the "wait" is failing.
672
-wait
673
-while (($? > 128)); do
674
-  wait
675
+DIRECTORY=$(mktemp -d)
676
+echo "Made temp directory $DIRECTORY."
677
+
678
+# Always remove directory on exit.
679
+trap "{ echo -n Removing temp directory $DIRECTORY...;
680
+  rm -rf $DIRECTORY; echo done; }" EXIT
681
+
682
+# Grab all the chromium shared library files.
683
+so_files=$(ldd "$FILENAME" 2>/dev/null \
684
+  | grep $(dirname "$FILENAME") \
685
+  | sed "s/.*[ \t]\(.*\) (.*/\1/")
686
+
687
+# Add index to binary and the shared library dependencies.
688
+for file in "$FILENAME" $so_files; do
689
+  basename=$(basename "$file")
690
+  echo -n "Adding index to $basename..."
691
+  readelf_out=$(readelf -S "$file")
692
+  if [[ $readelf_out =~ "gdb_index" ]]; then
693
+    echo "already contains index. Skipped."
694
+  else
695
+    gdb -batch "$file" -ex "save gdb-index $DIRECTORY" -ex "quit"
696
+    objcopy --add-section .gdb_index="$DIRECTORY"/$basename.gdb-index \
697
+      --set-section-flags .gdb_index=readonly "$file" "$file"
698
+    echo "done."
699
+  fi
700
 done
701
diff --git media/webrtc/trunk/build/gyp_chromium media/webrtc/trunk/build/gyp_chromium
702
index 4fc62bad9ba1..d13403403162 100755
703
--- media/webrtc/trunk/build/gyp_chromium
704
+++ media/webrtc/trunk/build/gyp_chromium
705
@@ -1,12 +1,175 @@
706
 #!/usr/bin/env python
707
+
708
 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
709
 # Use of this source code is governed by a BSD-style license that can be
710
 # found in the LICENSE file.
711
 
712
-# Simple launcher script for gyp_chromium.py.
713
-# TODO(sbc): This should probably be shell script but for historical
714
-# reasons (all the python code used to live in this script without a
715
-# .py extension, and was often run as 'python gyp_chromium') it is
716
-# currently still python.
717
+# This script is wrapper for Chromium that adds some support for how GYP
718
+# is invoked by Chromium beyond what can be done in the gclient hooks.
719
+
720
+import glob
721
+import os
722
+import shlex
723
+import subprocess
724
+import sys
725
+
726
+script_dir = os.path.dirname(os.path.realpath(__file__))
727
+chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir))
728
+
729
+sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib'))
730
+import gyp
731
+
732
+# Add paths so that pymod_do_main(...) can import files.
733
+sys.path.insert(1, os.path.join(chrome_src, 'tools', 'grit'))
734
+sys.path.insert(1, os.path.join(chrome_src, 'chrome', 'tools', 'build'))
735
+sys.path.insert(1, os.path.join(chrome_src, 'native_client', 'build'))
736
+
737
+
738
+# On Windows, Psyco shortens warm runs of build/gyp_chromium by about
739
+# 20 seconds on a z600 machine with 12 GB of RAM, from 90 down to 70
740
+# seconds.  Conversely, memory usage of build/gyp_chromium with Psyco
741
+# maxes out at about 158 MB vs. 132 MB without it.
742
+#
743
+# Psyco uses native libraries, so we need to load a different
744
+# installation depending on which OS we are running under. It has not
745
+# been tested whether using Psyco on our Mac and Linux builds is worth
746
+# it (the GYP running time is a lot shorter, so the JIT startup cost
747
+# may not be worth it).
748
+if sys.platform == 'win32':
749
+  try:
750
+    sys.path.insert(0, os.path.join(chrome_src, 'third_party', 'psyco_win32'))
751
+    import psyco
752
+  except:
753
+    psyco = None
754
+else:
755
+  psyco = None
756
+
757
+def apply_gyp_environment(file_path=None):
758
+  """
759
+  Reads in a *.gyp_env file and applies the valid keys to os.environ.
760
+  """
761
+  if not file_path or not os.path.exists(file_path):
762
+    return
763
+  file_contents = open(file_path).read()
764
+  try:
765
+    file_data = eval(file_contents, {'__builtins__': None}, None)
766
+  except SyntaxError, e:
767
+    e.filename = os.path.abspath(file_path)
768
+    raise
769
+  supported_vars = ( 'CC',
770
+                     'CHROMIUM_GYP_FILE',
771
+                     'CHROMIUM_GYP_SYNTAX_CHECK',
772
+                     'CXX',
773
+                     'GYP_DEFINES',
774
+                     'GYP_GENERATOR_FLAGS',
775
+                     'GYP_GENERATOR_OUTPUT',
776
+                     'GYP_GENERATORS', )
777
+  for var in supported_vars:
778
+    val = file_data.get(var)
779
+    if val:
780
+      if var in os.environ:
781
+        print 'INFO: Environment value for "%s" overrides value in %s.' % (
782
+            var, os.path.abspath(file_path)
783
+        )
784
+      else:
785
+        os.environ[var] = val
786
+
787
+def additional_include_files(args=[]):
788
+  """
789
+  Returns a list of additional (.gypi) files to include, without
790
+  duplicating ones that are already specified on the command line.
791
+  """
792
+  # Determine the include files specified on the command line.
793
+  # This doesn't cover all the different option formats you can use,
794
+  # but it's mainly intended to avoid duplicating flags on the automatic
795
+  # makefile regeneration which only uses this format.
796
+  specified_includes = set()
797
+  for arg in args:
798
+    if arg.startswith('-I') and len(arg) > 2:
799
+      specified_includes.add(os.path.realpath(arg[2:]))
800
+
801
+  result = []
802
+  def AddInclude(path):
803
+    if os.path.realpath(path) not in specified_includes:
804
+      result.append(path)
805
+
806
+  # Always include common.gypi.
807
+  AddInclude(os.path.join(script_dir, 'common.gypi'))
808
+
809
+  # Optionally add supplemental .gypi files if present.
810
+  supplements = glob.glob(os.path.join(chrome_src, '*', 'supplement.gypi'))
811
+  for supplement in supplements:
812
+    AddInclude(supplement)
813
+
814
+  return result
815
+
816
+if __name__ == '__main__':
817
+  args = sys.argv[1:]
818
+
819
+  # Use the Psyco JIT if available.
820
+  if psyco:
821
+    psyco.profile()
822
+    print "Enabled Psyco JIT."
823
+
824
+  # Fall back on hermetic python if we happen to get run under cygwin.
825
+  # TODO(bradnelson): take this out once this issue is fixed:
826
+  #    http://code.google.com/p/gyp/issues/detail?id=177
827
+  if sys.platform == 'cygwin':
828
+    python_dir = os.path.join(chrome_src, 'third_party', 'python_26')
829
+    env = os.environ.copy()
830
+    env['PATH'] = python_dir + os.pathsep + env.get('PATH', '')
831
+    p = subprocess.Popen(
832
+       [os.path.join(python_dir, 'python.exe')] + sys.argv,
833
+       env=env, shell=False)
834
+    p.communicate()
835
+    sys.exit(p.returncode)
836
+
837
+  if 'SKIP_CHROMIUM_GYP_ENV' not in os.environ:
838
+    # Update the environment based on chromium.gyp_env
839
+    gyp_env_path = os.path.join(os.path.dirname(chrome_src), 'chromium.gyp_env')
840
+    apply_gyp_environment(gyp_env_path)
841
+
842
+  # This could give false positives since it doesn't actually do real option
843
+  # parsing.  Oh well.
844
+  gyp_file_specified = False
845
+  for arg in args:
846
+    if arg.endswith('.gyp'):
847
+      gyp_file_specified = True
848
+      break
849
+
850
+  # If we didn't get a file, check an env var, and then fall back to
851
+  # assuming 'all.gyp' from the same directory as the script.
852
+  if not gyp_file_specified:
853
+    gyp_file = os.environ.get('CHROMIUM_GYP_FILE')
854
+    if gyp_file:
855
+      # Note that CHROMIUM_GYP_FILE values can't have backslashes as
856
+      # path separators even on Windows due to the use of shlex.split().
857
+      args.extend(shlex.split(gyp_file))
858
+    else:
859
+      args.append(os.path.join(script_dir, 'all.gyp'))
860
+
861
+  args.extend(['-I' + i for i in additional_include_files(args)])
862
+
863
+  # There shouldn't be a circular dependency relationship between .gyp files,
864
+  # but in Chromium's .gyp files, on non-Mac platforms, circular relationships
865
+  # currently exist.  The check for circular dependencies is currently
866
+  # bypassed on other platforms, but is left enabled on the Mac, where a
867
+  # violation of the rule causes Xcode to misbehave badly.
868
+  # TODO(mark): Find and kill remaining circular dependencies, and remove this
869
+  # option.  http://crbug.com/35878.
870
+  # TODO(tc): Fix circular dependencies in ChromiumOS then add linux2 to the
871
+  # list.
872
+  if sys.platform not in ('darwin',):
873
+    args.append('--no-circular-check')
874
+
875
+  # If CHROMIUM_GYP_SYNTAX_CHECK is set to 1, it will invoke gyp with --check
876
+  # to enfore syntax checking.
877
+  syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK')
878
+  if syntax_check and int(syntax_check):
879
+    args.append('--check')
880
+
881
+  print 'Updating projects from gyp files...'
882
+  sys.stdout.flush()
883
 
884
-execfile(__file__ + '.py')
885
+  # Off we go...
886
+  sys.exit(gyp.main(args))
887
diff --git media/webrtc/trunk/build/install-build-deps-android.sh media/webrtc/trunk/build/install-build-deps-android.sh
888
index 06f79aee9984..0a90d3b10c05 100755
889
--- media/webrtc/trunk/build/install-build-deps-android.sh
890
+++ media/webrtc/trunk/build/install-build-deps-android.sh
891
@@ -1,78 +1,101 @@
892
-#!/bin/bash
893
+#!/bin/bash -e
894
 
895
 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
896
 # Use of this source code is governed by a BSD-style license that can be
897
 # found in the LICENSE file.
898
 
899
-# Script to install everything needed to build chromium on android, including
900
-# items requiring sudo privileges.
901
-# See https://www.chromium.org/developers/how-tos/android-build-instructions
902
+# Script to install everything needed to build chromium on android that
903
+# requires sudo privileges.
904
+# See http://code.google.com/p/chromium/wiki/AndroidBuildInstructions
905
 
906
-args="$@"
907
+# This script installs the sun-java6 packages (bin, jre and jdk). Sun requires
908
+# a license agreement, so upon installation it will prompt the user. To get
909
+# past the curses-based dialog press TAB <ret> TAB <ret> to agree.
910
 
911
 if ! uname -m | egrep -q "i686|x86_64"; then
912
   echo "Only x86 architectures are currently supported" >&2
913
   exit
914
 fi
915
 
916
-# Exit if any commands fail.
917
-set -e
918
+if [ "x$(id -u)" != x0 ]; then
919
+  echo "Running as non-root user."
920
+  echo "You might have to enter your password one or more times for 'sudo'."
921
+  echo
922
+fi
923
 
924
-lsb_release=$(lsb_release --codename --short)
925
+# The temporary directory used to store output of update-java-alternatives
926
+TEMPDIR=$(mktemp -d)
927
+cleanup() {
928
+  local status=${?}
929
+  trap - EXIT
930
+  rm -rf "${TEMPDIR}"
931
+  exit ${status}
932
+}
933
+trap cleanup EXIT
934
 
935
-# Install first the default Linux build deps.
936
-"$(dirname "${BASH_SOURCE[0]}")/install-build-deps.sh" \
937
-  --no-syms --lib32 --no-arm --no-chromeos-fonts --no-nacl --no-prompt "${args}"
938
+sudo apt-get update
939
 
940
 # Fix deps
941
 sudo apt-get -f install
942
 
943
-# common
944
-sudo apt-get -y install lib32z1 lighttpd python-pexpect xvfb x11-utils
945
-
946
-# Some binaries in the Android SDK require 32-bit libraries on the host.
947
-# See https://developer.android.com/sdk/installing/index.html?pkg=tools
948
-sudo apt-get -y install libncurses5:i386 libstdc++6:i386 zlib1g:i386
949
+# Install deps
950
+# This step differs depending on what Ubuntu release we are running
951
+# on since the package names are different, and Sun's Java must
952
+# be installed manually on late-model versions.
953
 
954
-# Required by //components/cronet/tools/generate_javadoc.py
955
-# TODO(375324): Stop requiring ANT.
956
-sudo apt-get -y install ant
957
-
958
-# Required for apk-patch-size-estimator
959
-sudo apt-get -y install bsdiff
960
-
961
-# Do our own error handling for java.
962
-set +e
963
-
964
-function IsJava8() {
965
-  # Arg is either "java" or "javac"
966
-  $1 -version 2>&1 | grep -q '1\.8'
967
-}
968
-
969
-if ! (IsJava8 java && IsJava8 javac); then
970
-  sudo apt-get -y install openjdk-8-jre openjdk-8-jdk
971
-fi
972
-
973
-# There can be several reasons why java8 is not default despite being installed.
974
-# Just show an error and exit.
975
-if ! (IsJava8 java && IsJava8 javac); then
976
-  echo
977
-  echo "Automatic java installation failed."
978
-  echo '`java -version` reports:'
979
-  java -version
980
-  echo
981
-  echo '`javac -version` reports:'
982
-  javac -version
983
-  echo
984
-  echo "Please ensure that JDK 8 is installed and resolves first in your PATH."
985
-  echo -n '`which java` reports: '
986
-  which java
987
-  echo -n '`which javac` reports: '
988
-  which javac
989
-  echo
990
-  echo "You might also try running:"
991
-  echo "    sudo update-java-alternatives -s java-1.8.0-openjdk-amd64"
992
-  exit 1
993
+# common
994
+sudo apt-get -y install python-pexpect xvfb x11-utils
995
+
996
+if /usr/bin/lsb_release -r -s | grep -q "12."; then
997
+  # Ubuntu 12.x
998
+  sudo apt-get -y install ant
999
+
1000
+  # Java can not be installed via ppa on Ubuntu 12.04+ so we'll
1001
+  # simply check to see if it has been setup properly -- if not
1002
+  # let the user know.
1003
+
1004
+  if ! java -version 2>&1 | grep -q "Java(TM)"; then
1005
+    echo "****************************************************************"
1006
+    echo "You need to install the Oracle Java SDK from http://goo.gl/uPRSq"
1007
+    echo "and configure it as the default command-line Java environment."
1008
+    echo "****************************************************************"
1009
+    exit
1010
+  fi
1011
+
1012
+else
1013
+  # Ubuntu 10.x
1014
+
1015
+  sudo apt-get -y install ant1.8
1016
+
1017
+  # Install sun-java6 stuff
1018
+  sudo apt-get -y install sun-java6-bin sun-java6-jre sun-java6-jdk
1019
+
1020
+  # Switch version of Java to java-6-sun
1021
+  # Sun's java is missing certain Java plugins (e.g. for firefox, mozilla).
1022
+  # These are not required to build, and thus are treated only as warnings.
1023
+  # Any errors in updating java alternatives which are not '*-javaplugin.so'
1024
+  # will cause errors and stop the script from completing successfully.
1025
+  if ! sudo update-java-alternatives -s java-6-sun \
1026
+            >& "${TEMPDIR}"/update-java-alternatives.out
1027
+  then
1028
+    # Check that there are the expected javaplugin.so errors for the update
1029
+    if grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out >& \
1030
+           /dev/null
1031
+    then
1032
+      # Print as warnings all the javaplugin.so errors
1033
+      echo 'WARNING: java-6-sun has no alternatives for the following plugins:'
1034
+      grep 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out
1035
+    fi
1036
+    # Check if there are any errors that are not javaplugin.so
1037
+    if grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out \
1038
+           >& /dev/null
1039
+    then
1040
+      # If there are non-javaplugin.so errors, treat as errors and exit
1041
+      echo 'ERRORS: Failed to update alternatives for java-6-sun:'
1042
+      grep -v 'javaplugin.so' "${TEMPDIR}"/update-java-alternatives.out
1043
+      exit 1
1044
+    fi
1045
+  fi
1046
 fi
1047
 
1048
 echo "install-build-deps-android.sh complete."
1049
diff --git media/webrtc/trunk/build/install-build-deps.sh media/webrtc/trunk/build/install-build-deps.sh
1050
index c965a9b38e06..b77e23a6d9f6 100755
1051
--- media/webrtc/trunk/build/install-build-deps.sh
1052
+++ media/webrtc/trunk/build/install-build-deps.sh
1053
@@ -5,516 +5,166 @@
1054
 # found in the LICENSE file.
1055
 
1056
 # Script to install everything needed to build chromium (well, ideally, anyway)
1057
-# See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_build_instructions.md
1058
+# See http://code.google.com/p/chromium/wiki/LinuxBuildInstructions
1059
+# and http://code.google.com/p/chromium/wiki/LinuxBuild64Bit
1060
 
1061
 usage() {
1062
   echo "Usage: $0 [--options]"
1063
   echo "Options:"
1064
   echo "--[no-]syms: enable or disable installation of debugging symbols"
1065
-  echo "--lib32: enable installation of 32-bit libraries, e.g. for V8 snapshot"
1066
-  echo "--[no-]arm: enable or disable installation of arm cross toolchain"
1067
-  echo "--[no-]chromeos-fonts: enable or disable installation of Chrome OS"\
1068
-       "fonts"
1069
-  echo "--[no-]nacl: enable or disable installation of prerequisites for"\
1070
-       "building standalone NaCl and all its toolchains"
1071
+  echo "--[no-]lib32: enable or disable installation of 32 bit libraries"
1072
   echo "--no-prompt: silently select standard options/defaults"
1073
-  echo "--quick-check: quickly try to determine if dependencies are installed"
1074
-  echo "               (this avoids interactive prompts and sudo commands,"
1075
-  echo "               so might not be 100% accurate)"
1076
-  echo "--unsupported: attempt installation even on unsupported systems"
1077
   echo "Script will prompt interactively if options not given."
1078
   exit 1
1079
 }
1080
 
1081
-# Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is
1082
-# accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has
1083
-# been provided to yes_no(), the function also accepts RETURN as a user input.
1084
-# The parameter specifies the exit code that should be returned in that case.
1085
-# The function will echo the user's selection followed by a newline character.
1086
-# Users can abort the function by pressing CTRL-C. This will call "exit 1".
1087
-yes_no() {
1088
-  if [ 0 -ne "${do_default-0}" ] ; then
1089
-    [ $1 -eq 0 ] && echo "Y" || echo "N"
1090
-    return $1
1091
-  fi
1092
-  local c
1093
-  while :; do
1094
-    c="$(trap 'stty echo -iuclc icanon 2>/dev/null' EXIT INT TERM QUIT
1095
-         stty -echo iuclc -icanon 2>/dev/null
1096
-         dd count=1 bs=1 2>/dev/null | od -An -tx1)"
1097
-    case "$c" in
1098
-      " 0a") if [ -n "$1" ]; then
1099
-               [ $1 -eq 0 ] && echo "Y" || echo "N"
1100
-               return $1
1101
-             fi
1102
-             ;;
1103
-      " 79") echo "Y"
1104
-             return 0
1105
-             ;;
1106
-      " 6e") echo "N"
1107
-             return 1
1108
-             ;;
1109
-      "")    echo "Aborted" >&2
1110
-             exit 1
1111
-             ;;
1112
-      *)     # The user pressed an unrecognized key. As we are not echoing
1113
-             # any incorrect user input, alert the user by ringing the bell.
1114
-             (tput bel) 2>/dev/null
1115
-             ;;
1116
-    esac
1117
-  done
1118
-}
1119
-
1120
-# Checks whether a particular package is available in the repos.
1121
-# USAGE: $ package_exists <package name>
1122
-package_exists() {
1123
-  [ ! -z "`apt-cache search --names-only "$1"`" ]
1124
-}
1125
-
1126
-# These default to on because (some) bots need them and it keeps things
1127
-# simple for the bot setup if all bots just run the script in its default
1128
-# mode.  Developers who don't want stuff they don't need installed on their
1129
-# own workstations can pass --no-arm --no-nacl when running the script.
1130
-do_inst_arm=1
1131
-do_inst_nacl=1
1132
-
1133
 while test "$1" != ""
1134
 do
1135
   case "$1" in
1136
   --syms)                   do_inst_syms=1;;
1137
   --no-syms)                do_inst_syms=0;;
1138
   --lib32)                  do_inst_lib32=1;;
1139
-  --arm)                    do_inst_arm=1;;
1140
-  --no-arm)                 do_inst_arm=0;;
1141
-  --chromeos-fonts)         do_inst_chromeos_fonts=1;;
1142
-  --no-chromeos-fonts)      do_inst_chromeos_fonts=0;;
1143
-  --nacl)                   do_inst_nacl=1;;
1144
-  --no-nacl)                do_inst_nacl=0;;
1145
+  --no-lib32)               do_inst_lib32=0;;
1146
   --no-prompt)              do_default=1
1147
                             do_quietly="-qq --assume-yes"
1148
     ;;
1149
-  --quick-check)            do_quick_check=1;;
1150
-  --unsupported)            do_unsupported=1;;
1151
   *) usage;;
1152
   esac
1153
   shift
1154
 done
1155
 
1156
-if test "$do_inst_arm" = "1"; then
1157
-  do_inst_lib32=1
1158
-fi
1159
-
1160
-# Check for lsb_release command in $PATH
1161
-if ! which lsb_release > /dev/null; then
1162
-  echo "ERROR: lsb_release not found in \$PATH" >&2
1163
-  exit 1;
1164
+if ! egrep -q \
1165
+    'Ubuntu (10\.04|10\.10|11\.04|11\.10|12\.04|lucid|maverick|natty|oneiric|precise)' \
1166
+    /etc/issue; then
1167
+  echo "Only Ubuntu 10.04 (lucid) through 12.04 (precise) are currently" \
1168
+      "supported" >&2
1169
+  exit 1
1170
 fi
1171
 
1172
-distro_codename=$(lsb_release --codename --short)
1173
-distro_id=$(lsb_release --id --short)
1174
-supported_codenames="(trusty|xenial|yakkety)"
1175
-supported_ids="(Debian)"
1176
-if [ 0 -eq "${do_unsupported-0}" ] && [ 0 -eq "${do_quick_check-0}" ] ; then
1177
-  if [[ ! $distro_codename =~ $supported_codenames &&
1178
-        ! $distro_id =~ $supported_ids ]]; then
1179
-    echo -e "ERROR: The only supported distros are\n" \
1180
-      "\tUbuntu 14.04 (trusty)\n" \
1181
-      "\tUbuntu 16.04 (xenial)\n" \
1182
-      "\tUbuntu 16.10 (yakkety)\n" \
1183
-      "\tDebian 8 (jessie) or later" >&2
1184
-    exit 1
1185
-  fi
1186
-
1187
-  if ! uname -m | egrep -q "i686|x86_64"; then
1188
-    echo "Only x86 architectures are currently supported" >&2
1189
-    exit
1190
-  fi
1191
+if ! uname -m | egrep -q "i686|x86_64"; then
1192
+  echo "Only x86 architectures are currently supported" >&2
1193
+  exit
1194
 fi
1195
 
1196
-if [ "x$(id -u)" != x0 ] && [ 0 -eq "${do_quick_check-0}" ]; then
1197
+if [ "x$(id -u)" != x0 ]; then
1198
   echo "Running as non-root user."
1199
   echo "You might have to enter your password one or more times for 'sudo'."
1200
   echo
1201
 fi
1202
 
1203
 # Packages needed for chromeos only
1204
-chromeos_dev_list="libbluetooth-dev libxkbcommon-dev realpath"
1205
-
1206
-# Packages needed for development
1207
-dev_list="\
1208
-  bison
1209
-  cdbs
1210
-  curl
1211
-  dpkg-dev
1212
-  elfutils
1213
-  devscripts
1214
-  fakeroot
1215
-  flex
1216
-  fonts-ipafont
1217
-  fonts-thai-tlwg
1218
-  g++
1219
-  git-core
1220
-  git-svn
1221
-  gperf
1222
-  libasound2-dev
1223
-  libbrlapi-dev
1224
-  libav-tools
1225
-  libbz2-dev
1226
-  libcairo2-dev
1227
-  libcap-dev
1228
-  libcups2-dev
1229
-  libcurl4-gnutls-dev
1230
-  libdrm-dev
1231
-  libelf-dev
1232
-  libffi-dev
1233
-  libgconf2-dev
1234
-  libglib2.0-dev
1235
-  libglu1-mesa-dev
1236
-  libgnome-keyring-dev
1237
-  libgtk2.0-dev
1238
-  libgtk-3-dev
1239
-  libkrb5-dev
1240
-  libnspr4-dev
1241
-  libnss3-dev
1242
-  libpam0g-dev
1243
-  libpci-dev
1244
-  libpulse-dev
1245
-  libsctp-dev
1246
-  libspeechd-dev
1247
-  libsqlite3-dev
1248
-  libssl-dev
1249
-  libudev-dev
1250
-  libwww-perl
1251
-  libxslt1-dev
1252
-  libxss-dev
1253
-  libxt-dev
1254
-  libxtst-dev
1255
-  openbox
1256
-  patch
1257
-  perl
1258
-  pkg-config
1259
-  python
1260
-  python-cherrypy3
1261
-  python-crypto
1262
-  python-dev
1263
-  python-numpy
1264
-  python-opencv
1265
-  python-openssl
1266
-  python-psutil
1267
-  python-yaml
1268
-  rpm
1269
-  ruby
1270
-  subversion
1271
-  ttf-dejavu-core
1272
-  wdiff
1273
-  xcompmgr
1274
-  zip
1275
-  $chromeos_dev_list
1276
-"
1277
+chromeos_dev_list="libbluetooth-dev libpulse-dev"
1278
+
1279
+# Packages need for development
1280
+dev_list="apache2.2-bin bison curl elfutils fakeroot flex g++ gperf
1281
+          language-pack-fr libapache2-mod-php5 libasound2-dev libbz2-dev
1282
+          libcairo2-dev libcups2-dev libcurl4-gnutls-dev libdbus-glib-1-dev
1283
+          libelf-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev
1284
+          libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev
1285
+          libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libsctp-dev
1286
+          libsqlite3-dev libssl-dev libudev-dev libwww-perl libxslt1-dev
1287
+          libxss-dev libxt-dev libxtst-dev mesa-common-dev patch
1288
+          perl php5-cgi pkg-config python python-cherrypy3 python-dev
1289
+          python-psutil rpm ruby subversion ttf-dejavu-core ttf-indic-fonts
1290
+          ttf-kochi-gothic ttf-kochi-mincho ttf-thai-tlwg wdiff git-core
1291
+          $chromeos_dev_list"
1292
 
1293
 # 64-bit systems need a minimum set of 32-bit compat packages for the pre-built
1294
-# NaCl binaries.
1295
-if file -L /sbin/init | grep -q 'ELF 64-bit'; then
1296
+# NaCl binaries. These are always needed, regardless of whether or not we want
1297
+# the full 32-bit "cross-compile" support (--lib32).
1298
+if [ "$(uname -m)" = "x86_64" ]; then
1299
   dev_list="${dev_list} libc6-i386 lib32gcc1 lib32stdc++6"
1300
 fi
1301
 
1302
 # Run-time libraries required by chromeos only
1303
-chromeos_lib_list="libpulse0 libbz2-1.0"
1304
+chromeos_lib_list="libpulse0 libbz2-1.0 libcurl4-gnutls-dev"
1305
 
1306
 # Full list of required run-time libraries
1307
-lib_list="\
1308
-  libatk1.0-0
1309
-  libc6
1310
-  libasound2
1311
-  libcairo2
1312
-  libcap2
1313
-  libcups2
1314
-  libexpat1
1315
-  libffi6
1316
-  libfontconfig1
1317
-  libfreetype6
1318
-  libglib2.0-0
1319
-  libgnome-keyring0
1320
-  libgtk2.0-0
1321
-  libgtk-3-0
1322
-  libpam0g
1323
-  libpango1.0-0
1324
-  libpci3
1325
-  libpcre3
1326
-  libpixman-1-0
1327
-  libspeechd2
1328
-  libstdc++6
1329
-  libsqlite3-0
1330
-  libx11-6
1331
-  libx11-xcb1
1332
-  libxau6
1333
-  libxcb1
1334
-  libxcomposite1
1335
-  libxcursor1
1336
-  libxdamage1
1337
-  libxdmcp6
1338
-  libxext6
1339
-  libxfixes3
1340
-  libxi6
1341
-  libxinerama1
1342
-  libxrandr2
1343
-  libxrender1
1344
-  libxtst6
1345
-  zlib1g
1346
-  $chromeos_lib_list
1347
-"
1348
+lib_list="libatk1.0-0 libc6 libasound2 libcairo2 libcups2 libdbus-glib-1-2
1349
+          libexpat1 libfontconfig1 libfreetype6 libglib2.0-0 libgnome-keyring0
1350
+          libgtk2.0-0 libpam0g libpango1.0-0 libpcre3 libpixman-1-0
1351
+          libpng12-0 libstdc++6 libsqlite3-0 libudev0 libx11-6 libxau6 libxcb1
1352
+          libxcomposite1 libxcursor1 libxdamage1 libxdmcp6 libxext6 libxfixes3
1353
+          libxi6 libxinerama1 libxrandr2 libxrender1 libxtst6 zlib1g
1354
+          $chromeos_lib_list"
1355
 
1356
 # Debugging symbols for all of the run-time libraries
1357
-dbg_list="\
1358
-  libatk1.0-dbg
1359
-  libc6-dbg
1360
-  libcairo2-dbg
1361
-  libffi6-dbg
1362
-  libfontconfig1-dbg
1363
-  libglib2.0-0-dbg
1364
-  libgtk2.0-0-dbg
1365
-  libgtk-3-0-dbg
1366
-  libpango1.0-0-dbg
1367
-  libpcre3-dbg
1368
-  libpixman-1-0-dbg
1369
-  libsqlite3-0-dbg
1370
-  libx11-6-dbg
1371
-  libx11-xcb1-dbg
1372
-  libxau6-dbg
1373
-  libxcb1-dbg
1374
-  libxcomposite1-dbg
1375
-  libxcursor1-dbg
1376
-  libxdamage1-dbg
1377
-  libxdmcp6-dbg
1378
-  libxext6-dbg
1379
-  libxi6-dbg
1380
-  libxinerama1-dbg
1381
-  libxrandr2-dbg
1382
-  libxrender1-dbg
1383
-  libxtst6-dbg
1384
-  zlib1g-dbg
1385
-"
1386
-
1387
-if [[ ! $distro_codename =~ "yakkety" ]]; then
1388
-  dbg_list="${dbg_list} libxfixes3-dbg"
1389
-fi
1390
-
1391
-# Find the proper version of libstdc++6-4.x-dbg.
1392
-if [ "x$distro_codename" = "xtrusty" ]; then
1393
-  dbg_list="${dbg_list} libstdc++6-4.8-dbg"
1394
-else
1395
-  dbg_list="${dbg_list} libstdc++6-4.9-dbg"
1396
-fi
1397
-
1398
-# 32-bit libraries needed e.g. to compile V8 snapshot for Android or armhf
1399
-lib32_list="linux-libc-dev:i386"
1400
-
1401
-# arm cross toolchain packages needed to build chrome on armhf
1402
-EM_REPO="deb http://emdebian.org/tools/debian/ jessie main"
1403
-EM_SOURCE=$(cat <<EOF
1404
-# Repo added by Chromium $0
1405
-${EM_REPO}
1406
-# deb-src http://emdebian.org/tools/debian/ jessie main
1407
-EOF
1408
-)
1409
-EM_ARCHIVE_KEY_FINGER="084C6C6F39159EDB67969AA87DE089671804772E"
1410
-GPP_ARM_PACKAGE="g++-arm-linux-gnueabihf"
1411
-case $distro_codename in
1412
-  jessie)
1413
-    eval $(apt-config shell APT_SOURCESDIR 'Dir::Etc::sourceparts/d')
1414
-    CROSSTOOLS_LIST="${APT_SOURCESDIR}/crosstools.list"
1415
-    arm_list="libc6-dev:armhf
1416
-              linux-libc-dev:armhf"
1417
-    if test "$do_inst_arm" = "1"; then
1418
-      if $(dpkg-query -W ${GPP_ARM_PACKAGE} &>/dev/null); then
1419
-        arm_list+=" ${GPP_ARM_PACKAGE}"
1420
-      else
1421
-        echo "The Debian Cross-toolchains repository is necessary to"
1422
-        echo "cross-compile Chromium for arm."
1423
-        echo -n "Do you want me to add it for you (y/N) "
1424
-        if yes_no 1; then
1425
-          gpg --keyserver pgp.mit.edu --recv-keys ${EM_ARCHIVE_KEY_FINGER}
1426
-          gpg -a --export ${EM_ARCHIVE_KEY_FINGER} | sudo apt-key add -
1427
-          if ! grep "^${EM_REPO}" "${CROSSTOOLS_LIST}" &>/dev/null; then
1428
-            echo "${EM_SOURCE}" | sudo tee -a "${CROSSTOOLS_LIST}" >/dev/null
1429
-          fi
1430
-          arm_list+=" ${GPP_ARM_PACKAGE}"
1431
-        fi
1432
-      fi
1433
-    fi
1434
-    ;;
1435
-  # All necessary ARM packages are available on the default repos on
1436
-  # Debian 9 and later.
1437
-  *)
1438
-    arm_list="binutils-aarch64-linux-gnu
1439
-              libc6-dev-armhf-cross
1440
-              linux-libc-dev-armhf-cross
1441
-              ${GPP_ARM_PACKAGE}"
1442
-    ;;
1443
-esac
1444
-
1445
-# Work around for dependency issue Ubuntu/Trusty: http://crbug.com/435056
1446
-case $distro_codename in
1447
-  trusty)
1448
-    arm_list+=" g++-4.8-multilib-arm-linux-gnueabihf
1449
-                gcc-4.8-multilib-arm-linux-gnueabihf"
1450
-    ;;
1451
-  xenial|yakkety)
1452
-    arm_list+=" g++-5-multilib-arm-linux-gnueabihf
1453
-                gcc-5-multilib-arm-linux-gnueabihf
1454
-                gcc-arm-linux-gnueabihf"
1455
-    ;;
1456
-esac
1457
-
1458
-# Packages to build NaCl, its toolchains, and its ports.
1459
-naclports_list="ant autoconf bison cmake gawk intltool xutils-dev xsltproc"
1460
-nacl_list="\
1461
-  g++-mingw-w64-i686
1462
-  lib32z1-dev
1463
-  libasound2:i386
1464
-  libcap2:i386
1465
-  libelf-dev:i386
1466
-  libfontconfig1:i386
1467
-  libgconf-2-4:i386
1468
-  libglib2.0-0:i386
1469
-  libgpm2:i386
1470
-  libgtk2.0-0:i386
1471
-  libgtk-3-0:i386
1472
-  libncurses5:i386
1473
-  lib32ncurses5-dev
1474
-  libnss3:i386
1475
-  libpango1.0-0:i386
1476
-  libssl-dev:i386
1477
-  libtinfo-dev
1478
-  libtinfo-dev:i386
1479
-  libtool
1480
-  libxcomposite1:i386
1481
-  libxcursor1:i386
1482
-  libxdamage1:i386
1483
-  libxi6:i386
1484
-  libxrandr2:i386
1485
-  libxss1:i386
1486
-  libxtst6:i386
1487
-  texinfo
1488
-  xvfb
1489
-  ${naclports_list}
1490
-"
1491
-
1492
-if package_exists libssl1.0.0; then
1493
-  nacl_list="${nacl_list} libssl1.0.0:i386"
1494
-else
1495
-  nacl_list="${nacl_list} libssl1.0.2:i386"
1496
-fi
1497
-
1498
-# Find the proper version of packages that depend on mesa. Only one -lts variant
1499
-# of mesa can be installed and everything that depends on it must match.
1500
-
1501
-# Query for the name and status of all mesa LTS variants, filter for only
1502
-# installed packages, extract just the name, and eliminate duplicates (there can
1503
-# be more than one with the same name in the case of multiarch). Expand into an
1504
-# array.
1505
-mesa_packages=($(dpkg-query -Wf'${package} ${status}\n' \
1506
-                            libgl1-mesa-glx-lts-\* 2>/dev/null | \
1507
-                 grep " ok installed" | cut -d " " -f 1 | sort -u))
1508
-if [ "${#mesa_packages[@]}" -eq 0 ]; then
1509
-  mesa_variant=""
1510
-elif [ "${#mesa_packages[@]}" -eq 1 ]; then
1511
-  # Strip the base package name and leave just "-lts-whatever"
1512
-  mesa_variant="${mesa_packages[0]#libgl1-mesa-glx}"
1513
-else
1514
-  echo "ERROR: unable to determine which libgl1-mesa-glx variant is installed."
1515
-  exit 1
1516
-fi
1517
-dev_list="${dev_list} libgbm-dev${mesa_variant}
1518
-          libgles2-mesa-dev${mesa_variant} libgl1-mesa-dev${mesa_variant}
1519
-          mesa-common-dev${mesa_variant}"
1520
-nacl_list="${nacl_list} libgl1-mesa-glx${mesa_variant}:i386"
1521
+dbg_list="libatk1.0-dbg libc6-dbg libcairo2-dbg libdbus-glib-1-2-dbg
1522
+          libfontconfig1-dbg libglib2.0-0-dbg libgtk2.0-0-dbg
1523
+          libpango1.0-0-dbg libpcre3-dbg libpixman-1-0-dbg
1524
+          libsqlite3-0-dbg
1525
+          libx11-6-dbg libxau6-dbg libxcb1-dbg libxcomposite1-dbg
1526
+          libxcursor1-dbg libxdamage1-dbg libxdmcp6-dbg libxext6-dbg
1527
+          libxfixes3-dbg libxi6-dbg libxinerama1-dbg libxrandr2-dbg
1528
+          libxrender1-dbg libxtst6-dbg zlib1g-dbg"
1529
+
1530
+# Plugin lists needed for tests.
1531
+plugin_list="flashplugin-installer"
1532
 
1533
 # Some package names have changed over time
1534
-if package_exists libpng12-0; then
1535
-  lib_list="${lib_list} libpng12-0"
1536
+if apt-cache show ttf-mscorefonts-installer >/dev/null 2>&1; then
1537
+  dev_list="${dev_list} ttf-mscorefonts-installer"
1538
 else
1539
-  lib_list="${lib_list} libpng16-16"
1540
+  dev_list="${dev_list} msttcorefonts"
1541
 fi
1542
-if package_exists libnspr4-dbg; then
1543
+if apt-cache show libnspr4-dbg >/dev/null 2>&1; then
1544
   dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg"
1545
   lib_list="${lib_list} libnspr4 libnss3"
1546
 else
1547
   dbg_list="${dbg_list} libnspr4-0d-dbg libnss3-1d-dbg"
1548
   lib_list="${lib_list} libnspr4-0d libnss3-1d"
1549
 fi
1550
-if package_exists libjpeg-dev; then
1551
-  dev_list="${dev_list} libjpeg-dev"
1552
+if apt-cache show libjpeg-dev >/dev/null 2>&1; then
1553
+ dev_list="${dev_list} libjpeg-dev"
1554
 else
1555
-  dev_list="${dev_list} libjpeg62-dev"
1556
-fi
1557
-if package_exists libudev1; then
1558
-  dev_list="${dev_list} libudev1"
1559
-  nacl_list="${nacl_list} libudev1:i386"
1560
-else
1561
-  dev_list="${dev_list} libudev0"
1562
-  nacl_list="${nacl_list} libudev0:i386"
1563
-fi
1564
-if package_exists libbrlapi0.6; then
1565
-  dev_list="${dev_list} libbrlapi0.6"
1566
-else
1567
-  dev_list="${dev_list} libbrlapi0.5"
1568
-fi
1569
-if package_exists apache2-bin; then
1570
-  dev_list="${dev_list} apache2-bin"
1571
-else
1572
-  dev_list="${dev_list} apache2.2-bin"
1573
-fi
1574
-if package_exists xfonts-mathml; then
1575
-  dev_list="${dev_list} xfonts-mathml"
1576
-fi
1577
-if package_exists fonts-indic; then
1578
-  dev_list="${dev_list} fonts-indic"
1579
-else
1580
-  dev_list="${dev_list} ttf-indic-fonts"
1581
-fi
1582
-if package_exists php7.0-cgi; then
1583
-  dev_list="${dev_list} php7.0-cgi libapache2-mod-php7.0"
1584
-else
1585
-  dev_list="${dev_list} php5-cgi libapache2-mod-php5"
1586
-fi
1587
-# ttf-mscorefonts-installer is in the Debian contrib repo, which has
1588
-# dependencies on non-free software.  Install it only if the user has already
1589
-# enabled contrib.
1590
-if package_exists ttf-mscorefonts-installer; then
1591
-  dev_list="${dev_list} ttf-mscorefonts-installer"
1592
-elif package_exists msttcorefonts; then
1593
-  dev_list="${dev_list} msttcorefonts"
1594
-fi
1595
-# Ubuntu 16.04 has this package deleted.
1596
-if package_exists ttf-kochi-gothic; then
1597
-  dev_list="${dev_list} ttf-kochi-gothic"
1598
-fi
1599
-# Ubuntu 16.04 has this package deleted.
1600
-if package_exists ttf-kochi-mincho; then
1601
-  dev_list="${dev_list} ttf-kochi-mincho"
1602
+ dev_list="${dev_list} libjpeg62-dev"
1603
 fi
1604
 
1605
-# Some packages are only needed if the distribution actually supports
1606
+# Some packages are only needed, if the distribution actually supports
1607
 # installing them.
1608
-if package_exists appmenu-gtk; then
1609
+if apt-cache show appmenu-gtk >/dev/null 2>&1; then
1610
   lib_list="$lib_list appmenu-gtk"
1611
 fi
1612
 
1613
-# When cross building for arm/Android on 64-bit systems the host binaries
1614
-# that are part of v8 need to be compiled with -m32 which means
1615
-# that basic multilib support is needed.
1616
-if file -L /sbin/init | grep -q 'ELF 64-bit'; then
1617
-  # gcc-multilib conflicts with the arm cross compiler (at least in trusty) but
1618
-  # g++-X.Y-multilib gives us the 32-bit support that we need. Find out the
1619
-  # appropriate value of X and Y by seeing what version the current
1620
-  # distribution's g++-multilib package depends on.
1621
-  multilib_package=$(apt-cache depends g++-multilib --important | \
1622
-      grep -E --color=never --only-matching '\bg\+\+-[0-9.]+-multilib\b')
1623
-  lib32_list="$lib32_list $multilib_package"
1624
-fi
1625
+# Waits for the user to press 'Y' or 'N'. Either uppercase of lowercase is
1626
+# accepted. Returns 0 for 'Y' and 1 for 'N'. If an optional parameter has
1627
+# been provided to yes_no(), the function also accepts RETURN as a user input.
1628
+# The parameter specifies the exit code that should be returned in that case.
1629
+# The function will echo the user's selection followed by a newline character.
1630
+# Users can abort the function by pressing CTRL-C. This will call "exit 1".
1631
+yes_no() {
1632
+  if [ 0 -ne "${do_default-0}" ] ; then
1633
+    return $1
1634
+  fi
1635
+  local c
1636
+  while :; do
1637
+    c="$(trap 'stty echo -iuclc icanon 2>/dev/null' EXIT INT TERM QUIT
1638
+         stty -echo iuclc -icanon 2>/dev/null
1639
+         dd count=1 bs=1 2>/dev/null | od -An -tx1)"
1640
+    case "$c" in
1641
+      " 0a") if [ -n "$1" ]; then
1642
+               [ $1 -eq 0 ] && echo "Y" || echo "N"
1643
+               return $1
1644
+             fi
1645
+             ;;
1646
+      " 79") echo "Y"
1647
+             return 0
1648
+             ;;
1649
+      " 6e") echo "N"
1650
+             return 1
1651
+             ;;
1652
+      "")    echo "Aborted" >&2
1653
+             exit 1
1654
+             ;;
1655
+      *)     # The user pressed an unrecognized key. As we are not echoing
1656
+             # any incorrect user input, alert the user by ringing the bell.
1657
+             (tput bel) 2>/dev/null
1658
+             ;;
1659
+    esac
1660
+  done
1661
+}
1662
 
1663
-if test "$do_inst_syms" = "" && test 0 -eq ${do_quick_check-0}
1664
+if test "$do_inst_syms" = ""
1665
 then
1666
   echo "This script installs all tools and libraries needed to build Chromium."
1667
   echo ""
1668
@@ -527,81 +177,12 @@ then
1669
   fi
1670
 fi
1671
 if test "$do_inst_syms" = "1"; then
1672
-  echo "Including debugging symbols."
1673
-  # Many debug packages are not available in Debian stretch,
1674
-  # so exclude the ones that are missing.
1675
-  available_dbg_packages=""
1676
-  for package in ${dbg_list}; do
1677
-    if package_exists ${package}; then
1678
-      available_dbg_packages="${available_dbg_packages} ${package}"
1679
-    fi
1680
-  done
1681
-  dbg_list="${available_dbg_packages}"
1682
+  echo "Installing debugging symbols."
1683
 else
1684
-  echo "Skipping debugging symbols."
1685
+  echo "Skipping installation of debugging symbols."
1686
   dbg_list=
1687
 fi
1688
 
1689
-if test "$do_inst_lib32" = "1" ; then
1690
-  echo "Including 32-bit libraries for ARM/Android."
1691
-else
1692
-  echo "Skipping 32-bit libraries for ARM/Android."
1693
-  lib32_list=
1694
-fi
1695
-
1696
-if test "$do_inst_arm" = "1" ; then
1697
-  echo "Including ARM cross toolchain."
1698
-else
1699
-  echo "Skipping ARM cross toolchain."
1700
-  arm_list=
1701
-fi
1702
-
1703
-if test "$do_inst_nacl" = "1"; then
1704
-  echo "Including NaCl, NaCl toolchain, NaCl ports dependencies."
1705
-else
1706
-  echo "Skipping NaCl, NaCl toolchain, NaCl ports dependencies."
1707
-  nacl_list=
1708
-fi
1709
-
1710
-# The `sort -r -s -t: -k2` sorts all the :i386 packages to the front, to avoid
1711
-# confusing dpkg-query (crbug.com/446172).
1712
-packages="$(
1713
-  echo "${dev_list} ${lib_list} ${dbg_list} ${lib32_list} ${arm_list}"\
1714
-       "${nacl_list}" | tr " " "\n" | sort -u | sort -r -s -t: -k2 | tr "\n" " "
1715
-)"
1716
-
1717
-if [ 1 -eq "${do_quick_check-0}" ] ; then
1718
-  if ! missing_packages="$(dpkg-query -W -f ' ' ${packages} 2>&1)"; then
1719
-    # Distinguish between packages that actually aren't available to the
1720
-    # system (i.e. not in any repo) and packages that just aren't known to
1721
-    # dpkg (i.e. managed by apt).
1722
-    missing_packages="$(echo "${missing_packages}" | awk '{print $NF}')"
1723
-    not_installed=""
1724
-    unknown=""
1725
-    for p in ${missing_packages}; do
1726
-      if apt-cache show ${p} > /dev/null 2>&1; then
1727
-        not_installed="${p}\n${not_installed}"
1728
-      else
1729
-        unknown="${p}\n${unknown}"
1730
-      fi
1731
-    done
1732
-    if [ -n "${not_installed}" ]; then
1733
-      echo "WARNING: The following packages are not installed:"
1734
-      echo -e "${not_installed}" | sed -e "s/^/  /"
1735
-    fi
1736
-    if [ -n "${unknown}" ]; then
1737
-      echo "WARNING: The following packages are unknown to your system"
1738
-      echo "(maybe missing a repo or need to 'sudo apt-get update'):"
1739
-      echo -e "${unknown}" | sed -e "s/^/  /"
1740
-    fi
1741
-    exit 1
1742
-  fi
1743
-  exit 0
1744
-fi
1745
-
1746
-if test "$do_inst_lib32" = "1" || test "$do_inst_nacl" = "1"; then
1747
-  sudo dpkg --add-architecture i386
1748
-fi
1749
 sudo apt-get update
1750
 
1751
 # We initially run "apt-get" with the --reinstall option and parse its output.
1752
@@ -609,13 +190,14 @@ sudo apt-get update
1753
 # without accidentally promoting any packages from "auto" to "manual".
1754
 # We then re-run "apt-get" with just the list of missing packages.
1755
 echo "Finding missing packages..."
1756
+packages="${dev_list} ${lib_list} ${dbg_list} ${plugin_list}"
1757
 # Intentionally leaving $packages unquoted so it's more readable.
1758
 echo "Packages required: " $packages
1759
 echo
1760
 new_list_cmd="sudo apt-get install --reinstall $(echo $packages)"
1761
-if new_list="$(yes n | LANGUAGE=en LANG=C $new_list_cmd)"; then
1762
+if new_list="$(yes n | LANG=C $new_list_cmd)"; then
1763
   # We probably never hit this following line.
1764
-  echo "No missing packages, and the packages are up to date."
1765
+  echo "No missing packages, and the packages are up-to-date."
1766
 elif [ $? -eq 1 ]; then
1767
   # We expect apt-get to have exit status of 1.
1768
   # This indicates that we cancelled the install with "yes n|".
1769
@@ -623,7 +205,7 @@ elif [ $? -eq 1 ]; then
1770
     sed -e '1,/The following NEW packages will be installed:/d;s/^  //;t;d')
1771
   new_list=$(echo "$new_list" | sed 's/ *$//')
1772
   if [ -z "$new_list" ] ; then
1773
-    echo "No missing packages, and the packages are up to date."
1774
+    echo "No missing packages, and the packages are up-to-date."
1775
   else
1776
     echo "Installing missing packages: $new_list."
1777
     sudo apt-get install ${do_quietly-} ${new_list}
1778
@@ -644,44 +226,189 @@ else
1779
   exit 100
1780
 fi
1781
 
1782
-# Install the Chrome OS default fonts. This must go after running
1783
-# apt-get, since install-chromeos-fonts depends on curl.
1784
-if test "$do_inst_chromeos_fonts" != "0"; then
1785
-  echo
1786
-  echo "Installing Chrome OS fonts."
1787
-  dir=`echo $0 | sed -r -e 's/\/[^/]+$//'`
1788
-  if ! sudo $dir/linux/install-chromeos-fonts.py; then
1789
-    echo "ERROR: The installation of the Chrome OS default fonts failed."
1790
-    if [ `stat -f -c %T $dir` == "nfs" ]; then
1791
-      echo "The reason is that your repo is installed on a remote file system."
1792
-    else
1793
-      echo "This is expected if your repo is installed on a remote file system."
1794
-    fi
1795
-    echo "It is recommended to install your repo on a local file system."
1796
-    echo "You can skip the installation of the Chrome OS default founts with"
1797
-    echo "the command line option: --no-chromeos-fonts."
1798
-    exit 1
1799
+# Install 32bit backwards compatibility support for 64bit systems
1800
+if [ "$(uname -m)" = "x86_64" ]; then
1801
+  if test "$do_inst_lib32" = ""
1802
+  then
1803
+    echo "We no longer recommend that you use this script to install"
1804
+    echo "32bit libraries on a 64bit system. Instead, consider using"
1805
+    echo "the install-chroot.sh script to help you set up a 32bit"
1806
+    echo "environment for building and testing 32bit versions of Chrome."
1807
+    echo
1808
+    echo "If you nonetheless want to try installing 32bit libraries"
1809
+    echo "directly, you can do so by explicitly passing the --lib32"
1810
+    echo "option to install-build-deps.sh."
1811
+  fi
1812
+  if test "$do_inst_lib32" != "1"
1813
+  then
1814
+    echo "Exiting without installing any 32bit libraries."
1815
+    exit 0
1816
   fi
1817
-else
1818
-  echo "Skipping installation of Chrome OS fonts."
1819
-fi
1820
 
1821
-echo "Installing locales."
1822
-CHROMIUM_LOCALES="da_DK.UTF-8 fr_FR.UTF-8 he_IL.UTF-8 zh_TW.UTF-8"
1823
-LOCALE_GEN=/etc/locale.gen
1824
-if [ -e ${LOCALE_GEN} ]; then
1825
-  OLD_LOCALE_GEN="$(cat /etc/locale.gen)"
1826
-  for CHROMIUM_LOCALE in ${CHROMIUM_LOCALES}; do
1827
-    sudo sed -i "s/^# ${CHROMIUM_LOCALE}/${CHROMIUM_LOCALE}/" ${LOCALE_GEN}
1828
-  done
1829
-  # Regenerating locales can take a while, so only do it if we need to.
1830
-  if (echo "${OLD_LOCALE_GEN}" | cmp -s ${LOCALE_GEN}); then
1831
-    echo "Locales already up-to-date."
1832
+  echo "N.B. the code for installing 32bit libraries on a 64bit"
1833
+  echo "     system is no longer actively maintained and might"
1834
+  echo "     not work with modern versions of Ubuntu or Debian."
1835
+  echo
1836
+
1837
+  # Standard 32bit compatibility libraries
1838
+  echo "First, installing the limited existing 32-bit support..."
1839
+  cmp_list="ia32-libs lib32asound2-dev lib32stdc++6 lib32z1
1840
+            lib32z1-dev libc6-dev-i386 libc6-i386 g++-multilib"
1841
+  if [ -n "`apt-cache search lib32readline-gplv2-dev 2>/dev/null`" ]; then
1842
+    cmp_list="${cmp_list} lib32readline-gplv2-dev"
1843
   else
1844
-    sudo locale-gen
1845
+    cmp_list="${cmp_list} lib32readline5-dev"
1846
   fi
1847
-else
1848
-  for CHROMIUM_LOCALE in ${CHROMIUM_LOCALES}; do
1849
-    sudo locale-gen ${CHROMIUM_LOCALE}
1850
+  sudo apt-get install ${do_quietly-} $cmp_list
1851
+
1852
+  tmp=/tmp/install-32bit.$$
1853
+  trap 'rm -rf "${tmp}"' EXIT INT TERM QUIT
1854
+  mkdir -p "${tmp}/apt/lists/partial" "${tmp}/cache" "${tmp}/partial"
1855
+  touch "${tmp}/status"
1856
+
1857
+  [ -r /etc/apt/apt.conf ] && cp /etc/apt/apt.conf "${tmp}/apt/"
1858
+  cat >>"${tmp}/apt/apt.conf" <<EOF
1859
+        Apt::Architecture "i386";
1860
+        Dir::Cache "${tmp}/cache";
1861
+        Dir::Cache::Archives "${tmp}/";
1862
+        Dir::State::Lists "${tmp}/apt/lists/";
1863
+        Dir::State::status "${tmp}/status";
1864
+EOF
1865
+
1866
+  # Download 32bit packages
1867
+  echo "Computing list of available 32bit packages..."
1868
+  sudo apt-get -c="${tmp}/apt/apt.conf" update
1869
+
1870
+  echo "Downloading available 32bit packages..."
1871
+  sudo apt-get -c="${tmp}/apt/apt.conf" \
1872
+          --yes --download-only --force-yes --reinstall install \
1873
+          ${lib_list} ${dbg_list}
1874
+
1875
+  # Open packages, remove everything that is not a library, move the
1876
+  # library to a lib32 directory and package everything as a *.deb file.
1877
+  echo "Repackaging and installing 32bit packages for use on 64bit systems..."
1878
+  for i in ${lib_list} ${dbg_list}; do
1879
+    orig="$(echo "${tmp}/${i}"_*_i386.deb)"
1880
+    compat="$(echo "${orig}" |
1881
+              sed -e 's,\(_[^_/]*_\)i386\(.deb\),-ia32\1amd64\2,')"
1882
+    rm -rf "${tmp}/staging"
1883
+    msg="$(fakeroot -u sh -exc '
1884
+      # Unpack 32bit Debian archive
1885
+      umask 022
1886
+      mkdir -p "'"${tmp}"'/staging/dpkg/DEBIAN"
1887
+      cd "'"${tmp}"'/staging"
1888
+      ar x "'${orig}'"
1889
+      tar zCfx dpkg data.tar.gz
1890
+      tar zCfx dpkg/DEBIAN control.tar.gz
1891
+
1892
+      # Create a posix extended regular expression fragment that will
1893
+      # recognize the includes which have changed. Should be rare,
1894
+      # will almost always be empty.
1895
+      includes=`sed -n -e "s/^[0-9a-z]*  //g" \
1896
+                       -e "\,usr/include/,p" dpkg/DEBIAN/md5sums |
1897
+                  xargs -n 1 -I FILE /bin/sh -c \
1898
+                    "cmp -s dpkg/FILE /FILE || echo FILE" |
1899
+                  tr "\n" "|" |
1900
+                  sed -e "s,|$,,"`
1901
+
1902
+      # If empty, set it to not match anything.
1903
+      test -z "$includes" && includes="^//"
1904
+
1905
+      # Turn the conflicts into an extended RE for removal from the
1906
+      # Provides line.
1907
+      conflicts=`sed -n -e "/Conflicts/s/Conflicts: *//;T;s/, */|/g;p" \
1908
+                   dpkg/DEBIAN/control`
1909
+
1910
+      # Rename package, change architecture, remove conflicts and dependencies
1911
+      sed -r -i                              \
1912
+          -e "/Package/s/$/-ia32/"           \
1913
+          -e "/Architecture/s/:.*$/: amd64/" \
1914
+          -e "/Depends/s/:.*/: ia32-libs/"   \
1915
+          -e "/Provides/s/($conflicts)(, *)?//g;T1;s/, *$//;:1"   \
1916
+          -e "/Recommends/d"                 \
1917
+          -e "/Conflicts/d"                  \
1918
+        dpkg/DEBIAN/control
1919
+
1920
+      # Only keep files that live in "lib" directories or the includes
1921
+      # that have changed.
1922
+      sed -r -i                                                               \
1923
+          -e "/\/lib64\//d" -e "/\/.?bin\//d"                                 \
1924
+          -e "\,$includes,s,[ /]include/,&32/,g;s,include/32/,include32/,g"   \
1925
+          -e "s, lib/, lib32/,g"                                              \
1926
+          -e "s,/lib/,/lib32/,g"                                              \
1927
+          -e "t;d"                                                            \
1928
+          -e "\,^/usr/lib32/debug\(.*/lib32\),s,^/usr/lib32/debug,/usr/lib/debug," \
1929
+        dpkg/DEBIAN/md5sums
1930
+
1931
+      # Re-run ldconfig after installation/removal
1932
+      { echo "#!/bin/sh"; echo "[ \"x\$1\" = xconfigure ]&&ldconfig||:"; } \
1933
+        >dpkg/DEBIAN/postinst
1934
+      { echo "#!/bin/sh"; echo "[ \"x\$1\" = xremove ]&&ldconfig||:"; } \
1935
+        >dpkg/DEBIAN/postrm
1936
+      chmod 755 dpkg/DEBIAN/postinst dpkg/DEBIAN/postrm
1937
+
1938
+      # Remove any other control files
1939
+      find dpkg/DEBIAN -mindepth 1 "(" -name control -o -name md5sums -o \
1940
+                       -name postinst -o -name postrm ")" -o -print |
1941
+        xargs -r rm -rf
1942
+
1943
+      # Remove any files/dirs that live outside of "lib" directories,
1944
+      # or are not in our list of changed includes.
1945
+      find dpkg -mindepth 1 -regextype posix-extended \
1946
+          "(" -name DEBIAN -o -name lib -o -regex "dpkg/($includes)" ")" \
1947
+          -prune -o -print | tac |
1948
+        xargs -r -n 1 sh -c "rm \$0 2>/dev/null || rmdir \$0 2>/dev/null || : "
1949
+      find dpkg -name lib64 -o -name bin -o -name "?bin" |
1950
+        tac | xargs -r rm -rf
1951
+
1952
+      # Remove any symbolic links that were broken by the above steps.
1953
+      find -L dpkg -type l -print | tac | xargs -r rm -rf
1954
+
1955
+      # Rename lib to lib32, but keep debug symbols in /usr/lib/debug/usr/lib32
1956
+      # That is where gdb looks for them.
1957
+      find dpkg -type d -o -path "*/lib/*" -print |
1958
+        xargs -r -n 1 sh -c "
1959
+          i=\$(echo \"\${0}\" |
1960
+               sed -e s,/lib/,/lib32/,g \
1961
+               -e s,/usr/lib32/debug\\\\\(.*/lib32\\\\\),/usr/lib/debug\\\\1,);
1962
+          mkdir -p \"\${i%/*}\";
1963
+          mv \"\${0}\" \"\${i}\""
1964
+
1965
+      # Rename include to include32.
1966
+      [ -d "dpkg/usr/include" ] && mv "dpkg/usr/include" "dpkg/usr/include32"
1967
+
1968
+      # Prune any empty directories
1969
+      find dpkg -type d | tac | xargs -r -n 1 rmdir 2>/dev/null || :
1970
+
1971
+      # Create our own Debian package
1972
+      cd ..
1973
+      dpkg --build staging/dpkg .' 2>&1)"
1974
+    compat="$(eval echo $(echo "${compat}" |
1975
+                          sed -e 's,_[^_/]*_amd64.deb,_*_amd64.deb,'))"
1976
+    [ -r "${compat}" ] || {
1977
+      echo "${msg}" >&2
1978
+      echo "Failed to build new Debian archive!" >&2
1979
+      exit 1
1980
+    }
1981
+
1982
+    msg="$(sudo dpkg -i "${compat}" 2>&1)" && {
1983
+        echo "Installed ${compat##*/}"
1984
+      } || {
1985
+        # echo "${msg}" >&2
1986
+        echo "Skipped ${compat##*/}"
1987
+      }
1988
+  done
1989
+
1990
+  # Add symbolic links for developing 32bit code
1991
+  echo "Adding missing symbolic links, enabling 32bit code development..."
1992
+  for i in $(find /lib32 /usr/lib32 -maxdepth 1 -name \*.so.\* |
1993
+             sed -e 's/[.]so[.][0-9].*/.so/' |
1994
+             sort -u); do
1995
+    [ "x${i##*/}" = "xld-linux.so" ] && continue
1996
+    [ -r "$i" ] && continue
1997
+    j="$(ls "$i."* | sed -e 's/.*[.]so[.]\([^.]*\)$/\1/;t;d' |
1998
+         sort -n | tail -n 1)"
1999
+    [ -r "$i.$j" ] || continue
2000
+    sudo ln -s "${i##*/}.$j" "$i"
2001
   done
2002
 fi
2003
diff --git media/webrtc/trunk/build/install-chroot.sh media/webrtc/trunk/build/install-chroot.sh
2004
index 99451ed7ea49..d2c06fc39adc 100755
2005
--- media/webrtc/trunk/build/install-chroot.sh
2006
+++ media/webrtc/trunk/build/install-chroot.sh
2007
@@ -12,7 +12,7 @@
2008
 
2009
 # Older Debian based systems had both "admin" and "adm" groups, with "admin"
2010
 # apparently being used in more places. Newer distributions have standardized
2011
-# on just the "adm" group. Check /etc/group for the preferred name of the
2012
+# on just the "adm" group. Check /etc/group for the prefered name of the
2013
 # administrator group.
2014
 admin=$(grep '^admin:' /etc/group >&/dev/null && echo admin || echo adm)
2015
 
2016
@@ -223,8 +223,7 @@ target="${distname}${arch}"
2017
       d|D) sudo rm -rf "/var/lib/chroot/${target}"      \
2018
                        "/usr/local/bin/${target%bit}"   \
2019
                        "/etc/schroot/mount-${target}"   \
2020
-                       "/etc/schroot/script-${target}"  \
2021
-                       "/etc/schroot/${target}"
2022
+                       "/etc/schroot/script-${target}"
2023
            sudo sed -ni '/^[[]'"${target%bit}"']$/,${
2024
                          :1;n;/^[[]/b2;b1;:2;p;n;b2};p' \
2025
                        "/etc/schroot/schroot.conf"
2026
@@ -350,41 +349,13 @@ grep -qs ubuntu.com /usr/share/debootstrap/scripts/"${distname}" &&
2027
 if [ -z "${chroot_groups}" ]; then
2028
   chroot_groups="${admin},$(id -gn)"
2029
 fi
2030
-
2031
-if [ -d '/etc/schroot/default' ]; then
2032
-  new_version=1
2033
-  fstab="/etc/schroot/${target}/fstab"
2034
-else
2035
-  new_version=0
2036
-  fstab="/etc/schroot/mount-${target}"
2037
-fi
2038
-
2039
-if [ "$new_version" = "1" ]; then
2040
-  sudo cp -ar /etc/schroot/default /etc/schroot/${target}
2041
-
2042
-  sudo sh -c 'cat >>/etc/schroot/schroot.conf' <<EOF
2043
-[${target%bit}]
2044
-description=${brand} ${distname} ${arch}
2045
-type=directory
2046
-directory=/var/lib/chroot/${target}
2047
-users=root
2048
-groups=${chroot_groups}
2049
-root-groups=${chroot_groups}
2050
-personality=linux$([ "${arch}" != 64bit ] && echo 32)
2051
-profile=${target}
2052
-
2053
-EOF
2054
-  [ -n "${bind_mounts}" -a "${bind_mounts}" != "NONE" ] &&
2055
-    printf "${bind_mounts}" |
2056
-      sudo sh -c "cat >>${fstab}"
2057
-else
2058
-  # Older versions of schroot wanted a "priority=" line, whereas recent
2059
-  # versions deprecate "priority=" and warn if they see it. We don't have
2060
-  # a good feature test, but scanning for the string "priority=" in the
2061
-  # existing "schroot.conf" file is a good indication of what to do.
2062
-  priority=$(grep -qs 'priority=' /etc/schroot/schroot.conf &&
2063
+# Older versions of schroot wanted a "priority=" line, whereas recent
2064
+# versions deprecate "priority=" and warn if they see it. We don't have
2065
+# a good feature test, but scanning for the string "priority=" in the
2066
+# existing "schroot.conf" file is a good indication of what to do.
2067
+priority=$(grep -qs 'priority=' /etc/schroot/schroot.conf &&
2068
            echo 'priority=3' || :)
2069
-  sudo sh -c 'cat >>/etc/schroot/schroot.conf' <<EOF
2070
+sudo sh -c 'cat >>/etc/schroot/schroot.conf' <<EOF
2071
 [${target%bit}]
2072
 description=${brand} ${distname} ${arch}
2073
 type=directory
2074
@@ -398,43 +369,38 @@ ${priority}
2075
 
2076
 EOF
2077
 
2078
-  # Set up a list of mount points that is specific to this
2079
-  # chroot environment.
2080
-  sed '/^FSTAB=/s,"[^"]*","'"${fstab}"'",' \
2081
-           /etc/schroot/script-defaults |
2082
-    sudo sh -c 'cat >/etc/schroot/script-'"${target}"
2083
-  sed '\,^/home[/[:space:]],s/\([,[:space:]]\)bind[[:space:]]/\1rbind /' \
2084
-    /etc/schroot/mount-defaults |
2085
-    sudo sh -c "cat > ${fstab}"
2086
-fi
2087
+# Set up a list of mount points that is specific to this
2088
+# chroot environment.
2089
+sed '/^FSTAB=/s,"[^"]*","/etc/schroot/mount-'"${target}"'",' \
2090
+         /etc/schroot/script-defaults |
2091
+  sudo sh -c 'cat >/etc/schroot/script-'"${target}"
2092
+sed '\,^/home[/[:space:]],s/\([,[:space:]]\)bind[[:space:]]/\1rbind /' \
2093
+  /etc/schroot/mount-defaults |
2094
+  sudo sh -c 'cat > /etc/schroot/mount-'"${target}"
2095
 
2096
 # Add the extra mount points that the user told us about
2097
 [ -n "${bind_mounts}" -a "${bind_mounts}" != "NONE" ] &&
2098
   printf "${bind_mounts}" |
2099
-    sudo sh -c 'cat >>'"${fstab}"
2100
+    sudo sh -c 'cat >>/etc/schroot/mount-'"${target}"
2101
 
2102
 # If this system has a "/media" mountpoint, import it into the chroot
2103
 # environment. Most modern distributions use this mount point to
2104
 # automatically mount devices such as CDROMs, USB sticks, etc...
2105
 if [ -d /media ] &&
2106
-   ! grep -qs '^/media' "${fstab}"; then
2107
+   ! grep -qs '^/media' /etc/schroot/mount-"${target}"; then
2108
   echo '/media /media none rw,rbind 0 0' |
2109
-    sudo sh -c 'cat >>'"${fstab}"
2110
+    sudo sh -c 'cat >>/etc/schroot/mount-'"${target}"
2111
 fi
2112
 
2113
-# Share /dev/shm, /run and /run/shm.
2114
-grep -qs '^/dev/shm' "${fstab}" ||
2115
+# Share /dev/shm and possibly /run/shm
2116
+grep -qs '^/dev/shm' /etc/schroot/mount-"${target}" ||
2117
   echo '/dev/shm /dev/shm none rw,bind 0 0' |
2118
-    sudo sh -c 'cat >>'"${fstab}"
2119
-if [ ! -d "/var/lib/chroot/${target}/run" ] &&
2120
-   ! grep -qs '^/run' "${fstab}"; then
2121
-  echo '/run /run none rw,bind 0 0' |
2122
-    sudo sh -c 'cat >>'"${fstab}"
2123
-fi
2124
-if ! grep -qs '^/run/shm' "${fstab}"; then
2125
+    sudo sh -c 'cat >>/etc/schroot/mount-'"${target}"
2126
+if [ -d "/var/lib/chroot/${target}/run" ] &&
2127
+   ! grep -qs '^/run/shm' /etc/schroot/mount-"${target}"; then
2128
   { [ -d /run ] && echo '/run/shm /run/shm none rw,bind 0 0' ||
2129
                    echo '/dev/shm /run/shm none rw,bind 0 0'; } |
2130
-    sudo sh -c 'cat >>'"${fstab}"
2131
+    sudo sh -c 'cat >>/etc/schroot/mount-'"${target}"
2132
 fi
2133
 
2134
 # Set up a special directory that changes contents depending on the target
2135
@@ -442,7 +408,7 @@ fi
2136
 d="$(readlink -f "${HOME}/chroot" 2>/dev/null || echo "${HOME}/chroot")"
2137
 s="${d}/.${target}"
2138
 echo "${s} ${d} none rw,bind 0 0" |
2139
-  sudo sh -c 'cat >>'"${target}"
2140
+  sudo sh -c 'cat >>/etc/schroot/mount-'"${target}"
2141
 mkdir -p "${s}"
2142
 
2143
 # Install a helper script to launch commands in the chroot
2144
@@ -527,69 +493,27 @@ while [ "$#" -ne 0 ]; do
2145
   esac
2146
 done
2147
 
2148
-# Start a new chroot session and keep track of the session id. We inject this
2149
-# id into all processes that run inside the chroot. Unless they go out of their
2150
-# way to clear their environment, we can then later identify our child and
2151
-# grand-child processes by scanning their environment.
2152
 session="$(schroot -c "${chroot}" -b)"
2153
-export CHROOT_SESSION_ID="${session}"
2154
-
2155
-# Set GOMA_TMP_DIR for better handling of goma inside chroot.
2156
-export GOMA_TMP_DIR="/tmp/goma_tmp_$CHROOT_SESSION_ID"
2157
-mkdir -p "$GOMA_TMP_DIR"
2158
 
2159
 if [ $# -eq 0 ]; then
2160
-  # Run an interactive shell session
2161
   schroot -c "${session}" -r -p
2162
 else
2163
-  # Run a command inside of the chroot environment
2164
   p="$1"; shift
2165
   schroot -c "${session}" -r -p "$p" -- "$@"
2166
 fi
2167
 rc=$?
2168
 
2169
-# Compute the inode of the root directory inside of the chroot environment.
2170
 i=$(schroot -c "${session}" -r -p ls -- -id /proc/self/root/. |
2171
      awk '{ print $1 }') 2>/dev/null
2172
-other_pids=
2173
 while [ -n "$i" ]; do
2174
-  # Identify processes by the inode number of their root directory. Then
2175
-  # remove all processes that we know belong to other sessions. We use
2176
-  # "sort | uniq -u" to do what amounts to a "set substraction operation".
2177
-  pids=$({ ls -id1 /proc/*/root/. 2>/dev/null |
2178
+  pids=$(ls -id1 /proc/*/root/. 2>/dev/null |
2179
          sed -e 's,^[^0-9]*'$i'.*/\([1-9][0-9]*\)/.*$,\1,
2180
                  t
2181
-                 d';
2182
-         echo "${other_pids}";
2183
-         echo "${other_pids}"; } | sort | uniq -u) >/dev/null 2>&1
2184
-  # Kill all processes that are still left running in the session. This is
2185
-  # typically an assortment of daemon processes that were started
2186
-  # automatically. They result in us being unable to tear down the session
2187
-  # cleanly.
2188
-  [ -z "${pids}" ] && break
2189
-  for j in $pids; do
2190
-    # Unfortunately, the way that schroot sets up sessions has the
2191
-    # side-effect of being unable to tell one session apart from another.
2192
-    # This can result in us attempting to kill processes in other sessions.
2193
-    # We make a best-effort to avoid doing so.
2194
-    k="$( ( xargs -0 -n1 </proc/$j/environ ) 2>/dev/null |
2195
-         sed 's/^CHROOT_SESSION_ID=/x/;t1;d;:1;q')"
2196
-    if [ -n "${k}" -a "${k#x}" != "${session}" ]; then
2197
-      other_pids="${other_pids}
2198
-${j}"
2199
-      continue
2200
-    fi
2201
-    kill -9 $pids
2202
-  done
2203
+                 d') >/dev/null 2>&1
2204
+  [ -z "$pids" ] && break
2205
+  kill -9 $pids
2206
 done
2207
-# End the chroot session. This should clean up all temporary files. But if we
2208
-# earlier failed to terminate all (daemon) processes inside of the session,
2209
-# deleting the session could fail. When that happens, the user has to manually
2210
-# clean up the stale files by invoking us with "--clean" after having killed
2211
-# all running processes.
2212
 schroot -c "${session}" -e
2213
-# Since no goma processes are running, we can remove goma directory.
2214
-rm -rf "$GOMA_TMP_DIR"
2215
 exit $rc
2216
 EOF
2217
 sudo chown root:root /usr/local/bin/"${target%bit}"
2218
@@ -659,12 +583,9 @@ sudo "/usr/local/bin/${target%bit}" dpkg --assert-multi-arch >&/dev/null &&
2219
   sudo sed -i 's/ / [arch=amd64,i386] /' \
2220
               "/var/lib/chroot/${target}/etc/apt/sources.list"
2221
   [ -d /var/lib/chroot/${target}/etc/dpkg/dpkg.cfg.d/ ] &&
2222
-  sudo "/usr/local/bin/${target%bit}" dpkg --add-architecture \
2223
-      $([ "${arch}" = "32bit" ] && echo amd64 || echo i386) >&/dev/null ||
2224
-    echo foreign-architecture \
2225
-        $([ "${arch}" = "32bit" ] && echo amd64 || echo i386) |
2226
-      sudo sh -c \
2227
-        "cat >'/var/lib/chroot/${target}/etc/dpkg/dpkg.cfg.d/multiarch'"
2228
+  echo foreign-architecture \
2229
+       $([ "${arch}" = "32bit" ] && echo amd64 || echo i386) |
2230
+    sudo sh -c "cat >'/var/lib/chroot/${target}/etc/dpkg/dpkg.cfg.d/multiarch'"
2231
 }
2232
 
2233
 # Configure "sudo" package
2234
@@ -675,7 +596,7 @@ sudo "/usr/local/bin/${target%bit}" /bin/sh -c '
2235
 # Install a few more commonly used packages
2236
 sudo "/usr/local/bin/${target%bit}" apt-get -y install                         \
2237
   autoconf automake1.9 dpkg-dev g++-multilib gcc-multilib gdb less libtool     \
2238
-  lsof strace
2239
+  strace
2240
 
2241
 # If running a 32bit environment on a 64bit machine, install a few binaries
2242
 # as 64bit. This is only done automatically if the chroot distro is the same as
2243
@@ -689,7 +610,7 @@ if [ "${copy_64}" = "y" -o \
2244
   readlinepkg=$(sudo "/usr/local/bin/${target%bit}" sh -c \
2245
     'apt-cache search "lib64readline.\$" | sort | tail -n 1 | cut -d " " -f 1')
2246
   sudo "/usr/local/bin/${target%bit}" apt-get -y install                       \
2247
-    lib64expat1 lib64ncurses5 ${readlinepkg} lib64z1 lib64stdc++6
2248
+    lib64expat1 lib64ncurses5 ${readlinepkg} lib64z1
2249
   dep=
2250
   for i in binutils gdb; do
2251
     [ -d /usr/share/doc/"$i" ] || dep="$dep $i"
2252
@@ -747,7 +668,7 @@ if [ -x "${script}" ]; then
2253
         # installing the Chrome build depencies. This prevents the chroot
2254
         # session from being closed.  So, we always try to shut down any running
2255
         # instance of dbus and rsyslog.
2256
-        sudo /usr/local/bin/"${target%bit}" sh -c "${script};
2257
+        sudo /usr/local/bin/"${target%bit}" sh -c "${script} --no-lib32;
2258
               rc=$?;
2259
               /etc/init.d/cron stop >/dev/null 2>&1 || :;
2260
               /etc/init.d/rsyslog stop >/dev/null 2>&1 || :;
2261
@@ -848,7 +769,7 @@ if [ ! -h "${HOME}/chroot" ] &&
2262
 fi
2263
 
2264
 # Clean up package files
2265
-sudo schroot -c "${target%bit}" -p -- apt-get clean
2266
+sudo schroot -c /usr/local/bin/"${target%bit}" -p -- apt-get clean
2267
 sudo apt-get clean
2268
 
2269
 trap '' INT TERM QUIT HUP
2270
diff --git media/webrtc/trunk/build/linux/chrome_linux.croc media/webrtc/trunk/build/linux/chrome_linux.croc
2271
new file mode 100644
2272
index 000000000000..f4003060f69c
2273
--- /dev/null
2274
+++ media/webrtc/trunk/build/linux/chrome_linux.croc
2275
@@ -0,0 +1,29 @@
2276
+# -*- python -*-
2277
+# Crocodile config file for Chromium linux
2278
+
2279
+# TODO(jhawkins): We'll need to add a chromeos.croc once we get a coverage bot
2280
+# for that platform.
2281
+
2282
+{
2283
+  # List of rules, applied in order
2284
+  'rules' : [
2285
+    # Specify inclusions before exclusions, since rules are in order.
2286
+
2287
+    # Don't include non-Linux platform dirs
2288
+    {
2289
+      'regexp' : '.*/(chromeos|views)/',
2290
+      'include' : 0,
2291
+    },
2292
+    # Don't include chromeos, windows, or mac specific files
2293
+    {
2294
+      'regexp' : '.*(_|/)(chromeos|mac|win|views)(\\.|_)',
2295
+      'include' : 0,
2296
+    },
2297
+
2298
+    # Groups
2299
+    {
2300
+      'regexp' : '.*_test_linux\\.',
2301
+      'group' : 'test',
2302
+    },
2303
+  ],
2304
+}
2305
diff --git media/webrtc/trunk/build/linux/dump_app_syms media/webrtc/trunk/build/linux/dump_app_syms
2306
new file mode 100755
2307
index 000000000000..632bcc76a954
2308
--- /dev/null
2309
+++ media/webrtc/trunk/build/linux/dump_app_syms
2310
@@ -0,0 +1,36 @@
2311
+#!/bin/sh
2312
+
2313
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
2314
+# Use of this source code is governed by a BSD-style license that can be
2315
+# found in the LICENSE file.
2316
+#
2317
+# Helper script to run dump_syms on Chrome Linux executables and strip
2318
+# them if needed.
2319
+
2320
+set -e
2321
+
2322
+usage() {
2323
+  echo -n "$0 <dump_syms_exe> <strip_binary> " >&2
2324
+  echo "<binary_with_symbols> <symbols_output>" >&2
2325
+}
2326
+
2327
+
2328
+if [ $# -ne 4 ]; then
2329
+  usage
2330
+  exit 1
2331
+fi
2332
+
2333
+SCRIPTDIR="$(readlink -f "$(dirname "$0")")"
2334
+DUMPSYMS="$1"
2335
+STRIP_BINARY="$2"
2336
+INFILE="$3"
2337
+OUTFILE="$4"
2338
+
2339
+# Dump the symbols from the given binary.
2340
+if [ ! -e "$OUTFILE" -o "$INFILE" -nt "$OUTFILE" ]; then
2341
+  "$DUMPSYMS" "$INFILE" > "$OUTFILE"
2342
+fi
2343
+
2344
+if [ "$STRIP_BINARY" != "0" ]; then
2345
+  strip "$INFILE"
2346
+fi
2347
diff --git media/webrtc/trunk/build/linux/pkg-config-wrapper media/webrtc/trunk/build/linux/pkg-config-wrapper
2348
new file mode 100755
2349
index 000000000000..c39e5cd3f38c
2350
--- /dev/null
2351
+++ media/webrtc/trunk/build/linux/pkg-config-wrapper
2352
@@ -0,0 +1,47 @@
2353
+#!/bin/bash
2354
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
2355
+# Use of this source code is governed by a BSD-style license that can be
2356
+# found in the LICENSE file.
2357
+
2358
+# This program wraps around pkg-config to generate the correct include and
2359
+# library paths when cross-compiling using a sysroot.
2360
+# The assumption is that the sysroot contains the .pc files in usr/lib/pkgconfig
2361
+# and usr/share/pkgconfig (relative to the sysroot) and that they output paths
2362
+# relative to some parent path of the sysroot.
2363
+# This assumption is valid for a range of sysroots, in particular: a
2364
+# LSB-compliant root filesystem mounted at the sysroot, and a board build
2365
+# directory of a Chromium OS chroot.
2366
+
2367
+root="$1"
2368
+shift
2369
+target_arch="$1"
2370
+shift
2371
+
2372
+if [ -z "$root" -o -z "$target_arch" ]
2373
+then
2374
+  echo "usage: $0 /path/to/sysroot target_arch [pkg-config-arguments] package" >&2
2375
+  exit 1
2376
+fi
2377
+
2378
+if [ "$target_arch" = "x64" ]
2379
+then
2380
+  libpath="lib64"
2381
+else
2382
+  libpath="lib"
2383
+fi
2384
+
2385
+rewrite=`dirname $0`/rewrite_dirs.py
2386
+package=${!#}
2387
+
2388
+config_path=$root/usr/$libpath/pkgconfig:$root/usr/share/pkgconfig
2389
+set -e
2390
+# Some sysroots, like the Chromium OS ones, may generate paths that are not
2391
+# relative to the sysroot. For example,
2392
+# /path/to/chroot/build/x86-generic/usr/lib/pkgconfig/pkg.pc may have all paths
2393
+# relative to /path/to/chroot (i.e. prefix=/build/x86-generic/usr) instead of
2394
+# relative to /path/to/chroot/build/x86-generic (i.e prefix=/usr).
2395
+# To support this correctly, it's necessary to extract the prefix to strip from
2396
+# pkg-config's |prefix| variable.
2397
+prefix=`PKG_CONFIG_PATH=$config_path pkg-config --variable=prefix "$package" | sed -e 's|/usr$||'`
2398
+result=`PKG_CONFIG_PATH=$config_path pkg-config "$@"`
2399
+echo "$result"| $rewrite --sysroot "$root" --strip-prefix "$prefix"
2400
diff --git media/webrtc/trunk/build/linux/python_arch.sh media/webrtc/trunk/build/linux/python_arch.sh
2401
new file mode 100755
2402
index 000000000000..01e41d066e2a
2403
--- /dev/null
2404
+++ media/webrtc/trunk/build/linux/python_arch.sh
2405
@@ -0,0 +1,42 @@
2406
+#!/bin/sh
2407
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
2408
+# Use of this source code is governed by a BSD-style license that can be
2409
+# found in the LICENSE file.
2410
+
2411
+# This figures out the architecture of the version of Python we are building
2412
+# pyautolib against.
2413
+#
2414
+#  python_arch.sh /usr/lib/libpython2.5.so.1.0
2415
+#  python_arch.sh /path/to/sysroot/usr/lib/libpython2.4.so.1.0
2416
+#
2417
+
2418
+python=$(readlink -f "$1")
2419
+if [ ! -r "$python" ]; then
2420
+  echo unknown
2421
+  exit 0
2422
+fi
2423
+file_out=$(file "$python")
2424
+if [ $? -ne 0 ]; then
2425
+  echo unknown
2426
+  exit 0
2427
+fi
2428
+
2429
+echo $file_out | grep -qs "ARM"
2430
+if [ $? -eq 0 ]; then
2431
+  echo arm
2432
+  exit 0
2433
+fi
2434
+
2435
+echo $file_out | grep -qs "x86-64"
2436
+if [ $? -eq 0 ]; then
2437
+  echo x64
2438
+  exit 0
2439
+fi
2440
+
2441
+echo $file_out | grep -qs "Intel 80386"
2442
+if [ $? -eq 0 ]; then
2443
+  echo ia32
2444
+  exit 0
2445
+fi
2446
+
2447
+exit 1
2448
diff --git media/webrtc/trunk/build/linux/rewrite_dirs.py media/webrtc/trunk/build/linux/rewrite_dirs.py
2449
new file mode 100755
2450
index 000000000000..30f22f0cd617
2451
--- /dev/null
2452
+++ media/webrtc/trunk/build/linux/rewrite_dirs.py
2453
@@ -0,0 +1,71 @@
2454
+#!/usr/bin/env python
2455
+# Copyright (c) 2011 The Chromium Authors. All rights reserved.
2456
+# Use of this source code is governed by a BSD-style license that can be
2457
+# found in the LICENSE file.
2458
+
2459
+"""Rewrites paths in -I, -L and other option to be relative to a sysroot."""
2460
+
2461
+import sys
2462
+import os
2463
+import optparse
2464
+
2465
+REWRITE_PREFIX = ['-I',
2466
+                  '-idirafter',
2467
+                  '-imacros',
2468
+                  '-imultilib',
2469
+                  '-include',
2470
+                  '-iprefix',
2471
+                  '-iquote',
2472
+                  '-isystem',
2473
+                  '-L']
2474
+
2475
+def RewritePath(path, opts):
2476
+  """Rewrites a path by stripping the prefix and prepending the sysroot."""
2477
+  sysroot = opts.sysroot
2478
+  prefix = opts.strip_prefix
2479
+  if os.path.isabs(path) and not path.startswith(sysroot):
2480
+    if path.startswith(prefix):
2481
+      path = path[len(prefix):]
2482
+    path = path.lstrip('/')
2483
+    return os.path.join(sysroot, path)
2484
+  else:
2485
+    return path
2486
+
2487
+
2488
+def RewriteLine(line, opts):
2489
+  """Rewrites all the paths in recognized options."""
2490
+  args = line.split()
2491
+  count = len(args)
2492
+  i = 0
2493
+  while i < count:
2494
+    for prefix in REWRITE_PREFIX:
2495
+      # The option can be either in the form "-I /path/to/dir" or
2496
+      # "-I/path/to/dir" so handle both.
2497
+      if args[i] == prefix:
2498
+        i += 1
2499
+        try:
2500
+          args[i] = RewritePath(args[i], opts)
2501
+        except IndexError:
2502
+          sys.stderr.write('Missing argument following %s\n' % prefix)
2503
+          break
2504
+      elif args[i].startswith(prefix):
2505
+        args[i] = prefix + RewritePath(args[i][len(prefix):], opts)
2506
+    i += 1
2507
+
2508
+  return ' '.join(args)
2509
+
2510
+
2511
+def main(argv):
2512
+  parser = optparse.OptionParser()
2513
+  parser.add_option('-s', '--sysroot', default='/', help='sysroot to prepend')
2514
+  parser.add_option('-p', '--strip-prefix', default='', help='prefix to strip')
2515
+  opts, args = parser.parse_args(argv[1:])
2516
+
2517
+  for line in sys.stdin.readlines():
2518
+    line = RewriteLine(line.strip(), opts)
2519
+    print line
2520
+  return 0
2521
+
2522
+
2523
+if __name__ == '__main__':
2524
+  sys.exit(main(sys.argv))
2525
diff --git media/webrtc/trunk/build/linux/system.gyp media/webrtc/trunk/build/linux/system.gyp
2526
new file mode 100644
2527
index 000000000000..e36e558a8bdd
2528
--- /dev/null
2529
+++ media/webrtc/trunk/build/linux/system.gyp
2530
@@ -0,0 +1,637 @@
2531
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
2532
+# Use of this source code is governed by a BSD-style license that can be
2533
+# found in the LICENSE file.
2534
+
2535
+{
2536
+  'variables': {
2537
+    'conditions': [
2538
+      ['sysroot!=""', {
2539
+        'pkg-config': './pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
2540
+      }, {
2541
+        'pkg-config': 'pkg-config'
2542
+      }]
2543
+    ],
2544
+  },
2545
+  'conditions': [
2546
+    [ 'os_posix==1 and OS!="mac"', {
2547
+      'variables': {
2548
+        # We use our own copy of libssl3, although we still need to link against
2549
+        # the rest of NSS.
2550
+        'use_system_ssl%': 0,
2551
+      },
2552
+    }, {
2553
+      'variables': {
2554
+        'use_system_ssl%': 1,
2555
+      },
2556
+    }],
2557
+    [ 'chromeos==0', {
2558
+      # Hide GTK and related dependencies for Chrome OS, so they won't get
2559
+      # added back to Chrome OS. Don't try to use GTK on Chrome OS.
2560
+      'targets': [
2561
+        {
2562
+          'target_name': 'gtk',
2563
+          'type': 'none',
2564
+          'toolsets': ['host', 'target'],
2565
+          'variables': {
2566
+            # gtk requires gmodule, but it does not list it as a dependency
2567
+            # in some misconfigured systems.
2568
+            'gtk_packages': 'gmodule-2.0 gtk+-2.0 gthread-2.0',
2569
+          },
2570
+          'conditions': [
2571
+            ['_toolset=="target"', {
2572
+              'direct_dependent_settings': {
2573
+                'cflags': [
2574
+                  '<!@(<(pkg-config) --cflags <(gtk_packages))',
2575
+                ],
2576
+              },
2577
+              'link_settings': {
2578
+                'ldflags': [
2579
+                  '<!@(<(pkg-config) --libs-only-L --libs-only-other <(gtk_packages))',
2580
+                ],
2581
+                'libraries': [
2582
+                  '<!@(<(pkg-config) --libs-only-l <(gtk_packages))',
2583
+                ],
2584
+              },
2585
+            }, {
2586
+              'direct_dependent_settings': {
2587
+                'cflags': [
2588
+                  '<!@(pkg-config --cflags <(gtk_packages))',
2589
+                ],
2590
+              },
2591
+              'link_settings': {
2592
+                'ldflags': [
2593
+                  '<!@(pkg-config --libs-only-L --libs-only-other <(gtk_packages))',
2594
+                ],
2595
+                'libraries': [
2596
+                  '<!@(pkg-config --libs-only-l <(gtk_packages))',
2597
+                ],
2598
+              },
2599
+            }],
2600
+          ],
2601
+        },
2602
+        {
2603
+          'target_name': 'gtkprint',
2604
+          'type': 'none',
2605
+          'conditions': [
2606
+            ['_toolset=="target"', {
2607
+              'direct_dependent_settings': {
2608
+                'cflags': [
2609
+                  '<!@(<(pkg-config) --cflags gtk+-unix-print-2.0)',
2610
+                ],
2611
+              },
2612
+              'link_settings': {
2613
+                'ldflags': [
2614
+                  '<!@(<(pkg-config) --libs-only-L --libs-only-other gtk+-unix-print-2.0)',
2615
+                ],
2616
+                'libraries': [
2617
+                  '<!@(<(pkg-config) --libs-only-l gtk+-unix-print-2.0)',
2618
+                ],
2619
+              },
2620
+            }],
2621
+          ],
2622
+        },
2623
+        {
2624
+          'target_name': 'gdk',
2625
+          'type': 'none',
2626
+          'conditions': [
2627
+            ['_toolset=="target"', {
2628
+              'direct_dependent_settings': {
2629
+                'cflags': [
2630
+                  '<!@(<(pkg-config) --cflags gdk-2.0)',
2631
+                ],
2632
+              },
2633
+              'link_settings': {
2634
+                'ldflags': [
2635
+                  '<!@(<(pkg-config) --libs-only-L --libs-only-other gdk-2.0)',
2636
+                ],
2637
+                'libraries': [
2638
+                  '<!@(<(pkg-config) --libs-only-l gdk-2.0)',
2639
+                ],
2640
+              },
2641
+            }],
2642
+          ],
2643
+        },
2644
+      ],  # targets
2645
+    }, {  # chromeos==1
2646
+      'targets': [
2647
+        {
2648
+          # TODO(satorux): Remove this once dbus-glib clients are gone.
2649
+          'target_name': 'dbus-glib',
2650
+          'type': 'none',
2651
+          'direct_dependent_settings': {
2652
+            'cflags': [
2653
+              '<!@(<(pkg-config) --cflags dbus-glib-1)',
2654
+            ],
2655
+          },
2656
+          'link_settings': {
2657
+            'ldflags': [
2658
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-glib-1)',
2659
+            ],
2660
+            'libraries': [
2661
+              '<!@(<(pkg-config) --libs-only-l dbus-glib-1)',
2662
+            ],
2663
+          },
2664
+        },
2665
+      ],
2666
+    }]
2667
+  ],  # conditions
2668
+  'targets': [
2669
+    {
2670
+      'target_name': 'ssl',
2671
+      'type': 'none',
2672
+      'conditions': [
2673
+        ['_toolset=="target"', {
2674
+          'conditions': [
2675
+            ['use_openssl==1', {
2676
+              'dependencies': [
2677
+                '../../third_party/openssl/openssl.gyp:openssl',
2678
+              ],
2679
+            }],
2680
+            ['use_openssl==0 and use_system_ssl==0', {
2681
+              'dependencies': [
2682
+                '../../net/third_party/nss/ssl.gyp:libssl',
2683
+                '../../third_party/zlib/zlib.gyp:zlib',
2684
+              ],
2685
+              'direct_dependent_settings': {
2686
+                'include_dirs+': [
2687
+                  # We need for our local copies of the libssl3 headers to come
2688
+                  # before other includes, as we are shadowing system headers.
2689
+                  '<(DEPTH)/net/third_party/nss/ssl',
2690
+                ],
2691
+                'cflags': [
2692
+                  '<!@(<(pkg-config) --cflags nss)',
2693
+                ],
2694
+              },
2695
+              'link_settings': {
2696
+                'ldflags': [
2697
+                  '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
2698
+                ],
2699
+                'libraries': [
2700
+                  '<!@(<(pkg-config) --libs-only-l nss | sed -e "s/-lssl3//")',
2701
+                ],
2702
+              },
2703
+            }],
2704
+            ['use_openssl==0 and use_system_ssl==1', {
2705
+              'direct_dependent_settings': {
2706
+                'cflags': [
2707
+                  '<!@(<(pkg-config) --cflags nss)',
2708
+                ],
2709
+                'defines': [
2710
+                  'USE_SYSTEM_SSL',
2711
+                ],
2712
+              },
2713
+              'link_settings': {
2714
+                'ldflags': [
2715
+                  '<!@(<(pkg-config) --libs-only-L --libs-only-other nss)',
2716
+                ],
2717
+                'libraries': [
2718
+                  '<!@(<(pkg-config) --libs-only-l nss)',
2719
+                ],
2720
+              },
2721
+            }],
2722
+          ]
2723
+        }],
2724
+      ],
2725
+    },
2726
+    {
2727
+      'target_name': 'freetype2',
2728
+      'type': 'none',
2729
+      'conditions': [
2730
+        ['_toolset=="target"', {
2731
+          'direct_dependent_settings': {
2732
+            'cflags': [
2733
+              '<!@(<(pkg-config) --cflags freetype2)',
2734
+            ],
2735
+          },
2736
+          'link_settings': {
2737
+            'ldflags': [
2738
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other freetype2)',
2739
+            ],
2740
+            'libraries': [
2741
+              '<!@(<(pkg-config) --libs-only-l freetype2)',
2742
+            ],
2743
+          },
2744
+        }],
2745
+      ],
2746
+    },
2747
+    {
2748
+      'target_name': 'fontconfig',
2749
+      'type': 'none',
2750
+      'conditions': [
2751
+        ['_toolset=="target"', {
2752
+          'direct_dependent_settings': {
2753
+            'cflags': [
2754
+              '<!@(<(pkg-config) --cflags fontconfig)',
2755
+            ],
2756
+          },
2757
+          'link_settings': {
2758
+            'ldflags': [
2759
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other fontconfig)',
2760
+            ],
2761
+            'libraries': [
2762
+              '<!@(<(pkg-config) --libs-only-l fontconfig)',
2763
+            ],
2764
+          },
2765
+        }],
2766
+      ],
2767
+    },
2768
+    {
2769
+      'target_name': 'gconf',
2770
+      'type': 'none',
2771
+      'conditions': [
2772
+        ['use_gconf==1 and _toolset=="target"', {
2773
+          'direct_dependent_settings': {
2774
+            'cflags': [
2775
+              '<!@(<(pkg-config) --cflags gconf-2.0)',
2776
+            ],
2777
+            'defines': [
2778
+              'USE_GCONF',
2779
+            ],
2780
+          },
2781
+          'link_settings': {
2782
+            'ldflags': [
2783
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other gconf-2.0)',
2784
+            ],
2785
+            'libraries': [
2786
+              '<!@(<(pkg-config) --libs-only-l gconf-2.0)',
2787
+            ],
2788
+          },
2789
+        }],
2790
+      ],
2791
+    },
2792
+    {
2793
+      'target_name': 'gio',
2794
+      'type': 'none',
2795
+      'conditions': [
2796
+        ['use_gio==1 and _toolset=="target"', {
2797
+          'direct_dependent_settings': {
2798
+            'cflags': [
2799
+              '<!@(<(pkg-config) --cflags gio-2.0)',
2800
+            ],
2801
+            'defines': [
2802
+              'USE_GIO',
2803
+            ],
2804
+            'conditions': [
2805
+              ['linux_link_gsettings==0', {
2806
+                'defines': ['DLOPEN_GSETTINGS'],
2807
+              }],
2808
+            ],
2809
+          },
2810
+          'link_settings': {
2811
+            'ldflags': [
2812
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other gio-2.0)',
2813
+            ],
2814
+            'libraries': [
2815
+              '<!@(<(pkg-config) --libs-only-l gio-2.0)',
2816
+            ],
2817
+            'conditions': [
2818
+              ['linux_link_gsettings==0 and OS=="linux"', {
2819
+                'libraries': [
2820
+                  '-ldl',
2821
+                ],
2822
+              }],
2823
+            ],
2824
+          },
2825
+        }],
2826
+      ],
2827
+    },
2828
+    {
2829
+      'target_name': 'x11',
2830
+      'type': 'none',
2831
+      'toolsets': ['host', 'target'],
2832
+      'conditions': [
2833
+        ['_toolset=="target"', {
2834
+          'direct_dependent_settings': {
2835
+            'cflags': [
2836
+              '<!@(<(pkg-config) --cflags x11)',
2837
+            ],
2838
+          },
2839
+          'link_settings': {
2840
+            'ldflags': [
2841
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other x11 xi)',
2842
+            ],
2843
+            'libraries': [
2844
+              '<!@(<(pkg-config) --libs-only-l x11 xi)',
2845
+            ],
2846
+          },
2847
+        }, {
2848
+          'direct_dependent_settings': {
2849
+            'cflags': [
2850
+              '<!@(pkg-config --cflags x11)',
2851
+            ],
2852
+          },
2853
+          'link_settings': {
2854
+            'ldflags': [
2855
+              '<!@(pkg-config --libs-only-L --libs-only-other x11 xi)',
2856
+            ],
2857
+            'libraries': [
2858
+              '<!@(pkg-config --libs-only-l x11 xi)',
2859
+            ],
2860
+          },
2861
+        }],
2862
+      ],
2863
+    },
2864
+    {
2865
+      'target_name': 'xext',
2866
+      'type': 'none',
2867
+      'conditions': [
2868
+        ['_toolset=="target"', {
2869
+          'direct_dependent_settings': {
2870
+            'cflags': [
2871
+              '<!@(<(pkg-config) --cflags xext)',
2872
+            ],
2873
+          },
2874
+          'link_settings': {
2875
+            'ldflags': [
2876
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other xext)',
2877
+            ],
2878
+            'libraries': [
2879
+              '<!@(<(pkg-config) --libs-only-l xext)',
2880
+            ],
2881
+          },
2882
+        }],
2883
+      ],
2884
+    },
2885
+    {
2886
+      'target_name': 'xfixes',
2887
+      'type': 'none',
2888
+      'conditions': [
2889
+        ['_toolset=="target"', {
2890
+          'direct_dependent_settings': {
2891
+            'cflags': [
2892
+              '<!@(<(pkg-config) --cflags xfixes)',
2893
+            ],
2894
+          },
2895
+          'link_settings': {
2896
+            'ldflags': [
2897
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other xfixes)',
2898
+            ],
2899
+            'libraries': [
2900
+              '<!@(<(pkg-config) --libs-only-l xfixes)',
2901
+            ],
2902
+          },
2903
+        }],
2904
+      ],
2905
+    },
2906
+    {
2907
+      'target_name': 'libgcrypt',
2908
+      'type': 'none',
2909
+      'conditions': [
2910
+        ['_toolset=="target" and use_cups==1', {
2911
+          'direct_dependent_settings': {
2912
+            'cflags': [
2913
+              '<!@(libgcrypt-config --cflags)',
2914
+            ],
2915
+          },
2916
+          'link_settings': {
2917
+            'libraries': [
2918
+              '<!@(libgcrypt-config --libs)',
2919
+            ],
2920
+          },
2921
+        }],
2922
+      ],
2923
+    },
2924
+    {
2925
+      'target_name': 'selinux',
2926
+      'type': 'none',
2927
+      'conditions': [
2928
+        ['_toolset=="target"', {
2929
+          'link_settings': {
2930
+            'libraries': [
2931
+              '-lselinux',
2932
+            ],
2933
+          },
2934
+        }],
2935
+      ],
2936
+    },
2937
+    {
2938
+      'target_name': 'gnome_keyring',
2939
+      'type': 'none',
2940
+      'conditions': [
2941
+        ['use_gnome_keyring==1', {
2942
+          'direct_dependent_settings': {
2943
+            'cflags': [
2944
+              '<!@(<(pkg-config) --cflags gnome-keyring-1)',
2945
+            ],
2946
+            'defines': [
2947
+              'USE_GNOME_KEYRING',
2948
+            ],
2949
+            'conditions': [
2950
+              ['linux_link_gnome_keyring==0', {
2951
+                'defines': ['DLOPEN_GNOME_KEYRING'],
2952
+              }],
2953
+            ],
2954
+          },
2955
+          'conditions': [
2956
+            ['linux_link_gnome_keyring!=0', {
2957
+              'link_settings': {
2958
+                'ldflags': [
2959
+                  '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
2960
+                ],
2961
+                'libraries': [
2962
+                  '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
2963
+                ],
2964
+              },
2965
+            }, {
2966
+              'conditions': [
2967
+                ['OS=="linux"', {
2968
+                 'link_settings': {
2969
+                   'libraries': [
2970
+                     '-ldl',
2971
+                   ],
2972
+                 },
2973
+                }],
2974
+              ],
2975
+            }],
2976
+          ],
2977
+        }],
2978
+      ],
2979
+    },
2980
+    {
2981
+      # The unit tests use a few convenience functions from the GNOME
2982
+      # Keyring library directly. We ignore linux_link_gnome_keyring and
2983
+      # link directly in this version of the target to allow this.
2984
+      # *** Do not use this target in the main binary! ***
2985
+      'target_name': 'gnome_keyring_direct',
2986
+      'type': 'none',
2987
+      'conditions': [
2988
+        ['use_gnome_keyring==1', {
2989
+          'direct_dependent_settings': {
2990
+            'cflags': [
2991
+              '<!@(<(pkg-config) --cflags gnome-keyring-1)',
2992
+            ],
2993
+            'defines': [
2994
+              'USE_GNOME_KEYRING',
2995
+            ],
2996
+            'conditions': [
2997
+              ['linux_link_gnome_keyring==0', {
2998
+                'defines': ['DLOPEN_GNOME_KEYRING'],
2999
+              }],
3000
+            ],
3001
+          },
3002
+          'link_settings': {
3003
+            'ldflags': [
3004
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other gnome-keyring-1)',
3005
+            ],
3006
+            'libraries': [
3007
+              '<!@(<(pkg-config) --libs-only-l gnome-keyring-1)',
3008
+            ],
3009
+          },
3010
+        }],
3011
+      ],
3012
+    },
3013
+    {
3014
+      'target_name': 'dbus',
3015
+      'type': 'none',
3016
+      'direct_dependent_settings': {
3017
+        'cflags': [
3018
+          '<!@(<(pkg-config) --cflags dbus-1)',
3019
+        ],
3020
+      },
3021
+      'link_settings': {
3022
+        'ldflags': [
3023
+          '<!@(<(pkg-config) --libs-only-L --libs-only-other dbus-1)',
3024
+        ],
3025
+        'libraries': [
3026
+          '<!@(<(pkg-config) --libs-only-l dbus-1)',
3027
+        ],
3028
+      },
3029
+    },
3030
+    {
3031
+      'target_name': 'glib',
3032
+      'type': 'none',
3033
+      'toolsets': ['host', 'target'],
3034
+      'variables': {
3035
+        'glib_packages': 'glib-2.0 gmodule-2.0 gobject-2.0 gthread-2.0',
3036
+      },
3037
+      'conditions': [
3038
+        ['_toolset=="target"', {
3039
+          'direct_dependent_settings': {
3040
+            'cflags': [
3041
+              '<!@(<(pkg-config) --cflags <(glib_packages))',
3042
+            ],
3043
+          },
3044
+          'link_settings': {
3045
+            'ldflags': [
3046
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other <(glib_packages))',
3047
+            ],
3048
+            'libraries': [
3049
+              '<!@(<(pkg-config) --libs-only-l <(glib_packages))',
3050
+            ],
3051
+          },
3052
+        }, {
3053
+          'direct_dependent_settings': {
3054
+            'cflags': [
3055
+              '<!@(pkg-config --cflags <(glib_packages))',
3056
+            ],
3057
+          },
3058
+          'link_settings': {
3059
+            'ldflags': [
3060
+              '<!@(pkg-config --libs-only-L --libs-only-other <(glib_packages))',
3061
+            ],
3062
+            'libraries': [
3063
+              '<!@(pkg-config --libs-only-l <(glib_packages))',
3064
+            ],
3065
+          },
3066
+        }],
3067
+        ['chromeos==1', {
3068
+          'link_settings': {
3069
+            'libraries': [ '-lXtst' ]
3070
+          }
3071
+        }],
3072
+      ],
3073
+    },
3074
+    {
3075
+      'target_name': 'pangocairo',
3076
+      'type': 'none',
3077
+      'toolsets': ['host', 'target'],
3078
+      'conditions': [
3079
+        ['_toolset=="target"', {
3080
+          'direct_dependent_settings': {
3081
+            'cflags': [
3082
+              '<!@(<(pkg-config) --cflags pangocairo)',
3083
+            ],
3084
+          },
3085
+          'link_settings': {
3086
+            'ldflags': [
3087
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other pangocairo)',
3088
+            ],
3089
+            'libraries': [
3090
+              '<!@(<(pkg-config) --libs-only-l pangocairo)',
3091
+            ],
3092
+          },
3093
+        }, {
3094
+          'direct_dependent_settings': {
3095
+            'cflags': [
3096
+              '<!@(pkg-config --cflags pangocairo)',
3097
+            ],
3098
+          },
3099
+          'link_settings': {
3100
+            'ldflags': [
3101
+              '<!@(pkg-config --libs-only-L --libs-only-other pangocairo)',
3102
+            ],
3103
+            'libraries': [
3104
+              '<!@(pkg-config --libs-only-l pangocairo)',
3105
+            ],
3106
+          },
3107
+        }],
3108
+      ],
3109
+    },
3110
+    {
3111
+      'target_name': 'libresolv',
3112
+      'type': 'none',
3113
+      'link_settings': {
3114
+        'libraries': [
3115
+          '-lresolv',
3116
+        ],
3117
+      },
3118
+    },
3119
+    {
3120
+      'target_name': 'ibus',
3121
+      'type': 'none',
3122
+      'conditions': [
3123
+        ['use_ibus==1', {
3124
+          'variables': {
3125
+            'ibus_min_version': '1.3.99.20110425',
3126
+          },
3127
+          'direct_dependent_settings': {
3128
+            'defines': ['HAVE_IBUS=1'],
3129
+            'cflags': [
3130
+              '<!@(<(pkg-config) --cflags "ibus-1.0 >= <(ibus_min_version)")',
3131
+            ],
3132
+          },
3133
+          'link_settings': {
3134
+            'ldflags': [
3135
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other "ibus-1.0 >= <(ibus_min_version)")',
3136
+            ],
3137
+            'libraries': [
3138
+              '<!@(<(pkg-config) --libs-only-l "ibus-1.0 >= <(ibus_min_version)")',
3139
+            ],
3140
+          },
3141
+        }],
3142
+      ],
3143
+    },
3144
+    {
3145
+      'target_name': 'udev',
3146
+      'type': 'none',
3147
+      'conditions': [
3148
+        # libudev is not available on *BSD
3149
+        ['_toolset=="target" and os_bsd!=1', {
3150
+          'direct_dependent_settings': {
3151
+            'cflags': [
3152
+              '<!@(<(pkg-config) --cflags libudev)'
3153
+            ],
3154
+          },
3155
+          'link_settings': {
3156
+            'ldflags': [
3157
+              '<!@(<(pkg-config) --libs-only-L --libs-only-other libudev)',
3158
+            ],
3159
+            'libraries': [
3160
+              '<!@(<(pkg-config) --libs-only-l libudev)',
3161
+            ],
3162
+          },
3163
+        }],
3164
+      ],
3165
+    },
3166
+  ],
3167
+}
3168
diff --git media/webrtc/trunk/build/mac/OWNERS media/webrtc/trunk/build/mac/OWNERS
3169
index a2d7cc837d70..c56e89dd1235 100644
3170
--- media/webrtc/trunk/build/mac/OWNERS
3171
+++ media/webrtc/trunk/build/mac/OWNERS
3172
@@ -1,4 +1,2 @@
3173
 mark@chromium.org
3174
-rsesek@chromium.org
3175
-
3176
-# COMPONENT: Build
3177
+thomasvl@chromium.org
3178
diff --git media/webrtc/trunk/build/mac/find_sdk.py media/webrtc/trunk/build/mac/find_sdk.py
3179
index 7217093c3ebe..3e90dd95bb7a 100755
3180
--- media/webrtc/trunk/build/mac/find_sdk.py
3181
+++ media/webrtc/trunk/build/mac/find_sdk.py
3182
@@ -3,19 +3,18 @@
3183
 # Use of this source code is governed by a BSD-style license that can be
3184
 # found in the LICENSE file.
3185
 
3186
-"""Prints the lowest locally available SDK version greater than or equal to a
3187
-given minimum sdk version to standard output. If --developer_dir is passed, then
3188
-the script will use the Xcode toolchain located at DEVELOPER_DIR.
3189
-
3190
-Usage:
3191
-  python find_sdk.py [--developer_dir DEVELOPER_DIR] 10.6  # Ignores SDKs < 10.6
3192
-"""
3193
-
3194
 import os
3195
 import re
3196
 import subprocess
3197
 import sys
3198
 
3199
+"""Prints the lowest locally available SDK version greater than or equal to a
3200
+given minimum sdk version to standard output.
3201
+
3202
+Usage:
3203
+  python find_sdk.py 10.6  # Ignores SDKs < 10.6
3204
+"""
3205
+
3206
 from optparse import OptionParser
3207
 
3208
 
3209
@@ -32,64 +31,54 @@ def main():
3210
   parser.add_option("--sdk_path",
3211
                     action="store", type="string", dest="sdk_path", default="",
3212
                     help="user-specified SDK path; bypasses verification")
3213
-  parser.add_option("--print_sdk_path",
3214
-                    action="store_true", dest="print_sdk_path", default=False,
3215
-                    help="Additionaly print the path the SDK (appears first).")
3216
-  parser.add_option("--developer_dir", help='Path to Xcode.')
3217
-  options, args = parser.parse_args()
3218
-  if len(args) != 1:
3219
-    parser.error('Please specify a minimum SDK version')
3220
+  (options, args) = parser.parse_args()
3221
   min_sdk_version = args[0]
3222
 
3223
-  if options.developer_dir:
3224
-    os.environ['DEVELOPER_DIR'] = options.developer_dir
3225
-
3226
-  job = subprocess.Popen(['xcode-select', '-print-path'],
3227
-                         stdout=subprocess.PIPE,
3228
-                         stderr=subprocess.STDOUT)
3229
-  out, err = job.communicate()
3230
-  if job.returncode != 0:
3231
-    print >> sys.stderr, out
3232
-    print >> sys.stderr, err
3233
-    raise Exception('Error %d running xcode-select' % job.returncode)
3234
-  sdk_dir = os.path.join(
3235
+  if sys.platform == 'darwin':
3236
+    job = subprocess.Popen(['xcode-select', '-print-path'],
3237
+                           stdout=subprocess.PIPE,
3238
+                           stderr=subprocess.STDOUT)
3239
+    out, err = job.communicate()
3240
+    if job.returncode != 0:
3241
+      print >>sys.stderr, out
3242
+      print >>sys.stderr, err
3243
+      raise Exception(('Error %d running xcode-select, you might have to run '
3244
+                       '|sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer| '
3245
+                       'if you are using Xcode 4.') % job.returncode)
3246
+    # The Developer folder moved in Xcode 4.3.
3247
+    xcode43_sdk_path = os.path.join(
3248
       out.rstrip(), 'Platforms/MacOSX.platform/Developer/SDKs')
3249
-  sdks = [re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
3250
-  sdks = [s[0] for s in sdks if s]  # [['10.5'], ['10.6']] => ['10.5', '10.6']
3251
-  sdks = [s for s in sdks  # ['10.5', '10.6'] => ['10.6']
3252
-          if parse_version(s) >= parse_version(min_sdk_version)]
3253
-  if not sdks:
3254
-    raise Exception('No %s+ SDK found' % min_sdk_version)
3255
-  best_sdk = sorted(sdks, key=parse_version)[0]
3256
+    if os.path.isdir(xcode43_sdk_path):
3257
+      sdk_dir = xcode43_sdk_path
3258
+    else:
3259
+      sdk_dir = os.path.join(out.rstrip(), 'SDKs')
3260
+    sdks = [re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
3261
+    sdks = [s[0] for s in sdks if s]  # [['10.5'], ['10.6']] => ['10.5', '10.6']
3262
+    sdks = [s for s in sdks  # ['10.5', '10.6'] => ['10.6']
3263
+            if parse_version(s) >= parse_version(min_sdk_version)]
3264
+    if not sdks:
3265
+      raise Exception('No %s+ SDK found' % min_sdk_version)
3266
+    best_sdk = sorted(sdks, key=parse_version)[0]
3267
+  else:
3268
+    best_sdk = ""
3269
 
3270
   if options.verify and best_sdk != min_sdk_version and not options.sdk_path:
3271
-    print >> sys.stderr, ''
3272
-    print >> sys.stderr, '                                           vvvvvvv'
3273
-    print >> sys.stderr, ''
3274
-    print >> sys.stderr, \
3275
+    print >>sys.stderr, ''
3276
+    print >>sys.stderr, '                                           vvvvvvv'
3277
+    print >>sys.stderr, ''
3278
+    print >>sys.stderr, \
3279
         'This build requires the %s SDK, but it was not found on your system.' \
3280
         % min_sdk_version
3281
-    print >> sys.stderr, \
3282
+    print >>sys.stderr, \
3283
         'Either install it, or explicitly set mac_sdk in your GYP_DEFINES.'
3284
-    print >> sys.stderr, ''
3285
-    print >> sys.stderr, '                                           ^^^^^^^'
3286
-    print >> sys.stderr, ''
3287
-    sys.exit(1)
3288
-
3289
-  if options.print_sdk_path:
3290
-    print subprocess.check_output(
3291
-        ['xcrun', '-sdk', 'macosx' + best_sdk, '--show-sdk-path']).strip()
3292
+    print >>sys.stderr, ''
3293
+    print >>sys.stderr, '                                           ^^^^^^^'
3294
+    print >>sys.stderr, ''
3295
+    return min_sdk_version
3296
 
3297
   return best_sdk
3298
 
3299
 
3300
 if __name__ == '__main__':
3301
-  if sys.platform == 'darwin' and os.environ.get('MOZ_AUTOMATION') != '1':
3302
-    print main()
3303
-  else:
3304
-    # Mozilla builds cross-compile on Linux or install an SDK from tooltool, so
3305
-    # return some fake data to keep the build system happy. These values aren't
3306
-    # used anywhere.
3307
-    print "."
3308
-    print "."
3309
-  sys.exit(0)
3310
+  print main()
3311
+
3312
diff --git media/webrtc/trunk/build/mac/tweak_info_plist.py media/webrtc/trunk/build/mac/tweak_info_plist.py
3313
index 920c62daf99f..9b57e7da01ba 100755
3314
--- media/webrtc/trunk/build/mac/tweak_info_plist.py
3315
+++ media/webrtc/trunk/build/mac/tweak_info_plist.py
3316
@@ -22,19 +22,17 @@
3317
 
3318
 import optparse
3319
 import os
3320
+from os import environ as env
3321
 import plistlib
3322
 import re
3323
 import subprocess
3324
 import sys
3325
 import tempfile
3326
 
3327
-TOP = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
3328
+TOP = os.path.join(env['SRCROOT'], '..')
3329
 
3330
-
3331
-def _ConvertPlist(source_plist, output_plist, fmt):
3332
-  """Convert |source_plist| to |fmt| and save as |output_plist|."""
3333
-  return subprocess.call(
3334
-      ['plutil', '-convert', fmt, '-o', output_plist, source_plist])
3335
+sys.path.insert(0, os.path.join(TOP, "build/util"))
3336
+import lastchange
3337
 
3338
 
3339
 def _GetOutput(args):
3340
@@ -67,68 +65,37 @@ def _RemoveKeys(plist, *keys):
3341
       pass
3342
 
3343
 
3344
-def _ApplyVersionOverrides(version, keys, overrides, separator='.'):
3345
-  """Applies version overrides.
3346
-
3347
-  Given a |version| string as "a.b.c.d" (assuming a default separator) with
3348
-  version components named by |keys| then overrides any value that is present
3349
-  in |overrides|.
3350
-
3351
-  >>> _ApplyVersionOverrides('a.b', ['major', 'minor'], {'minor': 'd'})
3352
-  'a.d'
3353
-  """
3354
-  if not overrides:
3355
-    return version
3356
-  version_values = version.split(separator)
3357
-  for i, (key, value) in enumerate(zip(keys, version_values)):
3358
-    if key in overrides:
3359
-      version_values[i] = overrides[key]
3360
-  return separator.join(version_values)
3361
-
3362
-
3363
-def _GetVersion(version_format, values, overrides=None):
3364
-  """Generates a version number according to |version_format| using the values
3365
-  from |values| or |overrides| if given."""
3366
-  result = version_format
3367
-  for key in values:
3368
-    if overrides and key in overrides:
3369
-      value = overrides[key]
3370
-    else:
3371
-      value = values[key]
3372
-    result = result.replace('@%s@' % key, value)
3373
-  return result
3374
-
3375
-
3376
-def _AddVersionKeys(
3377
-    plist, version_format_for_key, version=None, overrides=None):
3378
+def _AddVersionKeys(plist):
3379
   """Adds the product version number into the plist. Returns True on success and
3380
   False on error. The error will be printed to stderr."""
3381
-  if not version:
3382
-    # Pull in the Chrome version number.
3383
-    VERSION_TOOL = os.path.join(TOP, 'build/util/version.py')
3384
-    VERSION_FILE = os.path.join(TOP, 'chrome/VERSION')
3385
-    (stdout, retval) = _GetOutput([
3386
-        VERSION_TOOL, '-f', VERSION_FILE,
3387
-        '-t', '@MAJOR@.@MINOR@.@BUILD@.@PATCH@'])
3388
-
3389
-    # If the command finished with a non-zero return code, then report the
3390
-    # error up.
3391
-    if retval != 0:
3392
-      return False
3393
-
3394
-    version = stdout.strip()
3395
-
3396
-  # Parse the given version number, that should be in MAJOR.MINOR.BUILD.PATCH
3397
-  # format (where each value is a number). Note that str.isdigit() returns
3398
-  # True if the string is composed only of digits (and thus match \d+ regexp).
3399
-  groups = version.split('.')
3400
-  if len(groups) != 4 or not all(element.isdigit() for element in groups):
3401
-    print >>sys.stderr, 'Invalid version string specified: "%s"' % version
3402
+  # Pull in the Chrome version number.
3403
+  VERSION_TOOL = os.path.join(TOP, 'chrome/tools/build/version.py')
3404
+  VERSION_FILE = os.path.join(TOP, 'chrome/VERSION')
3405
+
3406
+  (stdout, retval1) = _GetOutput([VERSION_TOOL, '-f', VERSION_FILE, '-t',
3407
+                                  '@MAJOR@.@MINOR@.@BUILD@.@PATCH@'])
3408
+  full_version = stdout.rstrip()
3409
+
3410
+  (stdout, retval2) = _GetOutput([VERSION_TOOL, '-f', VERSION_FILE, '-t',
3411
+                                  '@BUILD@.@PATCH@'])
3412
+  bundle_version = stdout.rstrip()
3413
+
3414
+  # If either of the two version commands finished with non-zero returncode,
3415
+  # report the error up.
3416
+  if retval1 or retval2:
3417
     return False
3418
-  values = dict(zip(('MAJOR', 'MINOR', 'BUILD', 'PATCH'), groups))
3419
 
3420
-  for key in version_format_for_key:
3421
-    plist[key] = _GetVersion(version_format_for_key[key], values, overrides)
3422
+  # Add public version info so "Get Info" works.
3423
+  plist['CFBundleShortVersionString'] = full_version
3424
+
3425
+  # Honor the 429496.72.95 limit.  The maximum comes from splitting 2^32 - 1
3426
+  # into  6, 2, 2 digits.  The limitation was present in Tiger, but it could
3427
+  # have been fixed in later OS release, but hasn't been tested (it's easy
3428
+  # enough to find out with "lsregister -dump).
3429
+  # http://lists.apple.com/archives/carbon-dev/2006/Jun/msg00139.html
3430
+  # BUILD will always be an increasing value, so BUILD_PATH gives us something
3431
+  # unique that meetings what LS wants.
3432
+  plist['CFBundleVersion'] = bundle_version
3433
 
3434
   # Return with no error.
3435
   return True
3436
@@ -137,16 +104,11 @@ def _AddVersionKeys(
3437
 def _DoSCMKeys(plist, add_keys):
3438
   """Adds the SCM information, visible in about:version, to property list. If
3439
   |add_keys| is True, it will insert the keys, otherwise it will remove them."""
3440
-  scm_revision = None
3441
+  scm_path, scm_revision = None, None
3442
   if add_keys:
3443
-    # Pull in the Chrome revision number.
3444
-    VERSION_TOOL = os.path.join(TOP, 'build/util/version.py')
3445
-    LASTCHANGE_FILE = os.path.join(TOP, 'build/util/LASTCHANGE')
3446
-    (stdout, retval) = _GetOutput([VERSION_TOOL, '-f', LASTCHANGE_FILE, '-t',
3447
-                                  '@LASTCHANGE@'])
3448
-    if retval:
3449
-      return False
3450
-    scm_revision = stdout.rstrip()
3451
+    version_info = lastchange.FetchVersionInfo(
3452
+        default_lastchange=None, directory=TOP)
3453
+    scm_path, scm_revision = version_info.url, version_info.revision
3454
 
3455
   # See if the operation failed.
3456
   _RemoveKeys(plist, 'SCMRevision')
3457
@@ -155,17 +117,67 @@ def _DoSCMKeys(plist, add_keys):
3458
   elif add_keys:
3459
     print >>sys.stderr, 'Could not determine SCM revision.  This may be OK.'
3460
 
3461
-  return True
3462
+  if scm_path != None:
3463
+    plist['SCMPath'] = scm_path
3464
+  else:
3465
+    _RemoveKeys(plist, 'SCMPath')
3466
+
3467
+
3468
+def _DoPDFKeys(plist, add_keys):
3469
+  """Adds PDF support to the document types list. If add_keys is True, it will
3470
+  add the type information dictionary. If it is False, it will remove it if
3471
+  present."""
3472
 
3473
+  PDF_FILE_EXTENSION = 'pdf'
3474
 
3475
-def _AddBreakpadKeys(plist, branding, platform):
3476
+  def __AddPDFKeys(sub_plist):
3477
+    """Writes the keys into a sub-dictionary of the plist."""
3478
+    sub_plist['CFBundleTypeExtensions'] = [PDF_FILE_EXTENSION]
3479
+    sub_plist['CFBundleTypeIconFile'] = 'document.icns'
3480
+    sub_plist['CFBundleTypeMIMETypes'] = 'application/pdf'
3481
+    sub_plist['CFBundleTypeName'] = 'PDF Document'
3482
+    sub_plist['CFBundleTypeRole'] = 'Viewer'
3483
+
3484
+  DOCUMENT_TYPES_KEY = 'CFBundleDocumentTypes'
3485
+
3486
+  # First get the list of document types, creating it if necessary.
3487
+  try:
3488
+    extensions = plist[DOCUMENT_TYPES_KEY]
3489
+  except KeyError:
3490
+    # If this plist doesn't have a type dictionary, create one if set to add the
3491
+    # keys. If not, bail.
3492
+    if not add_keys:
3493
+      return
3494
+    extensions = plist[DOCUMENT_TYPES_KEY] = []
3495
+
3496
+  # Loop over each entry in the list, looking for one that handles PDF types.
3497
+  for i, ext in enumerate(extensions):
3498
+    # If an entry for .pdf files is found...
3499
+    if 'CFBundleTypeExtensions' not in ext:
3500
+      continue
3501
+    if PDF_FILE_EXTENSION in ext['CFBundleTypeExtensions']:
3502
+      if add_keys:
3503
+        # Overwrite the existing keys with new ones.
3504
+        __AddPDFKeys(ext)
3505
+      else:
3506
+        # Otherwise, delete the entry entirely.
3507
+        del extensions[i]
3508
+      return
3509
+
3510
+  # No PDF entry exists. If one needs to be added, do so now.
3511
+  if add_keys:
3512
+    pdf_entry = {}
3513
+    __AddPDFKeys(pdf_entry)
3514
+    extensions.append(pdf_entry)
3515
+
3516
+
3517
+def _AddBreakpadKeys(plist, branding):
3518
   """Adds the Breakpad keys. This must be called AFTER _AddVersionKeys() and
3519
   also requires the |branding| argument."""
3520
   plist['BreakpadReportInterval'] = '3600'  # Deliberately a string.
3521
-  plist['BreakpadProduct'] = '%s_%s' % (branding, platform)
3522
+  plist['BreakpadProduct'] = '%s_Mac' % branding
3523
   plist['BreakpadProductDisplay'] = branding
3524
-  plist['BreakpadURL'] = 'https://clients2.google.com/cr/report'
3525
-
3526
+  plist['BreakpadVersion'] = plist['CFBundleShortVersionString']
3527
   # These are both deliberately strings and not boolean.
3528
   plist['BreakpadSendAndExit'] = 'YES'
3529
   plist['BreakpadSkipConfirm'] = 'YES'
3530
@@ -183,24 +195,6 @@ def _RemoveBreakpadKeys(plist):
3531
       'BreakpadSkipConfirm')
3532
 
3533
 
3534
-def _TagSuffixes():
3535
-  # Keep this list sorted in the order that tag suffix components are to
3536
-  # appear in a tag value. That is to say, it should be sorted per ASCII.
3537
-  components = ('full',)
3538
-  assert tuple(sorted(components)) == components
3539
-
3540
-  components_len = len(components)
3541
-  combinations = 1 << components_len
3542
-  tag_suffixes = []
3543
-  for combination in xrange(0, combinations):
3544
-    tag_suffix = ''
3545
-    for component_index in xrange(0, components_len):
3546
-      if combination & (1 << component_index):
3547
-        tag_suffix += '-' + components[component_index]
3548
-    tag_suffixes.append(tag_suffix)
3549
-  return tag_suffixes
3550
-
3551
-
3552
 def _AddKeystoneKeys(plist, bundle_identifier):
3553
   """Adds the Keystone keys. This must be called AFTER _AddVersionKeys() and
3554
   also requires the |bundle_identifier| argument (com.example.product)."""
3555
@@ -208,11 +202,6 @@ def _AddKeystoneKeys(plist, bundle_identifier):
3556
   plist['KSProductID'] = bundle_identifier
3557
   plist['KSUpdateURL'] = 'https://tools.google.com/service/update2'
3558
 
3559
-  _RemoveKeys(plist, 'KSChannelID')
3560
-  for tag_suffix in _TagSuffixes():
3561
-    if tag_suffix:
3562
-      plist['KSChannelID' + tag_suffix] = tag_suffix
3563
-
3564
 
3565
 def _RemoveKeystoneKeys(plist):
3566
   """Removes any set Keystone keys."""
3567
@@ -221,100 +210,37 @@ def _RemoveKeystoneKeys(plist):
3568
       'KSProductID',
3569
       'KSUpdateURL')
3570
 
3571
-  tag_keys = []
3572
-  for tag_suffix in _TagSuffixes():
3573
-    tag_keys.append('KSChannelID' + tag_suffix)
3574
-  _RemoveKeys(plist, *tag_keys)
3575
-
3576
 
3577
 def Main(argv):
3578
   parser = optparse.OptionParser('%prog [options]')
3579
-  parser.add_option('--plist', dest='plist_path', action='store',
3580
-      type='string', default=None, help='The path of the plist to tweak.')
3581
-  parser.add_option('--output', dest='plist_output', action='store',
3582
-      type='string', default=None, help='If specified, the path to output ' + \
3583
-      'the tweaked plist, rather than overwriting the input.')
3584
   parser.add_option('--breakpad', dest='use_breakpad', action='store',
3585
       type='int', default=False, help='Enable Breakpad [1 or 0]')
3586
+  parser.add_option('--breakpad_uploads', dest='breakpad_uploads',
3587
+      action='store', type='int', default=False,
3588
+      help='Enable Breakpad\'s uploading of crash dumps [1 or 0]')
3589
   parser.add_option('--keystone', dest='use_keystone', action='store',
3590
       type='int', default=False, help='Enable Keystone [1 or 0]')
3591
   parser.add_option('--scm', dest='add_scm_info', action='store', type='int',
3592
       default=True, help='Add SCM metadata [1 or 0]')
3593
+  parser.add_option('--pdf', dest='add_pdf_support', action='store', type='int',
3594
+      default=False, help='Add PDF file handler support [1 or 0]')
3595
   parser.add_option('--branding', dest='branding', action='store',
3596
       type='string', default=None, help='The branding of the binary')
3597
   parser.add_option('--bundle_id', dest='bundle_identifier',
3598
       action='store', type='string', default=None,
3599
       help='The bundle id of the binary')
3600
-  parser.add_option('--platform', choices=('ios', 'mac'), default='mac',
3601
-      help='The target platform of the bundle')
3602
-  parser.add_option('--version-overrides', action='append',
3603
-      help='Key-value pair to override specific component of version '
3604
-           'like key=value (can be passed multiple time to configure '
3605
-           'more than one override)')
3606
-  parser.add_option('--format', choices=('binary1', 'xml1', 'json'),
3607
-      default='xml1', help='Format to use when writing property list '
3608
-          '(default: %(default)s)')
3609
-  parser.add_option('--version', dest='version', action='store', type='string',
3610
-      default=None, help='The version string [major.minor.build.patch]')
3611
   (options, args) = parser.parse_args(argv)
3612
 
3613
   if len(args) > 0:
3614
     print >>sys.stderr, parser.get_usage()
3615
     return 1
3616
 
3617
-  if not options.plist_path:
3618
-    print >>sys.stderr, 'No --plist specified.'
3619
-    return 1
3620
-
3621
-  # Read the plist into its parsed format. Convert the file to 'xml1' as
3622
-  # plistlib only supports that format in Python 2.7.
3623
-  with tempfile.NamedTemporaryFile() as temp_info_plist:
3624
-    retcode = _ConvertPlist(options.plist_path, temp_info_plist.name, 'xml1')
3625
-    if retcode != 0:
3626
-      return retcode
3627
-    plist = plistlib.readPlist(temp_info_plist.name)
3628
-
3629
-  # Convert overrides.
3630
-  overrides = {}
3631
-  if options.version_overrides:
3632
-    for pair in options.version_overrides:
3633
-      if not '=' in pair:
3634
-        print >>sys.stderr, 'Invalid value for --version-overrides:', pair
3635
-        return 1
3636
-      key, value = pair.split('=', 1)
3637
-      overrides[key] = value
3638
-      if key not in ('MAJOR', 'MINOR', 'BUILD', 'PATCH'):
3639
-        print >>sys.stderr, 'Unsupported key for --version-overrides:', key
3640
-        return 1
3641
-
3642
-  if options.platform == 'mac':
3643
-    version_format_for_key = {
3644
-      # Add public version info so "Get Info" works.
3645
-      'CFBundleShortVersionString': '@MAJOR@.@MINOR@.@BUILD@.@PATCH@',
3646
-
3647
-      # Honor the 429496.72.95 limit.  The maximum comes from splitting 2^32 - 1
3648
-      # into  6, 2, 2 digits.  The limitation was present in Tiger, but it could
3649
-      # have been fixed in later OS release, but hasn't been tested (it's easy
3650
-      # enough to find out with "lsregister -dump).
3651
-      # http://lists.apple.com/archives/carbon-dev/2006/Jun/msg00139.html
3652
-      # BUILD will always be an increasing value, so BUILD_PATH gives us
3653
-      # something unique that meetings what LS wants.
3654
-      'CFBundleVersion': '@BUILD@.@PATCH@',
3655
-    }
3656
-  else:
3657
-    version_format_for_key = {
3658
-      'CFBundleShortVersionString': '@MAJOR@.@BUILD@.@PATCH@',
3659
-      'CFBundleVersion': '@MAJOR@.@MINOR@.@BUILD@.@PATCH@'
3660
-    }
3661
-
3662
-  if options.use_breakpad:
3663
-    version_format_for_key['BreakpadVersion'] = \
3664
-        '@MAJOR@.@MINOR@.@BUILD@.@PATCH@'
3665
+  # Read the plist into its parsed format.
3666
+  DEST_INFO_PLIST = os.path.join(env['TARGET_BUILD_DIR'], env['INFOPLIST_PATH'])
3667
+  plist = plistlib.readPlist(DEST_INFO_PLIST)
3668
 
3669
   # Insert the product version.
3670
-  if not _AddVersionKeys(
3671
-      plist, version_format_for_key, version=options.version,
3672
-      overrides=overrides):
3673
+  if not _AddVersionKeys(plist):
3674
     return 2
3675
 
3676
   # Add Breakpad if configured to do so.
3677
@@ -322,15 +248,22 @@ def Main(argv):
3678
     if options.branding is None:
3679
       print >>sys.stderr, 'Use of Breakpad requires branding.'
3680
       return 1
3681
-    # Map gyp "OS" / gn "target_os" passed via the --platform parameter to
3682
-    # the platform as known by breakpad.
3683
-    platform = {'mac': 'Mac', 'ios': 'iOS'}[options.platform]
3684
-    _AddBreakpadKeys(plist, options.branding, platform)
3685
+    _AddBreakpadKeys(plist, options.branding)
3686
+    if options.breakpad_uploads:
3687
+      plist['BreakpadURL'] = 'https://clients2.google.com/cr/report'
3688
+    else:
3689
+      # This allows crash dumping to a file without uploading the
3690
+      # dump, for testing purposes.  Breakpad does not recognise
3691
+      # "none" as a special value, but this does stop crash dump
3692
+      # uploading from happening.  We need to specify something
3693
+      # because if "BreakpadURL" is not present, Breakpad will not
3694
+      # register its crash handler and no crash dumping will occur.
3695
+      plist['BreakpadURL'] = 'none'
3696
   else:
3697
     _RemoveBreakpadKeys(plist)
3698
 
3699
-  # Add Keystone if configured to do so.
3700
-  if options.use_keystone:
3701
+  # Only add Keystone in Release builds.
3702
+  if options.use_keystone and env['CONFIGURATION'] == 'Release':
3703
     if options.bundle_identifier is None:
3704
       print >>sys.stderr, 'Use of Keystone requires the bundle id.'
3705
       return 1
3706
@@ -339,20 +272,21 @@ def Main(argv):
3707
     _RemoveKeystoneKeys(plist)
3708
 
3709
   # Adds or removes any SCM keys.
3710
-  if not _DoSCMKeys(plist, options.add_scm_info):
3711
-    return 3
3712
+  _DoSCMKeys(plist, options.add_scm_info)
3713
 
3714
-  output_path = options.plist_path
3715
-  if options.plist_output is not None:
3716
-    output_path = options.plist_output
3717
+  # Adds or removes the PDF file handler entry.
3718
+  _DoPDFKeys(plist, options.add_pdf_support)
3719
 
3720
   # Now that all keys have been mutated, rewrite the file.
3721
-  with tempfile.NamedTemporaryFile() as temp_info_plist:
3722
-    plistlib.writePlist(plist, temp_info_plist.name)
3723
-
3724
-    # Convert Info.plist to the format requested by the --format flag. Any
3725
-    # format would work on Mac but iOS requires specific format.
3726
-    return _ConvertPlist(temp_info_plist.name, output_path, options.format)
3727
+  temp_info_plist = tempfile.NamedTemporaryFile()
3728
+  plistlib.writePlist(plist, temp_info_plist.name)
3729
+
3730
+  # Info.plist will work perfectly well in any plist format, but traditionally
3731
+  # applications use xml1 for this, so convert it to ensure that it's valid.
3732
+  proc = subprocess.Popen(['plutil', '-convert', 'xml1', '-o', DEST_INFO_PLIST,
3733
+                           temp_info_plist.name])
3734
+  proc.wait()
3735
+  return proc.returncode
3736
 
3737
 
3738
 if __name__ == '__main__':
3739
diff --git media/webrtc/trunk/build/precompile.h media/webrtc/trunk/build/precompile.h
3740
index 50a9b87e2fb2..a3c5193c611f 100644
3741
--- media/webrtc/trunk/build/precompile.h
3742
+++ media/webrtc/trunk/build/precompile.h
3743
@@ -2,8 +2,17 @@
3744
 // Use of this source code is governed by a BSD-style license that can be
3745
 // found in the LICENSE file.
3746
 
3747
-// This file is used as a precompiled header for both C and C++ files. So
3748
-// any C++ headers must go in the __cplusplus block below.
3749
+// Precompiled header for Chromium project on Windows, not used by
3750
+// other build configurations. Using precompiled headers speeds the
3751
+// build up significantly, around 1/4th on VS 2010 on an HP Z600 with 12
3752
+// GB of memory.
3753
+//
3754
+// Numeric comments beside includes are the number of times they were
3755
+// included under src/chrome/browser on 2011/8/20, which was used as a
3756
+// baseline for deciding what to include in the PCH. Includes without
3757
+// a numeric comment are generally included at least 5 times. It may
3758
+// be possible to tweak the speed of the build by commenting out or
3759
+// removing some of the less frequently used headers.
3760
 
3761
 #if defined(BUILD_PRECOMPILE_H_)
3762
 #error You shouldn't include the precompiled header file more than once.
3763
@@ -11,40 +20,84 @@
3764
 
3765
 #define BUILD_PRECOMPILE_H_
3766
 
3767
-#define _USE_MATH_DEFINES
3768
+// The Windows header needs to come before almost all the other
3769
+// Windows-specific headers.
3770
+#include <Windows.h>
3771
+#include <dwmapi.h>
3772
+#include <shellapi.h>
3773
+#include <wincrypt.h>  // 4
3774
+#include <wtypes.h>  // 2
3775
+
3776
+// Defines in atlbase.h cause conflicts; if we could figure out how
3777
+// this family of headers can be included in the PCH, it might speed
3778
+// up the build as several of them are used frequently.
3779
+/*
3780
+#include <atlbase.h>
3781
+#include <atlapp.h>
3782
+#include <atlcom.h>
3783
+#include <atlcrack.h>  // 2
3784
+#include <atlctrls.h>  // 2
3785
+#include <atlmisc.h>  // 2
3786
+#include <atlsafe.h>  // 1
3787
+#include <atltheme.h>  // 1
3788
+#include <atlwin.h>  // 2
3789
+*/
3790
+
3791
+// Objbase.h and other files that rely on it bring in [ #define
3792
+// interface struct ] which can cause problems in a multi-platform
3793
+// build like Chrome's. #undef-ing it does not work as there are
3794
+// currently 118 targets that break if we do this, so leaving out of
3795
+// the precompiled header for now.
3796
+//#include <commctrl.h>  // 2
3797
+//#include <commdlg.h>  // 3
3798
+//#include <cryptuiapi.h>  // 2
3799
+//#include <Objbase.h>  // 2
3800
+//#include <objidl.h>  // 1
3801
+//#include <ole2.h>  // 1
3802
+//#include <oleacc.h>  // 2
3803
+//#include <oleauto.h>  // 1
3804
+//#include <oleidl.h>  // 1
3805
+//#include <propkey.h>  // 2
3806
+//#include <propvarutil.h>  // 2
3807
+//#include <pstore.h>  // 2
3808
+//#include <shlguid.h>  // 1
3809
+//#include <shlwapi.h>  // 1
3810
+//#include <shobjidl.h>  // 4
3811
+//#include <urlhist.h>  // 2
3812
+
3813
+// Caused other conflicts in addition to the 'interface' issue above.
3814
+// #include <shlobj.h>
3815
 
3816
 #include <errno.h>
3817
 #include <fcntl.h>
3818
-#include <limits.h>
3819
+#include <limits.h>  // 4
3820
 #include <math.h>
3821
-#include <memory.h>
3822
+#include <memory.h>  // 1
3823
 #include <signal.h>
3824
-#include <stdarg.h>
3825
+#include <stdarg.h>  // 1
3826
 #include <stddef.h>
3827
 #include <stdio.h>
3828
 #include <stdlib.h>
3829
 #include <string.h>
3830
-#include <time.h>
3831
-
3832
-#if defined(__cplusplus)
3833
+#include <time.h>  // 4
3834
 
3835
 #include <algorithm>
3836
-#include <bitset>
3837
+#include <bitset>  // 3
3838
 #include <cmath>
3839
 #include <cstddef>
3840
-#include <cstdio>
3841
-#include <cstdlib>
3842
+#include <cstdio>  // 3
3843
+#include <cstdlib>  // 2
3844
 #include <cstring>
3845
 #include <deque>
3846
-#include <fstream>
3847
+#include <fstream>  // 3
3848
 #include <functional>
3849
-#include <iomanip>
3850
-#include <iosfwd>
3851
+#include <iomanip>  // 2
3852
+#include <iosfwd>  // 2
3853
 #include <iterator>
3854
 #include <limits>
3855
 #include <list>
3856
 #include <map>
3857
-#include <numeric>
3858
+#include <numeric>  // 2
3859
 #include <ostream>
3860
 #include <queue>
3861
 #include <set>
3862
@@ -53,5 +106,3 @@
3863
 #include <string>
3864
 #include <utility>
3865
 #include <vector>
3866
-
3867
-#endif  // __cplusplus
3868
diff --git media/webrtc/trunk/build/sanitize-mac-build-log.sed media/webrtc/trunk/build/sanitize-mac-build-log.sed
3869
index b4111c7b828a..3312eac5a86c 100755
3870
--- media/webrtc/trunk/build/sanitize-mac-build-log.sed
3871
+++ media/webrtc/trunk/build/sanitize-mac-build-log.sed
3872
@@ -1,3 +1,5 @@
3873
+#!/bin/echo Use sanitize-mac-build-log.sh or sed -f
3874
+
3875
 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3876
 # Use of this source code is governed by a BSD-style license that can be
3877
 # found in the LICENSE file.
3878
@@ -15,8 +17,8 @@
3879
 # Xcode prints a short "compiling foobar.o" line followed by the lengthy
3880
 # full command line.  These deletions drop the command line.
3881
 \|^    /Developer/usr/bin/|d
3882
-\|^    /Developer/Library/PrivateFrameworks/DevToolsCore\.framework/|d
3883
-\|^    /Developer/Library/Xcode/Plug-ins/CoreBuildTasks\.xcplugin/|d
3884
+\|^    /Developer/Library/PrivateFrameworks/DevToolsCore.framework/|d
3885
+\|^    /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/|d
3886
 
3887
 # Drop any goma command lines as well.
3888
 \|^    .*/gomacc |d
3889
@@ -26,8 +28,8 @@
3890
 \|^    /Users/[^/]*/bin/|d
3891
 
3892
 # There's already a nice note for bindings, don't need the command line.
3893
-\|^python scripts/rule_binding\.py|d
3894
+\|^python scripts/rule_binding.py|d
3895
 
3896
 # Shorten the "compiling foobar.o" line.
3897
-s|^Distributed-CompileC (.*) normal i386 c\+\+ com\.apple\.compilers\.gcc\.4_2|    CC \1|
3898
-s|^CompileC (.*) normal i386 c\+\+ com\.apple\.compilers\.gcc\.4_2|    CC \1|
3899
+s|^Distributed-CompileC \(.*\) normal i386 c++ com.apple.compilers.gcc.4_2|    CC \1|
3900
+s|^CompileC \(.*\) normal i386 c++ com.apple.compilers.gcc.4_2|    CC \1|
3901
diff --git media/webrtc/trunk/build/sanitize-mac-build-log.sh media/webrtc/trunk/build/sanitize-mac-build-log.sh
3902
index df5a7af29eb6..dc743fabb51f 100755
3903
--- media/webrtc/trunk/build/sanitize-mac-build-log.sh
3904
+++ media/webrtc/trunk/build/sanitize-mac-build-log.sh
3905
@@ -2,4 +2,5 @@
3906
 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3907
 # Use of this source code is governed by a BSD-style license that can be
3908
 # found in the LICENSE file.
3909
-sed -r -f `dirname "${0}"`/`basename "${0}" sh`sed
3910
+sed -f `dirname "${0}"`/`basename "${0}" sh`sed
3911
+
3912
diff --git media/webrtc/trunk/build/sanitize-win-build-log.sed media/webrtc/trunk/build/sanitize-win-build-log.sed
3913
index c18e664c83a0..c8bffde87447 100755
3914
--- media/webrtc/trunk/build/sanitize-win-build-log.sed
3915
+++ media/webrtc/trunk/build/sanitize-win-build-log.sed
3916
@@ -1,3 +1,5 @@
3917
+#!/bin/echo Use sanitize-win-build-log.sh or sed -f
3918
+
3919
 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3920
 # Use of this source code is governed by a BSD-style license that can be
3921
 # found in the LICENSE file.
3922
@@ -6,10 +8,10 @@
3923
 # machine-parsable.
3924
 
3925
 # Drop uninformative lines.
3926
-/The operation completed successfully\./d
3927
+/The operation completed successfully./d
3928
 
3929
 # Drop parallelization indicators on lines.
3930
-s/^[0-9]+>//
3931
+s/^[0-9]\+>//
3932
 
3933
 # Shorten bindings generation lines
3934
-s/^.*"python".*idl_compiler\.py".*("[^"]+\.idl").*$/  idl_compiler \1/
3935
+s/^.*"perl".*generate-bindings.pl".*\("[^"]\+\.idl"\).*$/  generate-bindings \1/
3936
diff --git media/webrtc/trunk/build/sanitize-win-build-log.sh media/webrtc/trunk/build/sanitize-win-build-log.sh
3937
index df5a7af29eb6..dc743fabb51f 100755
3938
--- media/webrtc/trunk/build/sanitize-win-build-log.sh
3939
+++ media/webrtc/trunk/build/sanitize-win-build-log.sh
3940
@@ -2,4 +2,5 @@
3941
 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
3942
 # Use of this source code is governed by a BSD-style license that can be
3943
 # found in the LICENSE file.
3944
-sed -r -f `dirname "${0}"`/`basename "${0}" sh`sed
3945
+sed -f `dirname "${0}"`/`basename "${0}" sh`sed
3946
+
3947
diff --git media/webrtc/trunk/build/update-linux-sandbox.sh media/webrtc/trunk/build/update-linux-sandbox.sh
3948
index fa2d1077af61..ebf8c105a5c5 100755
3949
--- media/webrtc/trunk/build/update-linux-sandbox.sh
3950
+++ media/webrtc/trunk/build/update-linux-sandbox.sh
3951
@@ -6,7 +6,7 @@
3952
 
3953
 BUILDTYPE="${BUILDTYPE:-Debug}"
3954
 CHROME_SRC_DIR="${CHROME_SRC_DIR:-$(dirname -- $(readlink -fn -- "$0"))/..}"
3955
-CHROME_OUT_DIR="${CHROME_SRC_DIR}/${CHROMIUM_OUT_DIR:-out}/${BUILDTYPE}"
3956
+CHROME_OUT_DIR="${CHROME_SRC_DIR}/out/${BUILDTYPE}"
3957
 CHROME_SANDBOX_BUILD_PATH="${CHROME_OUT_DIR}/chrome_sandbox"
3958
 CHROME_SANDBOX_INST_PATH="/usr/local/sbin/chrome-devel-sandbox"
3959
 CHROME_SANDBOX_INST_DIR=$(dirname -- "$CHROME_SANDBOX_INST_PATH")
3960
@@ -39,9 +39,8 @@ if [ ! -d "${CHROME_OUT_DIR}" ]; then
3961
 fi
3962
 
3963
 if [ ! -f "${CHROME_SANDBOX_BUILD_PATH}" ]; then
3964
-  echo "Could not find ${CHROME_SANDBOX_BUILD_PATH}"
3965
-  echo -n "BUILDTYPE is $BUILDTYPE, use \"BUILDTYPE=<value> ${0}\" to override "
3966
-  echo "after you build the chrome_sandbox target"
3967
+  echo -n "Could not find ${CHROME_SANDBOX_BUILD_PATH}, "
3968
+  echo "please make sure you build the chrome_sandbox target"
3969
   exit 1
3970
 fi
3971
 
3972
diff --git media/webrtc/trunk/build/util/lastchange.py media/webrtc/trunk/build/util/lastchange.py
3973
index 0e3102f4b824..a101341ef7d3 100755
3974
--- media/webrtc/trunk/build/util/lastchange.py
3975
+++ media/webrtc/trunk/build/util/lastchange.py
3976
@@ -13,11 +13,56 @@ import os
3977
 import subprocess
3978
 import sys
3979
 
3980
+_GIT_SVN_ID_REGEX = re.compile(r'.*git-svn-id:\s*([^@]*)@([0-9]+)', re.DOTALL)
3981
+
3982
 class VersionInfo(object):
3983
-  def __init__(self, revision):
3984
+  def __init__(self, url, revision):
3985
+    self.url = url
3986
     self.revision = revision
3987
 
3988
 
3989
+def FetchSVNRevision(directory, svn_url_regex):
3990
+  """
3991
+  Fetch the Subversion branch and revision for a given directory.
3992
+
3993
+  Errors are swallowed.
3994
+
3995
+  Returns:
3996
+    A VersionInfo object or None on error.
3997
+  """
3998
+  try:
3999
+    proc = subprocess.Popen(['svn', 'info'],
4000
+                            stdout=subprocess.PIPE,
4001
+                            stderr=subprocess.PIPE,
4002
+                            cwd=directory,
4003
+                            shell=(sys.platform=='win32'))
4004
+  except OSError:
4005
+    # command is apparently either not installed or not executable.
4006
+    return None
4007
+  if not proc:
4008
+    return None
4009
+
4010
+  attrs = {}
4011
+  for line in proc.stdout:
4012
+    line = line.strip()
4013
+    if not line:
4014
+      continue
4015
+    key, val = line.split(': ', 1)
4016
+    attrs[key] = val
4017
+
4018
+  try:
4019
+    match = svn_url_regex.search(attrs['URL'])
4020
+    if match:
4021
+      url = match.group(2)
4022
+    else:
4023
+      url = ''
4024
+    revision = attrs['Revision']
4025
+  except KeyError:
4026
+    return None
4027
+
4028
+  return VersionInfo(url, revision)
4029
+
4030
+
4031
 def RunGitCommand(directory, command):
4032
   """
4033
   Launches git subcommand.
4034
@@ -54,74 +99,74 @@ def FetchGitRevision(directory):
4035
   Returns:
4036
     A VersionInfo object or None on error.
4037
   """
4038
-  hsh = ''
4039
-  git_args = ['log', '-1', '--format=%H']
4040
-  proc = RunGitCommand(directory, git_args)
4041
+  proc = RunGitCommand(directory, ['rev-parse', 'HEAD'])
4042
   if proc:
4043
     output = proc.communicate()[0].strip()
4044
     if proc.returncode == 0 and output:
4045
-      hsh = output
4046
-  if not hsh:
4047
-    return None
4048
-  pos = ''
4049
-  proc = RunGitCommand(directory, ['cat-file', 'commit', hsh])
4050
-  if proc:
4051
-    output = proc.communicate()[0]
4052
-    if proc.returncode == 0 and output:
4053
-      for line in reversed(output.splitlines()):
4054
-        if line.startswith('Cr-Commit-Position:'):
4055
-          pos = line.rsplit()[-1].strip()
4056
-          break
4057
-  return VersionInfo('%s-%s' % (hsh, pos))
4058
+      return VersionInfo('git', output[:7])
4059
+  return None
4060
 
4061
 
4062
-def FetchVersionInfo(directory=None):
4063
+def FetchGitSVNURLAndRevision(directory, svn_url_regex):
4064
   """
4065
-  Returns the last change (in the form of a branch, revision tuple),
4066
-  from some appropriate revision control system.
4067
-  """
4068
-  version_info = FetchGitRevision(directory)
4069
-  if not version_info:
4070
-    version_info = VersionInfo(None)
4071
-  return version_info
4072
+  Fetch the Subversion URL and revision through Git.
4073
 
4074
+  Errors are swallowed.
4075
 
4076
-def GetHeaderGuard(path):
4077
+  Returns:
4078
+    A tuple containing the Subversion URL and revision.
4079
   """
4080
-  Returns the header #define guard for the given file path.
4081
-  This treats everything after the last instance of "src/" as being a
4082
-  relevant part of the guard. If there is no "src/", then the entire path
4083
-  is used.
4084
+  proc = RunGitCommand(directory, ['log', '-1',
4085
+                                   '--grep=git-svn-id', '--format=%b'])
4086
+  if proc:
4087
+    output = proc.communicate()[0].strip()
4088
+    if proc.returncode == 0 and output:
4089
+      # Extract the latest SVN revision and the SVN URL.
4090
+      # The target line is the last "git-svn-id: ..." line like this:
4091
+      # git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85528 0039d316....
4092
+      match = _GIT_SVN_ID_REGEX.search(output)
4093
+      if match:
4094
+        revision = match.group(2)
4095
+        url_match = svn_url_regex.search(match.group(1))
4096
+        if url_match:
4097
+          url = url_match.group(2)
4098
+        else:
4099
+          url = ''
4100
+        return url, revision
4101
+  return None, None
4102
+
4103
+
4104
+def FetchGitSVNRevision(directory, svn_url_regex):
4105
   """
4106
-  src_index = path.rfind('src/')
4107
-  if src_index != -1:
4108
-    guard = path[src_index + 4:]
4109
-  else:
4110
-    guard = path
4111
-  guard = guard.upper()
4112
-  return guard.replace('/', '_').replace('.', '_').replace('\\', '_') + '_'
4113
+  Fetch the Git-SVN identifier for the local tree.
4114
 
4115
-
4116
-def GetHeaderContents(path, define, version):
4117
-  """
4118
-  Returns what the contents of the header file should be that indicate the given
4119
-  revision.
4120
+  Errors are swallowed.
4121
   """
4122
-  header_guard = GetHeaderGuard(path)
4123
+  url, revision = FetchGitSVNURLAndRevision(directory, svn_url_regex)
4124
+  if url and revision:
4125
+    return VersionInfo(url, revision)
4126
+  return None
4127
 
4128
-  header_contents = """/* Generated by lastchange.py, do not edit.*/
4129
 
4130
-#ifndef %(header_guard)s
4131
-#define %(header_guard)s
4132
-
4133
-#define %(define)s "%(version)s"
4134
+def FetchVersionInfo(default_lastchange, directory=None,
4135
+                     directory_regex_prior_to_src_url='chrome|svn'):
4136
+  """
4137
+  Returns the last change (in the form of a branch, revision tuple),
4138
+  from some appropriate revision control system.
4139
+  """
4140
+  svn_url_regex = re.compile(
4141
+      r'.*/(' + directory_regex_prior_to_src_url + r')(/.*)')
4142
 
4143
-#endif  // %(header_guard)s
4144
-"""
4145
-  header_contents = header_contents % { 'header_guard': header_guard,
4146
-                                        'define': define,
4147
-                                        'version': version }
4148
-  return header_contents
4149
+  version_info = (FetchSVNRevision(directory, svn_url_regex) or
4150
+                  FetchGitSVNRevision(directory, svn_url_regex) or
4151
+                  FetchGitRevision(directory))
4152
+  if not version_info:
4153
+    if default_lastchange and os.path.exists(default_lastchange):
4154
+      revision = open(default_lastchange, 'r').read().strip()
4155
+      version_info = VersionInfo(None, revision)
4156
+    else:
4157
+      version_info = VersionInfo(None, None)
4158
+  return version_info
4159
 
4160
 
4161
 def WriteIfChanged(file_name, contents):
4162
@@ -145,25 +190,15 @@ def main(argv=None):
4163
     argv = sys.argv
4164
 
4165
   parser = optparse.OptionParser(usage="lastchange.py [options]")
4166
-  parser.add_option("-m", "--version-macro",
4167
-                    help="Name of C #define when using --header. Defaults to " +
4168
-                    "LAST_CHANGE.",
4169
-                    default="LAST_CHANGE")
4170
+  parser.add_option("-d", "--default-lastchange", metavar="FILE",
4171
+                    help="default last change input FILE")
4172
   parser.add_option("-o", "--output", metavar="FILE",
4173
-                    help="Write last change to FILE. " +
4174
-                    "Can be combined with --header to write both files.")
4175
-  parser.add_option("", "--header", metavar="FILE",
4176
-                    help="Write last change to FILE as a C/C++ header. " +
4177
-                    "Can be combined with --output to write both files.")
4178
+                    help="write last change to FILE")
4179
   parser.add_option("--revision-only", action='store_true',
4180
-                    help="Just print the GIT hash. Overrides any " +
4181
-                    "file-output-related options.")
4182
-  parser.add_option("-s", "--source-dir", metavar="DIR",
4183
-                    help="Use repository in the given directory.")
4184
+                    help="just print the SVN revision number")
4185
   opts, args = parser.parse_args(argv[1:])
4186
 
4187
   out_file = opts.output
4188
-  header = opts.header
4189
 
4190
   while len(args) and out_file is None:
4191
     if out_file is None:
4192
@@ -173,12 +208,8 @@ def main(argv=None):
4193
     parser.print_help()
4194
     sys.exit(2)
4195
 
4196
-  if opts.source_dir:
4197
-    src_dir = opts.source_dir
4198
-  else:
4199
-    src_dir = os.path.dirname(os.path.abspath(__file__))
4200
-
4201
-  version_info = FetchVersionInfo(directory=src_dir)
4202
+  version_info = FetchVersionInfo(opts.default_lastchange,
4203
+      os.path.dirname(sys.argv[0]))
4204
 
4205
   if version_info.revision == None:
4206
     version_info.revision = '0'
4207
@@ -187,15 +218,10 @@ def main(argv=None):
4208
     print version_info.revision
4209
   else:
4210
     contents = "LASTCHANGE=%s\n" % version_info.revision
4211
-    if not out_file and not opts.header:
4212
-      sys.stdout.write(contents)
4213
+    if out_file:
4214
+      WriteIfChanged(out_file, contents)
4215
     else:
4216
-      if out_file:
4217
-        WriteIfChanged(out_file, contents)
4218
-      if header:
4219
-        WriteIfChanged(header,
4220
-                       GetHeaderContents(header, opts.version_macro,
4221
-                                         version_info.revision))
4222
+      sys.stdout.write(contents)
4223
 
4224
   return 0
4225
 
4226
diff --git media/webrtc/trunk/build/whitespace_file.txt media/webrtc/trunk/build/whitespace_file.txt
4227
index f2fa9b113c11..087f0ad752ee 100644
4228
--- media/webrtc/trunk/build/whitespace_file.txt
4229
+++ media/webrtc/trunk/build/whitespace_file.txt
4230
@@ -1,33 +1,30 @@
4231
-Copyright 2014 The Chromium Authors. All rights reserved.
4232
+Copyright (c) 2012 The Chromium Authors. All rights reserved.
4233
 Use of this useless file is governed by a BSD-style license that can be
4234
 found in the LICENSE file.
4235
 
4236
-
4237
 This file is used for making non-code changes to trigger buildbot cycles. Make
4238
 any modification below this line.
4239
 
4240
-======================================================================
4241
+=========================================================================
4242
 
4243
-Let's make a story. Add zero+ sentences for every commit:
4244
+Let's make a story. Add one sentence for every commit:
4245
 
4246
-CHÄPTER 1:
4247
-It was a dark and blinky night; the rain fell in torrents -- except at
4248
+CHAPTER 1.0:
4249
+It was a dark and stormy night; the rain fell in torrents -- except at
4250
 occasional intervals, when it was checked by a violent gust of wind which
4251
 swept up the streets (for it is in London that our scene lies), rattling along
4252
 the housetops, and fiercely agitating the scanty flame of the lamps that
4253
-struggled against the elements. A hooded figure emerged.
4254
-
4255
-It was a Domo-Kun.
4256
-
4257
-"What took you so long?", inquired his wife.
4258
+struggled against the darkness. A hooded figure emerged.
4259
 
4260
+It was a Domo-Kun. "What took you so long?", inquired his wife.
4261
 Silence. Oblivious to his silence, she continued, "Did Mr. Usagi enjoy the
4262
 waffles you brought him?" "You know him, he's not one to forego a waffle,
4263
-no matter how burnt," he snickered.
4264
+no matter how burnt", he snickered.
4265
 
4266
-The pause was filled with the sound of compile errors.
4267
+The pause was filled with the sound of thunder.
4268
 
4269
-CHAPTER 2:
4270
+
4271
+CHAPTER 2.0:
4272
 The jelly was as dark as night, and just as runny.
4273
 The Domo-Kun shuddered, remembering the way Mr. Usagi had speared his waffles
4274
 with his fork, watching the runny jelly spread and pool across his plate,
4275
@@ -41,27 +38,24 @@ when the fan was last cleaned.
4276
 
4277
 There was a poignant pause.
4278
 
4279
-CHAPTER 3:
4280
+CHAPTER 3.0:
4281
 Mr. Usagi felt that something wasn't right. Shortly after the Domo-Kun left he
4282
 began feeling sick. He thought out loud to himself, "No, he wouldn't have done
4283
-that to me." He considered that perhaps he shouldn't have pushed so hard.
4284
+that to me." He considered that perhaps he shouldn't have pushed him so far.
4285
 Perhaps he shouldn't have been so cold and sarcastic, after the unimaginable
4286
-horror that had occurred just the week before.
4287
+horror that had occurred, just the week before.
4288
 
4289
-Next time, there won't be any sushi. Why sushi with waffles anyway?  It's like
4290
-adorning breakfast cereal with halibut -- shameful.
4291
+Next time, there won't be any sushi. Why sushis with waffles anyway?  It's like
4292
+salmon in a cereal bowl.
4293
 
4294
 CHAPTER 4:
4295
 The taste of stale sushi in his mouth the next morning was unbearable. He
4296
-wondered where the sushi came from as he attempted to wash the taste away with
4297
-a bottle of 3000Â¥ sake. He tries to recall the cook's face.  Green? Probably.
4298
+wondered where the sushi came from. He tries to recall the cook's face.  Purple?
4299
 
4300
 CHAPTER 5:
4301
-Many tears later, Mr. Usagi would laugh at the memory of the earnest,
4302
-well-intentioned Domo-Kun. Another day in the life. That is when he realized that
4303
-life goes on.
4304
-
4305
-$CHAPTER6
4306
+Many years later, Mr. Usagi would laugh at the memory of the earnest,
4307
+well-intentioned Domo-Kun.
4308
+Another day in the life...
4309
 
4310
 TRUISMS (1978-1983)
4311
 JENNY HOLZER
4312
@@ -71,104 +65,5 @@ A MAN CAN'T KNOW WHAT IT IS TO BE A MOTHER
4313
 A NAME MEANS A LOT JUST BY ITSELF
4314
 A POSITIVE ATTITUDE MEANS ALL THE DIFFERENCE IN THE WORLD
4315
 A RELAXED MAN IS NOT NECESSARILY A BETTER MAN
4316
-NO ONE SHOULD EVER USE SVN
4317
-AN INFLEXIBLE POSITION SOMETIMES IS A SIGN OF PARALYSIS
4318
-IT IS MANS FATE TO OUTSMART HIMSELF
4319
-BEING SURE OF YOURSELF MEANS YOU'RE A FOOL
4320
-AM NOT
4321
-ARE TOO
4322
-IF AT FIRST YOU DON'T SUCCEED: TRY, EXCEPT, FINALLY
4323
-AND THEN, TIME LEAPT BACKWARDS
4324
-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaaaaaaahhhh LOT
4325
-I'm really tempted to change something above the line.
4326
-Reeccciiiipppppeeeeeesssssss!!!!!!!!!
4327
-PEOPLE SAY "FAILURE IS NOT AN OPTION", BUT FAILURE IS ALWAYS AN OPTION.
4328
-WHAT GOES UP MUST HAVE A NON-ZERO VELOCITY
4329
-
4330
-I can feel the heat closing in, feel them out there making their moves...
4331
-What could possibly go wrong? We've already ate our cake.
4332
-
4333
-Stand Still. Pause Clocks. We can make the World Stop.
4334
-WUBWUBWUBWUBWUB
4335
-
4336
-I want a 1917 build and you will give me what I want.
4337
-
4338
-This sentence is false.
4339
-
4340
-Beauty is in the eyes of a Beholder.
4341
-
4342
-I'm the best at space.
4343
-
4344
-The first time Yossarian saw the chaplain, he fell madly in love with him.
4345
-*
4346
-*
4347
-*
4348
-Give not thyself up, then, to fire, lest it invert thee, deaden thee; as for
4349
-the time it did me. There is a wisdom that is woe; but there is a woe that is
4350
-madness. And there is a Catskill eagle in some souls that can alike dive down
4351
-into the blackest gorges, and soar out of them again and become invisible in
4352
-the sunny spaces. And even if he for ever flies within the gorge, that gorge
4353
-is in the mountains; so that even in his lowest swoop the mountain eagle is
4354
-still higher than other birds upon the plain, even though they soar.
4355
-*
4356
-*
4357
-*
4358
-
4359
-I'm here to commit lines and drop rhymes
4360
-*
4361
-This is a line to test and try uploading a cl.
4362
-
4363
-And lo, in the year 2014, there was verily an attempt to upgrade to GCC 4.8 on
4364
-the Android bots, and it was good. Except on one bot, where it was bad. And
4365
-lo, the change was reverted, and GCC went back to 4.6, where code is slower
4366
-and less optimized. And verily did it break the build, because artifacts had
4367
-been created with 4.8, and alignment was no longer the same, and a great
4368
-sadness descended upon the Android GN buildbot, and it did refuseth to build
4369
-any more. But the sheriffs thought to themselves: Placebo! Let us clobber the
4370
-bot, and perhaps it will rebuild with GCC 4.6, which hath worked for many many
4371
-seasons. And so they modified the whitespace file with these immortal lines,
4372
-and visited it upon the bots, that great destruction might be wrought upon
4373
-their outdated binaries. In clobberus, veritas.
4374
-
4375
-As the git approaches, light begins to shine through the SCM thrice again...
4376
-However, the git, is, after all, quite stupid.
4377
-
4378
-Suddenly Domo-Kun found itself in a room filled with dazzling mirrors. As
4379
-Domo-Kun looked around, it realized that some of the mirrors were actually but
4380
-pale reflections of true reality.
4381
-
4382
-A herd of wild gits appears!  Time for CQ :D
4383
-And one more for sizes.py...
4384
-
4385
-What's an overmarketed dietary supplement expressing sadness, relief,
4386
-tiredness, or a similar feeling.?  Ah-Sigh-ee.
4387
-
4388
-It was love at first sight.  The moment Yossarian first laid eyes on the chaplain, he fell madly in love with him.
4389
-
4390
-Cool whitespace change for git-cl land
4391
-
4392
-Oh god the bots are red! I'm blind! Mmmm, cronuts.
4393
-
4394
-If you stand on your head, you will get footprints in your hair.
4395
-
4396
-sigh
4397
-sigher
4398
-pick up cls
4399
-
4400
-In the BUILD we trust.
4401
-^_^
4402
-
4403
-In the masters we don't.
4404
-In the tryservers, we don't either.
4405
-In the CQ sometimes.
4406
-Auto-generated by git-eject-upstream (http://goo.gl/cIHsYR)
4407
-My sandwiches are like my children: I love them all.
4408
-No, really, I couldn't eat another bit.
4409
-When I hunger I think of you, and a pastrami sandwich.
4410
-Do make a terrible mistake every once in a while.
4411
-I just made two.
4412
-Mistakes are the best sometimes.
4413
-\o/
4414
-This is groovy.
4415
-
4416
-SECRET ENDING: IT WAS _____ ALL ALONG!
4417
+
4418
+This commit will change the world as we know it.
4419
diff --git media/webrtc/trunk/gtest/moz.build media/webrtc/trunk/gtest/moz.build
4420
index 1f9f5c4d802b..71f4441f5fb0 100644
4421
--- media/webrtc/trunk/gtest/moz.build
4422
+++ media/webrtc/trunk/gtest/moz.build
4423
@@ -32,14 +32,14 @@ USE_LIBS += [
4424
     '/media/webrtc/trunk/third_party/gflags/gflags_gflags/gflags',
4425
     '/testing/gtest/gtest',
4426
     'media_libopus',
4427
-    'mozglue',
4428
     'speex',
4429
     'webrtc',
4430
-    'webrtc_common_gn',
4431
-    'webrtc_gn',
4432
-    'webrtc_i420_gn',
4433
-    'webrtc_vp8_gn',
4434
-    'webrtc_vp9_gn',
4435
+    'webrtc_common',
4436
+    'webrtc_i420',
4437
+    'webrtc_lib',
4438
+    'webrtc_utility',
4439
+    'webrtc_vp8',
4440
+    'webrtc_vp9',
4441
     'yuv',
4442
 ]
4443
 
4444
diff --git media/webrtc/trunk/webrtc/BUILD.gn media/webrtc/trunk/webrtc/BUILD.gn
4445
index c808a47ca300..805eaf0d847e 100644
4446
--- media/webrtc/trunk/webrtc/BUILD.gn
4447
+++ media/webrtc/trunk/webrtc/BUILD.gn
4448
@@ -11,9 +11,7 @@
4449
 import("//build/config/linux/pkg_config.gni")
4450
 import("//build/config/sanitizers/sanitizers.gni")
4451
 import("build/webrtc.gni")
4452
-if (!build_with_mozilla) {
4453
-  import("//third_party/protobuf/proto_library.gni")
4454
-}
4455
+import("//third_party/protobuf/proto_library.gni")
4456
 if (is_android) {
4457
   import("//build/config/android/config.gni")
4458
   import("//build/config/android/rules.gni")
4459
@@ -76,12 +74,6 @@ config("common_inherited_config") {
4460
       "WEBRTC_LINUX",
4461
       "WEBRTC_ANDROID",
4462
     ]
4463
-
4464
-    if (build_with_mozilla) {
4465
-      defines += [
4466
-        "WEBRTC_ANDROID_OPENSLES",
4467
-      ]
4468
-    }
4469
   }
4470
   if (is_chromeos) {
4471
     defines += [ "CHROMEOS" ]
4472
@@ -252,41 +244,26 @@ if (!build_with_chromium) {
4473
 
4474
     deps = [
4475
       ":webrtc_common",
4476
+      "api",
4477
       "api:transport_api",
4478
       "audio",
4479
       "base",
4480
       "call",
4481
       "common_audio",
4482
       "common_video",
4483
+      "logging",
4484
       "media",
4485
       "modules",
4486
       "modules/video_capture:video_capture_internal_impl",
4487
+      "p2p",
4488
+      "pc",
4489
       "sdk",
4490
+      "stats",
4491
       "system_wrappers",
4492
       "video",
4493
       "voice_engine",
4494
     ]
4495
 
4496
-    if (build_with_mozilla) {
4497
-      deps += [
4498
-        "api:video_frame_api",
4499
-        "system_wrappers:field_trial_default",
4500
-        "system_wrappers:metrics_default",
4501
-      ]
4502
-
4503
-      if (!is_android) {
4504
-        deps += [ "video_engine" ]
4505
-      }
4506
-    } else {
4507
-      deps += [
4508
-        "api",
4509
-        "logging",
4510
-        "p2p",
4511
-        "pc",
4512
-        "stats",
4513
-      ]
4514
-    }
4515
-
4516
     if (rtc_enable_protobuf) {
4517
       defines += [ "ENABLE_RTC_EVENT_LOG" ]
4518
       deps += [ "logging:rtc_event_log_proto" ]
4519
diff --git media/webrtc/trunk/webrtc/api/api.gyp media/webrtc/trunk/webrtc/api/api.gyp
4520
new file mode 100644
4521
index 000000000000..2ee17acfe779
4522
--- /dev/null
4523
+++ media/webrtc/trunk/webrtc/api/api.gyp
4524
@@ -0,0 +1,255 @@
4525
+# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
4526
+#
4527
+# Use of this source code is governed by a BSD-style license
4528
+# that can be found in the LICENSE file in the root of the source
4529
+# tree. An additional intellectual property rights grant can be found
4530
+# in the file PATENTS.  All contributing project authors may
4531
+# be found in the AUTHORS file in the root of the source tree.
4532
+
4533
+{
4534
+  'includes': [ '../build/common.gypi', ],
4535
+  'conditions': [
4536
+    ['os_posix == 1 and OS != "mac" and OS != "ios"', {
4537
+      'conditions': [
4538
+        ['sysroot!=""', {
4539
+          'variables': {
4540
+            'pkg-config': '../../../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
4541
+          },
4542
+        }, {
4543
+          'variables': {
4544
+            'pkg-config': 'pkg-config'
4545
+          },
4546
+        }],
4547
+      ],
4548
+    }],
4549
+    # Excluded from the Chromium build since they cannot be built due to
4550
+    # incompability with Chromium's logging implementation.
4551
+    ['OS=="android" and build_with_chromium==0 and build_with_mozilla==0', {
4552
+      'targets': [
4553
+        {
4554
+          'target_name': 'libjingle_peerconnection_jni',
4555
+          'type': 'static_library',
4556
+          'dependencies': [
4557
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:field_trial_default',
4558
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
4559
+            'libjingle_peerconnection',
4560
+          ],
4561
+          'sources': [
4562
+            'android/jni/androidmediacodeccommon.h',
4563
+            'android/jni/androidmediadecoder_jni.cc',
4564
+            'android/jni/androidmediadecoder_jni.h',
4565
+            'android/jni/androidmediaencoder_jni.cc',
4566
+            'android/jni/androidmediaencoder_jni.h',
4567
+            'android/jni/androidmetrics_jni.cc',
4568
+            'android/jni/androidnetworkmonitor_jni.cc',
4569
+            'android/jni/androidnetworkmonitor_jni.h',
4570
+            'android/jni/androidvideotracksource_jni.cc',
4571
+            'android/jni/classreferenceholder.cc',
4572
+            'android/jni/classreferenceholder.h',
4573
+            'android/jni/jni_helpers.cc',
4574
+            'android/jni/jni_helpers.h',
4575
+            'android/jni/native_handle_impl.cc',
4576
+            'android/jni/native_handle_impl.h',
4577
+            'android/jni/peerconnection_jni.cc',
4578
+            'android/jni/surfacetexturehelper_jni.cc',
4579
+            'android/jni/surfacetexturehelper_jni.h',
4580
+            'androidvideotracksource.cc',
4581
+            'androidvideotracksource.h',
4582
+          ],
4583
+          'include_dirs': [
4584
+            '<(libyuv_dir)/include',
4585
+          ],
4586
+          # TODO(kjellander): Make the code compile without disabling these flags.
4587
+          # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
4588
+          'cflags': [
4589
+            '-Wno-sign-compare',
4590
+            '-Wno-unused-variable',
4591
+          ],
4592
+          'cflags!': [
4593
+            '-Wextra',
4594
+          ],
4595
+          'msvs_disabled_warnings': [
4596
+            4245,  # conversion from 'int' to 'size_t', signed/unsigned mismatch.
4597
+            4267,  # conversion from 'size_t' to 'int', possible loss of data.
4598
+            4389,  # signed/unsigned mismatch.
4599
+          ],
4600
+        },
4601
+        {
4602
+          'target_name': 'libjingle_peerconnection_so',
4603
+          'type': 'shared_library',
4604
+          'dependencies': [
4605
+            'libjingle_peerconnection',
4606
+            'libjingle_peerconnection_jni',
4607
+          ],
4608
+          'sources': [
4609
+           'android/jni/jni_onload.cc',
4610
+          ],
4611
+          'variables': {
4612
+            # This library uses native JNI exports; tell GYP so that the
4613
+            # required symbols will be kept.
4614
+            'use_native_jni_exports': 1,
4615
+          },
4616
+        },
4617
+      ]
4618
+    }],
4619
+  ],  # conditions
4620
+  'targets': [
4621
+    {
4622
+      'target_name': 'call_api',
4623
+      'type': 'static_library',
4624
+      'dependencies': [
4625
+        # TODO(kjellander): Add remaining dependencies when webrtc:4243 is done.
4626
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
4627
+        '<(webrtc_root)/common.gyp:webrtc_common',
4628
+        '<(webrtc_root)/modules/modules.gyp:audio_encoder_interface',
4629
+      ],
4630
+      'sources': [
4631
+        'call/audio_receive_stream.h',
4632
+        'call/audio_send_stream.h',
4633
+        'call/audio_sink.h',
4634
+        'call/audio_state.h',
4635
+      ],
4636
+    },
4637
+    {
4638
+      'target_name': 'video_frame_api',
4639
+      'type': 'static_library',
4640
+      'dependencies': [
4641
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
4642
+        '<(webrtc_root)/common.gyp:webrtc_common',
4643
+      ],
4644
+      'sources': [
4645
+        'call/transport.h',
4646
+        'video/i420_buffer.cc',
4647
+        'video/i420_buffer.h',
4648
+        'video/video_frame.cc',
4649
+        'video/video_frame.h',
4650
+        'video/video_frame_buffer.h',
4651
+        'video/video_rotation.h',
4652
+      ],
4653
+      'include_dirs': [
4654
+        '<(libyuv_dir)/include',
4655
+      ],
4656
+    },
4657
+    {
4658
+      'target_name': 'libjingle_peerconnection',
4659
+      'type': 'static_library',
4660
+      'dependencies': [
4661
+        ':call_api',
4662
+        ':rtc_stats_api',
4663
+        '<(webrtc_root)/media/media.gyp:rtc_media',
4664
+        '<(webrtc_root)/pc/pc.gyp:rtc_pc',
4665
+        '<(webrtc_root)/stats/stats.gyp:rtc_stats',
4666
+      ],
4667
+      'sources': [
4668
+        'audiotrack.cc',
4669
+        'audiotrack.h',
4670
+        'datachannel.cc',
4671
+        'datachannel.h',
4672
+        'datachannelinterface.h',
4673
+        'dtmfsender.cc',
4674
+        'dtmfsender.h',
4675
+        'dtmfsenderinterface.h',
4676
+        'jsep.h',
4677
+        'jsepicecandidate.cc',
4678
+        'jsepicecandidate.h',
4679
+        'jsepsessiondescription.cc',
4680
+        'jsepsessiondescription.h',
4681
+        'localaudiosource.cc',
4682
+        'localaudiosource.h',
4683
+        'mediaconstraintsinterface.cc',
4684
+        'mediaconstraintsinterface.h',
4685
+        'mediacontroller.cc',
4686
+        'mediacontroller.h',
4687
+        'mediastream.cc',
4688
+        'mediastream.h',
4689
+        'mediastreaminterface.h',
4690
+        'mediastreamobserver.cc',
4691
+        'mediastreamobserver.h',
4692
+        'mediastreamproxy.h',
4693
+        'mediastreamtrack.h',
4694
+        'mediastreamtrackproxy.h',
4695
+        'notifier.h',
4696
+        'peerconnection.cc',
4697
+        'peerconnection.h',
4698
+        'peerconnectionfactory.cc',
4699
+        'peerconnectionfactory.h',
4700
+        'peerconnectionfactoryproxy.h',
4701
+        'peerconnectioninterface.h',
4702
+        'peerconnectionproxy.h',
4703
+        'proxy.h',
4704
+        'remoteaudiosource.cc',
4705
+        'remoteaudiosource.h',
4706
+        'rtcstatscollector.cc',
4707
+        'rtcstatscollector.h',
4708
+        'rtpparameters.h',
4709
+        'rtpreceiver.cc',
4710
+        'rtpreceiver.h',
4711
+        'rtpreceiverinterface.h',
4712
+        'rtpsender.cc',
4713
+        'rtpsender.h',
4714
+        'rtpsenderinterface.h',
4715
+        'sctputils.cc',
4716
+        'sctputils.h',
4717
+        'statscollector.cc',
4718
+        'statscollector.h',
4719
+        'statstypes.cc',
4720
+        'statstypes.h',
4721
+        'streamcollection.h',
4722
+        'videocapturertracksource.cc',
4723
+        'videocapturertracksource.h',
4724
+        'videosourceproxy.h',
4725
+        'videotrack.cc',
4726
+        'videotrack.h',
4727
+        'videotracksource.cc',
4728
+        'videotracksource.h',
4729
+        'webrtcsdp.cc',
4730
+        'webrtcsdp.h',
4731
+        'webrtcsession.cc',
4732
+        'webrtcsession.h',
4733
+        'webrtcsessiondescriptionfactory.cc',
4734
+        'webrtcsessiondescriptionfactory.h',
4735
+      ],
4736
+      'conditions': [
4737
+        ['clang==1', {
4738
+          'cflags!': [
4739
+            '-Wextra',
4740
+          ],
4741
+          'xcode_settings': {
4742
+            'WARNING_CFLAGS!': ['-Wextra'],
4743
+          },
4744
+        }, {
4745
+          'cflags': [
4746
+            '-Wno-maybe-uninitialized',  # Only exists for GCC.
4747
+          ],
4748
+        }],
4749
+        ['use_quic==1', {
4750
+          'dependencies': [
4751
+            '<(DEPTH)/third_party/libquic/libquic.gyp:libquic',
4752
+          ],
4753
+          'sources': [
4754
+            'quicdatachannel.cc',
4755
+            'quicdatachannel.h',
4756
+            'quicdatatransport.cc',
4757
+            'quicdatatransport.h',
4758
+          ],
4759
+          'export_dependent_settings': [
4760
+            '<(DEPTH)/third_party/libquic/libquic.gyp:libquic',
4761
+          ],
4762
+        }],
4763
+      ],
4764
+    },  # target libjingle_peerconnection
4765
+    {
4766
+      # GN version: webrtc/api:rtc_stats_api
4767
+      'target_name': 'rtc_stats_api',
4768
+      'type': 'static_library',
4769
+      'dependencies': [
4770
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
4771
+      ],
4772
+      'sources': [
4773
+        'stats/rtcstats.h',
4774
+        'stats/rtcstats_objects.h',
4775
+        'stats/rtcstatsreport.h',
4776
+      ],
4777
+    },  # target rtc_stats_api
4778
+  ],  # targets
4779
+}
4780
diff --git media/webrtc/trunk/webrtc/api/api_java.gyp media/webrtc/trunk/webrtc/api/api_java.gyp
4781
new file mode 100644
4782
index 000000000000..4e18035613e0
4783
--- /dev/null
4784
+++ media/webrtc/trunk/webrtc/api/api_java.gyp
4785
@@ -0,0 +1,50 @@
4786
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
4787
+#
4788
+# Use of this source code is governed by a BSD-style license
4789
+# that can be found in the LICENSE file in the root of the source
4790
+# tree. An additional intellectual property rights grant can be found
4791
+# in the file PATENTS.  All contributing project authors may
4792
+# be found in the AUTHORS file in the root of the source tree.
4793
+
4794
+# This file exists only because there's no other way to avoid errors in the
4795
+# Chromium build due to the inclusion of build/java.gypi. GYP unfortunately
4796
+# processes all 'includes' for all .gyp files, ignoring conditions. This
4797
+# processing takes place early in the cycle, before it's possible to use
4798
+# variables. It will go away when WebRTC has fully migrated to GN.
4799
+
4800
+{
4801
+  'includes': [ '../build/common.gypi', ],
4802
+  'conditions': [
4803
+    ['OS=="android"', {
4804
+      'targets': [
4805
+        {
4806
+          # |libjingle_peerconnection_java| builds a jar file with name
4807
+          # libjingle_peerconnection_java.jar using Chrome's build system.
4808
+          # It includes all Java files needed to setup a PeeerConnection call
4809
+          # from Android.
4810
+          'target_name': 'libjingle_peerconnection_java',
4811
+          'type': 'none',
4812
+          'dependencies': [
4813
+            '<(webrtc_root)/api/api.gyp:libjingle_peerconnection_so',
4814
+          ],
4815
+          'variables': {
4816
+            # Designate as Chromium code and point to our lint settings to
4817
+            # enable linting of the WebRTC code (this is the only way to make
4818
+            # lint_action invoke the Android linter).
4819
+            'android_manifest_path': '<(webrtc_root)/build/android/AndroidManifest.xml',
4820
+            'suppressions_file': '<(webrtc_root)/build/android/suppressions.xml',
4821
+            'chromium_code': 1,
4822
+            'java_in_dir': 'android/java',
4823
+            'webrtc_base_dir': '<(webrtc_root)/base',
4824
+            'webrtc_modules_dir': '<(webrtc_root)/modules',
4825
+            'additional_src_dirs' : [
4826
+              '<(webrtc_base_dir)/java',
4827
+              '<(webrtc_modules_dir)/audio_device/android/java/src',
4828
+            ],
4829
+          },
4830
+          'includes': ['../../build/java.gypi'],
4831
+        },
4832
+      ],  # targets
4833
+    }],  # OS=="android"
4834
+  ],  # conditions
4835
+}
4836
diff --git media/webrtc/trunk/webrtc/audio/webrtc_audio.gypi media/webrtc/trunk/webrtc/audio/webrtc_audio.gypi
4837
new file mode 100644
4838
index 000000000000..31a281c09a53
4839
--- /dev/null
4840
+++ media/webrtc/trunk/webrtc/audio/webrtc_audio.gypi
4841
@@ -0,0 +1,32 @@
4842
+# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
4843
+#
4844
+# Use of this source code is governed by a BSD-style license
4845
+# that can be found in the LICENSE file in the root of the source
4846
+# tree. An additional intellectual property rights grant can be found
4847
+# in the file PATENTS.  All contributing project authors may
4848
+# be found in the AUTHORS file in the root of the source tree.
4849
+{
4850
+  'variables': {
4851
+    'webrtc_audio_dependencies': [
4852
+      '<(webrtc_root)/api/api.gyp:call_api',
4853
+      '<(webrtc_root)/common.gyp:webrtc_common',
4854
+      '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
4855
+      '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine',
4856
+      '<(webrtc_root)/webrtc.gyp:rtc_event_log_api',
4857
+    ],
4858
+    'webrtc_audio_sources': [
4859
+      'audio/audio_receive_stream.cc',
4860
+      'audio/audio_receive_stream.h',
4861
+      'audio/audio_send_stream.cc',
4862
+      'audio/audio_send_stream.h',
4863
+      'audio/audio_state.cc',
4864
+      'audio/audio_state.h',
4865
+      'audio/audio_transport_proxy.cc',
4866
+      'audio/audio_transport_proxy.h',
4867
+      'audio/conversion.h',
4868
+      'audio/scoped_voe_interface.h',
4869
+      'audio/utility/audio_frame_operations.cc',
4870
+      'audio/utility/audio_frame_operations.h',
4871
+    ],
4872
+  },
4873
+}
4874
diff --git media/webrtc/trunk/webrtc/base/BUILD.gn media/webrtc/trunk/webrtc/base/BUILD.gn
4875
index bdef9f5a2cbf..0902581f2eff 100644
4876
--- media/webrtc/trunk/webrtc/base/BUILD.gn
4877
+++ media/webrtc/trunk/webrtc/base/BUILD.gn
4878
@@ -20,22 +20,17 @@ if (is_win) {
4879
 
4880
 group("base") {
4881
   public_deps = [
4882
+    ":rtc_base",
4883
     ":rtc_base_approved",
4884
     ":rtc_task_queue",
4885
   ]
4886
-  if (!build_with_mozilla) {
4887
-    public_deps += [
4888
-      ":rtc_base",
4889
-    ]
4890
-  }
4891
-
4892
-  if (is_android && !build_with_mozilla) {
4893
+  if (is_android) {
4894
     public_deps += [ ":base_java" ]
4895
   }
4896
 }
4897
 
4898
 config("rtc_base_approved_all_dependent_config") {
4899
-  if (is_mac && !(build_with_chromium || build_with_mozilla)) {
4900
+  if (is_mac && !build_with_chromium) {
4901
     libs = [ "Foundation.framework" ]  # needed for logging_mac.mm
4902
   }
4903
 }
4904
@@ -77,7 +72,7 @@ config("rtc_base_all_dependent_config") {
4905
   }
4906
 }
4907
 
4908
-if (is_linux && !build_with_chromium && !build_with_mozilla) {
4909
+if (is_linux && !build_with_chromium) {
4910
   # Provides the same functionality as the //crypto:platform target, which
4911
   # WebRTC cannot use as we don't sync src/crypto from Chromium.
4912
   group("linux_system_ssl") {
4913
@@ -89,11 +84,9 @@ if (is_linux && !build_with_chromium && !build_with_mozilla) {
4914
 
4915
 if (!rtc_build_ssl) {
4916
   config("external_ssl_library") {
4917
-    if (!build_with_mozilla) {
4918
-      assert(rtc_ssl_root != "",
4919
-             "You must specify rtc_ssl_root when rtc_build_ssl==0.")
4920
-      include_dirs = [ rtc_ssl_root ]
4921
-    }
4922
+    assert(rtc_ssl_root != "",
4923
+           "You must specify rtc_ssl_root when rtc_build_ssl==0.")
4924
+    include_dirs = [ rtc_ssl_root ]
4925
   }
4926
 }
4927
 
4928
@@ -201,19 +194,8 @@ rtc_static_library("rtc_base_approved") {
4929
 
4930
   if (is_win) {
4931
     sources += [ "file_win.cc" ]
4932
-
4933
-    if (build_with_mozilla) {
4934
-      sources += [ "win32.cc" ]
4935
-    }
4936
   }
4937
 
4938
-  if (is_mac) {
4939
-    if (build_with_mozilla) {
4940
-      sources += [ "macutils.cc" ]
4941
-    }
4942
-  }
4943
-
4944
-
4945
   if (build_with_chromium) {
4946
     # Dependency on chromium's logging (in //base).
4947
     deps += [ "//base:base" ]
4948
@@ -341,11 +323,6 @@ rtc_static_library("rtc_task_queue") {
4949
         "task_queue_posix.cc",
4950
       ]
4951
       all_dependent_configs = [ ":enable_libevent_config" ]
4952
-
4953
-      if (build_with_mozilla) {
4954
-        include_dirs = [ "$rtc_libevent_dir/include" ]
4955
-        include_dirs += [ "$rtc_libevent_dir/linux" ]
4956
-      }
4957
     } else {
4958
       if (is_mac || is_ios) {
4959
         sources += [
4960
@@ -966,7 +943,7 @@ if (rtc_include_tests) {
4961
   }
4962
 }
4963
 
4964
-if (is_android && !build_with_mozilla) {
4965
+if (is_android) {
4966
   android_library("base_java") {
4967
     java_files = [
4968
       "java/src/org/webrtc/Logging.java",
4969
diff --git media/webrtc/trunk/webrtc/base/base.gyp media/webrtc/trunk/webrtc/base/base.gyp
4970
new file mode 100644
4971
index 000000000000..4dd48f7d5f81
4972
--- /dev/null
4973
+++ media/webrtc/trunk/webrtc/base/base.gyp
4974
@@ -0,0 +1,682 @@
4975
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
4976
+#
4977
+# Use of this source code is governed by a BSD-style license
4978
+# that can be found in the LICENSE file in the root of the source
4979
+# tree. An additional intellectual property rights grant can be found
4980
+# in the file PATENTS.  All contributing project authors may
4981
+# be found in the AUTHORS file in the root of the source tree.
4982
+
4983
+{
4984
+  'includes': [ '../build/common.gypi', ],
4985
+  'conditions': [
4986
+    ['os_posix==1 and OS!="mac" and OS!="ios"', {
4987
+      'conditions': [
4988
+        ['sysroot!=""', {
4989
+          'variables': {
4990
+            'pkg-config': '../../../build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)"',
4991
+          },
4992
+        }, {
4993
+          'variables': {
4994
+            'pkg-config': 'pkg-config'
4995
+          },
4996
+        }],
4997
+      ],
4998
+    }],
4999
+  ],
5000
+  'targets': [
5001
+    {
5002
+      # The subset of rtc_base approved for use outside of libjingle.
5003
+      'target_name': 'rtc_base_approved',
5004
+      'type': 'static_library',
5005
+      'sources': [
5006
+        'arraysize.h',
5007
+        'array_view.h',
5008
+        'atomicops.h',
5009
+        'basictypes.h',
5010
+        'base64.cc',
5011
+        'base64.h',
5012
+        'bind.h',
5013
+        'bitbuffer.cc',
5014
+        'bitbuffer.h',
5015
+        'buffer.h',
5016
+        'bufferqueue.cc',
5017
+        'bufferqueue.h',
5018
+        'bytebuffer.cc',
5019
+        'bytebuffer.h',
5020
+        'byteorder.h',
5021
+        'checks.cc',
5022
+        'checks.h',
5023
+        'common.cc',
5024
+        'common.h',
5025
+        'constructormagic.h',
5026
+        'copyonwritebuffer.cc',
5027
+        'copyonwritebuffer.h',
5028
+        'criticalsection.cc',
5029
+        'criticalsection.h',
5030
+        'deprecation.h',
5031
+        'event.cc',
5032
+        'event.h',
5033
+        'event_tracer.cc',
5034
+        'event_tracer.h',
5035
+        'numerics/exp_filter.cc',
5036
+        'numerics/exp_filter.h',
5037
+        'numerics/percentile_filter.h',
5038
+        'file.cc',
5039
+        'file.h',
5040
+        'flags.cc',
5041
+        'flags.h',
5042
+        'format_macros.h',
5043
+        'function_view.h',
5044
+        'ignore_wundef.h',
5045
+        'location.h',
5046
+        'location.cc',
5047
+        'md5.cc',
5048
+        'md5.h',
5049
+        'md5digest.cc',
5050
+        'md5digest.h',
5051
+        'mod_ops.h',
5052
+        'onetimeevent.h',
5053
+        'optional.cc',
5054
+        'optional.h',
5055
+        'pathutils.cc',
5056
+        'pathutils.h',
5057
+        'platform_file.cc',
5058
+        'platform_file.h',
5059
+        'platform_thread.cc',
5060
+        'platform_thread.h',
5061
+        'platform_thread_types.h',
5062
+        'race_checker.cc',
5063
+        'race_checker.h',
5064
+        'random.cc',
5065
+        'random.h',
5066
+        'rate_statistics.cc',
5067
+        'rate_statistics.h',
5068
+        'rate_limiter.cc',
5069
+        'rate_limiter.h',
5070
+        'ratetracker.cc',
5071
+        'ratetracker.h',
5072
+        'refcount.h',
5073
+        'refcountedobject.h',
5074
+        'safe_compare.h',
5075
+        'safe_conversions.h',
5076
+        'safe_conversions_impl.h',
5077
+        'sanitizer.h',
5078
+        'scoped_ref_ptr.h',
5079
+        'stringencode.cc',
5080
+        'stringencode.h',
5081
+        'stringutils.cc',
5082
+        'stringutils.h',
5083
+        'swap_queue.h',
5084
+        'template_util.h',
5085
+        'thread_annotations.h',
5086
+        'thread_checker.h',
5087
+        'thread_checker_impl.cc',
5088
+        'thread_checker_impl.h',
5089
+        'timestampaligner.cc',
5090
+        'timestampaligner.h',
5091
+        'timeutils.cc',
5092
+        'timeutils.h',
5093
+        'trace_event.h',
5094
+        'type_traits.h',
5095
+      ],
5096
+      'conditions': [
5097
+        ['os_posix==1', {
5098
+          'sources': [
5099
+            'file_posix.cc',
5100
+          ],
5101
+        }],
5102
+        ['OS=="win"', {
5103
+          'sources': [
5104
+            'file_win.cc',
5105
+            'win32.cc',
5106
+            'win32.h',
5107
+          ],
5108
+        }],
5109
+        ['OS=="mac"', {
5110
+          'sources': [
5111
+            'macutils.cc',
5112
+            'macutils.h',
5113
+          ],
5114
+        }],
5115
+        ['build_with_chromium==1', {
5116
+          'dependencies': [
5117
+            '<(DEPTH)/base/base.gyp:base',
5118
+          ],
5119
+          'include_dirs': [
5120
+            '../../webrtc_overrides',
5121
+          ],
5122
+          'sources': [
5123
+            '../../webrtc_overrides/webrtc/base/logging.cc',
5124
+            '../../webrtc_overrides/webrtc/base/logging.h',
5125
+          ],
5126
+        }, {
5127
+          'sources': [
5128
+            'logging.cc',
5129
+            'logging.h',
5130
+            'logging_mac.mm',
5131
+          ],
5132
+        }],
5133
+        ['OS=="mac" and build_with_chromium==0', {
5134
+          'all_dependent_settings': {
5135
+            'xcode_settings': {
5136
+              'OTHER_LDFLAGS': [
5137
+                # needed for logging_mac.mm
5138
+                '-framework Foundation',
5139
+              ],
5140
+            },
5141
+          },
5142
+        }], # OS=="mac" and build_with_chromium==0
5143
+        ['OS=="android"', {
5144
+          'link_settings': {
5145
+            'libraries': [
5146
+              '-llog',
5147
+            ],
5148
+          },
5149
+        }],
5150
+      ],
5151
+    },
5152
+    {
5153
+      'target_name': 'rtc_task_queue',
5154
+      'type': 'static_library',
5155
+      'dependencies': [
5156
+        'rtc_base_approved',
5157
+      ],
5158
+      'sources': [
5159
+        'sequenced_task_checker.h',
5160
+        'sequenced_task_checker_impl.cc',
5161
+        'sequenced_task_checker_impl.h',
5162
+        'weak_ptr.cc',
5163
+        'weak_ptr.h',
5164
+      ],
5165
+      'conditions': [
5166
+        ['build_with_chromium==1', {
5167
+          'include_dirs': [
5168
+            '../../webrtc_overrides'
5169
+          ],
5170
+          'sources' : [
5171
+            '../../webrtc_overrides/webrtc/base/task_queue.cc',
5172
+            '../../webrtc_overrides/webrtc/base/task_queue.h',
5173
+          ]
5174
+        } , {
5175
+          # If not build for chromium, use our own implementation.
5176
+          'sources' : [
5177
+            'task_queue.h',
5178
+            'task_queue_posix.h',
5179
+          ],
5180
+          'conditions': [
5181
+            #TODO: no libevent.gyp
5182
+            ['build_libevent==1', {
5183
+              'dependencies': [
5184
+                '<(DEPTH)/base/third_party/libevent/libevent.gyp:libevent',
5185
+              ],
5186
+            } , {
5187
+              'include_dirs': [
5188
+                '$(MOZ_LIBEVENT_CFLAGS)',
5189
+                '<(libevent_dir)/',
5190
+                '<(libevent_dir)/../',
5191
+                '<(libevent_dir)/include/',
5192
+              ],
5193
+              'conditions': [
5194
+                ['OS=="mac" or OS=="ios"', {
5195
+                  'include_dirs': [
5196
+                    '<(libevent_dir)/mac/',
5197
+                  ],
5198
+                }],
5199
+                ['OS=="linux"', {
5200
+                  'include_dirs': [
5201
+                    '<(libevent_dir)/linux/',
5202
+                  ],
5203
+                }],
5204
+                ['os_bsd==1', {
5205
+                  'include_dirs': [
5206
+                    '<(libevent_dir)/bsd/',
5207
+                  ],
5208
+                }],
5209
+                ['OS=="win"', {
5210
+                  'include_dirs': [
5211
+                    '<(libevent_dir)/WIN32-Code/',
5212
+                  ],
5213
+                }],
5214
+                ['OS=="android"', {
5215
+                  'include_dirs': [
5216
+                    '<(libevent_dir)/android/',
5217
+                  ],
5218
+                }],
5219
+              ],
5220
+            }],
5221
+            ['enable_libevent==1', {
5222
+              'sources': [
5223
+                'task_queue_libevent.cc',
5224
+                'task_queue_posix.cc',
5225
+              ],
5226
+              'defines': [ 'WEBRTC_BUILD_LIBEVENT',  ],
5227
+              'all_dependent_settings': {
5228
+                'defines': [ 'WEBRTC_BUILD_LIBEVENT' ],
5229
+              },
5230
+            }, {
5231
+              # If not libevent, fall back to the other task queues.
5232
+              'conditions': [
5233
+                ['OS=="mac" or OS=="ios"', {
5234
+                 'sources': [
5235
+                   'task_queue_gcd.cc',
5236
+                   'task_queue_posix.cc',
5237
+                 ],
5238
+                }],
5239
+                ['OS=="win"', {
5240
+                  'sources': [ 'task_queue_win.cc' ],
5241
+                }]
5242
+              ],
5243
+            }],
5244
+          ]
5245
+        }],
5246
+      ],
5247
+    },
5248
+    {
5249
+      'target_name': 'rtc_base',
5250
+      'type': 'static_library',
5251
+      'dependencies': [
5252
+        '../common.gyp:webrtc_common',
5253
+        'rtc_base_approved',
5254
+      ],
5255
+      'export_dependent_settings': [
5256
+        'rtc_base_approved',
5257
+      ],
5258
+      'defines': [
5259
+        'FEATURE_ENABLE_SSL',
5260
+        'SSL_USE_OPENSSL',
5261
+        'HAVE_OPENSSL_SSL_H',
5262
+        'LOGGING=1',
5263
+      ],
5264
+      'sources': [
5265
+        'applefilesystem.mm',
5266
+        'asyncinvoker.cc',
5267
+        'asyncinvoker.h',
5268
+        'asyncinvoker-inl.h',
5269
+        'asyncpacketsocket.cc',
5270
+        'asyncpacketsocket.h',
5271
+        'asyncresolverinterface.cc',
5272
+        'asyncresolverinterface.h',
5273
+        'asyncsocket.cc',
5274
+        'asyncsocket.h',
5275
+        'asynctcpsocket.cc',
5276
+        'asynctcpsocket.h',
5277
+        'asyncudpsocket.cc',
5278
+        'asyncudpsocket.h',
5279
+        'autodetectproxy.cc',
5280
+        'autodetectproxy.h',
5281
+        'crc32.cc',
5282
+        'crc32.h',
5283
+        'cryptstring.cc',
5284
+        'cryptstring.h',
5285
+        'diskcache.cc',
5286
+        'diskcache.h',
5287
+        'filerotatingstream.cc',
5288
+        'filerotatingstream.h',
5289
+        'fileutils.cc',
5290
+        'fileutils.h',
5291
+        'firewallsocketserver.cc',
5292
+        'firewallsocketserver.h',
5293
+        'gunit_prod.h',
5294
+        'helpers.cc',
5295
+        'helpers.h',
5296
+        'httpbase.cc',
5297
+        'httpbase.h',
5298
+        'httpclient.cc',
5299
+        'httpclient.h',
5300
+        'httpcommon-inl.h',
5301
+        'httpcommon.cc',
5302
+        'httpcommon.h',
5303
+        'ipaddress.cc',
5304
+        'ipaddress.h',
5305
+        'linked_ptr.h',
5306
+        'messagedigest.cc',
5307
+        'messagedigest.h',
5308
+        'messagehandler.cc',
5309
+        'messagehandler.h',
5310
+        'messagequeue.cc',
5311
+        'messagequeue.h',
5312
+        'nethelpers.cc',
5313
+        'nethelpers.h',
5314
+        'network.cc',
5315
+        'network.h',
5316
+        'networkmonitor.cc',
5317
+        'networkmonitor.h',
5318
+        'nullsocketserver.cc',
5319
+        'nullsocketserver.h',
5320
+        'openssl.h',
5321
+        'openssladapter.cc',
5322
+        'openssladapter.h',
5323
+        'openssldigest.cc',
5324
+        'openssldigest.h',
5325
+        'opensslidentity.cc',
5326
+        'opensslidentity.h',
5327
+        'opensslstreamadapter.cc',
5328
+        'opensslstreamadapter.h',
5329
+        'physicalsocketserver.cc',
5330
+        'physicalsocketserver.h',
5331
+        'proxydetect.cc',
5332
+        'proxydetect.h',
5333
+        'proxyinfo.cc',
5334
+        'proxyinfo.h',
5335
+        'ratelimiter.cc',
5336
+        'ratelimiter.h',
5337
+        'rtccertificate.cc',
5338
+        'rtccertificate.h',
5339
+        'rtccertificategenerator.cc',
5340
+        'rtccertificategenerator.h',
5341
+        'sha1.cc',
5342
+        'sha1.h',
5343
+        'sha1digest.cc',
5344
+        'sha1digest.h',
5345
+        'sharedexclusivelock.cc',
5346
+        'sharedexclusivelock.h',
5347
+        'signalthread.cc',
5348
+        'signalthread.h',
5349
+        'sigslot.cc',
5350
+        'sigslot.h',
5351
+        'sigslotrepeater.h',
5352
+        'socket.h',
5353
+        'socketadapters.cc',
5354
+        'socketadapters.h',
5355
+        'socketaddress.cc',
5356
+        'socketaddress.h',
5357
+        'socketaddresspair.cc',
5358
+        'socketaddresspair.h',
5359
+        'socketfactory.h',
5360
+        'socketpool.cc',
5361
+        'socketpool.h',
5362
+        'socketserver.h',
5363
+        'socketstream.cc',
5364
+        'socketstream.h',
5365
+        'ssladapter.cc',
5366
+        'ssladapter.h',
5367
+        'sslfingerprint.cc',
5368
+        'sslfingerprint.h',
5369
+        'sslidentity.cc',
5370
+        'sslidentity.h',
5371
+        'sslsocketfactory.cc',
5372
+        'sslsocketfactory.h',
5373
+        'sslstreamadapter.cc',
5374
+        'sslstreamadapter.h',
5375
+        'stream.cc',
5376
+        'stream.h',
5377
+        'task.cc',
5378
+        'task.h',
5379
+        'taskparent.cc',
5380
+        'taskparent.h',
5381
+        'taskrunner.cc',
5382
+        'taskrunner.h',
5383
+        'thread.cc',
5384
+        'thread.h',
5385
+      ],
5386
+      # TODO(henrike): issue 3307, make rtc_base build without disabling
5387
+      # these flags.
5388
+      'cflags!': [
5389
+        '-Wextra',
5390
+        '-Wall',
5391
+      ],
5392
+      'direct_dependent_settings': {
5393
+        'defines': [
5394
+          'FEATURE_ENABLE_SSL',
5395
+          'SSL_USE_OPENSSL',
5396
+          'HAVE_OPENSSL_SSL_H',
5397
+        ],
5398
+      },
5399
+      'conditions': [
5400
+        ['build_with_chromium==1', {
5401
+          'include_dirs': [
5402
+            '../../webrtc_overrides',
5403
+            '../../boringssl/src/include',
5404
+          ],
5405
+          'conditions': [
5406
+            ['OS=="win"', {
5407
+              'sources': [
5408
+                '../../webrtc_overrides/webrtc/base/win32socketinit.cc',
5409
+              ],
5410
+            }],
5411
+          ],
5412
+          'defines': [
5413
+            'NO_MAIN_THREAD_WRAPPING',
5414
+          ],
5415
+          'direct_dependent_settings': {
5416
+            'defines': [
5417
+              'NO_MAIN_THREAD_WRAPPING',
5418
+            ],
5419
+          },
5420
+        }, {
5421
+          'sources': [
5422
+            'callback.h',
5423
+            'fileutils_mock.h',
5424
+            'httpserver.cc',
5425
+            'httpserver.h',
5426
+            'json.cc',
5427
+            'json.h',
5428
+            'logsinks.cc',
5429
+            'logsinks.h',
5430
+            'mathutils.h',
5431
+            'natserver.cc',
5432
+            'natserver.h',
5433
+            'natsocketfactory.cc',
5434
+            'natsocketfactory.h',
5435
+            'nattypes.cc',
5436
+            'nattypes.h',
5437
+            'optionsfile.cc',
5438
+            'optionsfile.h',
5439
+            'proxyserver.cc',
5440
+            'proxyserver.h',
5441
+            'referencecountedsingletonfactory.h',
5442
+            'rollingaccumulator.h',
5443
+            'scopedptrcollection.h',
5444
+            'sslconfig.h',
5445
+            'sslroots.h',
5446
+            'testbase64.h',
5447
+            'testclient.cc',
5448
+            'testclient.h',
5449
+            'transformadapter.cc',
5450
+            'transformadapter.h',
5451
+            'virtualsocketserver.cc',
5452
+            'virtualsocketserver.h',
5453
+            'window.h',
5454
+            'windowpicker.h',
5455
+            'windowpickerfactory.h',
5456
+          ],
5457
+          'conditions': [
5458
+            ['build_json==1', {
5459
+              'dependencies': [
5460
+                '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
5461
+              ],
5462
+            }, {
5463
+              'include_dirs': [
5464
+                '<(json_root)',
5465
+              ],
5466
+              'defines': [
5467
+                # When defined changes the include path for json.h to where it
5468
+                # is expected to be when building json outside of the standalone
5469
+                # build.
5470
+                'WEBRTC_EXTERNAL_JSON',
5471
+              ],
5472
+            }],
5473
+            ['OS=="mac"', {
5474
+              'sources': [
5475
+                'macasyncsocket.cc',
5476
+                'macasyncsocket.h',
5477
+                'maccocoasocketserver.h',
5478
+                'maccocoasocketserver.mm',
5479
+                'macsocketserver.cc',
5480
+                'macsocketserver.h',
5481
+                'macwindowpicker.cc',
5482
+                'macwindowpicker.h',
5483
+              ],
5484
+            }],
5485
+            ['OS=="win"', {
5486
+              'sources': [
5487
+                'diskcache_win32.cc',
5488
+                'diskcache_win32.h',
5489
+                'win32regkey.cc',
5490
+                'win32regkey.h',
5491
+                'win32socketinit.cc',
5492
+                'win32socketinit.h',
5493
+                'win32socketserver.cc',
5494
+                'win32socketserver.h',
5495
+              ],
5496
+            }],
5497
+            ['OS=="win" and clang==1', {
5498
+              'msvs_settings': {
5499
+                'VCCLCompilerTool': {
5500
+                  'AdditionalOptions': [
5501
+                    # Disable warnings failing when compiling with Clang on Windows.
5502
+                    # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
5503
+                    '-Wno-sign-compare',
5504
+                    '-Wno-missing-braces',
5505
+                  ],
5506
+                },
5507
+              },
5508
+            }],
5509
+          ],  # conditions
5510
+        }],  # build_with_chromium==0
5511
+        ['OS=="android"', {
5512
+          'sources': [
5513
+            'ifaddrs-android.cc',
5514
+            'ifaddrs-android.h',
5515
+          ],
5516
+          'link_settings': {
5517
+            'libraries': [
5518
+              '-llog',
5519
+              '-lGLESv2',
5520
+            ],
5521
+          },
5522
+        }],
5523
+        ['(OS=="mac" or OS=="ios") and nacl_untrusted_build==0', {
5524
+          'sources': [
5525
+            'maccocoathreadhelper.h',
5526
+            'maccocoathreadhelper.mm',
5527
+            'macconversion.cc',
5528
+            'macconversion.h',
5529
+            'macifaddrs_converter.cc',
5530
+            'scoped_autorelease_pool.h',
5531
+            'scoped_autorelease_pool.mm',
5532
+          ],
5533
+        }],
5534
+        ['OS=="ios"', {
5535
+          'all_dependent_settings': {
5536
+            'xcode_settings': {
5537
+              'OTHER_LDFLAGS': [
5538
+                '-framework CFNetwork',
5539
+                '-framework Foundation',
5540
+                '-framework Security',
5541
+                '-framework SystemConfiguration',
5542
+                '-framework UIKit',
5543
+              ],
5544
+            },
5545
+          },
5546
+        }],
5547
+        ['use_x11==1', {
5548
+          'sources': [
5549
+          ],
5550
+          'link_settings': {
5551
+            'libraries': [
5552
+              '-ldl',
5553
+              '-lrt',
5554
+              '-lXext',
5555
+              '-lX11',
5556
+              '-lXcomposite',
5557
+              '-lXrender',
5558
+            ],
5559
+          },
5560
+        }],
5561
+        ['OS=="linux"', {
5562
+          'link_settings': {
5563
+            'libraries': [
5564
+              '-ldl',
5565
+              '-lrt',
5566
+            ],
5567
+          },
5568
+        }],
5569
+        ['OS=="mac"', {
5570
+# moved by mozilla
5571
+#          'sources': [
5572
+#            'macutils.cc',
5573
+#            'macutils.h',
5574
+#          ],
5575
+          'all_dependent_settings': {
5576
+            'link_settings': {
5577
+              'xcode_settings': {
5578
+                'OTHER_LDFLAGS': [
5579
+                  '-framework Cocoa',
5580
+                  '-framework Foundation',
5581
+                  '-framework IOKit',
5582
+                  '-framework Security',
5583
+                  '-framework SystemConfiguration',
5584
+                ],
5585
+              },
5586
+            },
5587
+          },
5588
+        }],
5589
+        ['OS=="win" and nacl_untrusted_build==0', {
5590
+          'sources': [
5591
+# moved by mozilla
5592
+#            'win32.cc',
5593
+#            'win32.h',
5594
+            'win32filesystem.cc',
5595
+            'win32filesystem.h',
5596
+            'win32securityerrors.cc',
5597
+            'win32window.cc',
5598
+            'win32window.h',
5599
+            'win32windowpicker.cc',
5600
+            'win32windowpicker.h',
5601
+            'winfirewall.cc',
5602
+            'winfirewall.h',
5603
+            'winping.cc',
5604
+            'winping.h',
5605
+          ],
5606
+          'link_settings': {
5607
+            'libraries': [
5608
+              '-lcrypt32.lib',
5609
+              '-liphlpapi.lib',
5610
+              '-lsecur32.lib',
5611
+            ],
5612
+          },
5613
+          # Suppress warnings about WIN32_LEAN_AND_MEAN.
5614
+          'msvs_disabled_warnings': [4005, 4703],
5615
+          'defines': [
5616
+            '_CRT_NONSTDC_NO_DEPRECATE',
5617
+          ],
5618
+        }],
5619
+        ['os_posix==1', {
5620
+          'sources': [
5621
+            'ifaddrs_converter.cc',
5622
+            'ifaddrs_converter.h',
5623
+            'unixfilesystem.cc',
5624
+            'unixfilesystem.h',
5625
+          ],
5626
+          'configurations': {
5627
+            'Debug_Base': {
5628
+              'defines': [
5629
+                # Chromium's build/common.gypi defines this for all posix
5630
+                # _except_ for ios & mac.  We want it there as well, e.g.
5631
+                # because ASSERT and friends trigger off of it.
5632
+                '_DEBUG',
5633
+              ],
5634
+            },
5635
+          }
5636
+        }],
5637
+        ['build_ssl==1', {
5638
+          'dependencies': [
5639
+            '<(DEPTH)/third_party/boringssl/boringssl.gyp:boringssl',
5640
+          ],
5641
+        }, {
5642
+          'include_dirs': [
5643
+            '<(ssl_root)',
5644
+          ],
5645
+        }],
5646
+      ],
5647
+    },
5648
+    {
5649
+     'target_name': 'gtest_prod',
5650
+      'type': 'static_library',
5651
+      'sources': [
5652
+        'gtest_prod_util.h',
5653
+      ],
5654
+    },
5655
+  ],
5656
+}
5657
diff --git media/webrtc/trunk/webrtc/base/base_tests.gyp media/webrtc/trunk/webrtc/base/base_tests.gyp
5658
new file mode 100644
5659
index 000000000000..e1d5bc04963a
5660
--- /dev/null
5661
+++ media/webrtc/trunk/webrtc/base/base_tests.gyp
5662
@@ -0,0 +1,48 @@
5663
+# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
5664
+#
5665
+# Use of this source code is governed by a BSD-style license
5666
+# that can be found in the LICENSE file in the root of the source
5667
+# tree. An additional intellectual property rights grant can be found
5668
+# in the file PATENTS.  All contributing project authors may
5669
+# be found in the AUTHORS file in the root of the source tree.
5670
+{
5671
+  'includes': [ '../build/common.gypi', ],
5672
+  'targets': [
5673
+    {
5674
+      'target_name': 'rtc_base_tests_utils',
5675
+      'type': 'static_library',
5676
+      'sources': [
5677
+        'unittest_main.cc',
5678
+        # Also use this as a convenient dumping ground for misc files that are
5679
+        # included by multiple targets below.
5680
+        'fakeclock.cc',
5681
+        'fakeclock.h',
5682
+        'fakenetwork.h',
5683
+        'fakesslidentity.h',
5684
+        'faketaskrunner.h',
5685
+        'gunit.h',
5686
+        'testbase64.h',
5687
+        'testechoserver.h',
5688
+        'testutils.h',
5689
+        'timedelta.h',
5690
+      ],
5691
+      'defines': [
5692
+        'GTEST_RELATIVE_PATH',
5693
+      ],
5694
+      'dependencies': [
5695
+        'base.gyp:rtc_base',
5696
+        '<(DEPTH)/testing/gtest.gyp:gtest',
5697
+        '<(webrtc_root)/test/test.gyp:field_trial',
5698
+        '<(webrtc_root)/test/test.gyp:test_support',
5699
+      ],
5700
+      'direct_dependent_settings': {
5701
+        'defines': [
5702
+          'GTEST_RELATIVE_PATH',
5703
+        ],
5704
+      },
5705
+      'export_dependent_settings': [
5706
+        '<(DEPTH)/testing/gtest.gyp:gtest',
5707
+      ],
5708
+    },
5709
+  ],
5710
+}
5711
diff --git media/webrtc/trunk/webrtc/base/sigslot.h media/webrtc/trunk/webrtc/base/sigslot.h
5712
index 42be10f3728d..079e3aeaa6cf 100644
5713
--- media/webrtc/trunk/webrtc/base/sigslot.h
5714
+++ media/webrtc/trunk/webrtc/base/sigslot.h
5715
@@ -2803,5 +2803,9 @@ namespace sigslot {
5716
 
5717
 }; // namespace sigslot
5718
 
5719
+#endif // TALK_BASE_SIGSLOT_H__
5720
+#endif // TALK_BASE_SIGSLOT_H__
5721
+#endif // TALK_BASE_SIGSLOT_H__
5722
+#endif // TALK_BASE_SIGSLOT_H__
5723
 #endif // TALK_BASE_SIGSLOT_H__
5724
 #endif // WEBRTC_BASE_SIGSLOT_H__
5725
diff --git media/webrtc/trunk/webrtc/build/arm_neon.gypi media/webrtc/trunk/webrtc/build/arm_neon.gypi
5726
new file mode 100644
5727
index 000000000000..41dd50f19ad0
5728
--- /dev/null
5729
+++ media/webrtc/trunk/webrtc/build/arm_neon.gypi
5730
@@ -0,0 +1,60 @@
5731
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
5732
+#
5733
+# Use of this source code is governed by a BSD-style license
5734
+# that can be found in the LICENSE file in the root of the source
5735
+# tree. An additional intellectual property rights grant can be found
5736
+# in the file PATENTS.  All contributing project authors may
5737
+# be found in the AUTHORS file in the root of the source tree.
5738
+
5739
+# This file sets correct neon flags. Include it if you want to build
5740
+# source with neon intrinsics.
5741
+# To use this, create a gyp target with the following form:
5742
+# {
5743
+#   'target_name': 'my_lib',
5744
+#   'type': 'static_library',
5745
+#   'sources': [
5746
+#     'foo.c',
5747
+#     'bar.cc',
5748
+#   ],
5749
+#   'includes': ['path/to/this/gypi/file'],
5750
+# }
5751
+
5752
+{
5753
+  'cflags!': [
5754
+    '-mfpu=vfpv3-d16',
5755
+  ],
5756
+  'cflags_mozilla!': [
5757
+    '-mfpu=vfpv3-d16',
5758
+  ],
5759
+  'asflags!': [
5760
+    '-mfpu=vfpv3-d16',
5761
+  ],
5762
+  'asflags_mozilla!': [
5763
+    '-mfpu=vfpv3-d16',
5764
+  ],
5765
+  'conditions': [
5766
+    # "-mfpu=neon" is not required for arm64 in GCC.
5767
+    ['target_arch!="arm64"', {
5768
+      'cflags': [
5769
+        '-mfpu=neon',
5770
+      ],
5771
+      'cflags_mozilla': [
5772
+        '-mfpu=neon',
5773
+      ],
5774
+      'asflags': [
5775
+        '-mfpu=neon',
5776
+      ],
5777
+      'asflags_mozilla': [
5778
+        '-mfpu=neon',
5779
+      ],
5780
+    }],
5781
+    # Disable GCC LTO on NEON targets due to compiler bug.
5782
+    # TODO(fdegans): Enable this. See crbug.com/408997.
5783
+    ['clang==0 and use_lto==1', {
5784
+      'cflags!': [
5785
+        '-flto',
5786
+        '-ffat-lto-objects',
5787
+      ],
5788
+    }],
5789
+  ],
5790
+}
5791
diff --git media/webrtc/trunk/webrtc/build/chromium_common.gypi media/webrtc/trunk/webrtc/build/chromium_common.gypi
5792
new file mode 100644
5793
index 000000000000..c8e613497f56
5794
--- /dev/null
5795
+++ media/webrtc/trunk/webrtc/build/chromium_common.gypi
5796
@@ -0,0 +1,5973 @@
5797
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
5798
+#
5799
+# Use of this source code is governed by a BSD-style license
5800
+# that can be found in the LICENSE file in the root of the source
5801
+# tree. An additional intellectual property rights grant can be found
5802
+# in the file PATENTS.  All contributing project authors may
5803
+# be found in the AUTHORS file in the root of the source tree.
5804
+
5805
+# This ia copy of Chromium's common.gypi before it was deleted.
5806
+# TODO(kjellander): Clean this up as soon we've stopped using GYP entirely.
5807
+{
5808
+  # Variables expected to be overriden on the GYP command line (-D) or by
5809
+  # ~/.gyp/include.gypi.
5810
+  'variables': {
5811
+    # Putting a variables dict inside another variables dict looks kind of
5812
+    # weird.  This is done so that 'host_arch', 'chromeos', etc are defined as
5813
+    # variables within the outer variables dict here.  This is necessary
5814
+    # to get these variables defined for the conditions within this variables
5815
+    # dict that operate on these variables.
5816
+    'variables': {
5817
+      'variables': {
5818
+        'variables': {
5819
+          'variables': {
5820
+            # Whether we're building a ChromeOS build.
5821
+            'chromeos%': 0,
5822
+            # Whether we're building the cast (chromecast) shell
5823
+            'chromecast%': 0,
5824
+            # Whether or not we are using the Aura windowing framework.
5825
+            'use_aura%': 0,
5826
+            # Whether or not we are building the Ash shell.
5827
+            'use_ash%': 0,
5828
+            # Whether or not we are using CRAS, the ChromeOS Audio Server.
5829
+            'use_cras%': 0,
5830
+            # Use a raw surface abstraction.
5831
+            'use_ozone%': 0,
5832
+            # Configure the build for small devices. See crbug.com/318413
5833
+            'embedded%': 0,
5834
+            'conditions': [
5835
+              # Compute the architecture that we're building on.
5836
+              ['OS=="win" or OS=="ios"', {
5837
+                'host_arch%': 'ia32',
5838
+              }, {
5839
+                'host_arch%': '<!pymod_do_main(detect_host_arch)',
5840
+              }],
5841
+            ],
5842
+          },
5843
+          # Copy conditionally-set variables out one scope.
5844
+          'chromeos%': '<(chromeos)',
5845
+          'chromecast%': '<(chromecast)',
5846
+          'use_aura%': '<(use_aura)',
5847
+          'use_ash%': '<(use_ash)',
5848
+          'use_cras%': '<(use_cras)',
5849
+          'use_ozone%': '<(use_ozone)',
5850
+          'embedded%': '<(embedded)',
5851
+          'host_arch%': '<(host_arch)',
5852
+          # Whether we are using Views Toolkit
5853
+          'toolkit_views%': 0,
5854
+          # Use the PCI lib to collect GPU information.
5855
+          'use_libpci%': 1,
5856
+          # Use OpenSSL for representing certificates. When targeting Android,
5857
+          # the platform certificate library is used for certificate
5858
+          # verification. On other targets, this flag also enables OpenSSL for
5859
+          # certificate verification, but this configuration is unsupported.
5860
+          'use_openssl_certs%': 0,
5861
+          # Whether or not we use external popup menu.
5862
+          'use_external_popup_menu%': 0,
5863
+          # Disable viewport meta tag by default.
5864
+          'enable_viewport%': 0,
5865
+          # Enable HiDPI support.
5866
+          'enable_hidpi%': 0,
5867
+          # Enable Wayland display server support.
5868
+          'enable_wayland_server%' : 0,
5869
+          # Enable Wi-Fi Display support.
5870
+          # WARNING: This enables MPEG Transport Stream (MPEG-TS) encoding!
5871
+          'enable_wifi_display%' : 0,
5872
+          # By default we build against a stable sysroot image to avoid
5873
+          # depending on the packages installed on the local machine. Set this
5874
+          # to 0 to build against locally installed headers and libraries (e.g.
5875
+          # if packaging for a linux distro)
5876
+          'use_sysroot%': 1,
5877
+          # Override buildtype to select the desired build flavor.
5878
+          # Dev - everyday build for development/testing
5879
+          # Official - release build (generally implies additional processing)
5880
+          # TODO(mmoss) Once 'buildtype' is fully supported (e.g. Windows gyp
5881
+          # conversion is done), some of the things which are now controlled by
5882
+          # 'branding', such as symbol generation, will need to be refactored
5883
+          # based on 'buildtype' (i.e. we don't care about saving symbols for
5884
+          # non-Official # builds).
5885
+          'buildtype%': 'Dev',
5886
+          # Override branding to select the desired branding flavor.
5887
+          'branding%': 'Chromium',
5888
+          'conditions': [
5889
+            # Windows and Linux use Aura, but not Ash.
5890
+            ['OS=="win" or OS=="linux" or OS=="openbsd" or OS=="freebsd"', {
5891
+              'use_aura%': 1,
5892
+            }],
5893
+            # ChromeOS uses Ash.
5894
+            ['chromeos', {
5895
+              'use_ash%': 1,
5896
+            }],
5897
+            ['chromecast==1', {
5898
+              'use_libpci': 0,
5899
+              'conditions': [
5900
+                ['OS!="android"', {
5901
+                  'embedded%': 1,
5902
+                  'use_ozone%': 1,
5903
+                }],
5904
+              ],
5905
+            }],
5906
+            # Ozone uses Aura.
5907
+            ['use_ozone==1', {
5908
+              'use_aura%': 1,
5909
+            }],
5910
+            # Whether we're a traditional desktop unix.
5911
+            ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris") and chromeos==0', {
5912
+              'desktop_linux%': 1,
5913
+            }, {
5914
+              'desktop_linux%': 0,
5915
+            }],
5916
+            # Embedded implies ozone.
5917
+            ['embedded==1', {
5918
+              'use_ozone%': 1,
5919
+            }],
5920
+            # Mac and Android use external popup menu.
5921
+            ['OS=="mac" or OS=="android"', {
5922
+              'use_external_popup_menu%': 1,
5923
+            }],
5924
+            ['OS=="android"', {
5925
+              'target_arch%': 'arm',
5926
+            }, {
5927
+              # Default architecture we're building for is the architecture we're
5928
+              # building on, and possibly sub-architecture (for iOS builds).
5929
+              'target_arch%': '<(host_arch)',
5930
+            }],
5931
+          ],
5932
+        },
5933
+        # Copy conditionally-set variables out one scope.
5934
+        'chromeos%': '<(chromeos)',
5935
+        'chromecast%': '<(chromecast)',
5936
+        'desktop_linux%': '<(desktop_linux)',
5937
+        'use_aura%': '<(use_aura)',
5938
+        'use_ash%': '<(use_ash)',
5939
+        'use_cras%': '<(use_cras)',
5940
+        'use_ozone%': '<(use_ozone)',
5941
+        'embedded%': '<(embedded)',
5942
+        'use_libpci%': '<(use_libpci)',
5943
+        'use_openssl_certs%': '<(use_openssl_certs)',
5944
+        'use_external_popup_menu%': '<(use_external_popup_menu)',
5945
+        'enable_viewport%': '<(enable_viewport)',
5946
+        'enable_hidpi%': '<(enable_hidpi)',
5947
+        'enable_wayland_server%': '<(enable_wayland_server)',
5948
+        'enable_wifi_display%': '<(enable_wifi_display)',
5949
+        'buildtype%': '<(buildtype)',
5950
+        'branding%': '<(branding)',
5951
+        'branding_path_component%': '<(branding)',
5952
+        'host_arch%': '<(host_arch)',
5953
+        'target_arch%': '<(target_arch)',
5954
+        'use_sysroot%': '<(use_sysroot)',
5955
+        # Set to true to instrument the code with function call logger.
5956
+        # See src/third_party/cygprofile/cyg-profile.cc for details.
5957
+        'order_profiling%': 0,
5958
+        'target_subarch%': '',
5959
+        # The channel to build on Android: stable, beta, dev, canary, or
5960
+        # default. "default" should be used on non-official builds.
5961
+        'android_channel%': 'default',
5962
+        # Set ARM architecture version.
5963
+        'arm_version%': 7,
5964
+        # Use aurax11 for clipboard implementation. This is true on linux_aura.
5965
+        'use_clipboard_aurax11%': 0,
5966
+        # goma settings.
5967
+        # 1 to use goma.
5968
+        # If no gomadir is set, it uses the default gomadir.
5969
+        'use_goma%': 0,
5970
+        'gomadir%': '',
5971
+        'chroot_cmd%': '',
5972
+        # The system libdir used for this ABI.
5973
+        'system_libdir%': 'lib',
5974
+        # Default MIPS arch variant. This is set in the conditions block
5975
+        # below for MIPS targets.
5976
+        'mips_arch_variant%': '',
5977
+        # MIPS DSP ASE revision. Possible values are:
5978
+        #   0: unavailable
5979
+        #   1: revision 1
5980
+        #   2: revision 2
5981
+        'mips_dsp_rev%': 0,
5982
+        # MIPS SIMD Arch compilation flag.
5983
+        'mips_msa%': 1,
5984
+        'conditions': [
5985
+          ['branding == "Chrome"', {
5986
+            'branding_path_component%': 'google_chrome',
5987
+          }],
5988
+          ['branding == "Chromium"', {
5989
+            'branding_path_component%': 'chromium',
5990
+          }],
5991
+          # Ash needs Aura.
5992
+          ['use_aura==0', {
5993
+            'use_ash%': 0,
5994
+          }],
5995
+          # Set default value of toolkit_views based on OS.
5996
+          ['OS=="mac" or OS=="win" or chromeos==1 or use_aura==1', {
5997
+            'toolkit_views%': 1,
5998
+          }, {
5999
+            'toolkit_views%': 0,
6000
+          }],
6001
+          # Embedded builds use aura without ash or views.
6002
+          ['embedded==1', {
6003
+            'use_aura%': 1,
6004
+            'use_ash%': 0,
6005
+            'toolkit_views%': 0,
6006
+          }],
6007
+          # Chromecast builds on x86 Linux should default to desktop builds.
6008
+          ['chromecast==1 and OS=="linux" and (target_arch=="ia32" or target_arch=="x64")', {
6009
+            'is_cast_desktop_build%': 1,
6010
+          }, {
6011
+            'is_cast_desktop_build%': 0,
6012
+          }],
6013
+          # Enable HiDPI on Mac OS, Windows and Linux (including Chrome OS).
6014
+          ['OS=="mac" or OS=="win" or OS=="linux" or OS=="openbsd" or OS=="freebsd"', {
6015
+            'enable_hidpi%': 1,
6016
+          }],
6017
+          # Enable App Launcher on ChromeOS only.
6018
+          ['chromeos==1', {
6019
+            'enable_app_list%': 1,
6020
+          }, {
6021
+            'enable_app_list%': 0,
6022
+          }],
6023
+          ['use_aura==1 and OS!="android"', {
6024
+            'use_default_render_theme%': 1,
6025
+          }, {
6026
+            'use_default_render_theme%': 0,
6027
+          }],
6028
+          ['use_ozone==1', {
6029
+            'use_ozone_evdev%': 1,
6030
+          }, {
6031
+            'use_ozone_evdev%': 0,
6032
+          }],
6033
+          # Set default gomadir.
6034
+          ['OS=="win"', {
6035
+            'gomadir': 'c:\\goma\\goma-win64',
6036
+          }, {
6037
+            'gomadir': '<!(/bin/echo -n ${HOME}/goma)',
6038
+          }],
6039
+          # Set the default "target_subarch" on iOS. Valid values are "arm32",
6040
+          # "arm64" and "both" (meaning a fat binary).
6041
+          ['OS=="ios"', {
6042
+            'target_subarch%': 'arm64',
6043
+          }],
6044
+          # Set arch variants for MIPS platforms.
6045
+          ['target_arch=="mips64el"', {
6046
+            'conditions': [
6047
+              ['OS=="android"', {
6048
+                'mips_arch_variant%': 'r6',
6049
+              }, {
6050
+                'mips_arch_variant%': 'r2',
6051
+              }],
6052
+            ],
6053
+          }],
6054
+          ['target_arch=="mipsel"', {
6055
+            'mips_arch_variant%': 'r1',
6056
+          }],
6057
+          # The system root for linux builds.
6058
+          ['OS=="linux" and chromeos==0 and use_sysroot==1', {
6059
+            # sysroot needs to be an absolute path otherwise it generates
6060
+            # incorrect results when passed to pkg-config
6061
+            'conditions': [
6062
+              ['target_arch=="arm"', {
6063
+                'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_arm-sysroot',
6064
+              }],
6065
+              ['target_arch=="arm64"', {
6066
+                'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_jessie_arm64-sysroot',
6067
+              }],
6068
+              ['target_arch=="x64"', {
6069
+                'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_amd64-sysroot',
6070
+              }],
6071
+              ['target_arch=="ia32"', {
6072
+                'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_i386-sysroot',
6073
+              }],
6074
+              ['target_arch=="mipsel"', {
6075
+                'sysroot%': '<!(cd <(DEPTH) && pwd -P)/build/linux/debian_wheezy_mips-sysroot',
6076
+              }],
6077
+            ],
6078
+          }, {
6079
+            'sysroot%': ''
6080
+          }], # OS=="linux" and use_sysroot==1
6081
+        ],
6082
+      },
6083
+      # Copy conditionally-set variables out one scope.
6084
+      'chromeos%': '<(chromeos)',
6085
+      'chromecast%': '<(chromecast)',
6086
+      'is_cast_desktop_build%': '<(is_cast_desktop_build)',
6087
+      'host_arch%': '<(host_arch)',
6088
+      'target_arch%': '<(target_arch)',
6089
+      'target_subarch%': '<(target_subarch)',
6090
+      'mips_arch_variant%': '<(mips_arch_variant)',
6091
+      'mips_dsp_rev%': '<(mips_dsp_rev)',
6092
+      'mips_msa%': '<(mips_msa)',
6093
+      'toolkit_views%': '<(toolkit_views)',
6094
+      'desktop_linux%': '<(desktop_linux)',
6095
+      'use_aura%': '<(use_aura)',
6096
+      'use_ash%': '<(use_ash)',
6097
+      'use_cras%': '<(use_cras)',
6098
+      'use_libpci%': '<(use_libpci)',
6099
+      'use_ozone%': '<(use_ozone)',
6100
+      'use_ozone_evdev%': '<(use_ozone_evdev)',
6101
+      'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
6102
+      'embedded%': '<(embedded)',
6103
+      'use_openssl_certs%': '<(use_openssl_certs)',
6104
+      'use_external_popup_menu%': '<(use_external_popup_menu)',
6105
+      'enable_viewport%': '<(enable_viewport)',
6106
+      'enable_hidpi%': '<(enable_hidpi)',
6107
+      'enable_wayland_server%': '<(enable_wayland_server)',
6108
+      'enable_wifi_display%': '<(enable_wifi_display)',
6109
+      'android_channel%': '<(android_channel)',
6110
+      'use_goma%': '<(use_goma)',
6111
+      'gomadir%': '<(gomadir)',
6112
+      'enable_app_list%': '<(enable_app_list)',
6113
+      'use_default_render_theme%': '<(use_default_render_theme)',
6114
+      'buildtype%': '<(buildtype)',
6115
+      'branding%': '<(branding)',
6116
+      'branding_path_component%': '<(branding_path_component)',
6117
+      'arm_version%': '<(arm_version)',
6118
+      'sysroot%': '<(sysroot)',
6119
+      'use_sysroot%': '<(use_sysroot)',
6120
+      'chroot_cmd%': '<(chroot_cmd)',
6121
+      'system_libdir%': '<(system_libdir)',
6122
+      'order_profiling%': '<(order_profiling)',
6123
+      # TODO(zforman): Remove as soon as no bots depend on this.
6124
+      'dont_embed_build_metadata%': 0,
6125
+      # Set to 1 to force Visual C++ to use legacy debug information format /Z7.
6126
+      # This is useful for parallel compilation tools which can't support /Zi.
6127
+      # Only used on Windows.
6128
+      'win_z7%' : 0,
6129
+      # Set to 1 to enable dcheck in Release build.
6130
+      'dcheck_always_on%': 0,
6131
+      # Set to 1 to make a build that disables unshipped tracing events.
6132
+      # Note: this setting is ignored if buildtype=="Official".
6133
+      'tracing_like_official_build%': 0,
6134
+      # Set to 1 to make a build that disables activation of field trial tests
6135
+      # specified in testing/variations/fieldtrial_testing_config_*.json.
6136
+      # Note: this setting is ignored if branding=="Chrome".
6137
+      'fieldtrial_testing_like_official_build%': 0,
6138
+      # Disable image loader component extension by default.
6139
+      'image_loader_extension%': 0,
6140
+      # Set NEON compilation flags.
6141
+      'arm_neon%': 1,
6142
+      # Detect NEON support at run-time. TODO(pasko): This variable is no longer
6143
+      # set to non-zero, remove it when the last official build with NEON
6144
+      # runtime detection propagates to Stable channel.
6145
+      'arm_neon_optional%': 0,
6146
+      # Use libjpeg-turbo as the JPEG codec used by Chromium.
6147
+      'use_libjpeg_turbo%': 1,
6148
+      # Use system libjpeg. Note that the system's libjepg will be used even if
6149
+      # use_libjpeg_turbo is set.
6150
+      'use_system_libjpeg%': 0,
6151
+      # By default, component is set to static_library and it can be overriden
6152
+      # by the GYP command line or by ~/.gyp/include.gypi.
6153
+      'component%': 'static_library',
6154
+      # /analyze is off by default on Windows because it is very slow and noisy.
6155
+      # Enable with GYP_DEFINES=win_analyze=1
6156
+      'win_analyze%': 0,
6157
+      # /debug:fastlink is off by default on Windows because it generates PDBs
6158
+      # that are machine-local. But, great for local builds.
6159
+      # Enable with GYP_DEFINES=win_fastlink=1
6160
+      'win_fastlink%': 0,
6161
+      # Experimental setting to optimize Chrome's DLLs with PGO.
6162
+      'chrome_pgo_phase%': '0',
6163
+      # Experimental setting to build the official builds with full WPO.
6164
+      'full_wpo_on_official%': '0',
6165
+      # Set to select the Title Case versions of strings in GRD files.
6166
+      'use_titlecase_in_grd%': 0,
6167
+      # Remoting compilation is enabled by default. Set to 0 to disable.
6168
+      'remoting%': 1,
6169
+      # Configuration policy is enabled by default. Overridden on some
6170
+      # platforms. This can't be disabled manually since code in src/chrome
6171
+      # assumes this is enabled.
6172
+      'configuration_policy': 1,
6173
+      # Variable safe_browsing is used to control the build time configuration
6174
+      # for safe browsing feature. Safe browsing can be compiled in 3 different
6175
+      # levels: 0 disables it, 1 enables it fully, and 2 enables mobile
6176
+      # protection via an external API.
6177
+      'safe_browsing%': 1,
6178
+      # Web speech is enabled by default. Set to 0 to disable.
6179
+      'enable_web_speech%': 1,
6180
+      # 'Ok Google' hotwording is disabled by default. Set to 1 to enable. (This
6181
+      # will download a closed-source NaCl module at startup.) Chrome-branded
6182
+      # ChromeOS builds have this enabled by default.
6183
+      'enable_hotwording%': 0,
6184
+      # Notifications are compiled in by default. Set to 0 to disable.
6185
+      'notifications%' : 1,
6186
+      # Use dsymutil to generate real .dSYM files on Mac. The default is 0 for
6187
+      # regular builds and 1 for ASan builds.
6188
+      'mac_want_real_dsym%': 'default',
6189
+      # If this is set, the clang plugins used on the buildbot will be used.
6190
+      # Run tools/clang/scripts/update.py to make sure they are compiled.
6191
+      # This causes 'clang_chrome_plugins_flags' to be set.
6192
+      # Has no effect if 'clang' is not set as well.
6193
+      'clang_use_chrome_plugins%': 1,
6194
+      # Enable building with ASAN (Clang's -fsanitize=address option).
6195
+      # -fsanitize=address only works with clang, but asan=1 implies clang=1
6196
+      # See https://sites.google.com/a/chromium.org/dev/developers/testing/addresssanitizer
6197
+      'asan%': 0,
6198
+      'asan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/asan/blacklist.txt',
6199
+      # Enable coverage gathering instrumentation in sanitizer tools. This flag
6200
+      # also controls coverage granularity.
6201
+      'sanitizer_coverage%': '',
6202
+      # Enable intra-object-overflow detection in ASan (experimental).
6203
+      'asan_field_padding%': 0,
6204
+      # Enable Chromium overrides of the default configurations for various
6205
+      # dynamic tools (like ASan).
6206
+      'use_sanitizer_options%': 0,
6207
+      # Enable building with SyzyAsan.
6208
+      # See https://github.com/google/syzygy/wiki/SyzyASanHowTo
6209
+      'syzyasan%': 0,
6210
+      # Enable building with LSan (Clang's -fsanitize=leak option).
6211
+      # -fsanitize=leak only works with clang, but lsan=1 implies clang=1
6212
+      # See https://sites.google.com/a/chromium.org/dev/developers/testing/leaksanitizer
6213
+      'lsan%': 0,
6214
+      # Enable building with TSan (Clang's -fsanitize=thread option).
6215
+      # -fsanitize=thread only works with clang, but tsan=1 implies clang=1
6216
+      # See http://clang.llvm.org/docs/ThreadSanitizer.html
6217
+      'tsan%': 0,
6218
+      'tsan_blacklist%': '<(PRODUCT_DIR)/../../tools/memory/tsan_v2/ignores.txt',
6219
+      # Enable building with MSan (Clang's -fsanitize=memory option).
6220
+      # MemorySanitizer only works with clang, but msan=1 implies clang=1
6221
+      # See http://clang.llvm.org/docs/MemorySanitizer.html
6222
+      'msan%': 0,
6223
+      'msan_blacklist%': '<(PRODUCT_DIR)/../../tools/msan/blacklist.txt',
6224
+      # Track where uninitialized memory originates from. From fastest to
6225
+      # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
6226
+      # - track the chain of stores leading from allocation site to use site.
6227
+      'msan_track_origins%': 2,
6228
+      # Enable building with UBSan (Clang's -fsanitize=undefined option).
6229
+      # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
6230
+      # See http://clang.llvm.org/docs/UsersManual.html
6231
+      'ubsan%': 0,
6232
+      'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
6233
+      'ubsan_security_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/security_blacklist.txt',
6234
+      'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist.txt',
6235
+      # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
6236
+      # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
6237
+      # ubsan_security also enables UBSan's vptr.
6238
+      'ubsan_security%': 0,
6239
+      'ubsan_vptr%': 0,
6240
+      # Use dynamic libraries instrumented by one of the sanitizers
6241
+      # instead of the standard system libraries. Set this flag to build the
6242
+      # libraries from source.
6243
+      'use_instrumented_libraries%': 0,
6244
+      # Use dynamic libraries instrumented by one of the sanitizers
6245
+      # instead of the standard system libraries. Set this flag to download
6246
+      # prebuilt binaries from GCS.
6247
+      'use_prebuilt_instrumented_libraries%': 0,
6248
+      # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of
6249
+      # stdlibc++ as standard library. This is intended to use for instrumented
6250
+      # builds.
6251
+      'use_custom_libcxx%': 0,
6252
+      # Use the provided profiled order file to link Chrome image with it.
6253
+      # This makes Chrome faster by better using CPU cache when executing code.
6254
+      # This is known as PGO (profile guided optimization).
6255
+      # See https://sites.google.com/a/google.com/chrome-msk/dev/boot-speed-up-effort
6256
+      'order_text_section%' : "",
6257
+      # Set to 1 compile with -fPIC cflag on linux. This is a must for shared
6258
+      # libraries on linux x86-64 and arm, plus ASLR.
6259
+      'linux_fpic%': 1,
6260
+      # Whether one-click signin is enabled or not.
6261
+      'enable_one_click_signin%': 0,
6262
+      # Enable Chrome browser extensions
6263
+      'enable_extensions%': 1,
6264
+      # Enable basic printing support and UI.
6265
+      'enable_basic_printing%': 1,
6266
+      # Enable printing with print preview. It does not imply
6267
+      # enable_basic_printing. It's possible to build Chrome with preview only.
6268
+      'enable_print_preview%': 1,
6269
+      # For CLD2, the size of the tables that should be included in the build
6270
+      # See third_party/cld_2/cld_2.gyp for more information.
6271
+      #   0: Small tables, high accuracy
6272
+      #   2: Large tables, higher accuracy
6273
+      'cld2_table_size%': 2,
6274
+      # Enable spell checker.
6275
+      'enable_spellcheck%': 1,
6276
+      # Use the operating system spellchecker, e.g. NSSpellChecker on Mac or
6277
+      # SpellCheckerSession on Android.
6278
+      'use_browser_spellchecker%': 0,
6279
+      # Use Minikin hyphenation engine.
6280
+      'use_minikin_hyphenation%': 0,
6281
+      # Webrtc compilation is enabled by default. Set to 0 to disable.
6282
+      'enable_webrtc%': 1,
6283
+      # Media router support is enabled by default. Set to 0 to disable.
6284
+      'enable_media_router%': 1,
6285
+      # Enables use of the session service, which is enabled by default.
6286
+      # Support for disabling depends on the platform.
6287
+      'enable_session_service%': 1,
6288
+      # Enables theme support, which is enabled by default.  Support for
6289
+      # disabling depends on the platform.
6290
+      'enable_themes%': 1,
6291
+      # Enable the task manager by default.
6292
+      'enable_task_manager%': 1,
6293
+      # Enables used resource whitelist generation; disabled by default.
6294
+      'enable_resource_whitelist_generation%': 0,
6295
+      # Enable FILE support by default.
6296
+      'disable_file_support%': 0,
6297
+      # Enable FTP support by default.
6298
+      'disable_ftp_support%': 0,
6299
+      # Do not use the platform ICU alternatives by default.
6300
+      'use_platform_icu_alternatives%': 0,
6301
+      # Do not disable brotli filter by default.
6302
+      'disable_brotli_filter%': 0,
6303
+      # Use of precompiled headers on Windows.
6304
+      #
6305
+      # This variable may be explicitly set to 1 (enabled) or 0
6306
+      # (disabled) in ~/.gyp/include.gypi or via the GYP command line.
6307
+      # This setting will override the default.
6308
+      #
6309
+      # See
6310
+      # https://chromium.googlesource.com/chromium/src/+/master/docs/windows_precompiled_headers.md
6311
+      # for details.
6312
+      'chromium_win_pch%': 0,
6313
+      # Clang stuff.
6314
+      'make_clang_dir%': 'third_party/llvm-build/Release+Asserts',
6315
+      # Set this to true when building with Clang.
6316
+      # See https://chromium.googlesource.com/chromium/src/+/master/docs/clang.md for details.
6317
+      # If this is set, clang is used as both host and target compiler in
6318
+      # cross-compile builds.
6319
+      'clang%': 0,
6320
+      # Use experimental lld linker instead of the platform's default linker.
6321
+      'use_lld%': 0,
6322
+      # Enable plugin installation by default.
6323
+      'enable_plugin_installation%': 1,
6324
+      # Specifies whether to use canvas_skia.cc in place of platform
6325
+      # specific implementations of gfx::Canvas. Affects text drawing in the
6326
+      # Chrome UI.
6327
+      # TODO(asvitkine): Enable this on all platforms and delete this flag.
6328
+      #                  http://crbug.com/105550
6329
+      'use_canvas_skia%': 0,
6330
+      # Set to "drmemory" to configure the build to work with DrMemory.
6331
+      'build_for_tool%': '',
6332
+      'wix_path%': '<(DEPTH)/third_party/wix',
6333
+      # Supervised users are enabled by default.
6334
+      'enable_supervised_users%': 1,
6335
+      'enable_mdns%' : 0,
6336
+      'enable_service_discovery%': 0,
6337
+      'enable_hangout_services_extension%': 0,
6338
+       # Enable the Syzygy optimization step.
6339
+      'syzygy_optimize%': 0,
6340
+      # Automatically select platforms under ozone. Turn this off to
6341
+      # build only explicitly selected platforms.
6342
+      'ozone_auto_platforms%': 1,
6343
+      # Disable the display for a chromecast build. Set to 1 perform an audio-
6344
+      # only build.
6345
+      'disable_display%': 0,
6346
+      # If this is set clang is used as host compiler, but not as target
6347
+      # compiler. Always do this by default.
6348
+      'host_clang%': 1,
6349
+      # Variables to control Link-Time Optimization (LTO).
6350
+      # On Android, when using GCC LTO, the variable use_lto enables LTO on code
6351
+      # compiled with -Os, and use_lto_o2 enables LTO on code compiled with -O2.
6352
+      # On other platforms (including Android with Clang), use_lto enables LTO
6353
+      # in all translation units, and use_lto_o2 has no effect.
6354
+      #
6355
+      # On Linux and Android, when using LLVM LTO, the script
6356
+      # build/download_gold_plugin.py must be run to download a linker plugin.
6357
+      # On Mac, LLVM needs to be built from scratch using
6358
+      # tools/clang/scripts/update.py and the absolute path to
6359
+      # third_party/llvm-build/Release+Asserts/lib must be added to
6360
+      # $DYLD_LIBRARY_PATH to pick up the right version of the linker plugin.
6361
+      # TODO(pcc): Teach build system to use -lto_library flag to specify path
6362
+      # to linker plugin on Mac.
6363
+      #
6364
+      # On Android/GCC, the variables must *not* be enabled at the same time.
6365
+      # In this case LTO would 'merge' the optimization flags at link-time
6366
+      # which would lead to all code be optimized with -O2. See crbug.com/407544
6367
+      'use_lto%': 0,
6368
+      'use_lto_o2%': 0,
6369
+      # Allowed level of identical code folding in the gold linker.
6370
+      'gold_icf_level%': 'all',
6371
+      # Libxkbcommon usage.
6372
+      'use_xkbcommon%': 0,
6373
+      # Whether we use GTKv3 on linux.
6374
+      'use_gtk3%': 0,
6375
+      # Control Flow Integrity for virtual calls and casts.
6376
+      # See http://clang.llvm.org/docs/ControlFlowIntegrity.html
6377
+      'cfi_vptr%': 0,
6378
+      # TODO(krasin): remove it. See https://crbug.com/626794.
6379
+      'cfi_cast%': 0,
6380
+      'cfi_diag%': 0,
6381
+      'cfi_blacklist%': '<(PRODUCT_DIR)/../../tools/cfi/blacklist.txt',
6382
+      # Whether the entire browser uses toolkit-views on Mac instead of Cocoa.
6383
+      'mac_views_browser%': 0,
6384
+      # By default, use ICU data file (icudtl.dat).
6385
+      'icu_use_data_file_flag%': 1,
6386
+      # Turn on JNI generation optimizations by default.
6387
+      'optimize_jni_generation%': 1,
6388
+      'conditions': [
6389
+        # A flag for POSIX platforms
6390
+        ['OS=="win"', {
6391
+          'os_posix%': 0,
6392
+        }, {
6393
+          'os_posix%': 1,
6394
+        }],
6395
+        # A flag for BSD platforms
6396
+        ['OS=="freebsd" or OS=="openbsd"', {
6397
+          'os_bsd%': 1,
6398
+        }, {
6399
+          'os_bsd%': 0,
6400
+        }],
6401
+        # NSS usage.
6402
+        ['(OS=="linux" or OS=="freebsd" or OS=="openbsd" or OS=="solaris")', {
6403
+          'use_nss_certs%': 1,
6404
+        }, {
6405
+          'use_nss_certs%': 0,
6406
+        }],
6407
+        # libudev usage.  This currently only affects the content layer.
6408
+        ['OS=="linux" and embedded==0', {
6409
+          'use_udev%': 1,
6410
+        }, {
6411
+          'use_udev%': 0,
6412
+        }],
6413
+        # Flags to use X11 on non-Mac POSIX platforms.
6414
+        ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
6415
+          'use_x11%': 0,
6416
+        }, {
6417
+          'use_x11%': 1,
6418
+        }],
6419
+        # Flags to use glib.
6420
+        ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or use_ozone==1', {
6421
+          'use_glib%': 0,
6422
+        }, {
6423
+          'use_glib%': 1,
6424
+        }],
6425
+        # Flags to use Wayland server support.
6426
+        ['chromeos==1', {
6427
+          'enable_wayland_server%': 1,
6428
+        }, {
6429
+          'enable_wayland_server%': 0,
6430
+        }],
6431
+        # Flags to use pango and cairo.
6432
+        ['OS=="win" or OS=="mac" or OS=="ios" or OS=="android" or embedded==1', {
6433
+          'use_pango%': 0,
6434
+          'use_cairo%': 0,
6435
+        }, {
6436
+          'use_pango%': 1,
6437
+          'use_cairo%': 1,
6438
+        }],
6439
+        # DBus usage.
6440
+        ['(OS=="linux" or OS=="openbsd" or OS=="freebsd") and embedded==0', {
6441
+          'use_dbus%': 1,
6442
+        }, {
6443
+          'use_dbus%': 0,
6444
+        }],
6445
+        # We always use skia text rendering in Aura on Windows, since GDI
6446
+        # doesn't agree with our BackingStore.
6447
+        # TODO(beng): remove once skia text rendering is on by default.
6448
+        ['use_aura==1 and OS=="win"', {
6449
+          'enable_skia_text%': 1,
6450
+        }],
6451
+        # A flag to enable or disable our compile-time dependency
6452
+        # on gnome-keyring. If that dependency is disabled, no gnome-keyring
6453
+        # support will be available. This option is useful
6454
+        # for Linux distributions and for Aura.
6455
+        ['OS!="linux" or chromeos==1', {
6456
+          'use_gnome_keyring%': 0,
6457
+        }, {
6458
+          'use_gnome_keyring%': 1,
6459
+        }],
6460
+        ['OS=="mac" or OS=="ios"', {
6461
+          # Mac and iOS want Title Case strings
6462
+          'use_titlecase_in_grd%': 1,
6463
+        }],
6464
+        # Enable loader extensions on Chrome OS.
6465
+        ['chromeos==1', {
6466
+          'image_loader_extension%': 1,
6467
+        }, {
6468
+          'image_loader_extension%': 0,
6469
+        }],
6470
+        ['OS=="win" or OS=="mac" or (OS=="linux" and chromeos==0)', {
6471
+          'enable_one_click_signin%': 1,
6472
+        }],
6473
+        ['OS=="android"', {
6474
+          'enable_extensions%': 0,
6475
+          'cld2_table_size%': 0,
6476
+          'enable_themes%': 0,
6477
+          'remoting%': 0,
6478
+          'enable_basic_printing%': 1,
6479
+          'enable_print_preview%': 0,
6480
+          'enable_task_manager%':0,
6481
+        }],
6482
+        # Android and OSX have built-in spellcheckers that can be utilized.
6483
+        ['OS=="android" or OS=="mac"', {
6484
+          'use_browser_spellchecker%': 1,
6485
+        }],
6486
+        # Android has hyphenation dictionaries for Minikin to use.
6487
+        ['OS=="android"', {
6488
+          'use_minikin_hyphenation%': 1,
6489
+        }],
6490
+        # Enables proprietary codecs and demuxers; e.g. H264, AAC, MP3, and MP4.
6491
+        # We always build Google Chrome and Chromecast with proprietary codecs.
6492
+        ['branding=="Chrome" or chromecast==1', {
6493
+          'proprietary_codecs%': 1,
6494
+        }, {
6495
+          'proprietary_codecs%': 0,
6496
+        }],
6497
+  # Enable Link Time Optimization for the official Linux Chrome.
6498
+  # This requires LLVM Gold plugin to be downloaded.
6499
+        # See src/tools/clang/scripts/update.py
6500
+  ['OS=="linux" and target_arch=="x64" and buildtype=="Official" and branding=="Chrome" and chromeos==0', {
6501
+           'use_lto%': 1,
6502
+        }],
6503
+        # Enable hotwording on Chrome-branded ChromeOS builds.
6504
+        ['branding=="Chrome" and chromeos==1', {
6505
+          'enable_hotwording%': 1,
6506
+        }],
6507
+        ['OS=="android"', {
6508
+          'enable_webrtc%': 1,
6509
+        }],
6510
+        ['OS=="ios"', {
6511
+          'configuration_policy': 0,
6512
+          'disable_ftp_support%': 1,
6513
+          'enable_extensions%': 0,
6514
+          'cld2_table_size%': 0,
6515
+          'enable_basic_printing%': 0,
6516
+          'enable_print_preview%': 0,
6517
+          'enable_session_service%': 0,
6518
+          'enable_spellcheck%': 0,
6519
+          'enable_themes%': 0,
6520
+          'enable_webrtc%': 0,
6521
+          'notifications%': 0,
6522
+          'remoting%': 0,
6523
+          'safe_browsing%': 2,
6524
+          'enable_supervised_users%': 0,
6525
+          'enable_task_manager%': 0,
6526
+          'enable_media_router%': 0,
6527
+        }],
6528
+        # Use GPU accelerated cross process image transport by default
6529
+        # on linux and *BSD builds with the Aura window manager
6530
+        ['use_aura==1 and (OS=="linux" or OS=="openbsd" or OS=="freebsd")', {
6531
+          'ui_compositor_image_transport%': 1,
6532
+        }, {
6533
+          'ui_compositor_image_transport%': 0,
6534
+        }],
6535
+        # Turn precompiled headers on by default.
6536
+        ['OS=="win" and buildtype!="Official"', {
6537
+          'chromium_win_pch%': 1
6538
+        }],
6539
+        # Whether PDF plugin is enabled, and which options it supports.
6540
+        ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
6541
+          'enable_pdf%': 0,
6542
+          'pdf_enable_v8%': 0,
6543
+        }, {
6544
+          'enable_pdf%': 1,
6545
+          'pdf_enable_v8%': 1,
6546
+        }],
6547
+        ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
6548
+          'pdf_enable_xfa%': 0,
6549
+        }, {
6550
+          'pdf_enable_xfa%': 0,
6551
+        }],
6552
+        ['chromeos==1 or OS=="android" or OS=="ios" or desktop_linux==1', {
6553
+          'enable_plugin_installation%': 0,
6554
+        }, {
6555
+          'enable_plugin_installation%': 1,
6556
+        }],
6557
+        # Whether PPAPI is enabled.
6558
+        ['OS=="android" or OS=="ios" or (embedded==1 and chromecast==0)', {
6559
+          'enable_plugins%': 0,
6560
+        }, {
6561
+          'enable_plugins%': 1,
6562
+        }],
6563
+        # linux_use_bundled_gold: whether to use the gold linker binary checked
6564
+        # into third_party/binutils.  Force this off via GYP_DEFINES when you
6565
+        # are using a custom toolchain and need to control -B in ldflags.
6566
+        # Do not use 32-bit gold on 32-bit hosts as it runs out address space
6567
+        # for component=static_library builds.
6568
+        ['((OS=="linux" or OS=="android") and (target_arch=="x64" or target_arch=="arm" or (target_arch=="ia32" and host_arch=="x64"))) or (OS=="linux" and target_arch=="mipsel")', {
6569
+          'linux_use_bundled_gold%': 1,
6570
+        }, {
6571
+          'linux_use_bundled_gold%': 0,
6572
+        }],
6573
+        # linux_use_bundled_binutils: whether to use the binary binutils
6574
+        # checked into third_party/binutils.  These are not multi-arch so cannot
6575
+        # be used except on x86 and x86-64 (the only two architectures which
6576
+        # are currently checke in).  Force this off via GYP_DEFINES when you
6577
+        # are using a custom toolchain and need to control -B in cflags.
6578
+        ['OS=="linux" and (target_arch=="x64")', {
6579
+          'linux_use_bundled_binutils%': 1,
6580
+        }, {
6581
+          'linux_use_bundled_binutils%': 0,
6582
+        }],
6583
+        # linux_use_gold_flags: whether to use build flags that rely on gold.
6584
+        # On by default for x64 Linux.
6585
+        ['OS=="linux" and target_arch=="x64"', {
6586
+          'linux_use_gold_flags%': 1,
6587
+        }, {
6588
+          'linux_use_gold_flags%': 0,
6589
+        }],
6590
+        # linux_use_debug_fission: whether to use split DWARF debug info
6591
+        # files. This can reduce link time significantly, but is incompatible
6592
+        # with some utilities such as icecc and ccache. Requires gold and
6593
+        # gcc >= 4.8 or clang.
6594
+        # http://gcc.gnu.org/wiki/DebugFission
6595
+        ['OS=="linux" and target_arch=="x64"', {
6596
+          'linux_use_debug_fission%': 1,
6597
+        }, {
6598
+          'linux_use_debug_fission%': 0,
6599
+        }],
6600
+        ['OS=="android" or OS=="ios"', {
6601
+          'enable_captive_portal_detection%': 0,
6602
+        }, {
6603
+          'enable_captive_portal_detection%': 1,
6604
+        }],
6605
+        # Enable Skia UI text drawing incrementally on different platforms.
6606
+        # http://crbug.com/105550
6607
+        #
6608
+        # On Aura, this allows per-tile painting to be used in the browser
6609
+        # compositor.
6610
+        ['OS!="android" and OS!="ios"', {
6611
+          'use_canvas_skia%': 1,
6612
+        }],
6613
+        ['chromeos==1', {
6614
+          'enable_basic_printing%': 1,
6615
+          'enable_print_preview%': 1,
6616
+        }],
6617
+        # Whether tests targets should be run, archived or just have the
6618
+        # dependencies verified. All the tests targets have the '_run' suffix,
6619
+        # e.g. base_unittests_run runs the target base_unittests. The test
6620
+        # target always calls tools/swarming_client/isolate.py. See the script's
6621
+        # --help for more information. Meant to be overriden with GYP_DEFINES.
6622
+        # TODO(maruel): Remove the conditions as more configurations are
6623
+        # supported.
6624
+        ['OS!="ios" and OS!="android" and chromeos==0 and OS!="openbsd" and OS!="freebsd"', {
6625
+          'test_isolation_mode%': 'check',
6626
+        }, {
6627
+          'test_isolation_mode%': 'noop',
6628
+        }],
6629
+        # Whether Android build uses OpenMAX DL FFT.
6630
+        ['OS=="android" and ((target_arch=="arm" and arm_version >= 7) or target_arch=="ia32" or target_arch=="x64" or target_arch=="arm64" or target_arch=="mipsel")', {
6631
+          # Currently only supported on Android ARMv7+, ARM64, ia32, x64 and mipsel.
6632
+          # When enabled, this will also enable WebAudio support on
6633
+          # Android for these architectures.  Default is enabled.  Whether
6634
+          # WebAudio is actually available depends on runtime settings
6635
+          # and flags.
6636
+          'use_openmax_dl_fft%': 1,
6637
+        }, {
6638
+          'use_openmax_dl_fft%': 0,
6639
+        }],
6640
+        ['OS=="win" or OS=="linux" or OS=="openbsd" or OS=="freebsd"', {
6641
+          'enable_mdns%' : 1,
6642
+        }],
6643
+        # Disable various features by default on embedded.
6644
+        ['embedded==1', {
6645
+          'remoting%': 0,
6646
+          'enable_basic_printing%': 0,
6647
+          'enable_print_preview%': 0,
6648
+        }],
6649
+        ['sysroot!=""', {
6650
+          'pkg-config': '<(chroot_cmd) <(DEPTH)/build/linux/pkg-config-wrapper "<(sysroot)" "<(target_arch)" "<(system_libdir)"',
6651
+        }, {
6652
+          'pkg-config': 'pkg-config'
6653
+        }],
6654
+        # Enable WebVR support by default on Android
6655
+        # Still requires command line flag to access API
6656
+        ['OS=="android"', {
6657
+          'enable_webvr%': 1,
6658
+        }, {
6659
+          'enable_webvr%': 0,
6660
+        }],
6661
+        ['order_profiling==0', {
6662
+          # Set to 1 to enable fast builds. Set to 2 for even faster builds
6663
+          # (it disables debug info for fastest compilation - only for use
6664
+          # on compile-only bots).
6665
+          'fastbuild%': 0,
6666
+        }, {
6667
+          # With instrumentation enabled, debug info puts libchrome.so over 4gb,
6668
+          # which causes the linker to produce an invalid ELF.
6669
+          # http://crbug.com/574476
6670
+          'fastbuild%': 2,
6671
+        }],
6672
+      ],
6673
+      # Kasko reporting is disabled by default, but may get enabled below.
6674
+      'kasko%': 0,
6675
+      # Setting this to '0' will cause V8's startup snapshot to be
6676
+      # embedded in the binary instead of being a external files.
6677
+      'v8_use_external_startup_data%': 1,
6678
+      # Set this to 1 to enable use of concatenated impulse responses
6679
+      # for the HRTF panner in WebAudio.
6680
+      'use_concatenated_impulse_responses': 1,
6681
+      # You can set the variable 'use_official_google_api_keys' to 1
6682
+      # to use the Google-internal file containing official API keys
6683
+      # for Google Chrome even in a developer build.  Setting this
6684
+      # variable explicitly to 1 will cause your build to fail if the
6685
+      # internal file is missing.
6686
+      #
6687
+      # The variable is documented here, but not handled in this file;
6688
+      # see //google_apis/determine_use_official_keys.gypi for the
6689
+      # implementation.
6690
+      #
6691
+      # Set the variable to 0 to not use the internal file, even when
6692
+      # it exists in your checkout.
6693
+      #
6694
+      # Leave it unset in your include.gypi to have the variable
6695
+      # implicitly set to 1 if you have
6696
+      # src/google_apis/internal/google_chrome_api_keys.h in your
6697
+      # checkout, and implicitly set to 0 if not.
6698
+      #
6699
+      # Note that official builds always behave as if the variable
6700
+      # was explicitly set to 1, i.e. they always use official keys,
6701
+      # and will fail to build if the internal file is missing.
6702
+      #
6703
+      # NOTE: You MUST NOT explicitly set the variable to 2 in your
6704
+      # include.gypi or by other means. Due to subtleties of GYP, this
6705
+      # is not the same as leaving the variable unset, even though its
6706
+      # default value in
6707
+      # //google_apis/determine_use_official_keys.gypi is 2.
6708
+      # Set these to bake the specified API keys and OAuth client
6709
+      # IDs/secrets into your build.
6710
+      #
6711
+      # If you create a build without values baked in, you can instead
6712
+      # set environment variables to provide the keys at runtime (see
6713
+      # src/google_apis/google_api_keys.h for details).  Features that
6714
+      # require server-side APIs may fail to work if no keys are
6715
+      # provided.
6716
+      #
6717
+      # Note that if you are building an official build or if
6718
+      # use_official_google_api_keys has been set to 1 (explicitly or
6719
+      # implicitly), these values will be ignored and the official
6720
+      # keys will be used instead.
6721
+      'google_api_key%': '',
6722
+      'google_default_client_id%': '',
6723
+      'google_default_client_secret%': '',
6724
+      # Native Client is enabled by default.
6725
+      'disable_nacl%': '0',
6726
+      # Native Client toolchains, enabled by default.
6727
+      'disable_pnacl%': 0,
6728
+      'disable_newlib%': 0,
6729
+      # Sets the default version name and code for Android app, by default we
6730
+      # do a developer build.
6731
+      'android_app_version_name%': 'Developer Build',
6732
+      'android_app_version_code%': 1,
6733
+      # Use the internal version of the framework to build Android WebView.
6734
+      'use_webview_internal_framework%': 0,
6735
+    },
6736
+    # Copy conditionally-set variables out one scope.
6737
+    'branding%': '<(branding)',
6738
+    'branding_path_component%': '<(branding_path_component)',
6739
+    'buildtype%': '<(buildtype)',
6740
+    'target_arch%': '<(target_arch)',
6741
+    'target_subarch%': '<(target_subarch)',
6742
+    'mips_arch_variant%': '<(mips_arch_variant)',
6743
+    'mips_dsp_rev%': '<(mips_dsp_rev)',
6744
+    'mips_msa%': '<(mips_msa)',
6745
+    'host_arch%': '<(host_arch)',
6746
+    'toolkit_views%': '<(toolkit_views)',
6747
+    'ui_compositor_image_transport%': '<(ui_compositor_image_transport)',
6748
+    'use_aura%': '<(use_aura)',
6749
+    'use_ash%': '<(use_ash)',
6750
+    'use_cras%': '<(use_cras)',
6751
+    'use_libpci%': '<(use_libpci)',
6752
+    'use_openssl_certs%': '<(use_openssl_certs)',
6753
+    'use_external_popup_menu%': '<(use_external_popup_menu)',
6754
+    'use_nss_certs%': '<(use_nss_certs)',
6755
+    'use_udev%': '<(use_udev)',
6756
+    'os_bsd%': '<(os_bsd)',
6757
+    'os_posix%': '<(os_posix)',
6758
+    'use_dbus%': '<(use_dbus)',
6759
+    'use_glib%': '<(use_glib)',
6760
+    'use_pango%': '<(use_pango)',
6761
+    'use_cairo%': '<(use_cairo)',
6762
+    'use_ozone%': '<(use_ozone)',
6763
+    'use_ozone_evdev%': '<(use_ozone_evdev)',
6764
+    'use_xkbcommon%': '<(use_xkbcommon)',
6765
+    'use_gtk3%': '<(use_gtk3)',
6766
+    'use_clipboard_aurax11%': '<(use_clipboard_aurax11)',
6767
+    'desktop_linux%': '<(desktop_linux)',
6768
+    'use_x11%': '<(use_x11)',
6769
+    'use_gnome_keyring%': '<(use_gnome_keyring)',
6770
+    'linux_fpic%': '<(linux_fpic)',
6771
+    'chromeos%': '<(chromeos)',
6772
+    'chromecast%': '<(chromecast)',
6773
+    'is_cast_desktop_build%': '<(is_cast_desktop_build)',
6774
+    'enable_viewport%': '<(enable_viewport)',
6775
+    'enable_hidpi%': '<(enable_hidpi)',
6776
+    'enable_wayland_server%': '<(enable_wayland_server)',
6777
+    'enable_wifi_display%': '<(enable_wifi_display)',
6778
+    'image_loader_extension%': '<(image_loader_extension)',
6779
+    'fastbuild%': '<(fastbuild)',
6780
+    'win_z7%': '<(win_z7)',
6781
+    'dcheck_always_on%': '<(dcheck_always_on)',
6782
+    'tracing_like_official_build%': '<(tracing_like_official_build)',
6783
+    'fieldtrial_testing_like_official_build%': '<(fieldtrial_testing_like_official_build)',
6784
+    'arm_version%': '<(arm_version)',
6785
+    'arm_neon%': '<(arm_neon)',
6786
+    'arm_neon_optional%': '<(arm_neon_optional)',
6787
+    'sysroot%': '<(sysroot)',
6788
+    'use_sysroot%': '<(use_sysroot)',
6789
+    'pkg-config%': '<(pkg-config)',
6790
+    'chroot_cmd%': '<(chroot_cmd)',
6791
+    'system_libdir%': '<(system_libdir)',
6792
+    'component%': '<(component)',
6793
+    'win_analyze%': '<(win_analyze)',
6794
+    'win_fastlink%': '<(win_fastlink)',
6795
+    'chrome_pgo_phase%': '<(chrome_pgo_phase)',
6796
+    'full_wpo_on_official%': '<(full_wpo_on_official)',
6797
+    'enable_resource_whitelist_generation%': '<(enable_resource_whitelist_generation)',
6798
+    'use_titlecase_in_grd%': '<(use_titlecase_in_grd)',
6799
+    'remoting%': '<(remoting)',
6800
+    'enable_one_click_signin%': '<(enable_one_click_signin)',
6801
+    'enable_media_router%': '<(enable_media_router)',
6802
+    'enable_webrtc%': '<(enable_webrtc)',
6803
+    'chromium_win_pch%': '<(chromium_win_pch)',
6804
+    'configuration_policy': '<(configuration_policy)',
6805
+    'safe_browsing%': '<(safe_browsing)',
6806
+    'enable_web_speech%': '<(enable_web_speech)',
6807
+    'enable_hotwording%': '<(enable_hotwording)',
6808
+    'notifications%': '<(notifications)',
6809
+    'clang_use_chrome_plugins%': '<(clang_use_chrome_plugins)',
6810
+    'mac_want_real_dsym%': '<(mac_want_real_dsym)',
6811
+    'asan%': '<(asan)',
6812
+    'asan_blacklist%': '<(asan_blacklist)',
6813
+    'sanitizer_coverage%': '<(sanitizer_coverage)',
6814
+    'asan_field_padding%': '<(asan_field_padding)',
6815
+    'use_sanitizer_options%': '<(use_sanitizer_options)',
6816
+    'syzyasan%': '<(syzyasan)',
6817
+    'kasko%': '<(kasko)',
6818
+    'syzygy_optimize%': '<(syzygy_optimize)',
6819
+    'lsan%': '<(lsan)',
6820
+    'msan%': '<(msan)',
6821
+    'msan_blacklist%': '<(msan_blacklist)',
6822
+    'msan_track_origins%': '<(msan_track_origins)',
6823
+    'tsan%': '<(tsan)',
6824
+    'tsan_blacklist%': '<(tsan_blacklist)',
6825
+    'ubsan%': '<(ubsan)',
6826
+    'ubsan_blacklist%': '<(ubsan_blacklist)',
6827
+    'ubsan_security%': '<(ubsan_security)',
6828
+    'ubsan_security_blacklist%': '<(ubsan_security_blacklist)',
6829
+    'ubsan_vptr%': '<(ubsan_vptr)',
6830
+    'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
6831
+    'use_instrumented_libraries%': '<(use_instrumented_libraries)',
6832
+    'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_libraries)',
6833
+    'use_custom_libcxx%': '<(use_custom_libcxx)',
6834
+    'order_profiling%': '<(order_profiling)',
6835
+    'order_text_section%': '<(order_text_section)',
6836
+    'enable_extensions%': '<(enable_extensions)',
6837
+    'enable_pdf%': '<(enable_pdf)',
6838
+    'pdf_enable_v8%': '<(pdf_enable_v8)',
6839
+    'pdf_enable_xfa%': '<(pdf_enable_xfa)',
6840
+    'enable_plugin_installation%': '<(enable_plugin_installation)',
6841
+    'enable_plugins%': '<(enable_plugins)',
6842
+    'enable_session_service%': '<(enable_session_service)',
6843
+    'enable_themes%': '<(enable_themes)',
6844
+    'linux_use_bundled_gold%': '<(linux_use_bundled_gold)',
6845
+    'linux_use_bundled_binutils%': '<(linux_use_bundled_binutils)',
6846
+    'linux_use_gold_flags%': '<(linux_use_gold_flags)',
6847
+    'linux_use_debug_fission%': '<(linux_use_debug_fission)',
6848
+    'use_canvas_skia%': '<(use_canvas_skia)',
6849
+    'test_isolation_mode%': '<(test_isolation_mode)',
6850
+    'enable_basic_printing%': '<(enable_basic_printing)',
6851
+    'enable_print_preview%': '<(enable_print_preview)',
6852
+    'enable_spellcheck%': '<(enable_spellcheck)',
6853
+    'use_browser_spellchecker%': '<(use_browser_spellchecker)',
6854
+    'use_minikin_hyphenation%': '<(use_minikin_hyphenation)',
6855
+    'cld2_table_size%': '<(cld2_table_size)',
6856
+    'enable_captive_portal_detection%': '<(enable_captive_portal_detection)',
6857
+    'disable_file_support%': '<(disable_file_support)',
6858
+    'disable_ftp_support%': '<(disable_ftp_support)',
6859
+    'use_platform_icu_alternatives%': '<(use_platform_icu_alternatives)',
6860
+    'disable_brotli_filter%': '<(disable_brotli_filter)',
6861
+    'enable_task_manager%': '<(enable_task_manager)',
6862
+    'wix_path%': '<(wix_path)',
6863
+    'use_libjpeg_turbo%': '<(use_libjpeg_turbo)',
6864
+    'use_system_libjpeg%': '<(use_system_libjpeg)',
6865
+    'android_channel%': '<(android_channel)',
6866
+    'icu_use_data_file_flag%': '<(icu_use_data_file_flag)',
6867
+    'gyp_managed_install%': 0,
6868
+    'create_standalone_apk%': 1,
6869
+    'enable_app_list%': '<(enable_app_list)',
6870
+    'use_default_render_theme%': '<(use_default_render_theme)',
6871
+    'google_api_key%': '<(google_api_key)',
6872
+    'google_default_client_id%': '<(google_default_client_id)',
6873
+    'google_default_client_secret%': '<(google_default_client_secret)',
6874
+    'enable_supervised_users%': '<(enable_supervised_users)',
6875
+    'enable_mdns%' : '<(enable_mdns)',
6876
+    'enable_service_discovery%' : '<(enable_service_discovery)',
6877
+    'enable_hangout_services_extension%' : '<(enable_hangout_services_extension)',
6878
+    'proprietary_codecs%': '<(proprietary_codecs)',
6879
+    'use_goma%': '<(use_goma)',
6880
+    'gomadir%': '<(gomadir)',
6881
+    'use_lto%': '<(use_lto)',
6882
+    'use_lto_o2%': '<(use_lto_o2)',
6883
+    'gold_icf_level%': '<(gold_icf_level)',
6884
+    'v8_use_external_startup_data%': '<(v8_use_external_startup_data)',
6885
+    'cfi_vptr%': '<(cfi_vptr)',
6886
+    'cfi_cast%': '<(cfi_cast)',
6887
+    'cfi_diag%': '<(cfi_diag)',
6888
+    'cfi_blacklist%': '<(cfi_blacklist)',
6889
+    'mac_views_browser%': '<(mac_views_browser)',
6890
+    'android_app_version_name%': '<(android_app_version_name)',
6891
+    'android_app_version_code%': '<(android_app_version_code)',
6892
+    'use_webview_internal_framework%': '<(use_webview_internal_framework)',
6893
+    'enable_webvr%': '<(enable_webvr)',
6894
+    # Turns on compiler optimizations in V8 in Debug build.
6895
+    'v8_optimized_debug%': 1,
6896
+    # Use system protobuf instead of bundled one.
6897
+    'use_system_protobuf%': 0,
6898
+    # Use system yasm instead of bundled one.
6899
+    'use_system_yasm%': 0,
6900
+    # Use system ICU instead of bundled one.
6901
+    'use_system_icu%' : 0,
6902
+    # Default to enabled PIE; this is important for ASLR but we may need to be
6903
+    # able to turn it off for various reasons.
6904
+    'linux_disable_pie%': 0,
6905
+    # The release channel that this build targets. This is used to restrict
6906
+    # channel-specific build options, like which installer packages to create.
6907
+    # The default is 'all', which does no channel-specific filtering.
6908
+    'channel%': 'all',
6909
+    # Override chromium_mac_pch and set it to 0 to suppress the use of
6910
+    # precompiled headers on the Mac.  Prefix header injection may still be
6911
+    # used, but prefix headers will not be precompiled.  This is useful when
6912
+    # using distcc to distribute a build to compile slaves that don't
6913
+    # share the same compiler executable as the system driving the compilation,
6914
+    # because precompiled headers rely on pointers into a specific compiler
6915
+    # executable's image.  Setting this to 0 is needed to use an experimental
6916
+    # Linux-Mac cross compiler distcc farm.
6917
+    'chromium_mac_pch%': 1,
6918
+    # The default value for mac_strip in target_defaults. This cannot be
6919
+    # set there, per the comment about variable% in a target_defaults.
6920
+    'mac_strip_release%': 0,
6921
+    # Set to 1 to enable java code coverage. Instruments classes during build
6922
+    # to produce .ec files during runtime.
6923
+    'emma_coverage%': 0,
6924
+    # EMMA filter string consisting of a list of inclusion/exclusion patterns
6925
+    # separated with whitespace and/or comma. Only has effect if
6926
+    # 'emma_coverage=1'.
6927
+    'emma_filter%': '',
6928
+    # Set to 1 to enable running Android lint on java/class files.
6929
+    'android_lint%': 1,
6930
+    # Although base/allocator lets you select a heap library via an
6931
+    # environment variable, the shim it uses sometimes gets in the way.
6932
+    # To disable it entirely, and switch to normal msvcrt, do e.g.
6933
+    #  'win_use_allocator_shim': 0,
6934
+    #  'win_release_RuntimeLibrary': 2
6935
+    # to ~/.gyp/include.gypi, gclient runhooks --force, and do a release build.
6936
+    'win_use_allocator_shim%': 1, # 1 = shim allocator; 0 = msvcrt
6937
+    # Enables the unified allocator shim (experimental) which routes all the
6938
+    # alloc calls to base/. Right now is supported on Linux Desktop only.
6939
+    # http://crbug.com/550886 .
6940
+    'use_experimental_allocator_shim%': 0,
6941
+    # TODO(bradnelson): eliminate this when possible.
6942
+    # To allow local gyp files to prevent release.vsprops from being included.
6943
+    # Yes(1) means include release.vsprops.
6944
+    # Once all vsprops settings are migrated into gyp, this can go away.
6945
+    'msvs_use_common_release%': 1,
6946
+    # TODO(bradnelson): eliminate this when possible.
6947
+    # To allow local gyp files to override additional linker options for msvs.
6948
+    # Yes(1) means set use the common linker options.
6949
+    'msvs_use_common_linker_extras%': 1,
6950
+    # TODO(sgk): eliminate this if possible.
6951
+    # It would be nicer to support this via a setting in 'target_defaults'
6952
+    # in chrome/app/locales/locales.gypi overriding the setting in the
6953
+    # 'Debug' configuration in the 'target_defaults' dict below,
6954
+    # but that doesn't work as we'd like.
6955
+    'msvs_debug_link_incremental%': '2',
6956
+    # Needed for some of the largest modules.
6957
+    'msvs_debug_link_nonincremental%': '1',
6958
+    # Turns on Use Library Dependency Inputs for linking chrome.dll on Windows
6959
+    # to get incremental linking to be faster in debug builds.
6960
+    'incremental_chrome_dll%': '0',
6961
+    # Experimental setting to break chrome.dll into multiple pieces based on
6962
+    # process type.
6963
+    'chrome_multiple_dll%': '0',
6964
+    # Whether the VS xtree header has been patched to disable warning 4702. If
6965
+    # it has, then we don't need to disable 4702 (unreachable code warning).
6966
+    # The patch is preapplied to the internal toolchain and hence all bots.
6967
+    'msvs_xtree_patched%': '<!pymod_do_main(win_is_xtree_patched)',
6968
+    # Clang stuff.
6969
+    'clang%': '<(clang)',
6970
+    'host_clang%': '<(host_clang)',
6971
+    'make_clang_dir%': '<(make_clang_dir)',
6972
+    'use_lld%': '<(use_lld)',
6973
+    # Control which version of clang to use when building for iOS.  If set to
6974
+    # '1', uses the version of clang that ships with Xcode.  If set to '0', uses
6975
+    # the version of clang that ships with the Chromium source.  This variable
6976
+    # is automatically set to '1' in Official builds.
6977
+    'clang_xcode%': 0,
6978
+    # These two variables can be set in GYP_DEFINES while running
6979
+    # |gclient runhooks| to let clang run a plugin in every compilation.
6980
+    # Only has an effect if 'clang=1' is in GYP_DEFINES as well.
6981
+    # Example:
6982
+    #     GYP_DEFINES='clang=1 clang_load=/abs/path/to/libPrintFunctionNames.dylib clang_add_plugin=print-fns' gclient runhooks
6983
+    'clang_load%': '',
6984
+    'clang_add_plugin%': '',
6985
+    # Tell ld64 to write map files describing binary layout. Useful
6986
+    # for looking at what contributes to binary size, e.g. with
6987
+    # https://github.com/nico/bloat
6988
+    'mac_write_linker_maps%': 0,
6989
+    # The default type of gtest.
6990
+    'gtest_target_type%': 'executable',
6991
+    # Enable sampling based profiler.
6992
+    # See http://google-perftools.googlecode.com/svn/trunk/doc/cpuprofile.html
6993
+    'profiling%': '0',
6994
+    # Profile without optimizing out stack frames when profiling==1.
6995
+    'profiling_full_stack_frames%': '0',
6996
+    # And if we want to dump symbols for Breakpad-enabled builds.
6997
+    'linux_dump_symbols%': 0,
6998
+    # And if we want to strip the binary after dumping symbols.
6999
+    'linux_strip_binary%': 0,
7000
+    # If we want stack unwind support for backtrace().
7001
+    'debug_unwind_tables%': 1,
7002
+    'release_unwind_tables%': 1,
7003
+    # Override where to find binutils
7004
+    'binutils_version%': 0,
7005
+    'binutils_dir%': '',
7006
+    # Enable TCMalloc.
7007
+    # Default of 'use_allocator' is set to 'none' if OS=='android' later.
7008
+    'use_allocator%': 'tcmalloc',
7009
+    # Set to 1 to link against gsettings APIs instead of using dlopen().
7010
+    'linux_link_gsettings%': 0,
7011
+    # Enable use of OpenMAX DL FFT routines.
7012
+    'use_openmax_dl_fft%': '<(use_openmax_dl_fft)',
7013
+    # Enable new NPDevice API.
7014
+    'enable_new_npdevice_api%': 0,
7015
+    # .gyp files or targets should set chromium_code to 1 if they build
7016
+    # Chromium-specific code, as opposed to external code.  This variable is
7017
+    # used to control such things as the set of warnings to enable, and
7018
+    # whether warnings are treated as errors.
7019
+    'chromium_code%': 0,
7020
+    # Disable fatal linker warnings, similarly to how we make it possible
7021
+    # to disable -Werror (e.g. for different toolchain versions).
7022
+    'disable_fatal_linker_warnings%': 0,
7023
+    'release_valgrind_build%': 0,
7024
+    # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
7025
+    'enable_wexit_time_destructors%': 0,
7026
+    # Set to 1 to compile with the OpenGL ES 2.0 conformance tests.
7027
+    'internal_gles2_conform_tests%': 0,
7028
+    # Set to 1 to compile with the Khronos GL-CTS conformance tests.
7029
+    'internal_khronos_glcts_tests%': 0,
7030
+    # Set to 1 to compile the filter fuzzer.
7031
+    'internal_filter_fuzzer%': 0,
7032
+    # NOTE: When these end up in the Mac bundle, we need to replace '-' for '_'
7033
+    # so Cocoa is happy (http://crbug.com/20441).
7034
+    'locales': [
7035
+      'am', 'ar', 'bg', 'bn', 'ca', 'cs', 'da', 'de', 'el', 'en-GB',
7036
+      'en-US', 'es-419', 'es', 'et', 'fa', 'fi', 'fil', 'fr', 'gu', 'he',
7037
+      'hi', 'hr', 'hu', 'id', 'it', 'ja', 'kn', 'ko', 'lt', 'lv',
7038
+      'ml', 'mr', 'ms', 'nb', 'nl', 'pl', 'pt-BR', 'pt-PT', 'ro', 'ru',
7039
+      'sk', 'sl', 'sr', 'sv', 'sw', 'ta', 'te', 'th', 'tr', 'uk',
7040
+      'vi', 'zh-CN', 'zh-TW',
7041
+    ],
7042
+    # Pseudo locales are special locales which are used for testing and
7043
+    # debugging. They don't get copied to the final app. For more info,
7044
+    # check out https://www.chromium.org/developers/testing/fake-bidi
7045
+    'pseudo_locales': [
7046
+      'fake-bidi',
7047
+    ],
7048
+    'grit_defines': [],
7049
+    # If debug_devtools is set to 1, JavaScript files for DevTools are
7050
+    # stored as is and loaded from disk. Otherwise, a concatenated file
7051
+    # is stored in resources.pak. It is still possible to load JS files
7052
+    # from disk by passing --debug-devtools cmdline switch.
7053
+    'debug_devtools%': 0,
7054
+    # The Java Bridge is not compiled in by default.
7055
+    'java_bridge%': 0,
7056
+    # Code signing for iOS binaries.  The bots need to be able to disable this.
7057
+    'chromium_ios_signing%': 1,
7058
+    # Identity to use for code signing of iOS binaries.  Change this on machines
7059
+    # with multiple identities in their security keychain.
7060
+    'chromium_ios_signing_identity%': 'iPhone Developer',
7061
+    # This flag is only used when disable_nacl==0 and disables all those
7062
+    # subcomponents which would require the installation of a native_client
7063
+    # untrusted toolchain.
7064
+    'disable_nacl_untrusted%': 0,
7065
+    # PNaCl toolchain does not support sanitizers. Disable by default.
7066
+    'enable_nacl_nonsfi_test%': 0,
7067
+    # Disable Dart by default.
7068
+    'enable_dart%': 0,
7069
+    # Copy out the setting of disable_nacl.
7070
+    'disable_nacl%': '<(disable_nacl)',
7071
+    # Native Client toolchains, enabled by default.
7072
+    'disable_pnacl%': '<(disable_pnacl)',
7073
+    'disable_newlib%': '<(disable_newlib)',
7074
+    # Whether to build full debug version for Debug configuration on Android.
7075
+    # Compared to full debug version, the default Debug configuration on Android
7076
+    # has no full v8 debug, has size optimization and linker gc section, so that
7077
+    # we can build a debug version with acceptable size and performance.
7078
+    'android_full_debug%': 0,
7079
+    # Contains data about the attached devices for gyp_managed_install.
7080
+    'build_device_config_path': '<(PRODUCT_DIR)/build_devices.cfg',
7081
+    'wix_exists': '<!pymod_do_main(dir_exists "<(wix_path)")',
7082
+    'windows_sdk_path%': 'C:/Program Files (x86)/Windows Kits/10',
7083
+    'directx_sdk_default_path': '<(DEPTH)/third_party/directxsdk/files',
7084
+    # Whether we are using the rlz library or not.  Platforms like Android send
7085
+    # rlz codes for searches but do not use the library.
7086
+    'enable_rlz_support%': 0,
7087
+    'enable_rlz%': 0,
7088
+    # Turns on the i18n support in V8.
7089
+    'v8_enable_i18n_support': 1,
7090
+    # Compile the v8 shell for the host toolset.
7091
+    'v8_toolset_for_shell': 'host',
7092
+    # V8 extras
7093
+    # Adding V8 extras files requires API owners review
7094
+    # Be sure to synchronize with build/module_args/v8.gni
7095
+    'v8_extra_library_files': [
7096
+      '../third_party/WebKit/Source/core/streams/ByteLengthQueuingStrategy.js',
7097
+      '../third_party/WebKit/Source/core/streams/CountQueuingStrategy.js',
7098
+      '../third_party/WebKit/Source/core/streams/ReadableStream.js',
7099
+    ],
7100
+    'v8_experimental_extra_library_files': [
7101
+    ],
7102
+    # Use brlapi from brltty for braille display support.
7103
+    'use_brlapi%': 0,
7104
+    # Relative path to icu.gyp from this file.
7105
+    'icu_gyp_path': '../third_party/icu/icu.gyp',
7106
+    # IPC fuzzer is disabled by default.
7107
+    'enable_ipc_fuzzer%': 0,
7108
+    # Force disable libstdc++ debug mode.
7109
+    'disable_glibcxx_debug%': 0,
7110
+    # Support ChromeOS touchpad gestures with ozone.
7111
+    'use_evdev_gestures%': 0,
7112
+    # Default ozone platform (if no --ozone-platform flag).
7113
+    'ozone_platform%': "",
7114
+    # Ozone platforms to include in the build.
7115
+    'ozone_platform_caca%': 0,
7116
+    'ozone_platform_cast%': 0,
7117
+    'ozone_platform_gbm%': 0,
7118
+    'ozone_platform_headless%': 0,
7119
+    'ozone_platform_wayland%': 0,
7120
+    # Experiment: http://crbug.com/426914
7121
+    'envoy%': 0,
7122
+    # Used to set libjpeg_gyp_path. Chrome OS ui/gfx/gfx.gyp uses the IJG path
7123
+    # for robust login screen decoding.
7124
+    'libjpeg_ijg_gyp_path': '<(DEPTH)/third_party/libjpeg/libjpeg.gyp',
7125
+    'libjpeg_turbo_gyp_path': '<(DEPTH)/third_party/libjpeg_turbo/libjpeg.gyp',
7126
+    'conditions': [
7127
+      # Enable the Syzygy optimization step for the official builds.
7128
+      ['OS=="win" and buildtype=="Official" and syzyasan!=1 and clang!=1', {
7129
+        'syzygy_optimize%': 1,
7130
+      }, {
7131
+        'syzygy_optimize%': 0,
7132
+      }],
7133
+      ['sanitizer_coverage==1', {
7134
+        'sanitizer_coverage': 'edge,indirect-calls,8bit-counters',
7135
+      }],
7136
+      # Get binutils version so we can enable debug fission if we can.
7137
+      ['os_posix==1 and OS!="mac" and OS!="ios"', {
7138
+        'conditions': [
7139
+          # compiler_version doesn't work with clang
7140
+          # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
7141
+          # compiler_version works with clang.
7142
+          # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
7143
+          # that it takes effect here.
7144
+          ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_security==0 and ubsan_vptr==0', {
7145
+            'binutils_version%': '<!pymod_do_main(compiler_version target assembler)',
7146
+          }],
7147
+          # On Android we know the binutils version in the toolchain.
7148
+          ['OS=="android"', {
7149
+            'binutils_version%': 222,
7150
+          }],
7151
+          ['host_arch=="x64"', {
7152
+            'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
7153
+          }],
7154
+          ['host_arch=="ia32"', {
7155
+            'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin',
7156
+          }],
7157
+          # Our version of binutils in third_party/binutils
7158
+          ['linux_use_bundled_binutils==1', {
7159
+            'binutils_version%': 224,
7160
+          }],
7161
+        ],
7162
+      }, {
7163
+        'binutils_version%': 0,
7164
+      }],
7165
+      ['OS=="win" and "<!pymod_do_main(dir_exists <(directx_sdk_default_path))"=="True"', {
7166
+        'directx_sdk_path%': '<(directx_sdk_default_path)',
7167
+      }, {
7168
+        'directx_sdk_path%': '$(DXSDK_DIR)',
7169
+      }],
7170
+      ['OS=="win"', {
7171
+        'windows_driver_kit_path%': '$(WDK_DIR)',
7172
+        'conditions': [
7173
+          ['component!="shared_library"', {
7174
+            'single_module_mode_handle_verifier%': 0,
7175
+          }, {
7176
+            'single_module_mode_handle_verifier%': 1,
7177
+          }],
7178
+        ],
7179
+      }],
7180
+      ['os_posix==1 and OS!="mac" and OS!="ios"', {
7181
+        'conditions': [
7182
+          ['target_arch=="mipsel" or target_arch=="mips64el"', {
7183
+            'werror%': '',
7184
+            'disable_nacl%': 1,
7185
+            'nacl_untrusted_build%': 0,
7186
+            'use_allocator%': 'none',
7187
+          }],
7188
+          # Use a 64-bit linker to avoid running out of address space. The
7189
+          # buildbots should have a 64-bit kernel and a 64-bit libc installed.
7190
+          ['host_arch=="ia32" and target_arch=="ia32"', {
7191
+            # TODO(thestig) This is a horrible way to force the desired
7192
+            # configuration. Our gyp variable scoping is likely wrong and
7193
+            # needs to be cleaned up. The GN configuration should be changed
7194
+            # to match.
7195
+            'binutils_version%': 224,
7196
+            'linux_use_bundled_binutils%': '1',
7197
+            'linux_use_bundled_gold%': '1',
7198
+            'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
7199
+          }],
7200
+          # All Chrome builds have breakpad symbols, but only process the
7201
+          # symbols from official builds.
7202
+          ['(branding=="Chrome" and buildtype=="Official")', {
7203
+            'linux_dump_symbols%': 1,
7204
+            # Omit unwind support in official release builds to save space. We
7205
+            # can use breakpad for these builds.
7206
+            'release_unwind_tables%': 0,
7207
+          }],
7208
+        ],
7209
+      }],  # os_posix==1 and OS!="mac" and OS!="ios"
7210
+      ['OS=="ios"', {
7211
+        'disable_nacl%': 1,
7212
+        'icu_use_data_file_flag%': 1,
7213
+        'enable_web_speech%': 0,
7214
+        'use_system_libxml%': 1,
7215
+        'use_system_sqlite%': 1,
7216
+        'locales==': [
7217
+          'ar', 'ca', 'cs', 'da', 'de', 'el', 'en-GB', 'en-US', 'es', 'es-MX',
7218
+          'fi', 'fr', 'he', 'hi', 'hr', 'hu', 'id', 'it', 'ja', 'ko', 'ms',
7219
+          'nb', 'nl', 'pl', 'pt', 'pt-PT', 'ro', 'ru', 'sk', 'sv', 'th', 'tr',
7220
+          'uk', 'vi', 'zh-CN', 'zh-TW',
7221
+        ],
7222
+        # iOS SDK and deployment target support.  The |ios_sdk| value is left
7223
+        # blank so that when it is set in the project files it will be the
7224
+        # "current" iOS SDK.  Forcing a specific SDK even if it is "current"
7225
+        # causes Xcode to spit out a warning for every single project file for
7226
+        # not using the "current" SDK.
7227
+        'ios_sdk%': '',
7228
+        'ios_sdk_path%': '',
7229
+        'ios_deployment_target%': '9.0',
7230
+        'conditions': [
7231
+          # ios_product_name is set to the name of the .app bundle as it should
7232
+          # appear on disk.
7233
+          ['branding=="Chrome"', {
7234
+            'ios_product_name%': 'Chrome',
7235
+          }, { # else: branding!="Chrome"
7236
+            'ios_product_name%': 'Chromium',
7237
+          }],
7238
+          ['branding=="Chrome" and buildtype=="Official"', {
7239
+            'ios_breakpad%': 1,
7240
+          }, { # else: branding!="Chrome" or buildtype!="Official"
7241
+            'ios_breakpad%': 0,
7242
+          }],
7243
+        ],
7244
+      }],  # OS=="ios"
7245
+      ['OS=="android"', {
7246
+        # Location of Android NDK.
7247
+        'variables': {
7248
+          'variables': {
7249
+            # Standard libraries can use the relative path to the NDK.
7250
+            'android_ndk_root%': '../../third_party/android_tools/ndk/',
7251
+            # Unfortunately, it is required to use the absolute path to the SDK
7252
+            # because it us passed to ant which uses a different relative path
7253
+            # from GYP.
7254
+            'android_sdk_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/sdk/',
7255
+            # Similarly, gdbserver and the Android toolchain need to use the
7256
+            # absolute path to the NDK because they are used at different levels
7257
+            # in the GYP files.
7258
+            'android_ndk_absolute_root%': '<!(cd <(DEPTH) && pwd -P)/third_party/android_tools/ndk/',
7259
+            'android_host_arch%': '<!(uname -m)',
7260
+            # Version of the NDK. Used to ensure full rebuilds on NDK rolls.
7261
+            'android_ndk_version%': 'r10e',
7262
+            # Android API-level of the SDK used for compilation.
7263
+            'android_sdk_version%': '23',
7264
+            'android_sdk_build_tools_version%': '23.0.1',
7265
+            'host_os%': "<!(uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/')",
7266
+            'conditions': [
7267
+              # Figure this out early since it needs symbols from libgcc.a, so it
7268
+              # has to be before that in the set of libraries.
7269
+              # ASan needs to dynamically link to libc++ even in static builds so
7270
+              # that it can interpose operator new.
7271
+              ['component=="shared_library" or asan==1', {
7272
+                  'android_libcpp_library': 'c++_shared',
7273
+                  'android_must_copy_system_libraries': 1,
7274
+              }, {
7275
+                  'android_libcpp_library': 'c++_static',
7276
+                  'android_must_copy_system_libraries': 0,
7277
+              }],
7278
+            ],
7279
+          },
7280
+          # Copy conditionally-set variables out one scope.
7281
+          'android_ndk_root%': '<(android_ndk_root)',
7282
+          'android_ndk_absolute_root%': '<(android_ndk_absolute_root)',
7283
+          'android_ndk_version%': '<(android_ndk_version)',
7284
+          'android_sdk_root%': '<(android_sdk_root)',
7285
+          'android_sdk_version%': '<(android_sdk_version)',
7286
+          'android_sdk_build_tools_version%': '<(android_sdk_build_tools_version)',
7287
+          'android_libcpp_root': '<(android_ndk_root)/sources/cxx-stl/llvm-libc++',
7288
+          'android_libcpp_library': '<(android_libcpp_library)',
7289
+          'android_must_copy_system_libraries': '<(android_must_copy_system_libraries)',
7290
+          'host_os%': '<(host_os)',
7291
+          'android_sdk%': '<(android_sdk_root)/platforms/android-<(android_sdk_version)',
7292
+          # Android SDK build tools (e.g. dx, aidl)
7293
+          'android_sdk_tools%': '<(android_sdk_root)/build-tools/<(android_sdk_build_tools_version)',
7294
+          # Android API level 16 is JB (Android 4.1) which is the minimum
7295
+          # platform requirement for Chrome on Android, we use it for native
7296
+          # code compilation.
7297
+          'conditions': [
7298
+            ['target_arch == "ia32"', {
7299
+              'android_app_abi%': 'x86',
7300
+              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86/gdbserver/gdbserver',
7301
+              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-x86',
7302
+              'android_ndk_lib_dir%': 'usr/lib',
7303
+              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
7304
+            }],
7305
+            ['target_arch == "x64"', {
7306
+              'android_app_abi%': 'x86_64',
7307
+              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-x86_64/gdbserver/gdbserver',
7308
+              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-x86_64',
7309
+              'android_ndk_lib_dir%': 'usr/lib64',
7310
+              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/x86_64-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
7311
+            }],
7312
+            ['target_arch=="arm"', {
7313
+              'conditions': [
7314
+                ['arm_version<7', {
7315
+                  'android_app_abi%': 'armeabi',
7316
+                }, {
7317
+                  'android_app_abi%': 'armeabi-v7a',
7318
+                }],
7319
+              ],
7320
+              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm/gdbserver/gdbserver',
7321
+              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-arm',
7322
+              'android_ndk_lib_dir%': 'usr/lib',
7323
+              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/arm-linux-androideabi-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
7324
+            }],
7325
+            ['target_arch == "arm64"', {
7326
+              'android_app_abi%': 'arm64-v8a',
7327
+              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-arm64/gdbserver/gdbserver',
7328
+              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-arm64',
7329
+              'android_ndk_lib_dir%': 'usr/lib',
7330
+              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/aarch64-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
7331
+            }],
7332
+            ['target_arch == "mipsel"', {
7333
+              'android_app_abi%': 'mips',
7334
+              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips/gdbserver/gdbserver',
7335
+              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-16/arch-mips',
7336
+              'android_ndk_lib_dir%': 'usr/lib',
7337
+              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mipsel-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
7338
+            }],
7339
+            ['target_arch == "mips64el"', {
7340
+              'android_app_abi%': 'mips64',
7341
+              'android_gdbserver%': '<(android_ndk_absolute_root)/prebuilt/android-mips64/gdbserver/gdbserver',
7342
+              'android_ndk_sysroot%': '<(android_ndk_root)/platforms/android-21/arch-mips64',
7343
+              'android_ndk_lib_dir%': 'usr/lib64',
7344
+              'android_toolchain%': '<(android_ndk_absolute_root)/toolchains/mips64el-linux-android-4.9/prebuilt/<(host_os)-<(android_host_arch)/bin',
7345
+            }],
7346
+          ],
7347
+        },
7348
+        # Copy conditionally-set variables out one scope.
7349
+        'android_app_abi%': '<(android_app_abi)',
7350
+        'android_gdbserver%': '<(android_gdbserver)',
7351
+        'android_ndk_root%': '<(android_ndk_root)',
7352
+        'android_ndk_sysroot%': '<(android_ndk_sysroot)',
7353
+        'android_ndk_version%': '<(android_ndk_version)',
7354
+        'android_sdk_root%': '<(android_sdk_root)',
7355
+        'android_sdk_version%': '<(android_sdk_version)',
7356
+        'android_toolchain%': '<(android_toolchain)',
7357
+        'android_ndk_include': '<(android_ndk_sysroot)/usr/include',
7358
+        'android_ndk_lib': '<(android_ndk_sysroot)/<(android_ndk_lib_dir)',
7359
+        'android_sdk_build_tools_version%': '<(android_sdk_build_tools_version)',
7360
+        'android_sdk_tools%': '<(android_sdk_tools)',
7361
+        'android_aapt_path%': '<(android_sdk_tools)/aapt',
7362
+        'android_sdk%': '<(android_sdk)',
7363
+        'android_sdk_jar%': '<(android_sdk)/android.jar',
7364
+        'android_libcpp_root': '<(android_libcpp_root)',
7365
+        'android_libcpp_library': '<(android_libcpp_library)',
7366
+        'android_libcpp_include': '<(android_libcpp_root)/libcxx/include',
7367
+        'android_libcpp_libs_dir%': '<(android_libcpp_root)/libs/<(android_app_abi)',
7368
+        'android_must_copy_system_libraries': '<(android_must_copy_system_libraries)',
7369
+        'host_os%': '<(host_os)',
7370
+        # Location of the "objcopy" binary, used by both gyp and scripts.
7371
+        'android_objcopy%' : '<!(/bin/echo -n <(android_toolchain)/*-objcopy)',
7372
+        # Location of the "strip" binary, used by both gyp and scripts.
7373
+        'android_strip%' : '<!(/bin/echo -n <(android_toolchain)/*-strip)',
7374
+        # Location of the "readelf" binary.
7375
+        'android_readelf%' : '<!(/bin/echo -n <(android_toolchain)/*-readelf)',
7376
+        # Determines whether we should optimize JNI generation at the cost of
7377
+        # breaking assumptions in the build system that when inputs have changed
7378
+        # the outputs should always change as well.  This is meant purely for
7379
+        # developer builds, to avoid spurious re-linking of native files.
7380
+        'optimize_jni_generation%': '<(optimize_jni_generation)',
7381
+        # Use OpenSSL's struct X509 to represent certificates.
7382
+        'use_openssl_certs%': 1,
7383
+        'proprietary_codecs%': '<(proprietary_codecs)',
7384
+        'safe_browsing%': 2,
7385
+        'enable_web_speech%': 0,
7386
+        'java_bridge%': 1,
7387
+        'use_allocator%': 'none',
7388
+        # Disable Native Client.
7389
+        'disable_nacl%': 1,
7390
+        # Sessions are store separately in the Java side.
7391
+        'enable_session_service%': 0,
7392
+        'p2p_apis%' : 0,
7393
+        'gtest_target_type%': 'shared_library',
7394
+      }],  # OS=="android"
7395
+      ['embedded==1', {
7396
+        'use_system_fontconfig%': 0,
7397
+      }, {
7398
+        'use_system_fontconfig%': 1,
7399
+      }],
7400
+      ['chromecast==1', {
7401
+        'conditions': [
7402
+          ['target_arch=="arm"', {
7403
+            'arm_arch%': '',
7404
+            'arm_tune%': 'cortex-a9',
7405
+            'arm_thumb%': 1,
7406
+          }],
7407
+          # TODO(dalecurtis): What audio codecs does Chromecast want here?  Sort
7408
+          # out and add configs if necessary.  http://crbug.com/570754
7409
+          ['OS!="android"', {
7410
+            'ffmpeg_branding%': 'ChromeOS',
7411
+          }],
7412
+        ],
7413
+      }],
7414
+      ['OS=="linux"', {
7415
+        'clang%': 1,
7416
+        'conditions': [
7417
+          ['target_arch=="arm64"', {
7418
+            # Temporarily disable nacl and tcmalloc on arm64 linux to get
7419
+            # rid of compilation errors.
7420
+            'disable_nacl%': 1,
7421
+            'use_allocator%': 'none',
7422
+          }],
7423
+        ],
7424
+      }],  # OS=="mac"
7425
+      ['OS=="mac"', {
7426
+        'conditions': [
7427
+          # All Chrome builds have breakpad symbols, but only process the
7428
+          # symbols from official builds.
7429
+          ['(branding=="Chrome" and buildtype=="Official")', {
7430
+            'mac_strip_release%': 1,
7431
+          }],
7432
+        ],
7433
+      }],  # OS=="mac"
7434
+      ['OS=="mac" or OS=="ios"', {
7435
+        'clang%': 1,
7436
+        # On Mac and iOS we just use the default system allocator.
7437
+        'use_allocator%': 'none',
7438
+        'variables': {
7439
+          # Mac OS X SDK and deployment target support.  The SDK identifies
7440
+          # the version of the system headers that will be used, and
7441
+          # corresponds to the MAC_OS_X_VERSION_MAX_ALLOWED compile-time
7442
+          # macro.  "Maximum allowed" refers to the operating system version
7443
+          # whose APIs are available in the headers.  The deployment target
7444
+          # identifies the minimum system version that the built products are
7445
+          # expected to function on.  It corresponds to the
7446
+          # MAC_OS_X_VERSION_MIN_REQUIRED compile-time macro.  To ensure these
7447
+          # macros are available, #include <AvailabilityMacros.h>.  Additional
7448
+          # documentation on these macros is available at
7449
+          # http://developer.apple.com/mac/library/technotes/tn2002/tn2064.html#SECTION3
7450
+          # Chrome normally builds with the Mac OS X 10.10 SDK and sets the
7451
+          # deployment target to 10.7.  Other projects, such as O3D, may
7452
+          # override these defaults.
7453
+          # Normally, mac_sdk_min is used to find an SDK that Xcode knows
7454
+          # about that is at least the specified version. In official builds,
7455
+          # the SDK must match mac_sdk_min exactly. If the SDK is installed
7456
+          # someplace that Xcode doesn't know about, set mac_sdk_path to the
7457
+          # path to the SDK; when set to a non-empty string, SDK detection
7458
+          # based on mac_sdk_min will be bypassed entirely.
7459
+          'mac_deployment_target%': '10.7',
7460
+          'mac_sdk_min%': '10.10',
7461
+          'mac_sdk_path%': '',
7462
+        },
7463
+        'mac_sdk_min': '<(mac_sdk_min)',
7464
+        'mac_sdk_path': '<(mac_sdk_path)',
7465
+        'mac_deployment_target': '<(mac_deployment_target)',
7466
+        # Compile in Breakpad support by default so that it can be
7467
+        # tested, even if it is not enabled by default at runtime.
7468
+        'mac_breakpad_compiled_in%': 1,
7469
+        'conditions': [
7470
+          # mac_product_name is set to the name of the .app bundle as it should
7471
+          # appear on disk.  This duplicates data from
7472
+          # chrome/app/theme/chromium/BRANDING and
7473
+          # chrome/app/theme/google_chrome/BRANDING, but is necessary to get
7474
+          # these names into the build system.
7475
+          ['branding=="Chrome"', {
7476
+            'mac_product_name%': 'Google Chrome',
7477
+          }, { # else: branding!="Chrome"
7478
+            'mac_product_name%': 'Chromium',
7479
+          }],
7480
+          # Official mac builds require a specific OS X SDK, but iOS and
7481
+          # non-official mac builds do not.
7482
+          ['branding=="Chrome" and buildtype=="Official" and OS=="mac"', {
7483
+            'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py --verify <(mac_sdk_min) --sdk_path=<(mac_sdk_path))',
7484
+          }, {
7485
+            'mac_sdk%': '<!(python <(DEPTH)/build/mac/find_sdk.py <(mac_sdk_min))',
7486
+          }],
7487
+          ['branding=="Chrome" and buildtype=="Official"', {
7488
+            # Enable uploading crash dumps.
7489
+            'mac_breakpad_uploads%': 1,
7490
+            # Enable dumping symbols at build time for use by Mac Breakpad.
7491
+            'mac_breakpad%': 1,
7492
+            # Enable Keystone auto-update support.
7493
+            'mac_keystone%': 1,
7494
+          }, { # else: branding!="Chrome" or buildtype!="Official"
7495
+            'mac_breakpad_uploads%': 0,
7496
+            'mac_breakpad%': 0,
7497
+            'mac_keystone%': 0,
7498
+          }],
7499
+        ],
7500
+      }],  # OS=="mac" or OS=="ios"
7501
+      ['OS=="win"', {
7502
+        'conditions': [
7503
+          # This is the architecture convention used in WinSDK paths.
7504
+          ['target_arch=="ia32"', {
7505
+            'winsdk_arch%': 'x86',
7506
+          },{
7507
+            'winsdk_arch%': '<(target_arch)',
7508
+          }],
7509
+          ['component=="shared_library"', {
7510
+            'win_use_allocator_shim%': 0,
7511
+          }],
7512
+          ['component=="static_library"', {
7513
+            # Turn on multiple dll by default on Windows when in static_library.
7514
+            'chrome_multiple_dll%': 1,
7515
+          }],
7516
+          ['asan==1 or syzyasan==1', {
7517
+            'win_use_allocator_shim%': 0,
7518
+          }],
7519
+          # The AddressSanitizer build should be a console program as it prints
7520
+          # out stuff on stderr.
7521
+          ['asan==1', {
7522
+            'win_console_app%': 1,
7523
+          }, {
7524
+            'win_console_app%': 0,
7525
+          }],
7526
+          # Enable the Kasko reporter for syzyasan builds.
7527
+          ['syzyasan==1', {
7528
+            'kasko': 1,
7529
+          }],
7530
+          ['component=="shared_library"', {
7531
+            # Not enabled for component=static_library because some targets
7532
+            # are too large and the toolchain fails due to the size of the
7533
+            # .obj files.
7534
+            'incremental_chrome_dll%': 1,
7535
+          }],
7536
+          # Don't do incremental linking for large modules on 32-bit or when
7537
+          # component=static_library as the toolchain fails due to the size of
7538
+          # the .ilk files.
7539
+          ['MSVS_OS_BITS==32 or component=="static_library"', {
7540
+            'msvs_large_module_debug_link_mode%': '1',  # No
7541
+          },{
7542
+            'msvs_large_module_debug_link_mode%': '2',  # Yes
7543
+          }],
7544
+          ['chrome_pgo_phase!=0', {
7545
+            'full_wpo_on_official%': 1,
7546
+          }],
7547
+        ],
7548
+        'nacl_win64_defines': [
7549
+          # This flag is used to minimize dependencies when building
7550
+          # Native Client loader for 64-bit Windows.
7551
+          'NACL_WIN64',
7552
+        ],
7553
+        # Need to include allocator target, but exclude tcmalloc files.
7554
+        'use_allocator%': 'winheap',
7555
+      }],
7556
+      ['os_posix==1 and chromeos==0 and OS!="android" and OS!="ios" and embedded==0', {
7557
+        'use_cups%': 1,
7558
+      }, {
7559
+        'use_cups%': 0,
7560
+      }],
7561
+      ['enable_plugins==1 and (OS=="linux" or OS=="mac" or OS=="win") and chromecast==0', {
7562
+        'enable_pepper_cdms%': 1,
7563
+      }, {
7564
+        'enable_pepper_cdms%': 0,
7565
+      }],
7566
+      ['OS=="android" or chromecast==1', {
7567
+        'enable_browser_cdms%': 1,
7568
+      }, {
7569
+        'enable_browser_cdms%': 0,
7570
+      }],
7571
+      # Native Client glibc toolchain is enabled except on mips
7572
+      ['target_arch=="mipsel" or target_arch=="mips64el"', {
7573
+        'disable_glibc%': 1,
7574
+      }, {
7575
+        'disable_glibc%': 0,
7576
+      }],
7577
+      # Set the relative path from this file to the GYP file of the JPEG
7578
+      # library used by Chromium.
7579
+      ['use_system_libjpeg==1 or use_libjpeg_turbo==0', {
7580
+        # Configuration for using the system libjeg is here.
7581
+        'libjpeg_gyp_path': '<(libjpeg_ijg_gyp_path)',
7582
+      }, {
7583
+        'libjpeg_gyp_path': '<(libjpeg_turbo_gyp_path)',
7584
+      }],
7585
+      # Options controlling the use of GConf (the classic GNOME configuration
7586
+      # system) and GIO, which contains GSettings (the new GNOME config system).
7587
+      ['chromeos==1 or embedded==1', {
7588
+        'use_gconf%': 0,
7589
+        'use_gio%': 0,
7590
+      }, {
7591
+        'use_gconf%': 1,
7592
+        'use_gio%': 1,
7593
+      }],
7594
+      # Set up -D and -E flags passed into grit.
7595
+      ['branding=="Chrome"', {
7596
+        # TODO(mmoss) The .grd files look for _google_chrome, but for
7597
+        # consistency they should look for google_chrome_build like C++.
7598
+        'grit_defines': ['-D', '_google_chrome',
7599
+                         '-E', 'CHROMIUM_BUILD=google_chrome'],
7600
+      }, {
7601
+        'grit_defines': ['-D', '_chromium',
7602
+                         '-E', 'CHROMIUM_BUILD=chromium'],
7603
+      }],
7604
+      ['chromeos==1', {
7605
+        'grit_defines': ['-D', 'chromeos', '-D', 'scale_factors=2x'],
7606
+      }],
7607
+      ['desktop_linux==1', {
7608
+        'grit_defines': ['-D', 'desktop_linux'],
7609
+      }],
7610
+      ['toolkit_views==1', {
7611
+        'grit_defines': ['-D', 'toolkit_views'],
7612
+      }],
7613
+      ['use_aura==1', {
7614
+        'grit_defines': ['-D', 'use_aura'],
7615
+      }],
7616
+      ['use_ash==1', {
7617
+        'grit_defines': ['-D', 'use_ash'],
7618
+      }],
7619
+      ['use_nss_certs==1', {
7620
+        'grit_defines': ['-D', 'use_nss_certs'],
7621
+      }],
7622
+      ['use_ozone==1', {
7623
+        'grit_defines': ['-D', 'use_ozone'],
7624
+      }],
7625
+      ['image_loader_extension==1', {
7626
+        'grit_defines': ['-D', 'image_loader_extension'],
7627
+      }],
7628
+      ['use_titlecase_in_grd==1', {
7629
+        'grit_defines': ['-D', 'use_titlecase'],
7630
+      }],
7631
+      ['OS=="android"', {
7632
+        'grit_defines': [
7633
+          '-t', 'android',
7634
+          '-E', 'ANDROID_JAVA_TAGGED_ONLY=true',
7635
+          '--no-output-all-resource-defines',
7636
+        ],
7637
+      }],
7638
+      ['OS=="mac" or OS=="ios"', {
7639
+        'grit_defines': ['-D', 'scale_factors=2x'],
7640
+      }],
7641
+      ['OS == "ios"', {
7642
+        'variables': {
7643
+          'enable_coverage%': 0,
7644
+        },
7645
+        'grit_defines': [
7646
+          '-t', 'ios',
7647
+          '--no-output-all-resource-defines',
7648
+        ],
7649
+        # Enable host builds.
7650
+        'host_os%': "mac",
7651
+        'conditions': [
7652
+          # Use the version of clang shipped with Xcode when building official
7653
+          # version of Chrome for iOS.
7654
+          #
7655
+          # TODO(eugenebut): Remove enable_coverage check once
7656
+          # libclang_rt.profile_ios.a is bundled with Chromium's clang.
7657
+          # http://crbug.com/450379
7658
+          ['buildtype=="Official" or enable_coverage', {
7659
+            'clang_xcode%': 1,
7660
+          }],
7661
+        ],
7662
+      }],
7663
+      ['enable_extensions==1', {
7664
+        'grit_defines': ['-D', 'enable_extensions'],
7665
+      }],
7666
+      ['enable_plugins!=0', {
7667
+        'grit_defines': ['-D', 'enable_plugins'],
7668
+      }],
7669
+      ['enable_basic_printing==1 or enable_print_preview==1', {
7670
+        'grit_defines': ['-D', 'enable_printing'],
7671
+      }],
7672
+      ['enable_print_preview==1', {
7673
+        'grit_defines': ['-D', 'enable_print_preview'],
7674
+      }],
7675
+      ['enable_themes==1', {
7676
+        'grit_defines': ['-D', 'enable_themes'],
7677
+      }],
7678
+      ['enable_app_list==1', {
7679
+        'grit_defines': ['-D', 'enable_app_list'],
7680
+      }],
7681
+      ['use_concatenated_impulse_responses==1', {
7682
+        'grit_defines': ['-D', 'use_concatenated_impulse_responses'],
7683
+      }],
7684
+      ['enable_media_router==1', {
7685
+        'grit_defines': ['-D', 'enable_media_router'],
7686
+      }],
7687
+      ['enable_webrtc==1', {
7688
+        'grit_defines': ['-D', 'enable_webrtc'],
7689
+      }],
7690
+      ['enable_hangout_services_extension==1', {
7691
+        'grit_defines': ['-D', 'enable_hangout_services_extension'],
7692
+      }],
7693
+      ['enable_task_manager==1', {
7694
+        'grit_defines': ['-D', 'enable_task_manager'],
7695
+      }],
7696
+      ['notifications==1', {
7697
+        'grit_defines': ['-D', 'enable_notifications'],
7698
+      }],
7699
+      ['mac_views_browser==1', {
7700
+        'grit_defines': ['-D', 'mac_views_browser'],
7701
+      }],
7702
+      ['enable_resource_whitelist_generation==1 and OS!="win"', {
7703
+        'grit_rc_header_format': ['-h', '#define {textual_id} _Pragma("whitelisted_resource_{numeric_id}") {numeric_id}'],
7704
+      }],
7705
+      ['enable_resource_whitelist_generation==1 and OS=="win"', {
7706
+        'grit_rc_header_format': ['-h', '#define {textual_id} __pragma(message("whitelisted_resource_{numeric_id}")) {numeric_id}'],
7707
+      }],
7708
+      ['enable_mdns==1 or OS=="mac"', {
7709
+        'grit_defines': ['-D', 'enable_service_discovery'],
7710
+        'enable_service_discovery%': 1
7711
+      }],
7712
+      ['clang_use_chrome_plugins==1', {
7713
+        'variables': {
7714
+          'conditions': [
7715
+            ['OS!="win"', {
7716
+              'variables': {
7717
+                'conditions': [
7718
+                  ['OS=="mac" or OS=="ios"', {
7719
+                    'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib',
7720
+                  }, { # OS != "mac" or OS != "ios"
7721
+                    'clang_lib_path%': '<!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.so',
7722
+                  }],
7723
+                ],
7724
+              },
7725
+              'clang_dynlib_flags%': '-Xclang -load -Xclang <(clang_lib_path) ',
7726
+            }, { # OS == "win"
7727
+              # On Windows, the plugin is built directly into clang, so there's
7728
+              # no need to load it dynamically.
7729
+              'clang_dynlib_flags%': '',
7730
+            }],
7731
+            ['(OS=="android" or OS=="linux") and chromecast==0', {
7732
+              'clang_plugin_check_ipc_arg': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-ipc',
7733
+            }, {
7734
+              'clang_plugin_check_ipc_arg': '',
7735
+            }],
7736
+          ],
7737
+          'clang_plugin_args%': '-Xclang -plugin-arg-find-bad-constructs -Xclang check-templates '
7738
+          '-Xclang -plugin-arg-find-bad-constructs -Xclang follow-macro-expansion ',
7739
+        },
7740
+        # If you change these, also change build/config/clang/BUILD.gn.
7741
+        'clang_chrome_plugins_flags%':
7742
+          '<(clang_dynlib_flags)'
7743
+          '-Xclang -add-plugin -Xclang find-bad-constructs <(clang_plugin_args) <(clang_plugin_check_ipc_arg)',
7744
+      }],
7745
+      ['asan==1 or msan==1 or lsan==1 or tsan==1', {
7746
+        'clang%': 1,
7747
+        'use_allocator%': 'none',
7748
+        'use_sanitizer_options%': 1,
7749
+      }],
7750
+      ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and lsan==0 and tsan==0 and build_for_tool==""', {
7751
+        'use_experimental_allocator_shim%': 1,
7752
+      }],
7753
+      ['OS=="linux" and asan==0 and msan==0 and lsan==0 and tsan==0', {
7754
+        # PNaCl toolchain Non-SFI build only supports linux OS build.
7755
+        # Also, it does not support sanitizers.
7756
+        'enable_nacl_nonsfi_test%': 1,
7757
+      }],
7758
+      ['asan==1 and OS=="linux" and chromeos==0', {
7759
+        'use_custom_libcxx%': 1,
7760
+      }],
7761
+      ['ubsan==1', {
7762
+        'clang%': 1,
7763
+      }],
7764
+      ['ubsan_security==1', {
7765
+        'clang%': 1,
7766
+      }],
7767
+      ['ubsan_vptr==1', {
7768
+        'clang%': 1,
7769
+      }],
7770
+      ['asan==1 and OS=="mac"', {
7771
+        'mac_strip_release': 1,
7772
+      }],
7773
+      ['tsan==1', {
7774
+        'use_custom_libcxx%': 1,
7775
+      }],
7776
+      ['msan==1', {
7777
+        # Use a just-built, MSan-instrumented libc++ instead of the system-wide
7778
+        # libstdc++. This is required to avoid false positive reports whenever
7779
+        # the C++ standard library is used.
7780
+        'use_custom_libcxx%': 1,
7781
+        # Running the V8-generated code on an ARM simulator is a powerful hack
7782
+        # that allows the tool to see the memory accesses from JITted code.
7783
+        # Without this flag, JS code causes false positive reports from MSan.
7784
+        'v8_target_arch': 'arm64',
7785
+      }],
7786
+      # Build tweaks for DrMemory.
7787
+      # TODO(rnk): Combine with tsan config to share the builder.
7788
+      # http://crbug.com/108155
7789
+      ['build_for_tool=="drmemory"', {
7790
+        # These runtime checks force initialization of stack vars which blocks
7791
+        # DrMemory's uninit detection.
7792
+        'win_debug_RuntimeChecks': '0',
7793
+        # Iterator debugging is slow.
7794
+        'win_debug_disable_iterator_debugging': '1',
7795
+        # Try to disable optimizations that mess up stacks in a release build.
7796
+        # DrM-i#1054 (https://github.com/DynamoRIO/drmemory/issues/1054)
7797
+        # /O2 and /Ob0 (disable inline) cannot be used together because of a
7798
+        # compiler bug, so we use /Ob1 instead.
7799
+        'win_release_InlineFunctionExpansion': '1',
7800
+        'win_release_OmitFramePointers': '0',
7801
+        # Ditto for debug, to support bumping win_debug_Optimization.
7802
+        'win_debug_InlineFunctionExpansion': 0,
7803
+        'win_debug_OmitFramePointers': 0,
7804
+        # Keep the code under #ifndef NVALGRIND.
7805
+        'release_valgrind_build': 1,
7806
+      }],
7807
+      # RLZ library is used on Win, Mac, iOS and ChromeOS.
7808
+      ['OS=="win" or OS=="mac" or OS=="ios" or chromeos==1', {
7809
+        'enable_rlz_support%': 1,
7810
+        'conditions': [
7811
+          # RLZ is enabled for "Chrome" builds.
7812
+          ['branding=="Chrome"', {
7813
+            'enable_rlz%': 1,
7814
+          }],
7815
+        ],
7816
+      }],
7817
+      # Set default compiler flags depending on ARM version.
7818
+      ['arm_version==6', {
7819
+        'arm_arch%': 'armv6',
7820
+        'arm_tune%': '',
7821
+        'arm_fpu%': 'vfp',
7822
+        'arm_float_abi%': 'softfp',
7823
+        'arm_thumb%': 0,
7824
+      }],
7825
+      ['arm_version==7', {
7826
+        'arm_arch%': 'armv7-a',
7827
+        'arm_tune%': 'generic-armv7-a',
7828
+        'conditions': [
7829
+          ['arm_neon==1', {
7830
+            'arm_fpu%': 'neon',
7831
+          }, {
7832
+            'arm_fpu%': 'vfpv3-d16',
7833
+          }],
7834
+          ['OS=="android"', {
7835
+            'arm_float_abi%': 'softfp',
7836
+          }, {
7837
+            'arm_float_abi%': 'hard',
7838
+          }],
7839
+        ],
7840
+        'arm_thumb%': 1,
7841
+      }],
7842
+      # Set default compiler flags for MIPS floating-point support.
7843
+      ['target_arch=="mipsel"', {
7844
+        'mips_float_abi%': 'hard',
7845
+      }],
7846
+      ['target_arch=="mipsel" and mips_arch_variant=="r2"', {
7847
+        'mips_fpu_mode%': 'fp32',
7848
+      }, {
7849
+        'mips_fpu_mode%': '',
7850
+      }],
7851
+      # Enable brlapi by default for chromeos.
7852
+      ['chromeos==1', {
7853
+        'use_brlapi%': 1,
7854
+      }],
7855
+      ['use_ozone==1 and ozone_auto_platforms==1', {
7856
+        # Use headless as the default platform.
7857
+        'ozone_platform%': 'headless',
7858
+        'ozone_platform_headless%': 1,
7859
+        'conditions': [
7860
+          ['chromecast==1', {
7861
+            'ozone_platform_cast%': 1,
7862
+            'conditions': [
7863
+              # For desktop non-audio Chromecast builds, run with
7864
+              # --ozone-platform=x11
7865
+              # TODO(slan|halliwell): Make the default platform "cast" on
7866
+              # desktop non-audio builds too.
7867
+              ['is_cast_desktop_build==1 and disable_display==0', {
7868
+                # Use GN instead.
7869
+              }, {
7870
+                'ozone_platform%': 'cast',
7871
+              }],
7872
+            ],
7873
+          }, {  # chromecast!=1
7874
+            # Build all platforms whose deps are in install-build-deps.sh.
7875
+            # Only these platforms will be compile tested by buildbots.
7876
+            'conditions': [
7877
+              ['chromeos==1', {
7878
+                'ozone_platform_gbm%': 1,
7879
+              }],
7880
+            ],
7881
+          }],
7882
+        ],
7883
+      }],
7884
+      ['desktop_linux==1 and use_aura==1 and use_x11==1', {
7885
+        'use_clipboard_aurax11%': 1,
7886
+      }],
7887
+      ['OS=="win" and use_goma==1', {
7888
+        # goma doesn't support pch yet.
7889
+        'chromium_win_pch': 0,
7890
+        # goma doesn't support PDB yet, so win_z7=1 or fastbuild=1.
7891
+        'conditions': [
7892
+          ['win_z7==0 and fastbuild==0', {
7893
+            'fastbuild': 1,
7894
+          }],
7895
+        ],
7896
+      }],
7897
+      ['host_clang==1', {
7898
+        'host_cc': '<(make_clang_dir)/bin/clang',
7899
+        'host_cxx': '<(make_clang_dir)/bin/clang++',
7900
+      }, {
7901
+        'host_cc': '<!(which gcc)',
7902
+        'host_cxx': '<!(which g++)',
7903
+      }],
7904
+      # The seccomp-bpf sandbox is only supported on five architectures
7905
+      # currently.
7906
+      # Do not disable seccomp_bpf anywhere without talking to
7907
+      # security@chromium.org!
7908
+      ['((OS=="linux" or OS=="android") and '
7909
+           '(target_arch=="ia32" or target_arch=="x64" or '
7910
+             'target_arch=="arm" or target_arch=="mipsel" or '
7911
+             'target_arch=="arm64"))', {
7912
+         'use_seccomp_bpf%': 1,
7913
+      }, {
7914
+         'use_seccomp_bpf%': 0,
7915
+      }],
7916
+      ['cfi_vptr==1', {
7917
+        'use_lto%': 1,
7918
+      }],
7919
+      ['branding=="Chrome" and buildtype=="Official"', {
7920
+        'enable_hangout_services_extension%': 1,
7921
+      }, {
7922
+        'enable_hangout_services_extension%': 0,
7923
+      }],
7924
+    ],
7925
+    # The path to the ANGLE library.
7926
+    'angle_path': '<(DEPTH)/third_party/angle',
7927
+    # List of default apps to install in new profiles.  The first list contains
7928
+    # the source files as found in svn.  The second list, used only for linux,
7929
+    # contains the destination location for each of the files.  When a crx
7930
+    # is added or removed from the list, the chrome/browser/resources/
7931
+    # default_apps/external_extensions.json file must also be updated.
7932
+    #
7933
+    # README: GN version of these is in the target //chrome:default_apps
7934
+    # (there's no global variable like in GYP). Be sure to update that target
7935
+    # if you change these lists!
7936
+    'default_apps_list': [
7937
+      'browser/resources/default_apps/external_extensions.json',
7938
+      'browser/resources/default_apps/gmail.crx',
7939
+      'browser/resources/default_apps/youtube.crx',
7940
+      'browser/resources/default_apps/drive.crx',
7941
+      'browser/resources/default_apps/docs.crx',
7942
+    ],
7943
+    'default_apps_list_linux_dest': [
7944
+      '<(PRODUCT_DIR)/default_apps/external_extensions.json',
7945
+      '<(PRODUCT_DIR)/default_apps/gmail.crx',
7946
+      '<(PRODUCT_DIR)/default_apps/youtube.crx',
7947
+      '<(PRODUCT_DIR)/default_apps/drive.crx',
7948
+      '<(PRODUCT_DIR)/default_apps/docs.crx',
7949
+    ],
7950
+    # Whether to allow building of the GPU-related isolates.
7951
+    'archive_gpu_tests%': 0,
7952
+     # Whether to allow building of chromoting related isolates.
7953
+    'archive_chromoting_tests%': 0,
7954
+    # Whether to allow building of Media Router related isolates.
7955
+    'archive_media_router_tests%': 0,
7956
+  },
7957
+  'target_defaults': {
7958
+    'variables': {
7959
+      # The condition that operates on chromium_code is in a target_conditions
7960
+      # section, and will not have access to the default fallback value of
7961
+      # chromium_code at the top of this file, or to the chromium_code
7962
+      # variable placed at the root variables scope of .gyp files, because
7963
+      # those variables are not set at target scope.  As a workaround,
7964
+      # if chromium_code is not set at target scope, define it in target scope
7965
+      # to contain whatever value it has during early variable expansion.
7966
+      # That's enough to make it available during target conditional
7967
+      # processing.
7968
+      'chromium_code%': '<(chromium_code)',
7969
+      'component%': '<(component)',
7970
+      'chromecast%': '<(chromecast)',
7971
+      # See http://msdn.microsoft.com/en-us/library/aa652360(VS.71).aspx
7972
+      'win_release_Optimization%': '2', # 2 = /O2
7973
+      'win_debug_Optimization%': '0',   # 0 = /Od
7974
+      # See http://msdn.microsoft.com/en-us/library/2kxx5t2c(v=vs.80).aspx
7975
+      # Tri-state: blank is default, 1 on, 0 off
7976
+      'win_release_OmitFramePointers%': '0',
7977
+      # Tri-state: blank is default, 1 on, 0 off
7978
+      'win_debug_OmitFramePointers%': '',
7979
+      # See http://msdn.microsoft.com/en-us/library/8wtf2dfz(VS.71).aspx
7980
+      'win_debug_RuntimeChecks%': '3',    # 3 = all checks enabled, 0 = off
7981
+      # See http://msdn.microsoft.com/en-us/library/47238hez(VS.71).aspx
7982
+      'win_debug_InlineFunctionExpansion%': '',    # empty = default, 0 = off,
7983
+      'win_release_InlineFunctionExpansion%': '2', # 1 = only __inline, 2 = max
7984
+      # VS inserts quite a lot of extra checks to algorithms like
7985
+      # std::partial_sort in Debug build which make them O(N^2)
7986
+      # instead of O(N*logN). This is particularly slow under memory
7987
+      # tools like ThreadSanitizer so we want it to be disablable.
7988
+      # See http://msdn.microsoft.com/en-us/library/aa985982(v=VS.80).aspx
7989
+      'win_debug_disable_iterator_debugging%': '0',
7990
+      # An application manifest fragment to declare compatibility settings for
7991
+      # 'executable' targets. Ignored in other target type.
7992
+      'win_exe_compatibility_manifest%':
7993
+          '<(DEPTH)\\build\\win\\compatibility.manifest',
7994
+      'release_extra_cflags%': '',
7995
+      'debug_extra_cflags%': '',
7996
+      'release_valgrind_build%': '<(release_valgrind_build)',
7997
+      # the non-qualified versions are widely assumed to be *nix-only
7998
+      'win_release_extra_cflags%': '',
7999
+      'win_debug_extra_cflags%': '',
8000
+      # TODO(thakis): Make this a blacklist instead, http://crbug.com/101600
8001
+      'enable_wexit_time_destructors%': '<(enable_wexit_time_destructors)',
8002
+      # Only used by Windows build for now.  Can be used to build into a
8003
+      # differet output directory, e.g., a build_dir_prefix of VS2010_ would
8004
+      # output files in src/build/VS2010_{Debug,Release}.
8005
+      'build_dir_prefix%': '',
8006
+      # Targets are by default not nacl untrusted code.
8007
+      'nacl_untrusted_build%': 0,
8008
+      'pnacl_compile_flags': [
8009
+        # pnacl uses the clang compiler so we need to suppress all the
8010
+        # same warnings as we do for clang.
8011
+        # TODO(sbc): Remove these if/when they are removed from the clang
8012
+        # build.
8013
+        '-Wno-unused-function',
8014
+        '-Wno-char-subscripts',
8015
+        '-Wno-c++11-extensions',
8016
+        '-Wno-unnamed-type-template-args',
8017
+      ],
8018
+      # By default, Android targets have their exported JNI symbols stripped,
8019
+      # so we test the manual JNI registration code paths that are required
8020
+      # when using the crazy linker. To allow use of native JNI exports (lazily
8021
+      # resolved by the JVM), targets can enable this variable, which will stop
8022
+      # the stripping from happening. Only targets which do not need to be
8023
+      # compatible with the crazy linker are permitted to set this.
8024
+      'use_native_jni_exports%': 0,
8025
+      'conditions': [
8026
+        ['OS=="win" and component=="shared_library"', {
8027
+          # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
8028
+          'win_release_RuntimeLibrary%': '2', # 2 = /MD (nondebug DLL)
8029
+          'win_debug_RuntimeLibrary%': '3',   # 3 = /MDd (debug DLL)
8030
+        }, {
8031
+          # See http://msdn.microsoft.com/en-us/library/aa652367.aspx
8032
+          'win_release_RuntimeLibrary%': '0', # 0 = /MT (nondebug static)
8033
+          'win_debug_RuntimeLibrary%': '1',   # 1 = /MTd (debug static)
8034
+        }],
8035
+        ['OS=="ios"', {
8036
+          # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
8037
+          'mac_release_optimization%': 's', # Use -Os unless overridden
8038
+          'mac_debug_optimization%': '0',   # Use -O0 unless overridden
8039
+        }, {
8040
+          # See http://gcc.gnu.org/onlinedocs/gcc-4.4.2/gcc/Optimize-Options.html
8041
+          'mac_release_optimization%': '2', # Use -O2 unless overridden
8042
+          'mac_debug_optimization%': '0',   # Use -O0 unless overridden
8043
+        }],
8044
+        ['OS=="android"', {
8045
+          'host_os%': '<(host_os)',  # See comment above chromium_code.
8046
+        }],
8047
+      ],
8048
+      'clang_warning_flags': [
8049
+        '-Wheader-hygiene',
8050
+        # TODO(thakis): Consider -Wloop-analysis (turns on
8051
+        # -Wrange-loop-analysis too).
8052
+        # Don't die on dtoa code that uses a char as an array index.
8053
+        # This is required solely for base/third_party/dmg_fp/dtoa.cc.
8054
+        '-Wno-char-subscripts',
8055
+        # TODO(thakis): This used to be implied by -Wno-unused-function,
8056
+        # which we no longer use. Check if it makes sense to remove
8057
+        # this as well. http://crbug.com/316352
8058
+        '-Wno-unneeded-internal-declaration',
8059
+        # Warns on switches on enums that cover all enum values but
8060
+        # also contain a default: branch. Chrome is full of that.
8061
+        '-Wno-covered-switch-default',
8062
+        # Warns when a const char[] is converted to bool.
8063
+        '-Wstring-conversion',
8064
+        # C++11-related flags:
8065
+        # This warns on using ints as initializers for floats in
8066
+        # initializer lists (e.g. |int a = f(); CGSize s = { a, a };|),
8067
+        # which happens in several places in chrome code. Not sure if
8068
+        # this is worth fixing.
8069
+        '-Wno-c++11-narrowing',
8070
+        # Clang considers the `register` keyword as deprecated, but e.g.
8071
+        # code generated by flex (used in angle) contains that keyword.
8072
+        # http://crbug.com/255186
8073
+        '-Wno-deprecated-register',
8074
+        # TODO(hans): Get this cleaned up, http://crbug.com/428099
8075
+        '-Wno-inconsistent-missing-override',
8076
+        # TODO(thakis): Enable this, crbug.com/507717
8077
+        '-Wno-shift-negative-value',
8078
+        # TODO(thakis): https://crbug.com/604888
8079
+        '-Wno-undefined-var-template',
8080
+        # TODO(thakis): https://crbug.com/617318
8081
+        '-Wno-nonportable-include-path',
8082
+      ],
8083
+    },
8084
+    'defines': [
8085
+      # Don't use deprecated V8 APIs anywhere.
8086
+      'V8_DEPRECATION_WARNINGS',
8087
+    ],
8088
+    'include_dirs': [
8089
+      '<(SHARED_INTERMEDIATE_DIR)',
8090
+    ],
8091
+    'conditions': [
8092
+      ['OS=="mac"', {
8093
+        # When compiling Objective C, warns if a method is used whose
8094
+        # availability is newer than the deployment target.
8095
+        'xcode_settings': { 'WARNING_CFLAGS': ['-Wpartial-availability']},
8096
+      }],
8097
+      ['(OS=="mac" or OS=="ios") and asan==1', {
8098
+        'dependencies': [
8099
+          '<(DEPTH)/build/mac/asan.gyp:asan_dynamic_runtime',
8100
+        ],
8101
+      }],
8102
+      ['OS=="win" and asan==1 and component=="shared_library"', {
8103
+        'dependencies': [
8104
+          '<(DEPTH)/build/win/asan.gyp:asan_dynamic_runtime',
8105
+        ],
8106
+      }],
8107
+      ['branding=="Chrome"', {
8108
+        'defines': ['GOOGLE_CHROME_BUILD'],
8109
+      }, {  # else: branding!="Chrome"
8110
+        'defines': ['CHROMIUM_BUILD'],
8111
+      }],
8112
+      ['OS=="mac" and component=="shared_library"', {
8113
+        'xcode_settings': {
8114
+          'DYLIB_INSTALL_NAME_BASE': '@rpath',
8115
+          'LD_RUNPATH_SEARCH_PATHS': [
8116
+            # For unbundled binaries.
8117
+            '@loader_path/.',
8118
+            # For bundled binaries, to get back from Binary.app/Contents/MacOS.
8119
+            '@loader_path/../../..',
8120
+          ],
8121
+        },
8122
+      }],
8123
+      ['clang==1 or host_clang==1', {
8124
+        # This is here so that all files get recompiled after a clang roll and
8125
+        # when turning clang on or off.
8126
+        # (defines are passed via the command line, and build systems rebuild
8127
+        # things when their commandline changes). Nothing should ever read this
8128
+        # define.
8129
+        'defines': ['CR_CLANG_REVISION=<!(python <(DEPTH)/tools/clang/scripts/update.py --print-revision)'],
8130
+      }],
8131
+      ['enable_rlz==1', {
8132
+        'defines': ['ENABLE_RLZ'],
8133
+      }],
8134
+      ['component=="shared_library"', {
8135
+        'defines': ['COMPONENT_BUILD'],
8136
+      }],
8137
+      ['ui_compositor_image_transport==1', {
8138
+        'defines': ['UI_COMPOSITOR_IMAGE_TRANSPORT'],
8139
+      }],
8140
+      ['use_aura==1', {
8141
+        'defines': ['USE_AURA=1'],
8142
+      }],
8143
+      ['use_ash==1', {
8144
+        'defines': ['USE_ASH=1'],
8145
+      }],
8146
+      ['use_pango==1', {
8147
+        'defines': ['USE_PANGO=1'],
8148
+      }],
8149
+      ['use_cairo==1', {
8150
+        'defines': ['USE_CAIRO=1'],
8151
+      }],
8152
+      ['use_cras==1', {
8153
+        'defines': ['USE_CRAS=1'],
8154
+      }],
8155
+      ['use_ozone==1', {
8156
+        'defines': ['USE_OZONE=1'],
8157
+      }],
8158
+      ['use_default_render_theme==1', {
8159
+        'defines': ['USE_DEFAULT_RENDER_THEME=1'],
8160
+      }],
8161
+      ['use_libjpeg_turbo==1', {
8162
+        'defines': ['USE_LIBJPEG_TURBO=1'],
8163
+      }],
8164
+      ['use_x11==1', {
8165
+        'defines': ['USE_X11=1'],
8166
+      }],
8167
+      ['use_clipboard_aurax11==1', {
8168
+        'defines': ['USE_CLIPBOARD_AURAX11=1'],
8169
+      }],
8170
+      ['image_loader_extension==1', {
8171
+        'defines': ['IMAGE_LOADER_EXTENSION=1'],
8172
+      }],
8173
+      ['enable_webrtc==1', {
8174
+        'defines': ['ENABLE_WEBRTC=1'],
8175
+      }],
8176
+      ['enable_media_router==1', {
8177
+        'defines': ['ENABLE_MEDIA_ROUTER=1'],
8178
+      }],
8179
+      ['proprietary_codecs==1', {
8180
+        'defines': ['USE_PROPRIETARY_CODECS'],
8181
+      }],
8182
+      ['enable_viewport==1', {
8183
+        'defines': ['ENABLE_VIEWPORT'],
8184
+      }],
8185
+      ['enable_pepper_cdms==1', {
8186
+        'defines': ['ENABLE_PEPPER_CDMS'],
8187
+      }],
8188
+      ['enable_browser_cdms==1', {
8189
+        'defines': ['ENABLE_BROWSER_CDMS'],
8190
+      }],
8191
+      ['notifications==1', {
8192
+        'defines': ['ENABLE_NOTIFICATIONS'],
8193
+      }],
8194
+      ['enable_wayland_server==1', {
8195
+        'defines': ['ENABLE_WAYLAND_SERVER=1'],
8196
+      }],
8197
+      ['enable_wifi_display==1', {
8198
+        'defines': ['ENABLE_WIFI_DISPLAY=1'],
8199
+      }],
8200
+      ['use_udev==1', {
8201
+        'defines': ['USE_UDEV'],
8202
+      }],
8203
+      ['use_external_popup_menu==1', {
8204
+        'defines': ['USE_EXTERNAL_POPUP_MENU'],
8205
+      }],
8206
+      ['fastbuild!=0', {
8207
+        'xcode_settings': {
8208
+          'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO',
8209
+        },
8210
+        'conditions': [
8211
+          ['OS=="win" and fastbuild==2', {
8212
+            # Completely disable debug information.
8213
+            'msvs_settings': {
8214
+              'VCLinkerTool': {
8215
+                'GenerateDebugInformation': 'false',
8216
+              },
8217
+              'VCCLCompilerTool': {
8218
+                'DebugInformationFormat': '0',
8219
+              },
8220
+            },
8221
+          }],
8222
+          ['OS=="win" and fastbuild==1', {
8223
+            'msvs_settings': {
8224
+              'VCLinkerTool': {
8225
+                # This tells the linker to generate .pdbs, so that
8226
+                # we can get meaningful stack traces.
8227
+                'GenerateDebugInformation': 'true',
8228
+              },
8229
+              'VCCLCompilerTool': {
8230
+                # No debug info to be generated by compiler.
8231
+                'DebugInformationFormat': '0',
8232
+              },
8233
+            },
8234
+          }],
8235
+          ['(OS=="android" or OS=="linux") and fastbuild==2', {
8236
+            'variables': { 'debug_extra_cflags': '-g0', },
8237
+          }],
8238
+          ['(OS=="android" or OS=="linux") and fastbuild==1', {
8239
+            # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
8240
+            # fixed.
8241
+            'variables': { 'debug_extra_cflags': '-g0', },
8242
+          }],
8243
+          # Android builds symbols on release by default, disable them.
8244
+          ['OS=="android" and fastbuild==2', {
8245
+            'variables': { 'release_extra_cflags': '-g0', },
8246
+          }],
8247
+          ['OS=="android" and fastbuild==1', {
8248
+            # TODO(thakis): Change this to -g1 once http://crbug.com/456947 is
8249
+            # fixed.
8250
+            'variables': { 'release_extra_cflags': '-g0', },
8251
+          }],
8252
+        ],
8253
+      }],  # fastbuild!=0
8254
+      ['dcheck_always_on!=0', {
8255
+        'defines': ['DCHECK_ALWAYS_ON=1'],
8256
+      }],  # dcheck_always_on!=0
8257
+      ['tracing_like_official_build!=0', {
8258
+        'defines': ['TRACING_IS_OFFICIAL_BUILD=1'],
8259
+      }],  # tracing_like_official_build!=0
8260
+      ['fieldtrial_testing_like_official_build==0 and branding!="Chrome"', {
8261
+        'defines': ['FIELDTRIAL_TESTING_ENABLED'],
8262
+      }],  # fieldtrial_testing_like_official_build==0 and branding!="Chrome"
8263
+      ['OS=="win"', {
8264
+        'defines': ['NO_TCMALLOC'],
8265
+      }],
8266
+      ['syzyasan==1', {
8267
+        # SyzyAsan needs /PROFILE turned on to produce appropriate pdbs.
8268
+        'msvs_settings': {
8269
+          'VCLinkerTool': {
8270
+            'Profile': 'true',
8271
+          },
8272
+        },
8273
+        'defines': [
8274
+            'SYZYASAN',
8275
+            'MEMORY_TOOL_REPLACES_ALLOCATOR',
8276
+            'MEMORY_SANITIZER_INITIAL_SIZE',
8277
+        ],
8278
+      }],
8279
+      ['OS=="win"', {
8280
+        'defines': [
8281
+          '__STD_C',
8282
+          '_CRT_SECURE_NO_DEPRECATE',
8283
+          '_SCL_SECURE_NO_DEPRECATE',
8284
+          # This define is required to pull in the new Win 10 interfaces from
8285
+          # system headers like ShObjIdl.h.
8286
+          'NTDDI_VERSION=0x0A000000',
8287
+          # This is required for ATL to use XP-safe versions of its functions.
8288
+          '_USING_V110_SDK71_',
8289
+        ],
8290
+        'include_dirs': [
8291
+          '<(DEPTH)/third_party/wtl/include',
8292
+        ],
8293
+        'conditions': [
8294
+          ['win_z7!=0', {
8295
+            'msvs_settings': {
8296
+              # Generates debug info when win_z7=1
8297
+              # even if fastbuild=1 (that makes GenerateDebugInformation false).
8298
+              'VCLinkerTool': {
8299
+                'GenerateDebugInformation': 'true',
8300
+              },
8301
+              'VCCLCompilerTool': {
8302
+                'DebugInformationFormat': '1',
8303
+              }
8304
+            }
8305
+          }],  # win_z7!=0
8306
+          ['win_analyze', {
8307
+            'defines!': [
8308
+              # This is prohibited when running /analyze.
8309
+              '_USING_V110_SDK71_',
8310
+            ],
8311
+            'msvs_settings': {
8312
+              'VCCLCompilerTool': {
8313
+                # Set WarnAsError to false to disable this setting for most
8314
+                # projects so that compilation continues.
8315
+                'WarnAsError': 'false',
8316
+                # When win_analyze is specified add the /analyze switch.
8317
+                # Also add /WX- to force-disable WarnAsError for projects that
8318
+                # override WarnAsError.
8319
+                # Also, disable various noisy warnings that have low value.
8320
+                'AdditionalOptions': [
8321
+                  '/analyze:WX-',
8322
+                  '/wd6011',  # Dereferencing NULL pointer
8323
+                  '/wd6312',  # Possible infinite loop: use of the constant
8324
+                    # EXCEPTION_CONTINUE_EXECUTION in the exception-filter
8325
+                  '/wd6326',  # Potential comparison of constant with constant
8326
+                  '/wd28159', # Consider using 'GetTickCount64'
8327
+                  '/wd28204', # Inconsistent SAL annotations
8328
+                  '/wd28251', # Inconsistent SAL annotations
8329
+                  '/wd28252', # Inconsistent SAL annotations
8330
+                  '/wd28253', # Inconsistent SAL annotations
8331
+                  '/wd28196', # The precondition is not satisfied
8332
+                  '/wd28301', # Inconsistent SAL annotations
8333
+                  '/wd6340',  # Sign mismatch in function parameter
8334
+                  '/wd28182', # Dereferencing NULL pointer
8335
+                  # C6285 is ~16% of raw warnings and has low value
8336
+                  '/wd6285',  # non-zero constant || non-zero constant
8337
+                  # C6334 is ~80% of raw warnings and has low value
8338
+                  '/wd6334',  # sizeof applied to an expression with an operator
8339
+                ],
8340
+              },
8341
+            },
8342
+          }],  # win_analyze
8343
+        ],
8344
+      }],  # OS==win
8345
+      ['chromecast==1', {
8346
+        'defines': [
8347
+          'LOG_DISABLED=0',
8348
+        ],
8349
+      }],
8350
+      ['enable_task_manager==1', {
8351
+        'defines': [
8352
+          'ENABLE_TASK_MANAGER=1',
8353
+        ],
8354
+      }],
8355
+      ['enable_extensions==1', {
8356
+        'defines': [
8357
+          'ENABLE_EXTENSIONS=1',
8358
+        ],
8359
+      }],
8360
+      ['OS=="win" and branding=="Chrome"', {
8361
+        'defines': ['ENABLE_SWIFTSHADER'],
8362
+      }],
8363
+      ['enable_dart==1', {
8364
+        'defines': ['WEBKIT_USING_DART=1'],
8365
+      }],
8366
+      ['enable_pdf==1', {
8367
+        'defines': ['ENABLE_PDF=1'],
8368
+      }],
8369
+      ['enable_plugin_installation==1', {
8370
+        'defines': ['ENABLE_PLUGIN_INSTALLATION=1'],
8371
+      }],
8372
+      ['enable_plugins==1', {
8373
+        'defines': ['ENABLE_PLUGINS=1'],
8374
+      }],
8375
+      ['enable_session_service==1', {
8376
+        'defines': ['ENABLE_SESSION_SERVICE=1'],
8377
+      }],
8378
+      ['enable_themes==1', {
8379
+        'defines': ['ENABLE_THEMES=1'],
8380
+      }],
8381
+      ['enable_basic_printing==1 or enable_print_preview==1', {
8382
+        # Convenience define for ENABLE_BASIC_PRINTING || ENABLE_PRINT_PREVIEW.
8383
+        'defines': ['ENABLE_PRINTING=1'],
8384
+      }],
8385
+      ['enable_basic_printing==1', {
8386
+        # Enable basic printing support and UI.
8387
+        'defines': ['ENABLE_BASIC_PRINTING=1'],
8388
+      }],
8389
+      ['enable_print_preview==1', {
8390
+        # Enable printing with print preview.
8391
+        # Can be defined without ENABLE_BASIC_PRINTING.
8392
+        'defines': ['ENABLE_PRINT_PREVIEW=1'],
8393
+      }],
8394
+      ['enable_spellcheck==1', {
8395
+        'defines': ['ENABLE_SPELLCHECK=1'],
8396
+      }],
8397
+      ['use_browser_spellchecker', {
8398
+        'defines': ['USE_BROWSER_SPELLCHECKER=1'],
8399
+      }],
8400
+      ['use_minikin_hyphenation', {
8401
+        'defines': ['USE_MINIKIN_HYPHENATION=1'],
8402
+      }],
8403
+      ['enable_captive_portal_detection==1', {
8404
+        'defines': ['ENABLE_CAPTIVE_PORTAL_DETECTION=1'],
8405
+      }],
8406
+      ['enable_app_list==1', {
8407
+        'defines': ['ENABLE_APP_LIST=1'],
8408
+      }],
8409
+      ['disable_file_support==1', {
8410
+        'defines': ['DISABLE_FILE_SUPPORT=1'],
8411
+      }],
8412
+      ['disable_ftp_support==1', {
8413
+        'defines': ['DISABLE_FTP_SUPPORT=1'],
8414
+      }],
8415
+      ['enable_supervised_users==1', {
8416
+        'defines': ['ENABLE_SUPERVISED_USERS=1'],
8417
+      }],
8418
+      ['enable_mdns==1', {
8419
+        'defines': ['ENABLE_MDNS=1'],
8420
+      }],
8421
+      ['enable_service_discovery==1', {
8422
+        'defines' : [ 'ENABLE_SERVICE_DISCOVERY=1' ],
8423
+      }],
8424
+      ['enable_hangout_services_extension==1', {
8425
+        'defines': ['ENABLE_HANGOUT_SERVICES_EXTENSION=1'],
8426
+      }],
8427
+      ['enable_ipc_fuzzer==1', {
8428
+        'defines': ['ENABLE_IPC_FUZZER=1'],
8429
+      }],
8430
+      ['v8_use_external_startup_data==1', {
8431
+       'defines': ['V8_USE_EXTERNAL_STARTUP_DATA'],
8432
+      }],
8433
+      ['enable_webvr==1', {
8434
+        'defines': ['ENABLE_WEBVR'],
8435
+      }],
8436
+      # SAFE_BROWSING_DB_LOCAL - service manages a local database.
8437
+      # SAFE_BROWSING_DB_REMOTE - service talks via API to a database
8438
+      # SAFE_BROWSING_CSD - enable client-side phishing detection.
8439
+      ['safe_browsing==1', {
8440
+        'defines': [
8441
+          # TODO(nparker): Remove existing uses of FULL_SAFE_BROWSING
8442
+          'FULL_SAFE_BROWSING',
8443
+          'SAFE_BROWSING_CSD',
8444
+          'SAFE_BROWSING_DB_LOCAL',
8445
+        ],
8446
+      }],
8447
+      ['safe_browsing==2 and OS!="ios"', {
8448
+        'defines': [
8449
+          'SAFE_BROWSING_DB_REMOTE',
8450
+        ],
8451
+      }],
8452
+    ],  # conditions for 'target_defaults'
8453
+    'target_conditions': [
8454
+      ['<(use_libpci)==1', {
8455
+        'defines': ['USE_LIBPCI=1'],
8456
+      }],
8457
+      ['<(use_openssl_certs)==1', {
8458
+        'defines': ['USE_OPENSSL_CERTS=1'],
8459
+      }],
8460
+      ['>(nacl_untrusted_build)==1', {
8461
+        'defines': [
8462
+          'USE_OPENSSL_CERTS=1',
8463
+        ],
8464
+      }],
8465
+      ['<(use_glib)==1 and >(nacl_untrusted_build)==0', {
8466
+        'defines': ['USE_GLIB=1'],
8467
+      }],
8468
+      ['<(use_nss_certs)==1 and >(nacl_untrusted_build)==0', {
8469
+        'defines': ['USE_NSS_CERTS=1'],
8470
+      }],
8471
+      ['<(chromeos)==1 and >(nacl_untrusted_build)==0', {
8472
+        'defines': ['OS_CHROMEOS=1'],
8473
+      }],
8474
+      ['<(asan)==1 and >(nacl_untrusted_build)==0', {
8475
+        'defines': [
8476
+          'ADDRESS_SANITIZER',
8477
+          'MEMORY_TOOL_REPLACES_ALLOCATOR',
8478
+          'MEMORY_SANITIZER_INITIAL_SIZE',
8479
+        ],
8480
+      }],
8481
+      ['enable_wexit_time_destructors==1 and OS!="win"', {
8482
+        # TODO: Enable on Windows too, http://crbug.com/404525
8483
+        'variables': { 'clang_warning_flags': ['-Wexit-time-destructors']},
8484
+      }],
8485
+      ['chromium_code==0', {
8486
+        'variables': {
8487
+          'clang_warning_flags': [
8488
+            # Lots of third-party libraries have unused variables. Instead of
8489
+            # suppressing them individually, we just blanket suppress them here.
8490
+            '-Wno-unused-variable',
8491
+          ],
8492
+        },
8493
+        'conditions': [
8494
+          [ 'os_posix==1 and OS!="mac" and OS!="ios"', {
8495
+            # Remove -Wextra for third-party code.
8496
+            'cflags!': [ '-Wextra' ],
8497
+            'cflags_cc': [
8498
+              # Don't warn about hash_map in third-party code.
8499
+              '-Wno-deprecated',
8500
+            ],
8501
+          }],
8502
+          [ 'os_posix==1 and clang!=1 and OS!="mac" and OS!="ios"', {
8503
+            # When we don't control the compiler, don't use -Wall for
8504
+            # third-party code either.
8505
+            'cflags!': [ '-Wall' ],
8506
+          }],
8507
+          # TODO: Fix all warnings on chromeos too.
8508
+          [ 'os_posix==1 and OS!="mac" and OS!="ios" and (clang!=1 or chromeos==1)', {
8509
+            'cflags!': [
8510
+              '-Werror',
8511
+            ],
8512
+          }],
8513
+          [ 'OS=="win"', {
8514
+            'defines': [
8515
+              '_CRT_SECURE_NO_DEPRECATE',
8516
+              '_CRT_NONSTDC_NO_WARNINGS',
8517
+              '_CRT_NONSTDC_NO_DEPRECATE',
8518
+              '_SCL_SECURE_NO_DEPRECATE',
8519
+            ],
8520
+            'msvs_disabled_warnings': [
8521
+              # forcing value to bool 'true' or 'false' (performance warning)
8522
+              4800,
8523
+            ],
8524
+            'msvs_settings': {
8525
+              'VCCLCompilerTool': {
8526
+                'WarningLevel': '3',
8527
+                'WarnAsError': 'true',
8528
+                'Detect64BitPortabilityProblems': 'false',
8529
+              },
8530
+            },
8531
+            'conditions': [
8532
+              ['buildtype=="Official"', {
8533
+                'msvs_settings': {
8534
+                  'VCCLCompilerTool': { 'WarnAsError': 'false' },
8535
+                }
8536
+              }],
8537
+              [ 'component=="shared_library"', {
8538
+              # TODO(darin): Unfortunately, some third_party code depends on base.
8539
+                'msvs_disabled_warnings': [
8540
+                  4251,  # class 'std::xx' needs to have dll-interface.
8541
+                 ],
8542
+              }],
8543
+            ],
8544
+          }],
8545
+          [ 'OS=="mac" or OS=="ios"', {
8546
+            'xcode_settings': {
8547
+              'WARNING_CFLAGS!': ['-Wextra'],
8548
+            },
8549
+            'conditions': [
8550
+              ['buildtype=="Official"', {
8551
+                'xcode_settings': {
8552
+                  'GCC_TREAT_WARNINGS_AS_ERRORS': 'NO',    # -Werror
8553
+                },
8554
+              }],
8555
+            ],
8556
+          }],
8557
+          [ 'OS=="ios"', {
8558
+            'xcode_settings': {
8559
+              'RUN_CLANG_STATIC_ANALYZER': 'NO',
8560
+              # Several internal ios directories generate numerous warnings for
8561
+              # -Wobjc-missing-property-synthesis.
8562
+              'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
8563
+            },
8564
+          }],
8565
+        ],
8566
+      }, {
8567
+        # In Chromium code, we define __STDC_foo_MACROS in order to get the
8568
+        # C99 macros on Mac and Linux.
8569
+        'defines': [
8570
+          '__STDC_CONSTANT_MACROS',
8571
+          '__STDC_FORMAT_MACROS',
8572
+        ],
8573
+        'conditions': [
8574
+          ['OS=="win"', {
8575
+            # turn on warnings for signed/unsigned mismatch on chromium code.
8576
+            'msvs_settings': {
8577
+              'VCCLCompilerTool': {
8578
+                'AdditionalOptions': ['/we4389'],
8579
+              },
8580
+            },
8581
+          }],
8582
+          ['OS=="win" and component=="shared_library"', {
8583
+            'msvs_disabled_warnings': [
8584
+              4251,  # class 'std::xx' needs to have dll-interface.
8585
+            ],
8586
+          }],
8587
+        ],
8588
+      }],
8589
+    ],  # target_conditions for 'target_defaults'
8590
+    'default_configuration': 'Debug',
8591
+    'configurations': {
8592
+      # VCLinkerTool LinkIncremental values below:
8593
+      #   0 == default
8594
+      #   1 == /INCREMENTAL:NO
8595
+      #   2 == /INCREMENTAL
8596
+      # Debug links incremental, Release does not.
8597
+      #
8598
+      # Abstract base configurations to cover common attributes.
8599
+      #
8600
+      'Common_Base': {
8601
+        'abstract': 1,
8602
+        'msvs_configuration_attributes': {
8603
+          'OutputDirectory': '<(DEPTH)\\build\\<(build_dir_prefix)$(ConfigurationName)',
8604
+          'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)',
8605
+          'CharacterSet': '1',
8606
+        },
8607
+        'msvs_settings':{
8608
+          'VCCLCompilerTool': {
8609
+            'AdditionalOptions': [
8610
+              '/bigobj',
8611
+              # Tell the compiler to crash on failures. This is undocumented
8612
+              # and unsupported but very handy.
8613
+              '/d2FastFail',
8614
+            ],
8615
+          },
8616
+          'VCLinkerTool': {
8617
+            # Add the default import libs.
8618
+            'AdditionalDependencies': [
8619
+              'kernel32.lib',
8620
+              'gdi32.lib',
8621
+              'winspool.lib',
8622
+              'comdlg32.lib',
8623
+              'advapi32.lib',
8624
+              'shell32.lib',
8625
+              'ole32.lib',
8626
+              'oleaut32.lib',
8627
+              'user32.lib',
8628
+              'uuid.lib',
8629
+              'odbc32.lib',
8630
+              'odbccp32.lib',
8631
+              'delayimp.lib',
8632
+              'credui.lib',
8633
+            ],
8634
+            'AdditionalOptions': [
8635
+              # Suggested by Microsoft Devrel to avoid
8636
+              #   LINK : fatal error LNK1248: image size (80000000) exceeds maximum allowable size (80000000)
8637
+              # which started happening more regularly after VS2013 Update 4.
8638
+              # Needs to be a bit lower for VS2015, or else errors out.
8639
+              '/maxilksize:0x7ff00000',
8640
+              # Tell the linker to crash on failures.
8641
+              '/fastfail',
8642
+            ],
8643
+          },
8644
+        },
8645
+        'conditions': [
8646
+          ['OS=="win" and win_fastlink==1 and MSVS_VERSION != "2013"', {
8647
+            'msvs_settings': {
8648
+              'VCLinkerTool': {
8649
+                # /PROFILE is incompatible with /debug:fastlink
8650
+                'Profile': 'false',
8651
+                'AdditionalOptions': [
8652
+                  # Tell VS 2015+ to create a PDB that references debug
8653
+                  # information in .obj and .lib files instead of copying
8654
+                  # it all.
8655
+                  '/DEBUG:FASTLINK',
8656
+                ],
8657
+              },
8658
+            },
8659
+          }],
8660
+          ['OS=="win" and MSVS_VERSION == "2015"', {
8661
+            'msvs_settings': {
8662
+              'VCCLCompilerTool': {
8663
+                'AdditionalOptions': [
8664
+                  # Work around crbug.com/526851, bug in VS 2015 RTM compiler.
8665
+                  '/Zc:sizedDealloc-',
8666
+                  # Disable thread-safe statics to avoid overhead and because
8667
+                  # they are disabled on other platforms. See crbug.com/587210
8668
+                  # and -fno-threadsafe-statics.
8669
+                  '/Zc:threadSafeInit-',
8670
+                ],
8671
+              },
8672
+            },
8673
+          }],
8674
+        ],
8675
+      },
8676
+      'x86_Base': {
8677
+        'abstract': 1,
8678
+        'msvs_settings': {
8679
+          'VCLinkerTool': {
8680
+            'MinimumRequiredVersion': '5.01',  # XP.
8681
+            'TargetMachine': '1',
8682
+          },
8683
+          'VCLibrarianTool': {
8684
+            'TargetMachine': '1',
8685
+          },
8686
+        },
8687
+        'msvs_configuration_platform': 'Win32',
8688
+      },
8689
+      'x64_Base': {
8690
+        'abstract': 1,
8691
+        'msvs_configuration_platform': 'x64',
8692
+        'msvs_settings': {
8693
+          'VCLinkerTool': {
8694
+            # Make sure to understand http://crbug.com/361720 if you want to
8695
+            # increase this.
8696
+            'MinimumRequiredVersion': '5.02',  # Server 2003.
8697
+            'TargetMachine': '17', # x86 - 64
8698
+            'AdditionalLibraryDirectories!':
8699
+              ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x86'],
8700
+            'AdditionalLibraryDirectories':
8701
+              ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x64'],
8702
+            # Doesn't exist x64 SDK. Should use oleaut32 in any case.
8703
+            'IgnoreDefaultLibraryNames': [ 'olepro32.lib' ],
8704
+          },
8705
+          'VCLibrarianTool': {
8706
+            'AdditionalLibraryDirectories!':
8707
+              ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x86'],
8708
+            'AdditionalLibraryDirectories':
8709
+              ['<(windows_sdk_path)/Lib/10.0.10586.0/um/x64'],
8710
+            'TargetMachine': '17', # x64
8711
+          },
8712
+        },
8713
+      },
8714
+      'Debug_Base': {
8715
+        'abstract': 1,
8716
+        'defines': [
8717
+          'DYNAMIC_ANNOTATIONS_ENABLED=1',
8718
+          'WTF_USE_DYNAMIC_ANNOTATIONS=1',
8719
+        ],
8720
+        'xcode_settings': {
8721
+          'GCC_OPTIMIZATION_LEVEL': '<(mac_debug_optimization)',
8722
+          'OTHER_CFLAGS': [
8723
+            '<@(debug_extra_cflags)',
8724
+          ],
8725
+        },
8726
+        'msvs_settings': {
8727
+          'VCCLCompilerTool': {
8728
+            'Optimization': '<(win_debug_Optimization)',
8729
+            'PreprocessorDefinitions': ['_DEBUG'],
8730
+            'BasicRuntimeChecks': '<(win_debug_RuntimeChecks)',
8731
+            'RuntimeLibrary': '<(win_debug_RuntimeLibrary)',
8732
+            'conditions': [
8733
+              # According to MSVS, InlineFunctionExpansion=0 means
8734
+              # "default inlining", not "/Ob0".
8735
+              # Thus, we have to handle InlineFunctionExpansion==0 separately.
8736
+              ['win_debug_InlineFunctionExpansion==0', {
8737
+                'AdditionalOptions': ['/Ob0'],
8738
+              }],
8739
+              ['win_debug_InlineFunctionExpansion!=""', {
8740
+                'InlineFunctionExpansion':
8741
+                  '<(win_debug_InlineFunctionExpansion)',
8742
+              }],
8743
+              ['win_debug_disable_iterator_debugging==1', {
8744
+                'PreprocessorDefinitions': ['_HAS_ITERATOR_DEBUGGING=0'],
8745
+              }],
8746
+              # if win_debug_OmitFramePointers is blank, leave as default
8747
+              ['win_debug_OmitFramePointers==1', {
8748
+                'OmitFramePointers': 'true',
8749
+              }],
8750
+              ['win_debug_OmitFramePointers==0', {
8751
+                'OmitFramePointers': 'false',
8752
+                # The above is not sufficient (http://crbug.com/106711): it
8753
+                # simply eliminates an explicit "/Oy", but both /O2 and /Ox
8754
+                # perform FPO regardless, so we must explicitly disable.
8755
+                # We still want the false setting above to avoid having
8756
+                # "/Oy /Oy-" and warnings about overriding.
8757
+                'AdditionalOptions': ['/Oy-'],
8758
+              }],
8759
+            ],
8760
+            'AdditionalOptions': [ '<@(win_debug_extra_cflags)', ],
8761
+          },
8762
+          'VCLinkerTool': {
8763
+            'LinkIncremental': '<(msvs_debug_link_incremental)',
8764
+            # ASLR makes debugging with windbg difficult because Chrome.exe and
8765
+            # Chrome.dll share the same base name. As result, windbg will
8766
+            # name the Chrome.dll module like chrome_<base address>, where
8767
+            # <base address> typically changes with each launch. This in turn
8768
+            # means that breakpoints in Chrome.dll don't stick from one launch
8769
+            # to the next. For this reason, we turn ASLR off in debug builds.
8770
+            # Note that this is a three-way bool, where 0 means to pick up
8771
+            # the default setting, 1 is off and 2 is on.
8772
+            'RandomizedBaseAddress': 1,
8773
+          },
8774
+          'VCResourceCompilerTool': {
8775
+            'PreprocessorDefinitions': ['_DEBUG'],
8776
+          },
8777
+        },
8778
+        'variables': {
8779
+          'clang_warning_flags': [
8780
+            # Allow comparing the address of references and 'this' against 0
8781
+            # in debug builds. Technically, these can never be null in
8782
+            # well-defined C/C++ and Clang can optimize such checks away in
8783
+            # release builds, but they may be used in asserts in debug builds.
8784
+            '-Wno-undefined-bool-conversion',
8785
+            '-Wno-tautological-undefined-compare',
8786
+          ],
8787
+        },
8788
+        'conditions': [
8789
+          ['OS=="linux" or OS=="android"', {
8790
+            'target_conditions': [
8791
+              ['_toolset=="target"', {
8792
+                'cflags': [
8793
+                  '<@(debug_extra_cflags)',
8794
+                ],
8795
+              }],
8796
+            ],
8797
+          }],
8798
+          ['OS=="linux" and target_arch!="ia32" and disable_glibcxx_debug==0', {
8799
+            # Enable libstdc++ debugging facilities to help catch problems
8800
+            # early, see http://crbug.com/65151 .
8801
+            # TODO(phajdan.jr): Should we enable this for all of POSIX?
8802
+            'defines': ['_GLIBCXX_DEBUG=1',],
8803
+          }],
8804
+          ['release_valgrind_build==0', {
8805
+            'xcode_settings': {
8806
+              'OTHER_CFLAGS': [
8807
+                '-fstack-protector-strong',  # Implies -fstack-protector
8808
+              ],
8809
+            },
8810
+          }],
8811
+        ],
8812
+      },
8813
+      'Release_Base': {
8814
+        'abstract': 1,
8815
+        'defines': [
8816
+          'NDEBUG',
8817
+        ],
8818
+        'xcode_settings': {
8819
+          'DEAD_CODE_STRIPPING': 'YES',  # -Wl,-dead_strip
8820
+          'GCC_OPTIMIZATION_LEVEL': '<(mac_release_optimization)',
8821
+          'OTHER_CFLAGS': [ '<@(release_extra_cflags)', ],
8822
+        },
8823
+        'msvs_settings': {
8824
+          'VCCLCompilerTool': {
8825
+            'RuntimeLibrary': '<(win_release_RuntimeLibrary)',
8826
+            'conditions': [
8827
+              # In official builds, each target will self-select
8828
+              # an optimization level.
8829
+              ['buildtype!="Official"', {
8830
+                  'Optimization': '<(win_release_Optimization)',
8831
+                },
8832
+              ],
8833
+              # According to MSVS, InlineFunctionExpansion=0 means
8834
+              # "default inlining", not "/Ob0".
8835
+              # Thus, we have to handle InlineFunctionExpansion==0 separately.
8836
+              ['win_release_InlineFunctionExpansion==0', {
8837
+                'AdditionalOptions': ['/Ob0'],
8838
+              }],
8839
+              ['win_release_InlineFunctionExpansion!=""', {
8840
+                'InlineFunctionExpansion':
8841
+                  '<(win_release_InlineFunctionExpansion)',
8842
+              }],
8843
+              # if win_release_OmitFramePointers is blank, leave as default
8844
+              ['win_release_OmitFramePointers==1', {
8845
+                'OmitFramePointers': 'true',
8846
+              }],
8847
+              ['win_release_OmitFramePointers==0', {
8848
+                'OmitFramePointers': 'false',
8849
+                # The above is not sufficient (http://crbug.com/106711): it
8850
+                # simply eliminates an explicit "/Oy", but both /O2 and /Ox
8851
+                # perform FPO regardless, so we must explicitly disable.
8852
+                # We still want the false setting above to avoid having
8853
+                # "/Oy /Oy-" and warnings about overriding.
8854
+                'AdditionalOptions': ['/Oy-'],
8855
+              }],
8856
+              ['asan==0', {
8857
+                # Put data in separate COMDATs. This allows the linker
8858
+                # to put bit-identical constants at the same address even if
8859
+                # they're unrelated constants, which saves binary size.
8860
+                # This optimization can't be used when ASan is enabled because
8861
+                # it is not compatible with the ASan ODR checker.
8862
+                'AdditionalOptions': ['/Gw'],
8863
+              }],
8864
+            ],
8865
+            'AdditionalOptions': [
8866
+                '/d2Zi+',  # Improve debugging of Release builds.
8867
+                '/Zc:inline',  # Remove unreferenced COMDAT (faster links).
8868
+                '<@(win_release_extra_cflags)',
8869
+            ],
8870
+          },
8871
+          'VCLinkerTool': {
8872
+            # LinkIncremental is a tri-state boolean, where 0 means default
8873
+            # (i.e., inherit from parent solution), 1 means false, and
8874
+            # 2 means true.
8875
+            'LinkIncremental': '1',
8876
+            # This corresponds to the /PROFILE flag which ensures the PDB
8877
+            # file contains FIXUP information (growing the PDB file by about
8878
+            # 5%) but does not otherwise alter the output binary. This
8879
+            # information is used by the Syzygy optimization tool when
8880
+            # decomposing the release image.
8881
+            'Profile': 'true',
8882
+          },
8883
+        },
8884
+        'conditions': [
8885
+          ['release_valgrind_build==0 and tsan==0', {
8886
+            'defines': [
8887
+              'NVALGRIND',
8888
+              'DYNAMIC_ANNOTATIONS_ENABLED=0',
8889
+            ],
8890
+          }, {
8891
+            'defines': [
8892
+              'MEMORY_TOOL_REPLACES_ALLOCATOR',
8893
+              'MEMORY_SANITIZER_INITIAL_SIZE',
8894
+              'DYNAMIC_ANNOTATIONS_ENABLED=1',
8895
+              'WTF_USE_DYNAMIC_ANNOTATIONS=1',
8896
+            ],
8897
+          }],
8898
+          ['OS=="win" and win_use_allocator_shim==1', {
8899
+            'defines': [
8900
+              'ALLOCATOR_SHIM'
8901
+            ],
8902
+          }],
8903
+          # _FORTIFY_SOURCE isn't really supported by Clang now, see
8904
+          # http://llvm.org/bugs/show_bug.cgi?id=16821.
8905
+          # It seems to work fine with Ubuntu 12 headers though, so use it
8906
+          # in official builds.
8907
+          ['os_posix==1 and (asan!=1 and msan!=1 and tsan!=1 and lsan!=1 and ubsan!=1) and (OS!="linux" or clang!=1 or buildtype=="Official")', {
8908
+            'target_conditions': [
8909
+              ['chromium_code==1', {
8910
+                # Non-chromium code is not guaranteed to compile cleanly
8911
+                # with _FORTIFY_SOURCE. Also, fortified build may fail
8912
+                # when optimizations are disabled, so only do that for Release
8913
+                # build.
8914
+                'defines': [
8915
+                  '_FORTIFY_SOURCE=2',
8916
+                ],
8917
+              }],
8918
+            ],
8919
+          }],
8920
+          ['OS=="linux" or OS=="android"', {
8921
+            'target_conditions': [
8922
+              ['_toolset=="target"', {
8923
+                'cflags': [
8924
+                  '<@(release_extra_cflags)',
8925
+                ],
8926
+                'conditions': [
8927
+                  ['enable_resource_whitelist_generation==1', {
8928
+                    'cflags': [
8929
+                      '-Wunknown-pragmas -Wno-error=unknown-pragmas',
8930
+                    ],
8931
+                  }],
8932
+                ],
8933
+              }],
8934
+            ],
8935
+          }],
8936
+          ['OS=="ios"', {
8937
+            'defines': [
8938
+              'NS_BLOCK_ASSERTIONS=1',
8939
+            ],
8940
+          }],
8941
+        ],
8942
+      },
8943
+      #
8944
+      # Concrete configurations
8945
+      #
8946
+      'Debug': {
8947
+        'inherit_from': ['Common_Base', 'x86_Base', 'Debug_Base'],
8948
+      },
8949
+      'Release': {
8950
+        'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
8951
+      },
8952
+      'conditions': [
8953
+        [ 'OS=="ios"', {
8954
+          'Profile': {
8955
+            'inherit_from': ['Common_Base', 'x86_Base', 'Release_Base'],
8956
+            'target_conditions': [
8957
+              [ '_type=="executable"', {
8958
+                # To get a real .dSYM bundle produced by dsymutil, set the
8959
+                # debug information format to dwarf-with-dsym.  Since
8960
+                # strip_from_xcode will not be used, set Xcode to do the
8961
+                # stripping as well.
8962
+                'xcode_settings': {
8963
+                  'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
8964
+                  'DEPLOYMENT_POSTPROCESSING': 'YES',
8965
+                  'STRIP_INSTALLED_PRODUCT': 'YES',
8966
+                },
8967
+              }],
8968
+            ],
8969
+          },
8970
+        }],
8971
+        [ 'OS=="win"', {
8972
+          # TODO(bradnelson): add a gyp mechanism to make this more graceful.
8973
+          'Debug_x64': {
8974
+            'inherit_from': ['Common_Base', 'x64_Base', 'Debug_Base'],
8975
+          },
8976
+          'Release_x64': {
8977
+            'inherit_from': ['Common_Base', 'x64_Base', 'Release_Base'],
8978
+          },
8979
+        }],
8980
+      ],
8981
+    },
8982
+  },
8983
+  'conditions': [
8984
+    ['os_posix==1', {
8985
+      'target_defaults': {
8986
+        'ldflags': [
8987
+          '-Wl,-z,now',
8988
+          '-Wl,-z,relro',
8989
+        ],
8990
+        # TODO(glider): enable the default options on other systems.
8991
+        'conditions': [
8992
+          ['use_sanitizer_options==1 and ((OS=="linux" and (chromeos==0 or target_arch!="ia32")) or OS=="mac")', {
8993
+            'dependencies': [
8994
+              '<(DEPTH)/build/sanitizers/sanitizers.gyp:sanitizer_options',
8995
+            ],
8996
+          }],
8997
+        ],
8998
+      },
8999
+    }],
9000
+    # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
9001
+    ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
9002
+      'target_defaults': {
9003
+        'ldflags': [
9004
+          '-Wl,--fatal-warnings',
9005
+        ],
9006
+      },
9007
+    }],
9008
+    # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
9009
+    ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubsan==0 and ubsan_security==0 and ubsan_vptr==0 and cfi_diag==0', {
9010
+      'target_defaults': {
9011
+        'ldflags': [
9012
+          '-Wl,-z,defs',
9013
+        ],
9014
+      },
9015
+    }],
9016
+    ['os_posix==1 and chromeos==0', {
9017
+      # Chrome OS enables -fstack-protector-strong via its build wrapper,
9018
+      # and we want to avoid overriding this, so stack-protector is only
9019
+      # enabled when not building on Chrome OS.
9020
+      # TODO(phajdan.jr): Use -fstack-protector-strong when our gcc
9021
+      # supports it.  See also https://crbug.com/533294
9022
+      'target_defaults': {
9023
+        'cflags': [
9024
+          '-fstack-protector',
9025
+          '--param=ssp-buffer-size=4',
9026
+        ],
9027
+      },
9028
+    }],
9029
+    ['os_posix==1 and OS=="linux"', {
9030
+      'defines': [
9031
+        '_LARGEFILE_SOURCE',
9032
+        '_LARGEFILE64_SOURCE',
9033
+        '_FILE_OFFSET_BITS=64',
9034
+      ],
9035
+    }],
9036
+    ['os_posix==1 and OS!="mac" and OS!="ios"', {
9037
+      'target_defaults': {
9038
+        # Enable -Werror by default, but put it in a variable so it can
9039
+        # be disabled in ~/.gyp/include.gypi on the valgrind builders.
9040
+        'variables': {
9041
+          'werror%': '-Werror',
9042
+          'libraries_for_target%': '',
9043
+          'conditions' : [
9044
+            # Enable -Wextra for chromium_code when we control the compiler.
9045
+            ['clang==1', { 'wextra': '-Wextra' }, { 'wextra': '-Wno-extra' }],
9046
+          ],
9047
+        },
9048
+        'defines': [
9049
+          '_FILE_OFFSET_BITS=64',
9050
+        ],
9051
+        'cflags': [
9052
+          '<(werror)',  # See note above about the werror variable.
9053
+          '-pthread',
9054
+          '-fno-strict-aliasing',  # See http://crbug.com/32204
9055
+          '-Wall',
9056
+          '<(wextra)',
9057
+          # Don't warn about unused function params.  We use those everywhere.
9058
+          '-Wno-unused-parameter',
9059
+          # Don't warn about the "struct foo f = {0};" initialization pattern.
9060
+          '-Wno-missing-field-initializers',
9061
+          # Don't export any symbols (for example, to plugins we dlopen()).
9062
+          # Note: this is *required* to make some plugins work.
9063
+          '-fvisibility=hidden',
9064
+          '-pipe',
9065
+        ],
9066
+        'cflags_cc': [
9067
+          '-fno-exceptions',
9068
+          '-fno-rtti',
9069
+          # If this is removed then remove the corresponding /Zc:threadSafeInit-
9070
+          # for Windows.
9071
+          '-fno-threadsafe-statics',
9072
+          # Make inline functions have hidden visiblity by default.
9073
+          # Surprisingly, not covered by -fvisibility=hidden.
9074
+          '-fvisibility-inlines-hidden',
9075
+        ],
9076
+        'ldflags': [
9077
+          '-pthread', '-Wl,-z,noexecstack',
9078
+        ],
9079
+        'libraries' : [
9080
+          '<(libraries_for_target)',
9081
+        ],
9082
+        'configurations': {
9083
+          'Debug_Base': {
9084
+            'variables': {
9085
+              'debug_optimize%': '0',
9086
+            },
9087
+            'defines': [
9088
+              '_DEBUG',
9089
+            ],
9090
+            'cflags': [
9091
+              '-O>(debug_optimize)',
9092
+              '-g',
9093
+            ],
9094
+            'conditions' : [
9095
+              ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
9096
+                # TODO(jdduke) Re-enable on mips after resolving linking
9097
+                # issues with libc++ (crbug.com/456380).
9098
+                'ldflags': [
9099
+                  # Warn in case of text relocations.
9100
+                  '-Wl,--warn-shared-textrel',
9101
+                ],
9102
+              }],
9103
+              ['OS=="android" and android_full_debug==0', {
9104
+                # Some configurations are copied from Release_Base to reduce
9105
+                # the binary size.
9106
+                'variables': {
9107
+                  'debug_optimize%': 's',
9108
+                },
9109
+                'cflags': [
9110
+                  '-fdata-sections',
9111
+                  '-ffunction-sections',
9112
+                ],
9113
+                'ldflags': [
9114
+                  '-Wl,-O1',
9115
+                  '-Wl,--as-needed',
9116
+                ],
9117
+              }],
9118
+              ['OS=="android" and android_full_debug==0 and target_arch!="arm64"', {
9119
+                # We don't omit frame pointers on arm64 since they are required
9120
+                # to correctly unwind stackframes which contain system library
9121
+                # function frames (crbug.com/391706).
9122
+                'cflags': [
9123
+                  '-fomit-frame-pointer',
9124
+                ],
9125
+              }],
9126
+              ['OS=="linux" and target_arch=="ia32"', {
9127
+                'ldflags': [
9128
+                  '-Wl,--no-as-needed',
9129
+                ],
9130
+              }],
9131
+              ['debug_unwind_tables==1', {
9132
+                'cflags': ['-funwind-tables'],
9133
+              }, {
9134
+                'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
9135
+                'defines': ['NO_UNWIND_TABLES'],
9136
+              }],
9137
+              ['linux_use_debug_fission==1 and linux_use_gold_flags==1 and binutils_version>=223', {
9138
+                'cflags': ['-gsplit-dwarf'],
9139
+              }],
9140
+            ],
9141
+          },
9142
+          'Release_Base': {
9143
+            'variables': {
9144
+              'release_optimize%': '2',
9145
+              # Binaries become big and gold is unable to perform GC
9146
+              # and remove unused sections for some of test targets
9147
+              # on 32 bit platform.
9148
+              # (This is currently observed only in chromeos valgrind bots)
9149
+              # The following flag is to disable --gc-sections linker
9150
+              # option for these bots.
9151
+              'no_gc_sections%': 0,
9152
+              # TODO(bradnelson): reexamine how this is done if we change the
9153
+              # expansion of configurations
9154
+              'release_valgrind_build%': 0,
9155
+            },
9156
+            'cflags': [
9157
+              '-O<(release_optimize)',
9158
+              # Don't emit the GCC version ident directives, they just end up
9159
+              # in the .comment section taking up binary size.
9160
+              '-fno-ident',
9161
+              # Put data and code in their own sections, so that unused symbols
9162
+              # can be removed at link time with --gc-sections.
9163
+              '-fdata-sections',
9164
+              '-ffunction-sections',
9165
+            ],
9166
+            'ldflags': [
9167
+              # Specifically tell the linker to perform optimizations.
9168
+              # See http://lwn.net/Articles/192624/ .
9169
+              '-Wl,-O1',
9170
+              '-Wl,--as-needed',
9171
+            ],
9172
+            'conditions' : [
9173
+              ['no_gc_sections==0', {
9174
+                'ldflags': [
9175
+                  '-Wl,--gc-sections',
9176
+                ],
9177
+              }],
9178
+              ['OS=="android" and target_arch!="arm64"', {
9179
+                # We don't omit frame pointers on arm64 since they are required
9180
+                # to correctly unwind stackframes which contain system library
9181
+                # function frames (crbug.com/391706).
9182
+                'cflags': [
9183
+                  '-fomit-frame-pointer',
9184
+                ]
9185
+              }],
9186
+              ['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {
9187
+                # TODO(jdduke) Re-enable on mips after resolving linking
9188
+                # issues with libc++ (crbug.com/456380).
9189
+                'ldflags': [
9190
+                  # Warn in case of text relocations.
9191
+                  '-Wl,--warn-shared-textrel',
9192
+                ],
9193
+              }],
9194
+              ['OS=="android"', {
9195
+                'variables': {
9196
+                  'release_optimize%': 's',
9197
+                },
9198
+              }, {
9199
+                'ldflags': [
9200
+                  # TODO(pcc): Fix linker bug which requires us to link pthread
9201
+                  # unconditionally here (crbug.com/623236).
9202
+                  '-Wl,--no-as-needed',
9203
+                  '-lpthread',
9204
+                  '-Wl,--as-needed',
9205
+                ],
9206
+              }],
9207
+              ['profiling==1', {
9208
+                'cflags': [
9209
+                  '-fno-omit-frame-pointer',
9210
+                  '-g',
9211
+                ],
9212
+                'conditions' : [
9213
+                  ['profiling_full_stack_frames==1', {
9214
+                    'cflags': [
9215
+                      '-fno-inline',
9216
+                      '-fno-optimize-sibling-calls',
9217
+                    ],
9218
+                  }],
9219
+                ],
9220
+              }],
9221
+              ['release_unwind_tables==1', {
9222
+                'cflags': ['-funwind-tables'],
9223
+              }, {
9224
+                'cflags': ['-fno-unwind-tables', '-fno-asynchronous-unwind-tables'],
9225
+                'defines': ['NO_UNWIND_TABLES'],
9226
+              }],
9227
+            ],
9228
+          },
9229
+        },
9230
+        'conditions': [
9231
+          ['target_arch=="ia32"', {
9232
+            'target_conditions': [
9233
+              ['_toolset=="target"', {
9234
+                'asflags': [
9235
+                  # Needed so that libs with .s files (e.g. libicudata.a)
9236
+                  # are compatible with the general 32-bit-ness.
9237
+                  '-32',
9238
+                ],
9239
+                # All floating-point computations on x87 happens in 80-bit
9240
+                # precision.  Because the C and C++ language standards allow
9241
+                # the compiler to keep the floating-point values in higher
9242
+                # precision than what's specified in the source and doing so
9243
+                # is more efficient than constantly rounding up to 64-bit or
9244
+                # 32-bit precision as specified in the source, the compiler,
9245
+                # especially in the optimized mode, tries very hard to keep
9246
+                # values in x87 floating-point stack (in 80-bit precision)
9247
+                # as long as possible. This has important side effects, that
9248
+                # the real value used in computation may change depending on
9249
+                # how the compiler did the optimization - that is, the value
9250
+                # kept in 80-bit is different than the value rounded down to
9251
+                # 64-bit or 32-bit. There are possible compiler options to
9252
+                # make this behavior consistent (e.g. -ffloat-store would keep
9253
+                # all floating-values in the memory, thus force them to be
9254
+                # rounded to its original precision) but they have significant
9255
+                # runtime performance penalty.
9256
+                #
9257
+                # -mfpmath=sse -msse2 makes the compiler use SSE instructions
9258
+                # which keep floating-point values in SSE registers in its
9259
+                # native precision (32-bit for single precision, and 64-bit
9260
+                # for double precision values). This means the floating-point
9261
+                # value used during computation does not change depending on
9262
+                # how the compiler optimized the code, since the value is
9263
+                # always kept in its specified precision.
9264
+                #
9265
+                # Refer to http://crbug.com/348761 for rationale behind SSE2
9266
+                # being a minimum requirement for 32-bit Linux builds and
9267
+                # http://crbug.com/313032 for an example where this has "bit"
9268
+                # us in the past.
9269
+                'cflags': [
9270
+                  '-msse2',
9271
+                  '-mfpmath=sse',
9272
+                  '-mmmx',  # Allows mmintrin.h for MMX intrinsics.
9273
+                  '-m32',
9274
+                ],
9275
+                'ldflags': [
9276
+                  '-m32',
9277
+                ],
9278
+                'conditions': [
9279
+                  # Use gold linker for Android ia32 target.
9280
+                  ['OS=="android"', {
9281
+                     # Use gold linker for Android ia32 target.
9282
+                    'ldflags': [
9283
+                      '-fuse-ld=gold',
9284
+                    ],
9285
+                    # Use -mstackrealign due to a bug on ia32 Jelly Bean.
9286
+                    # See crbug.com/521527
9287
+                    'cflags': [
9288
+                      '-mstackrealign',
9289
+                    ],
9290
+                  }],
9291
+                ],
9292
+              }],
9293
+            ],
9294
+          }],
9295
+          ['target_arch=="x64"', {
9296
+            'target_conditions': [
9297
+              ['_toolset=="target"', {
9298
+                'conditions': [
9299
+                  # Use gold linker for Android x64 target.
9300
+                  ['OS=="android"', {
9301
+                    'ldflags': [
9302
+                      '-fuse-ld=gold',
9303
+                    ],
9304
+                  }],
9305
+                ],
9306
+                'cflags': [
9307
+                  '-m64',
9308
+                  '-march=x86-64',
9309
+                ],
9310
+                'ldflags': [
9311
+                  '-m64',
9312
+                ],
9313
+              }],
9314
+            ],
9315
+          }],
9316
+          ['target_arch=="arm"', {
9317
+            'target_conditions': [
9318
+              ['_toolset=="target"', {
9319
+                'conditions': [
9320
+                  ['clang==0', {
9321
+                    'cflags': [
9322
+                      # Don't warn about "maybe" uninitialized. Clang doesn't
9323
+                      # include this in -Wall but gcc does, and it gives false
9324
+                      # positives.
9325
+                      '-Wno-maybe-uninitialized',
9326
+                    ],
9327
+                    'cflags_cc': [
9328
+                      # The codesourcery arm-2009q3 toolchain warns at that the ABI
9329
+                      # has changed whenever it encounters a varargs function. This
9330
+                      # silences those warnings, as they are not helpful and
9331
+                      # clutter legitimate warnings.
9332
+                      '-Wno-abi',
9333
+                    ],
9334
+                  }],
9335
+                  ['clang==1 and arm_arch!="" and OS!="android"', {
9336
+                    'cflags': [
9337
+                      '-target arm-linux-gnueabihf',
9338
+                    ],
9339
+                    'ldflags': [
9340
+                      '-target arm-linux-gnueabihf',
9341
+                    ],
9342
+                  }],
9343
+                  ['arm_arch!=""', {
9344
+                    'cflags': [
9345
+                      '-march=<(arm_arch)',
9346
+                    ],
9347
+                    'conditions': [
9348
+                      ['use_lto==1 or use_lto_o2==1', {
9349
+                        'ldflags': [
9350
+                          '-march=<(arm_arch)',
9351
+                        ],
9352
+                      }],
9353
+                    ],
9354
+                  }],
9355
+                  ['arm_tune!=""', {
9356
+                    'cflags': [
9357
+                      '-mtune=<(arm_tune)',
9358
+                    ],
9359
+                    'conditions': [
9360
+                      ['use_lto==1 or use_lto_o2==1', {
9361
+                        'ldflags': [
9362
+                          '-mtune=<(arm_tune)',
9363
+                        ],
9364
+                      }],
9365
+                    ],
9366
+                  }],
9367
+                  ['arm_fpu!=""', {
9368
+                    'cflags': [
9369
+                      '-mfpu=<(arm_fpu)',
9370
+                    ],
9371
+                    'conditions': [
9372
+                      ['use_lto==1 or use_lto_o2==1', {
9373
+                        'ldflags': [
9374
+                          '-mfpu=<(arm_fpu)',
9375
+                        ],
9376
+                      }],
9377
+                    ],
9378
+                  }],
9379
+                  ['arm_float_abi!=""', {
9380
+                    'cflags': [
9381
+                      '-mfloat-abi=<(arm_float_abi)',
9382
+                    ],
9383
+                    'conditions': [
9384
+                      ['use_lto==1 or use_lto_o2==1', {
9385
+                        'ldflags': [
9386
+                          '-mfloat-abi=<(arm_float_abi)',
9387
+                        ],
9388
+                      }],
9389
+                    ],
9390
+                  }],
9391
+                  ['arm_thumb==1', {
9392
+                    'cflags': [
9393
+                      '-mthumb',
9394
+                    ],
9395
+                    'conditions': [
9396
+                      ['use_lto==1 or use_lto_o2==1', {
9397
+                        'ldflags': [
9398
+                          '-mthumb',
9399
+                        ],
9400
+                      }],
9401
+                    ],
9402
+                  }],
9403
+                  ['OS=="android"', {
9404
+                    # Most of the following flags are derived from what Android
9405
+                    # uses by default when building for arm, reference for which
9406
+                    # can be found in the following file in the Android NDK:
9407
+                    # toolchains/arm-linux-androideabi-4.9/setup.mk
9408
+                    'cflags': [
9409
+                      # The tree-sra optimization (scalar replacement for
9410
+                      # aggregates enabling subsequent optimizations) leads to
9411
+                      # invalid code generation when using the Android NDK's
9412
+                      # compiler (r5-r7). This can be verified using
9413
+                      # webkit_unit_tests' WTF.Checked_int8_t test.
9414
+                      '-fno-tree-sra',
9415
+                      # The following option is disabled to improve binary
9416
+                      # size and performance in gcc 4.9.
9417
+                      '-fno-caller-saves',
9418
+                      '-Wno-psabi',
9419
+                    ],
9420
+                    # Android now supports .relro sections properly.
9421
+                    # NOTE: While these flags enable the generation of .relro
9422
+                    # sections, the generated libraries can still be loaded on
9423
+                    # older Android platform versions.
9424
+                    'ldflags': [
9425
+                        '-Wl,-z,relro',
9426
+                        '-Wl,-z,now',
9427
+                        '-fuse-ld=gold',
9428
+                    ],
9429
+                    'conditions': [
9430
+                      ['arm_thumb==1', {
9431
+                        'cflags': [ '-mthumb-interwork' ],
9432
+                      }],
9433
+                      ['profiling==1', {
9434
+                        'cflags': [
9435
+                          # Thumb code with frame pointer makes chrome crash
9436
+                          # early.
9437
+                          '-marm',
9438
+                          '-mapcs-frame', # Required by -fno-omit-frame-pointer.
9439
+                          # The perf report sometimes incorrectly attributes
9440
+                          # code from tail calls.
9441
+                          '-fno-optimize-sibling-calls',
9442
+                        ],
9443
+                        'cflags!': [
9444
+                          '-fomit-frame-pointer',
9445
+                        ],
9446
+                      }],
9447
+                      ['clang==1', {
9448
+                        'cflags!': [
9449
+                          # Clang does not support the following options.
9450
+                          '-mapcs-frame',
9451
+                          '-mthumb-interwork',
9452
+                          '-finline-limit=64',
9453
+                          '-fno-tree-sra',
9454
+                          '-fno-caller-saves',
9455
+                          '-Wno-psabi',
9456
+                        ],
9457
+                      }],
9458
+                      ['clang==1 and linux_use_bundled_gold==0', {
9459
+                        'ldflags': [
9460
+                          # Let clang find the ld.gold in the NDK.
9461
+                          '--gcc-toolchain=<(android_toolchain)/..',
9462
+                        ],
9463
+                      }],
9464
+                      ['asan==1', {
9465
+                        'cflags': [
9466
+                          '-marm', # Required for frame pointer based stack traces.
9467
+                        ],
9468
+                      }],
9469
+                    ],
9470
+                  }],
9471
+                  ['chromecast==1', {
9472
+                    'cflags': [
9473
+                      # We set arm_arch to "" so that -march compiler option
9474
+                      # is not set.  Otherwise a gcc bug that would complain
9475
+                      # about it conflicting with '-mcpu=cortex-a9'. The flag
9476
+                      # '-march=armv7-a' is actually redundant anyway because
9477
+                      # it is enabled by default when we built the toolchain.
9478
+                      # And using '-mcpu=cortex-a9' should be sufficient.
9479
+                      '-mcpu=cortex-a9',
9480
+                      '-funwind-tables',
9481
+                      # Breakpad requires symbols with debugging information
9482
+                      '-g',
9483
+                    ],
9484
+                    'ldflags': [
9485
+                      # We want to statically link libstdc++/libgcc.
9486
+                      '-static-libstdc++',
9487
+                      '-static-libgcc',
9488
+                      # Don't allow visible symbols from libraries that contain
9489
+                      # assembly code with symbols that aren't hidden properly.
9490
+                      # http://b/26390825
9491
+                      '-Wl,--exclude-libs=libffmpeg.a',
9492
+                    ],
9493
+                    'cflags!': [
9494
+                      # Some components in Chromium (e.g. v8, skia, ffmpeg)
9495
+                      # define their own cflags for arm builds that could
9496
+                      # conflict with the flags we set here (e.g.
9497
+                      # '-mcpu=cortex-a9'). Remove these flags explicitly.
9498
+                      '-march=armv7-a',
9499
+                      '-mtune=cortex-a8',
9500
+                    ],
9501
+                    'target_conditions': [
9502
+                      [ '_type=="executable" and OS!="android"', {
9503
+                        # Statically link whole libstdc++ and libgcc in
9504
+                        # executables to ensure only one copy at runtime.
9505
+                        'ldflags': [
9506
+                          # Note executables also get -static-stdlibc++/libgcc.
9507
+                          # Despite including libstdc++/libgcc archives, we
9508
+                          # still need to specify static linking for them in
9509
+                          # order to prevent the executable from having a
9510
+                          # dynamic dependency on them.
9511
+                          # Export stdlibc++ and libgcc symbols to force shlibs
9512
+                          # to refer to these symbols from the executable.
9513
+                          '-Wl,--export-dynamic',
9514
+                          '-lm', # stdlibc++ requires math.h
9515
+                          # In case we redefined stdlibc++ symbols
9516
+                          # (e.g. tc_malloc)
9517
+                          '-Wl,--allow-multiple-definition',
9518
+                          '-Wl,--whole-archive',
9519
+                          '-l:libstdc++.a',
9520
+                          '-l:libgcc.a',
9521
+                          '-Wl,--no-whole-archive',
9522
+                        ],
9523
+                      }]
9524
+                    ],
9525
+                  }],
9526
+                ],
9527
+              }],
9528
+            ],
9529
+          }],
9530
+          ['target_arch=="arm64"', {
9531
+            'target_conditions': [
9532
+              ['_toolset=="target"', {
9533
+                'conditions': [
9534
+                  ['OS=="android"', {
9535
+                    'cflags!': [
9536
+                       '-fstack-protector',  # stack protector is always enabled on arm64.
9537
+                    ],
9538
+                  }],
9539
+                  ['clang==1 and arm_arch!="" and OS!="android"', {
9540
+                    'cflags': [
9541
+                      '-target aarch64-linux-gnu',
9542
+                     ],
9543
+                     'ldflags': [
9544
+                       '-target aarch64-linux-gnu',
9545
+                     ],
9546
+                 }],
9547
+                ],
9548
+              }],
9549
+            ],
9550
+          }],
9551
+          ['target_arch=="mipsel"', {
9552
+            'target_conditions': [
9553
+              ['_toolset=="target"', {
9554
+                'conditions': [
9555
+                  ['mips_arch_variant=="r6"', {
9556
+                    'conditions': [
9557
+                      ['clang==1', {
9558
+                        'conditions': [
9559
+                          ['OS=="android"', {
9560
+                            'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r6', ],
9561
+                            'ldflags': [ '-target mipsel-linux-android', ],
9562
+                          }],
9563
+                        ],
9564
+                      }, { # clang==0
9565
+                        'cflags': ['-mips32r6', '-Wa,-mips32r6', ],
9566
+                      }],
9567
+                      ['clang==0 and OS=="android"', {
9568
+                        'ldflags': ['-mips32r6', '-Wl,-melf32ltsmip',],
9569
+                      }],
9570
+                      ['mips_msa==1', {
9571
+                        'cflags': ['-mmsa', '-mfp64', '-msched-weight', '-mload-store-pairs'],
9572
+                      }],
9573
+                    ],
9574
+                    'cflags': [ '-mfp64', '-mno-odd-spreg' ],
9575
+                    'ldflags': [ '-mfp64', '-mno-odd-spreg' ],
9576
+                  }],
9577
+                  ['mips_arch_variant=="r2"', {
9578
+                    'conditions': [
9579
+                      ['mips_float_abi=="hard" and mips_fpu_mode!=""', {
9580
+                        'cflags': ['-m<(mips_fpu_mode)'],
9581
+                      }],
9582
+                      ['clang==1', {
9583
+                         'conditions': [
9584
+                          ['OS=="android"', {
9585
+                            'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32r2'],
9586
+                            'ldflags': [ '-target mipsel-linux-android', ],
9587
+                          }, {
9588
+                            'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32r2'],
9589
+                            'ldflags': [ '-target mipsel-linux-gnu', ],
9590
+                          }],
9591
+                         ],
9592
+                      }, { # clang==0
9593
+                        'cflags': ['-mips32r2', '-Wa,-mips32r2', ],
9594
+                      }],
9595
+                    ],
9596
+                  }],
9597
+                  ['mips_arch_variant=="r1"', {
9598
+                    'conditions': [
9599
+                      ['clang==1', {
9600
+                        'conditions': [
9601
+                          ['OS=="android"', {
9602
+                            'cflags': [ '-target mipsel-linux-android', '-march=mipsel', '-mcpu=mips32'],
9603
+                            'ldflags': [ '-target mipsel-linux-android', ],
9604
+                          }, {
9605
+                            'cflags': [ '-target mipsel-linux-gnu', '-march=mipsel', '-mcpu=mips32'],
9606
+                            'ldflags': [ '-target mipsel-linux-gnu', ],
9607
+                          }],
9608
+                        ],
9609
+                      }, { # clang==0
9610
+                        'cflags': ['-mips32', '-Wa,-mips32', ],
9611
+                      }],
9612
+                    ],
9613
+                  }],
9614
+                  ['clang==1', {
9615
+                    'cflags!': [
9616
+                      # Clang does not support the following options.
9617
+                      '-finline-limit=64',
9618
+                    ],
9619
+                    # TODO(gordanac) Enable integrated-as.
9620
+                    'cflags': [ '-fno-integrated-as' ],
9621
+                    'conditions': [
9622
+                      ['OS=="android"', {
9623
+                        'cflags': [
9624
+                          # Else /usr/bin/as gets picked up.
9625
+                          '-B<(android_toolchain)',
9626
+                        ],
9627
+                      }],
9628
+                    ],
9629
+                  }],
9630
+                  ['clang==1 and OS=="android"', {
9631
+                    'ldflags': [
9632
+                      # Let clang find the ld in the NDK.
9633
+                      '--gcc-toolchain=<(android_toolchain)/..',
9634
+                    ],
9635
+                  }],
9636
+                  ['mips_dsp_rev==1', {
9637
+                    'cflags': ['-mdsp'],
9638
+                  }],
9639
+                  ['mips_dsp_rev==2', {
9640
+                    'cflags': ['-mdspr2'],
9641
+                  }],
9642
+                ],
9643
+                'cflags': [
9644
+                  '-m<(mips_float_abi)-float'
9645
+                ],
9646
+                'ldflags': [
9647
+                  '-Wl,--no-keep-memory'
9648
+                ],
9649
+                'cflags_cc': [
9650
+                  '-Wno-uninitialized',
9651
+                ],
9652
+              }],
9653
+              ['_toolset=="target" and _type=="executable"', {
9654
+                'conditions': [
9655
+                  ['OS=="linux"', {
9656
+                    'ldflags': ['-pie'],
9657
+                  }],
9658
+                ],
9659
+              }],
9660
+            ],
9661
+          }],
9662
+          ['target_arch=="mips64el"', {
9663
+            'target_conditions': [
9664
+              ['_toolset=="target"', {
9665
+                'conditions': [
9666
+                  ['mips_arch_variant=="r6"', {
9667
+                    'conditions': [
9668
+                      ['clang==1', {
9669
+                        'conditions': [
9670
+                          ['OS=="android"', {
9671
+                            'cflags': [ '-target mips64el-linux-android', '-march=mips64el', '-mcpu=mips64r6', ],
9672
+                            'ldflags': [ '-target mips64el-linux-android', ],
9673
+                          }],
9674
+                        ],
9675
+                      }, { # clang==0
9676
+                        'cflags': ['-mips64r6', '-Wa,-mips64r6'],
9677
+                        'ldflags': ['-mips64r6'],
9678
+                      }],
9679
+                      ['mips_msa==1', {
9680
+                        'cflags': ['-mmsa', '-mfp64', '-msched-weight', '-mload-store-pairs'],
9681
+                      }],
9682
+                    ],
9683
+                  }],
9684
+                  ['mips_arch_variant=="r2"', {
9685
+                    'cflags': ['-mips64r2', '-Wa,-mips64r2'],
9686
+                    'ldflags': ['-mips64r2'],
9687
+                  }],
9688
+                  ['clang==1', {
9689
+                    'cflags!': [
9690
+                      # Clang does not support the following options.
9691
+                      '-finline-limit=64',
9692
+                    ],
9693
+                    # TODO(gordanac) Enable integrated-as.
9694
+                    'cflags': [ '-fno-integrated-as' ],
9695
+                    'conditions': [
9696
+                      ['OS=="android"', {
9697
+                        'cflags': [
9698
+                          # Else /usr/bin/as gets picked up.
9699
+                          '-B<(android_toolchain)',
9700
+                        ],
9701
+                      }],
9702
+                    ],
9703
+                  }],
9704
+                  ['clang==1 and OS=="android"', {
9705
+                    'ldflags': [
9706
+                      # Let clang find the ld in the NDK.
9707
+                      '--gcc-toolchain=<(android_toolchain)/..',
9708
+                    ],
9709
+                  }],
9710
+                ],
9711
+                'cflags_cc': [
9712
+                  '-Wno-uninitialized',
9713
+                ],
9714
+              }],
9715
+            ],
9716
+          }],
9717
+          ['linux_fpic==1', {
9718
+            'cflags': [
9719
+              '-fPIC',
9720
+            ],
9721
+            'ldflags': [
9722
+              '-fPIC',
9723
+            ],
9724
+          }],
9725
+          ['sysroot!=""', {
9726
+            'target_conditions': [
9727
+              ['_toolset=="target"', {
9728
+                'cflags': [
9729
+                  '--sysroot=<(sysroot)',
9730
+                ],
9731
+                'ldflags': [
9732
+                  '--sysroot=<(sysroot)',
9733
+                  '<!(<(DEPTH)/build/linux/sysroot_ld_path.sh <(sysroot))',
9734
+                ],
9735
+              }]]
9736
+          }],
9737
+          ['clang==1', {
9738
+            'cflags': [
9739
+              # See http://crbug.com/110262
9740
+              '-fcolor-diagnostics',
9741
+            ],
9742
+            'cflags_cc': [
9743
+              # gnu++11 instead of c++11 is needed because some code uses
9744
+              # typeof() (a GNU extension).
9745
+              # TODO(thakis): Eventually switch this to c++11 instead,
9746
+              # http://crbug.com/427584
9747
+              '-std=gnu++11',
9748
+            ],
9749
+          }],
9750
+          ['clang==1 and chromeos==1', {
9751
+            'cflags': [
9752
+              # TODO(thakis): Remove, http://crbug.com/263960
9753
+              '-Wno-reserved-user-defined-literal',
9754
+            ],
9755
+          }],
9756
+          ['clang==0 and host_clang==1', {
9757
+            'target_conditions': [
9758
+              ['_toolset=="host"', {
9759
+                'cflags_cc': [ '-std=gnu++11', ],
9760
+              }],
9761
+            ],
9762
+          }],
9763
+          ['clang==1 and clang_use_chrome_plugins==1', {
9764
+            'cflags': [
9765
+              '<@(clang_chrome_plugins_flags)',
9766
+            ],
9767
+          }],
9768
+          ['clang==1 and clang_load!=""', {
9769
+            'cflags': [
9770
+              '-Xclang', '-load', '-Xclang', '<(clang_load)',
9771
+            ],
9772
+          }],
9773
+          ['clang==1 and clang_add_plugin!=""', {
9774
+            'cflags': [
9775
+              '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
9776
+            ],
9777
+          }],
9778
+          ['clang==1 and target_arch=="ia32"', {
9779
+            'cflags': [
9780
+              # Else building libyuv gives clang's register allocator issues,
9781
+              # see llvm.org/PR15798 / crbug.com/233709
9782
+              '-momit-leaf-frame-pointer',
9783
+              # Align the stack on 16-byte boundaries, http://crbug.com/418554.
9784
+              '-mstack-alignment=16',
9785
+              '-mstackrealign',
9786
+            ],
9787
+          }],
9788
+          # Common options for AddressSanitizer, LeakSanitizer,
9789
+          # ThreadSanitizer, MemorySanitizer and non-official CFI builds.
9790
+          ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_security==1 or ubsan_vptr==1 or '
9791
+           '(cfi_vptr==1 and buildtype!="Official")', {
9792
+            'target_conditions': [
9793
+              ['_toolset=="target"', {
9794
+                'cflags': [
9795
+                  '-fno-omit-frame-pointer',
9796
+                  '-gline-tables-only',
9797
+                ],
9798
+                'cflags!': [
9799
+                  '-fomit-frame-pointer',
9800
+                ],
9801
+              }],
9802
+            ],
9803
+          }],
9804
+          ['asan==1 or lsan==1 or tsan==1 or msan==1', {
9805
+            'target_conditions': [
9806
+              ['_toolset=="target"', {
9807
+                'ldflags!': [
9808
+                  # Functions interposed by the sanitizers can make ld think
9809
+                  # that some libraries aren't needed when they actually are,
9810
+                  # http://crbug.com/234010. As workaround, disable --as-needed.
9811
+                  '-Wl,--as-needed',
9812
+                ],
9813
+                'defines': [
9814
+                  'MEMORY_TOOL_REPLACES_ALLOCATOR',
9815
+                  'MEMORY_SANITIZER_INITIAL_SIZE',
9816
+                ],
9817
+              }],
9818
+            ],
9819
+          }],
9820
+          ['asan==1', {
9821
+            'target_conditions': [
9822
+              ['_toolset=="target"', {
9823
+                'cflags': [
9824
+                  '-fsanitize=address',
9825
+                  # TODO(eugenis): Re-enable. http://crbug.com/427202
9826
+                  #'-fsanitize-blacklist=<(asan_blacklist)',
9827
+                ],
9828
+                'ldflags': [
9829
+                  '-fsanitize=address',
9830
+                ],
9831
+              }],
9832
+            ],
9833
+            'conditions': [
9834
+              ['OS=="mac"', {
9835
+                'cflags': [
9836
+                  '-mllvm -asan-globals=0',  # http://crbug.com/352073
9837
+                ],
9838
+              }],
9839
+            ],
9840
+          }],
9841
+          ['ubsan==1', {
9842
+            'target_conditions': [
9843
+              ['_toolset=="target"', {
9844
+                'conditions': [
9845
+                  ['chromecast==0', {
9846
+                    'cflags': [
9847
+                      # Employ the experimental PBQP register allocator to avoid
9848
+                      # slow compilation on files with too many basic blocks.
9849
+                      # See http://crbug.com/426271.
9850
+                      '-mllvm -regalloc=pbqp',
9851
+                      # Speculatively use coalescing to slightly improve the code
9852
+                      # generated by PBQP regallocator. May increase compile time.
9853
+                      '-mllvm -pbqp-coalescing',
9854
+                    ],
9855
+                  }],
9856
+                ],
9857
+                'cflags': [
9858
+                  # FIXME: work on enabling more flags and getting rid of false
9859
+                  # positives. http://crbug.com/174801.
9860
+                  '-fsanitize=bounds',
9861
+                  '-fsanitize=float-divide-by-zero',
9862
+                  '-fsanitize=integer-divide-by-zero',
9863
+                  '-fsanitize=null',
9864
+                  '-fsanitize=object-size',
9865
+                  '-fsanitize=return',
9866
+                  '-fsanitize=returns-nonnull-attribute',
9867
+                  '-fsanitize=shift-exponent',
9868
+                  '-fsanitize=signed-integer-overflow',
9869
+                  '-fsanitize=unreachable',
9870
+                  '-fsanitize=vla-bound',
9871
+                  '-fsanitize-blacklist=<(ubsan_blacklist)',
9872
+                ],
9873
+                'cflags_cc!': [
9874
+                  '-fno-rtti',
9875
+                ],
9876
+                'cflags!': [
9877
+                  '-fno-rtti',
9878
+                ],
9879
+                'ldflags': [
9880
+                  '-fsanitize=undefined',
9881
+                ],
9882
+                'defines': [
9883
+                  'UNDEFINED_SANITIZER',
9884
+                ],
9885
+              }],
9886
+            ],
9887
+          }],
9888
+          ['ubsan_security==1', {
9889
+            'target_conditions': [
9890
+              ['_toolset=="target"', {
9891
+                'cflags': [
9892
+                  '-fsanitize=signed-integer-overflow,shift,vptr',
9893
+                  '-fsanitize-blacklist=<(ubsan_security_blacklist)',
9894
+                ],
9895
+                'cflags_cc!': [
9896
+                  '-fno-rtti',
9897
+                ],
9898
+                'cflags!': [
9899
+                  '-fno-rtti',
9900
+                ],
9901
+                'ldflags': [
9902
+                  '-fsanitize=signed-integer-overflow,shift,vptr',
9903
+                ],
9904
+                'defines': [
9905
+                  'UNDEFINED_SANITIZER',
9906
+                ],
9907
+              }],
9908
+            ],
9909
+          }],
9910
+          ['ubsan_vptr==1', {
9911
+            'target_conditions': [
9912
+              ['_toolset=="target"', {
9913
+                'cflags': [
9914
+                  '-fsanitize=vptr',
9915
+                  '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
9916
+                ],
9917
+                'cflags_cc!': [
9918
+                  '-fno-rtti',
9919
+                ],
9920
+                'cflags!': [
9921
+                  '-fno-rtti',
9922
+                ],
9923
+                'ldflags': [
9924
+                  '-fsanitize=vptr',
9925
+                ],
9926
+                'defines': [
9927
+                  'UNDEFINED_SANITIZER',
9928
+                ],
9929
+              }],
9930
+            ],
9931
+          }],
9932
+          ['sanitizer_coverage!=""', {
9933
+            'target_conditions': [
9934
+              ['_toolset=="target"', {
9935
+                'cflags': [
9936
+                  '-fsanitize-coverage=<(sanitizer_coverage)',
9937
+                ],
9938
+                'defines': [
9939
+                  'SANITIZER_COVERAGE',
9940
+                ],
9941
+              }],
9942
+            ],
9943
+          }],
9944
+          ['sanitizer_coverage!="" and target_arch=="arm"', {
9945
+            'target_conditions': [
9946
+              ['_toolset=="target"', {
9947
+                'cflags': [
9948
+                  '-mllvm -sanitizer-coverage-block-threshold=0',  # http://crbug.com/517105
9949
+                ],
9950
+              }],
9951
+            ],
9952
+          }],
9953
+          ['asan_field_padding!=0', {
9954
+            'target_conditions': [
9955
+              ['_toolset=="target"', {
9956
+                'cflags': [
9957
+                  '-fsanitize-address-field-padding=<(asan_field_padding)',
9958
+                ],
9959
+              }],
9960
+            ],
9961
+          }],
9962
+          ['lsan==1', {
9963
+            'target_conditions': [
9964
+              ['_toolset=="target"', {
9965
+                'cflags': [
9966
+                  '-fsanitize=leak',
9967
+                ],
9968
+                'ldflags': [
9969
+                  '-fsanitize=leak',
9970
+                ],
9971
+                'defines': [
9972
+                  'LEAK_SANITIZER',
9973
+                  'WTF_USE_LEAK_SANITIZER=1',
9974
+                ],
9975
+              }],
9976
+            ],
9977
+          }],
9978
+          ['tsan==1', {
9979
+            'target_conditions': [
9980
+              ['_toolset=="target"', {
9981
+                'cflags': [
9982
+                  '-fsanitize=thread',
9983
+                  '-fsanitize-blacklist=<(tsan_blacklist)',
9984
+                ],
9985
+                'ldflags': [
9986
+                  '-fsanitize=thread',
9987
+                ],
9988
+                'defines': [
9989
+                  'THREAD_SANITIZER',
9990
+                  'DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL=1',
9991
+                  'WTF_USE_DYNAMIC_ANNOTATIONS_NOIMPL=1',
9992
+                ],
9993
+              }],
9994
+            ],
9995
+          }],
9996
+          ['msan==1', {
9997
+            'target_conditions': [
9998
+              ['_toolset=="target"', {
9999
+                'cflags': [
10000
+                  '-fsanitize=memory',
10001
+                  '-fsanitize-memory-track-origins=<(msan_track_origins)',
10002
+                  '-fsanitize-blacklist=<(msan_blacklist)',
10003
+                ],
10004
+                'ldflags': [
10005
+                  '-fsanitize=memory',
10006
+                ],
10007
+                'defines': [
10008
+                  'MEMORY_SANITIZER',
10009
+                ],
10010
+              }],
10011
+            ],
10012
+          }],
10013
+          ['use_instrumented_libraries==1', {
10014
+            'dependencies': [
10015
+              '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:instrumented_libraries',
10016
+            ],
10017
+          }],
10018
+          ['use_prebuilt_instrumented_libraries==1', {
10019
+            'dependencies': [
10020
+              '<(DEPTH)/third_party/instrumented_libraries/instrumented_libraries.gyp:prebuilt_instrumented_libraries',
10021
+            ],
10022
+          }],
10023
+          ['use_custom_libcxx==1', {
10024
+            'dependencies': [
10025
+              '<(DEPTH)/buildtools/third_party/libc++/libc++.gyp:libcxx_proxy',
10026
+            ],
10027
+          }],
10028
+          ['order_profiling!=0 and OS=="android"', {
10029
+            'target_conditions' : [
10030
+              ['_toolset=="target"', {
10031
+                'cflags': ['-finstrument-functions'],
10032
+                'defines': ['CYGPROFILE_INSTRUMENTATION'],
10033
+              }],
10034
+            ],
10035
+          }],
10036
+          # Clang doesn't understand -finstrument-functions-exclude-file-list=.
10037
+          ['order_profiling!=0 and OS=="android" and clang==0', {
10038
+            'target_conditions' : [
10039
+              ['_toolset=="target"', {
10040
+                'cflags': [
10041
+                  # Allow mmx intrinsics to inline, so that the
10042
+                  # compiler can expand the intrinsics.
10043
+                  '-finstrument-functions-exclude-file-list=mmintrin.h',
10044
+                  # Avoids errors with current NDK:
10045
+                  # "third_party/android_tools/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/include/arm_neon.h:3426:3: error: argument must be a constant"
10046
+                  '-finstrument-functions-exclude-file-list=arm_neon.h',
10047
+                ],
10048
+              }],
10049
+            ],
10050
+          }],
10051
+          ['linux_dump_symbols==1', {
10052
+            'cflags': [ '-g' ],
10053
+            'conditions': [
10054
+              ['OS=="linux" and host_arch=="ia32" and linux_use_bundled_gold==0', {
10055
+                'target_conditions': [
10056
+                  ['_toolset=="target"', {
10057
+                    'ldflags': [
10058
+                      # Attempt to use less memory to prevent the linker from
10059
+                      # running out of address space. Considering installing a
10060
+                      # 64-bit kernel and switching to a 64-bit linker.
10061
+                      '-Wl,--no-keep-memory',
10062
+                    ],
10063
+                  }],
10064
+                ],
10065
+              }],
10066
+            ],
10067
+          }],
10068
+          ['use_allocator!="tcmalloc"', {
10069
+            'defines': ['NO_TCMALLOC'],
10070
+          }],
10071
+          ['linux_use_gold_flags==1', {
10072
+            # Newer gccs and clangs support -fuse-ld, use the flag to force gold
10073
+            # selection.
10074
+            # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html
10075
+            'ldflags': [ '-fuse-ld=gold', ],
10076
+            'target_conditions': [
10077
+              ['_toolset=="target"', {
10078
+                'conditions': [
10079
+                  # TODO(thestig): Enable this for disabled cases.
10080
+                  [ 'linux_use_bundled_binutils==1', {
10081
+                    'ldflags': [
10082
+                      # Experimentation found that using four linking threads
10083
+                      # saved ~20% of link time.
10084
+                      # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_thread/thread/281527606915bb36
10085
+                      # Only apply this to the target linker, since the host
10086
+                      # linker might not be gold, but isn't used much anyway.
10087
+                      '-Wl,--threads',
10088
+                      '-Wl,--thread-count=4',
10089
+                    ],
10090
+                  }],
10091
+                  # TODO(thestig): Enable this for disabled cases.
10092
+                  [ 'buildtype!="Official" and chromeos==0 and release_valgrind_build==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_security==0 and ubsan_vptr==0', {
10093
+                    'ldflags': [
10094
+                      '-Wl,--detect-odr-violations',
10095
+                    ],
10096
+                  }],
10097
+                ],
10098
+              }],
10099
+            ],
10100
+            'conditions': [
10101
+              ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
10102
+                'target_conditions': [
10103
+                  ['_toolset=="target"', {
10104
+                    'ldflags': [
10105
+                      '-Wl,--icf=<(gold_icf_level)',
10106
+                    ],
10107
+                  }],
10108
+                ],
10109
+              }],
10110
+            ],
10111
+          }],
10112
+          ['linux_use_bundled_binutils==1', {
10113
+            'cflags': [
10114
+              '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
10115
+            ],
10116
+          }],
10117
+          ['linux_use_bundled_gold==1 and '
10118
+           'not (clang==0 and (use_lto==1 or use_lto_o2==1))', {
10119
+            # Put our binutils, which contains gold in the search path. We pass
10120
+            # the path to gold to the compiler. gyp leaves unspecified what the
10121
+            # cwd is when running the compiler, so the normal gyp path-munging
10122
+            # fails us. This hack gets the right path.
10123
+            #
10124
+            # Disabled when using GCC LTO because GCC also uses the -B search
10125
+            # path at link time to find "as", and our bundled "as" can only
10126
+            # target x86.
10127
+            'ldflags': [
10128
+              '-B<!(cd <(DEPTH) && pwd -P)/<(binutils_dir)',
10129
+            ],
10130
+          }],
10131
+          # Some binutils 2.23 releases may or may not have new dtags enabled,
10132
+          # but they are all compatible with --disable-new-dtags,
10133
+          # because the new dynamic tags are not created by default.
10134
+          ['binutils_version>=223', {
10135
+            # Newer binutils don't set DT_RPATH unless you disable "new" dtags
10136
+            # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
10137
+            # FIXME(mithro): Figure out the --as-needed/--no-as-needed flags
10138
+            # inside this file to allow usage of --no-as-needed and removal of
10139
+            # this flag.
10140
+            'ldflags': [
10141
+              '-Wl,--disable-new-dtags',
10142
+            ],
10143
+          }],
10144
+          ['clang==0', {
10145
+            'target_conditions': [
10146
+              ['_toolset=="target"', {
10147
+                'cflags_cc': [
10148
+                  '-std=gnu++11',
10149
+                  # See comment for -Wno-c++11-narrowing.
10150
+                  '-Wno-narrowing',
10151
+                ],
10152
+              }],
10153
+            ],
10154
+          }],
10155
+          ['clang==0 and host_clang==0', {
10156
+            'target_conditions': [
10157
+              ['_toolset=="host"', {
10158
+                'cflags_cc': [
10159
+                  '-std=gnu++11',
10160
+                  # See comment for -Wno-c++11-narrowing.
10161
+                  '-Wno-narrowing',
10162
+                ],
10163
+              }],
10164
+            ],
10165
+          }],
10166
+          ['clang==0 and chromeos==1', {
10167
+            'target_conditions': [
10168
+              ['_toolset=="target"', {
10169
+                'cflags_cc': [
10170
+                  # TODO(thakis): Remove, http://crbug.com/263960
10171
+                  '-Wno-literal-suffix',
10172
+                ],
10173
+              }],
10174
+            ],
10175
+          }],
10176
+          ['clang==0 and host_clang==0 and chromeos==1', {
10177
+            'target_conditions': [
10178
+              ['_toolset=="host"', {
10179
+                'cflags_cc': [
10180
+                  # TODO(thakis): Remove, http://crbug.com/263960
10181
+                  '-Wno-literal-suffix',
10182
+                ],
10183
+              }],
10184
+            ],
10185
+          }],
10186
+        ],
10187
+      },
10188
+    }],
10189
+    # *BSD-specific options; note that most *BSD options are set above,
10190
+    # with Linux.
10191
+    ['OS=="openbsd" or OS=="freebsd"', {
10192
+      'target_defaults': {
10193
+        'ldflags': [
10194
+          '-Wl,--no-keep-memory',
10195
+        ],
10196
+      },
10197
+    }],
10198
+    # Android-specific options; note that most are set above with Linux.
10199
+    ['OS=="android"', {
10200
+      'variables': {
10201
+        # Placing this variable here prevents from forking libvpx, used
10202
+        # by remoting.  Remoting is off, so it needn't built,
10203
+        # so forking it's deps seems like overkill.
10204
+        # But this variable need defined to properly run gyp.
10205
+        # A proper solution is to have an OS==android conditional
10206
+        # in third_party/libvpx/libvpx.gyp to define it.
10207
+        'libvpx_path': 'lib/linux/arm',
10208
+      },
10209
+      'target_defaults': {
10210
+        'variables': {
10211
+          'release_extra_cflags%': '',
10212
+          'conditions': [
10213
+            # If we're using the components build, append "cr" to all shared
10214
+            # libraries to avoid naming collisions with android system library
10215
+            # versions with the same name (e.g. skia, icu).
10216
+            ['component=="shared_library"', {
10217
+              'android_product_extension': 'cr.so',
10218
+            }, {
10219
+              'android_product_extension': 'so',
10220
+            } ],
10221
+          ],
10222
+        },
10223
+        'target_conditions': [
10224
+          ['_type=="shared_library"', {
10225
+            'product_extension': '<(android_product_extension)',
10226
+          }],
10227
+          # Settings for building device targets using Android's toolchain.
10228
+          # These are based on the setup.mk file from the Android NDK.
10229
+          #
10230
+          # The NDK Android executable link step looks as follows:
10231
+          #  $LDFLAGS
10232
+          #  $(TARGET_CRTBEGIN_DYNAMIC_O)  <-- crtbegin.o
10233
+          #  $(PRIVATE_OBJECTS)            <-- The .o that we built
10234
+          #  $(PRIVATE_STATIC_LIBRARIES)   <-- The .a that we built
10235
+          #  $(TARGET_LIBGCC)              <-- libgcc.a
10236
+          #  $(PRIVATE_SHARED_LIBRARIES)   <-- The .so that we built
10237
+          #  $(PRIVATE_LDLIBS)             <-- System .so
10238
+          #  $(TARGET_CRTEND_O)            <-- crtend.o
10239
+          #
10240
+          # For now the above are approximated for executables by adding
10241
+          # crtbegin.o to the end of the ldflags and 'crtend.o' to the end
10242
+          # of 'libraries'.
10243
+          #
10244
+          # The NDK Android shared library link step looks as follows:
10245
+          #  $LDFLAGS
10246
+          #  $(PRIVATE_OBJECTS)            <-- The .o that we built
10247
+          #  -l,--whole-archive
10248
+          #  $(PRIVATE_WHOLE_STATIC_LIBRARIES)
10249
+          #  -l,--no-whole-archive
10250
+          #  $(PRIVATE_STATIC_LIBRARIES)   <-- The .a that we built
10251
+          #  $(TARGET_LIBGCC)              <-- libgcc.a
10252
+          #  $(PRIVATE_SHARED_LIBRARIES)   <-- The .so that we built
10253
+          #  $(PRIVATE_LDLIBS)             <-- System .so
10254
+          #
10255
+          # For now, assume that whole static libraries are not needed.
10256
+          #
10257
+          # For both executables and shared libraries, add the proper
10258
+          # libgcc.a to the start of libraries which puts it in the
10259
+          # proper spot after .o and .a files get linked in.
10260
+          #
10261
+          # TODO: The proper thing to do longer-tem would be proper gyp
10262
+          # support for a custom link command line.
10263
+          ['_toolset=="target"', {
10264
+            'cflags!': [
10265
+              '-pthread',  # Not supported by Android toolchain.
10266
+            ],
10267
+            'cflags': [
10268
+              '-ffunction-sections',
10269
+              '-funwind-tables',
10270
+              '-g',
10271
+              '-fstack-protector',
10272
+              '-fno-short-enums',
10273
+              '-finline-limit=64',
10274
+              '<@(release_extra_cflags)',
10275
+              '--sysroot=<(android_ndk_sysroot)',
10276
+            ],
10277
+            'cflags_cc': [
10278
+              # NOTE: The libc++ header include paths below are specified in
10279
+              # cflags rather than include_dirs because they need to come
10280
+              # after include_dirs.
10281
+              # The include ordering here is important; change with caution.
10282
+              '-isystem<(android_libcpp_include)',
10283
+              '-isystem<(android_ndk_root)/sources/cxx-stl/llvm-libc++abi/libcxxabi/include',
10284
+              '-isystem<(android_ndk_root)/sources/android/support/include',
10285
+            ],
10286
+            'defines': [
10287
+              'ANDROID',
10288
+              '__GNU_SOURCE=1',  # Necessary for clone()
10289
+              # The NDK has these things, but doesn't define the constants
10290
+              # to say that it does. Define them here instead.
10291
+              'HAVE_SYS_UIO_H',
10292
+              'ANDROID_NDK_VERSION=<(android_ndk_version)',
10293
+            ],
10294
+            'ldflags!': [
10295
+              '-pthread',  # Not supported by Android toolchain.
10296
+            ],
10297
+            'ldflags': [
10298
+              '-Wl,--build-id=sha1',
10299
+              '-Wl,--no-undefined',
10300
+              '--sysroot=<(android_ndk_sysroot)',
10301
+              '-nostdlib',
10302
+              '-L<(android_libcpp_libs_dir)',
10303
+              # Don't allow visible symbols from libgcc or libc++ to be
10304
+              # re-exported.
10305
+              '-Wl,--exclude-libs=libgcc.a',
10306
+              '-Wl,--exclude-libs=libc++_static.a',
10307
+              # Don't allow visible symbols from libraries that contain
10308
+              # assembly code with symbols that aren't hidden properly.
10309
+              # http://crbug.com/448386
10310
+              '-Wl,--exclude-libs=libcommon_audio.a',
10311
+              '-Wl,--exclude-libs=libcommon_audio_neon.a',
10312
+              '-Wl,--exclude-libs=libcommon_audio_sse2.a',
10313
+              '-Wl,--exclude-libs=libiSACFix.a',
10314
+              '-Wl,--exclude-libs=libisac_neon.a',
10315
+              '-Wl,--exclude-libs=libopus.a',
10316
+              '-Wl,--exclude-libs=libvpx.a',
10317
+            ],
10318
+            'libraries': [
10319
+              '-l<(android_libcpp_library)',
10320
+              '-latomic',
10321
+              # Manually link the libgcc.a that the cross compiler uses.
10322
+              '<!(<(android_toolchain)/*-gcc -print-libgcc-file-name)',
10323
+              '-lc',
10324
+              '-ldl',
10325
+              '-lm',
10326
+            ],
10327
+            'conditions': [
10328
+              ['component=="static_library"', {
10329
+                'target_conditions': [
10330
+                  ['use_native_jni_exports==0', {
10331
+                    # Use a linker version script to strip JNI exports from
10332
+                    # binaries which have not specifically asked to use them.
10333
+                    'ldflags': [
10334
+                      '-Wl,--version-script=<!(cd <(DEPTH) && pwd -P)/build/android/android_no_jni_exports.lst',
10335
+                    ],
10336
+                  }],
10337
+                ],
10338
+              }],
10339
+              ['clang==1', {
10340
+                'libraries!': [
10341
+                  # Clang with libc++ does not require an explicit atomic
10342
+                  # library reference.
10343
+                  '-latomic',
10344
+                ],
10345
+                'cflags': [
10346
+                  # Work around incompatibilities between bionic and clang
10347
+                  # headers.
10348
+                  '-D__compiler_offsetof=__builtin_offsetof',
10349
+                  '-Dnan=__builtin_nan',
10350
+                ],
10351
+                'cflags!': [
10352
+                  # Clang does not support the following options.
10353
+                  '-finline-limit=64',
10354
+                ],
10355
+                'conditions': [
10356
+                  ['target_arch=="arm"', {
10357
+                    'cflags': [
10358
+                      '-target arm-linux-androideabi',
10359
+                    ],
10360
+                    'ldflags': [
10361
+                      '-target arm-linux-androideabi',
10362
+                    ],
10363
+                  }],
10364
+                  ['target_arch=="ia32"', {
10365
+                    'cflags': [
10366
+                      '-target i686-linux-androideabi',
10367
+                    ],
10368
+                    'ldflags': [
10369
+                      '-target i686-linux-androideabi',
10370
+                    ],
10371
+                  }],
10372
+                  # Place holder for arm64 support, not tested.
10373
+                  # TODO: Enable clang support for Android Arm64. http://crbug.com/539781
10374
+                  ['target_arch=="arm64"', {
10375
+                    'cflags': [
10376
+                      '-target aarch64-linux-androideabi',
10377
+                    ],
10378
+                    'ldflags': [
10379
+                      '-target aarch64-linux-androideabi',
10380
+                    ],
10381
+                  }],
10382
+                  # Place holder for x64 support, not tested.
10383
+                  # TODO: Enable clang support for Android x64. http://crbug.com/539781
10384
+                  ['target_arch=="x64"', {
10385
+                    'cflags': [
10386
+                      '-target x86_64-linux-androideabi',
10387
+                    ],
10388
+                    'ldflags': [
10389
+                      '-target x86_64-linux-androideabi',
10390
+                    ],
10391
+                  }],
10392
+                ],
10393
+              }],
10394
+              ['asan==1', {
10395
+                'cflags': [
10396
+                  # Android build relies on -Wl,--gc-sections removing
10397
+                  # unreachable code. ASan instrumentation for globals inhibits
10398
+                  # this and results in a library with unresolvable relocations.
10399
+                  # TODO(eugenis): find a way to reenable this.
10400
+                  '-mllvm -asan-globals=0',
10401
+                ],
10402
+              }],
10403
+              ['target_arch == "arm" and order_profiling==0', {
10404
+                'ldflags': [
10405
+                  # Enable identical code folding to reduce size.
10406
+                  '-Wl,--icf=<(gold_icf_level)',
10407
+                ],
10408
+              }],
10409
+              ['target_arch=="ia32"', {
10410
+                # The x86 toolchain currently has problems with stack-protector.
10411
+                'cflags!': [
10412
+                  '-fstack-protector',
10413
+                ],
10414
+                'cflags': [
10415
+                  '-fno-stack-protector',
10416
+                ],
10417
+              }],
10418
+            ],
10419
+            'target_conditions': [
10420
+              ['_type=="executable"', {
10421
+                'cflags': [
10422
+                  '-fPIE',
10423
+                ],
10424
+                'ldflags': [
10425
+                  '-Bdynamic',
10426
+                  '-Wl,--gc-sections',
10427
+                  '-Wl,-z,nocopyreloc',
10428
+                  '-pie',
10429
+                  # crtbegin_dynamic.o should be the last item in ldflags.
10430
+                  '<(android_ndk_lib)/crtbegin_dynamic.o',
10431
+                ],
10432
+                'libraries': [
10433
+                  # crtend_android.o needs to be the last item in libraries.
10434
+                  # Do not add any libraries after this!
10435
+                  '<(android_ndk_lib)/crtend_android.o',
10436
+                ],
10437
+              }],
10438
+              ['_type=="shared_library" or _type=="loadable_module"', {
10439
+                'ldflags': [
10440
+                  '-Wl,-shared,-Bsymbolic',
10441
+                  # crtbegin_so.o should be the last item in ldflags.
10442
+                  '<(android_ndk_lib)/crtbegin_so.o',
10443
+                ],
10444
+                'libraries': [
10445
+                  # crtend_so.o needs to be the last item in libraries.
10446
+                  # Do not add any libraries after this!
10447
+                  '<(android_ndk_lib)/crtend_so.o',
10448
+                ],
10449
+              }],
10450
+            ],
10451
+          }],
10452
+          # Settings for building host targets using the system toolchain.
10453
+          ['_toolset=="host"', {
10454
+            'cflags!': [
10455
+              # Due to issues in Clang build system, using ASan on 32-bit
10456
+              # binaries on x86_64 host is problematic.
10457
+              # TODO(eugenis): re-enable.
10458
+              '-fsanitize=address',
10459
+            ],
10460
+            'ldflags!': [
10461
+              '-fsanitize=address',
10462
+              '-Wl,-z,noexecstack',
10463
+              '-Wl,--gc-sections',
10464
+              '-Wl,-O1',
10465
+              '-Wl,--as-needed',
10466
+              '-Wl,--warn-shared-textrel',
10467
+              '-Wl,--fatal-warnings',
10468
+            ],
10469
+          }],
10470
+          # Settings for building host targets on mac.
10471
+          ['_toolset=="host" and host_os=="mac"', {
10472
+            'ldflags!': [
10473
+              '-Wl,-z,now',
10474
+              '-Wl,-z,relro',
10475
+            ],
10476
+          }],
10477
+        ],
10478
+      },
10479
+    }],
10480
+    ['OS=="solaris"', {
10481
+      'cflags!': ['-fvisibility=hidden'],
10482
+      'cflags_cc!': ['-fvisibility-inlines-hidden'],
10483
+    }],
10484
+    ['OS=="mac" or OS=="ios"', {
10485
+      'target_defaults': {
10486
+        'mac_bundle': 0,
10487
+        'xcode_settings': {
10488
+          'ALWAYS_SEARCH_USER_PATHS': 'NO',
10489
+          'CLANG_CXX_LANGUAGE_STANDARD': 'c++11',  # -std=c++11
10490
+          # Don't link in libarclite_macosx.a, see http://crbug.com/156530.
10491
+          'CLANG_LINK_OBJC_RUNTIME': 'NO',          # -fno-objc-link-runtime
10492
+          # Warn if automatic synthesis is triggered with
10493
+          # the -Wobjc-missing-property-synthesis flag.
10494
+          'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
10495
+          'COPY_PHASE_STRIP': 'NO',
10496
+          'GCC_C_LANGUAGE_STANDARD': 'c99',         # -std=c99
10497
+          'GCC_CW_ASM_SYNTAX': 'NO',                # No -fasm-blocks
10498
+          'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',        # -fno-exceptions
10499
+          'GCC_ENABLE_CPP_RTTI': 'NO',              # -fno-rtti
10500
+          'GCC_ENABLE_PASCAL_STRINGS': 'NO',        # No -mpascal-strings
10501
+          # GCC_INLINES_ARE_PRIVATE_EXTERN maps to -fvisibility-inlines-hidden
10502
+          'GCC_INLINES_ARE_PRIVATE_EXTERN': 'YES',
10503
+          'GCC_OBJC_CALL_CXX_CDTORS': 'YES',        # -fobjc-call-cxx-cdtors
10504
+          'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',      # -fvisibility=hidden
10505
+          'GCC_THREADSAFE_STATICS': 'NO',           # -fno-threadsafe-statics
10506
+          'GCC_TREAT_WARNINGS_AS_ERRORS': 'YES',    # -Werror
10507
+          'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0',
10508
+          'USE_HEADERMAP': 'NO',
10509
+          'WARNING_CFLAGS': [
10510
+            '-Wall',
10511
+            '-Wextra',
10512
+            # Don't warn about unused function parameters.
10513
+            '-Wno-unused-parameter',
10514
+            # Don't warn about the "struct foo f = {0};" initialization
10515
+            # pattern.
10516
+            '-Wno-missing-field-initializers',
10517
+            # This warns on selectors from Cocoa headers (-length, -set).
10518
+            # cfe-dev is currently discussing the merits of this warning.
10519
+            # TODO(thakis): Reevaluate what to do with this, based on the
10520
+            # cfe-dev discussion.
10521
+            '-Wno-selector-type-mismatch',
10522
+          ],
10523
+          'conditions': [
10524
+            ['chromium_mac_pch', {'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'},
10525
+                                 {'GCC_PRECOMPILE_PREFIX_HEADER': 'NO'}
10526
+            ],
10527
+            ['clang==1', {
10528
+              'OTHER_CFLAGS': [
10529
+                # See http://crbug.com/110262
10530
+                '-fcolor-diagnostics',
10531
+              ],
10532
+            }],
10533
+            # Note that the prebuilt Clang binaries should not be used for iOS
10534
+            # development except for ASan builds.
10535
+            ['clang_xcode==0', {
10536
+              'CC': '$(SOURCE_ROOT)/<(clang_dir)/clang',
10537
+              'LDPLUSPLUS': '$(SOURCE_ROOT)/<(clang_dir)/clang++',
10538
+            }],
10539
+            ['clang==1 and clang_xcode==0 and clang_use_chrome_plugins==1', {
10540
+              'OTHER_CFLAGS': [
10541
+                '<@(clang_chrome_plugins_flags)',
10542
+              ],
10543
+            }],
10544
+            ['clang==1 and clang_xcode==0 and clang_load!=""', {
10545
+              'OTHER_CFLAGS': [
10546
+                '-Xclang', '-load', '-Xclang', '<(clang_load)',
10547
+              ],
10548
+            }],
10549
+            ['clang==1 and clang_xcode==0 and clang_add_plugin!=""', {
10550
+              'OTHER_CFLAGS': [
10551
+                '-Xclang', '-add-plugin', '-Xclang', '<(clang_add_plugin)',
10552
+              ],
10553
+            }],
10554
+          ],
10555
+        },
10556
+        'conditions': [
10557
+          ['clang==1', {
10558
+            'variables': {
10559
+              'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
10560
+            },
10561
+          }],
10562
+          ['asan==1', {
10563
+            'xcode_settings': {
10564
+              'OTHER_CFLAGS': [
10565
+                '-fsanitize=address',
10566
+                '-mllvm -asan-globals=0',  # http://crbug.com/352073
10567
+                '-gline-tables-only',
10568
+              ],
10569
+            },
10570
+          }],
10571
+          ['sanitizer_coverage!=""', {
10572
+            'target_conditions': [
10573
+              ['_toolset=="target"', {
10574
+                'cflags': [
10575
+                  '-fsanitize-coverage=<(sanitizer_coverage)',
10576
+                ],
10577
+                'defines': [
10578
+                  'SANITIZER_COVERAGE',
10579
+                ],
10580
+              }],
10581
+            ],
10582
+          }],
10583
+        ],
10584
+        'target_conditions': [
10585
+          ['_type!="static_library"', {
10586
+            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-search_paths_first']},
10587
+            'conditions': [
10588
+              ['asan==1', {
10589
+                'xcode_settings': {
10590
+                  'OTHER_LDFLAGS': [
10591
+                    '-fsanitize=address',
10592
+                  ],
10593
+                },
10594
+              }],
10595
+              ['mac_write_linker_maps==1', {
10596
+                'xcode_settings': {
10597
+                  'OTHER_LDFLAGS': [
10598
+                    '-Wl,-map,>(_target_name).map',
10599
+                  ],
10600
+                },
10601
+              }],
10602
+            ],
10603
+          }],
10604
+          ['_mac_bundle', {
10605
+            'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
10606
+            'target_conditions': [
10607
+              ['_type=="executable"', {
10608
+                'conditions': [
10609
+                  ['asan==1', {
10610
+                    'postbuilds': [
10611
+                      {
10612
+                        'variables': {
10613
+                          # Define copy_asan_dylib_path in a variable ending in
10614
+                          # _path so that gyp understands it's a path and
10615
+                          # performs proper relativization during dict merging.
10616
+                          'copy_asan_dylib_path':
10617
+                            'mac/copy_asan_runtime_dylib.sh',
10618
+                        },
10619
+                        'postbuild_name': 'Copy ASan runtime dylib',
10620
+                        'action': [
10621
+                          '<(copy_asan_dylib_path)',
10622
+                        ],
10623
+                      },
10624
+                    ],
10625
+                  }],
10626
+                ],
10627
+              }],
10628
+            ],
10629
+          }],
10630
+        ],  # target_conditions
10631
+      },  # target_defaults
10632
+    }],  # OS=="mac" or OS=="ios"
10633
+    ['OS=="mac"', {
10634
+      'target_defaults': {
10635
+        'defines': [
10636
+          # Prevent Mac OS X AssertMacros.h from defining macros that collide
10637
+          # with common names, like 'check', 'require', and 'verify'.
10638
+          # (Included by system header. Also exists on iOS but not included.)
10639
+          # http://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/AssertMacros.h
10640
+          '__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0',
10641
+        ],
10642
+        'variables': {
10643
+          # These should end with %, but there seems to be a bug with % in
10644
+          # variables that are intended to be set to different values in
10645
+          # different targets, like these.
10646
+          # Strip debugging symbols from the target.
10647
+          'mac_strip': '<(mac_strip_release)',
10648
+          'conditions': [
10649
+            ['asan==1', {
10650
+              'conditions': [
10651
+                ['mac_want_real_dsym=="default"', {
10652
+                  'mac_real_dsym': 1,
10653
+                }, {
10654
+                  'mac_real_dsym': '<(mac_want_real_dsym)'
10655
+                }],
10656
+              ],
10657
+            }, {
10658
+              'conditions': [
10659
+                ['mac_want_real_dsym=="default"', {
10660
+                  'mac_real_dsym': 0, # Fake .dSYMs are fine in most cases.
10661
+                }, {
10662
+                  'mac_real_dsym': '<(mac_want_real_dsym)'
10663
+                }],
10664
+              ],
10665
+            }],
10666
+          ],
10667
+        },
10668
+        'configurations': {
10669
+          'Release_Base': {
10670
+            'conditions': [
10671
+              ['branding=="Chrome" and buildtype=="Official"', {
10672
+                'xcode_settings': {
10673
+                  'OTHER_CFLAGS': [
10674
+                    # The Google Chrome Framework dSYM generated by dsymutil has
10675
+                    # grown larger than 4GB, which dsymutil can't handle. Reduce
10676
+                    # the amount of debug symbols.
10677
+                    '-fno-standalone-debug',  # See http://crbug.com/479841
10678
+                  ]
10679
+                },
10680
+              }],
10681
+            ],
10682
+          },  # configuration "Release"
10683
+        },  # configurations
10684
+        'xcode_settings': {
10685
+          # Tell the compiler to use libc++'s headers and the linker to link
10686
+          # against libc++.  The latter part normally requires OS X 10.7,
10687
+          # but we still support running on 10.6.  How does this work?  Two
10688
+          # parts:
10689
+          # 1. Chromium's clang doesn't error on -mmacosx-version-min=10.6
10690
+          #    combined with -stdlib=libc++ (it normally silently produced a
10691
+          #    binary that doesn't run on 10.6)
10692
+          # 2. Further down, library_dirs is set to
10693
+          #    third_party/libc++-static, which contains a static
10694
+          #    libc++.a library.  The linker then links against that instead
10695
+          #    of against /usr/lib/libc++.dylib when it sees the -lc++ flag
10696
+          #    added by the driver.
10697
+          #
10698
+          # In component builds, just link to the system libc++.  This has
10699
+          # the effect of making everything depend on libc++, which means
10700
+          # component-build binaries won't run on 10.6 (no libc++ there),
10701
+          # but for a developer-only configuration that's ok.  (We don't
10702
+          # want to raise the deployment target yet so that official and
10703
+          # dev builds have the same deployment target.  This affects
10704
+          # things like which functions are considered deprecated.)
10705
+          'CLANG_CXX_LIBRARY': 'libc++',  # -stdlib=libc++
10706
+          'GCC_DYNAMIC_NO_PIC': 'NO',               # No -mdynamic-no-pic
10707
+                                                    # (Equivalent to -fPIC)
10708
+          # MACOSX_DEPLOYMENT_TARGET maps to -mmacosx-version-min
10709
+          'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
10710
+          # Keep pch files below xcodebuild/.
10711
+          'SHARED_PRECOMPS_DIR': '$(CONFIGURATION_BUILD_DIR)/SharedPrecompiledHeaders',
10712
+          'OTHER_CFLAGS': [
10713
+            # Someday this can be replaced by an 'GCC_STRICT_ALIASING': 'NO'
10714
+            # xcode_setting, but not until all downstream projects' mac bots are
10715
+            # using xcode >= 4.6, because that's when the default value of the
10716
+            # flag in the compiler switched.  Pre-4.6, the value 'NO' for that
10717
+            # setting is a no-op as far as xcode is concerned, but the compiler
10718
+            # behaves differently based on whether -fno-strict-aliasing is
10719
+            # specified or not.
10720
+            '-fno-strict-aliasing',  # See http://crbug.com/32204.
10721
+          ],
10722
+        },
10723
+        'target_conditions': [
10724
+          ['>(nacl_untrusted_build)==0 and component=="static_library"', {
10725
+            # See the comment for CLANG_CXX_LIBRARY above for what this does.
10726
+            # The NaCl toolchains have their own toolchain and don't need this.
10727
+            # ASan requires 10.7+ and clang implicitly adds -lc++abi in ASan
10728
+            # mode.  Our libc++.a contains both libc++ and libc++abi in one
10729
+            # library, so it doesn't work in that mode.
10730
+            'conditions': [
10731
+              ['asan==0', {
10732
+                'library_dirs': [ '<(DEPTH)/third_party/libc++-static' ],
10733
+              }],
10734
+            ],
10735
+          }],
10736
+          ['_type=="executable"', {
10737
+            # Turn on position-independence (ASLR) for executables. When
10738
+            # PIE is on for the Chrome executables, the framework will
10739
+            # also be subject to ASLR.
10740
+            'xcode_settings': {
10741
+              'OTHER_LDFLAGS': [
10742
+                '-Wl,-pie',  # Position-independent executable (MH_PIE)
10743
+              ],
10744
+            },
10745
+          }],
10746
+          ['(_type=="executable" or _type=="shared_library" or \
10747
+             _type=="loadable_module") and mac_strip!=0', {
10748
+            'target_conditions': [
10749
+              ['mac_real_dsym == 1', {
10750
+                # To get a real .dSYM bundle produced by dsymutil, set the
10751
+                # debug information format to dwarf-with-dsym.  Since
10752
+                # strip_from_xcode will not be used, set Xcode to do the
10753
+                # stripping as well.
10754
+                'configurations': {
10755
+                  'Release_Base': {
10756
+                    'xcode_settings': {
10757
+                      'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
10758
+                      'DEPLOYMENT_POSTPROCESSING': 'YES',
10759
+                      'STRIP_INSTALLED_PRODUCT': 'YES',
10760
+                      'conditions': [
10761
+                        # Only strip non-ASan builds.
10762
+                        ['asan==0', {
10763
+                          'target_conditions': [
10764
+                            ['_type=="shared_library" or _type=="loadable_module"', {
10765
+                              # The Xcode default is to strip debugging symbols
10766
+                              # only (-S).  Local symbols should be stripped as
10767
+                              # well, which will be handled by -x.  Xcode will
10768
+                              # continue to insert -S when stripping even when
10769
+                              # additional flags are added with STRIPFLAGS.
10770
+                              'STRIPFLAGS': '-x',
10771
+                            }],  # _type=="shared_library" or _type=="loadable_module"
10772
+                          ],  # target_conditions
10773
+                        }, {  # asan != 0
10774
+                          'STRIPFLAGS': '-S',
10775
+                        }],
10776
+                      ],
10777
+                    },  # xcode_settings
10778
+                  },  # configuration "Release"
10779
+                },  # configurations
10780
+              }, {  # mac_real_dsym != 1
10781
+                # To get a fast fake .dSYM bundle, use a post-build step to
10782
+                # produce the .dSYM and strip the executable.  strip_from_xcode
10783
+                # only operates in the Release configuration.
10784
+                'postbuilds': [
10785
+                  {
10786
+                    'variables': {
10787
+                      # Define strip_from_xcode in a variable ending in _path
10788
+                      # so that gyp understands it's a path and performs proper
10789
+                      # relativization during dict merging.
10790
+                      'strip_from_xcode_path': 'mac/strip_from_xcode',
10791
+                    },
10792
+                    'postbuild_name': 'Strip If Needed',
10793
+                    'action': ['<(strip_from_xcode_path)'],
10794
+                  },
10795
+                ],  # postbuilds
10796
+              }],  # mac_real_dsym
10797
+            ],  # target_conditions
10798
+          }],  # (_type=="executable" or _type=="shared_library" or
10799
+               #  _type=="loadable_module") and mac_strip!=0
10800
+        ],  # target_conditions
10801
+      },  # target_defaults
10802
+    }],  # OS=="mac"
10803
+    ['OS=="ios"', {
10804
+      'target_defaults': {
10805
+        'xcode_settings' : {
10806
+          'ENABLE_BITCODE': 'NO',
10807
+          'CLANG_CXX_LIBRARY': 'libc++',  # -stdlib=libc++
10808
+          'conditions': [
10809
+            # Older Xcodes do not support -Wno-deprecated-register, so pass an
10810
+            # additional flag to suppress the "unknown compiler option" error.
10811
+            # Restrict this flag to builds that are either compiling with Xcode
10812
+            # or compiling with Xcode's Clang.  This will allow Ninja builds to
10813
+            # continue failing on unknown compiler options.
10814
+            # TODO(rohitrao): This flag is temporary and should be removed as
10815
+            # soon as the iOS bots are updated to use Xcode 5.1.
10816
+            ['clang_xcode==1', {
10817
+              'WARNING_CFLAGS': [
10818
+                '-Wno-unknown-warning-option',
10819
+                # It's not possible to achieve nullability completeness before
10820
+                # all builders are running Xcode 7. crbug.com/499809
10821
+                '-Wno-nullability-completeness',
10822
+              ],
10823
+              'OTHER_CPLUSPLUSFLAGS': [
10824
+                '$(inherited)',
10825
+                # TODO(ios): Remove once Xcode's libc++ has LLVM r256325
10826
+                '-isystem <!(cd <(DEPTH) && pwd -P)/third_party/llvm-build/Release+Asserts/include/c++/v1',
10827
+              ],
10828
+            }],
10829
+            # Limit the valid architectures depending on "target_subarch".
10830
+            # This need to include the "arm" architectures but also the "x86"
10831
+            # ones (they are used when building for the simulator).
10832
+            ['target_subarch=="arm32"', {
10833
+              'VALID_ARCHS': ['armv7', 'i386'],
10834
+            }],
10835
+            ['target_subarch=="arm64"', {
10836
+              'VALID_ARCHS': ['arm64', 'x86_64'],
10837
+            }],
10838
+            ['target_subarch=="both"', {
10839
+              'VALID_ARCHS': ['arm64', 'armv7', 'x86_64', 'i386'],
10840
+            }],
10841
+          ],
10842
+        },
10843
+        'target_conditions': [
10844
+          ['_toolset=="host"', {
10845
+            'xcode_settings': {
10846
+              'SDKROOT': 'macosx<(mac_sdk)',  # -isysroot
10847
+              'MACOSX_DEPLOYMENT_TARGET': '<(mac_deployment_target)',
10848
+              'VALID_ARCHS': [
10849
+                'x86_64',
10850
+              ],
10851
+              'ARCHS': [
10852
+                'x86_64',
10853
+              ],
10854
+            },
10855
+          }],
10856
+          ['_toolset=="target"', {
10857
+            'xcode_settings': {
10858
+              # This section should be for overriding host settings. But,
10859
+              # since we can't negate the iphone deployment target above, we
10860
+              # instead set it here for target only.
10861
+              'IPHONEOS_DEPLOYMENT_TARGET': '<(ios_deployment_target)',
10862
+              'ARCHS': ['$(ARCHS_STANDARD_INCLUDING_64_BIT)'],
10863
+            },
10864
+          }],
10865
+          ['_type=="executable"', {
10866
+            'configurations': {
10867
+              'Release_Base': {
10868
+                'xcode_settings': {
10869
+                  'DEPLOYMENT_POSTPROCESSING': 'YES',
10870
+                  'STRIP_INSTALLED_PRODUCT': 'YES',
10871
+                  'conditions': [
10872
+                    ['buildtype=="Official"', {
10873
+                      'DEBUG_INFORMATION_FORMAT': 'dwarf-with-dsym',
10874
+                    }, {
10875
+                      # Remove dSYM to reduce build time.
10876
+                      'DEBUG_INFORMATION_FORMAT': 'dwarf',
10877
+                    }],
10878
+                  ],
10879
+                },
10880
+              },
10881
+              'Debug_Base': {
10882
+                'xcode_settings': {
10883
+                  # Remove dSYM to reduce build time.
10884
+                  'DEBUG_INFORMATION_FORMAT': 'dwarf',
10885
+                },
10886
+              },
10887
+            },
10888
+            'xcode_settings': {
10889
+              'conditions': [
10890
+                ['chromium_ios_signing', {
10891
+                  # iOS SDK wants everything for device signed.
10892
+                  'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '<(chromium_ios_signing_identity)',
10893
+                }, {
10894
+                  'CODE_SIGNING_REQUIRED': 'NO',
10895
+                  'CODE_SIGN_IDENTITY[sdk=iphoneos*]': '',
10896
+                }],
10897
+              ],
10898
+            },
10899
+          }],
10900
+        ],  # target_conditions
10901
+      },  # target_defaults
10902
+    }],  # OS=="ios"
10903
+    ['OS=="win"', {
10904
+      'target_defaults': {
10905
+        'defines': [
10906
+          '_WIN32_WINNT=0x0A00',
10907
+          'WINVER=0x0A00',
10908
+          'WIN32',
10909
+          '_WINDOWS',
10910
+          'NOMINMAX',
10911
+          'PSAPI_VERSION=1',
10912
+          '_CRT_RAND_S',
10913
+          'CERT_CHAIN_PARA_HAS_EXTRA_FIELDS',
10914
+          'WIN32_LEAN_AND_MEAN',
10915
+          '_ATL_NO_OPENGL',
10916
+          '_SECURE_ATL',
10917
+          # _HAS_EXCEPTIONS must match ExceptionHandling in msvs_settings.
10918
+          '_HAS_EXCEPTIONS=0',
10919
+          # Silence some warnings; we can't switch the the 'recommended'
10920
+          # versions as they're not available on old OSs.
10921
+          '_WINSOCK_DEPRECATED_NO_WARNINGS',
10922
+        ],
10923
+        'conditions': [
10924
+          ['buildtype=="Official"', {
10925
+            # In official builds, targets can self-select an optimization
10926
+            # level by defining a variable named 'optimize', and setting it
10927
+            # to one of
10928
+            # - "size", optimizes for minimal code size - the default.
10929
+            # - "speed", optimizes for speed over code size.
10930
+            # - "max", whole program optimization and link-time code
10931
+            #   generation. This is very expensive and should be used
10932
+            #   sparingly.
10933
+            'variables': {
10934
+              'optimize%': 'size',
10935
+            },
10936
+            'msvs_settings': {
10937
+              'VCLinkerTool': {
10938
+                # Set /LTCG for the official builds.
10939
+                'LinkTimeCodeGeneration': '1',
10940
+                'AdditionalOptions': [
10941
+                  # Set the number of LTCG code-gen threads to eight.
10942
+                  # The default is four. This gives a 5-10% link speedup.
10943
+                  '/cgthreads:8',
10944
+                ],
10945
+              },
10946
+            },
10947
+            'target_conditions': [
10948
+              ['optimize=="size"', {
10949
+                'msvs_settings': {
10950
+                  'VCCLCompilerTool': {
10951
+                    # 1, optimizeMinSpace, Minimize Size (/O1)
10952
+                    'Optimization': '1',
10953
+                    # 2, favorSize - Favor small code (/Os)
10954
+                    'FavorSizeOrSpeed': '2',
10955
+                    'conditions': [
10956
+                      # TODO(thakis): Remove clang==0 here, crbug.com/598772
10957
+                      ['full_wpo_on_official==1 and clang==0', {
10958
+                        # This implies link time code generation.
10959
+                        'WholeProgramOptimization': 'true',
10960
+                      }],
10961
+                    ],
10962
+                  },
10963
+                },
10964
+              }],
10965
+              # This config is used to avoid a problem in ffmpeg, see
10966
+              # http://crbug.com/264459.
10967
+              ['optimize=="size_no_ltcg"', {
10968
+                'msvs_settings': {
10969
+                  'VCCLCompilerTool': {
10970
+                    # 1, optimizeMinSpace, Minimize Size (/O1)
10971
+                    'Optimization': '1',
10972
+                    # 2, favorSize - Favor small code (/Os)
10973
+                    'FavorSizeOrSpeed': '2',
10974
+                  },
10975
+                },
10976
+              }],
10977
+              ['optimize=="speed"', {
10978
+                'msvs_settings': {
10979
+                  'VCCLCompilerTool': {
10980
+                    # 2, optimizeMaxSpeed, Maximize Speed (/O2)
10981
+                    'Optimization': '2',
10982
+                    # 1, favorSpeed - Favor fast code (/Ot)
10983
+                    'FavorSizeOrSpeed': '1',
10984
+                    'conditions': [
10985
+                      # TODO(thakis): Remove clang==0 here, crbug.com/598772
10986
+                      ['full_wpo_on_official==1 and clang==0', {
10987
+                        # This implies link time code generation.
10988
+                        'WholeProgramOptimization': 'true',
10989
+                      }],
10990
+                    ],
10991
+                  },
10992
+                },
10993
+              }],
10994
+              ['optimize=="max"', {
10995
+                # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
10996
+                # builds. Probably anything that this would catch that
10997
+                # wouldn't be caught in a normal build isn't going to
10998
+                # actually be a bug, so the incremental value of C4702 for
10999
+                # PGO builds is likely very small.
11000
+                'msvs_disabled_warnings': [
11001
+                  4702
11002
+                ],
11003
+                'msvs_settings': {
11004
+                  'VCCLCompilerTool': {
11005
+                    # 2, optimizeMaxSpeed, Maximize Speed (/O2)
11006
+                    'Optimization': '2',
11007
+                    # 1, favorSpeed - Favor fast code (/Ot)
11008
+                    'FavorSizeOrSpeed': '1',
11009
+                  },
11010
+                },
11011
+                # TODO(thakis): Remove clang==0 here, https://crbug.com/598772
11012
+                'conditions': [
11013
+                  ['clang==0', {
11014
+                    'msvs_settings': {
11015
+                      'VCCLCompilerTool': {
11016
+                        # This implies link time code generation.
11017
+                        'WholeProgramOptimization': 'true',
11018
+                      },
11019
+                    },
11020
+                  }],
11021
+                ],
11022
+              }],
11023
+            ],
11024
+          }],
11025
+          ['msvs_xtree_patched!=1', {
11026
+            # If xtree hasn't been patched, then we disable C4702. Otherwise,
11027
+            # it's enabled. This will generally only be true for system-level
11028
+            # installed Express users.
11029
+            'msvs_disabled_warnings': [
11030
+              4702, # unreachable code
11031
+            ],
11032
+          }],
11033
+          ['full_wpo_on_official==1', {
11034
+            # Disable Warning 4702 ("Unreachable code") for the WPO/PGO
11035
+            # builds. Probably anything that this would catch that
11036
+            # wouldn't be caught in a normal build isn't going to
11037
+            # actually be a bug, so the incremental value of C4702 for
11038
+            # PGO builds is likely very small.
11039
+            'msvs_disabled_warnings': [
11040
+              4702
11041
+            ],
11042
+          }],
11043
+        ],
11044
+        # Add extra include directories here that need to be in front of the
11045
+        # installed and packaged include directories. This may be needed in
11046
+        # order to force a particular SDK version, such as to get VS 2013 to use
11047
+        # the Windows 10 SDK. Beware of making the INCLUDE variable excessively
11048
+        # long, and be sure to make corresponding changes to
11049
+        # build\toolchain\win\setup_toolchain.py
11050
+        'msvs_system_include_dirs': [
11051
+        ],
11052
+        'msvs_disabled_warnings': [
11053
+          # C4091: 'typedef ': ignored on left of 'X' when no variable is
11054
+          #                    declared.
11055
+          # This happens in a number of Windows headers. Dumb.
11056
+          4091,
11057
+          # C4127: conditional expression is constant
11058
+          # This warning can in theory catch dead code and other problems, but
11059
+          # triggers in far too many desirable cases where the conditional
11060
+          # expression is either set by macros or corresponds some legitimate
11061
+          # compile-time constant expression (due to constant template args,
11062
+          # conditionals comparing the sizes of different types, etc.).  Some of
11063
+          # these can be worked around, but it's not worth it.
11064
+          4127,
11065
+          # C4351: new behavior: elements of array 'array' will be default
11066
+          #        initialized
11067
+          # This is a silly "warning" that basically just alerts you that the
11068
+          # compiler is going to actually follow the language spec like it's
11069
+          # supposed to, instead of not following it like old buggy versions
11070
+          # did.  There's absolutely no reason to turn this on.
11071
+          4351,
11072
+          # C4355: 'this': used in base member initializer list
11073
+          # It's commonly useful to pass |this| to objects in a class'
11074
+          # initializer list.  While this warning can catch real bugs, most of
11075
+          # the time the constructors in question don't attempt to call methods
11076
+          # on the passed-in pointer (until later), and annotating every legit
11077
+          # usage of this is simply more hassle than the warning is worth.
11078
+          4355,
11079
+          # C4503: 'identifier': decorated name length exceeded, name was
11080
+          #        truncated
11081
+          # This only means that some long error messages might have truncated
11082
+          # identifiers in the presence of lots of templates.  It has no effect
11083
+          # on program correctness and there's no real reason to waste time
11084
+          # trying to prevent it.
11085
+          4503,
11086
+          # Warning C4589 says: "Constructor of abstract class ignores
11087
+          # initializer for virtual base class." Disable this warning because it
11088
+          # is flaky in VS 2015 RTM. It triggers on compiler generated
11089
+          # copy-constructors in some cases.
11090
+          4589,
11091
+          # C4611: interaction between 'function' and C++ object destruction is
11092
+          #        non-portable
11093
+          # This warning is unavoidable when using e.g. setjmp/longjmp.  MSDN
11094
+          # suggests using exceptions instead of setjmp/longjmp for C++, but
11095
+          # Chromium code compiles without exception support.  We therefore have
11096
+          # to use setjmp/longjmp for e.g. JPEG decode error handling, which
11097
+          # means we have to turn off this warning (and be careful about how
11098
+          # object destruction happens in such cases).
11099
+          4611,
11100
+          # TODO(maruel): These warnings are level 4. They will be slowly
11101
+          # removed as code is fixed.
11102
+          4100, # Unreferenced formal parameter
11103
+          4121, # Alignment of a member was sensitive to packing
11104
+          4244, # Conversion from 'type1' to 'type2', possible loss of data
11105
+          4505, # Unreferenced local function has been removed
11106
+          4510, # Default constructor could not be generated
11107
+          4512, # Assignment operator could not be generated
11108
+          4610, # Object can never be instantiated
11109
+          4838, # Narrowing conversion. Doesn't seem to be very useful.
11110
+          4995, # 'X': name was marked as #pragma deprecated
11111
+          4996, # 'X': was declared deprecated (for GetVersionEx).
11112
+          # These are variable shadowing warnings that are new in VS2015. We
11113
+          # should work through these at some point -- they may be removed from
11114
+          # the RTM release in the /W4 set.
11115
+          4456, 4457, 4458, 4459,
11116
+          # TODO(brucedawson): http://crbug.com/554200 4312 is a VS
11117
+          # 2015 64-bit warning for integer to larger pointer
11118
+          4312,
11119
+          # TODO(brucedawson): http://crbug.com/593448 - C4595 is an 'illegal
11120
+          # inline operator new' warning that is new in VS 2015 Update 2.
11121
+          # This is equivalent to clang's no-inline-new-delete warning.
11122
+          # See http://bugs.icu-project.org/trac/ticket/11122
11123
+          4595,
11124
+        ],
11125
+        'msvs_settings': {
11126
+          'VCCLCompilerTool': {
11127
+            'AdditionalOptions': ['/MP'],
11128
+            'MinimalRebuild': 'false',
11129
+            'BufferSecurityCheck': 'true',
11130
+            'EnableFunctionLevelLinking': 'true',
11131
+            'RuntimeTypeInfo': 'false',
11132
+            'WarningLevel': '4',
11133
+            'WarnAsError': 'true',
11134
+            'DebugInformationFormat': '3',
11135
+            # ExceptionHandling must match _HAS_EXCEPTIONS above.
11136
+            'ExceptionHandling': '0',
11137
+          },
11138
+          'VCLibrarianTool': {
11139
+            'AdditionalOptions': ['/ignore:4221'],
11140
+            'AdditionalLibraryDirectories': [
11141
+              '<(windows_sdk_path)/Lib/win8/um/x86',
11142
+            ],
11143
+          },
11144
+          'VCLinkerTool': {
11145
+            'AdditionalDependencies': [
11146
+              'wininet.lib',
11147
+              'dnsapi.lib',
11148
+              'version.lib',
11149
+              'msimg32.lib',
11150
+              'ws2_32.lib',
11151
+              'usp10.lib',
11152
+              'psapi.lib',
11153
+              'dbghelp.lib',
11154
+              'winmm.lib',
11155
+              'shlwapi.lib',
11156
+            ],
11157
+            'AdditionalLibraryDirectories': [
11158
+              '<(windows_sdk_path)/Lib/win8/um/x86',
11159
+            ],
11160
+            'GenerateDebugInformation': 'true',
11161
+            'MapFileName': '$(OutDir)\\$(TargetName).map',
11162
+            'FixedBaseAddress': '1',
11163
+            # SubSystem values:
11164
+            #   0 == not set
11165
+            #   1 == /SUBSYSTEM:CONSOLE
11166
+            #   2 == /SUBSYSTEM:WINDOWS
11167
+            # Most of the executables we'll ever create are tests
11168
+            # and utilities with console output.
11169
+            'SubSystem': '1',
11170
+          },
11171
+          'VCMIDLTool': {
11172
+            'GenerateStublessProxies': 'true',
11173
+            'TypeLibraryName': '$(InputName).tlb',
11174
+            'OutputDirectory': '$(IntDir)',
11175
+            'HeaderFileName': '$(InputName).h',
11176
+            'DLLDataFileName': '$(InputName).dlldata.c',
11177
+            'InterfaceIdentifierFileName': '$(InputName)_i.c',
11178
+            'ProxyFileName': '$(InputName)_p.c',
11179
+          },
11180
+          'VCResourceCompilerTool': {
11181
+            'Culture' : '1033',
11182
+            'AdditionalIncludeDirectories': [
11183
+              '<(DEPTH)',
11184
+              '<(SHARED_INTERMEDIATE_DIR)',
11185
+            ],
11186
+          },
11187
+          'target_conditions': [
11188
+            ['_type=="executable"', {
11189
+              'VCManifestTool': {
11190
+                'EmbedManifest': 'true',
11191
+              },
11192
+            }],
11193
+            ['_type=="executable" and ">(win_exe_compatibility_manifest)"!=""', {
11194
+              'VCManifestTool': {
11195
+                'AdditionalManifestFiles': [
11196
+                  '>(win_exe_compatibility_manifest)',
11197
+                ],
11198
+              },
11199
+            }],
11200
+          ],
11201
+          'conditions': [
11202
+            # Building with Clang on Windows is a work in progress and very
11203
+            # experimental. See crbug.com/82385.
11204
+            # Keep this in sync with the similar blocks in build/config/compiler/BUILD.gn
11205
+            ['clang==1', {
11206
+              'VCCLCompilerTool': {
11207
+                'AdditionalOptions': [
11208
+                  # Don't warn about unused function parameters.
11209
+                  # (This is also used on other platforms.)
11210
+                  '-Wno-unused-parameter',
11211
+                  # Don't warn about the "struct foo f = {0};" initialization
11212
+                  # pattern.
11213
+                  '-Wno-missing-field-initializers',
11214
+                  # TODO(hans): Make this list shorter eventually, http://crbug.com/504657
11215
+                  '-Wno-microsoft-enum-value',  # http://crbug.com/505296
11216
+                  '-Wno-unknown-pragmas',  # http://crbug.com/505314
11217
+                  '-Wno-microsoft-cast',  # http://crbug.com/550065
11218
+                ],
11219
+              },
11220
+            }],
11221
+            ['clang==1 and clang_use_chrome_plugins==1', {
11222
+              'VCCLCompilerTool': {
11223
+                'AdditionalOptions': [
11224
+                  '<@(clang_chrome_plugins_flags)',
11225
+                ],
11226
+              },
11227
+            }],
11228
+            ['clang==1 and MSVS_VERSION == "2013"', {
11229
+              'VCCLCompilerTool': {
11230
+                'AdditionalOptions': [
11231
+                  '-fmsc-version=1800',
11232
+                ],
11233
+              },
11234
+            }],
11235
+            ['clang==1 and MSVS_VERSION == "2015"', {
11236
+              'VCCLCompilerTool': {
11237
+                'AdditionalOptions': [
11238
+                  '-fmsc-version=1900',
11239
+                ],
11240
+              },
11241
+            }],
11242
+            ['clang==1 and "<!(python <(DEPTH)/build/win/use_ansi_codes.py)"=="True"', {
11243
+              'VCCLCompilerTool': {
11244
+                'AdditionalOptions': [
11245
+                  # cmd.exe doesn't understand ANSI escape codes by default,
11246
+                  # so only enable them if something emulating them is around.
11247
+                  '-fansi-escape-codes',
11248
+                  # Also see http://crbug.com/110262
11249
+                  '-fcolor-diagnostics',
11250
+                ],
11251
+              },
11252
+            }],
11253
+          ],
11254
+        },
11255
+      },
11256
+    }],
11257
+    ['disable_nacl==1', {
11258
+      'target_defaults': {
11259
+        'defines': [
11260
+          'DISABLE_NACL',
11261
+        ],
11262
+      },
11263
+    }],
11264
+    ['OS=="win" and msvs_use_common_linker_extras', {
11265
+      'target_defaults': {
11266
+        'msvs_settings': {
11267
+          'VCLinkerTool': {
11268
+            'DelayLoadDLLs': [
11269
+              'dbghelp.dll',
11270
+              'dwmapi.dll',
11271
+              'shell32.dll',
11272
+              'uxtheme.dll',
11273
+            ],
11274
+          },
11275
+        },
11276
+        'configurations': {
11277
+          'x86_Base': {
11278
+            'msvs_settings': {
11279
+              'VCLinkerTool': {
11280
+                'AdditionalOptions': [
11281
+                  '/safeseh',
11282
+                  '/dynamicbase',
11283
+                  '/ignore:4199',
11284
+                  '/ignore:4221',
11285
+                  '/nxcompat',
11286
+                  '/largeaddressaware',
11287
+                ],
11288
+              },
11289
+              'conditions': [
11290
+                ['asan==1', {
11291
+                  # TODO(asan/win): Move this down into the general
11292
+                  # win-target_defaults section once the 64-bit asan runtime
11293
+                  # exists.  See crbug.com/345874.
11294
+                  'VCCLCompilerTool': {
11295
+                    'AdditionalOptions': [
11296
+                      '-fsanitize=address',
11297
+                      '-fsanitize-blacklist=<(PRODUCT_DIR)/../../tools/memory/asan/blacklist_win.txt',
11298
+          # Omit variable info to speed up /Z7 links.
11299
+          '-gline-tables-only',
11300
+                    ],
11301
+                    'AdditionalIncludeDirectories': [
11302
+                      # MSVC needs to be able to find the sanitizer headers when
11303
+                      # invoked via /fallback. This is critical for using macros
11304
+                      # like ASAN_UNPOISON_MEMORY_REGION in files where we fall
11305
+                      # back.
11306
+                      '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/include_sanitizer',
11307
+                    ],
11308
+                  },
11309
+                  'VCLinkerTool': {
11310
+                    'AdditionalLibraryDirectories': [
11311
+                      # TODO(hans): If make_clang_dir is absolute, this breaks.
11312
+                      '<(DEPTH)/<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/lib/windows',
11313
+                    ],
11314
+                  },
11315
+                  'target_conditions': [
11316
+                    ['component=="shared_library"', {
11317
+                      'VCLinkerTool': {
11318
+                        'AdditionalDependencies': [
11319
+                           'clang_rt.asan_dynamic-i386.lib',
11320
+                           'clang_rt.asan_dynamic_runtime_thunk-i386.lib',
11321
+                        ],
11322
+                      },
11323
+                    }],
11324
+                    ['_type=="executable" and component=="static_library"', {
11325
+                      'VCLinkerTool': {
11326
+                        'AdditionalDependencies': [
11327
+                           'clang_rt.asan-i386.lib',
11328
+                        ],
11329
+                      },
11330
+                    }],
11331
+                    ['(_type=="shared_library" or _type=="loadable_module") and component=="static_library"', {
11332
+                      'VCLinkerTool': {
11333
+                        'AdditionalDependencies': [
11334
+                           'clang_rt.asan_dll_thunk-i386.lib',
11335
+                        ],
11336
+                      },
11337
+                    }],
11338
+                  ],
11339
+                }],
11340
+                ['sanitizer_coverage!=""', {
11341
+                  # TODO(asan/win): Move this down into the general
11342
+                  # win-target_defaults section once the 64-bit asan runtime
11343
+                  # exists.  See crbug.com/345874.
11344
+                  'VCCLCompilerTool': {
11345
+                    'AdditionalOptions': [
11346
+                      '-fsanitize-coverage=<(sanitizer_coverage)',
11347
+                    ],
11348
+                  },
11349
+                }],
11350
+              ],
11351
+            },
11352
+            'conditions': [
11353
+              ['sanitizer_coverage!=""', {
11354
+                # TODO(asan/win): Move this down into the general
11355
+                # win-target_defaults section once the 64-bit asan runtime
11356
+                # exists.  See crbug.com/345874.
11357
+                'defines': [
11358
+                  'SANITIZER_COVERAGE',
11359
+                ],
11360
+              }],
11361
+            ],
11362
+          },
11363
+          'x64_Base': {
11364
+            'msvs_settings': {
11365
+              'VCLinkerTool': {
11366
+                'AdditionalOptions': [
11367
+                  # safeseh is not compatible with x64
11368
+                  '/dynamicbase',
11369
+                  '/ignore:4199',
11370
+                  '/ignore:4221',
11371
+                  '/nxcompat',
11372
+                ],
11373
+              },
11374
+            },
11375
+          },
11376
+        },
11377
+      },
11378
+    }],
11379
+    ['enable_new_npdevice_api==1', {
11380
+      'target_defaults': {
11381
+        'defines': [
11382
+          'ENABLE_NEW_NPDEVICE_API',
11383
+        ],
11384
+      },
11385
+    }],
11386
+    # Don't warn about the "typedef 'foo' locally defined but not used"
11387
+    # for gcc 4.8 and higher.
11388
+    # TODO: remove this flag once all builds work. See crbug.com/227506
11389
+    ['clang==0', {
11390
+      'target_defaults': {
11391
+        'cflags': [ '-Wno-unused-local-typedefs' ],
11392
+      },
11393
+    }],
11394
+    ['clang==0 and host_clang==1', {
11395
+      'target_defaults': {
11396
+        'target_conditions': [
11397
+          ['_toolset=="host"', { 'cflags!': [ '-Wno-unused-local-typedefs' ]}],
11398
+        ],
11399
+      },
11400
+    }],
11401
+    ['clang==1 and ((OS!="mac" and OS!="ios") or clang_xcode==0) '
11402
+        'and OS!="win"', {
11403
+      'make_global_settings': [
11404
+        ['CC', '<(make_clang_dir)/bin/clang'],
11405
+        ['CXX', '<(make_clang_dir)/bin/clang++'],
11406
+        ['CC.host', '$(CC)'],
11407
+        ['CXX.host', '$(CXX)'],
11408
+      ],
11409
+    }],
11410
+    ['clang==1 and OS=="win"', {
11411
+      'make_global_settings': [
11412
+        # On Windows, gyp's ninja generator only looks at CC.
11413
+        ['CC', '<(make_clang_dir)/bin/clang-cl'],
11414
+      ],
11415
+    }],
11416
+    ['use_lld==1 and OS=="win"', {
11417
+      'make_global_settings': [
11418
+        # Limited to Windows because lld-link is the driver that is
11419
+        # compatible with link.exe.
11420
+        ['LD', '<(make_clang_dir)/bin/lld-link'],
11421
+        # lld-link includes a replacement for lib.exe that can produce thin
11422
+        # archives and understands bitcode (for use_lto==1).
11423
+        ['AR', '<(make_clang_dir)/bin/lld-link /lib /llvmlibthin'],
11424
+      ],
11425
+    }],
11426
+    ['OS=="android" and clang==0', {
11427
+      # Hardcode the compiler names in the Makefile so that
11428
+      # it won't depend on the environment at make time.
11429
+      'make_global_settings': [
11430
+        ['CC', '<!(/bin/echo -n <(android_toolchain)/*-gcc)'],
11431
+        ['CXX', '<!(/bin/echo -n <(android_toolchain)/*-g++)'],
11432
+        ['CC.host', '<(host_cc)'],
11433
+        ['CXX.host', '<(host_cxx)'],
11434
+      ],
11435
+    }],
11436
+    ['OS=="linux" and target_arch=="mipsel" and host_arch!="mipsel" and chromeos==0 and clang==0', {
11437
+      # Set default mips cross tools on linux.  These can be overridden
11438
+      # using CC,CXX,CC.host and CXX.host environment variables.
11439
+      'make_global_settings': [
11440
+        ['CC', '<!(which mipsel-linux-gnu-gcc)'],
11441
+        ['CXX', '<!(which mipsel-linux-gnu-g++)'],
11442
+        ['CC.host', '<(host_cc)'],
11443
+        ['CXX.host', '<(host_cxx)'],
11444
+      ],
11445
+    }],
11446
+    ['OS=="linux" and target_arch=="arm" and host_arch!="arm" and chromeos==0 and clang==0', {
11447
+      # Set default ARM cross tools on linux.  These can be overridden
11448
+      # using CC,CXX,CC.host and CXX.host environment variables.
11449
+      'make_global_settings': [
11450
+        ['CC', '<!(which arm-linux-gnueabihf-gcc)'],
11451
+        ['CXX', '<!(which arm-linux-gnueabihf-g++)'],
11452
+        ['CC.host', '<(host_cc)'],
11453
+        ['CXX.host', '<(host_cxx)'],
11454
+      ],
11455
+    }],
11456
+    ['use_goma==1', {
11457
+      'make_global_settings': [
11458
+       ['CC_wrapper', '<(gomadir)/gomacc'],
11459
+       ['CXX_wrapper', '<(gomadir)/gomacc'],
11460
+       ['CC.host_wrapper', '<(gomadir)/gomacc'],
11461
+       ['CXX.host_wrapper', '<(gomadir)/gomacc'],
11462
+      ],
11463
+    }],
11464
+    ['use_lto==1', {
11465
+      'target_defaults': {
11466
+        'target_conditions': [
11467
+          ['_toolset=="target"', {
11468
+            'cflags': [
11469
+              '-flto',
11470
+            ],
11471
+            'xcode_settings': {
11472
+              'LLVM_LTO': 'YES',
11473
+            },
11474
+          }],
11475
+          # Work-around for http://openradar.appspot.com/20356002
11476
+          ['_toolset=="target" and _type!="static_library"', {
11477
+            'xcode_settings': {
11478
+              'OTHER_LDFLAGS': [
11479
+                '-Wl,-all_load',
11480
+              ],
11481
+            },
11482
+          }],
11483
+        ],
11484
+      },
11485
+    }],
11486
+    ['use_lto==1 and clang==0', {
11487
+      'target_defaults': {
11488
+        'target_conditions': [
11489
+          ['_toolset=="target"', {
11490
+            'cflags': [
11491
+              '-ffat-lto-objects',
11492
+            ],
11493
+          }],
11494
+        ],
11495
+      },
11496
+    }],
11497
+    ['use_lto==1 and clang==1', {
11498
+      'target_defaults': {
11499
+        'target_conditions': [
11500
+          ['_toolset=="target"', {
11501
+            'arflags': [
11502
+              '--plugin', '../../<(make_clang_dir)/lib/LLVMgold.so',
11503
+            ],
11504
+            'cflags': [
11505
+              '-fwhole-program-vtables',
11506
+            ],
11507
+            'ldflags': [
11508
+              '-fwhole-program-vtables',
11509
+            ],
11510
+          }],
11511
+        ],
11512
+        'msvs_settings': {
11513
+          'VCCLCompilerTool': {
11514
+            'AdditionalOptions': [
11515
+              # TODO(pcc): Add LTO support to clang-cl driver and use it here.
11516
+              '-Xclang',
11517
+              '-emit-llvm-bc',
11518
+            ],
11519
+          },
11520
+        },
11521
+      },
11522
+    }],
11523
+    # Apply a lower LTO optimization level as the default is too slow.
11524
+    ['use_lto==1 and clang==1', {
11525
+      'target_defaults': {
11526
+        'target_conditions': [
11527
+          ['_toolset=="target"', {
11528
+            'ldflags': [
11529
+              '-Wl,--plugin-opt,O1',
11530
+              # Allows the linker to apply ICF to the LTO object file. Also, when
11531
+              # targeting ARM, wWithout this flag, LTO produces a .text section
11532
+              # that is larger than the maximum call displacement, preventing the
11533
+              # linker from relocating calls (http://llvm.org/PR22999).
11534
+              '-Wl,--plugin-opt,-function-sections',
11535
+            ],
11536
+          }],
11537
+          ['_toolset=="target" and _type!="static_library"', {
11538
+            'xcode_settings':  {
11539
+              'OTHER_LDFLAGS': [
11540
+                '-Wl,-mllvm,-O1',
11541
+              ],
11542
+            },
11543
+          }],
11544
+        ],
11545
+        'msvs_settings': {
11546
+          'VCLinkerTool': {
11547
+            'AdditionalOptions': [
11548
+              '/opt:lldlto=1',
11549
+            ],
11550
+          },
11551
+        },
11552
+      },
11553
+    }],
11554
+    ['(use_lto==1 or use_lto_o2==1) and clang==0', {
11555
+      'target_defaults': {
11556
+        'target_conditions': [
11557
+          ['_toolset=="target"', {
11558
+            'ldflags': [
11559
+              '-flto=32',
11560
+            ],
11561
+          }],
11562
+        ],
11563
+      },
11564
+    }],
11565
+    ['(use_lto==1 or use_lto_o2==1) and clang==1', {
11566
+      'target_defaults': {
11567
+        'target_conditions': [
11568
+          ['_toolset=="target"', {
11569
+            'ldflags': [
11570
+              '-flto',
11571
+            ],
11572
+          }],
11573
+        ],
11574
+      },
11575
+    }],
11576
+    ['cfi_diag==1', {
11577
+      'target_defaults': {
11578
+        'target_conditions': [
11579
+          ['_toolset=="target"', {
11580
+            'cflags': [
11581
+              '-fno-sanitize-trap=cfi',
11582
+              '-fsanitize-recover=cfi',
11583
+            ],
11584
+            'cflags_cc!': [
11585
+              '-fno-rtti',
11586
+            ],
11587
+            'cflags!': [
11588
+              '-fno-rtti',
11589
+            ],
11590
+            'ldflags': [
11591
+              '-fno-sanitize-trap=cfi',
11592
+              '-fsanitize-recover=cfi',
11593
+            ],
11594
+            'xcode_settings': {
11595
+              'OTHER_CFLAGS': [
11596
+                '-fno-sanitize-trap=cfi',
11597
+                '-fsanitize-recover=cfi',
11598
+              ],
11599
+            },
11600
+            'msvs_settings': {
11601
+              'VCCLCompilerTool': {
11602
+                'AdditionalOptions': [
11603
+                  '-fno-sanitize-trap=cfi',
11604
+                  '-fsanitize-recover=cfi',
11605
+                ],
11606
+              },
11607
+            },
11608
+          }],
11609
+          ['_toolset=="target" and _type!="static_library"', {
11610
+            'xcode_settings':  {
11611
+              'OTHER_LDFLAGS': [
11612
+                '-fno-sanitize-trap=cfi',
11613
+                '-fsanitize-recover=cfi',
11614
+              ],
11615
+            },
11616
+          }],
11617
+        ],
11618
+      },
11619
+    }],
11620
+    ['cfi_vptr==1 and cfi_diag==0', {
11621
+      'target_defaults': {
11622
+        'target_conditions': [
11623
+          ['_toolset=="target"', {
11624
+            'defines': [
11625
+              'CFI_ENFORCEMENT',
11626
+            ],
11627
+          }],
11628
+        ],
11629
+      },
11630
+    }],
11631
+    ['cfi_vptr==1', {
11632
+      'target_defaults': {
11633
+        'target_conditions': [
11634
+          ['_toolset=="target"', {
11635
+            'cflags': [
11636
+              '-fsanitize=cfi-vcall',
11637
+              '-fsanitize-blacklist=<(cfi_blacklist)',
11638
+            ],
11639
+            'ldflags': [
11640
+              '-fsanitize=cfi-vcall',
11641
+              '-fsanitize=cfi-derived-cast',
11642
+              '-fsanitize=cfi-unrelated-cast',
11643
+            ],
11644
+            'xcode_settings': {
11645
+              'OTHER_CFLAGS': [
11646
+                '-fsanitize=cfi-vcall',
11647
+                '-fsanitize-blacklist=<(cfi_blacklist)',
11648
+              ],
11649
+            },
11650
+          }],
11651
+          ['_toolset=="target" and _type!="static_library"', {
11652
+            'xcode_settings':  {
11653
+              'OTHER_LDFLAGS': [
11654
+                '-fsanitize=cfi-vcall',
11655
+              ],
11656
+            },
11657
+          }],
11658
+        ],
11659
+      },
11660
+    }],
11661
+    ['cfi_vptr==1 and cfi_cast==1', {
11662
+      'target_defaults': {
11663
+        'target_conditions': [
11664
+          ['_toolset=="target"', {
11665
+            'cflags': [
11666
+              '-fsanitize=cfi-derived-cast',
11667
+              '-fsanitize=cfi-unrelated-cast',
11668
+            ],
11669
+            'ldflags': [
11670
+              '-fsanitize=cfi-derived-cast',
11671
+              '-fsanitize=cfi-unrelated-cast',
11672
+            ],
11673
+            'xcode_settings': {
11674
+              'OTHER_CFLAGS': [
11675
+                '-fsanitize=cfi-derived-cast',
11676
+                '-fsanitize=cfi-unrelated-cast',
11677
+              ],
11678
+            },
11679
+          }],
11680
+          ['_toolset=="target" and _type!="static_library"', {
11681
+            'xcode_settings':  {
11682
+              'OTHER_LDFLAGS': [
11683
+                '-fsanitize=cfi-derived-cast',
11684
+                '-fsanitize=cfi-unrelated-cast',
11685
+              ],
11686
+            },
11687
+          }],
11688
+        ],
11689
+      },
11690
+    }],
11691
+    ['cfi_vptr==1 and OS=="win"', {
11692
+      'target_defaults': {
11693
+        'target_conditions': [
11694
+          ['_toolset=="target"', {
11695
+            'msvs_settings': {
11696
+              'VCCLCompilerTool': {
11697
+                'AdditionalOptions': [
11698
+                  # TODO(pcc): Use regular -fsanitize=* flags here once clang-cl
11699
+                  # supports LTO.
11700
+                  '-Xclang',
11701
+                  '-fsanitize=cfi-vcall',
11702
+                  '-Xclang',
11703
+                  '-fsanitize=cfi-derived-cast',
11704
+                  '-Xclang',
11705
+                  '-fsanitize=cfi-unrelated-cast',
11706
+                  '-Xclang',
11707
+                  '-fsanitize-trap=cfi-vcall',
11708
+                  '-Xclang',
11709
+                  '-fsanitize-trap=cfi-derived-cast',
11710
+                  '-Xclang',
11711
+                  '-fsanitize-trap=cfi-unrelated-cast',
11712
+                  '-Xclang',
11713
+                  '-fsanitize-blacklist=<(cfi_blacklist)',
11714
+                  '-Xclang',
11715
+                  '-fsanitize-blacklist=../../<(make_clang_dir)/lib/clang/<!(python <(DEPTH)/tools/clang/scripts/update.py --print-clang-version)/cfi_blacklist.txt',
11716
+                ],
11717
+              },
11718
+            },
11719
+          }],
11720
+        ],
11721
+      },
11722
+    }],
11723
+  ],
11724
+  'xcode_settings': {
11725
+    # DON'T ADD ANYTHING NEW TO THIS BLOCK UNLESS YOU REALLY REALLY NEED IT!
11726
+    # This block adds *project-wide* configuration settings to each project
11727
+    # file.  It's almost always wrong to put things here.  Specify your
11728
+    # custom xcode_settings in target_defaults to add them to targets instead.
11729
+    'conditions': [
11730
+      # In an Xcode Project Info window, the "Base SDK for All Configurations"
11731
+      # setting sets the SDK on a project-wide basis. In order to get the
11732
+      # configured SDK to show properly in the Xcode UI, SDKROOT must be set
11733
+      # here at the project level.
11734
+      ['OS=="mac"', {
11735
+        'ARCHS': [ 'x86_64' ],
11736
+        'conditions': [
11737
+          ['mac_sdk_path==""', {
11738
+            'SDKROOT': 'macosx<(mac_sdk)',  # -isysroot
11739
+          }, {
11740
+            'SDKROOT': '<(mac_sdk_path)',  # -isysroot
11741
+          }],
11742
+        ],
11743
+      }],
11744
+      ['OS=="ios"', {
11745
+        # Target both iPhone and iPad.
11746
+        'TARGETED_DEVICE_FAMILY': '1,2',
11747
+        'conditions': [
11748
+          ['ios_sdk_path==""', {
11749
+            'SDKROOT': 'iphoneos<(ios_sdk)',  # -isysroot
11750
+          }, {
11751
+            'SDKROOT': '<(ios_sdk_path)',  # -isysroot
11752
+          }],
11753
+        ],
11754
+      }],
11755
+    ],
11756
+    # The Xcode generator will look for an xcode_settings section at the root
11757
+    # of each dict and use it to apply settings on a file-wide basis.  Most
11758
+    # settings should not be here, they should be in target-specific
11759
+    # xcode_settings sections, or better yet, should use non-Xcode-specific
11760
+    # settings in target dicts.  SYMROOT is a special case, because many other
11761
+    # Xcode variables depend on it, including variables such as
11762
+    # PROJECT_DERIVED_FILE_DIR.  When a source group corresponding to something
11763
+    # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
11764
+    # files to appear (when present) in the UI as actual files and not red
11765
+    # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
11766
+    # and therefore SYMROOT, needs to be set at the project level.
11767
+    'SYMROOT': '<(DEPTH)/xcodebuild',
11768
+  },
11769
+}
11770
diff --git media/webrtc/trunk/webrtc/build/common.gypi media/webrtc/trunk/webrtc/build/common.gypi
11771
new file mode 100644
11772
index 000000000000..eb72ba57cce7
11773
--- /dev/null
11774
+++ media/webrtc/trunk/webrtc/build/common.gypi
11775
@@ -0,0 +1,665 @@
11776
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
11777
+#
11778
+# Use of this source code is governed by a BSD-style license
11779
+# that can be found in the LICENSE file in the root of the source
11780
+# tree. An additional intellectual property rights grant can be found
11781
+# in the file PATENTS.  All contributing project authors may
11782
+# be found in the AUTHORS file in the root of the source tree.
11783
+
11784
+# This file contains common settings for building WebRTC components.
11785
+
11786
+{
11787
+  # Nesting is required in order to use variables for setting other variables.
11788
+  'variables': {
11789
+    'variables': {
11790
+      'variables': {
11791
+        'variables': {
11792
+          # This will already be set to zero by supplement.gypi
11793
+          'build_with_chromium%': 1,
11794
+
11795
+          # Enable to use the Mozilla internal settings.
11796
+          'build_with_mozilla%': 0,
11797
+        },
11798
+        'build_with_chromium%': '<(build_with_chromium)',
11799
+        'build_with_mozilla%': '<(build_with_mozilla%)',
11800
+        'include_opus%': 1,
11801
+        'rtc_opus_variable_complexity%': 0,
11802
+
11803
+        'conditions': [
11804
+          # Include the iLBC audio codec?
11805
+          ['build_with_chromium==1 or build_with_mozilla==1', {
11806
+            'include_ilbc%': 0,
11807
+          }, {
11808
+            'include_ilbc%': 1,
11809
+          }],
11810
+
11811
+          ['build_with_chromium==1', {
11812
+            'webrtc_root%': '<(DEPTH)/third_party/webrtc',
11813
+          }, {
11814
+            'webrtc_root%': '<(DEPTH)/webrtc',
11815
+          }],
11816
+
11817
+          # Controls whether we use libevent on posix platforms.
11818
+          # TODO(phoglund): should arguably be controlled by platform #ifdefs
11819
+          # in the code instead.
11820
+          ['OS=="win" or OS=="mac" or OS=="ios"', {
11821
+            'build_libevent%': 0,
11822
+            'enable_libevent%': 0,
11823
+          }, {
11824
+            'build_libevent%': 1,
11825
+            'enable_libevent%': 1,
11826
+            'libevent_dir%': '<(DEPTH)/third_party/libevent',
11827
+          }],
11828
+        ],
11829
+      },
11830
+      'build_with_chromium%': '<(build_with_chromium)',
11831
+      'build_with_mozilla%': '<(build_with_mozilla)',
11832
+      'build_libevent%': '<(build_libevent)',
11833
+      'enable_libevent%': '<(enable_libevent)',
11834
+      'webrtc_root%': '<(webrtc_root)',
11835
+      'webrtc_vp8_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp8',
11836
+      'webrtc_vp9_dir%': '<(webrtc_root)/modules/video_coding/codecs/vp9',
11837
+      'webrtc_h264_dir%': '<(webrtc_root)/modules/video_coding/codecs/h264',
11838
+      'libevent_dir%': '<(DEPTH)/third_party/libevent',
11839
+      'include_g711%': 1,
11840
+      'include_g722%': 1,
11841
+      'include_ilbc%': '<(include_ilbc)',
11842
+      'include_opus%': '<(include_opus)',
11843
+      'include_isac%': 1,
11844
+      'include_pcm16b%': 1,
11845
+      'opus_dir%': '<(DEPTH)/third_party/opus',
11846
+    },
11847
+    'build_with_chromium%': '<(build_with_chromium)',
11848
+    'build_with_mozilla%': '<(build_with_mozilla)',
11849
+    'build_libevent%': '<(build_libevent)',
11850
+    'enable_libevent%': '<(enable_libevent)',
11851
+    'webrtc_root%': '<(webrtc_root)',
11852
+    'test_runner_path': '<(DEPTH)/webrtc/build/android/test_runner.py',
11853
+    'webrtc_vp8_dir%': '<(webrtc_vp8_dir)',
11854
+    'webrtc_vp9_dir%': '<(webrtc_vp9_dir)',
11855
+    'webrtc_h264_dir%': '<(webrtc_h264_dir)',
11856
+    'libevent_dir%': '<(libevent_dir)',
11857
+
11858
+    'include_g711%': '<(include_g711)',
11859
+    'include_g722%': '<(include_g722)',
11860
+    'include_ilbc%': '<(include_ilbc)',
11861
+    'include_opus%': '<(include_opus)',
11862
+    'include_isac%': '<(include_isac)',
11863
+    'include_pcm16b%': '<(include_pcm16b)',
11864
+
11865
+    'rtc_relative_path%': 1,
11866
+    'external_libraries%': '0',
11867
+    'json_root%': '<(DEPTH)/third_party/jsoncpp/source/include/',
11868
+    # openssl needs to be defined or gyp will complain. Is is only used when
11869
+    # when providing external libraries so just use current directory as a
11870
+    # placeholder.
11871
+    'ssl_root%': '.',
11872
+
11873
+    # The Chromium common.gypi we use treats all gyp files without
11874
+    # chromium_code==1 as third party code. This disables many of the
11875
+    # preferred warning settings.
11876
+    #
11877
+    # We can set this here to have WebRTC code treated as Chromium code. Our
11878
+    # third party code will still have the reduced warning settings.
11879
+    'chromium_code': 1,
11880
+
11881
+    # Targets are by default not NaCl untrusted code. Use this variable exclude
11882
+    # code that uses libraries that aren't available in the NaCl sandbox.
11883
+    'nacl_untrusted_build%': 0,
11884
+
11885
+    # Set to 1 to enable code coverage on Linux using the gcov library.
11886
+    'coverage%': 0,
11887
+
11888
+    # Set to "func", "block", "edge" for coverage generation.
11889
+    # At unit test runtime set UBSAN_OPTIONS="coverage=1".
11890
+    # It is recommend to set include_examples=0.
11891
+    # Use llvm's sancov -html-report for human readable reports.
11892
+    # See http://clang.llvm.org/docs/SanitizerCoverage.html .
11893
+    'webrtc_sanitize_coverage%': "",
11894
+
11895
+    # Remote bitrate estimator logging/plotting.
11896
+    'enable_bwe_test_logging%': 0,
11897
+
11898
+    # Selects fixed-point code where possible.
11899
+    'prefer_fixed_point%': 0,
11900
+
11901
+    # Enable data logging. Produces text files with data logged within engines
11902
+    # which can be easily parsed for offline processing.
11903
+    'enable_data_logging%': 0,
11904
+
11905
+    # Enables the use of protocol buffers for debug recordings.
11906
+    'enable_protobuf%': 1,
11907
+
11908
+    # Disable the code for the intelligibility enhancer by default.
11909
+    'enable_intelligibility_enhancer%': 0,
11910
+
11911
+    # Selects whether debug dumps for the audio processing module
11912
+    # should be generated.
11913
+    'apm_debug_dump%': 0,
11914
+
11915
+    # Disable these to not build components which can be externally provided.
11916
+    'build_expat%': 1,
11917
+    'build_json%': 1,
11918
+    'build_libsrtp%': 1,
11919
+    'build_libvpx%': 1,
11920
+    'libvpx_build_vp9%': 1,
11921
+    'build_libyuv%': 1,
11922
+    'build_openmax_dl%': 1,
11923
+    'build_opus%': 1,
11924
+    'build_protobuf%': 1,
11925
+    'build_ssl%': 1,
11926
+    'build_usrsctp%': 1,
11927
+
11928
+    # Disable by default
11929
+    'have_dbus_glib%': 0,
11930
+
11931
+    # Make it possible to provide custom locations for some libraries.
11932
+    'libvpx_dir%': '<(DEPTH)/third_party/libvpx',
11933
+    'libyuv_dir%': '<(DEPTH)/third_party/libyuv',
11934
+    'libevent_dir%': '<(DEPTH)/third_party/libevent',
11935
+    'opus_dir%': '<(opus_dir)',
11936
+
11937
+    # Use Java based audio layer as default for Android.
11938
+    # Change this setting to 1 to use Open SL audio instead.
11939
+    # TODO(henrika): add support for Open SL ES.
11940
+    'enable_android_opensl%': 0,
11941
+
11942
+    # Link-Time Optimizations
11943
+    # Executes code generation at link-time instead of compile-time
11944
+    # https://gcc.gnu.org/wiki/LinkTimeOptimization
11945
+    'use_lto%': 0,
11946
+
11947
+    # Defer ssl perference to that specified through sslconfig.h instead of
11948
+    # choosing openssl or nss directly.  In practice, this can be used to
11949
+    # enable schannel on windows.
11950
+    'use_legacy_ssl_defaults%': 0,
11951
+
11952
+    # Determines whether NEON code will be built.
11953
+    'build_with_neon%': 0,
11954
+
11955
+    # Disable this to skip building source requiring GTK.
11956
+    'use_gtk%': 1,
11957
+
11958
+    # Enable this to prevent extern symbols from being hidden on iOS builds.
11959
+    # The chromium settings we inherit hide symbols by default on Release
11960
+    # builds. We want our symbols to be visible when distributing WebRTC via
11961
+    # static libraries to avoid linker warnings.
11962
+    'ios_override_visibility%': 0,
11963
+
11964
+    # Determines whether QUIC code will be built.
11965
+    'use_quic%': 0,
11966
+
11967
+    # By default, use normal platform audio support or dummy audio, but don't
11968
+    # use file-based audio playout and record.
11969
+    'use_dummy_audio_file_devices%': 0,
11970
+
11971
+    'conditions': [
11972
+      # Enable this to build OpenH264 encoder/FFmpeg decoder. This is supported
11973
+      # on all platforms except Android and iOS. Because FFmpeg can be built
11974
+      # with/without H.264 support, |ffmpeg_branding| has to separately be set
11975
+      # to a value that includes H.264, for example "Chrome". If FFmpeg is built
11976
+      # without H.264, compilation succeeds but |H264DecoderImpl| fails to
11977
+      # initialize. See also: |rtc_initialize_ffmpeg|.
11978
+      # CHECK THE OPENH264, FFMPEG AND H.264 LICENSES/PATENTS BEFORE BUILDING.
11979
+      # http://www.openh264.org, https://www.ffmpeg.org/
11980
+      # TODO: proprietary_codecs is undefined here?
11981
+      #['proprietary_codecs==1 and OS!="android" and OS!="ios"', {
11982
+      #  'rtc_use_h264%': 1,
11983
+      #}, {
11984
+      #  'rtc_use_h264%': 0,
11985
+      #}],
11986
+
11987
+      # FFmpeg must be initialized for |H264DecoderImpl| to work. This can be
11988
+      # done by WebRTC during |H264DecoderImpl::InitDecode| or externally.
11989
+      # FFmpeg must only be initialized once. Projects that initialize FFmpeg
11990
+      # externally, such as Chromium, must turn this flag off so that WebRTC
11991
+      # does not also initialize.
11992
+      ['build_with_chromium==0', {
11993
+        'rtc_initialize_ffmpeg%': 1,
11994
+      }, {
11995
+        'rtc_initialize_ffmpeg%': 0,
11996
+      }],
11997
+
11998
+      ['build_with_chromium==1', {
11999
+        # Build sources requiring GTK. NOTICE: This is not present in Chrome OS
12000
+        # build environments, even if available for Chromium builds.
12001
+        'use_gtk%': 0,
12002
+        # Exclude pulse audio on Chromium since its prerequisites don't require
12003
+        # pulse audio.
12004
+        'include_pulse_audio%': 0,
12005
+
12006
+        # Exclude internal ADM since Chromium uses its own IO handling.
12007
+        'include_internal_audio_device%': 0,
12008
+
12009
+        'include_ndk_cpu_features%': 0,
12010
+
12011
+        # Remove tests for Chromium to avoid slowing down GYP generation.
12012
+        'include_tests%': 0,
12013
+        'restrict_webrtc_logging%': 1,
12014
+      }, {  # Settings for the standalone (not-in-Chromium) build.
12015
+        'use_gtk%': 1,
12016
+        # TODO(andrew): For now, disable the Chrome plugins, which causes a
12017
+        # flood of chromium-style warnings. Investigate enabling them:
12018
+        # http://code.google.com/p/webrtc/issues/detail?id=163
12019
+        'clang_use_chrome_plugins%': 0,
12020
+
12021
+        'include_pulse_audio%': 1,
12022
+        'include_internal_audio_device%': 1,
12023
+        'include_ndk_cpu_features%': 0,
12024
+        'conditions': [
12025
+          ['build_with_mozilla==1', {
12026
+            'include_tests%': 0,
12027
+            'conditions': [
12028
+	      # silly gyp won't let me do 'a': !'b'
12029
+	      # suppress TRACE logging in non-debug builds
12030
+              ['debug==1', {
12031
+                'restrict_webrtc_logging%': 0,
12032
+              }, {
12033
+                'restrict_webrtc_logging%': 1,
12034
+              }],
12035
+	    ],
12036
+          }, {
12037
+            'include_tests%': 1,
12038
+            'restrict_webrtc_logging%': 0,
12039
+	  }],
12040
+	],
12041
+      }],
12042
+      ['OS=="linux"', {
12043
+        'include_alsa_audio%': 1,
12044
+      }, {
12045
+        'include_alsa_audio%': 0,
12046
+      }],
12047
+      ['OS=="openbsd"', {
12048
+        'include_sndio_audio%': 1,
12049
+      }, {
12050
+        'include_sndio_audio%': 0,
12051
+      }],
12052
+      ['OS=="solaris" or (OS!="openbsd" and os_bsd==1)', {
12053
+        'include_pulse_audio%': 1,
12054
+      }, {
12055
+        'include_pulse_audio%': 0,
12056
+      }],
12057
+      ['OS=="linux" or OS=="solaris" or os_bsd==1', {
12058
+        'include_v4l2_video_capture%': 1,
12059
+      }, {
12060
+        'include_v4l2_video_capture%': 0,
12061
+      }],
12062
+      ['target_arch=="arm" or target_arch=="arm64" or target_arch=="mipsel"', {
12063
+        'prefer_fixed_point%': 1,
12064
+      }],
12065
+      ['(target_arch=="arm" and arm_neon==1) or target_arch=="arm64"', {
12066
+        'build_with_neon%': 1,
12067
+      }],
12068
+      ['OS!="ios" and (target_arch!="arm" or arm_version>=7) and target_arch!="mips64el" and build_with_mozilla==0', {
12069
+        'rtc_use_openmax_dl%': 1,
12070
+      }, {
12071
+        'rtc_use_openmax_dl%': 0,
12072
+      }],
12073
+    ], # conditions
12074
+  },
12075
+  'target_defaults': {
12076
+    'conditions': [
12077
+      ['restrict_webrtc_logging==1', {
12078
+        'defines': ['WEBRTC_RESTRICT_LOGGING',],
12079
+      }],
12080
+      ['build_with_mozilla==1', {
12081
+        'defines': [
12082
+          # Changes settings for Mozilla build.
12083
+          'WEBRTC_MOZILLA_BUILD',
12084
+          'WEBRTC_VOE_EXTERNAL_REC_AND_PLAYOUT',
12085
+         ],
12086
+      }],
12087
+      ['have_dbus_glib==1', {
12088
+        'defines': [
12089
+          'HAVE_DBUS_GLIB',
12090
+         ],
12091
+         'cflags': [
12092
+           '<!@(pkg-config --cflags dbus-glib-1)',
12093
+         ],
12094
+      }],
12095
+      ['rtc_relative_path==1', {
12096
+        'defines': ['EXPAT_RELATIVE_PATH',],
12097
+      }],
12098
+      ['os_posix==1', {
12099
+        'configurations': {
12100
+          'Debug_Base': {
12101
+            'defines': [
12102
+              # Chromium's build/common.gypi defines _DEBUG for all posix
12103
+              # _except_ for ios & mac.  The size of data types such as
12104
+              # pthread_mutex_t varies between release and debug builds
12105
+              # and is controlled via this flag.  Since we now share code
12106
+              # between base/base.gyp and build/common.gypi (this file),
12107
+              # both gyp(i) files, must consistently set this flag uniformly
12108
+              # or else we'll run in to hard-to-figure-out problems where
12109
+              # one compilation unit uses code from another but expects
12110
+              # differently laid out types.
12111
+              # For WebRTC, we want it there as well, because ASSERT and
12112
+              # friends trigger off of it.
12113
+              '_DEBUG',
12114
+            ],
12115
+          },
12116
+        },
12117
+      }],
12118
+      ['build_with_chromium==1', {
12119
+        'defines': [
12120
+          # Changes settings for Chromium build.
12121
+          # TODO(kjellander): Cleanup unused ones and move defines closer to the
12122
+          # source when webrtc:4256 is completed.
12123
+          'ENABLE_EXTERNAL_AUTH',
12124
+          'FEATURE_ENABLE_SSL',
12125
+          'HAVE_OPENSSL_SSL_H',
12126
+          'HAVE_SCTP',
12127
+          'HAVE_SRTP',
12128
+          'HAVE_WEBRTC_VIDEO',
12129
+          'HAVE_WEBRTC_VOICE',
12130
+          'LOGGING_INSIDE_WEBRTC',
12131
+          'NO_MAIN_THREAD_WRAPPING',
12132
+          'NO_SOUND_SYSTEM',
12133
+          'SRTP_RELATIVE_PATH',
12134
+          'SSL_USE_OPENSSL',
12135
+          'USE_WEBRTC_DEV_BRANCH',
12136
+          'WEBRTC_CHROMIUM_BUILD',
12137
+        ],
12138
+        'include_dirs': [
12139
+          # Include the top-level directory when building in Chrome, so we can
12140
+          # use full paths (e.g. headers inside testing/ or third_party/).
12141
+          '<(DEPTH)',
12142
+          # The overrides must be included before the WebRTC root as that's the
12143
+          # mechanism for selecting the override headers in Chromium.
12144
+          '../../webrtc_overrides',
12145
+          # The WebRTC root is needed to allow includes in the WebRTC code base
12146
+          # to be prefixed with webrtc/.
12147
+          '../..',
12148
+        ],
12149
+      }, {
12150
+         'includes': [
12151
+           # Rules for excluding e.g. foo_win.cc from the build on non-Windows.
12152
+           'filename_rules.gypi',
12153
+         ],
12154
+         # Include the top-level dir so the WebRTC code can use full paths.
12155
+        'include_dirs': [
12156
+          '../..',
12157
+        ],
12158
+        'conditions': [
12159
+          ['os_posix==1', {
12160
+            'conditions': [
12161
+              # -Wextra is currently disabled in Chromium's common.gypi. Enable
12162
+              # for targets that can handle it. For Android/arm64 right now
12163
+              # there will be an 'enumeral and non-enumeral type in conditional
12164
+              # expression' warning in android_tools/ndk_experimental's version
12165
+              # of stlport.
12166
+              # See: https://code.google.com/p/chromium/issues/detail?id=379699
12167
+              ['target_arch!="arm64" or OS!="android"', {
12168
+                'cflags': [
12169
+                  '-Wextra',
12170
+                  # We need to repeat some flags from Chromium's common.gypi
12171
+                  # here that get overridden by -Wextra.
12172
+                  '-Wno-unused-parameter',
12173
+                  '-Wno-missing-field-initializers',
12174
+                  '-Wno-strict-overflow',
12175
+                ],
12176
+              }],
12177
+            ],
12178
+            'cflags_cc': [
12179
+              '-Wnon-virtual-dtor',
12180
+              # This is enabled for clang; enable for gcc as well.
12181
+              '-Woverloaded-virtual',
12182
+            ],
12183
+          }],
12184
+          ['clang==1', {
12185
+            'cflags': [
12186
+              '-Wimplicit-fallthrough',
12187
+              '-Wthread-safety',
12188
+              '-Winconsistent-missing-override',
12189
+            ],
12190
+            'cflags_mozilla': [
12191
+              '-Wthread-safety',
12192
+            ],
12193
+          }],
12194
+        ],
12195
+      }],
12196
+      ['target_arch=="arm64"', {
12197
+        'defines': [
12198
+          'WEBRTC_ARCH_ARM64',
12199
+          'WEBRTC_HAS_NEON',
12200
+        ],
12201
+      }],
12202
+      ['target_arch=="arm"', {
12203
+        'build_with_neon%': 1,
12204
+        'defines': [
12205
+          'WEBRTC_ARCH_ARM',
12206
+        ],
12207
+        'conditions': [
12208
+          ['arm_version>=7', {
12209
+            'defines': ['WEBRTC_ARCH_ARM_V7',
12210
+                        'WEBRTC_BUILD_NEON_LIBS',
12211
+                        'WEBRTC_HAS_NEON'],
12212
+            'cflags_mozilla': ['-mfloat-abi=softfp',
12213
+                               '-mfpu=neon'],
12214
+          }],
12215
+        ],
12216
+      }],
12217
+      ['os_bsd==1', {
12218
+        'defines': [
12219
+          'WEBRTC_BSD',
12220
+        ],
12221
+      }],
12222
+      ['OS=="openbsd"', {
12223
+        'defines' : [
12224
+          'WEBRTC_AUDIO_SNDIO',
12225
+        ],
12226
+      }],
12227
+      # Mozilla: if we support Mozilla on MIPS, we'll need to mod the cflags entries here
12228
+      ['target_arch=="mipsel" and mips_arch_variant!="r6"', {
12229
+        'defines': [
12230
+          'MIPS32_LE',
12231
+        ],
12232
+        'conditions': [
12233
+          ['mips_float_abi=="hard"', {
12234
+            'defines': [
12235
+              'MIPS_FPU_LE',
12236
+            ],
12237
+          }],
12238
+          ['mips_arch_variant=="r2"', {
12239
+            'defines': [
12240
+              'MIPS32_R2_LE',
12241
+            ],
12242
+          }],
12243
+          ['mips_dsp_rev==1', {
12244
+            'defines': [
12245
+              'MIPS_DSP_R1_LE',
12246
+            ],
12247
+          }],
12248
+          ['mips_dsp_rev==2', {
12249
+            'defines': [
12250
+              'MIPS_DSP_R1_LE',
12251
+              'MIPS_DSP_R2_LE',
12252
+            ],
12253
+          }],
12254
+        ],
12255
+      }],
12256
+      ['coverage==1 and OS=="linux"', {
12257
+        'cflags': [ '-ftest-coverage',
12258
+                    '-fprofile-arcs' ],
12259
+        'ldflags': [ '--coverage' ],
12260
+        'link_settings': { 'libraries': [ '-lgcov' ] },
12261
+      }],
12262
+     ['webrtc_sanitize_coverage!=""', {
12263
+        'cflags': [ '-fsanitize-coverage=<(webrtc_sanitize_coverage)' ],
12264
+        'ldflags': [ '-fsanitize-coverage=<(webrtc_sanitize_coverage)' ],
12265
+     }],
12266
+     ['webrtc_sanitize_coverage!="" and OS=="mac"', {
12267
+        'xcode_settings': {
12268
+            'OTHER_CFLAGS': [
12269
+               '-fsanitize-coverage=func',
12270
+            ],
12271
+         },
12272
+      }],
12273
+      ['os_posix==1', {
12274
+        # For access to standard POSIXish features, use WEBRTC_POSIX instead of
12275
+        # a more specific macro.
12276
+        'defines': [
12277
+          'WEBRTC_POSIX',
12278
+        ],
12279
+      }],
12280
+      ['OS=="ios"', {
12281
+        'defines': [
12282
+          'WEBRTC_MAC',
12283
+          'WEBRTC_IOS',
12284
+        ],
12285
+      }],
12286
+      ['OS=="ios" and ios_override_visibility==1', {
12287
+        'xcode_settings': {
12288
+          'GCC_INLINES_ARE_PRIVATE_EXTERN': 'NO',
12289
+          'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
12290
+        }
12291
+      }],
12292
+      ['OS=="linux"', {
12293
+        'defines': [
12294
+          'WEBRTC_LINUX',
12295
+        ],
12296
+      }],
12297
+      ['OS=="mac"', {
12298
+        'defines': [
12299
+          'WEBRTC_MAC',
12300
+        ],
12301
+      }],
12302
+      ['OS=="win"', {
12303
+        'defines': [
12304
+          'WEBRTC_WIN',
12305
+        ],
12306
+        # TODO(andrew): enable all warnings when possible.
12307
+        # TODO(phoglund): get rid of 4373 supression when
12308
+        # http://code.google.com/p/webrtc/issues/detail?id=261 is solved.
12309
+        'msvs_disabled_warnings': [
12310
+          4373,  # legacy warning for ignoring const / volatile in signatures.
12311
+          4389,  # Signed/unsigned mismatch.
12312
+        ],
12313
+        # Re-enable some warnings that Chromium disables.
12314
+        'msvs_disabled_warnings!': [4189,],
12315
+      }],
12316
+      ['enable_android_opensl==1 and OS=="android"', {
12317
+        'defines': [
12318
+          'WEBRTC_ANDROID_OPENSLES',
12319
+        ],
12320
+      }],
12321
+      ['OS=="android"', {
12322
+        'defines': [
12323
+          'WEBRTC_LINUX',
12324
+          'WEBRTC_ANDROID',
12325
+         ],
12326
+         'conditions': [
12327
+           ['clang==0', {
12328
+             # The Android NDK doesn't provide optimized versions of these
12329
+             # functions. Ensure they are disabled for all compilers.
12330
+             'cflags': [
12331
+               '-fno-builtin-cos',
12332
+               '-fno-builtin-sin',
12333
+               '-fno-builtin-cosf',
12334
+               '-fno-builtin-sinf',
12335
+             ],
12336
+           }],
12337
+         ],
12338
+      }],
12339
+      ['chromeos==1', {
12340
+        'defines': [
12341
+          'CHROMEOS',
12342
+        ],
12343
+      }],
12344
+      ['os_bsd==1', {
12345
+        'defines': [
12346
+          'WEBRTC_BSD',
12347
+        ],
12348
+      }],
12349
+      ['include_internal_audio_device==1', {
12350
+        'defines': [
12351
+          'WEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE',
12352
+        ],
12353
+      }],
12354
+      ['libvpx_build_vp9==0', {
12355
+        'defines': [
12356
+          'RTC_DISABLE_VP9',
12357
+        ],
12358
+      }],
12359
+    ], # conditions
12360
+    'direct_dependent_settings': {
12361
+      'conditions': [
12362
+        ['build_with_mozilla==1', {
12363
+          'defines': [
12364
+            # Changes settings for Mozilla build.
12365
+            'WEBRTC_MOZILLA_BUILD',
12366
+           ],
12367
+        }],
12368
+        ['build_with_chromium==1', {
12369
+          'defines': [
12370
+            # Changes settings for Chromium build.
12371
+            # TODO(kjellander): Cleanup unused ones and move defines closer to
12372
+            # the source when webrtc:4256 is completed.
12373
+            'FEATURE_ENABLE_SSL',
12374
+            'FEATURE_ENABLE_VOICEMAIL',
12375
+            'EXPAT_RELATIVE_PATH',
12376
+            'GTEST_RELATIVE_PATH',
12377
+            'NO_MAIN_THREAD_WRAPPING',
12378
+            'NO_SOUND_SYSTEM',
12379
+            'WEBRTC_CHROMIUM_BUILD',
12380
+          ],
12381
+          'include_dirs': [
12382
+            # The overrides must be included first as that is the mechanism for
12383
+            # selecting the override headers in Chromium.
12384
+            '../../webrtc_overrides',
12385
+            '../..',
12386
+          ],
12387
+        }, {
12388
+          'include_dirs': [
12389
+            '../..',
12390
+          ],
12391
+        }],
12392
+        ['OS=="mac"', {
12393
+          'defines': [
12394
+            'WEBRTC_MAC',
12395
+          ],
12396
+        }],
12397
+        ['OS=="ios"', {
12398
+          'defines': [
12399
+            'WEBRTC_MAC',
12400
+            'WEBRTC_IOS',
12401
+          ],
12402
+        }],
12403
+        ['OS=="win"', {
12404
+          'defines': [
12405
+            'WEBRTC_WIN',
12406
+            '_CRT_SECURE_NO_WARNINGS',  # Suppress warnings about _vsnprinf
12407
+          ],
12408
+        }],
12409
+        ['OS=="linux"', {
12410
+          'defines': [
12411
+            'WEBRTC_LINUX',
12412
+          ],
12413
+        }],
12414
+        ['OS=="android"', {
12415
+          'defines': [
12416
+            'WEBRTC_LINUX',
12417
+            'WEBRTC_ANDROID',
12418
+           ],
12419
+        }],
12420
+        ['os_posix==1', {
12421
+          # For access to standard POSIXish features, use WEBRTC_POSIX instead
12422
+          # of a more specific macro.
12423
+          'defines': [
12424
+            'WEBRTC_POSIX',
12425
+          ],
12426
+        }],
12427
+        ['chromeos==1', {
12428
+          'defines': [
12429
+            'CHROMEOS',
12430
+          ],
12431
+        }],
12432
+        ['os_bsd==1', {
12433
+          'defines': [
12434
+            'WEBRTC_BSD',
12435
+          ],
12436
+        }],
12437
+      ],
12438
+    },
12439
+  }, # target_defaults
12440
+}
12441
diff --git media/webrtc/trunk/webrtc/build/filename_rules.gypi media/webrtc/trunk/webrtc/build/filename_rules.gypi
12442
new file mode 100644
12443
index 000000000000..93c9028a4d61
12444
--- /dev/null
12445
+++ media/webrtc/trunk/webrtc/build/filename_rules.gypi
12446
@@ -0,0 +1,107 @@
12447
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
12448
+#
12449
+# Use of this source code is governed by a BSD-style license
12450
+# that can be found in the LICENSE file in the root of the source
12451
+# tree. An additional intellectual property rights grant can be found
12452
+# in the file PATENTS.  All contributing project authors may
12453
+# be found in the AUTHORS file in the root of the source tree.
12454
+
12455
+# This is a copy of the deleted build/filename_includes.gypi that
12456
+# has now been dropped from Chromium.
12457
+{
12458
+  'target_conditions': [
12459
+    ['OS!="win" or >(nacl_untrusted_build)==1', {
12460
+      'sources/': [ ['exclude', '_win(_browsertest|_unittest|_test)?\\.(h|cc)$'],
12461
+                    ['exclude', '(^|/)win/'],
12462
+                    ['exclude', '(^|/)win_[^/]*\\.(h|cc)$'] ],
12463
+    }],
12464
+    ['OS!="mac" or >(nacl_untrusted_build)==1', {
12465
+      'sources/': [ ['exclude', '_(cocoa|mac|mach)(_unittest|_test)?\\.(h|cc|c|mm?)$'],
12466
+                    ['exclude', '(^|/)(cocoa|mac|mach)/'] ],
12467
+    }],
12468
+    ['OS!="ios" or >(nacl_untrusted_build)==1', {
12469
+      'sources/': [ ['exclude', '_ios(_unittest|_test)?\\.(h|cc|mm?)$'],
12470
+                    ['exclude', '(^|/)ios/'] ],
12471
+    }],
12472
+    ['(OS!="mac" and OS!="ios") or >(nacl_untrusted_build)==1', {
12473
+      'sources/': [ ['exclude', '\\.mm?$' ] ],
12474
+    }],
12475
+    # Do not exclude the linux files on *BSD since most of them can be
12476
+    # shared at this point.
12477
+    # In case a file is not needed, it is going to be excluded later on.
12478
+    # TODO(evan): the above is not correct; we shouldn't build _linux
12479
+    # files on non-linux.
12480
+    ['OS!="linux" and OS!="solaris" and <(os_bsd)!=1 or >(nacl_untrusted_build)==1', {
12481
+      'sources/': [
12482
+        ['exclude', '_linux(_unittest|_test)?\\.(h|cc)$'],
12483
+        ['exclude', '(^|/)linux/'],
12484
+      ],
12485
+    }],
12486
+    ['OS!="android" or _toolset=="host" or >(nacl_untrusted_build)==1', {
12487
+      'sources/': [
12488
+        ['exclude', '_android(_unittest|_test)?\\.(h|cc)$'],
12489
+        ['exclude', '(^|/)android/'],
12490
+      ],
12491
+    }],
12492
+    ['OS=="win" and >(nacl_untrusted_build)==0', {
12493
+      'sources/': [
12494
+        ['exclude', '_posix(_unittest|_test)?\\.(h|cc)$'],
12495
+        ['exclude', '(^|/)posix/'],
12496
+      ],
12497
+    }],
12498
+    ['<(chromeos)!=1 or >(nacl_untrusted_build)==1', {
12499
+      'sources/': [
12500
+        ['exclude', '_chromeos(_unittest|_test)?\\.(h|cc)$'],
12501
+        ['exclude', '(^|/)chromeos/'],
12502
+      ],
12503
+    }],
12504
+    ['>(nacl_untrusted_build)==0', {
12505
+      'sources/': [
12506
+        ['exclude', '_nacl(_unittest)?\\.(h|cc)$'],
12507
+      ],
12508
+    }],
12509
+    ['OS!="linux" and OS!="solaris" and <(os_bsd)!=1 or >(nacl_untrusted_build)==1', {
12510
+      'sources/': [
12511
+        ['exclude', '_xdg(_unittest)?\\.(h|cc)$'],
12512
+      ],
12513
+    }],
12514
+    ['<(use_x11)!=1 or >(nacl_untrusted_build)==1', {
12515
+      'sources/': [
12516
+        ['exclude', '_(x|x11)(_interactive_uitest|_unittest)?\\.(h|cc)$'],
12517
+        ['exclude', '(^|/)x11_[^/]*\\.(h|cc)$'],
12518
+        ['exclude', '(^|/)x11/'],
12519
+        ['exclude', '(^|/)x/'],
12520
+      ],
12521
+    }],
12522
+    ['<(toolkit_views)==0 or >(nacl_untrusted_build)==1', {
12523
+      'sources/': [ ['exclude', '_views(_browsertest|_unittest)?\\.(h|cc)$'] ]
12524
+    }],
12525
+    ['<(use_aura)==0 or >(nacl_untrusted_build)==1', {
12526
+      'sources/': [ ['exclude', '_aura(_browsertest|_unittest)?\\.(h|cc)$'],
12527
+                    ['exclude', '(^|/)aura/'],
12528
+                    ['exclude', '_ash(_browsertest|_unittest)?\\.(h|cc)$'],
12529
+                    ['exclude', '(^|/)ash/'],
12530
+      ]
12531
+    }],
12532
+    ['<(use_aura)==0 or <(use_x11)==0 or >(nacl_untrusted_build)==1', {
12533
+      'sources/': [ ['exclude', '_aurax11(_browsertest|_unittest)?\\.(h|cc)$'] ]
12534
+    }],
12535
+    ['<(use_aura)==0 or OS!="win" or >(nacl_untrusted_build)==1', {
12536
+      'sources/': [ ['exclude', '_aurawin\\.(h|cc)$'],
12537
+                    ['exclude', '_ashwin\\.(h|cc)$']
12538
+      ]
12539
+    }],
12540
+    ['<(use_aura)==0 or OS!="linux" or >(nacl_untrusted_build)==1', {
12541
+      'sources/': [ ['exclude', '_auralinux\\.(h|cc)$'] ]
12542
+    }],
12543
+    #TODO: use_ozone is undefined here
12544
+    #['<(use_ozone)==0 or >(nacl_untrusted_build)==1', {
12545
+    #  'sources/': [ ['exclude', '_ozone(_browsertest|_unittest)?\\.(h|cc)$'] ]
12546
+    #}],
12547
+    #TODO: use_pango is undefined here
12548
+    #['<(use_pango)==0', {
12549
+    #  'sources/': [ ['exclude', '(^|_)pango(_util|_browsertest|_unittest)?\\.(h|cc)$'], ],
12550
+    #}],
12551
+  ]
12552
+}
12553
+
12554
diff --git media/webrtc/trunk/webrtc/build/ios/merge_ios_libs.gyp media/webrtc/trunk/webrtc/build/ios/merge_ios_libs.gyp
12555
new file mode 100644
12556
index 000000000000..d28b6221db44
12557
--- /dev/null
12558
+++ media/webrtc/trunk/webrtc/build/ios/merge_ios_libs.gyp
12559
@@ -0,0 +1,26 @@
12560
+# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
12561
+#
12562
+# Use of this source code is governed by a BSD-style license
12563
+# that can be found in the LICENSE file in the root of the source
12564
+# tree. An additional intellectual property rights grant can be found
12565
+# in the file PATENTS.  All contributing project authors may
12566
+# be found in the AUTHORS file in the root of the source tree.
12567
+
12568
+{
12569
+  'includes': ['../common.gypi',],
12570
+  'conditions': [
12571
+    ['OS=="ios" or OS=="mac"', {
12572
+      'targets': [
12573
+        {
12574
+          'target_name': 'rtc_sdk_peerconnection_objc_no_op',
12575
+          'includes': [ 'objc_app.gypi' ],
12576
+          'type': 'executable',
12577
+          'dependencies': [
12578
+            '<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_peerconnection_objc',
12579
+          ],
12580
+          'sources': ['no_op.cc',],
12581
+        },
12582
+      ],
12583
+    }]
12584
+  ],
12585
+}
12586
diff --git media/webrtc/trunk/webrtc/build/ios/objc_app.gypi media/webrtc/trunk/webrtc/build/ios/objc_app.gypi
12587
new file mode 100644
12588
index 000000000000..85a10dd91563
12589
--- /dev/null
12590
+++ media/webrtc/trunk/webrtc/build/ios/objc_app.gypi
12591
@@ -0,0 +1,33 @@
12592
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
12593
+#
12594
+# Use of this source code is governed by a BSD-style license
12595
+# that can be found in the LICENSE file in the root of the source
12596
+# tree. An additional intellectual property rights grant can be found
12597
+# in the file PATENTS.  All contributing project authors may
12598
+# be found in the AUTHORS file in the root of the source tree.
12599
+
12600
+# Include this .gypi in an ObjC target's definition to allow it to be
12601
+# used as an iOS or OS/X application.
12602
+
12603
+{
12604
+  'variables': {
12605
+    'infoplist_file': './objc_app.plist',
12606
+  },
12607
+  'dependencies': [
12608
+    '<(webrtc_root)/system_wrappers/system_wrappers.gyp:field_trial_default',
12609
+    '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
12610
+  ],
12611
+  'mac_bundle': 1,
12612
+  'mac_bundle_resources': [
12613
+    '<(infoplist_file)',
12614
+  ],
12615
+  # The plist is listed above so that it appears in XCode's file list,
12616
+  # but we don't actually want to bundle it.
12617
+  'mac_bundle_resources!': [
12618
+    '<(infoplist_file)',
12619
+  ],
12620
+  'xcode_settings': {
12621
+    'CLANG_ENABLE_OBJC_ARC': 'YES',
12622
+    'INFOPLIST_FILE': '<(infoplist_file)',
12623
+  },
12624
+}
12625
diff --git media/webrtc/trunk/webrtc/build/isolate.gypi media/webrtc/trunk/webrtc/build/isolate.gypi
12626
new file mode 100644
12627
index 000000000000..2d4ea7786971
12628
--- /dev/null
12629
+++ media/webrtc/trunk/webrtc/build/isolate.gypi
12630
@@ -0,0 +1,142 @@
12631
+# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
12632
+#
12633
+# Use of this source code is governed by a BSD-style license
12634
+# that can be found in the LICENSE file in the root of the source
12635
+# tree. An additional intellectual property rights grant can be found
12636
+# in the file PATENTS.  All contributing project authors may
12637
+# be found in the AUTHORS file in the root of the source tree.
12638
+
12639
+# Copied from Chromium's src/build/isolate.gypi
12640
+#
12641
+# It was necessary to copy this file because the path to build/common.gypi is
12642
+# different for the standalone and Chromium builds. Gyp doesn't permit
12643
+# conditional inclusion or variable expansion in include paths.
12644
+# http://code.google.com/p/gyp/wiki/InputFormatReference#Including_Other_Files
12645
+#
12646
+# Local modifications:
12647
+# * Removed include of '../chrome/version.gypi'.
12648
+# * Removed passing of version_full variable created in version.gypi:
12649
+#   '--extra-variable', 'version_full=<(version_full)',
12650
+
12651
+# This file is meant to be included into a target to provide a rule
12652
+# to "build" .isolate files into a .isolated file.
12653
+#
12654
+# To use this, create a gyp target with the following form:
12655
+# 'conditions': [
12656
+#   ['test_isolation_mode != "noop"', {
12657
+#     'targets': [
12658
+#       {
12659
+#         'target_name': 'foo_test_run',
12660
+#         'type': 'none',
12661
+#         'dependencies': [
12662
+#           'foo_test',
12663
+#         ],
12664
+#         'includes': [
12665
+#           '../build/isolate.gypi',
12666
+#           'foo_test.isolate',
12667
+#         ],
12668
+#         'sources': [
12669
+#           'foo_test.isolate',
12670
+#         ],
12671
+#       },
12672
+#     ],
12673
+#   }],
12674
+# ],
12675
+#
12676
+# Note: foo_test.isolate is included and a source file. It is an inherent
12677
+# property of the .isolate format. This permits to define GYP variables but is
12678
+# a stricter format than GYP so isolate.py can read it.
12679
+#
12680
+# The generated .isolated file will be:
12681
+#   <(PRODUCT_DIR)/foo_test.isolated
12682
+#
12683
+# See http://dev.chromium.org/developers/testing/isolated-testing/for-swes
12684
+# for more information.
12685
+
12686
+{
12687
+  'rules': [
12688
+    {
12689
+      'rule_name': 'isolate',
12690
+      'extension': 'isolate',
12691
+      'inputs': [
12692
+        # Files that are known to be involved in this step.
12693
+        '<(DEPTH)/tools/isolate_driver.py',
12694
+        '<(DEPTH)/tools/swarming_client/isolate.py',
12695
+        '<(DEPTH)/tools/swarming_client/run_isolated.py',
12696
+      ],
12697
+      'outputs': [],
12698
+      'action': [
12699
+        'python',
12700
+        '<(DEPTH)/tools/isolate_driver.py',
12701
+        '<(test_isolation_mode)',
12702
+        '--isolated', '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated',
12703
+        '--isolate', '<(RULE_INPUT_PATH)',
12704
+
12705
+        # Variables should use the -V FOO=<(FOO) form so frequent values,
12706
+        # like '0' or '1', aren't stripped out by GYP. Run 'isolate.py help' for
12707
+        # more details.
12708
+
12709
+        # Path variables are used to replace file paths when loading a .isolate
12710
+        # file
12711
+        '--path-variable', 'DEPTH', '<(DEPTH)',
12712
+        '--path-variable', 'PRODUCT_DIR', '<(PRODUCT_DIR) ',
12713
+
12714
+        # Note: This list must match DefaultConfigVariables()
12715
+        # in build/android/pylib/utils/isolator.py
12716
+        '--config-variable', 'CONFIGURATION_NAME=<(CONFIGURATION_NAME)',
12717
+        '--config-variable', 'OS=<(OS)',
12718
+        '--config-variable', 'asan=<(asan)',
12719
+        '--config-variable', 'branding=<(branding)',
12720
+        '--config-variable', 'chromeos=<(chromeos)',
12721
+        '--config-variable', 'component=<(component)',
12722
+        '--config-variable', 'disable_nacl=<(disable_nacl)',
12723
+        '--config-variable', 'enable_pepper_cdms=<(enable_pepper_cdms)',
12724
+        '--config-variable', 'enable_plugins=<(enable_plugins)',
12725
+        '--config-variable', 'fastbuild=<(fastbuild)',
12726
+        '--config-variable', 'icu_use_data_file_flag=<(icu_use_data_file_flag)',
12727
+        # TODO(kbr): move this to chrome_tests.gypi:gles2_conform_tests_run
12728
+        # once support for user-defined config variables is added.
12729
+        '--config-variable',
12730
+          'internal_gles2_conform_tests=<(internal_gles2_conform_tests)',
12731
+        '--config-variable', 'kasko=<(kasko)',
12732
+        '--config-variable', 'lsan=<(lsan)',
12733
+        '--config-variable', 'msan=<(msan)',
12734
+        '--config-variable', 'target_arch=<(target_arch)',
12735
+        '--config-variable', 'tsan=<(tsan)',
12736
+        '--config-variable', 'use_custom_libcxx=<(use_custom_libcxx)',
12737
+        '--config-variable', 'use_instrumented_libraries=<(use_instrumented_libraries)',
12738
+        '--config-variable',
12739
+        'use_prebuilt_instrumented_libraries=<(use_prebuilt_instrumented_libraries)',
12740
+        '--config-variable', 'use_ozone=<(use_ozone)',
12741
+        '--config-variable', 'use_x11=<(use_x11)',
12742
+        '--config-variable', 'v8_use_external_startup_data=<(v8_use_external_startup_data)',
12743
+      ],
12744
+      'conditions': [
12745
+        # Note: When gyp merges lists, it appends them to the old value.
12746
+        ['OS=="mac"', {
12747
+          'action': [
12748
+            '--extra-variable', 'mac_product_name=<(mac_product_name)',
12749
+          ],
12750
+        }],
12751
+        ["test_isolation_mode == 'prepare'", {
12752
+          'outputs': [
12753
+            '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated.gen.json',
12754
+          ],
12755
+        }, {
12756
+          'outputs': [
12757
+            '<(PRODUCT_DIR)/<(RULE_INPUT_ROOT).isolated',
12758
+          ],
12759
+        }],
12760
+        ['OS=="win"', {
12761
+          'action': [
12762
+            '--config-variable', 'msvs_version=<(MSVS_VERSION)',
12763
+          ],
12764
+        }, {
12765
+          'action': [
12766
+            '--config-variable', 'msvs_version=0',
12767
+          ],
12768
+        }],
12769
+      ],
12770
+    },
12771
+  ],
12772
+}
12773
diff --git media/webrtc/trunk/webrtc/build/merge_libs.gyp media/webrtc/trunk/webrtc/build/merge_libs.gyp
12774
new file mode 100644
12775
index 000000000000..7e251748a09c
12776
--- /dev/null
12777
+++ media/webrtc/trunk/webrtc/build/merge_libs.gyp
12778
@@ -0,0 +1,53 @@
12779
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
12780
+#
12781
+# Use of this source code is governed by a BSD-style license
12782
+# that can be found in the LICENSE file in the root of the source
12783
+# tree. An additional intellectual property rights grant can be found
12784
+# in the file PATENTS.  All contributing project authors may
12785
+# be found in the AUTHORS file in the root of the source tree.
12786
+
12787
+{
12788
+  'includes': ['common.gypi',],
12789
+  'variables': {
12790
+    'merge_libs_dependencies': [
12791
+    ],
12792
+  },
12793
+  'targets': [
12794
+    {
12795
+      'target_name': 'no_op',
12796
+      'type': 'executable',
12797
+      'dependencies': [
12798
+        '<@(merge_libs_dependencies)',
12799
+        '../webrtc.gyp:webrtc',
12800
+        '../p2p/p2p.gyp:rtc_p2p',
12801
+      ],
12802
+      'sources': ['no_op.cc',],
12803
+    },
12804
+    {
12805
+      'target_name': 'merged_lib',
12806
+      'type': 'none',
12807
+      'dependencies': [
12808
+        'no_op',
12809
+      ],
12810
+      'actions': [
12811
+        {
12812
+          'variables': {
12813
+            'output_lib_name': 'webrtc_merged',
12814
+            'output_lib': '<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)<(output_lib_name)<(STATIC_LIB_SUFFIX)',
12815
+          },
12816
+          'action_name': 'merge_libs',
12817
+          'inputs': ['<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)no_op<(EXECUTABLE_SUFFIX)'],
12818
+          'outputs': ['<(output_lib)'],
12819
+          'action': ['python',
12820
+                     'merge_libs.py',
12821
+                     '<(PRODUCT_DIR)',
12822
+                     '<(output_lib)',],
12823
+        },
12824
+      ],
12825
+    },
12826
+  ],
12827
+#      }],
12828
+#    ],
12829
+#      }],
12830
+#    ],
12831
+}
12832
diff --git media/webrtc/trunk/webrtc/build/merge_libs_voice.gyp media/webrtc/trunk/webrtc/build/merge_libs_voice.gyp
12833
new file mode 100644
12834
index 000000000000..10e305900ab2
12835
--- /dev/null
12836
+++ media/webrtc/trunk/webrtc/build/merge_libs_voice.gyp
12837
@@ -0,0 +1,48 @@
12838
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
12839
+#
12840
+# Use of this source code is governed by a BSD-style license
12841
+# that can be found in the LICENSE file in the root of the source
12842
+# tree. An additional intellectual property rights grant can be found
12843
+# in the file PATENTS.  All contributing project authors may
12844
+# be found in the AUTHORS file in the root of the source tree.
12845
+
12846
+{
12847
+  'includes': ['common.gypi',],
12848
+  'variables': {
12849
+    'merge_libs_dependencies': [
12850
+    ],
12851
+  },
12852
+  'targets': [
12853
+    {
12854
+      'target_name': 'no_op_voice',
12855
+      'type': 'executable',
12856
+      'dependencies': [
12857
+        '<@(merge_libs_dependencies)',
12858
+        '../voice_engine/voice_engine.gyp:voice_engine'
12859
+      ],
12860
+      'sources': ['no_op.cc',],
12861
+    },
12862
+    {
12863
+      'target_name': 'merged_lib_voice',
12864
+      'type': 'none',
12865
+      'dependencies': [
12866
+        'no_op_voice',
12867
+      ],
12868
+      'actions': [
12869
+        {
12870
+          'variables': {
12871
+            'output_lib_name': 'rtc_voice_merged',
12872
+            'output_lib': '<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)<(output_lib_name)<(STATIC_LIB_SUFFIX)',
12873
+          },
12874
+          'action_name': 'merge_libs_voice',
12875
+          'inputs': ['<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)no_op_voice<(EXECUTABLE_SUFFIX)'],
12876
+          'outputs': ['<(output_lib)'],
12877
+          'action': ['python',
12878
+                     'merge_libs.py',
12879
+                     '<(PRODUCT_DIR)',
12880
+                     '<(output_lib)',],
12881
+        },
12882
+      ],
12883
+    },
12884
+  ],
12885
+}
12886
diff --git media/webrtc/trunk/webrtc/build/merge_voice_libs.gyp media/webrtc/trunk/webrtc/build/merge_voice_libs.gyp
12887
new file mode 100644
12888
index 000000000000..5e72d43be070
12889
--- /dev/null
12890
+++ media/webrtc/trunk/webrtc/build/merge_voice_libs.gyp
12891
@@ -0,0 +1,43 @@
12892
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
12893
+#
12894
+# Use of this source code is governed by a BSD-style license
12895
+# that can be found in the LICENSE file in the root of the source
12896
+# tree. An additional intellectual property rights grant can be found
12897
+# in the file PATENTS.  All contributing project authors may
12898
+# be found in the AUTHORS file in the root of the source tree.
12899
+
12900
+{
12901
+  'includes': [ 'common.gypi', ],
12902
+  'targets': [
12903
+    {
12904
+      'target_name': 'no_op',
12905
+      'type': 'executable',
12906
+      'dependencies': [
12907
+        '../voice_engine/voice_engine.gyp:voice_engine',
12908
+      ],
12909
+      'sources': [ 'no_op.cc', ],
12910
+    },
12911
+    {
12912
+      'target_name': 'merge_voice_libs',
12913
+      'type': 'none',
12914
+      'dependencies': [
12915
+        'no_op',
12916
+      ],
12917
+      'actions': [
12918
+        {
12919
+          'variables': {
12920
+            'output_lib_name': 'webrtc_voice',
12921
+            'output_lib': '<(PRODUCT_DIR)/<(STATIC_LIB_PREFIX)<(output_lib_name)<(STATIC_LIB_SUFFIX)',
12922
+          },
12923
+          'action_name': 'merge_libs',
12924
+          'inputs': ['<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)no_op<(EXECUTABLE_SUFFIX)'],
12925
+          'outputs': ['<(output_lib)'],
12926
+          'action': ['python',
12927
+                     'merge_libs.py',
12928
+                     '<(PRODUCT_DIR)',
12929
+                     '<(output_lib)',],
12930
+        },
12931
+      ],
12932
+    },
12933
+  ],
12934
+}
12935
diff --git media/webrtc/trunk/webrtc/build/objc_common.gypi media/webrtc/trunk/webrtc/build/objc_common.gypi
12936
new file mode 100644
12937
index 000000000000..ff908cfe6295
12938
--- /dev/null
12939
+++ media/webrtc/trunk/webrtc/build/objc_common.gypi
12940
@@ -0,0 +1,21 @@
12941
+# Copyright 2016 The WebRTC project authors. All Rights Reserved.
12942
+#
12943
+# Use of this source code is governed by a BSD-style license
12944
+# that can be found in the LICENSE file in the root of the source
12945
+# tree. An additional intellectual property rights grant can be found
12946
+# in the file PATENTS.  All contributing project authors may
12947
+# be found in the AUTHORS file in the root of the source tree.
12948
+
12949
+# ObjC target common prefix header.
12950
+
12951
+{
12952
+  'variables': {
12953
+    'objc_prefix_file': '../sdk/objc/WebRTC-Prefix.pch',
12954
+  },
12955
+  'xcode_settings': {
12956
+    'CLANG_ENABLE_OBJC_ARC': 'YES',
12957
+    'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
12958
+    'GCC_PREFIX_HEADER': '<(objc_prefix_file)',
12959
+    'GCC_PRECOMPILE_PREFIX_HEADER': 'YES'
12960
+  },
12961
+}
12962
diff --git media/webrtc/trunk/webrtc/build/protoc.gypi media/webrtc/trunk/webrtc/build/protoc.gypi
12963
new file mode 100644
12964
index 000000000000..df209d47de8d
12965
--- /dev/null
12966
+++ media/webrtc/trunk/webrtc/build/protoc.gypi
12967
@@ -0,0 +1,136 @@
12968
+# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
12969
+#
12970
+# Use of this source code is governed by a BSD-style license
12971
+# that can be found in the LICENSE file in the root of the source
12972
+# tree. An additional intellectual property rights grant can be found
12973
+# in the file PATENTS.  All contributing project authors may
12974
+# be found in the AUTHORS file in the root of the source tree.
12975
+
12976
+# Copied from Chromium's src/build/protoc.gypi
12977
+#
12978
+# It was necessary to copy this file to WebRTC, because the path to
12979
+# build/common.gypi is different for the standalone and Chromium builds. Gyp
12980
+# doesn't permit conditional inclusion or variable expansion in include paths.
12981
+# http://code.google.com/p/gyp/wiki/InputFormatReference#Including_Other_Files
12982
+#
12983
+# Local changes:
12984
+# * Removed <(DEPTH) from include_dir due to difficulties with generated
12985
+#   downstream code.
12986
+
12987
+
12988
+# This file is meant to be included into a target to provide a rule
12989
+# to invoke protoc in a consistent manner. For Java-targets, see
12990
+# protoc_java.gypi.
12991
+#
12992
+# To use this, create a gyp target with the following form:
12993
+# {
12994
+#   'target_name': 'my_proto_lib',
12995
+#   'type': 'static_library',
12996
+#   'sources': [
12997
+#     'foo.proto',
12998
+#     'bar.proto',
12999
+#   ],
13000
+#   'variables': {
13001
+#     # Optional, see below: 'proto_in_dir': '.'
13002
+#     'proto_out_dir': 'dir/for/my_proto_lib'
13003
+#   },
13004
+#   'includes': ['path/to/this/gypi/file'],
13005
+# }
13006
+# If necessary, you may add normal .cc files to the sources list or other gyp
13007
+# dependencies.  The proto headers are guaranteed to be generated before any
13008
+# source files, even within this target, are compiled.
13009
+#
13010
+# The 'proto_in_dir' variable must be the relative path to the
13011
+# directory containing the .proto files.  If left out, it defaults to '.'.
13012
+#
13013
+# The 'proto_out_dir' variable specifies the path suffix that output
13014
+# files are generated under.  Targets that gyp-depend on my_proto_lib
13015
+# will be able to include the resulting proto headers with an include
13016
+# like:
13017
+#   #include "dir/for/my_proto_lib/foo.pb.h"
13018
+#
13019
+# If you need to add an EXPORT macro to a protobuf's c++ header, set the
13020
+# 'cc_generator_options' variable with the value: 'dllexport_decl=FOO_EXPORT:'
13021
+# e.g. 'dllexport_decl=BASE_EXPORT:'
13022
+#
13023
+# It is likely you also need to #include a file for the above EXPORT macro to
13024
+# work. You can do so with the 'cc_include' variable.
13025
+# e.g. 'base/base_export.h'
13026
+#
13027
+# Implementation notes:
13028
+# A proto_out_dir of foo/bar produces
13029
+#   <(SHARED_INTERMEDIATE_DIR)/protoc_out/foo/bar/{file1,file2}.pb.{cc,h}
13030
+#   <(SHARED_INTERMEDIATE_DIR)/pyproto/foo/bar/{file1,file2}_pb2.py
13031
+
13032
+{
13033
+  'variables': {
13034
+    'protoc_wrapper': '<(DEPTH)/tools/protoc_wrapper/protoc_wrapper.py',
13035
+    'cc_dir': '<(SHARED_INTERMEDIATE_DIR)/protoc_out/<(proto_out_dir)',
13036
+    'py_dir': '<(PRODUCT_DIR)/pyproto/<(proto_out_dir)',
13037
+    'cc_generator_options%': '',
13038
+    'cc_include%': '',
13039
+    'proto_in_dir%': '.',
13040
+    'conditions': [
13041
+      ['use_system_protobuf==0', {
13042
+        'protoc': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)protoc<(EXECUTABLE_SUFFIX)',
13043
+      }, { # use_system_protobuf==1
13044
+        'protoc': '<!(which protoc)',
13045
+      }],
13046
+    ],
13047
+  },
13048
+  'rules': [
13049
+    {
13050
+      'rule_name': 'genproto',
13051
+      'extension': 'proto',
13052
+      'inputs': [
13053
+        '<(protoc_wrapper)',
13054
+        '<(protoc)',
13055
+      ],
13056
+      'outputs': [
13057
+        '<(py_dir)/<(RULE_INPUT_ROOT)_pb2.py',
13058
+        '<(cc_dir)/<(RULE_INPUT_ROOT).pb.cc',
13059
+        '<(cc_dir)/<(RULE_INPUT_ROOT).pb.h',
13060
+      ],
13061
+      'action': [
13062
+        'python',
13063
+        '<(protoc_wrapper)',
13064
+        '--protoc',
13065
+        '<(protoc)',
13066
+        # Using the --arg val form (instead of --arg=val) allows gyp's msvs rule
13067
+        # generation to correct 'val' which is a path.
13068
+        '--proto-in-dir','<(proto_in_dir)',
13069
+        # Naively you'd use <(RULE_INPUT_PATH) here, but protoc requires
13070
+        # --proto_path is a strict prefix of the path given as an argument.
13071
+        '--cc-out-dir', '<(cc_generator_options)<(cc_dir)',
13072
+        '--py-out-dir', '<(py_dir)',
13073
+        '<(RULE_INPUT_ROOT)<(RULE_INPUT_EXT)',
13074
+      ],
13075
+      'message': 'Generating C++ and Python code from <(RULE_INPUT_PATH)',
13076
+      'process_outputs_as_sources': 1,
13077
+    },
13078
+  ],
13079
+  'include_dirs': [
13080
+    '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
13081
+  ],
13082
+  'direct_dependent_settings': {
13083
+    'include_dirs': [
13084
+      '<(SHARED_INTERMEDIATE_DIR)/protoc_out',
13085
+    ]
13086
+  },
13087
+  # This target exports a hard dependency because it generates header
13088
+  # files.
13089
+  'hard_dependency': 1,
13090
+  'conditions': [
13091
+    ['build_protobuf==1', {
13092
+      'dependencies': [
13093
+        '<(DEPTH)/third_party/protobuf/protobuf.gyp:protoc#host',
13094
+        '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
13095
+      ],
13096
+      'export_dependent_settings': [
13097
+        # The generated headers reference headers within protobuf_lite,
13098
+        # so dependencies must be able to find those headers too.
13099
+        '<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
13100
+      ],
13101
+    }],
13102
+  ],
13103
+}
13104
diff --git media/webrtc/trunk/webrtc/build/webrtc.gni media/webrtc/trunk/webrtc/build/webrtc.gni
13105
index 1fc87dd30dab..8a460f5d7ecc 100644
13106
--- media/webrtc/trunk/webrtc/build/webrtc.gni
13107
+++ media/webrtc/trunk/webrtc/build/webrtc.gni
13108
@@ -11,10 +11,7 @@ import("//build/config/features.gni")
13109
 import("//build/config/mips.gni")
13110
 import("//build/config/sanitizers/sanitizers.gni")
13111
 import("//build_overrides/build.gni")
13112
-
13113
-if (!build_with_mozilla) {
13114
-  import("//testing/test.gni")
13115
-}
13116
+import("//testing/test.gni")
13117
 
13118
 declare_args() {
13119
   # Disable this to avoid building the Opus audio codec.
13120
@@ -38,7 +35,7 @@ declare_args() {
13121
   rtc_prefer_fixed_point = false
13122
 
13123
   # Enables the use of protocol buffers for debug recordings.
13124
-  rtc_enable_protobuf = !build_with_mozilla
13125
+  rtc_enable_protobuf = true
13126
 
13127
   # Disable the code for the intelligibility enhancer by default.
13128
   rtc_enable_intelligibility_enhancer = false
13129
@@ -49,26 +46,29 @@ declare_args() {
13130
 
13131
   # Selects whether debug dumps for the audio processing module
13132
   # should be generated.
13133
-  apm_debug_dump = true
13134
+  apm_debug_dump = false
13135
 
13136
   # Set this to true to enable BWE test logging.
13137
   rtc_enable_bwe_test_logging = false
13138
 
13139
   # Set this to disable building with support for SCTP data channels.
13140
-  rtc_enable_sctp = !build_with_mozilla
13141
+  rtc_enable_sctp = true
13142
 
13143
   # Disable these to not build components which can be externally provided.
13144
-  rtc_build_expat = !build_with_mozilla
13145
-  rtc_build_json = !build_with_mozilla
13146
-  rtc_build_libjpeg = !build_with_mozilla
13147
-  rtc_build_libsrtp = !build_with_mozilla
13148
-  rtc_build_libvpx = !build_with_mozilla
13149
+  rtc_build_expat = true
13150
+  rtc_build_json = true
13151
+  rtc_build_libjpeg = true
13152
+  rtc_build_libsrtp = true
13153
+  rtc_build_libvpx = true
13154
   rtc_libvpx_build_vp9 = true
13155
-  rtc_build_libyuv = !build_with_mozilla
13156
-  rtc_build_openmax_dl = !build_with_mozilla
13157
-  rtc_build_opus = !build_with_mozilla
13158
-  rtc_build_ssl = !build_with_mozilla
13159
-  rtc_build_usrsctp = !build_with_mozilla
13160
+  rtc_build_libyuv = true
13161
+  rtc_build_openmax_dl = true
13162
+  rtc_build_opus = true
13163
+  rtc_build_ssl = true
13164
+  rtc_build_usrsctp = true
13165
+
13166
+  # Enable to use the Mozilla internal settings.
13167
+  build_with_mozilla = false
13168
 
13169
   rtc_enable_android_opensl = false
13170
 
13171
@@ -90,7 +90,7 @@ declare_args() {
13172
     rtc_build_libevent = false
13173
   } else {
13174
     rtc_enable_libevent = true
13175
-    rtc_build_libevent = !build_with_mozilla
13176
+    rtc_build_libevent = true
13177
   }
13178
 
13179
   if (current_cpu == "arm" || current_cpu == "arm64") {
13180
@@ -104,10 +104,6 @@ declare_args() {
13181
     rtc_use_openmax_dl = false
13182
   }
13183
 
13184
-  if (build_with_mozilla) {
13185
-    rtc_use_openmax_dl = false
13186
-  }
13187
-
13188
   # Determines whether NEON code will be built.
13189
   rtc_build_with_neon =
13190
       (current_cpu == "arm" && arm_use_neon) || current_cpu == "arm64"
13191
@@ -142,7 +138,7 @@ declare_args() {
13192
 
13193
   # Build sources requiring GTK. NOTICE: This is not present in Chrome OS
13194
   # build environments, even if available for Chromium builds.
13195
-  rtc_use_gtk = !build_with_chromium && !build_with_mozilla
13196
+  rtc_use_gtk = !build_with_chromium
13197
 }
13198
 
13199
 # A second declare_args block, so that declarations within it can
13200
@@ -152,7 +148,7 @@ declare_args() {
13201
   # Include the iLBC audio codec?
13202
   rtc_include_ilbc = !(build_with_chromium || build_with_mozilla)
13203
 
13204
-  rtc_restrict_logging = build_with_chromium || build_with_mozilla
13205
+  rtc_restrict_logging = build_with_chromium
13206
 
13207
   # Excluded in Chromium since its prerequisites don't require Pulse Audio.
13208
   rtc_include_pulse_audio = !build_with_chromium
13209
@@ -162,19 +158,14 @@ declare_args() {
13210
   rtc_include_internal_audio_device = !build_with_chromium
13211
 
13212
   # Include tests in standalone checkout.
13213
-  rtc_include_tests = !build_with_chromium && !build_with_mozilla
13214
+  rtc_include_tests = !build_with_chromium
13215
 }
13216
 
13217
 # Make it possible to provide custom locations for some libraries (move these
13218
 # up into declare_args should we need to actually use them for the GN build).
13219
-if (build_with_mozilla) {
13220
-  rtc_libevent_dir = "/ipc/chromium/src/third_party/libevent"
13221
-  rtc_libyuv_dir = "/media/libyuv/libyuv"
13222
-} else {
13223
-  rtc_libvpx_dir = "//third_party/libvpx"
13224
-  rtc_libyuv_dir = "//third_party/libyuv"
13225
-  rtc_opus_dir = "//third_party/opus"
13226
-}
13227
+rtc_libvpx_dir = "//third_party/libvpx"
13228
+rtc_libyuv_dir = "//third_party/libyuv"
13229
+rtc_opus_dir = "//third_party/opus"
13230
 
13231
 ###############################################################################
13232
 # Templates
13233
diff --git media/webrtc/trunk/webrtc/call/BUILD.gn media/webrtc/trunk/webrtc/call/BUILD.gn
13234
index 23704ee0a8cc..195c37f614b8 100644
13235
--- media/webrtc/trunk/webrtc/call/BUILD.gn
13236
+++ media/webrtc/trunk/webrtc/call/BUILD.gn
13237
@@ -11,21 +11,12 @@ import("../build/webrtc.gni")
13238
 rtc_source_set("call_interfaces") {
13239
   sources = [
13240
     "audio_receive_stream.h",
13241
+    "audio_send_stream.cc",
13242
     "audio_send_stream.h",
13243
     "audio_state.h",
13244
     "call.h",
13245
     "flexfec_receive_stream.h",
13246
   ]
13247
-
13248
-  if (!build_with_mozilla) {
13249
-    sources += [
13250
-      "audio_send_stream.cc",
13251
-    ]
13252
-  } else {
13253
-    sources += [
13254
-      "audio_send_stream_call.cc",
13255
-    ]
13256
-  }
13257
 }
13258
 
13259
 rtc_static_library("call") {
13260
diff --git media/webrtc/trunk/webrtc/call/webrtc_call.gypi media/webrtc/trunk/webrtc/call/webrtc_call.gypi
13261
new file mode 100644
13262
index 000000000000..a60c66b54dfd
13263
--- /dev/null
13264
+++ media/webrtc/trunk/webrtc/call/webrtc_call.gypi
13265
@@ -0,0 +1,27 @@
13266
+# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
13267
+#
13268
+# Use of this source code is governed by a BSD-style license
13269
+# that can be found in the LICENSE file in the root of the source
13270
+# tree. An additional intellectual property rights grant can be found
13271
+# in the file PATENTS.  All contributing project authors may
13272
+# be found in the AUTHORS file in the root of the source tree.
13273
+{
13274
+  'variables': {
13275
+    'webrtc_call_dependencies': [
13276
+      '<(webrtc_root)/common.gyp:webrtc_common',
13277
+      '<(webrtc_root)/modules/modules.gyp:congestion_controller',
13278
+      '<(webrtc_root)/modules/modules.gyp:rtp_rtcp',
13279
+      '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
13280
+      '<(webrtc_root)/webrtc.gyp:rtc_event_log_impl',
13281
+    ],
13282
+    'webrtc_call_sources': [
13283
+      'call/audio_receive_stream.h',
13284
+      'call/audio_send_stream_call.cc',
13285
+      'call/bitrate_allocator.cc',
13286
+      'call/call.h',
13287
+      'call/call.cc',
13288
+      'call/flexfec_receive_stream.h',
13289
+      'call/flexfec_receive_stream_impl.cc',
13290
+    ],
13291
+  },
13292
+}
13293
diff --git media/webrtc/trunk/webrtc/common.gyp media/webrtc/trunk/webrtc/common.gyp
13294
new file mode 100644
13295
index 000000000000..3b5fe902dd99
13296
--- /dev/null
13297
+++ media/webrtc/trunk/webrtc/common.gyp
13298
@@ -0,0 +1,24 @@
13299
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
13300
+#
13301
+# Use of this source code is governed by a BSD-style license
13302
+# that can be found in the LICENSE file in the root of the source
13303
+# tree. An additional intellectual property rights grant can be found
13304
+# in the file PATENTS.  All contributing project authors may
13305
+# be found in the AUTHORS file in the root of the source tree.
13306
+{
13307
+  'includes': ['build/common.gypi'],
13308
+  'targets': [
13309
+    {
13310
+      'target_name': 'webrtc_common',
13311
+      'type': 'static_library',
13312
+      'sources': [
13313
+        'common_types.cc',
13314
+        'common_types.h',
13315
+        'config.h',
13316
+        'config.cc',
13317
+        'engine_configurations.h',
13318
+        'typedefs.h',
13319
+      ],
13320
+    },
13321
+  ],
13322
+}
13323
diff --git media/webrtc/trunk/webrtc/common_audio/common_audio.gyp media/webrtc/trunk/webrtc/common_audio/common_audio.gyp
13324
new file mode 100644
13325
index 000000000000..5bfc48f8ad45
13326
--- /dev/null
13327
+++ media/webrtc/trunk/webrtc/common_audio/common_audio.gyp
13328
@@ -0,0 +1,235 @@
13329
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
13330
+#
13331
+# Use of this source code is governed by a BSD-style license
13332
+# that can be found in the LICENSE file in the root of the source
13333
+# tree. An additional intellectual property rights grant can be found
13334
+# in the file PATENTS.  All contributing project authors may
13335
+# be found in the AUTHORS file in the root of the source tree.
13336
+
13337
+{
13338
+  'includes': [
13339
+    '../build/common.gypi',
13340
+  ],
13341
+  'targets': [
13342
+    {
13343
+      'target_name': 'common_audio',
13344
+      'type': 'static_library',
13345
+      'dependencies': [
13346
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
13347
+      ],
13348
+      'include_dirs': [
13349
+        'resampler/include',
13350
+        'signal_processing/include',
13351
+      ],
13352
+      'direct_dependent_settings': {
13353
+        'include_dirs': [
13354
+          'resampler/include',
13355
+          'signal_processing/include',
13356
+          'vad/include',
13357
+        ],
13358
+      },
13359
+      'sources': [
13360
+        'audio_converter.cc',
13361
+        'audio_converter.h',
13362
+        'audio_ring_buffer.cc',
13363
+        'audio_ring_buffer.h',
13364
+        'audio_util.cc',
13365
+        'blocker.cc',
13366
+        'blocker.h',
13367
+        'channel_buffer.cc',
13368
+        'channel_buffer.h',
13369
+        'fft4g.c',
13370
+        'fft4g.h',
13371
+        'fir_filter.cc',
13372
+        'fir_filter.h',
13373
+        'fir_filter_neon.h',
13374
+        'fir_filter_sse.h',
13375
+        'include/audio_util.h',
13376
+        'lapped_transform.cc',
13377
+        'lapped_transform.h',
13378
+        'real_fourier.cc',
13379
+        'real_fourier.h',
13380
+        'real_fourier_ooura.cc',
13381
+        'real_fourier_ooura.h',
13382
+        'resampler/include/push_resampler.h',
13383
+        'resampler/include/resampler.h',
13384
+        'resampler/push_resampler.cc',
13385
+        'resampler/push_sinc_resampler.cc',
13386
+        'resampler/push_sinc_resampler.h',
13387
+        'resampler/resampler.cc',
13388
+        'resampler/sinc_resampler.cc',
13389
+        'resampler/sinc_resampler.h',
13390
+        'ring_buffer.c',
13391
+        'ring_buffer.h',
13392
+        'signal_processing/include/real_fft.h',
13393
+        'signal_processing/include/signal_processing_library.h',
13394
+        'signal_processing/include/spl_inl.h',
13395
+        'signal_processing/auto_corr_to_refl_coef.c',
13396
+        'signal_processing/auto_correlation.c',
13397
+        'signal_processing/complex_fft.c',
13398
+        'signal_processing/complex_fft_tables.h',
13399
+        'signal_processing/complex_bit_reverse.c',
13400
+        'signal_processing/copy_set_operations.c',
13401
+        'signal_processing/cross_correlation.c',
13402
+        'signal_processing/division_operations.c',
13403
+        'signal_processing/dot_product_with_scale.c',
13404
+        'signal_processing/downsample_fast.c',
13405
+        'signal_processing/energy.c',
13406
+        'signal_processing/filter_ar.c',
13407
+        'signal_processing/filter_ar_fast_q12.c',
13408
+        'signal_processing/filter_ma_fast_q12.c',
13409
+        'signal_processing/get_hanning_window.c',
13410
+        'signal_processing/get_scaling_square.c',
13411
+        'signal_processing/ilbc_specific_functions.c',
13412
+        'signal_processing/levinson_durbin.c',
13413
+        'signal_processing/lpc_to_refl_coef.c',
13414
+        'signal_processing/min_max_operations.c',
13415
+        'signal_processing/randomization_functions.c',
13416
+        'signal_processing/refl_coef_to_lpc.c',
13417
+        'signal_processing/real_fft.c',
13418
+        'signal_processing/resample.c',
13419
+        'signal_processing/resample_48khz.c',
13420
+        'signal_processing/resample_by_2.c',
13421
+        'signal_processing/resample_by_2_internal.c',
13422
+        'signal_processing/resample_by_2_internal.h',
13423
+        'signal_processing/resample_fractional.c',
13424
+        'signal_processing/spl_init.c',
13425
+        'signal_processing/spl_inl.c',
13426
+        'signal_processing/spl_sqrt.c',
13427
+        'signal_processing/spl_sqrt_floor.c',
13428
+        'signal_processing/splitting_filter.c',
13429
+        'signal_processing/sqrt_of_one_minus_x_squared.c',
13430
+        'signal_processing/vector_scaling_operations.c',
13431
+        'smoothing_filter.cc',
13432
+        'smoothing_filter.h',
13433
+        'sparse_fir_filter.cc',
13434
+        'sparse_fir_filter.h',
13435
+        'vad/include/vad.h',
13436
+        'vad/vad.cc',
13437
+        'vad/webrtc_vad.c',
13438
+        'vad/vad_core.c',
13439
+        'vad/vad_core.h',
13440
+        'vad/vad_filterbank.c',
13441
+        'vad/vad_filterbank.h',
13442
+        'vad/vad_gmm.c',
13443
+        'vad/vad_gmm.h',
13444
+        'vad/vad_sp.c',
13445
+        'vad/vad_sp.h',
13446
+        'wav_header.cc',
13447
+        'wav_header.h',
13448
+        'wav_file.cc',
13449
+        'wav_file.h',
13450
+        'window_generator.cc',
13451
+        'window_generator.h',
13452
+      ],
13453
+      'conditions': [
13454
+        #TODO: not defined
13455
+        #['rtc_use_openmax_dl==1', {
13456
+        #  'sources': [
13457
+        #    'real_fourier_openmax.cc',
13458
+        #    'real_fourier_openmax.h',
13459
+        #  ],
13460
+        #  'defines': ['RTC_USE_OPENMAX_DL',],
13461
+        #  'conditions': [
13462
+        #    ['build_openmax_dl==1', {
13463
+        #      'dependencies': ['<(DEPTH)/third_party/openmax_dl/dl/dl.gyp:openmax_dl',],
13464
+        #    }],
13465
+        #  ],
13466
+        #}],
13467
+        ['target_arch=="ia32" or target_arch=="x64"', {
13468
+          'dependencies': ['common_audio_sse2',],
13469
+        }],
13470
+        ['build_with_neon==1', {
13471
+          'dependencies': ['common_audio_neon',],
13472
+        }],
13473
+        ['target_arch=="arm"', {
13474
+          'sources': [
13475
+            'signal_processing/complex_bit_reverse_arm.S',
13476
+            'signal_processing/spl_sqrt_floor_arm.S',
13477
+          ],
13478
+          'sources!': [
13479
+            'signal_processing/complex_bit_reverse.c',
13480
+            'signal_processing/spl_sqrt_floor.c',
13481
+          ],
13482
+          'conditions': [
13483
+            ['arm_version>=7', {
13484
+              'sources': [
13485
+                'signal_processing/filter_ar_fast_q12_armv7.S',
13486
+              ],
13487
+              'sources!': [
13488
+                'signal_processing/filter_ar_fast_q12.c',
13489
+              ],
13490
+            }],
13491
+          ],  # conditions
13492
+        }],
13493
+        ['target_arch=="mipsel" and mips_arch_variant!="r6"', {
13494
+          'sources': [
13495
+            'signal_processing/include/spl_inl_mips.h',
13496
+            'signal_processing/complex_bit_reverse_mips.c',
13497
+            'signal_processing/complex_fft_mips.c',
13498
+            'signal_processing/cross_correlation_mips.c',
13499
+            'signal_processing/downsample_fast_mips.c',
13500
+            'signal_processing/filter_ar_fast_q12_mips.c',
13501
+            'signal_processing/min_max_operations_mips.c',
13502
+            'signal_processing/resample_by_2_mips.c',
13503
+            'signal_processing/spl_sqrt_floor_mips.c',
13504
+          ],
13505
+          'sources!': [
13506
+            'signal_processing/complex_bit_reverse.c',
13507
+            'signal_processing/complex_fft.c',
13508
+            'signal_processing/filter_ar_fast_q12.c',
13509
+            'signal_processing/spl_sqrt_floor.c',
13510
+          ],
13511
+          'conditions': [
13512
+            ['mips_dsp_rev>0', {
13513
+              'sources': [
13514
+                'signal_processing/vector_scaling_operations_mips.c',
13515
+              ],
13516
+            }],
13517
+          ],
13518
+        }],
13519
+      ],  # conditions
13520
+      # Ignore warning on shift operator promotion.
13521
+      'msvs_disabled_warnings': [ 4334, ],
13522
+    },
13523
+  ],  # targets
13524
+  'conditions': [
13525
+    ['target_arch=="ia32" or target_arch=="x64"', {
13526
+      'targets': [
13527
+        {
13528
+          'target_name': 'common_audio_sse2',
13529
+          'type': 'static_library',
13530
+          'sources': [
13531
+            'fir_filter_sse.cc',
13532
+            'resampler/sinc_resampler_sse.cc',
13533
+          ],
13534
+          'conditions': [
13535
+            ['os_posix==1', {
13536
+              'cflags': [ '-msse2', ],
13537
+              'cflags_mozilla': ['-msse2',],
13538
+              'xcode_settings': {
13539
+                'OTHER_CFLAGS': [ '-msse2', ],
13540
+              },
13541
+            }],
13542
+          ],
13543
+        },
13544
+      ],  # targets
13545
+    }],
13546
+    ['build_with_neon==1', {
13547
+      'targets': [
13548
+        {
13549
+          'target_name': 'common_audio_neon',
13550
+          'type': 'static_library',
13551
+          'includes': ['../build/arm_neon.gypi',],
13552
+          'sources': [
13553
+            'fir_filter_neon.cc',
13554
+            'resampler/sinc_resampler_neon.cc',
13555
+            'signal_processing/cross_correlation_neon.c',
13556
+            'signal_processing/downsample_fast_neon.c',
13557
+            'signal_processing/min_max_operations_neon.c',
13558
+          ],
13559
+        },
13560
+      ],  # targets
13561
+    }],
13562
+  ],  # conditions
13563
+}
13564
diff --git media/webrtc/trunk/webrtc/common_video/common_video.gyp media/webrtc/trunk/webrtc/common_video/common_video.gyp
13565
new file mode 100644
13566
index 000000000000..8391b7ce173a
13567
--- /dev/null
13568
+++ media/webrtc/trunk/webrtc/common_video/common_video.gyp
13569
@@ -0,0 +1,83 @@
13570
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
13571
+#
13572
+# Use of this source code is governed by a BSD-style license
13573
+# that can be found in the LICENSE file in the root of the source
13574
+# tree. An additional intellectual property rights grant can be found
13575
+# in the file PATENTS.  All contributing project authors may
13576
+# be found in the AUTHORS file in the root of the source tree.
13577
+
13578
+{
13579
+  'includes': ['../build/common.gypi'],
13580
+  'targets': [
13581
+    {
13582
+      'target_name': 'common_video',
13583
+      'type': 'static_library',
13584
+      'include_dirs': [
13585
+        '<(webrtc_root)/modules/interface/',
13586
+        'include',
13587
+        'libyuv/include',
13588
+      ],
13589
+      'dependencies': [
13590
+        '<(webrtc_root)/base/base.gyp:rtc_task_queue',
13591
+        '<(webrtc_root)/common.gyp:webrtc_common',
13592
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
13593
+      ],
13594
+      'direct_dependent_settings': {
13595
+        'include_dirs': [
13596
+          'include',
13597
+          'libyuv/include',
13598
+        ],
13599
+      },
13600
+      'conditions': [
13601
+        ['build_libyuv==1', {
13602
+          'dependencies': ['<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv',],
13603
+          'export_dependent_settings': [
13604
+            '<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv',
13605
+          ],
13606
+        }, {
13607
+          # Need to add a directory normally exported by libyuv.gyp.
13608
+          'include_dirs': ['<(libyuv_dir)/include',],
13609
+        }],
13610
+        ['OS=="ios" or OS=="mac"', {
13611
+          'sources': [
13612
+            'corevideo_frame_buffer.cc',
13613
+            'include/corevideo_frame_buffer.h',
13614
+          ],
13615
+          'link_settings': {
13616
+            'xcode_settings': {
13617
+              'OTHER_LDFLAGS': [
13618
+                '-framework CoreVideo',
13619
+              ],
13620
+            },
13621
+          },
13622
+        }],
13623
+      ],
13624
+      'sources': [
13625
+        'bitrate_adjuster.cc',
13626
+        'h264/sps_vui_rewriter.cc',
13627
+        'h264/sps_vui_rewriter.h',
13628
+        'h264/h264_common.cc',
13629
+        'h264/h264_common.h',
13630
+        'h264/profile_level_id.cc',
13631
+        'h264/pps_parser.cc',
13632
+        'h264/pps_parser.h',
13633
+        'h264/sps_parser.cc',
13634
+        'h264/sps_parser.h',
13635
+        'i420_buffer_pool.cc',
13636
+        'video_frame.cc',
13637
+        'incoming_video_stream.cc',
13638
+        'include/bitrate_adjuster.h',
13639
+        'include/frame_callback.h',
13640
+        'include/i420_buffer_pool.h',
13641
+        'include/incoming_video_stream.h',
13642
+        'include/video_bitrate_allocator.h',
13643
+        'include/video_frame_buffer.h',
13644
+        'libyuv/include/webrtc_libyuv.h',
13645
+        'libyuv/webrtc_libyuv.cc',
13646
+        'video_frame_buffer.cc',
13647
+        'video_render_frames.cc',
13648
+        'video_render_frames.h',
13649
+      ],
13650
+    },
13651
+  ],  # targets
13652
+}
13653
diff --git media/webrtc/trunk/webrtc/logging/BUILD.gn media/webrtc/trunk/webrtc/logging/BUILD.gn
13654
index a83238db6eb9..98776d3f90ee 100644
13655
--- media/webrtc/trunk/webrtc/logging/BUILD.gn
13656
+++ media/webrtc/trunk/webrtc/logging/BUILD.gn
13657
@@ -7,9 +7,7 @@
13658
 # be found in the AUTHORS file in the root of the source tree.
13659
 
13660
 import("../build/webrtc.gni")
13661
-if (!build_with_mozilla) {
13662
-  import("//third_party/protobuf/proto_library.gni")
13663
-}
13664
+import("//third_party/protobuf/proto_library.gni")
13665
 if (is_android) {
13666
   import("//build/config/android/config.gni")
13667
   import("//build/config/android/rules.gni")
13668
diff --git media/webrtc/trunk/webrtc/media/BUILD.gn media/webrtc/trunk/webrtc/media/BUILD.gn
13669
index e27e39892367..060b6afa9a3e 100644
13670
--- media/webrtc/trunk/webrtc/media/BUILD.gn
13671
+++ media/webrtc/trunk/webrtc/media/BUILD.gn
13672
@@ -10,17 +10,10 @@ import("//build/config/linux/pkg_config.gni")
13673
 import("../build/webrtc.gni")
13674
 
13675
 group("media") {
13676
-  public_deps = []
13677
-  if (!build_with_mozilla) {
13678
-    public_deps += [
13679
-      ":rtc_media",
13680
-      ":rtc_media_base",
13681
-    ]
13682
-  } else {
13683
-    public_deps += [
13684
-      ":mozilla_rtc_media",
13685
-    ]
13686
-  }
13687
+  public_deps = [
13688
+    ":rtc_media",
13689
+    ":rtc_media_base",
13690
+  ]
13691
 }
13692
 
13693
 config("rtc_media_defines_config") {
13694
@@ -49,22 +42,6 @@ if (is_linux && rtc_use_gtk) {
13695
   }
13696
 }
13697
 
13698
-if (build_with_mozilla) {
13699
-  rtc_static_library("mozilla_rtc_media") {
13700
-    defines = []
13701
-    libs = []
13702
-    deps = []
13703
-    sources = [
13704
-      "base/videoadapter.cc",
13705
-      "base/videoadapter.h",
13706
-      "base/videobroadcaster.cc",
13707
-      "base/videobroadcaster.h",
13708
-      "base/videosourcebase.cc",
13709
-      "base/videosourcebase.h",
13710
-    ]
13711
-  }
13712
-}
13713
-
13714
 rtc_static_library("rtc_media_base") {
13715
   defines = []
13716
   libs = []
13717
@@ -125,13 +102,8 @@ rtc_static_library("rtc_media_base") {
13718
   deps += [
13719
     "..:webrtc_common",
13720
     "../base:rtc_base_approved",
13721
+    "../p2p",
13722
   ]
13723
-
13724
-  if (!build_with_mozilla) {
13725
-    deps += [
13726
-      "../p2p",
13727
-    ]
13728
-  }
13729
 }
13730
 
13731
 rtc_static_library("rtc_media") {
13732
diff --git media/webrtc/trunk/webrtc/media/media.gyp media/webrtc/trunk/webrtc/media/media.gyp
13733
new file mode 100644
13734
index 000000000000..eda77532241a
13735
--- /dev/null
13736
+++ media/webrtc/trunk/webrtc/media/media.gyp
13737
@@ -0,0 +1,219 @@
13738
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
13739
+#
13740
+# Use of this source code is governed by a BSD-style license
13741
+# that can be found in the LICENSE file in the root of the source
13742
+# tree. An additional intellectual property rights grant can be found
13743
+# in the file PATENTS.  All contributing project authors may
13744
+# be found in the AUTHORS file in the root of the source tree.
13745
+
13746
+{
13747
+  'includes': [ '../build/common.gypi', ],
13748
+  'targets': [
13749
+    {
13750
+      'target_name': 'mozilla_rtc_media',
13751
+      'type': 'static_library',
13752
+      'dependencies': [
13753
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
13754
+        '<(webrtc_root)/common.gyp:webrtc_common',
13755
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
13756
+      ],
13757
+      'direct_dependent_settings': {
13758
+        'include_dirs': [
13759
+          '<(libyuv_dir)/include',
13760
+        ],
13761
+      },
13762
+      'sources': [
13763
+        'base/videoadapter.cc',
13764
+        'base/videoadapter.h',
13765
+        'base/videobroadcaster.cc',
13766
+        'base/videobroadcaster.h',
13767
+        'base/videosourcebase.cc',
13768
+        'base/videosourcebase.h',
13769
+      ],
13770
+      # TODO(kjellander): Make the code compile without disabling these flags.
13771
+      # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
13772
+      'cflags': [
13773
+        '-Wno-deprecated-declarations',
13774
+      ],
13775
+      'cflags!': [
13776
+        '-Wextra',
13777
+      ],
13778
+      'cflags_cc!': [
13779
+        '-Woverloaded-virtual',
13780
+      ],
13781
+    },
13782
+    {
13783
+      'target_name': 'rtc_media',
13784
+      'type': 'static_library',
13785
+      'dependencies': [
13786
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
13787
+        '<(webrtc_root)/common.gyp:webrtc_common',
13788
+        '<(webrtc_root)/webrtc.gyp:webrtc_lib',
13789
+        '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine',
13790
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
13791
+        '<(webrtc_root)/p2p/p2p.gyp:rtc_p2p',
13792
+      ],
13793
+      'direct_dependent_settings': {
13794
+        'include_dirs': [
13795
+          '<(libyuv_dir)/include',
13796
+        ],
13797
+      },
13798
+      'sources': [
13799
+        'base/adaptedvideotracksource.cc',
13800
+        'base/adaptedvideotracksource.h',
13801
+        'base/audiosource.h',
13802
+        'base/codec.cc',
13803
+        'base/codec.h',
13804
+        'base/cpuid.cc',
13805
+        'base/cpuid.h',
13806
+        'base/cryptoparams.h',
13807
+        'base/device.h',
13808
+        'base/hybriddataengine.h',
13809
+        'base/mediachannel.h',
13810
+        'base/mediacommon.h',
13811
+        'base/mediaconstants.cc',
13812
+        'base/mediaconstants.h',
13813
+        'base/mediaengine.cc',
13814
+        'base/mediaengine.h',
13815
+        'base/rtpdataengine.cc',
13816
+        'base/rtpdataengine.h',
13817
+        'base/rtpdump.cc',
13818
+        'base/rtpdump.h',
13819
+        'base/rtputils.cc',
13820
+        'base/rtputils.h',
13821
+        'base/screencastid.h',
13822
+        'base/streamparams.cc',
13823
+        'base/streamparams.h',
13824
+        'base/turnutils.cc',
13825
+        'base/turnutils.h',
13826
+        'base/videoadapter.cc',
13827
+        'base/videoadapter.h',
13828
+        'base/videobroadcaster.cc',
13829
+        'base/videobroadcaster.h',
13830
+        'base/videocapturer.cc',
13831
+        'base/videocapturer.h',
13832
+        'base/videocapturerfactory.h',
13833
+        'base/videocommon.cc',
13834
+        'base/videocommon.h',
13835
+        'base/videoframe.cc',
13836
+        'base/videoframe.h',
13837
+        'base/videosourcebase.cc',
13838
+        'base/videosourcebase.h',
13839
+        'devices/videorendererfactory.h',
13840
+        'engine/internaldecoderfactory.cc',
13841
+        'engine/internaldecoderfactory.h',
13842
+        'engine/internalencoderfactory.cc',
13843
+        'engine/internalencoderfactory.h',
13844
+        'engine/nullwebrtcvideoengine.h',
13845
+        'engine/payload_type_mapper.cc',
13846
+        'engine/payload_type_mapper.h',
13847
+        'engine/simulcast.cc',
13848
+        'engine/simulcast.h',
13849
+        'engine/videodecodersoftwarefallbackwrapper.cc',
13850
+        'engine/videodecodersoftwarefallbackwrapper.h',
13851
+        'engine/videoencodersoftwarefallbackwrapper.cc',
13852
+        'engine/videoencodersoftwarefallbackwrapper.h',
13853
+        'engine/webrtccommon.h',
13854
+        'engine/webrtcmediaengine.cc',
13855
+        'engine/webrtcmediaengine.h',
13856
+        'engine/webrtcmediaengine.cc',
13857
+        'engine/webrtcvideocapturer.cc',
13858
+        'engine/webrtcvideocapturer.h',
13859
+        'engine/webrtcvideocapturerfactory.h',
13860
+        'engine/webrtcvideocapturerfactory.cc',
13861
+        'engine/webrtcvideodecoderfactory.h',
13862
+        'engine/webrtcvideoencoderfactory.h',
13863
+        'engine/webrtcvideoengine2.cc',
13864
+        'engine/webrtcvideoengine2.h',
13865
+        'engine/webrtcvideoframe.cc',
13866
+        'engine/webrtcvideoframe.h',
13867
+        'engine/webrtcvoe.h',
13868
+        'engine/webrtcvoiceengine.cc',
13869
+        'engine/webrtcvoiceengine.h',
13870
+        'sctp/sctptransportinternal.h',
13871
+#       'sctp/sctpdataengine.cc',
13872
+#       'sctp/sctpdataengine.h',
13873
+      ],
13874
+      # TODO(kjellander): Make the code compile without disabling these flags.
13875
+      # See https://bugs.chromium.org/p/webrtc/issues/detail?id=3307
13876
+      'cflags': [
13877
+        '-Wno-deprecated-declarations',
13878
+      ],
13879
+      'cflags!': [
13880
+        '-Wextra',
13881
+      ],
13882
+      'cflags_cc!': [
13883
+        '-Woverloaded-virtual',
13884
+      ],
13885
+      'msvs_disabled_warnings': [
13886
+        4245,  # conversion from 'int' to 'size_t', signed/unsigned mismatch.
13887
+        4267,  # conversion from 'size_t' to 'int', possible loss of data.
13888
+        4389,  # signed/unsigned mismatch.
13889
+      ],
13890
+      'conditions': [
13891
+        ['build_libyuv==1', {
13892
+          'dependencies': ['<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv',],
13893
+        }],
13894
+        #TODO: build_usrsctp not defined
13895
+        #['build_usrsctp==1', {
13896
+        #  'include_dirs': [
13897
+        #    # TODO(jiayl): move this into the direct_dependent_settings of
13898
+        #    # usrsctp.gyp.
13899
+        #    '<(DEPTH)/third_party/usrsctp/usrsctplib',
13900
+        #  ],
13901
+        #  'dependencies': [
13902
+        #    '<(DEPTH)/third_party/usrsctp/usrsctp.gyp:usrsctplib',
13903
+        #  ],
13904
+        #}],
13905
+        ['enable_intelligibility_enhancer==1', {
13906
+          'defines': ['WEBRTC_INTELLIGIBILITY_ENHANCER=1',],
13907
+        }, {
13908
+          'defines': ['WEBRTC_INTELLIGIBILITY_ENHANCER=0',],
13909
+        }],
13910
+        ['build_with_chromium==1', {
13911
+          'dependencies': [
13912
+            '<(webrtc_root)/modules/modules.gyp:video_capture',
13913
+          ],
13914
+        }, {
13915
+          'defines': [
13916
+            'HAVE_WEBRTC_VIDEO',
13917
+            'HAVE_WEBRTC_VOICE',
13918
+          ],
13919
+          'direct_dependent_settings': {
13920
+            'defines': [
13921
+              'HAVE_WEBRTC_VIDEO',
13922
+              'HAVE_WEBRTC_VOICE',
13923
+            ],
13924
+          },
13925
+          'dependencies': [
13926
+            '<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl',
13927
+          ],
13928
+        }],
13929
+        ['OS=="linux" and use_gtk==1', {
13930
+          'sources': [
13931
+            'devices/gtkvideorenderer.cc',
13932
+            'devices/gtkvideorenderer.h',
13933
+          ],
13934
+          'cflags': [
13935
+            '<!@(pkg-config --cflags gobject-2.0 gthread-2.0 gtk+-2.0)',
13936
+          ],
13937
+        }],
13938
+        ['OS=="win"', {
13939
+          'sources': [
13940
+            'devices/gdivideorenderer.cc',
13941
+            'devices/gdivideorenderer.h',
13942
+          ],
13943
+          'msvs_settings': {
13944
+            'VCLibrarianTool': {
13945
+              'AdditionalDependencies': [
13946
+                'd3d9.lib',
13947
+                'gdi32.lib',
13948
+                'strmiids.lib',
13949
+              ],
13950
+            },
13951
+          },
13952
+        }],
13953
+      ],
13954
+    },  # target rtc_media
13955
+  ],  # targets.
13956
+}
13957
diff --git media/webrtc/trunk/webrtc/modules/BUILD.gn media/webrtc/trunk/webrtc/modules/BUILD.gn
13958
index 2212adebd378..ff059accf54f 100644
13959
--- media/webrtc/trunk/webrtc/modules/BUILD.gn
13960
+++ media/webrtc/trunk/webrtc/modules/BUILD.gn
13961
@@ -23,26 +23,16 @@ group("modules") {
13962
     "audio_processing",
13963
     "bitrate_controller",
13964
     "congestion_controller",
13965
+    "desktop_capture",
13966
     "media_file",
13967
     "pacing",
13968
     "remote_bitrate_estimator",
13969
     "rtp_rtcp",
13970
     "utility",
13971
+    "video_capture",
13972
     "video_coding",
13973
     "video_processing",
13974
   ]
13975
-
13976
-  if (!build_with_mozilla) {
13977
-    public_deps += [
13978
-      "video_capture",
13979
-    ]
13980
-  }
13981
-
13982
-  if (rtc_desktop_capture_supported) {
13983
-    public_deps += [
13984
-      "desktop_capture",
13985
-    ]
13986
-  }
13987
 }
13988
 
13989
 if (rtc_include_tests) {
13990
@@ -76,6 +66,7 @@ if (rtc_include_tests) {
13991
     deps = [
13992
       "..:webrtc_common",
13993
       "../common_video",
13994
+      "../media:rtc_media_base",
13995
       "../modules/audio_coding",
13996
       "../modules/audio_coding:audio_format_conversion",
13997
       "../modules/rtp_rtcp",
13998
@@ -88,12 +79,6 @@ if (rtc_include_tests) {
13999
       "//testing/gtest",
14000
     ]
14001
 
14002
-    if (!build_with_mozilla) {
14003
-      deps += [
14004
-        "../media:rtc_media_base",
14005
-      ]
14006
-    }
14007
-
14008
     sources = [
14009
       "audio_coding/test/APITest.cc",
14010
       "audio_coding/test/Channel.cc",
14011
@@ -561,7 +546,7 @@ if (rtc_include_tests) {
14012
       sources += [ "video_coding/codecs/h264/h264_encoder_impl_unittest.cc" ]
14013
     }
14014
 
14015
-    if (rtc_desktop_capture_supported || (is_android && !build_with_mozilla)) {
14016
+    if (rtc_desktop_capture_supported || is_android) {
14017
       deps += [ "desktop_capture" ]
14018
       sources += [
14019
         "desktop_capture/desktop_region_unittest.cc",
14020
@@ -663,6 +648,7 @@ if (rtc_include_tests) {
14021
       ":audio_network_adaptor_unittests",
14022
       "..:webrtc_common",
14023
       "../api:transport_api",
14024
+      "../base:rtc_base",  # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
14025
       "../base:rtc_base_tests_utils",
14026
       "../common_audio",
14027
       "../common_video",
14028
@@ -707,11 +693,6 @@ if (rtc_include_tests) {
14029
       "//third_party/gflags",
14030
     ]
14031
 
14032
-    if (!build_with_mozilla) {
14033
-      deps += [
14034
-        "../base:rtc_base",  # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
14035
-      ]
14036
-    }
14037
     data = modules_unittests_resources
14038
 
14039
     if (is_android) {
14040
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/BUILD.gn media/webrtc/trunk/webrtc/modules/audio_coding/BUILD.gn
14041
index 0706c9f5ad16..3b852d32cf5f 100644
14042
--- media/webrtc/trunk/webrtc/modules/audio_coding/BUILD.gn
14043
+++ media/webrtc/trunk/webrtc/modules/audio_coding/BUILD.gn
14044
@@ -9,9 +9,7 @@
14045
 import("../../build/webrtc.gni")
14046
 import("audio_coding.gni")
14047
 import("//build/config/arm.gni")
14048
-if (!build_with_mozilla) {
14049
-  import("//third_party/protobuf/proto_library.gni")
14050
-}
14051
+import("//third_party/protobuf/proto_library.gni")
14052
 
14053
 audio_codec_deps = [
14054
   ":cng",
14055
@@ -24,12 +22,14 @@ if (rtc_include_ilbc) {
14056
 if (rtc_include_opus) {
14057
   audio_codec_deps += [ ":webrtc_opus" ]
14058
 }
14059
-if (current_cpu == "arm") {
14060
-  audio_codec_deps += [ ":isac_fix" ]
14061
-} else {
14062
-  audio_codec_deps += [ ":isac" ]
14063
+if (!build_with_mozilla) {
14064
+  if (current_cpu == "arm") {
14065
+    audio_codec_deps += [ ":isac_fix" ]
14066
+  } else {
14067
+    audio_codec_deps += [ ":isac" ]
14068
+  }
14069
+  audio_codec_deps += [ ":g722" ]
14070
 }
14071
-audio_codec_deps += [ ":g722" ]
14072
 if (!build_with_mozilla && !build_with_chromium) {
14073
   audio_codec_deps += [ ":red" ]
14074
 }
14075
@@ -873,7 +873,7 @@ rtc_source_set("webrtc_opus_c") {
14076
       rtc_opus_dir,
14077
     ]
14078
   } else if (build_with_mozilla) {
14079
-    include_dirs = [ "/media/libopus/include" ]
14080
+    include_dirs = [ getenv("DIST") + "/include/opus" ]
14081
   }
14082
 
14083
   deps = [
14084
@@ -1043,15 +1043,17 @@ rtc_static_library("neteq") {
14085
     defines += [ "WEBRTC_CODEC_OPUS" ]
14086
     deps += [ ":webrtc_opus" ]
14087
   }
14088
-  if (current_cpu == "arm") {
14089
-    defines += [ "WEBRTC_CODEC_ISACFX" ]
14090
-    deps += [ ":isac_fix" ]
14091
-  } else {
14092
-    defines += [ "WEBRTC_CODEC_ISAC" ]
14093
-    deps += [ ":isac" ]
14094
+  if (!build_with_mozilla) {
14095
+    if (current_cpu == "arm") {
14096
+      defines += [ "WEBRTC_CODEC_ISACFX" ]
14097
+      deps += [ ":isac_fix" ]
14098
+    } else {
14099
+      defines += [ "WEBRTC_CODEC_ISAC" ]
14100
+      deps += [ ":isac" ]
14101
+    }
14102
+    defines += [ "WEBRTC_CODEC_G722" ]
14103
+    deps += [ ":g722" ]
14104
   }
14105
-  defines += [ "WEBRTC_CODEC_G722" ]
14106
-  deps += [ ":g722" ]
14107
 }
14108
 
14109
 # Although providing only test support, this target must be outside of the
14110
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/audio_coding.gni media/webrtc/trunk/webrtc/modules/audio_coding/audio_coding.gni
14111
index a176724027b4..13577f86b363 100644
14112
--- media/webrtc/trunk/webrtc/modules/audio_coding/audio_coding.gni
14113
+++ media/webrtc/trunk/webrtc/modules/audio_coding/audio_coding.gni
14114
@@ -21,8 +21,8 @@ if (!build_with_mozilla) {
14115
   } else {
14116
     audio_codec_defines += [ "WEBRTC_CODEC_ISAC" ]
14117
   }
14118
+  audio_codec_defines += [ "WEBRTC_CODEC_G722" ]
14119
 }
14120
-audio_codec_defines += [ "WEBRTC_CODEC_G722" ]
14121
 if (!build_with_mozilla && !build_with_chromium) {
14122
   audio_codec_defines += [ "WEBRTC_CODEC_RED" ]
14123
 }
14124
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/audio_coding.gypi media/webrtc/trunk/webrtc/modules/audio_coding/audio_coding.gypi
14125
new file mode 100644
14126
index 000000000000..214df95d28cd
14127
--- /dev/null
14128
+++ media/webrtc/trunk/webrtc/modules/audio_coding/audio_coding.gypi
14129
@@ -0,0 +1,257 @@
14130
+# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
14131
+#
14132
+# Use of this source code is governed by a BSD-style license
14133
+# that can be found in the LICENSE file in the root of the source
14134
+# tree. An additional intellectual property rights grant can be found
14135
+# in the file PATENTS.  All contributing project authors may
14136
+# be found in the AUTHORS file in the root of the source tree.
14137
+
14138
+{
14139
+  'includes': [
14140
+    '../../build/common.gypi',
14141
+    'audio_network_adaptor/audio_network_adaptor.gypi',
14142
+    'codecs/interfaces.gypi',
14143
+    'codecs/cng/cng.gypi',
14144
+    'codecs/g711/g711.gypi',
14145
+    'codecs/g722/g722.gypi',
14146
+    'codecs/ilbc/ilbc.gypi',
14147
+    'codecs/isac/isac.gypi',
14148
+    'codecs/isac/isac_common.gypi',
14149
+    'codecs/isac/isacfix.gypi',
14150
+    'codecs/pcm16b/pcm16b.gypi',
14151
+    'codecs/red/red.gypi',
14152
+    'neteq/neteq.gypi',
14153
+  ],
14154
+  'variables': {
14155
+    'variables': {
14156
+      'audio_codec_dependencies': [
14157
+        'cng',
14158
+        'g711',
14159
+        'pcm16b',
14160
+      ],
14161
+      'audio_codec_defines': [],
14162
+      'conditions': [
14163
+        ['include_g722==1', {
14164
+          'audio_coding_dependencies': ['g722',],
14165
+          'audio_coding_defines': ['WEBRTC_CODEC_G722',],
14166
+        }],
14167
+        ['include_isac==1', {
14168
+          'audio_coding_dependencies': ['isac',],
14169
+          'audio_coding_defines': ['WEBRTC_CODEC_ISAC',],
14170
+        }],
14171
+        ['include_ilbc==1', {
14172
+          'audio_codec_dependencies': ['ilbc',],
14173
+          'audio_codec_defines': ['WEBRTC_CODEC_ILBC',],
14174
+        }],
14175
+        ['include_opus==1', {
14176
+          'audio_codec_dependencies': ['webrtc_opus',],
14177
+          'audio_codec_defines': ['WEBRTC_CODEC_OPUS',],
14178
+          'conditions': [
14179
+            ['rtc_opus_variable_complexity==1', {
14180
+              'audio_codec_defines': [ "WEBRTC_OPUS_VARIABLE_COMPLEXITY=1" ]
14181
+            },{
14182
+              'audio_codec_defines': [ "WEBRTC_OPUS_VARIABLE_COMPLEXITY=0" ]
14183
+            }],
14184
+          ],
14185
+        }],
14186
+        ['build_with_mozilla==0', {
14187
+          'conditions': [
14188
+            ['target_arch=="arm"', {
14189
+              'audio_codec_dependencies': ['isac_fix',],
14190
+              'audio_codec_defines': ['WEBRTC_CODEC_ISACFX',],
14191
+            }, {
14192
+              'audio_codec_dependencies': ['isac',],
14193
+              'audio_codec_defines': ['WEBRTC_CODEC_ISAC',],
14194
+            }],
14195
+          ],
14196
+          'audio_codec_dependencies': ['g722',],
14197
+          'audio_codec_defines': ['WEBRTC_CODEC_G722',],
14198
+        }],
14199
+        ['build_with_mozilla==0 and build_with_chromium==0', {
14200
+          'audio_codec_dependencies': ['red',],
14201
+          'audio_codec_defines': ['WEBRTC_CODEC_RED',],
14202
+        }],
14203
+        ['build_with_mozilla==1', {
14204
+          'audio_codec_dependencies': ['g722',],
14205
+          'audio_codec_defines': ['WEBRTC_CODEC_G722',],
14206
+        }],
14207
+      ],
14208
+    },
14209
+    'audio_codec_dependencies': '<(audio_codec_dependencies)',
14210
+    'audio_codec_defines': '<(audio_codec_defines)',
14211
+    'audio_coding_dependencies': [
14212
+      '<@(audio_codec_dependencies)',
14213
+      '<(webrtc_root)/common.gyp:webrtc_common',
14214
+      '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
14215
+      '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
14216
+    ],
14217
+    'audio_coding_defines': '<(audio_codec_defines)',
14218
+  },
14219
+  'targets': [
14220
+    {
14221
+      'target_name': 'audio_decoder_factory_interface',
14222
+      'type': 'static_library',
14223
+      'dependencies': [
14224
+        '<(webrtc_root)/common.gyp:webrtc_common',
14225
+      'audio_format',
14226
+      ],
14227
+      'include_dirs': [
14228
+        '<(webrtc_root)',
14229
+      ],
14230
+      'direct_dependent_settings': {
14231
+        'include_dirs': [
14232
+          '<(webrtc_root)',
14233
+        ],
14234
+      },
14235
+      'sources': [
14236
+        'codecs/audio_decoder_factory.h',
14237
+      ],
14238
+    },
14239
+    {
14240
+      'target_name': 'audio_format',
14241
+      'type': 'static_library',
14242
+      'defines': [
14243
+        '<@(audio_codec_defines)',
14244
+      ],
14245
+      'dependencies': [
14246
+        '<(webrtc_root)/common.gyp:webrtc_common',
14247
+      ],
14248
+      'include_dirs': [
14249
+        '<(webrtc_root)',
14250
+      ],
14251
+      'direct_dependent_settings': {
14252
+        'include_dirs': [
14253
+          '<(webrtc_root)',
14254
+        ],
14255
+      },
14256
+      'sources': [
14257
+        'codecs/audio_format.cc',
14258
+        'codecs/audio_format.h',
14259
+      ],
14260
+    },
14261
+    {
14262
+      'target_name': 'audio_format_conversion',
14263
+      'type': 'static_library',
14264
+      'defines': [
14265
+        '<@(audio_codec_defines)',
14266
+      ],
14267
+      'dependencies': [
14268
+        '<(webrtc_root)/common.gyp:webrtc_common',
14269
+        'audio_format',
14270
+      ],
14271
+      'include_dirs': [
14272
+        '<(webrtc_root)',
14273
+      ],
14274
+      'direct_dependent_settings': {
14275
+        'include_dirs': [
14276
+          '<(webrtc_root)',
14277
+        ],
14278
+      },
14279
+      'sources': [
14280
+        'codecs/audio_format_conversion.cc',
14281
+        'codecs/audio_format_conversion.h',
14282
+      ],
14283
+    },
14284
+    {
14285
+      'target_name': 'builtin_audio_decoder_factory',
14286
+      'type': 'static_library',
14287
+      'defines': [
14288
+        '<@(audio_codec_defines)',
14289
+      ],
14290
+      'dependencies': [
14291
+        '<(webrtc_root)/common.gyp:webrtc_common',
14292
+        '<@(audio_codec_dependencies)',
14293
+        'audio_decoder_factory_interface',
14294
+      ],
14295
+      'include_dirs': [
14296
+        '<(webrtc_root)',
14297
+      ],
14298
+      'direct_dependent_settings': {
14299
+        'include_dirs': [
14300
+          '<(webrtc_root)',
14301
+        ],
14302
+      },
14303
+      'sources': [
14304
+        'codecs/builtin_audio_decoder_factory.cc',
14305
+        'codecs/builtin_audio_decoder_factory.h',
14306
+      ],
14307
+    },
14308
+    {
14309
+      'target_name': 'rent_a_codec',
14310
+      'type': 'static_library',
14311
+      'defines': [
14312
+        '<@(audio_codec_defines)',
14313
+      ],
14314
+      'dependencies': [
14315
+        '<(webrtc_root)/common.gyp:webrtc_common',
14316
+        '<@(audio_codec_dependencies)',
14317
+      ],
14318
+      'include_dirs': [
14319
+        '<(webrtc_root)',
14320
+      ],
14321
+      'direct_dependent_settings': {
14322
+        'include_dirs': [
14323
+          '<(webrtc_root)',
14324
+        ],
14325
+      },
14326
+      'sources': [
14327
+        'acm2/acm_codec_database.cc',
14328
+        'acm2/acm_codec_database.h',
14329
+        'acm2/rent_a_codec.cc',
14330
+        'acm2/rent_a_codec.h',
14331
+      ],
14332
+    },
14333
+    {
14334
+      'target_name': 'audio_coding_module',
14335
+      'type': 'static_library',
14336
+      'defines': [
14337
+        '<@(audio_coding_defines)',
14338
+      ],
14339
+      'dependencies': [
14340
+        '<@(audio_coding_dependencies)',
14341
+        '<(webrtc_root)/common.gyp:webrtc_common',
14342
+        '<(webrtc_root)/webrtc.gyp:rtc_event_log_api',
14343
+        'audio_network_adaptor',
14344
+        'neteq',
14345
+        'rent_a_codec',
14346
+        'audio_format_conversion',
14347
+      ],
14348
+      'include_dirs': [
14349
+        'include',
14350
+        '../include',
14351
+        '<(webrtc_root)',
14352
+      ],
14353
+      'direct_dependent_settings': {
14354
+        'include_dirs': [
14355
+          'include',
14356
+          '../include',
14357
+          '<(webrtc_root)',
14358
+        ],
14359
+      },
14360
+      'conditions': [
14361
+        ['include_opus==1', {
14362
+          'export_dependent_settings': ['webrtc_opus'],
14363
+        }],
14364
+      ],
14365
+      'sources': [
14366
+        'acm2/acm_common_defs.h',
14367
+        'acm2/acm_receiver.cc',
14368
+        'acm2/acm_receiver.h',
14369
+        'acm2/acm_resampler.cc',
14370
+        'acm2/acm_resampler.h',
14371
+        'acm2/audio_coding_module.cc',
14372
+        'acm2/call_statistics.cc',
14373
+        'acm2/call_statistics.h',
14374
+        'acm2/codec_manager.cc',
14375
+        'acm2/codec_manager.h',
14376
+        'include/audio_coding_module.h',
14377
+        'include/audio_coding_module_typedefs.h',
14378
+      ],
14379
+    },
14380
+  ],
14381
+  'conditions': [
14382
+    ['include_opus==1', {
14383
+      'includes': ['codecs/opus/opus.gypi',],
14384
+    }],
14385
+  ],
14386
+}
14387
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/audio_coding_tests.gypi media/webrtc/trunk/webrtc/modules/audio_coding/audio_coding_tests.gypi
14388
new file mode 100644
14389
index 000000000000..0b1a22d8d048
14390
--- /dev/null
14391
+++ media/webrtc/trunk/webrtc/modules/audio_coding/audio_coding_tests.gypi
14392
@@ -0,0 +1,42 @@
14393
+# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
14394
+#
14395
+# Use of this source code is governed by a BSD-style license
14396
+# that can be found in the LICENSE file in the root of the source
14397
+# tree. An additional intellectual property rights grant can be found
14398
+# in the file PATENTS.  All contributing project authors may
14399
+# be found in the AUTHORS file in the root of the source tree.
14400
+
14401
+{
14402
+  'includes': [
14403
+    '../../build/common.gypi',
14404
+    'codecs/isac/isac_test.gypi',
14405
+    'codecs/isac/isacfix_test.gypi',
14406
+  ],
14407
+  'targets': [
14408
+    {
14409
+      'target_name': 'audio_codec_speed_tests',
14410
+      'type': '<(gtest_target_type)',
14411
+      'dependencies': [
14412
+        'audio_processing',
14413
+        'isac_fix',
14414
+        'webrtc_opus',
14415
+        '<(DEPTH)/testing/gtest.gyp:gtest',
14416
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
14417
+        '<(webrtc_root)/test/test.gyp:test_support_main',
14418
+      ],
14419
+      'sources': [
14420
+        'codecs/isac/fix/test/isac_speed_test.cc',
14421
+        'codecs/opus/opus_speed_test.cc',
14422
+        'codecs/tools/audio_codec_speed_test.h',
14423
+        'codecs/tools/audio_codec_speed_test.cc',
14424
+      ],
14425
+      'conditions': [
14426
+        ['OS=="android"', {
14427
+          'dependencies': [
14428
+            '<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
14429
+          ],
14430
+        }],
14431
+      ],
14432
+    },
14433
+  ],
14434
+}
14435
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor.gypi media/webrtc/trunk/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor.gypi
14436
new file mode 100644
14437
index 000000000000..406282e9cc00
14438
--- /dev/null
14439
+++ media/webrtc/trunk/webrtc/modules/audio_coding/audio_network_adaptor/audio_network_adaptor.gypi
14440
@@ -0,0 +1,77 @@
14441
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
14442
+#
14443
+# Use of this source code is governed by a BSD-style license
14444
+# that can be found in the LICENSE file in the root of the source
14445
+# tree. An additional intellectual property rights grant can be found
14446
+# in the file PATENTS.  All contributing project authors may
14447
+# be found in the AUTHORS file in the root of the source tree.
14448
+
14449
+{
14450
+  'targets': [
14451
+    { 'target_name': 'audio_network_adaptor',
14452
+      'type': 'static_library',
14453
+      'sources': [
14454
+        'audio_network_adaptor.cc',
14455
+        'audio_network_adaptor_impl.cc',
14456
+        'audio_network_adaptor_impl.h',
14457
+        'bitrate_controller.h',
14458
+        'bitrate_controller.cc',
14459
+        'channel_controller.cc',
14460
+        'channel_controller.h',
14461
+        'controller.h',
14462
+        'controller.cc',
14463
+        'controller_manager.cc',
14464
+        'controller_manager.h',
14465
+        'debug_dump_writer.cc',
14466
+        'debug_dump_writer.h',
14467
+        'dtx_controller.h',
14468
+        'dtx_controller.cc',
14469
+        'fec_controller.h',
14470
+        'fec_controller.cc',
14471
+        'frame_length_controller.cc',
14472
+        'frame_length_controller.h',
14473
+        'include/audio_network_adaptor.h',
14474
+      ], # sources
14475
+      'conditions': [
14476
+        ['enable_protobuf==1', {
14477
+          'dependencies': [
14478
+            'ana_config_proto',
14479
+            'ana_debug_dump_proto',
14480
+          ],
14481
+          'defines': ['WEBRTC_AUDIO_NETWORK_ADAPTOR_DEBUG_DUMP'],
14482
+        }],
14483
+      ], # conditions
14484
+    },
14485
+  ], # targets
14486
+
14487
+  'conditions': [
14488
+    ['enable_protobuf==1', {
14489
+      'targets': [
14490
+        { 'target_name': 'ana_debug_dump_proto',
14491
+          'type': 'static_library',
14492
+          'sources': ['debug_dump.proto',],
14493
+          'variables': {
14494
+            'proto_in_dir': '.',
14495
+            # Workaround to protect against gyp's pathname relativization when
14496
+            # this file is included by modules.gyp.
14497
+            'proto_out_protected': 'webrtc/modules/audio_coding/audio_network_adaptor',
14498
+            'proto_out_dir': '<(proto_out_protected)',
14499
+          },
14500
+          'includes': ['../../../build/protoc.gypi',],
14501
+        },
14502
+        { 'target_name': 'ana_config_proto',
14503
+          'type': 'static_library',
14504
+          'sources': ['config.proto',],
14505
+          'variables': {
14506
+            'proto_in_dir': '.',
14507
+            # Workaround to protect against gyp's pathname relativization when
14508
+            # this file is included by modules.gyp.
14509
+            'proto_out_protected': 'webrtc/modules/audio_coding/audio_network_adaptor',
14510
+            'proto_out_dir': '<(proto_out_protected)',
14511
+          },
14512
+          'includes': ['../../../build/protoc.gypi',],
14513
+        },
14514
+      ], # targets
14515
+    }],
14516
+  ], # conditions
14517
+}
14518
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/cng/cng.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/cng/cng.gypi
14519
new file mode 100644
14520
index 000000000000..bbff9f8edfee
14521
--- /dev/null
14522
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/cng/cng.gypi
14523
@@ -0,0 +1,26 @@
14524
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
14525
+#
14526
+# Use of this source code is governed by a BSD-style license
14527
+# that can be found in the LICENSE file in the root of the source
14528
+# tree. An additional intellectual property rights grant can be found
14529
+# in the file PATENTS.  All contributing project authors may
14530
+# be found in the AUTHORS file in the root of the source tree.
14531
+
14532
+{
14533
+  'targets': [
14534
+    {
14535
+      'target_name': 'cng',
14536
+      'type': 'static_library',
14537
+      'dependencies': [
14538
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
14539
+        'audio_encoder_interface',
14540
+      ],
14541
+      'sources': [
14542
+        'audio_encoder_cng.cc',
14543
+        'audio_encoder_cng.h',
14544
+        'webrtc_cng.cc',
14545
+        'webrtc_cng.h',
14546
+      ],
14547
+    },
14548
+  ], # targets
14549
+}
14550
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/g711/g711.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/g711/g711.gypi
14551
new file mode 100644
14552
index 000000000000..364a1e6a8fa1
14553
--- /dev/null
14554
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/g711/g711.gypi
14555
@@ -0,0 +1,30 @@
14556
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
14557
+#
14558
+# Use of this source code is governed by a BSD-style license
14559
+# that can be found in the LICENSE file in the root of the source
14560
+# tree. An additional intellectual property rights grant can be found
14561
+# in the file PATENTS.  All contributing project authors may
14562
+# be found in the AUTHORS file in the root of the source tree.
14563
+
14564
+{
14565
+  'targets': [
14566
+    {
14567
+      'target_name': 'g711',
14568
+      'type': 'static_library',
14569
+      'dependencies': [
14570
+        'audio_encoder_interface',
14571
+        'audio_decoder_interface',
14572
+      ],
14573
+      'sources': [
14574
+        'audio_decoder_pcm.cc',
14575
+        'audio_decoder_pcm.h',
14576
+        'audio_encoder_pcm.cc',
14577
+        'audio_encoder_pcm.h',
14578
+        'g711_interface.c',
14579
+        'g711_interface.h',
14580
+        'g711.c',
14581
+        'g711.h',
14582
+      ],
14583
+    },
14584
+  ], # targets
14585
+}
14586
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/g722/g722.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/g722/g722.gypi
14587
new file mode 100644
14588
index 000000000000..836afa1203ad
14589
--- /dev/null
14590
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/g722/g722.gypi
14591
@@ -0,0 +1,30 @@
14592
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
14593
+#
14594
+# Use of this source code is governed by a BSD-style license
14595
+# that can be found in the LICENSE file in the root of the source
14596
+# tree. An additional intellectual property rights grant can be found
14597
+# in the file PATENTS.  All contributing project authors may
14598
+# be found in the AUTHORS file in the root of the source tree.
14599
+{
14600
+  'targets': [
14601
+    {
14602
+      'target_name': 'g722',
14603
+      'type': 'static_library',
14604
+      'dependencies': [
14605
+        'audio_encoder_interface',
14606
+        'audio_decoder_interface',
14607
+      ],
14608
+      'sources': [
14609
+        'audio_decoder_g722.cc',
14610
+        'audio_decoder_g722.h',
14611
+        'audio_encoder_g722.cc',
14612
+        'audio_encoder_g722.h',
14613
+        'g722_interface.c',
14614
+        'g722_interface.h',
14615
+        'g722_decode.c',
14616
+        'g722_enc_dec.h',
14617
+        'g722_encode.c',
14618
+      ],
14619
+    },
14620
+  ], # targets
14621
+}
14622
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/ilbc/ilbc.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/ilbc/ilbc.gypi
14623
new file mode 100644
14624
index 000000000000..762a8fab1a28
14625
--- /dev/null
14626
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/ilbc/ilbc.gypi
14627
@@ -0,0 +1,166 @@
14628
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
14629
+#
14630
+# Use of this source code is governed by a BSD-style license
14631
+# that can be found in the LICENSE file in the root of the source
14632
+# tree. An additional intellectual property rights grant can be found
14633
+# in the file PATENTS.  All contributing project authors may
14634
+# be found in the AUTHORS file in the root of the source tree.
14635
+
14636
+{
14637
+  'targets': [
14638
+    {
14639
+      'target_name': 'ilbc',
14640
+      'type': 'static_library',
14641
+      'dependencies': [
14642
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
14643
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
14644
+        'audio_encoder_interface',
14645
+      ],
14646
+      'sources': [
14647
+        'abs_quant.c',
14648
+        'abs_quant_loop.c',
14649
+        'audio_decoder_ilbc.cc',
14650
+        'audio_decoder_ilbc.h',
14651
+        'audio_encoder_ilbc.cc',
14652
+        'audio_encoder_ilbc.h',
14653
+        'augmented_cb_corr.c',
14654
+        'bw_expand.c',
14655
+        'cb_construct.c',
14656
+        'cb_mem_energy.c',
14657
+        'cb_mem_energy_augmentation.c',
14658
+        'cb_mem_energy_calc.c',
14659
+        'cb_search.c',
14660
+        'cb_search_core.c',
14661
+        'cb_update_best_index.c',
14662
+        'chebyshev.c',
14663
+        'comp_corr.c',
14664
+        'constants.c',
14665
+        'create_augmented_vec.c',
14666
+        'decode.c',
14667
+        'decode_residual.c',
14668
+        'decoder_interpolate_lsf.c',
14669
+        'do_plc.c',
14670
+        'encode.c',
14671
+        'energy_inverse.c',
14672
+        'enh_upsample.c',
14673
+        'enhancer.c',
14674
+        'enhancer_interface.c',
14675
+        'filtered_cb_vecs.c',
14676
+        'frame_classify.c',
14677
+        'gain_dequant.c',
14678
+        'gain_quant.c',
14679
+        'get_cd_vec.c',
14680
+        'get_lsp_poly.c',
14681
+        'get_sync_seq.c',
14682
+        'hp_input.c',
14683
+        'hp_output.c',
14684
+        'ilbc.c',
14685
+        'ilbc.h',
14686
+        'index_conv_dec.c',
14687
+        'index_conv_enc.c',
14688
+        'init_decode.c',
14689
+        'init_encode.c',
14690
+        'interpolate.c',
14691
+        'interpolate_samples.c',
14692
+        'lpc_encode.c',
14693
+        'lsf_check.c',
14694
+        'lsf_interpolate_to_poly_dec.c',
14695
+        'lsf_interpolate_to_poly_enc.c',
14696
+        'lsf_to_lsp.c',
14697
+        'lsf_to_poly.c',
14698
+        'lsp_to_lsf.c',
14699
+        'my_corr.c',
14700
+        'nearest_neighbor.c',
14701
+        'pack_bits.c',
14702
+        'poly_to_lsf.c',
14703
+        'poly_to_lsp.c',
14704
+        'refiner.c',
14705
+        'simple_interpolate_lsf.c',
14706
+        'simple_lpc_analysis.c',
14707
+        'simple_lsf_dequant.c',
14708
+        'simple_lsf_quant.c',
14709
+        'smooth.c',
14710
+        'smooth_out_data.c',
14711
+        'sort_sq.c',
14712
+        'split_vq.c',
14713
+        'state_construct.c',
14714
+        'state_search.c',
14715
+        'swap_bytes.c',
14716
+        'unpack_bits.c',
14717
+        'vq3.c',
14718
+        'vq4.c',
14719
+        'window32_w32.c',
14720
+        'xcorr_coef.c',
14721
+        'abs_quant.h',
14722
+        'abs_quant_loop.h',
14723
+        'augmented_cb_corr.h',
14724
+        'bw_expand.h',
14725
+        'cb_construct.h',
14726
+        'cb_mem_energy.h',
14727
+        'cb_mem_energy_augmentation.h',
14728
+        'cb_mem_energy_calc.h',
14729
+        'cb_search.h',
14730
+        'cb_search_core.h',
14731
+        'cb_update_best_index.h',
14732
+        'chebyshev.h',
14733
+        'comp_corr.h',
14734
+        'constants.h',
14735
+        'create_augmented_vec.h',
14736
+        'decode.h',
14737
+        'decode_residual.h',
14738
+        'decoder_interpolate_lsf.h',
14739
+        'do_plc.h',
14740
+        'encode.h',
14741
+        'energy_inverse.h',
14742
+        'enh_upsample.h',
14743
+        'enhancer.h',
14744
+        'enhancer_interface.h',
14745
+        'filtered_cb_vecs.h',
14746
+        'frame_classify.h',
14747
+        'gain_dequant.h',
14748
+        'gain_quant.h',
14749
+        'get_cd_vec.h',
14750
+        'get_lsp_poly.h',
14751
+        'get_sync_seq.h',
14752
+        'hp_input.h',
14753
+        'hp_output.h',
14754
+        'defines.h',
14755
+        'index_conv_dec.h',
14756
+        'index_conv_enc.h',
14757
+        'init_decode.h',
14758
+        'init_encode.h',
14759
+        'interpolate.h',
14760
+        'interpolate_samples.h',
14761
+        'lpc_encode.h',
14762
+        'lsf_check.h',
14763
+        'lsf_interpolate_to_poly_dec.h',
14764
+        'lsf_interpolate_to_poly_enc.h',
14765
+        'lsf_to_lsp.h',
14766
+        'lsf_to_poly.h',
14767
+        'lsp_to_lsf.h',
14768
+        'my_corr.h',
14769
+        'nearest_neighbor.h',
14770
+        'pack_bits.h',
14771
+        'poly_to_lsf.h',
14772
+        'poly_to_lsp.h',
14773
+        'refiner.h',
14774
+        'simple_interpolate_lsf.h',
14775
+        'simple_lpc_analysis.h',
14776
+        'simple_lsf_dequant.h',
14777
+        'simple_lsf_quant.h',
14778
+        'smooth.h',
14779
+        'smooth_out_data.h',
14780
+        'sort_sq.h',
14781
+        'split_vq.h',
14782
+        'state_construct.h',
14783
+        'state_search.h',
14784
+        'swap_bytes.h',
14785
+        'unpack_bits.h',
14786
+        'vq3.h',
14787
+        'vq4.h',
14788
+        'window32_w32.h',
14789
+        'xcorr_coef.h',
14790
+     ], # sources
14791
+    }, # ilbc
14792
+  ], # targets
14793
+}
14794
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/interfaces.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/interfaces.gypi
14795
new file mode 100644
14796
index 000000000000..adcddcf9fee8
14797
--- /dev/null
14798
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/interfaces.gypi
14799
@@ -0,0 +1,39 @@
14800
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
14801
+#
14802
+# Use of this source code is governed by a BSD-style license
14803
+# that can be found in the LICENSE file in the root of the source
14804
+# tree. An additional intellectual property rights grant can be found
14805
+# in the file PATENTS.  All contributing project authors may
14806
+# be found in the AUTHORS file in the root of the source tree.
14807
+
14808
+{
14809
+  'targets': [
14810
+    {
14811
+      'target_name': 'audio_decoder_interface',
14812
+      'type': 'static_library',
14813
+      'sources': [
14814
+        'audio_decoder.cc',
14815
+        'audio_decoder.h',
14816
+        'legacy_encoded_audio_frame.cc',
14817
+        'legacy_encoded_audio_frame.h',
14818
+      ],
14819
+      'dependencies': [
14820
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
14821
+        '<(webrtc_root)/common.gyp:webrtc_common',
14822
+      ],
14823
+    },
14824
+
14825
+    {
14826
+      'target_name': 'audio_encoder_interface',
14827
+      'type': 'static_library',
14828
+      'sources': [
14829
+        'audio_encoder.cc',
14830
+        'audio_encoder.h',
14831
+      ],
14832
+      'dependencies': [
14833
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
14834
+        '<(webrtc_root)/common.gyp:webrtc_common',
14835
+      ],
14836
+    },
14837
+  ],
14838
+}
14839
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isac.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isac.gypi
14840
new file mode 100644
14841
index 000000000000..55d7c3199513
14842
--- /dev/null
14843
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isac.gypi
14844
@@ -0,0 +1,95 @@
14845
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
14846
+#
14847
+# Use of this source code is governed by a BSD-style license
14848
+# that can be found in the LICENSE file in the root of the source
14849
+# tree. An additional intellectual property rights grant can be found
14850
+# in the file PATENTS.  All contributing project authors may
14851
+# be found in the AUTHORS file in the root of the source tree.
14852
+
14853
+{
14854
+  'targets': [
14855
+    {
14856
+      'target_name': 'isac',
14857
+      'type': 'static_library',
14858
+      'dependencies': [
14859
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
14860
+        'audio_decoder_interface',
14861
+        'audio_encoder_interface',
14862
+        'isac_common',
14863
+      ],
14864
+      'include_dirs': [
14865
+        'main/include',
14866
+        '<(webrtc_root)',
14867
+      ],
14868
+      'direct_dependent_settings': {
14869
+        'include_dirs': [
14870
+          'main/include',
14871
+          '<(webrtc_root)',
14872
+        ],
14873
+      },
14874
+      'sources': [
14875
+        'main/include/audio_decoder_isac.h',
14876
+        'main/include/audio_encoder_isac.h',
14877
+        'main/include/isac.h',
14878
+        'main/source/arith_routines.c',
14879
+        'main/source/arith_routines_hist.c',
14880
+        'main/source/arith_routines_logist.c',
14881
+        'main/source/audio_decoder_isac.cc',
14882
+        'main/source/audio_encoder_isac.cc',
14883
+        'main/source/bandwidth_estimator.c',
14884
+        'main/source/crc.c',
14885
+        'main/source/decode.c',
14886
+        'main/source/decode_bwe.c',
14887
+        'main/source/encode.c',
14888
+        'main/source/encode_lpc_swb.c',
14889
+        'main/source/entropy_coding.c',
14890
+        'main/source/fft.c',
14891
+        'main/source/filter_functions.c',
14892
+        'main/source/filterbank_tables.c',
14893
+        'main/source/intialize.c',
14894
+        'main/source/isac.c',
14895
+        'main/source/isac_float_type.h',
14896
+        'main/source/filterbanks.c',
14897
+        'main/source/pitch_lag_tables.c',
14898
+        'main/source/lattice.c',
14899
+        'main/source/lpc_gain_swb_tables.c',
14900
+        'main/source/lpc_analysis.c',
14901
+        'main/source/lpc_shape_swb12_tables.c',
14902
+        'main/source/lpc_shape_swb16_tables.c',
14903
+        'main/source/lpc_tables.c',
14904
+        'main/source/pitch_estimator.c',
14905
+        'main/source/pitch_filter.c',
14906
+        'main/source/pitch_gain_tables.c',
14907
+        'main/source/spectrum_ar_model_tables.c',
14908
+        'main/source/transform.c',
14909
+        'main/source/arith_routines.h',
14910
+        'main/source/bandwidth_estimator.h',
14911
+        'main/source/codec.h',
14912
+        'main/source/crc.h',
14913
+        'main/source/encode_lpc_swb.h',
14914
+        'main/source/entropy_coding.h',
14915
+        'main/source/fft.h',
14916
+        'main/source/filterbank_tables.h',
14917
+        'main/source/lpc_gain_swb_tables.h',
14918
+        'main/source/lpc_analysis.h',
14919
+        'main/source/lpc_shape_swb12_tables.h',
14920
+        'main/source/lpc_shape_swb16_tables.h',
14921
+        'main/source/lpc_tables.h',
14922
+        'main/source/pitch_estimator.h',
14923
+        'main/source/pitch_gain_tables.h',
14924
+        'main/source/pitch_lag_tables.h',
14925
+        'main/source/settings.h',
14926
+        'main/source/spectrum_ar_model_tables.h',
14927
+        'main/source/structs.h',
14928
+        'main/source/os_specific_inline.h',
14929
+     ],
14930
+     'conditions': [
14931
+       ['OS=="linux"', {
14932
+         'link_settings': {
14933
+           'libraries': ['-lm',],
14934
+         },
14935
+       }],
14936
+     ],
14937
+    },
14938
+  ],
14939
+}
14940
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isac_common.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isac_common.gypi
14941
new file mode 100644
14942
index 000000000000..135ecd27cc91
14943
--- /dev/null
14944
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isac_common.gypi
14945
@@ -0,0 +1,22 @@
14946
+# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
14947
+#
14948
+# Use of this source code is governed by a BSD-style license
14949
+# that can be found in the LICENSE file in the root of the source
14950
+# tree. An additional intellectual property rights grant can be found
14951
+# in the file PATENTS.  All contributing project authors may
14952
+# be found in the AUTHORS file in the root of the source tree.
14953
+
14954
+{
14955
+  'targets': [
14956
+    {
14957
+      'target_name': 'isac_common',
14958
+      'type': 'static_library',
14959
+      'sources': [
14960
+        'audio_encoder_isac_t.h',
14961
+        'audio_encoder_isac_t_impl.h',
14962
+        'locked_bandwidth_info.cc',
14963
+        'locked_bandwidth_info.h',
14964
+      ],
14965
+    },
14966
+  ],
14967
+}
14968
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isac_test.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isac_test.gypi
14969
new file mode 100644
14970
index 000000000000..90d15d8fb3d3
14971
--- /dev/null
14972
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isac_test.gypi
14973
@@ -0,0 +1,83 @@
14974
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
14975
+#
14976
+# Use of this source code is governed by a BSD-style license
14977
+# that can be found in the LICENSE file in the root of the source
14978
+# tree. An additional intellectual property rights grant can be found
14979
+# in the file PATENTS.  All contributing project authors may
14980
+# be found in the AUTHORS file in the root of the source tree.
14981
+
14982
+{
14983
+  'targets': [
14984
+    # simple kenny
14985
+    {
14986
+      'target_name': 'isac_test',
14987
+      'type': 'executable',
14988
+      'dependencies': [
14989
+        'isac',
14990
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
14991
+      ],
14992
+      'include_dirs': [
14993
+        './main/include',
14994
+        './main/test',
14995
+        './main/util',
14996
+        '<(webrtc_root)',
14997
+      ],
14998
+      'sources': [
14999
+        'empty.cc',  # force build system to use C++ linker
15000
+        './main/test/simpleKenny.c',
15001
+        './main/util/utility.c',
15002
+      ],
15003
+      'conditions': [
15004
+        ['OS=="win" and clang==1', {
15005
+          'msvs_settings': {
15006
+            'VCCLCompilerTool': {
15007
+              'AdditionalOptions': [
15008
+                # Disable warnings failing when compiling with Clang on Windows.
15009
+                # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
15010
+                '-Wno-format',
15011
+              ],
15012
+            },
15013
+          },
15014
+        }],
15015
+      ],  # conditions.
15016
+    },
15017
+    # ReleaseTest-API
15018
+    {
15019
+      'target_name': 'isac_api_test',
15020
+      'type': 'executable',
15021
+      'dependencies': [
15022
+        'isac',
15023
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
15024
+      ],
15025
+      'include_dirs': [
15026
+        './main/test',
15027
+        './main/include',
15028
+        './main/util',
15029
+        '<(webrtc_root)',
15030
+      ],
15031
+      'sources': [
15032
+        './main/test/ReleaseTest-API/ReleaseTest-API.cc',
15033
+        './main/util/utility.c',
15034
+      ],
15035
+    },
15036
+    # SwitchingSampRate
15037
+    {
15038
+      'target_name': 'isac_switch_samprate_test',
15039
+      'type': 'executable',
15040
+      'dependencies': [
15041
+        'isac',
15042
+      ],
15043
+      'include_dirs': [
15044
+        './main/test',
15045
+        './main/include',
15046
+        '../../../../common_audio/signal_processing/include',
15047
+        './main/util',
15048
+        '<(webrtc_root)',
15049
+      ],
15050
+      'sources': [
15051
+        './main/test/SwitchingSampRate/SwitchingSampRate.cc',
15052
+        './main/util/utility.c',
15053
+      ],
15054
+    },
15055
+  ],
15056
+}
15057
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isacfix.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isacfix.gypi
15058
new file mode 100644
15059
index 000000000000..25c285c1afe1
15060
--- /dev/null
15061
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isacfix.gypi
15062
@@ -0,0 +1,149 @@
15063
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
15064
+#
15065
+# Use of this source code is governed by a BSD-style license
15066
+# that can be found in the LICENSE file in the root of the source
15067
+# tree. An additional intellectual property rights grant can be found
15068
+# in the file PATENTS.  All contributing project authors may
15069
+# be found in the AUTHORS file in the root of the source tree.
15070
+
15071
+{
15072
+  'includes': [
15073
+    '../../../../build/common.gypi',
15074
+  ],
15075
+  'targets': [
15076
+    {
15077
+      'target_name': 'isac_fix',
15078
+      'type': 'static_library',
15079
+      'dependencies': [
15080
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
15081
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
15082
+        'isac_common',
15083
+      ],
15084
+      'include_dirs': [
15085
+        'fix/include',
15086
+        '<(webrtc_root)'
15087
+      ],
15088
+      'direct_dependent_settings': {
15089
+        'include_dirs': [
15090
+          'fix/include',
15091
+          '<(webrtc_root)',
15092
+        ],
15093
+      },
15094
+      'sources': [
15095
+        'fix/include/audio_decoder_isacfix.h',
15096
+        'fix/include/audio_encoder_isacfix.h',
15097
+        'fix/include/isacfix.h',
15098
+        'fix/source/arith_routines.c',
15099
+        'fix/source/arith_routines_hist.c',
15100
+        'fix/source/arith_routines_logist.c',
15101
+        'fix/source/audio_decoder_isacfix.cc',
15102
+        'fix/source/audio_encoder_isacfix.cc',
15103
+        'fix/source/bandwidth_estimator.c',
15104
+        'fix/source/decode.c',
15105
+        'fix/source/decode_bwe.c',
15106
+        'fix/source/decode_plc.c',
15107
+        'fix/source/encode.c',
15108
+        'fix/source/entropy_coding.c',
15109
+        'fix/source/fft.c',
15110
+        'fix/source/filterbank_tables.c',
15111
+        'fix/source/filterbanks.c',
15112
+        'fix/source/filters.c',
15113
+        'fix/source/initialize.c',
15114
+        'fix/source/isac_fix_type.h',
15115
+        'fix/source/isacfix.c',
15116
+        'fix/source/lattice.c',
15117
+        'fix/source/lattice_c.c',
15118
+        'fix/source/lpc_masking_model.c',
15119
+        'fix/source/lpc_tables.c',
15120
+        'fix/source/pitch_estimator.c',
15121
+        'fix/source/pitch_estimator_c.c',
15122
+        'fix/source/pitch_filter.c',
15123
+        'fix/source/pitch_filter_c.c',
15124
+        'fix/source/pitch_gain_tables.c',
15125
+        'fix/source/pitch_lag_tables.c',
15126
+        'fix/source/spectrum_ar_model_tables.c',
15127
+        'fix/source/transform.c',
15128
+        'fix/source/transform_tables.c',
15129
+        'fix/source/arith_routins.h',
15130
+        'fix/source/bandwidth_estimator.h',
15131
+        'fix/source/codec.h',
15132
+        'fix/source/entropy_coding.h',
15133
+        'fix/source/fft.h',
15134
+        'fix/source/filterbank_tables.h',
15135
+        'fix/source/lpc_masking_model.h',
15136
+        'fix/source/lpc_tables.h',
15137
+        'fix/source/pitch_estimator.h',
15138
+        'fix/source/pitch_gain_tables.h',
15139
+        'fix/source/pitch_lag_tables.h',
15140
+        'fix/source/settings.h',
15141
+        'fix/source/spectrum_ar_model_tables.h',
15142
+        'fix/source/structs.h',
15143
+      ],
15144
+      'conditions': [
15145
+        ['target_arch=="arm" and arm_version>=7', {
15146
+          'sources': [
15147
+            'fix/source/lattice_armv7.S',
15148
+            'fix/source/pitch_filter_armv6.S',
15149
+          ],
15150
+          'sources!': [
15151
+            'fix/source/lattice_c.c',
15152
+            'fix/source/pitch_filter_c.c',
15153
+          ],
15154
+        }],
15155
+        ['build_with_neon==1', {
15156
+          'dependencies': ['isac_neon', ],
15157
+        }],
15158
+        ['target_arch=="mipsel" and mips_arch_variant!="r6"', {
15159
+          'sources': [
15160
+            'fix/source/entropy_coding_mips.c',
15161
+            'fix/source/filters_mips.c',
15162
+            'fix/source/lattice_mips.c',
15163
+            'fix/source/pitch_estimator_mips.c',
15164
+            'fix/source/transform_mips.c',
15165
+          ],
15166
+          'sources!': [
15167
+            'fix/source/lattice_c.c',
15168
+            'fix/source/pitch_estimator_c.c',
15169
+          ],
15170
+          'conditions': [
15171
+            ['mips_dsp_rev>0', {
15172
+              'sources': [
15173
+                'fix/source/filterbanks_mips.c',
15174
+              ],
15175
+            }],
15176
+            ['mips_dsp_rev>1', {
15177
+              'sources': [
15178
+                'fix/source/lpc_masking_model_mips.c',
15179
+                'fix/source/pitch_filter_mips.c',
15180
+              ],
15181
+              'sources!': [
15182
+                'fix/source/pitch_filter_c.c',
15183
+              ],
15184
+            }],
15185
+          ],
15186
+        }],
15187
+      ],
15188
+    },
15189
+  ],
15190
+  'conditions': [
15191
+    ['build_with_neon==1', {
15192
+      'targets': [
15193
+        {
15194
+          'target_name': 'isac_neon',
15195
+          'type': 'static_library',
15196
+          'includes': ['../../../../build/arm_neon.gypi',],
15197
+          'dependencies': [
15198
+            '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
15199
+          ],
15200
+          'sources': [
15201
+            'fix/source/entropy_coding_neon.c',
15202
+            'fix/source/filterbanks_neon.c',
15203
+            'fix/source/filters_neon.c',
15204
+            'fix/source/lattice_neon.c',
15205
+            'fix/source/transform_neon.c',
15206
+          ],
15207
+        },
15208
+      ],
15209
+    }],
15210
+  ],
15211
+}
15212
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isacfix_test.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isacfix_test.gypi
15213
new file mode 100644
15214
index 000000000000..7d9bc995199d
15215
--- /dev/null
15216
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/isac/isacfix_test.gypi
15217
@@ -0,0 +1,35 @@
15218
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
15219
+#
15220
+# Use of this source code is governed by a BSD-style license
15221
+# that can be found in the LICENSE file in the root of the source
15222
+# tree. An additional intellectual property rights grant can be found
15223
+# in the file PATENTS.  All contributing project authors may
15224
+# be found in the AUTHORS file in the root of the source tree.
15225
+
15226
+{
15227
+  'targets': [
15228
+    # kenny
15229
+    {
15230
+      'target_name': 'isac_fix_test',
15231
+      'type': 'executable',
15232
+      'dependencies': [
15233
+        'isac_fix',
15234
+        '<(webrtc_root)/test/test.gyp:test_support',
15235
+      ],
15236
+      'include_dirs': [
15237
+        './fix/test',
15238
+        './fix/include',
15239
+        '<(webrtc_root)',
15240
+      ],
15241
+      'sources': [
15242
+        './fix/test/kenny.cc',
15243
+      ],
15244
+      # Disable warnings to enable Win64 build, issue 1323.
15245
+      'msvs_disabled_warnings': [
15246
+        4267,  # size_t to int truncation.
15247
+      ],
15248
+    },
15249
+  ],
15250
+}
15251
+
15252
+# TODO(kma): Add bit-exact test for iSAC-fix.
15253
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
15254
new file mode 100644
15255
index 000000000000..b2bffc1d1e9d
15256
--- /dev/null
15257
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/opus/opus.gypi
15258
@@ -0,0 +1,68 @@
15259
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
15260
+#
15261
+# Use of this source code is governed by a BSD-style license
15262
+# that can be found in the LICENSE file in the root of the source
15263
+# tree. An additional intellectual property rights grant can be found
15264
+# in the file PATENTS.  All contributing project authors may
15265
+# be found in the AUTHORS file in the root of the source tree.
15266
+
15267
+{
15268
+  'variables': {
15269
+    'opus_complexity%': 0,
15270
+  },
15271
+  'targets': [
15272
+    {
15273
+      'target_name': 'webrtc_opus',
15274
+      'type': 'static_library',
15275
+      'conditions': [
15276
+        ['build_opus==1', {
15277
+          'dependencies': [
15278
+            '<(opus_dir)/opus.gyp:opus'
15279
+          ],
15280
+          'export_dependent_settings': [
15281
+            '<(opus_dir)/opus.gyp:opus',
15282
+          ],
15283
+          'direct_dependent_settings': {
15284
+            'include_dirs': [  # need by Neteq audio classifier.
15285
+              '<(opus_dir)/src/src',
15286
+              '<(opus_dir)/src/celt',
15287
+            ],
15288
+          },
15289
+        }, {
15290
+          'conditions': [
15291
+            ['build_with_mozilla==1', {
15292
+              # Mozilla provides its own build of the opus library.
15293
+             'include_dirs': [
15294
+                '/media/libopus/include',
15295
+                '/media/libopus/src',
15296
+                '/media/libopus/celt',
15297
+              ],
15298
+              'direct_dependent_settings': {
15299
+                'include_dirs': [
15300
+                  '/media/libopus/include',
15301
+                  '/media/libopus/src',
15302
+                  '/media/libopus/celt',
15303
+                ],
15304
+              },
15305
+            }],
15306
+          ],
15307
+        }],
15308
+      ],
15309
+      'dependencies': [
15310
+        'audio_encoder_interface',
15311
+      ],
15312
+      'defines': [
15313
+        'OPUS_COMPLEXITY=<(opus_complexity)'
15314
+      ],
15315
+      'sources': [
15316
+        'audio_decoder_opus.cc',
15317
+        'audio_decoder_opus.h',
15318
+        'audio_encoder_opus.cc',
15319
+        'audio_encoder_opus.h',
15320
+        'opus_inst.h',
15321
+        'opus_interface.c',
15322
+        'opus_interface.h',
15323
+      ],
15324
+    },
15325
+  ],
15326
+}
15327
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.gypi
15328
new file mode 100644
15329
index 000000000000..e6ffb16640fe
15330
--- /dev/null
15331
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/pcm16b/pcm16b.gypi
15332
@@ -0,0 +1,29 @@
15333
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
15334
+#
15335
+# Use of this source code is governed by a BSD-style license
15336
+# that can be found in the LICENSE file in the root of the source
15337
+# tree. An additional intellectual property rights grant can be found
15338
+# in the file PATENTS.  All contributing project authors may
15339
+# be found in the AUTHORS file in the root of the source tree.
15340
+
15341
+{
15342
+  'targets': [
15343
+    {
15344
+      'target_name': 'pcm16b',
15345
+      'type': 'static_library',
15346
+      'dependencies': [
15347
+        'audio_encoder_interface',
15348
+        'audio_decoder_interface',
15349
+        'g711',
15350
+      ],
15351
+      'sources': [
15352
+        'audio_decoder_pcm16b.cc',
15353
+        'audio_decoder_pcm16b.h',
15354
+        'audio_encoder_pcm16b.cc',
15355
+        'audio_encoder_pcm16b.h',
15356
+        'pcm16b.c',
15357
+        'pcm16b.h',
15358
+      ],
15359
+    },
15360
+  ], # targets
15361
+}
15362
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/codecs/red/red.gypi media/webrtc/trunk/webrtc/modules/audio_coding/codecs/red/red.gypi
15363
new file mode 100644
15364
index 000000000000..667ac866c9c3
15365
--- /dev/null
15366
+++ media/webrtc/trunk/webrtc/modules/audio_coding/codecs/red/red.gypi
15367
@@ -0,0 +1,33 @@
15368
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
15369
+#
15370
+# Use of this source code is governed by a BSD-style license
15371
+# that can be found in the LICENSE file in the root of the source
15372
+# tree. An additional intellectual property rights grant can be found
15373
+# in the file PATENTS.  All contributing project authors may
15374
+# be found in the AUTHORS file in the root of the source tree.
15375
+
15376
+{
15377
+  'targets': [
15378
+    {
15379
+      'target_name': 'red',
15380
+      'type': 'static_library',
15381
+      'dependencies': [
15382
+        'audio_encoder_interface',
15383
+      ],
15384
+      'include_dirs': [
15385
+        'include',
15386
+        '<(webrtc_root)',
15387
+      ],
15388
+      'direct_dependent_settings': {
15389
+        'include_dirs': [
15390
+          'include',
15391
+          '<(webrtc_root)',
15392
+        ],
15393
+      },
15394
+      'sources': [
15395
+        'audio_encoder_copy_red.h',
15396
+        'audio_encoder_copy_red.cc',
15397
+      ],
15398
+    },
15399
+  ], # targets
15400
+}
15401
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi
15402
new file mode 100644
15403
index 000000000000..c77ef5087d12
15404
--- /dev/null
15405
+++ media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq.gypi
15406
@@ -0,0 +1,130 @@
15407
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
15408
+#
15409
+# Use of this source code is governed by a BSD-style license
15410
+# that can be found in the LICENSE file in the root of the source
15411
+# tree. An additional intellectual property rights grant can be found
15412
+# in the file PATENTS.  All contributing project authors may
15413
+# be found in the AUTHORS file in the root of the source tree.
15414
+
15415
+{
15416
+  'variables': {
15417
+    'codecs': [
15418
+      'cng',
15419
+      'g711',
15420
+      'pcm16b',
15421
+    ],
15422
+    'neteq_defines': [],
15423
+    'conditions': [
15424
+      ['include_ilbc==1', {
15425
+        'codecs': ['ilbc',],
15426
+        'neteq_defines': ['WEBRTC_CODEC_ILBC',],
15427
+      }],
15428
+      ['include_opus==1', {
15429
+        'codecs': ['webrtc_opus',],
15430
+        'neteq_defines': ['WEBRTC_CODEC_OPUS',],
15431
+      }],
15432
+      ['include_g722==1', {
15433
+        'codecs': ['g722',],
15434
+        'neteq_defines': ['WEBRTC_CODEC_G722',],
15435
+      }],
15436
+      ['include_isac==1', {
15437
+        'codecs': ['isac', 'isac_fix',],
15438
+        'neteq_defines': ['WEBRTC_CODEC_ISAC', 'WEBRTC_CODEC_ISACFIX',],
15439
+      }],
15440
+    ],
15441
+    'neteq_dependencies': [
15442
+      '<@(codecs)',
15443
+      '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
15444
+      '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
15445
+      'audio_decoder_interface',
15446
+    ],
15447
+  },
15448
+  'targets': [
15449
+    {
15450
+      'target_name': 'neteq',
15451
+      'type': 'static_library',
15452
+      'dependencies': [
15453
+        '<@(neteq_dependencies)',
15454
+        '<(webrtc_root)/common.gyp:webrtc_common',
15455
+        'builtin_audio_decoder_factory',
15456
+        'rent_a_codec',
15457
+      ],
15458
+      'defines': [
15459
+        '<@(neteq_defines)',
15460
+      ],
15461
+      'sources': [
15462
+        'include/neteq.h',
15463
+        'accelerate.cc',
15464
+        'accelerate.h',
15465
+        'audio_decoder_impl.cc',
15466
+        'audio_decoder_impl.h',
15467
+        'audio_multi_vector.cc',
15468
+        'audio_multi_vector.h',
15469
+        'audio_vector.cc',
15470
+        'audio_vector.h',
15471
+        'background_noise.cc',
15472
+        'background_noise.h',
15473
+        'buffer_level_filter.cc',
15474
+        'buffer_level_filter.h',
15475
+        'comfort_noise.cc',
15476
+        'comfort_noise.h',
15477
+        'cross_correlation.cc',
15478
+        'cross_correlation.h',
15479
+        'decision_logic.cc',
15480
+        'decision_logic.h',
15481
+        'decision_logic_fax.cc',
15482
+        'decision_logic_fax.h',
15483
+        'decision_logic_normal.cc',
15484
+        'decision_logic_normal.h',
15485
+        'decoder_database.cc',
15486
+        'decoder_database.h',
15487
+        'defines.h',
15488
+        'delay_manager.cc',
15489
+        'delay_manager.h',
15490
+        'delay_peak_detector.cc',
15491
+        'delay_peak_detector.h',
15492
+        'dsp_helper.cc',
15493
+        'dsp_helper.h',
15494
+        'dtmf_buffer.cc',
15495
+        'dtmf_buffer.h',
15496
+        'dtmf_tone_generator.cc',
15497
+        'dtmf_tone_generator.h',
15498
+        'expand.cc',
15499
+        'expand.h',
15500
+        'merge.cc',
15501
+        'merge.h',
15502
+        'nack_tracker.h',
15503
+        'nack_tracker.cc',
15504
+        'neteq_impl.cc',
15505
+        'neteq_impl.h',
15506
+        'neteq.cc',
15507
+        'statistics_calculator.cc',
15508
+        'statistics_calculator.h',
15509
+        'normal.cc',
15510
+        'normal.h',
15511
+        'packet.cc',
15512
+        'packet.h',
15513
+        'packet_buffer.cc',
15514
+        'packet_buffer.h',
15515
+        'red_payload_splitter.cc',
15516
+        'red_payload_splitter.h',
15517
+        'post_decode_vad.cc',
15518
+        'post_decode_vad.h',
15519
+        'preemptive_expand.cc',
15520
+        'preemptive_expand.h',
15521
+        'random_vector.cc',
15522
+        'random_vector.h',
15523
+        'rtcp.cc',
15524
+        'rtcp.h',
15525
+        'sync_buffer.cc',
15526
+        'sync_buffer.h',
15527
+        'tick_timer.cc',
15528
+        'tick_timer.h',
15529
+        'timestamp_scaler.cc',
15530
+        'timestamp_scaler.h',
15531
+        'time_stretch.cc',
15532
+        'time_stretch.h',
15533
+      ],
15534
+    },
15535
+  ], # targets
15536
+}
15537
diff --git media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq_tests.gypi media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq_tests.gypi
15538
new file mode 100644
15539
index 000000000000..b37eb5193022
15540
--- /dev/null
15541
+++ media/webrtc/trunk/webrtc/modules/audio_coding/neteq/neteq_tests.gypi
15542
@@ -0,0 +1,312 @@
15543
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
15544
+#
15545
+# Use of this source code is governed by a BSD-style license
15546
+# that can be found in the LICENSE file in the root of the source
15547
+# tree. An additional intellectual property rights grant can be found
15548
+# in the file PATENTS.  All contributing project authors may
15549
+# be found in the AUTHORS file in the root of the source tree.
15550
+
15551
+{
15552
+  'conditions': [
15553
+    ['enable_protobuf==1', {
15554
+      'targets': [
15555
+        {
15556
+          'target_name': 'neteq_rtpplay',
15557
+          'type': 'executable',
15558
+          'dependencies': [
15559
+            '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
15560
+            '<(webrtc_root)/test/test.gyp:test_support',
15561
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
15562
+            'neteq',
15563
+            'neteq_unittest_tools',
15564
+          ],
15565
+          'sources': [
15566
+            'tools/neteq_rtpplay.cc',
15567
+          ],
15568
+          'defines': [
15569
+          ],
15570
+        }, # neteq_rtpplay
15571
+      ],
15572
+    }],
15573
+  ],
15574
+  'targets': [
15575
+    {
15576
+      'target_name': 'RTPencode',
15577
+      'type': 'executable',
15578
+      'dependencies': [
15579
+        # TODO(hlundin): Make RTPencode use ACM to encode files.
15580
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
15581
+        'cng',
15582
+        'g711',
15583
+        'g722',
15584
+        'ilbc',
15585
+        'isac',
15586
+        'neteq_test_tools',  # Test helpers
15587
+        'pcm16b',
15588
+        'webrtc_opus',
15589
+      ],
15590
+      'defines': [
15591
+        'CODEC_ILBC',
15592
+        'CODEC_PCM16B',
15593
+        'CODEC_G711',
15594
+        'CODEC_G722',
15595
+        'CODEC_ISAC',
15596
+        'CODEC_PCM16B_WB',
15597
+        'CODEC_ISAC_SWB',
15598
+        'CODEC_PCM16B_32KHZ',
15599
+        'CODEC_PCM16B_48KHZ',
15600
+        'CODEC_CNGCODEC8',
15601
+        'CODEC_CNGCODEC16',
15602
+        'CODEC_CNGCODEC32',
15603
+        'CODEC_ATEVENT_DECODE',
15604
+        'CODEC_RED',
15605
+        'CODEC_OPUS',
15606
+      ],
15607
+      'include_dirs': [
15608
+        'include',
15609
+        'test',
15610
+        '<(webrtc_root)',
15611
+      ],
15612
+      'sources': [
15613
+        'test/RTPencode.cc',
15614
+      ],
15615
+      # Disable warnings to enable Win64 build, issue 1323.
15616
+      'msvs_disabled_warnings': [
15617
+        4267,  # size_t to int truncation.
15618
+      ],
15619
+    },
15620
+
15621
+    {
15622
+      'target_name': 'RTPjitter',
15623
+      'type': 'executable',
15624
+      'dependencies': [
15625
+        '<(webrtc_root)/common.gyp:webrtc_common',
15626
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15627
+      ],
15628
+      'sources': [
15629
+        'test/RTPjitter.cc',
15630
+      ],
15631
+    },
15632
+
15633
+    {
15634
+      'target_name': 'rtp_analyze',
15635
+      'type': 'executable',
15636
+      'dependencies': [
15637
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15638
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
15639
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
15640
+        'neteq_unittest_tools',
15641
+      ],
15642
+      'sources': [
15643
+        'tools/rtp_analyze.cc',
15644
+      ],
15645
+    },
15646
+
15647
+    {
15648
+      'target_name': 'RTPchange',
15649
+      'type': 'executable',
15650
+      'dependencies': [
15651
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15652
+        'neteq_test_tools',
15653
+      ],
15654
+      'sources': [
15655
+       'test/RTPchange.cc',
15656
+      ],
15657
+    },
15658
+
15659
+    {
15660
+      'target_name': 'RTPtimeshift',
15661
+      'type': 'executable',
15662
+      'dependencies': [
15663
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15664
+        'neteq_test_tools',
15665
+      ],
15666
+      'sources': [
15667
+        'test/RTPtimeshift.cc',
15668
+      ],
15669
+    },
15670
+
15671
+    {
15672
+      'target_name': 'rtpcat',
15673
+      'type': 'executable',
15674
+      'dependencies': [
15675
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15676
+        '<(webrtc_root)/test/test.gyp:rtp_test_utils',
15677
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
15678
+      ],
15679
+      'sources': [
15680
+        'tools/rtpcat.cc',
15681
+      ],
15682
+    },
15683
+
15684
+    {
15685
+      'target_name': 'audio_classifier_test',
15686
+      'type': 'executable',
15687
+      'dependencies': [
15688
+        'neteq',
15689
+        'webrtc_opus',
15690
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
15691
+      ],
15692
+      'sources': [
15693
+        'test/audio_classifier_test.cc',
15694
+      ],
15695
+    },
15696
+
15697
+    {
15698
+      'target_name': 'neteq_test_support',
15699
+      'type': 'static_library',
15700
+      'dependencies': [
15701
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15702
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
15703
+        'neteq',
15704
+        'neteq_unittest_tools',
15705
+        'pcm16b',
15706
+      ],
15707
+      'sources': [
15708
+        'tools/neteq_external_decoder_test.cc',
15709
+        'tools/neteq_external_decoder_test.h',
15710
+        'tools/neteq_performance_test.cc',
15711
+        'tools/neteq_performance_test.h',
15712
+      ],
15713
+    }, # neteq_test_support
15714
+
15715
+    {
15716
+      'target_name': 'neteq_quality_test_support',
15717
+      'type': 'static_library',
15718
+      'dependencies': [
15719
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15720
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
15721
+        'neteq',
15722
+        'neteq_unittest_tools',
15723
+      ],
15724
+      'sources': [
15725
+        'tools/neteq_quality_test.cc',
15726
+        'tools/neteq_quality_test.h',
15727
+      ],
15728
+    }, # neteq_test_support
15729
+
15730
+    {
15731
+      'target_name': 'neteq_speed_test',
15732
+      'type': 'executable',
15733
+      'dependencies': [
15734
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
15735
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
15736
+        '<(webrtc_root)/test/test.gyp:test_support',
15737
+        'neteq',
15738
+        'neteq_test_support',
15739
+      ],
15740
+      'sources': [
15741
+        'test/neteq_speed_test.cc',
15742
+      ],
15743
+    },
15744
+
15745
+    {
15746
+      'target_name': 'neteq_opus_quality_test',
15747
+      'type': 'executable',
15748
+      'dependencies': [
15749
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15750
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
15751
+        '<(webrtc_root)/test/test.gyp:test_support_main',
15752
+        'neteq',
15753
+        'neteq_quality_test_support',
15754
+        'webrtc_opus',
15755
+      ],
15756
+      'sources': [
15757
+        'test/neteq_opus_quality_test.cc',
15758
+      ],
15759
+    },
15760
+
15761
+    {
15762
+      'target_name': 'neteq_isac_quality_test',
15763
+      'type': 'executable',
15764
+      'dependencies': [
15765
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15766
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
15767
+        '<(webrtc_root)/test/test.gyp:test_support_main',
15768
+        'isac_fix',
15769
+        'neteq',
15770
+        'neteq_quality_test_support',
15771
+      ],
15772
+      'sources': [
15773
+        'test/neteq_isac_quality_test.cc',
15774
+      ],
15775
+    },
15776
+
15777
+    {
15778
+      'target_name': 'neteq_pcmu_quality_test',
15779
+      'type': 'executable',
15780
+      'dependencies': [
15781
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15782
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
15783
+        '<(webrtc_root)/test/test.gyp:test_support_main',
15784
+        'g711',
15785
+        'neteq',
15786
+        'neteq_quality_test_support',
15787
+      ],
15788
+      'sources': [
15789
+        'test/neteq_pcmu_quality_test.cc',
15790
+      ],
15791
+    },
15792
+
15793
+    {
15794
+      'target_name': 'neteq_ilbc_quality_test',
15795
+      'type': 'executable',
15796
+      'dependencies': [
15797
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15798
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
15799
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
15800
+        '<(webrtc_root)/test/test.gyp:test_support_main',
15801
+        'neteq',
15802
+        'neteq_quality_test_support',
15803
+        'ilbc',
15804
+      ],
15805
+      'sources': [
15806
+        'test/neteq_ilbc_quality_test.cc',
15807
+      ],
15808
+    },
15809
+
15810
+    {
15811
+     'target_name': 'neteq_test_tools',
15812
+      # Collection of useful functions used in other tests.
15813
+      'type': 'static_library',
15814
+      'variables': {
15815
+        # Expects RTP packets without payloads when enabled.
15816
+        'neteq_dummy_rtp%': 0,
15817
+      },
15818
+      'dependencies': [
15819
+        '<(DEPTH)/testing/gtest.gyp:gtest',
15820
+        '<(webrtc_root)/common.gyp:webrtc_common',
15821
+        'cng',
15822
+        'g711',
15823
+        'g722',
15824
+        'ilbc',
15825
+        'isac',
15826
+        'pcm16b',
15827
+      ],
15828
+      'direct_dependent_settings': {
15829
+        'include_dirs': [
15830
+          'include',
15831
+          'test',
15832
+          '<(webrtc_root)',
15833
+        ],
15834
+      },
15835
+      'defines': [
15836
+      ],
15837
+      'include_dirs': [
15838
+        'include',
15839
+        'test',
15840
+        '<(webrtc_root)',
15841
+      ],
15842
+      'sources': [
15843
+        'test/NETEQTEST_DummyRTPpacket.cc',
15844
+        'test/NETEQTEST_DummyRTPpacket.h',
15845
+        'test/NETEQTEST_RTPpacket.cc',
15846
+        'test/NETEQTEST_RTPpacket.h',
15847
+      ],
15848
+      # Disable warnings to enable Win64 build, issue 1323.
15849
+      'msvs_disabled_warnings': [
15850
+        4267,  # size_t to int truncation.
15851
+      ],
15852
+    },
15853
+  ], # targets
15854
+}
15855
diff --git media/webrtc/trunk/webrtc/modules/audio_conference_mixer/audio_conference_mixer.gypi media/webrtc/trunk/webrtc/modules/audio_conference_mixer/audio_conference_mixer.gypi
15856
new file mode 100644
15857
index 000000000000..9d7179504c4d
15858
--- /dev/null
15859
+++ media/webrtc/trunk/webrtc/modules/audio_conference_mixer/audio_conference_mixer.gypi
15860
@@ -0,0 +1,34 @@
15861
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
15862
+#
15863
+# Use of this source code is governed by a BSD-style license
15864
+# that can be found in the LICENSE file in the root of the source
15865
+# tree. An additional intellectual property rights grant can be found
15866
+# in the file PATENTS.  All contributing project authors may
15867
+# be found in the AUTHORS file in the root of the source tree.
15868
+
15869
+{
15870
+  'targets': [
15871
+    {
15872
+      'target_name': 'audio_conference_mixer',
15873
+      'type': 'static_library',
15874
+      'dependencies': [
15875
+        'audio_processing',
15876
+        'webrtc_utility',
15877
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
15878
+      ],
15879
+      'sources': [
15880
+        'include/audio_conference_mixer.h',
15881
+        'include/audio_conference_mixer_defines.h',
15882
+        'source/audio_frame_manipulator.cc',
15883
+        'source/audio_frame_manipulator.h',
15884
+        'source/memory_pool.h',
15885
+        'source/memory_pool_posix.h',
15886
+        'source/memory_pool_win.h',
15887
+        'source/audio_conference_mixer_impl.cc',
15888
+        'source/audio_conference_mixer_impl.h',
15889
+        'source/time_scheduler.cc',
15890
+        'source/time_scheduler.h',
15891
+      ],
15892
+    },
15893
+  ], # targets
15894
+}
15895
diff --git media/webrtc/trunk/webrtc/modules/audio_device/BUILD.gn media/webrtc/trunk/webrtc/modules/audio_device/BUILD.gn
15896
index 49430c62ed39..ab9406e13fb0 100644
15897
--- media/webrtc/trunk/webrtc/modules/audio_device/BUILD.gn
15898
+++ media/webrtc/trunk/webrtc/modules/audio_device/BUILD.gn
15899
@@ -81,13 +81,6 @@ rtc_static_library("audio_device") {
15900
     "include/audio_device_defines.h",
15901
   ]
15902
 
15903
-  if (build_with_mozilla) {
15904
-    sources += [
15905
-      "opensl/single_rw_fifo.cc",
15906
-      "opensl/single_rw_fifo.h",
15907
-    ]
15908
-  }
15909
-
15910
   include_dirs = []
15911
   if (is_linux) {
15912
     include_dirs += [ "linux" ]
15913
@@ -133,36 +126,26 @@ rtc_static_library("audio_device") {
15914
         "log",
15915
         "OpenSLES",
15916
       ]
15917
-
15918
-      if (build_with_mozilla) {
15919
-        include_dirs += [
15920
-          "/config/external/nspr",
15921
-          "/nsprpub/lib/ds",
15922
-          "/nsprpub/pr/include",
15923
-        ]
15924
-      }
15925
     }
15926
     if (rtc_use_dummy_audio_file_devices) {
15927
       defines += [ "WEBRTC_DUMMY_FILE_DEVICES" ]
15928
     } else {
15929
       if (is_linux) {
15930
         sources += [
15931
+          "linux/alsasymboltable_linux.cc",
15932
+          "linux/alsasymboltable_linux.h",
15933
+          "linux/audio_device_alsa_linux.cc",
15934
+          "linux/audio_device_alsa_linux.h",
15935
+          "linux/audio_mixer_manager_alsa_linux.cc",
15936
+          "linux/audio_mixer_manager_alsa_linux.h",
15937
           "linux/latebindingsymboltable_linux.cc",
15938
           "linux/latebindingsymboltable_linux.h",
15939
         ]
15940
-        libs = [ "dl" ]
15941
-        if (!build_with_mozilla) {
15942
-          sources += [
15943
-            "linux/alsasymboltable_linux.cc",
15944
-            "linux/alsasymboltable_linux.h",
15945
-            "linux/audio_device_alsa_linux.cc",
15946
-            "linux/audio_device_alsa_linux.h",
15947
-            "linux/audio_mixer_manager_alsa_linux.cc",
15948
-            "linux/audio_mixer_manager_alsa_linux.h",
15949
-          ]
15950
-          defines += [ "LINUX_ALSA" ]
15951
-          libs += [ "X11" ]
15952
-        }
15953
+        defines += [ "LINUX_ALSA" ]
15954
+        libs = [
15955
+          "dl",
15956
+          "X11",
15957
+        ]
15958
         if (rtc_include_pulse_audio) {
15959
           sources += [
15960
             "linux/audio_device_pulse_linux.cc",
15961
diff --git media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi
15962
new file mode 100644
15963
index 000000000000..a0c4de18cdcf
15964
--- /dev/null
15965
+++ media/webrtc/trunk/webrtc/modules/audio_device/audio_device.gypi
15966
@@ -0,0 +1,316 @@
15967
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
15968
+#
15969
+# Use of this source code is governed by a BSD-style license
15970
+# that can be found in the LICENSE file in the root of the source
15971
+# tree. An additional intellectual property rights grant can be found
15972
+# in the file PATENTS.  All contributing project authors may
15973
+# be found in the AUTHORS file in the root of the source tree.
15974
+
15975
+{
15976
+  'targets': [
15977
+    {
15978
+      'target_name': 'audio_device',
15979
+      'type': 'static_library',
15980
+      'dependencies': [
15981
+        'webrtc_utility',
15982
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
15983
+        '<(webrtc_root)/common.gyp:webrtc_common',
15984
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
15985
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
15986
+      ],
15987
+      'include_dirs': [
15988
+        '.',
15989
+        '../include',
15990
+        'include',
15991
+        'dummy',  # Contains dummy audio device implementations.
15992
+      ],
15993
+      'direct_dependent_settings': {
15994
+        'include_dirs': [
15995
+          '../include',
15996
+          'include',
15997
+        ],
15998
+      },
15999
+      # TODO(xians): Rename files to e.g. *_linux.{ext}, remove sources in conditions section
16000
+      'sources': [
16001
+        'include/audio_device.h',
16002
+        'include/audio_device_defines.h',
16003
+        'audio_device_buffer.cc',
16004
+        'audio_device_buffer.h',
16005
+        'audio_device_generic.cc',
16006
+        'audio_device_generic.h',
16007
+        'audio_device_config.h',
16008
+        'dummy/audio_device_dummy.cc',
16009
+        'dummy/audio_device_dummy.h',
16010
+        'dummy/file_audio_device.cc',
16011
+        'dummy/file_audio_device.h',
16012
+        'fine_audio_buffer.cc',
16013
+        'fine_audio_buffer.h',
16014
+      ],
16015
+      'conditions': [
16016
+        ['build_with_mozilla==1', {
16017
+          'cflags_mozilla': [
16018
+            '$(NSPR_CFLAGS)',
16019
+          ],
16020
+        }],
16021
+        ['hardware_aec_ns==1', {
16022
+          'defines': [
16023
+            'WEBRTC_HARDWARE_AEC_NS',
16024
+          ],
16025
+        }],
16026
+        ['include_sndio_audio==1', {
16027
+          'include_dirs': [
16028
+            'sndio',
16029
+          ],
16030
+        }], # include_sndio_audio==1
16031
+        ['OS=="linux" or include_alsa_audio==1 or include_pulse_audio==1', {
16032
+          'include_dirs': [
16033
+            'linux',
16034
+          ],
16035
+        }], # OS=="linux" or include_alsa_audio==1 or include_pulse_audio==1
16036
+        ['OS=="ios"', {
16037
+          'include_dirs': [
16038
+            'ios',
16039
+          ],
16040
+        }], # OS==ios
16041
+        ['OS=="mac"', {
16042
+          'include_dirs': [
16043
+            'mac',
16044
+          ],
16045
+        }], # OS==mac
16046
+        ['OS=="win"', {
16047
+          'include_dirs': [
16048
+            'win',
16049
+          ],
16050
+        }],
16051
+        ['OS=="android"', {
16052
+          'include_dirs': [
16053
+            '/widget/android',
16054
+            'android',
16055
+          ],
16056
+        }], # OS==android
16057
+        ['enable_android_opensl==1', {
16058
+          'include_dirs': [
16059
+            'dom/media/systemservices',
16060
+            'opensl',
16061
+          ],
16062
+        }], # enable_android_opensl
16063
+        ['include_internal_audio_device==0', {
16064
+          'defines': [
16065
+            'WEBRTC_DUMMY_AUDIO_BUILD',
16066
+          ],
16067
+        }],
16068
+        ['build_with_chromium==0', {
16069
+          'sources': [
16070
+            # Don't link these into Chrome since they contain static data.
16071
+            'dummy/file_audio_device_factory.cc',
16072
+            'dummy/file_audio_device_factory.h',
16073
+          ],
16074
+        }],
16075
+        ['include_internal_audio_device==1', {
16076
+          'sources': [
16077
+            'audio_device_impl.cc',
16078
+            'audio_device_impl.h',
16079
+            # used externally for getUserMedia
16080
+            'opensl/single_rw_fifo.cc',
16081
+            'opensl/single_rw_fifo.h',
16082
+          ],
16083
+          'conditions': [
16084
+            ['use_dummy_audio_file_devices==1', {
16085
+              'defines': [
16086
+               'WEBRTC_DUMMY_FILE_DEVICES',
16087
+              ],
16088
+            }, { # use_dummy_audio_file_devices==0, so use a platform device.
16089
+              'conditions': [
16090
+                ['OS=="android"', {
16091
+                  'sources': [
16092
+                    'android/audio_device_template.h',
16093
+                    'android/audio_manager.cc',
16094
+                    'android/audio_manager.h',
16095
+                    'android/audio_record_jni.cc',
16096
+                    'android/audio_record_jni.h',
16097
+                    'android/audio_track_jni.cc',
16098
+                    'android/audio_track_jni.h',
16099
+                    'android/build_info.cc',
16100
+                    'android/build_info.h',
16101
+                    'android/opensles_common.cc',
16102
+                    'android/opensles_common.h',
16103
+                    'android/opensles_player.cc',
16104
+                    'android/opensles_player.h',
16105
+                    'android/opensles_recorder.cc',
16106
+                    'android/opensles_recorder.h',
16107
+                  ],
16108
+                  'link_settings': {
16109
+                    'libraries': [
16110
+                      '-llog',
16111
+                      '-lOpenSLES',
16112
+                    ],
16113
+                  },
16114
+                }],
16115
+                ['OS=="linux"', {
16116
+                  'link_settings': {
16117
+                    'libraries': [
16118
+                      '-ldl',
16119
+                    ],
16120
+                  },
16121
+                }],
16122
+                ['include_sndio_audio==1', {
16123
+                  'link_settings': {
16124
+                    'libraries': [
16125
+                      '-lsndio',
16126
+                    ],
16127
+                  },
16128
+                  'sources': [
16129
+                    'sndio/audio_device_sndio.cc',
16130
+                    'sndio/audio_device_sndio.h',
16131
+                  ],
16132
+                }],
16133
+                ['include_alsa_audio==1', {
16134
+                  'cflags_mozilla': [
16135
+                    '$(MOZ_ALSA_CFLAGS)',
16136
+                  ],
16137
+                  'defines': [
16138
+                    'LINUX_ALSA',
16139
+                  ],
16140
+                  'link_settings': {
16141
+                    'libraries': [
16142
+                      '-lX11',
16143
+                    ],
16144
+                  },
16145
+                  'sources': [
16146
+                    'linux/alsasymboltable_linux.cc',
16147
+                    'linux/alsasymboltable_linux.h',
16148
+                    'linux/audio_device_alsa_linux.cc',
16149
+                    'linux/audio_device_alsa_linux.h',
16150
+                    'linux/audio_mixer_manager_alsa_linux.cc',
16151
+                    'linux/audio_mixer_manager_alsa_linux.h',
16152
+                    'linux/latebindingsymboltable_linux.cc',
16153
+                    'linux/latebindingsymboltable_linux.h',
16154
+                  ],
16155
+                }],
16156
+                ['include_pulse_audio==1', {
16157
+                  'cflags_mozilla': [
16158
+                    '$(MOZ_PULSEAUDIO_CFLAGS)',
16159
+                  ],
16160
+                  'defines': [
16161
+                    'LINUX_PULSE',
16162
+                  ],
16163
+                  'link_settings': {
16164
+                    'libraries': [
16165
+                      '-lX11',
16166
+                    ],
16167
+                  },
16168
+                  'sources': [
16169
+                    'linux/audio_device_pulse_linux.cc',
16170
+                    'linux/audio_device_pulse_linux.h',
16171
+                    'linux/audio_mixer_manager_pulse_linux.cc',
16172
+                    'linux/audio_mixer_manager_pulse_linux.h',
16173
+                    'linux/latebindingsymboltable_linux.cc',
16174
+                    'linux/latebindingsymboltable_linux.h',
16175
+                    'linux/pulseaudiosymboltable_linux.cc',
16176
+                    'linux/pulseaudiosymboltable_linux.h',
16177
+                  ],
16178
+                }],
16179
+                ['OS=="mac"', {
16180
+                  'sources': [
16181
+                    'mac/audio_device_mac.cc',
16182
+                    'mac/audio_device_mac.h',
16183
+                    'mac/audio_mixer_manager_mac.cc',
16184
+                    'mac/audio_mixer_manager_mac.h',
16185
+                    'mac/portaudio/pa_memorybarrier.h',
16186
+                    'mac/portaudio/pa_ringbuffer.c',
16187
+                    'mac/portaudio/pa_ringbuffer.h',
16188
+                  ],
16189
+                  'link_settings': {
16190
+                    'libraries': [
16191
+                      '$(SDKROOT)/System/Library/Frameworks/AudioToolbox.framework',
16192
+                      '$(SDKROOT)/System/Library/Frameworks/CoreAudio.framework',
16193
+                    ],
16194
+                  },
16195
+                }],
16196
+                ['OS=="ios"', {
16197
+                  'dependencies': [
16198
+                    '<(webrtc_root)/base/base.gyp:rtc_base',
16199
+                    '<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_common_objc',
16200
+                  ],
16201
+                  'export_dependent_settings': [
16202
+                    '<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_common_objc',
16203
+                  ],
16204
+                  'sources': [
16205
+                    'ios/audio_device_ios.h',
16206
+                    'ios/audio_device_ios.mm',
16207
+                    'ios/audio_device_not_implemented_ios.mm',
16208
+                    'ios/audio_session_observer.h',
16209
+                    'ios/objc/RTCAudioSession+Configuration.mm',
16210
+                    'ios/objc/RTCAudioSession+Private.h',
16211
+                    'ios/objc/RTCAudioSession.h',
16212
+                    'ios/objc/RTCAudioSession.mm',
16213
+                    'ios/objc/RTCAudioSessionConfiguration.h',
16214
+                    'ios/objc/RTCAudioSessionConfiguration.m',
16215
+                    'ios/objc/RTCAudioSessionDelegateAdapter.h',
16216
+                    'ios/objc/RTCAudioSessionDelegateAdapter.mm',
16217
+                    'ios/voice_processing_audio_unit.h',
16218
+                    'ios/voice_processing_audio_unit.mm',
16219
+                  ],
16220
+                  'xcode_settings': {
16221
+                    'CLANG_ENABLE_OBJC_ARC': 'YES',
16222
+                  },
16223
+                  'link_settings': {
16224
+                    'xcode_settings': {
16225
+                      'OTHER_LDFLAGS': [
16226
+                        '-framework AudioToolbox',
16227
+                        '-framework AVFoundation',
16228
+                        '-framework Foundation',
16229
+                        '-framework UIKit',
16230
+                      ],
16231
+                    },
16232
+                  },
16233
+                }],
16234
+                ['OS=="win"', {
16235
+                  'sources': [
16236
+                    'win/audio_device_core_win.cc',
16237
+                    'win/audio_device_core_win.h',
16238
+                    'win/audio_device_wave_win.cc',
16239
+                    'win/audio_device_wave_win.h',
16240
+                    'win/audio_mixer_manager_win.cc',
16241
+                    'win/audio_mixer_manager_win.h',
16242
+                  ],
16243
+                  'link_settings': {
16244
+                    'libraries': [
16245
+                      # Required for the built-in WASAPI AEC.
16246
+                      '-ldmoguids.lib',
16247
+                      '-lwmcodecdspuuid.lib',
16248
+                      '-lamstrmid.lib',
16249
+                      '-lmsdmo.lib',
16250
+                    ],
16251
+                  },
16252
+                }],
16253
+                ['OS=="win" and clang==1', {
16254
+                  'msvs_settings': {
16255
+                    'VCCLCompilerTool': {
16256
+                      'AdditionalOptions': [
16257
+                        # Disable warnings failing when compiling with Clang on Windows.
16258
+                        # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
16259
+                        '-Wno-bool-conversion',
16260
+                        '-Wno-delete-non-virtual-dtor',
16261
+                        '-Wno-logical-op-parentheses',
16262
+                        '-Wno-microsoft-extra-qualification',
16263
+                        '-Wno-microsoft-goto',
16264
+                        '-Wno-missing-braces',
16265
+                        '-Wno-parentheses-equality',
16266
+                        '-Wno-reorder',
16267
+                        '-Wno-shift-overflow',
16268
+                        '-Wno-tautological-compare',
16269
+                        '-Wno-unused-private-field',
16270
+                      ],
16271
+                    },
16272
+                  },
16273
+                }],
16274
+              ], # conditions (for non-dummy devices)
16275
+            }], # use_dummy_audio_file_devices check
16276
+          ], # conditions
16277
+        }], # include_internal_audio_device==1
16278
+      ], # conditions
16279
+    },
16280
+  ],
16281
+}
16282
+
16283
diff --git media/webrtc/trunk/webrtc/modules/audio_mixer/audio_mixer.gypi media/webrtc/trunk/webrtc/modules/audio_mixer/audio_mixer.gypi
16284
new file mode 100644
16285
index 000000000000..570129019115
16286
--- /dev/null
16287
+++ media/webrtc/trunk/webrtc/modules/audio_mixer/audio_mixer.gypi
16288
@@ -0,0 +1,33 @@
16289
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
16290
+#
16291
+# Use of this source code is governed by a BSD-style license
16292
+# that can be found in the LICENSE file in the root of the source
16293
+# tree. An additional intellectual property rights grant can be found
16294
+# in the file PATENTS.  All contributing project authors may
16295
+# be found in the AUTHORS file in the root of the source tree.
16296
+
16297
+{
16298
+  'targets': [
16299
+    {
16300
+      'target_name': 'audio_mixer',
16301
+      'type': 'static_library',
16302
+      'dependencies': [
16303
+        'audio_processing',
16304
+        'webrtc_utility',
16305
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
16306
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
16307
+        '<(webrtc_root)/voice_engine/voice_engine.gyp:level_indicator',
16308
+      ],
16309
+      'sources': [
16310
+        'audio_frame_manipulator.cc',
16311
+        'audio_frame_manipulator.h',
16312
+        'audio_mixer.h',
16313
+        'audio_mixer_impl.cc',
16314
+        'audio_mixer_impl.h',
16315
+        'default_output_rate_calculator.cc',
16316
+        'default_output_rate_calculator.h',
16317
+        'output_rate_calculator.h',
16318
+      ],
16319
+    },
16320
+  ], # targets
16321
+}
16322
diff --git media/webrtc/trunk/webrtc/modules/audio_processing/BUILD.gn media/webrtc/trunk/webrtc/modules/audio_processing/BUILD.gn
16323
index 2dcf155935bc..4178a08a761a 100644
16324
--- media/webrtc/trunk/webrtc/modules/audio_processing/BUILD.gn
16325
+++ media/webrtc/trunk/webrtc/modules/audio_processing/BUILD.gn
16326
@@ -7,9 +7,7 @@
16327
 # be found in the AUTHORS file in the root of the source tree.
16328
 
16329
 import("//build/config/arm.gni")
16330
-if (!build_with_mozilla) {
16331
-  import("//third_party/protobuf/proto_library.gni")
16332
-}
16333
+import("//third_party/protobuf/proto_library.gni")
16334
 import("../../build/webrtc.gni")
16335
 
16336
 declare_args() {
16337
diff --git media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing.gypi media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing.gypi
16338
new file mode 100644
16339
index 000000000000..17bf5622b806
16340
--- /dev/null
16341
+++ media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing.gypi
16342
@@ -0,0 +1,351 @@
16343
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
16344
+#
16345
+# Use of this source code is governed by a BSD-style license
16346
+# that can be found in the LICENSE file in the root of the source
16347
+# tree. An additional intellectual property rights grant can be found
16348
+# in the file PATENTS.  All contributing project authors may
16349
+# be found in the AUTHORS file in the root of the source tree.
16350
+
16351
+{
16352
+  'includes': [
16353
+    '../../build/common.gypi',
16354
+  ],
16355
+  'variables': {
16356
+    'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/audio_processing/asm_offsets',
16357
+    'apm_debug_dump%': 1,
16358
+  },
16359
+  'targets': [
16360
+    {
16361
+      'target_name': 'audio_processing',
16362
+      'type': 'static_library',
16363
+      'variables': {
16364
+        # Outputs some low-level debug files.
16365
+        'agc_debug_dump%': 0,
16366
+
16367
+        # Disables the usual mode where we trust the reported system delay
16368
+        # values the AEC receives. The corresponding define is set appropriately
16369
+        # in the code, but it can be force-enabled here for testing.
16370
+        'aec_untrusted_delay_for_testing%': 0,
16371
+      },
16372
+      'dependencies': [
16373
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
16374
+        '<(webrtc_root)/common.gyp:webrtc_common',
16375
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
16376
+#        '<(webrtc_root)/modules/modules.gyp:isac',
16377
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
16378
+      ],
16379
+      'sources': [
16380
+        'aec/aec_core.cc',
16381
+        'aec/aec_core.h',
16382
+        'aec/aec_core_optimized_methods.h',
16383
+        'aec/aec_resampler.cc',
16384
+        'aec/aec_resampler.h',
16385
+        'aec/echo_cancellation.cc',
16386
+        'aec/echo_cancellation.h',
16387
+        'aec3/aec3_constants.h',
16388
+        'aec3/block_framer.cc',
16389
+        'aec3/block_framer.h',
16390
+        'aec3/block_processor.cc',
16391
+        'aec3/block_processor.h',
16392
+        'aec3/cascaded_biquad_filter.cc',
16393
+        'aec3/cascaded_biquad_filter.h',
16394
+        'aec3/echo_canceller3.cc',
16395
+        'aec3/echo_canceller3.h',
16396
+        'aec3/frame_blocker.cc',
16397
+        'aec3/frame_blocker.h',
16398
+        'aecm/aecm_core.cc',
16399
+        'aecm/aecm_core.h',
16400
+        'aecm/echo_control_mobile.cc',
16401
+        'aecm/echo_control_mobile.h',
16402
+        'agc/agc.cc',
16403
+        'agc/agc.h',
16404
+        'agc/agc_manager_direct.cc',
16405
+        'agc/agc_manager_direct.h',
16406
+        'agc/gain_map_internal.h',
16407
+        'agc/legacy/analog_agc.c',
16408
+        'agc/legacy/analog_agc.h',
16409
+        'agc/legacy/digital_agc.c',
16410
+        'agc/legacy/digital_agc.h',
16411
+        'agc/legacy/gain_control.h',
16412
+        'agc/loudness_histogram.cc',
16413
+        'agc/loudness_histogram.h',
16414
+        'agc/legacy/gain_control.h',
16415
+        'agc/utility.cc',
16416
+        'agc/utility.h',
16417
+        'audio_buffer.cc',
16418
+        'audio_buffer.h',
16419
+        'audio_processing_impl.cc',
16420
+        'audio_processing_impl.h',
16421
+        'beamformer/array_util.cc',
16422
+        'beamformer/array_util.h',
16423
+        'beamformer/complex_matrix.h',
16424
+        'beamformer/covariance_matrix_generator.cc',
16425
+        'beamformer/covariance_matrix_generator.h',
16426
+        'beamformer/matrix.h',
16427
+        'beamformer/nonlinear_beamformer.cc',
16428
+        'beamformer/nonlinear_beamformer.h',
16429
+        'common.h',
16430
+        'echo_cancellation_impl.cc',
16431
+        'echo_cancellation_impl.h',
16432
+        'echo_control_mobile_impl.cc',
16433
+        'echo_control_mobile_impl.h',
16434
+        'echo_detector/circular_buffer.cc',
16435
+        'echo_detector/circular_buffer.h',
16436
+        'echo_detector/mean_variance_estimator.cc',
16437
+        'echo_detector/mean_variance_estimator.h',
16438
+        'echo_detector/moving_max.cc',
16439
+        'echo_detector/moving_max.h',
16440
+        'echo_detector/normalized_covariance_estimator.cc',
16441
+        'echo_detector/normalized_covariance_estimator.h',
16442
+        'gain_control_for_experimental_agc.cc',
16443
+        'gain_control_for_experimental_agc.h',
16444
+        'gain_control_impl.cc',
16445
+        'gain_control_impl.h',
16446
+        'include/audio_processing.cc',
16447
+        'include/audio_processing.h',
16448
+        'include/config.cc',
16449
+        'include/config.h',
16450
+        'level_controller/biquad_filter.cc',
16451
+        'level_controller/biquad_filter.h',
16452
+        'level_controller/down_sampler.cc',
16453
+        'level_controller/down_sampler.h',
16454
+        'level_controller/gain_applier.cc',
16455
+        'level_controller/gain_applier.h',
16456
+        'level_controller/gain_selector.cc',
16457
+        'level_controller/gain_selector.h',
16458
+        'level_controller/lc_constants.h',
16459
+        'level_controller/level_controller.cc',
16460
+        'level_controller/level_controller.h',
16461
+        'level_controller/noise_spectrum_estimator.cc',
16462
+        'level_controller/noise_spectrum_estimator.h',
16463
+        'level_controller/noise_level_estimator.cc',
16464
+        'level_controller/noise_level_estimator.h',
16465
+        'level_controller/peak_level_estimator.cc',
16466
+        'level_controller/peak_level_estimator.h',
16467
+        'level_controller/saturating_gain_estimator.cc',
16468
+        'level_controller/saturating_gain_estimator.h',
16469
+        'level_controller/signal_classifier.cc',
16470
+        'level_controller/signal_classifier.h',
16471
+        'level_estimator_impl.cc',
16472
+        'level_estimator_impl.h',
16473
+        'logging/apm_data_dumper.cc',
16474
+        'logging/apm_data_dumper.h',
16475
+        'low_cut_filter.cc',
16476
+        'low_cut_filter.h',
16477
+        'noise_suppression_impl.cc',
16478
+        'noise_suppression_impl.h',
16479
+        'render_queue_item_verifier.h',
16480
+        'residual_echo_detector.cc',
16481
+        'residual_echo_detector.h',
16482
+        'rms_level.cc',
16483
+        'rms_level.h',
16484
+        'splitting_filter.cc',
16485
+        'splitting_filter.h',
16486
+        'three_band_filter_bank.cc',
16487
+        'three_band_filter_bank.h',
16488
+        'transient/common.h',
16489
+        'transient/daubechies_8_wavelet_coeffs.h',
16490
+        'transient/dyadic_decimator.h',
16491
+        'transient/moving_moments.cc',
16492
+        'transient/moving_moments.h',
16493
+        'transient/transient_detector.cc',
16494
+        'transient/transient_detector.h',
16495
+        'transient/transient_suppressor.cc',
16496
+        'transient/transient_suppressor.h',
16497
+        'transient/wpd_node.cc',
16498
+        'transient/wpd_node.h',
16499
+        'transient/wpd_tree.cc',
16500
+        'transient/wpd_tree.h',
16501
+        'typing_detection.cc',
16502
+        'typing_detection.h',
16503
+        'utility/block_mean_calculator.cc',
16504
+        'utility/block_mean_calculator.h',
16505
+        'utility/delay_estimator.cc',
16506
+        'utility/delay_estimator.h',
16507
+        'utility/delay_estimator_internal.h',
16508
+        'utility/delay_estimator_wrapper.cc',
16509
+        'utility/delay_estimator_wrapper.h',
16510
+        'utility/ooura_fft.cc',
16511
+        'utility/ooura_fft.h',
16512
+        'utility/ooura_fft_tables_common.h',
16513
+        'vad/common.h',
16514
+        'vad/gmm.cc',
16515
+        'vad/gmm.h',
16516
+        'vad/noise_gmm_tables.h',
16517
+        'vad/pitch_based_vad.cc',
16518
+        'vad/pitch_based_vad.h',
16519
+        'vad/pitch_internal.cc',
16520
+        'vad/pitch_internal.h',
16521
+        'vad/pole_zero_filter.cc',
16522
+        'vad/pole_zero_filter.h',
16523
+        'vad/standalone_vad.cc',
16524
+        'vad/standalone_vad.h',
16525
+        'vad/vad_audio_proc.cc',
16526
+        'vad/vad_audio_proc.h',
16527
+        'vad/vad_audio_proc_internal.h',
16528
+        'vad/vad_circular_buffer.cc',
16529
+        'vad/vad_circular_buffer.h',
16530
+        'vad/voice_activity_detector.cc',
16531
+        'vad/voice_activity_detector.h',
16532
+        'vad/voice_gmm_tables.h',
16533
+        'voice_detection_impl.cc',
16534
+        'voice_detection_impl.h',
16535
+      ],
16536
+      'conditions': [
16537
+        ['apm_debug_dump==1', {
16538
+          'defines': ['WEBRTC_APM_DEBUG_DUMP=1',],
16539
+        }, {
16540
+          'defines': ['WEBRTC_APM_DEBUG_DUMP=0',],
16541
+        }],
16542
+        ['aec_untrusted_delay_for_testing==1', {
16543
+          'defines': ['WEBRTC_UNTRUSTED_DELAY',],
16544
+        }],
16545
+        ['agc_debug_dump==1', {
16546
+          'defines': ['WEBRTC_AGC_DEBUG_DUMP',],
16547
+        }],
16548
+        ['enable_protobuf==1', {
16549
+          'dependencies': ['audioproc_debug_proto'],
16550
+          'defines': ['WEBRTC_AUDIOPROC_DEBUG_DUMP'],
16551
+        }],
16552
+        ['enable_intelligibility_enhancer==1', {
16553
+          'defines': ['WEBRTC_INTELLIGIBILITY_ENHANCER=1',],
16554
+          'sources': [
16555
+            'intelligibility/intelligibility_enhancer.cc',
16556
+            'intelligibility/intelligibility_enhancer.h',
16557
+            'intelligibility/intelligibility_utils.cc',
16558
+            'intelligibility/intelligibility_utils.h',
16559
+          ],
16560
+        }, {
16561
+          'defines': ['WEBRTC_INTELLIGIBILITY_ENHANCER=0',],
16562
+        }],
16563
+        ['prefer_fixed_point==1', {
16564
+          'defines': ['WEBRTC_NS_FIXED'],
16565
+          'sources': [
16566
+            'ns/noise_suppression_x.h',
16567
+            'ns/noise_suppression_x.c',
16568
+            'ns/nsx_core.c',
16569
+            'ns/nsx_core.h',
16570
+            'ns/nsx_defines.h',
16571
+          ],
16572
+          'conditions': [
16573
+            ['target_arch=="mipsel" and mips_arch_variant!="r6"', {
16574
+              'sources': [
16575
+                'ns/nsx_core_mips.c',
16576
+              ],
16577
+            }, {
16578
+              'sources': [
16579
+                'ns/nsx_core_c.c',
16580
+              ],
16581
+            }],
16582
+          ],
16583
+        }, {
16584
+          'defines': ['WEBRTC_NS_FLOAT'],
16585
+          'sources': [
16586
+            'ns/defines.h',
16587
+            'ns/noise_suppression.h',
16588
+            'ns/noise_suppression.c',
16589
+            'ns/ns_core.c',
16590
+            'ns/ns_core.h',
16591
+            'ns/windows_private.h',
16592
+          ],
16593
+        }],
16594
+        ['target_arch=="ia32" or target_arch=="x64"', {
16595
+          'dependencies': ['audio_processing_sse2',],
16596
+        }],
16597
+        ['build_with_neon==1', {
16598
+          'dependencies': ['audio_processing_neon',],
16599
+        }],
16600
+        ['target_arch=="mipsel" and mips_arch_variant!="r6"', {
16601
+          'sources': [
16602
+            'aecm/aecm_core_mips.cc',
16603
+          ],
16604
+          'conditions': [
16605
+            ['mips_float_abi=="hard"', {
16606
+              'sources': [
16607
+                'aec/aec_core_mips.cc',
16608
+                'aec/aec_rdft_mips.cc',
16609
+                'utility/ooura_fft_mips.cc',
16610
+              ],
16611
+            }],
16612
+          ],
16613
+        }, {
16614
+          'sources': [
16615
+            'aecm/aecm_core_c.cc',
16616
+          ],
16617
+        }],
16618
+      ],
16619
+      # TODO(jschuh): Bug 1348: fix size_t to int truncations.
16620
+      'msvs_disabled_warnings': [ 4267, ],
16621
+    },
16622
+  ],
16623
+  'conditions': [
16624
+    ['enable_protobuf==1', {
16625
+      'targets': [
16626
+        {
16627
+          'target_name': 'audioproc_debug_proto',
16628
+          'type': 'static_library',
16629
+          'sources': ['debug.proto',],
16630
+          'variables': {
16631
+            'proto_in_dir': '.',
16632
+            # Workaround to protect against gyp's pathname relativization when
16633
+            # this file is included by modules.gyp.
16634
+            'proto_out_protected': 'webrtc/modules/audio_processing',
16635
+            'proto_out_dir': '<(proto_out_protected)',
16636
+          },
16637
+          'includes': ['../../build/protoc.gypi',],
16638
+        },
16639
+      ],
16640
+    }],
16641
+    ['target_arch=="ia32" or target_arch=="x64"', {
16642
+      'targets': [
16643
+        {
16644
+          'target_name': 'audio_processing_sse2',
16645
+          'type': 'static_library',
16646
+          'sources': [
16647
+            'aec/aec_core_sse2.cc',
16648
+            'utility/ooura_fft_sse2.cc',
16649
+            'utility/ooura_fft_tables_neon_sse2.h',
16650
+          ],
16651
+          'conditions': [
16652
+            ['apm_debug_dump==1', {
16653
+              'defines': ['WEBRTC_APM_DEBUG_DUMP=1',],
16654
+            }, {
16655
+              'defines': ['WEBRTC_APM_DEBUG_DUMP=0',],
16656
+            }],
16657
+            ['os_posix==1', {
16658
+              'cflags': [ '-msse2', ],
16659
+              'cflags_mozilla': [ '-msse2', ],
16660
+              'xcode_settings': {
16661
+                'OTHER_CFLAGS': [ '-msse2', ],
16662
+              },
16663
+            }],
16664
+          ],
16665
+        },
16666
+      ],
16667
+    }],
16668
+    ['build_with_neon==1', {
16669
+      'targets': [{
16670
+        'target_name': 'audio_processing_neon',
16671
+        'type': 'static_library',
16672
+        'includes': ['../../build/arm_neon.gypi',],
16673
+        'dependencies': [
16674
+          '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
16675
+        ],
16676
+        'sources': [
16677
+          'aec/aec_core_neon.cc',
16678
+          'aecm/aecm_core_neon.cc',
16679
+          'ns/nsx_core_neon.c',
16680
+          'utility/ooura_fft_neon.cc',
16681
+        ],
16682
+        'conditions': [
16683
+          ['apm_debug_dump==1', {
16684
+            'defines': ['WEBRTC_APM_DEBUG_DUMP=1',],
16685
+          }],
16686
+          ['apm_debug_dump==0', {
16687
+            'defines': ['WEBRTC_APM_DEBUG_DUMP=0',],
16688
+          }],
16689
+        ],
16690
+      }],
16691
+    }],
16692
+  ],
16693
+}
16694
diff --git media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_tests.gypi media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_tests.gypi
16695
new file mode 100644
16696
index 000000000000..d68fed3ff194
16697
--- /dev/null
16698
+++ media/webrtc/trunk/webrtc/modules/audio_processing/audio_processing_tests.gypi
16699
@@ -0,0 +1,166 @@
16700
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
16701
+#
16702
+# Use of this source code is governed by a BSD-style license
16703
+# that can be found in the LICENSE file in the root of the source
16704
+# tree. An additional intellectual property rights grant can be found
16705
+# in the file PATENTS.  All contributing project authors may
16706
+# be found in the AUTHORS file in the root of the source tree.
16707
+
16708
+{
16709
+  'targets': [
16710
+    {
16711
+      'target_name': 'audioproc_test_utils',
16712
+      'type': 'static_library',
16713
+      'dependencies': [
16714
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
16715
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
16716
+      ],
16717
+      'sources': [
16718
+        'test/audio_buffer_tools.cc',
16719
+        'test/audio_buffer_tools.h',
16720
+        'test/test_utils.cc',
16721
+        'test/test_utils.h',
16722
+      ],
16723
+    },
16724
+    {
16725
+      'target_name': 'transient_suppression_test',
16726
+      'type': 'executable',
16727
+      'dependencies': [
16728
+        '<(DEPTH)/testing/gtest.gyp:gtest',
16729
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
16730
+        '<(webrtc_root)/test/test.gyp:test_support',
16731
+        '<(webrtc_root)/modules/modules.gyp:audio_processing',
16732
+      ],
16733
+      'sources': [
16734
+        'transient/transient_suppression_test.cc',
16735
+        'transient/file_utils.cc',
16736
+        'transient/file_utils.h',
16737
+      ],
16738
+    }, # transient_suppression_test
16739
+    {
16740
+      'target_name': 'click_annotate',
16741
+      'type': 'executable',
16742
+      'dependencies': [
16743
+        '<(webrtc_root)/modules/modules.gyp:audio_processing',
16744
+      ],
16745
+      'sources': [
16746
+        'transient/click_annotate.cc',
16747
+        'transient/file_utils.cc',
16748
+        'transient/file_utils.h',
16749
+      ],
16750
+    },  # click_annotate
16751
+    {
16752
+      'target_name': 'nonlinear_beamformer_test',
16753
+      'type': 'executable',
16754
+      'dependencies': [
16755
+        'audioproc_test_utils',
16756
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
16757
+        '<(webrtc_root)/modules/modules.gyp:audio_processing',
16758
+      ],
16759
+      'sources': [
16760
+        'beamformer/nonlinear_beamformer_test.cc',
16761
+      ],
16762
+    }, # nonlinear_beamformer_test
16763
+  ],
16764
+  'conditions': [
16765
+    ['enable_intelligibility_enhancer==1', {
16766
+      'defines': ['WEBRTC_INTELLIGIBILITY_ENHANCER=1',],
16767
+      'targets': [
16768
+        {
16769
+          'target_name': 'intelligibility_proc',
16770
+          'type': 'executable',
16771
+          'dependencies': [
16772
+            'audioproc_test_utils',
16773
+            '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
16774
+            '<(DEPTH)/testing/gtest.gyp:gtest',
16775
+            '<(webrtc_root)/modules/modules.gyp:audio_processing',
16776
+            '<(webrtc_root)/test/test.gyp:test_support',
16777
+          ],
16778
+          'sources': [
16779
+            'intelligibility/test/intelligibility_proc.cc',
16780
+          ],
16781
+        },
16782
+      ],
16783
+    }, {
16784
+      'defines': ['WEBRTC_INTELLIGIBILITY_ENHANCER=0',],
16785
+    }],
16786
+    ['enable_protobuf==1', {
16787
+      'targets': [
16788
+        {
16789
+          'target_name': 'audioproc_unittest_proto',
16790
+          'type': 'static_library',
16791
+          'sources': [ 'test/unittest.proto', ],
16792
+          'variables': {
16793
+            'proto_in_dir': 'test',
16794
+            # Workaround to protect against gyp's pathname relativization when
16795
+            # this file is included by modules.gyp.
16796
+            'proto_out_protected': 'webrtc/modules/audio_processing',
16797
+            'proto_out_dir': '<(proto_out_protected)',
16798
+          },
16799
+          'includes': [ '../../build/protoc.gypi', ],
16800
+        },
16801
+        {
16802
+          'target_name': 'audioproc_protobuf_utils',
16803
+          'type': 'static_library',
16804
+          'dependencies': [
16805
+            'audioproc_debug_proto',
16806
+          ],
16807
+          'sources': [
16808
+            'test/protobuf_utils.cc',
16809
+            'test/protobuf_utils.h',
16810
+          ],
16811
+        },
16812
+        {
16813
+          'target_name': 'audioproc',
16814
+          'type': 'executable',
16815
+          'dependencies': [
16816
+            'audio_processing',
16817
+            'audioproc_debug_proto',
16818
+            'audioproc_test_utils',
16819
+            'audioproc_protobuf_utils',
16820
+            '<(DEPTH)/testing/gtest.gyp:gtest',
16821
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
16822
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
16823
+            '<(webrtc_root)/test/test.gyp:test_support',
16824
+          ],
16825
+          'sources': [ 'test/process_test.cc', ],
16826
+        },
16827
+        {
16828
+          'target_name': 'audioproc_f',
16829
+          'type': 'executable',
16830
+          'dependencies': [
16831
+            'audio_processing',
16832
+            'audioproc_debug_proto',
16833
+            'audioproc_test_utils',
16834
+            'audioproc_protobuf_utils',
16835
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
16836
+            '<(webrtc_root)/test/test.gyp:test_support',
16837
+            '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
16838
+          ],
16839
+          'sources': [
16840
+            'test/audio_processing_simulator.cc',
16841
+            'test/audio_processing_simulator.h',
16842
+            'test/aec_dump_based_simulator.cc',
16843
+            'test/aec_dump_based_simulator.h',
16844
+            'test/wav_based_simulator.cc',
16845
+            'test/wav_based_simulator.h',
16846
+            'test/audioproc_float.cc',
16847
+          ],
16848
+        },
16849
+        {
16850
+          'target_name': 'unpack_aecdump',
16851
+          'type': 'executable',
16852
+          'dependencies': [
16853
+            'audioproc_debug_proto',
16854
+            'audioproc_test_utils',
16855
+            'audioproc_protobuf_utils',
16856
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
16857
+            '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
16858
+            '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
16859
+          ],
16860
+          'sources': [ 'test/unpack.cc', ],
16861
+        },
16862
+      ],
16863
+    }],
16864
+  ],
16865
+}
16866
diff --git media/webrtc/trunk/webrtc/modules/bitrate_controller/bitrate_controller.gypi media/webrtc/trunk/webrtc/modules/bitrate_controller/bitrate_controller.gypi
16867
new file mode 100644
16868
index 000000000000..82121cdddf88
16869
--- /dev/null
16870
+++ media/webrtc/trunk/webrtc/modules/bitrate_controller/bitrate_controller.gypi
16871
@@ -0,0 +1,35 @@
16872
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
16873
+#
16874
+# Use of this source code is governed by a BSD-style license
16875
+# that can be found in the LICENSE file in the root of the source
16876
+# tree. An additional intellectual property rights grant can be found
16877
+# in the file PATENTS.  All contributing project authors may
16878
+# be found in the AUTHORS file in the root of the source tree.
16879
+
16880
+{
16881
+  'targets': [
16882
+    {
16883
+      'target_name': 'bitrate_controller',
16884
+      'type': 'static_library',
16885
+      'dependencies': [
16886
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
16887
+      ],
16888
+      'sources': [
16889
+        'bitrate_controller_impl.cc',
16890
+        'bitrate_controller_impl.h',
16891
+        'include/bitrate_controller.h',
16892
+        'send_side_bandwidth_estimation.cc',
16893
+        'send_side_bandwidth_estimation.h',
16894
+      ],
16895
+      'conditions': [
16896
+        ['enable_bwe_test_logging==1', {
16897
+          'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1' ],
16898
+        }, {
16899
+          'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0' ],
16900
+        }],
16901
+      ],
16902
+      # TODO(jschuh): Bug 1348: fix size_t to int truncations.
16903
+      'msvs_disabled_warnings': [ 4267, ],
16904
+    },
16905
+  ], # targets
16906
+}
16907
diff --git media/webrtc/trunk/webrtc/modules/congestion_controller/BUILD.gn media/webrtc/trunk/webrtc/modules/congestion_controller/BUILD.gn
16908
index 34843a313177..16794a16fe93 100644
16909
--- media/webrtc/trunk/webrtc/modules/congestion_controller/BUILD.gn
16910
+++ media/webrtc/trunk/webrtc/modules/congestion_controller/BUILD.gn
16911
@@ -44,6 +44,7 @@ rtc_static_library("congestion_controller") {
16912
 
16913
   deps = [
16914
     "../..:webrtc_common",
16915
+    "../../base:rtc_base",
16916
     "../../base:rtc_base_approved",
16917
     "../../base:rtc_numerics",
16918
     "../../system_wrappers",
16919
@@ -53,10 +54,4 @@ rtc_static_library("congestion_controller") {
16920
     "../rtp_rtcp",
16921
     "../utility",
16922
   ]
16923
-
16924
-  if (!build_with_mozilla) {
16925
-    deps += [
16926
-      "../../base:rtc_base",
16927
-    ]
16928
-  }
16929
 }
16930
diff --git media/webrtc/trunk/webrtc/modules/congestion_controller/congestion_controller.gypi media/webrtc/trunk/webrtc/modules/congestion_controller/congestion_controller.gypi
16931
new file mode 100644
16932
index 000000000000..83064eb7dc97
16933
--- /dev/null
16934
+++ media/webrtc/trunk/webrtc/modules/congestion_controller/congestion_controller.gypi
16935
@@ -0,0 +1,40 @@
16936
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
16937
+#
16938
+# Use of this source code is governed by a BSD-style license
16939
+# that can be found in the LICENSE file in the root of the source
16940
+# tree. An additional intellectual property rights grant can be found
16941
+# in the file PATENTS.  All contributing project authors may
16942
+# be found in the AUTHORS file in the root of the source tree.
16943
+
16944
+{
16945
+  'targets': [
16946
+    {
16947
+      'target_name': 'congestion_controller',
16948
+      'type': 'static_library',
16949
+      'dependencies': [
16950
+        '<(webrtc_root)/modules/modules.gyp:bitrate_controller',
16951
+        '<(webrtc_root)/modules/modules.gyp:paced_sender',
16952
+      ],
16953
+      'sources': [
16954
+        'congestion_controller.cc',
16955
+        'delay_based_bwe.cc',
16956
+        'delay_based_bwe.h',
16957
+        'include/congestion_controller.h',
16958
+        'median_slope_estimator.cc',
16959
+        'median_slope_estimator.h',
16960
+        'probe_bitrate_estimator.cc',
16961
+        'probe_bitrate_estimator.h',
16962
+        'probe_controller.cc',
16963
+        'probe_controller.h',
16964
+        'probing_interval_estimator.cc',
16965
+        'probing_interval_estimator.h',
16966
+        'transport_feedback_adapter.cc',
16967
+        'transport_feedback_adapter.h',
16968
+        'trendline_estimator.cc',
16969
+        'trendline_estimator.h',
16970
+      ],
16971
+      # TODO(jschuh): Bug 1348: fix size_t to int truncations.
16972
+      'msvs_disabled_warnings': [ 4267, ],
16973
+    },
16974
+  ], # targets
16975
+}
16976
diff --git media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
16977
index ed12a1521eb0..4920611bec6d 100644
16978
--- media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
16979
+++ media/webrtc/trunk/webrtc/modules/desktop_capture/BUILD.gn
16980
@@ -28,13 +28,8 @@ rtc_static_library("primitives") {
16981
 
16982
   deps = [
16983
     "../..:webrtc_common",
16984
+    "../../base:rtc_base",  # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
16985
   ]
16986
-
16987
-  if (!build_with_mozilla) {
16988
-    deps += [
16989
-      "../../base:rtc_base",  # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
16990
-    ]
16991
-  }
16992
 }
16993
 
16994
 if (rtc_include_tests) {
16995
@@ -180,23 +175,6 @@ rtc_static_library("desktop_capture") {
16996
     "window_capturer_win.cc",
16997
   ]
16998
 
16999
-  if (build_with_mozilla) {
17000
-    defines = [ "MULTI_MONITOR_SCREENSHARE" ]
17001
-    sources += [
17002
-      "desktop_device_info.cc",
17003
-      "desktop_device_info.h",
17004
-      "app_capturer_win.cc",
17005
-      "win/desktop_device_info_win.cc",
17006
-      "win/win_shared.cc",
17007
-    ]
17008
-
17009
-    if (is_mac) {
17010
-      sources += [
17011
-        "app_capturer_mac.mm",
17012
-      ]
17013
-    }
17014
-  }
17015
-
17016
   if (use_x11) {
17017
     sources += [
17018
       "mouse_cursor_monitor_x11.cc",
17019
@@ -209,18 +187,6 @@ rtc_static_library("desktop_capture") {
17020
       "x11/x_server_pixel_buffer.cc",
17021
       "x11/x_server_pixel_buffer.h",
17022
     ]
17023
-
17024
-    if (build_with_mozilla) {
17025
-      sources += [
17026
-        "app_capturer_x11.cc",
17027
-        "app_capturer_x11.h",
17028
-        "x11/desktop_device_info_x11.cc",
17029
-        "x11/desktop_device_info_x11.h",
17030
-        "x11/shared_x_util.cc",
17031
-        "x11/shared_x_util.h",
17032
-      ]
17033
-    }
17034
-
17035
     configs += [ "//build/config/linux:x11" ]
17036
   }
17037
 
17038
@@ -238,12 +204,6 @@ rtc_static_library("desktop_capture") {
17039
       "IOKit.framework",
17040
       "OpenGL.framework",
17041
     ]
17042
-
17043
-    if (build_with_mozilla) {
17044
-      sources += [
17045
-        "mac/desktop_device_info_mac.mm",
17046
-      ]
17047
-    }
17048
   }
17049
 
17050
   if (is_win) {
17051
@@ -256,28 +216,14 @@ rtc_static_library("desktop_capture") {
17052
   deps = [
17053
     ":primitives",
17054
     "../..:webrtc_common",
17055
+    "../../base:rtc_base",  # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
17056
     "../../system_wrappers",
17057
+    "//third_party/libyuv",
17058
   ]
17059
 
17060
-  if (!build_with_mozilla) {
17061
-    deps += [
17062
-      "../../base:rtc_base",  # TODO(kjellander): Cleanup in bugs.webrtc.org/3806.
17063
-    ]
17064
-  }
17065
-
17066
-  if (rtc_build_libyuv) {
17067
-    deps += [ "$rtc_libyuv_dir" ]
17068
-  } else {
17069
-    include_dirs = [ "$rtc_libyuv_dir/include" ]
17070
-  }
17071
-
17072
   if (use_desktop_capture_differ_sse2) {
17073
     deps += [ ":desktop_capture_differ_sse2" ]
17074
   }
17075
-
17076
-  if (build_with_mozilla) {
17077
-    deps += ["../../base:rtc_base_approved"]
17078
-  }
17079
 }
17080
 
17081
 if (use_desktop_capture_differ_sse2) {
17082
diff --git media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture.gypi media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture.gypi
17083
new file mode 100644
17084
index 000000000000..c7d6212ba3a9
17085
--- /dev/null
17086
+++ media/webrtc/trunk/webrtc/modules/desktop_capture/desktop_capture.gypi
17087
@@ -0,0 +1,300 @@
17088
+# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
17089
+#
17090
+# Use of this source code is governed by a BSD-style license
17091
+# that can be found in the LICENSE file in the root of the source
17092
+# tree. An additional intellectual property rights grant can be found
17093
+# in the file PATENTS.  All contributing project authors may
17094
+# be found in the AUTHORS file in the root of the source tree.
17095
+
17096
+{
17097
+  'variables': {
17098
+    'multi_monitor_screenshare%' : 1,
17099
+  },
17100
+  'targets': [
17101
+    {
17102
+      'target_name': 'primitives',
17103
+      'type': 'static_library',
17104
+      'sources': [
17105
+        'desktop_capture_types.h',
17106
+        'desktop_frame.cc',
17107
+        'desktop_frame.h',
17108
+        'desktop_geometry.cc',
17109
+        'desktop_geometry.h',
17110
+        'desktop_region.cc',
17111
+        'desktop_region.h',
17112
+      ],
17113
+    },
17114
+    {
17115
+      'target_name': 'desktop_capture',
17116
+      'type': 'static_library',
17117
+      'dependencies': [
17118
+        ':primitives',
17119
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
17120
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
17121
+      ],
17122
+      'include_dirs': [
17123
+        '../../../../../libyuv/libyuv/include/',
17124
+      ],
17125
+      'sources': [
17126
+        'cropped_desktop_frame.cc',
17127
+        'cropped_desktop_frame.h',
17128
+        'cropping_window_capturer.cc',
17129
+        'cropping_window_capturer.h',
17130
+        'cropping_window_capturer_win.cc',
17131
+        'desktop_and_cursor_composer.cc',
17132
+        'desktop_and_cursor_composer.h',
17133
+        'desktop_capture_options.h',
17134
+        'desktop_capture_options.cc',
17135
+        'desktop_capturer.h',
17136
+        'desktop_capturer_differ_wrapper.cc',
17137
+        'desktop_capturer_differ_wrapper.h',
17138
+        'desktop_frame_rotation.cc',
17139
+        'desktop_frame_rotation.h',
17140
+#        'desktop_frame_win.cc',
17141
+#        'desktop_frame_win.h',
17142
+        'differ_block.cc',
17143
+        'differ_block.h',
17144
+#        'mac/desktop_configuration.h',
17145
+#        'mac/desktop_configuration.mm',
17146
+#        'mac/desktop_configuration_monitor.h',
17147
+#        'mac/desktop_configuration_monitor.cc',
17148
+#        'mac/full_screen_chrome_window_detector.cc',
17149
+#        'mac/full_screen_chrome_window_detector.h',
17150
+#        'mac/scoped_pixel_buffer_object.cc',
17151
+#        'mac/scoped_pixel_buffer_object.h',
17152
+#        'mac/window_list_utils.cc',
17153
+#        'mac/window_list_utils.h',
17154
+        'mouse_cursor.cc',
17155
+        'mouse_cursor.h',
17156
+        'mouse_cursor_monitor.h',
17157
+#        'mouse_cursor_monitor_mac.mm',
17158
+#        'mouse_cursor_monitor_win.cc',
17159
+        'screen_capture_frame_queue.h',
17160
+        'screen_capturer.h',
17161
+        'screen_capturer_helper.cc',
17162
+        'screen_capturer_helper.h',
17163
+#        'screen_capturer_mac.mm',
17164
+#        'screen_capturer_win.cc',
17165
+        'shared_desktop_frame.cc',
17166
+        'shared_desktop_frame.h',
17167
+        'shared_memory.cc',
17168
+        'shared_memory.h',
17169
+#        'win/cursor.cc',
17170
+#        'win/cursor.h',
17171
+#        'win/d3d_device.cc',
17172
+#        'win/d3d_device.h',
17173
+#        'win/desktop.cc',
17174
+#        'win/desktop.h',
17175
+#        'win/dxgi_adapter_duplicator.cc',
17176
+#        'win/dxgi_adapter_duplicator.h',
17177
+#        'win/dxgi_duplicator_controller.cc',
17178
+#        'win/dxgi_duplicator_controller.h',
17179
+#        'win/dxgi_output_duplicator.cc',
17180
+#        'win/dxgi_output_duplicator.h',
17181
+#        'win/dxgi_texture.cc',
17182
+#        'win/dxgi_texture.h',
17183
+#        'win/dxgi_texture_mapping.cc',
17184
+#        'win/dxgi_texture_mapping.h',
17185
+#        'win/dxgi_texture_staging.cc',
17186
+#        'win/dxgi_texture_staging.h',
17187
+#        'win/scoped_gdi_object.h',
17188
+#        'win/scoped_thread_desktop.cc',
17189
+#        'win/scoped_thread_desktop.h',
17190
+#        'win/screen_capture_utils.cc',
17191
+#        'win/screen_capture_utils.h',
17192
+#        'win/screen_capturer_win_directx.cc',
17193
+#        'win/screen_capturer_win_directx.h',
17194
+#        'win/screen_capturer_win_gdi.cc',
17195
+#        'win/screen_capturer_win_gdi.h',
17196
+#        'win/screen_capturer_win_magnifier.cc',
17197
+#        'win/screen_capturer_win_magnifier.h',
17198
+#        'win/window_capture_utils.cc',
17199
+#        'win/window_capture_utils.h',
17200
+        'window_capturer.h',
17201
+#        'window_capturer_mac.mm',
17202
+#        'window_capturer_win.cc',
17203
+        "desktop_capturer.h",
17204
+        "desktop_capturer.cc",
17205
+        "desktop_device_info.h",
17206
+        "desktop_device_info.cc",
17207
+#        "app_capturer.h",
17208
+#        "app_capturer.cc",
17209
+      ],
17210
+      'conditions': [
17211
+        ['OS!="android"', {
17212
+          'sources': [
17213
+            '../../video_engine/desktop_capture_impl.cc',
17214
+            '../../video_engine/desktop_capture_impl.h',
17215
+          ],
17216
+        }],
17217
+        ['multi_monitor_screenshare != 0', {
17218
+          'defines': [
17219
+            'MULTI_MONITOR_SCREENSHARE'
17220
+          ],
17221
+        }],
17222
+        ['OS!="ios" and (target_arch=="ia32" or target_arch=="x64")', {
17223
+          'dependencies': [
17224
+            'desktop_capture_differ_sse2',
17225
+          ],
17226
+        }],
17227
+        ['use_x11==1', {
17228
+          'defines':[
17229
+            'USE_X11',
17230
+          ],
17231
+          'sources': [
17232
+            'mouse_cursor_monitor_x11.cc',
17233
+            'screen_capturer_x11.cc',
17234
+            'window_capturer_x11.cc',
17235
+            "x11/shared_x_util.h",
17236
+            "x11/shared_x_util.cc",
17237
+            'x11/shared_x_display.h',
17238
+            'x11/shared_x_display.cc',
17239
+            'x11/x_error_trap.cc',
17240
+            'x11/x_error_trap.h',
17241
+            'x11/x_server_pixel_buffer.cc',
17242
+            'x11/x_server_pixel_buffer.h',
17243
+            'x11/desktop_device_info_x11.h',
17244
+            'x11/desktop_device_info_x11.cc',
17245
+            'app_capturer_x11.cc',
17246
+          ],
17247
+          'link_settings': {
17248
+            'libraries': [
17249
+              '-lX11',
17250
+              '-lXcomposite',
17251
+              '-lXdamage',
17252
+              '-lXext',
17253
+              '-lXfixes',
17254
+              '-lXrender',
17255
+            ],
17256
+          },
17257
+        }],
17258
+        ['OS!="win" and OS!="mac" and use_x11==0', {
17259
+          'sources': [
17260
+            "app_capturer_null.cc",
17261
+            "desktop_device_info_null.cc",
17262
+            'mouse_cursor_monitor_null.cc',
17263
+            'screen_capturer_null.cc',
17264
+            'window_capturer_null.cc',
17265
+          ],
17266
+        }],
17267
+        ['OS!="ios" ', {
17268
+          'sources': [
17269
+            'differ_block.cc',
17270
+            'differ_block.h',
17271
+          ],
17272
+        }],
17273
+        ['OS=="mac"', {
17274
+          'sources': [
17275
+            "mac/desktop_configuration.h",
17276
+            "mac/desktop_configuration.mm",
17277
+            "mac/desktop_configuration_monitor.h",
17278
+            "mac/desktop_configuration_monitor.cc",
17279
+            "mac/full_screen_chrome_window_detector.cc",
17280
+            "mac/full_screen_chrome_window_detector.h",
17281
+            "mac/window_list_utils.cc",
17282
+            "mac/window_list_utils.h",
17283
+            "mac/scoped_pixel_buffer_object.cc",
17284
+            "mac/scoped_pixel_buffer_object.h",
17285
+            "mac/desktop_device_info_mac.h",
17286
+            "mac/desktop_device_info_mac.mm",
17287
+            "mouse_cursor_monitor_mac.mm",
17288
+            "screen_capturer_mac.mm",
17289
+            "window_capturer_mac.mm",
17290
+            "app_capturer_mac.mm",
17291
+          ],
17292
+          'link_settings': {
17293
+            'libraries': [
17294
+              '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
17295
+              '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
17296
+              '$(SDKROOT)/System/Library/Frameworks/OpenGL.framework',
17297
+            ],
17298
+          },
17299
+        }],
17300
+        ['OS=="win"', {
17301
+          'sources': [
17302
+            "desktop_frame_win.cc",
17303
+            "desktop_frame_win.h",
17304
+            "mouse_cursor_monitor_win.cc",
17305
+            "screen_capturer_win.cc",
17306
+            "win/cursor.cc",
17307
+            "win/cursor.h",
17308
+#        'win/d3d_device.cc',
17309
+#        'win/d3d_device.h',
17310
+            "win/desktop.cc",
17311
+            "win/desktop.h",
17312
+#        'win/dxgi_adapter_duplicator.cc',
17313
+#        'win/dxgi_adapter_duplicator.h',
17314
+#        'win/dxgi_duplicator_controller.cc',
17315
+#        'win/dxgi_duplicator_controller.h',
17316
+#        'win/dxgi_output_duplicator.cc',
17317
+#        'win/dxgi_output_duplicator.h',
17318
+#        'win/dxgi_texture.cc',
17319
+#        'win/dxgi_texture.h',
17320
+#        'win/dxgi_texture_mapping.cc',
17321
+#        'win/dxgi_texture_mapping.h',
17322
+#        'win/dxgi_texture_staging.cc',
17323
+#        'win/dxgi_texture_staging.h',
17324
+            "win/scoped_gdi_object.h",
17325
+            "win/scoped_thread_desktop.cc",
17326
+            "win/scoped_thread_desktop.h",
17327
+            "win/win_shared.h",
17328
+            "win/win_shared.cc",
17329
+            "win/desktop_device_info_win.h",
17330
+            "win/desktop_device_info_win.cc",
17331
+#	    "win/screen_capturer_win_directx.cc",
17332
+#	    "win/screen_capturer_win_directx.h",
17333
+            "win/screen_capturer_win_gdi.cc",
17334
+            "win/screen_capturer_win_gdi.h",
17335
+            "win/screen_capturer_win_magnifier.cc",
17336
+            "win/screen_capturer_win_magnifier.h",
17337
+            "win/screen_capture_utils.cc",
17338
+            "win/screen_capture_utils.h",
17339
+            "win/window_capture_utils.cc",
17340
+            "win/window_capture_utils.h",
17341
+            "window_capturer_win.cc",
17342
+            "app_capturer_win.cc",
17343
+          ],
17344
+        }],
17345
+      ],
17346
+      'all_dependent_settings': {
17347
+        'conditions': [
17348
+          ['OS=="win"', {
17349
+            'msvs_settings': {
17350
+              'VCLinkerTool': {
17351
+                'AdditionalDependencies': [
17352
+                  'd3d11.lib',
17353
+                  'dxgi.lib',
17354
+                ],
17355
+              },
17356
+            },
17357
+          }],
17358
+        ],
17359
+      },
17360
+    },
17361
+  ],  # targets
17362
+  'conditions': [
17363
+    ['OS!="ios" and (target_arch=="ia32" or target_arch=="x64")', {
17364
+      'targets': [
17365
+        {
17366
+          # Have to be compiled as a separate target because it needs to be
17367
+          # compiled with SSE2 enabled.
17368
+          'target_name': 'desktop_capture_differ_sse2',
17369
+          'type': 'static_library',
17370
+          'sources': [
17371
+            'differ_vector_sse2.cc',
17372
+            'differ_vector_sse2.h',
17373
+          ],
17374
+          'conditions': [
17375
+            ['os_posix==1', {
17376
+              'cflags': [ '-msse2', ],
17377
+              'cflags_mozilla': [ '-msse2', ],
17378
+              'xcode_settings': {
17379
+                'OTHER_CFLAGS': [ '-msse2', ],
17380
+              },
17381
+            }],
17382
+          ],
17383
+        },
17384
+      ],  # targets
17385
+    }],
17386
+  ],
17387
+}
17388
diff --git media/webrtc/trunk/webrtc/modules/desktop_capture/win/cursor.cc media/webrtc/trunk/webrtc/modules/desktop_capture/win/cursor.cc
17389
index f27bbaf3eb77..304d5960d5ed 100644
17390
--- media/webrtc/trunk/webrtc/modules/desktop_capture/win/cursor.cc
17391
+++ media/webrtc/trunk/webrtc/modules/desktop_capture/win/cursor.cc
17392
@@ -42,6 +42,8 @@ namespace {
17393
 
17394
 #endif  // !defined(WEBRTC_ARCH_LITTLE_ENDIAN)
17395
 
17396
+const int kBytesPerPixel = DesktopFrame::kBytesPerPixel;
17397
+
17398
 // Pixel colors used when generating cursor outlines.
17399
 const uint32_t kPixelRgbaBlack = RGBA(0, 0, 0, 0xff);
17400
 const uint32_t kPixelRgbaWhite = RGBA(0xff, 0xff, 0xff, 0xff);
17401
@@ -74,7 +76,7 @@ void AddCursorOutline(int width, int height, uint32_t* data) {
17402
 // Premultiplies RGB components of the pixel data in the given image by
17403
 // the corresponding alpha components.
17404
 void AlphaMul(uint32_t* data, int width, int height) {
17405
-  static_assert(sizeof(uint32_t) == DesktopFrame::kBytesPerPixel,
17406
+  static_assert(sizeof(uint32_t) == kBytesPerPixel,
17407
                 "size of uint32 should be the number of bytes per pixel");
17408
 
17409
   for (uint32_t* data_end = data + width * height; data != data_end; ++data) {
17410
@@ -142,7 +144,7 @@ MouseCursor* CreateMouseCursorFromHCursor(HDC dc, HCURSOR cursor) {
17411
   bmi.bV5Width = width;
17412
   bmi.bV5Height = -height;  // request a top-down bitmap.
17413
   bmi.bV5Planes = 1;
17414
-  bmi.bV5BitCount = DesktopFrame::kBytesPerPixel * 8;
17415
+  bmi.bV5BitCount = kBytesPerPixel * 8;
17416
   bmi.bV5Compression = BI_RGB;
17417
   bmi.bV5AlphaMask = 0xff000000;
17418
   bmi.bV5CSType = LCS_WINDOWS_COLOR_SPACE;
17419
diff --git media/webrtc/trunk/webrtc/modules/media_file/media_file.gypi media/webrtc/trunk/webrtc/modules/media_file/media_file.gypi
17420
new file mode 100644
17421
index 000000000000..94a99a22f1e2
17422
--- /dev/null
17423
+++ media/webrtc/trunk/webrtc/modules/media_file/media_file.gypi
17424
@@ -0,0 +1,31 @@
17425
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
17426
+#
17427
+# Use of this source code is governed by a BSD-style license
17428
+# that can be found in the LICENSE file in the root of the source
17429
+# tree. An additional intellectual property rights grant can be found
17430
+# in the file PATENTS.  All contributing project authors may
17431
+# be found in the AUTHORS file in the root of the source tree.
17432
+
17433
+{
17434
+  'targets': [
17435
+    {
17436
+      'target_name': 'media_file',
17437
+      'type': 'static_library',
17438
+      'dependencies': [
17439
+        '<(webrtc_root)/common.gyp:webrtc_common',
17440
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
17441
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
17442
+      ],
17443
+      'sources': [
17444
+        'media_file.h',
17445
+        'media_file_defines.h',
17446
+        'media_file_impl.cc',
17447
+        'media_file_impl.h',
17448
+        'media_file_utility.cc',
17449
+        'media_file_utility.h',
17450
+      ], # source
17451
+      # TODO(jschuh): Bug 1348: fix size_t to int truncations.
17452
+      'msvs_disabled_warnings': [ 4267, ],
17453
+    },
17454
+  ], # targets
17455
+}
17456
diff --git media/webrtc/trunk/webrtc/modules/modules.gyp media/webrtc/trunk/webrtc/modules/modules.gyp
17457
new file mode 100644
17458
index 000000000000..3037b5604edc
17459
--- /dev/null
17460
+++ media/webrtc/trunk/webrtc/modules/modules.gyp
17461
@@ -0,0 +1,31 @@
17462
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
17463
+#
17464
+# Use of this source code is governed by a BSD-style license
17465
+# that can be found in the LICENSE file in the root of the source
17466
+# tree. An additional intellectual property rights grant can be found
17467
+# in the file PATENTS.  All contributing project authors may
17468
+# be found in the AUTHORS file in the root of the source tree.
17469
+
17470
+{
17471
+  'includes': [
17472
+    '../build/common.gypi',
17473
+    'audio_coding/audio_coding.gypi',
17474
+    'audio_conference_mixer/audio_conference_mixer.gypi',
17475
+    'audio_device/audio_device.gypi',
17476
+    'audio_mixer/audio_mixer.gypi',
17477
+    'audio_processing/audio_processing.gypi',
17478
+    'bitrate_controller/bitrate_controller.gypi',
17479
+    'congestion_controller/congestion_controller.gypi',
17480
+    'desktop_capture/desktop_capture.gypi',
17481
+    'media_file/media_file.gypi',
17482
+    'pacing/pacing.gypi',
17483
+    'remote_bitrate_estimator/remote_bitrate_estimator.gypi',
17484
+    'rtp_rtcp/rtp_rtcp.gypi',
17485
+    'utility/utility.gypi',
17486
+    'video_coding/codecs/h264/h264.gypi',
17487
+    'video_coding/codecs/i420/i420.gypi',
17488
+    'video_coding/video_coding.gypi',
17489
+    'video_capture/video_capture.gypi',
17490
+    'video_processing/video_processing.gypi',
17491
+  ],
17492
+}
17493
diff --git media/webrtc/trunk/webrtc/modules/pacing/pacing.gypi media/webrtc/trunk/webrtc/modules/pacing/pacing.gypi
17494
new file mode 100644
17495
index 000000000000..d74f9cae0a7e
17496
--- /dev/null
17497
+++ media/webrtc/trunk/webrtc/modules/pacing/pacing.gypi
17498
@@ -0,0 +1,30 @@
17499
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
17500
+#
17501
+# Use of this source code is governed by a BSD-style license
17502
+# that can be found in the LICENSE file in the root of the source
17503
+# tree. An additional intellectual property rights grant can be found
17504
+# in the file PATENTS.  All contributing project authors may
17505
+# be found in the AUTHORS file in the root of the source tree.
17506
+
17507
+{
17508
+  'targets': [
17509
+    {
17510
+      'target_name': 'paced_sender',
17511
+      'type': 'static_library',
17512
+      'dependencies': [
17513
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
17514
+        '<(webrtc_root)/modules/modules.gyp:bitrate_controller',
17515
+        '<(webrtc_root)/modules/modules.gyp:rtp_rtcp',
17516
+      ],
17517
+      'sources': [
17518
+        'alr_detector.cc',
17519
+        'bitrate_prober.cc',
17520
+        'bitrate_prober.h',
17521
+        'paced_sender.cc',
17522
+        'paced_sender.h',
17523
+        'packet_router.cc',
17524
+        'packet_router.h',
17525
+      ],
17526
+    },
17527
+  ], # targets
17528
+}
17529
diff --git media/webrtc/trunk/webrtc/modules/remote_bitrate_estimator/BUILD.gn media/webrtc/trunk/webrtc/modules/remote_bitrate_estimator/BUILD.gn
17530
index cdd8db2bf608..7ddb0bb1e89f 100644
17531
--- media/webrtc/trunk/webrtc/modules/remote_bitrate_estimator/BUILD.gn
17532
+++ media/webrtc/trunk/webrtc/modules/remote_bitrate_estimator/BUILD.gn
17533
@@ -51,15 +51,10 @@ rtc_static_library("remote_bitrate_estimator") {
17534
 
17535
   deps = [
17536
     "../..:webrtc_common",
17537
+    "../../base:rtc_base",
17538
     "../../base:rtc_base_approved",
17539
     "../../system_wrappers",
17540
   ]
17541
-
17542
-  if (!build_with_mozilla) {
17543
-    deps += [
17544
-      "../../base:rtc_base",
17545
-    ]
17546
-  }
17547
 }
17548
 
17549
 if (rtc_include_tests) {
17550
@@ -116,6 +111,7 @@ if (rtc_include_tests) {
17551
       ":remote_bitrate_estimator",
17552
       "../..:webrtc_common",
17553
       "../../base:gtest_prod",
17554
+      "../../base:rtc_base",
17555
       "../../base:rtc_base_approved",
17556
       "../../system_wrappers",
17557
       "../../test:test_support",
17558
@@ -127,12 +123,6 @@ if (rtc_include_tests) {
17559
       "//testing/gmock",
17560
       "//testing/gtest",
17561
     ]
17562
-
17563
-    if (!build_with_mozilla) {
17564
-      deps += [
17565
-        "../../base:rtc_base",
17566
-      ]
17567
-    }
17568
   }
17569
 
17570
   rtc_source_set("remote_bitrate_estimator_perf_tests") {
17571
diff --git media/webrtc/trunk/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi media/webrtc/trunk/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi
17572
new file mode 100644
17573
index 000000000000..a5b0ab86bf30
17574
--- /dev/null
17575
+++ media/webrtc/trunk/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator.gypi
17576
@@ -0,0 +1,118 @@
17577
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
17578
+#
17579
+# Use of this source code is governed by a BSD-style license
17580
+# that can be found in the LICENSE file in the root of the source
17581
+# tree. An additional intellectual property rights grant can be found
17582
+# in the file PATENTS.  All contributing project authors may
17583
+# be found in the AUTHORS file in the root of the source tree.
17584
+
17585
+{
17586
+  'includes': [
17587
+    '../../build/common.gypi',
17588
+  ],
17589
+  'targets': [
17590
+    {
17591
+      'target_name': 'remote_bitrate_estimator',
17592
+      'type': 'static_library',
17593
+      'dependencies': [
17594
+        '<(webrtc_root)/common.gyp:webrtc_common',
17595
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
17596
+      ],
17597
+      'sources': [
17598
+        'include/bwe_defines.h',
17599
+        'include/remote_bitrate_estimator.h',
17600
+        'include/send_time_history.h',
17601
+        'aimd_rate_control.cc',
17602
+        'aimd_rate_control.h',
17603
+        'bwe_defines.cc',
17604
+        'inter_arrival.cc',
17605
+        'inter_arrival.h',
17606
+        'overuse_detector.cc',
17607
+        'overuse_detector.h',
17608
+        'overuse_estimator.cc',
17609
+        'overuse_estimator.h',
17610
+        'remote_bitrate_estimator_abs_send_time.cc',
17611
+        'remote_bitrate_estimator_abs_send_time.h',
17612
+        'remote_bitrate_estimator_single_stream.cc',
17613
+        'remote_bitrate_estimator_single_stream.h',
17614
+        'remote_estimator_proxy.cc',
17615
+        'remote_estimator_proxy.h',
17616
+        'send_time_history.cc',
17617
+        'test/bwe_test_logging.h',
17618
+      ], # source
17619
+      'conditions': [
17620
+        ['enable_bwe_test_logging==1', {
17621
+          'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1' ],
17622
+          'sources': [
17623
+            'test/bwe_test_logging.cc'
17624
+          ],
17625
+        }, {
17626
+          'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0' ],
17627
+        }],
17628
+      ],
17629
+    },
17630
+  ], # targets
17631
+  'conditions': [
17632
+    ['include_tests==1', {
17633
+      'targets': [
17634
+        {
17635
+          'target_name': 'bwe_tools_util',
17636
+          'type': 'static_library',
17637
+          'dependencies': [
17638
+            '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
17639
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
17640
+            'rtp_rtcp',
17641
+          ],
17642
+          'sources': [
17643
+            'tools/bwe_rtp.cc',
17644
+            'tools/bwe_rtp.h',
17645
+          ],
17646
+        },
17647
+        {
17648
+          'target_name': 'bwe_rtp_to_text',
17649
+          'type': 'executable',
17650
+          'includes': [
17651
+            '../rtp_rtcp/rtp_rtcp.gypi',
17652
+          ],
17653
+          'dependencies': [
17654
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
17655
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
17656
+            '<(webrtc_root)/test/test.gyp:rtp_test_utils',
17657
+            'bwe_tools_util',
17658
+            'rtp_rtcp',
17659
+          ],
17660
+          'direct_dependent_settings': {
17661
+            'include_dirs': [
17662
+              'include',
17663
+            ],
17664
+          },
17665
+          'sources': [
17666
+            'tools/rtp_to_text.cc',
17667
+          ], # source
17668
+        },
17669
+        {
17670
+          'target_name': 'bwe_rtp_play',
17671
+          'type': 'executable',
17672
+          'includes': [
17673
+            '../rtp_rtcp/rtp_rtcp.gypi',
17674
+          ],
17675
+          'dependencies': [
17676
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
17677
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
17678
+            '<(webrtc_root)/test/test.gyp:rtp_test_utils',
17679
+            'bwe_tools_util',
17680
+            'rtp_rtcp',
17681
+          ],
17682
+          'direct_dependent_settings': {
17683
+            'include_dirs': [
17684
+              'include',
17685
+            ],
17686
+          },
17687
+          'sources': [
17688
+            'tools/bwe_rtp_play.cc',
17689
+          ], # source
17690
+        },
17691
+      ],
17692
+    }],  # include_tests==1
17693
+  ],
17694
+}
17695
diff --git media/webrtc/trunk/webrtc/modules/rtp_rtcp/rtp_rtcp.gypi media/webrtc/trunk/webrtc/modules/rtp_rtcp/rtp_rtcp.gypi
17696
new file mode 100644
17697
index 000000000000..6e3ebca9bc8f
17698
--- /dev/null
17699
+++ media/webrtc/trunk/webrtc/modules/rtp_rtcp/rtp_rtcp.gypi
17700
@@ -0,0 +1,192 @@
17701
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
17702
+#
17703
+# Use of this source code is governed by a BSD-style license
17704
+# that can be found in the LICENSE file in the root of the source
17705
+# tree. An additional intellectual property rights grant can be found
17706
+# in the file PATENTS.  All contributing project authors may
17707
+# be found in the AUTHORS file in the root of the source tree.
17708
+
17709
+{
17710
+  'targets': [
17711
+    {
17712
+      'target_name': 'rtp_rtcp',
17713
+      'type': 'static_library',
17714
+      'dependencies': [
17715
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
17716
+        '<(webrtc_root)/modules/modules.gyp:remote_bitrate_estimator',
17717
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
17718
+      ],
17719
+      'sources': [
17720
+        # Common
17721
+        'include/fec_receiver.h',
17722
+        'include/flexfec_receiver.h',
17723
+        'include/flexfec_sender.h',
17724
+        'include/receive_statistics.h',
17725
+        'include/remote_ntp_time_estimator.h',
17726
+        'include/rtp_audio_level_observer.h',
17727
+        'include/rtp_header_parser.h',
17728
+        'include/rtp_payload_registry.h',
17729
+        'include/rtp_receiver.h',
17730
+        'include/rtp_rtcp.h',
17731
+        'include/rtp_rtcp_defines.h',
17732
+        'source/byte_io.h',
17733
+        'source/fec_private_tables_bursty.h',
17734
+        'source/fec_private_tables_random.h',
17735
+        'source/flexfec_header_reader_writer.cc',
17736
+        'source/flexfec_header_reader_writer.h',
17737
+        'source/flexfec_receiver.cc',
17738
+        'source/flexfec_sender.cc',
17739
+        'source/packet_loss_stats.cc',
17740
+        'source/packet_loss_stats.h',
17741
+        'source/playout_delay_oracle.cc',
17742
+        'source/playout_delay_oracle.h',
17743
+        'source/receive_statistics_impl.cc',
17744
+        'source/receive_statistics_impl.h',
17745
+        'source/remote_ntp_time_estimator.cc',
17746
+        'source/rtcp_packet.cc',
17747
+        'source/rtcp_packet.h',
17748
+        'source/rtcp_packet/app.cc',
17749
+        'source/rtcp_packet/app.h',
17750
+        'source/rtcp_packet/bye.cc',
17751
+        'source/rtcp_packet/bye.h',
17752
+        'source/rtcp_packet/common_header.cc',
17753
+        'source/rtcp_packet/common_header.h',
17754
+        'source/rtcp_packet/compound_packet.cc',
17755
+        'source/rtcp_packet/compound_packet.h',
17756
+        'source/rtcp_packet/dlrr.cc',
17757
+        'source/rtcp_packet/dlrr.h',
17758
+        'source/rtcp_packet/extended_jitter_report.cc',
17759
+        'source/rtcp_packet/extended_jitter_report.h',
17760
+        'source/rtcp_packet/extended_reports.cc',
17761
+        'source/rtcp_packet/extended_reports.h',
17762
+        'source/rtcp_packet/fir.cc',
17763
+        'source/rtcp_packet/fir.h',
17764
+        'source/rtcp_packet/nack.cc',
17765
+        'source/rtcp_packet/nack.h',
17766
+        'source/rtcp_packet/pli.cc',
17767
+        'source/rtcp_packet/pli.h',
17768
+        'source/rtcp_packet/psfb.cc',
17769
+        'source/rtcp_packet/psfb.h',
17770
+        'source/rtcp_packet/rapid_resync_request.cc',
17771
+        'source/rtcp_packet/rapid_resync_request.h',
17772
+        'source/rtcp_packet/receiver_report.cc',
17773
+        'source/rtcp_packet/receiver_report.h',
17774
+        'source/rtcp_packet/remb.cc',
17775
+        'source/rtcp_packet/remb.h',
17776
+        'source/rtcp_packet/report_block.cc',
17777
+        'source/rtcp_packet/report_block.h',
17778
+        'source/rtcp_packet/rpsi.cc',
17779
+        'source/rtcp_packet/rpsi.h',
17780
+        'source/rtcp_packet/rrtr.cc',
17781
+        'source/rtcp_packet/rrtr.h',
17782
+        'source/rtcp_packet/rtpfb.cc',
17783
+        'source/rtcp_packet/rtpfb.h',
17784
+        'source/rtcp_packet/sdes.cc',
17785
+        'source/rtcp_packet/sdes.h',
17786
+        'source/rtcp_packet/sender_report.cc',
17787
+        'source/rtcp_packet/sender_report.h',
17788
+        'source/rtcp_packet/sli.cc',
17789
+        'source/rtcp_packet/sli.h',
17790
+        'source/rtcp_packet/target_bitrate.cc',
17791
+        'source/rtcp_packet/target_bitrate.h',
17792
+        'source/rtcp_packet/tmmb_item.cc',
17793
+        'source/rtcp_packet/tmmb_item.h',
17794
+        'source/rtcp_packet/tmmbn.cc',
17795
+        'source/rtcp_packet/tmmbn.h',
17796
+        'source/rtcp_packet/tmmbr.cc',
17797
+        'source/rtcp_packet/tmmbr.h',
17798
+        'source/rtcp_packet/transport_feedback.cc',
17799
+        'source/rtcp_packet/transport_feedback.h',
17800
+        'source/rtcp_packet/voip_metric.cc',
17801
+        'source/rtcp_packet/voip_metric.h',
17802
+        'source/rtcp_receiver.cc',
17803
+        'source/rtcp_receiver.h',
17804
+        'source/rtcp_sender.cc',
17805
+        'source/rtcp_sender.h',
17806
+        'source/rtcp_utility.cc',
17807
+        'source/rtcp_utility.h',
17808
+        'source/rtp_header_extension.cc',
17809
+        'source/rtp_header_extension.h',
17810
+        'source/rtp_header_extensions.cc',
17811
+        'source/rtp_header_extensions.h',
17812
+        'source/rtp_header_parser.cc',
17813
+        'source/rtp_packet.cc',
17814
+        'source/rtp_packet.h',
17815
+        'source/rtp_packet_received.h',
17816
+        'source/rtp_packet_to_send.h',
17817
+        'source/rtp_receiver_impl.cc',
17818
+        'source/rtp_receiver_impl.h',
17819
+        'source/rtp_rtcp_config.h',
17820
+        'source/rtp_rtcp_impl.cc',
17821
+        'source/rtp_rtcp_impl.h',
17822
+        'source/rtp_sender.cc',
17823
+        'source/rtp_sender.h',
17824
+        'source/rtp_utility.cc',
17825
+        'source/rtp_utility.h',
17826
+        'source/ssrc_database.cc',
17827
+        'source/ssrc_database.h',
17828
+        'source/time_util.cc',
17829
+        'source/time_util.h',
17830
+        'source/tmmbr_help.cc',
17831
+        'source/tmmbr_help.h',
17832
+        # Audio Files
17833
+        'source/dtmf_queue.cc',
17834
+        'source/dtmf_queue.h',
17835
+        'source/rtp_receiver_audio.cc',
17836
+        'source/rtp_receiver_audio.h',
17837
+        'source/rtp_sender_audio.cc',
17838
+        'source/rtp_sender_audio.h',
17839
+        # Video Files
17840
+        'source/fec_private_tables_random.h',
17841
+        'source/fec_private_tables_bursty.h',
17842
+        'source/flexfec_header_reader_writer.cc',
17843
+        'source/flexfec_header_reader_writer.h',
17844
+        'source/forward_error_correction.cc',
17845
+        'source/forward_error_correction.h',
17846
+        'source/forward_error_correction_internal.cc',
17847
+        'source/forward_error_correction_internal.h',
17848
+        'source/rtp_packet_history.cc',
17849
+        'source/rtp_packet_history.h',
17850
+        'source/rtp_payload_registry.cc',
17851
+        'source/rtp_receiver_strategy.cc',
17852
+        'source/rtp_receiver_strategy.h',
17853
+        'source/rtp_receiver_video.cc',
17854
+        'source/rtp_receiver_video.h',
17855
+        'source/rtp_sender_video.cc',
17856
+        'source/rtp_sender_video.h',
17857
+        'source/video_codec_information.h',
17858
+        'source/rtp_format.cc',
17859
+        'source/rtp_format.h',
17860
+        'source/rtp_format_h264.cc',
17861
+        'source/rtp_format_h264.h',
17862
+        'source/rtp_format_vp8.cc',
17863
+        'source/rtp_format_vp8.h',
17864
+        'source/rtp_format_vp9.cc',
17865
+        'source/rtp_format_vp9.h',
17866
+        'source/rtp_format_video_generic.cc',
17867
+        'source/rtp_format_video_generic.h',
17868
+        'source/ulpfec_generator.cc',
17869
+        'source/ulpfec_generator.h',
17870
+        'source/ulpfec_header_reader_writer.cc',
17871
+        'source/ulpfec_header_reader_writer.h',
17872
+        'source/ulpfec_receiver_impl.cc',
17873
+        'source/ulpfec_receiver_impl.h',
17874
+        'source/video_codec_information.h',
17875
+        'source/vp8_partition_aggregator.cc',
17876
+        'source/vp8_partition_aggregator.h',
17877
+        # Mocks
17878
+        'mocks/mock_rtp_rtcp.h',
17879
+        'source/mock/mock_rtp_payload_strategy.h',
17880
+       ], # source
17881
+        'conditions': [
17882
+            ['enable_bwe_test_logging==1', {
17883
+              'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=1' ],
17884
+            }, {
17885
+              'defines': [ 'BWE_TEST_LOGGING_COMPILE_TIME_ENABLE=0' ],
17886
+            }],
17887
+        ],
17888
+      # TODO(jschuh): Bug 1348: fix size_t to int truncations.
17889
+      'msvs_disabled_warnings': [ 4267, ],
17890
+    },
17891
+  ],
17892
+}
17893
diff --git media/webrtc/trunk/webrtc/modules/rtp_rtcp/test/testFec/test_fec.gypi media/webrtc/trunk/webrtc/modules/rtp_rtcp/test/testFec/test_fec.gypi
17894
new file mode 100644
17895
index 000000000000..2843894a5e48
17896
--- /dev/null
17897
+++ media/webrtc/trunk/webrtc/modules/rtp_rtcp/test/testFec/test_fec.gypi
17898
@@ -0,0 +1,26 @@
17899
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
17900
+#
17901
+# Use of this source code is governed by a BSD-style license
17902
+# that can be found in the LICENSE file in the root of the source
17903
+# tree. An additional intellectual property rights grant can be found
17904
+# in the file PATENTS.  All contributing project authors may
17905
+# be found in the AUTHORS file in the root of the source tree.
17906
+
17907
+{
17908
+  'targets': [
17909
+    {
17910
+      # The test below takes long to run, no need to add it to any bot.
17911
+      'target_name': 'test_packet_masks_metrics',
17912
+      'type': 'executable',
17913
+      'dependencies': [
17914
+        'rtp_rtcp',
17915
+        '<(webrtc_root)/test/test.gyp:test_support_main',
17916
+        '<(DEPTH)/testing/gtest.gyp:gtest',
17917
+      ],
17918
+      'sources': [
17919
+        'test_packet_masks_metrics.cc',
17920
+        'average_residual_loss_xor_codes.h',
17921
+      ],
17922
+    },
17923
+  ],
17924
+}
17925
diff --git media/webrtc/trunk/webrtc/modules/utility/utility.gypi media/webrtc/trunk/webrtc/modules/utility/utility.gypi
17926
new file mode 100644
17927
index 000000000000..3b8f8c22fa28
17928
--- /dev/null
17929
+++ media/webrtc/trunk/webrtc/modules/utility/utility.gypi
17930
@@ -0,0 +1,37 @@
17931
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
17932
+#
17933
+# Use of this source code is governed by a BSD-style license
17934
+# that can be found in the LICENSE file in the root of the source
17935
+# tree. An additional intellectual property rights grant can be found
17936
+# in the file PATENTS.  All contributing project authors may
17937
+# be found in the AUTHORS file in the root of the source tree.
17938
+
17939
+{
17940
+  'targets': [
17941
+    {
17942
+      'target_name': 'webrtc_utility',
17943
+      'type': 'static_library',
17944
+      'dependencies': [
17945
+        'audio_coding_module',
17946
+        'media_file',
17947
+        '<(webrtc_root)/base/base.gyp:rtc_task_queue',
17948
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
17949
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
17950
+      ],
17951
+      'sources': [
17952
+        'include/audio_frame_operations.h',
17953
+        'include/file_player.h',
17954
+        'include/file_recorder.h',
17955
+        'include/helpers_android.h',
17956
+        'include/helpers_ios.h',
17957
+        'include/jvm_android.h',
17958
+        'include/process_thread.h',
17959
+        'source/helpers_android.cc',
17960
+        'source/helpers_ios.mm',
17961
+        'source/jvm_android.cc',
17962
+        'source/process_thread_impl.cc',
17963
+        'source/process_thread_impl.h',
17964
+      ],
17965
+    },
17966
+  ], # targets
17967
+}
17968
diff --git media/webrtc/trunk/webrtc/modules/video_capture/BUILD.gn media/webrtc/trunk/webrtc/modules/video_capture/BUILD.gn
17969
index 0658ab74b3ff..6887552b583a 100644
17970
--- media/webrtc/trunk/webrtc/modules/video_capture/BUILD.gn
17971
+++ media/webrtc/trunk/webrtc/modules/video_capture/BUILD.gn
17972
@@ -124,18 +124,9 @@ if (!build_with_chromium) {
17973
 
17974
       libs = [ "Strmiids.lib" ]
17975
 
17976
-      if (!build_with_mozilla) {
17977
-        deps += [ "//third_party/winsdk_samples" ]
17978
-      } else {
17979
-        sources += [
17980
-          "windows/BasePin.cpp",
17981
-          "windows/BaseFilter.cpp",
17982
-          "windows/BaseInputPin.cpp",
17983
-          "windows/MediaType.cpp",
17984
-        ]
17985
-      }
17986
+      deps += [ "//third_party/winsdk_samples" ]
17987
     }
17988
-    if (!build_with_mozilla && (is_ios || is_mac)) {
17989
+    if (is_ios || is_mac) {
17990
       sources = [
17991
         "objc/device_info.h",
17992
         "objc/device_info.mm",
17993
@@ -157,34 +148,6 @@ if (!build_with_chromium) {
17994
       ]
17995
     }
17996
 
17997
-    if (build_with_mozilla && is_android) {
17998
-      include_dirs = [
17999
-        "/config/external/nspr",
18000
-        "/nsprpub/lib/ds",
18001
-        "/nsprpub/pr/include",
18002
-      ]
18003
-
18004
-      sources = [
18005
-        "android/device_info_android.cc",
18006
-        "android/video_capture_android.cc",
18007
-      ]
18008
-    }
18009
-
18010
-    if (build_with_mozilla && is_mac) {
18011
-      sources = [
18012
-        "mac/avfoundation/video_capture_avfoundation.h",
18013
-        "mac/avfoundation/video_capture_avfoundation.mm",
18014
-        "mac/avfoundation/video_capture_avfoundation_info.h",
18015
-        "mac/avfoundation/video_capture_avfoundation_info.mm",
18016
-        "mac/avfoundation/video_capture_avfoundation_info_objc.h",
18017
-        "mac/avfoundation/video_capture_avfoundation_info_objc.mm",
18018
-        "mac/avfoundation/video_capture_avfoundation_objc.h",
18019
-        "mac/avfoundation/video_capture_avfoundation_objc.mm",
18020
-        "mac/avfoundation/video_capture_avfoundation_utility.h",
18021
-        "mac/video_capture_mac.mm",
18022
-      ]
18023
-    }
18024
-
18025
     all_dependent_configs = [ ":video_capture_internal_impl_config" ]
18026
 
18027
     if (!build_with_chromium && is_clang) {
18028
diff --git media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi
18029
new file mode 100644
18030
index 000000000000..ebda305e08ca
18031
--- /dev/null
18032
+++ media/webrtc/trunk/webrtc/modules/video_capture/video_capture.gypi
18033
@@ -0,0 +1,200 @@
18034
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
18035
+#
18036
+# Use of this source code is governed by a BSD-style license
18037
+# that can be found in the LICENSE file in the root of the source
18038
+# tree. An additional intellectual property rights grant can be found
18039
+# in the file PATENTS.  All contributing project authors may
18040
+# be found in the AUTHORS file in the root of the source tree.
18041
+
18042
+{
18043
+  'targets': [
18044
+    {
18045
+      # Note this library is missing an implementation for the video capture.
18046
+      # Targets must link with either 'video_capture' or
18047
+      # 'video_capture_module_internal_impl' depending on whether they want to
18048
+      # use the internal capturer.
18049
+      'target_name': 'video_capture_module',
18050
+      'type': 'static_library',
18051
+      'dependencies': [
18052
+        'webrtc_utility',
18053
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
18054
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
18055
+      ],
18056
+      'cflags_mozilla': [
18057
+        '$(NSPR_CFLAGS)',
18058
+      ],
18059
+      'sources': [
18060
+        'device_info_impl.cc',
18061
+        'device_info_impl.h',
18062
+        'video_capture.h',
18063
+        'video_capture_config.h',
18064
+        'video_capture_defines.h',
18065
+        'video_capture_delay.h',
18066
+        'video_capture_factory.h',
18067
+        'video_capture_factory.cc',
18068
+        'video_capture_impl.cc',
18069
+        'video_capture_impl.h',
18070
+      ],
18071
+    },
18072
+    {
18073
+      # Default video capture module implementation that only supports external
18074
+      # capture.
18075
+      'target_name': 'video_capture',
18076
+      'type': 'static_library',
18077
+      'dependencies': [
18078
+        'video_capture_module',
18079
+      ],
18080
+      'cflags_mozilla': [
18081
+        '$(NSPR_CFLAGS)',
18082
+      ],
18083
+      'sources': [
18084
+        'external/device_info_external.cc',
18085
+        'external/video_capture_external.cc',
18086
+      ],
18087
+    },
18088
+  ], # targets
18089
+  'conditions': [
18090
+    ['build_with_chromium==0', {
18091
+      'targets': [
18092
+        {
18093
+          'target_name': 'video_capture_module_internal_impl',
18094
+          'type': 'static_library',
18095
+          'dependencies': [
18096
+            'video_capture_module',
18097
+            '<(webrtc_root)/common.gyp:webrtc_common',
18098
+           ],
18099
+          'cflags_mozilla': [
18100
+            '$(NSPR_CFLAGS)',
18101
+          ],
18102
+          'conditions': [
18103
+            ['include_v4l2_video_capture==1', {
18104
+              'sources': [
18105
+                'linux/device_info_linux.cc',
18106
+                'linux/device_info_linux.h',
18107
+                'linux/video_capture_linux.cc',
18108
+                'linux/video_capture_linux.h',
18109
+              ],
18110
+            }],
18111
+            ['OS=="mac"', {
18112
+              'sources': [
18113
+                'mac/avfoundation/video_capture_avfoundation.h',
18114
+                'mac/avfoundation/video_capture_avfoundation.mm',
18115
+                'mac/avfoundation/video_capture_avfoundation_info.h',
18116
+                'mac/avfoundation/video_capture_avfoundation_info.mm',
18117
+                'mac/avfoundation/video_capture_avfoundation_info_objc.h',
18118
+                'mac/avfoundation/video_capture_avfoundation_info_objc.mm',
18119
+                'mac/avfoundation/video_capture_avfoundation_objc.h',
18120
+                'mac/avfoundation/video_capture_avfoundation_objc.mm',
18121
+                'mac/avfoundation/video_capture_avfoundation_utility.h',
18122
+                'mac/video_capture_mac.mm',
18123
+              ],
18124
+              'link_settings': {
18125
+                'xcode_settings': {
18126
+                  'OTHER_LDFLAGS': [
18127
+                    '-framework Cocoa',
18128
+                    '-framework CoreVideo',
18129
+                  ],
18130
+                },
18131
+              },
18132
+            }],  # mac
18133
+            ['OS=="win"', {
18134
+              'conditions': [
18135
+                ['build_with_mozilla==0', {
18136
+                  'dependencies': [
18137
+                    '<(DEPTH)/third_party/winsdk_samples/winsdk_samples.gyp:directshow_baseclasses',
18138
+                  ],
18139
+                }],
18140
+	      ],
18141
+              'sources': [
18142
+                'windows/device_info_ds.cc',
18143
+                'windows/device_info_ds.h',
18144
+                'windows/device_info_mf.cc',
18145
+                'windows/device_info_mf.h',
18146
+                'windows/help_functions_ds.cc',
18147
+                'windows/help_functions_ds.h',
18148
+                'windows/sink_filter_ds.cc',
18149
+                'windows/sink_filter_ds.h',
18150
+                'windows/video_capture_ds.cc',
18151
+                'windows/video_capture_ds.h',
18152
+                'windows/video_capture_factory_windows.cc',
18153
+                'windows/video_capture_mf.cc',
18154
+                'windows/video_capture_mf.h',
18155
+                'windows/BasePin.cpp',
18156
+                'windows/BaseFilter.cpp',
18157
+                'windows/BaseInputPin.cpp',
18158
+                'windows/MediaType.cpp',
18159
+              ],
18160
+              'link_settings': {
18161
+                'libraries': [
18162
+                  '-lStrmiids.lib',
18163
+                ],
18164
+              },
18165
+            }],  # win
18166
+            ['OS=="win" and clang==1', {
18167
+              'msvs_settings': {
18168
+                'VCCLCompilerTool': {
18169
+                  'AdditionalOptions': [
18170
+                    # Disable warnings failing when compiling with Clang on Windows.
18171
+                    # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
18172
+                    '-Wno-comment',
18173
+                    '-Wno-ignored-attributes',
18174
+                    '-Wno-microsoft-extra-qualification',
18175
+                    '-Wno-missing-braces',
18176
+                    '-Wno-overloaded-virtual',
18177
+                    '-Wno-reorder',
18178
+                    '-Wno-writable-strings',
18179
+                  ],
18180
+                },
18181
+              },
18182
+            }],
18183
+            ['OS=="android"', {
18184
+              'sources': [
18185
+                'android/device_info_android.cc',
18186
+                'android/device_info_android.h',
18187
+                'android/video_capture_android.cc',
18188
+                'android/video_capture_android.h',
18189
+              ],
18190
+            }],  # android
18191
+            ['OS=="ios"', {
18192
+              'sources': [
18193
+                'objc/device_info.h',
18194
+                'objc/device_info.mm',
18195
+                'objc/device_info_objc.h',
18196
+                'objc/device_info_objc.mm',
18197
+                'objc/rtc_video_capture_objc.h',
18198
+                'objc/rtc_video_capture_objc.mm',
18199
+                'objc/video_capture.h',
18200
+                'objc/video_capture.mm',
18201
+              ],
18202
+              'xcode_settings': {
18203
+                'CLANG_ENABLE_OBJC_ARC': 'YES',
18204
+              },
18205
+              'cflags_mozilla': [
18206
+                '-fobjc-arc',
18207
+              ],
18208
+              'all_dependent_settings': {
18209
+                'xcode_settings': {
18210
+                  'OTHER_LDFLAGS': [
18211
+                    '-framework AVFoundation',
18212
+                    '-framework CoreMedia',
18213
+                    '-framework CoreVideo',
18214
+                  ],
18215
+                },
18216
+              },
18217
+            }],  # ios
18218
+            ['OS=="ios"', {
18219
+              'all_dependent_settings': {
18220
+                'xcode_settings': {
18221
+                  'OTHER_LDFLAGS': [
18222
+                    '-framework UIKit',
18223
+                  ],
18224
+                },
18225
+              },
18226
+            }],  # ios
18227
+          ], # conditions
18228
+        },
18229
+      ],
18230
+    }], # build_with_chromium==0
18231
+  ],
18232
+}
18233
+
18234
diff --git media/webrtc/trunk/webrtc/modules/video_coding/BUILD.gn media/webrtc/trunk/webrtc/modules/video_coding/BUILD.gn
18235
index b932dc825579..f70a314f9232 100644
18236
--- media/webrtc/trunk/webrtc/modules/video_coding/BUILD.gn
18237
+++ media/webrtc/trunk/webrtc/modules/video_coding/BUILD.gn
18238
@@ -93,6 +93,7 @@ rtc_static_library("video_coding") {
18239
     ":webrtc_vp8",
18240
     ":webrtc_vp9",
18241
     "../..:webrtc_common",
18242
+    "../../base:rtc_base",
18243
     "../../base:rtc_base_approved",
18244
     "../../base:rtc_numerics",
18245
     "../../base:rtc_task_queue",
18246
@@ -101,12 +102,6 @@ rtc_static_library("video_coding") {
18247
     "../rtp_rtcp:rtp_rtcp",
18248
     "../utility:utility",
18249
   ]
18250
-
18251
-  if (!build_with_mozilla) {
18252
-    deps += [
18253
-      "../../base:rtc_base",
18254
-    ]
18255
-  }
18256
 }
18257
 
18258
 rtc_static_library("video_coding_utility") {
18259
@@ -188,15 +183,10 @@ rtc_static_library("webrtc_h264") {
18260
     ]
18261
     deps += [
18262
       "../../common_video",
18263
+      "../../media:rtc_media_base",
18264
       "//third_party/ffmpeg:ffmpeg",
18265
       "//third_party/openh264:encoder",
18266
     ]
18267
-
18268
-    if (!build_with_mozilla) {
18269
-      deps += [
18270
-        "../../media:rtc_media_base",
18271
-      ]
18272
-    }
18273
   }
18274
 }
18275
 
18276
@@ -255,10 +245,6 @@ rtc_static_library("webrtc_vp8") {
18277
   if (rtc_build_libvpx) {
18278
     deps += [ rtc_libvpx_dir ]
18279
   }
18280
-
18281
-  if (build_with_mozilla) {
18282
-    include_dirs = [ "$rtc_libyuv_dir/include" ]
18283
-  }
18284
 }
18285
 
18286
 rtc_static_library("webrtc_vp9") {
18287
diff --git media/webrtc/trunk/webrtc/modules/video_coding/codecs/h264/h264.gypi media/webrtc/trunk/webrtc/modules/video_coding/codecs/h264/h264.gypi
18288
new file mode 100644
18289
index 000000000000..08f418dd70f6
18290
--- /dev/null
18291
+++ media/webrtc/trunk/webrtc/modules/video_coding/codecs/h264/h264.gypi
18292
@@ -0,0 +1,97 @@
18293
+# Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
18294
+#
18295
+# Use of this source code is governed by a BSD-style license
18296
+# that can be found in the LICENSE file in the root of the source
18297
+# tree. An additional intellectual property rights grant can be found
18298
+# in the file PATENTS.  All contributing project authors may
18299
+# be found in the AUTHORS file in the root of the source tree.
18300
+
18301
+{
18302
+  'includes': [
18303
+    '../../../../build/common.gypi',
18304
+  ],
18305
+  'targets': [
18306
+    {
18307
+      'target_name': 'webrtc_h264',
18308
+      'type': 'static_library',
18309
+      'conditions': [
18310
+        ['OS=="ios"', {
18311
+          'dependencies': [
18312
+            'webrtc_h264_video_toolbox',
18313
+          ],
18314
+          'sources': [
18315
+            'h264_objc.mm',
18316
+          ],
18317
+        }],
18318
+        #TODO: rtc_use_h264 not defined here
18319
+        # TODO(hbos): Consider renaming this flag and the below macro to
18320
+        # something which helps distinguish OpenH264/FFmpeg from other H264
18321
+        # implementations.
18322
+        #['rtc_use_h264==1', {
18323
+        #  'defines': [
18324
+        #    'WEBRTC_USE_H264',
18325
+        #  ],
18326
+        #  'conditions': [
18327
+        #    ['rtc_initialize_ffmpeg==1', {
18328
+        #      'defines': [
18329
+        #        'WEBRTC_INITIALIZE_FFMPEG',
18330
+        #      ],
18331
+        #    }],
18332
+        #  ],
18333
+        #  'dependencies': [
18334
+        #    '<(DEPTH)/third_party/ffmpeg/ffmpeg.gyp:ffmpeg',
18335
+        #    '<(DEPTH)/third_party/openh264/openh264.gyp:openh264_encoder',
18336
+        #    '<(webrtc_root)/common_video/common_video.gyp:common_video',
18337
+        #  ],
18338
+        #  'sources': [
18339
+        #    'h264_decoder_impl.cc',
18340
+        #    'h264_decoder_impl.h',
18341
+        #    'h264_encoder_impl.cc',
18342
+        #    'h264_encoder_impl.h',
18343
+        #  ],
18344
+        #}],
18345
+      ],
18346
+      'sources': [
18347
+        'h264.cc',
18348
+        'include/h264.h',
18349
+      ],
18350
+    }, # webrtc_h264
18351
+  ],
18352
+  'conditions': [
18353
+    ['OS=="ios"', {
18354
+      'targets': [
18355
+        {
18356
+          'target_name': 'webrtc_h264_video_toolbox',
18357
+          'type': 'static_library',
18358
+          'includes': [ '../../../../build/objc_common.gypi' ],
18359
+          'dependencies': [
18360
+            '<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_common_objc',
18361
+          ],
18362
+          'link_settings': {
18363
+            'xcode_settings': {
18364
+              'OTHER_LDFLAGS': [
18365
+                '-framework CoreFoundation',
18366
+                '-framework CoreMedia',
18367
+                '-framework CoreVideo',
18368
+                '-framework VideoToolbox',
18369
+              ],
18370
+            },
18371
+          },
18372
+          'sources': [
18373
+            'h264_video_toolbox_decoder.cc',
18374
+            'h264_video_toolbox_decoder.h',
18375
+            'h264_video_toolbox_encoder.h',
18376
+            'h264_video_toolbox_encoder.mm',
18377
+            'h264_video_toolbox_nalu.cc',
18378
+            'h264_video_toolbox_nalu.h',
18379
+          ],
18380
+          'conditions': [
18381
+            ['build_libyuv==1', {
18382
+              'dependencies': ['<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv'],
18383
+            }],
18384
+          ],
18385
+        }, # webrtc_h264_video_toolbox
18386
+      ], # targets
18387
+    }], # OS=="ios"
18388
+  ], # conditions
18389
+}
18390
diff --git media/webrtc/trunk/webrtc/modules/video_coding/codecs/i420/i420.gypi media/webrtc/trunk/webrtc/modules/video_coding/codecs/i420/i420.gypi
18391
new file mode 100644
18392
index 000000000000..4fd8e318bd66
18393
--- /dev/null
18394
+++ media/webrtc/trunk/webrtc/modules/video_coding/codecs/i420/i420.gypi
18395
@@ -0,0 +1,23 @@
18396
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
18397
+#
18398
+# Use of this source code is governed by a BSD-style license
18399
+# that can be found in the LICENSE file in the root of the source
18400
+# tree. An additional intellectual property rights grant can be found
18401
+# in the file PATENTS.  All contributing project authors may
18402
+# be found in the AUTHORS file in the root of the source tree.
18403
+
18404
+{
18405
+  'targets': [
18406
+    {
18407
+      'target_name': 'webrtc_i420',
18408
+      'type': 'static_library',
18409
+      'dependencies': [
18410
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
18411
+      ],
18412
+      'sources': [
18413
+        'include/i420.h',
18414
+        'i420.cc',
18415
+      ],
18416
+    },
18417
+  ],
18418
+}
18419
diff --git media/webrtc/trunk/webrtc/modules/video_coding/codecs/test/video_codecs_test_framework.gypi media/webrtc/trunk/webrtc/modules/video_coding/codecs/test/video_codecs_test_framework.gypi
18420
new file mode 100644
18421
index 000000000000..700616aa6624
18422
--- /dev/null
18423
+++ media/webrtc/trunk/webrtc/modules/video_coding/codecs/test/video_codecs_test_framework.gypi
18424
@@ -0,0 +1,34 @@
18425
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
18426
+#
18427
+# Use of this source code is governed by a BSD-style license
18428
+# that can be found in the LICENSE file in the root of the source
18429
+# tree. An additional intellectual property rights grant can be found
18430
+# in the file PATENTS.  All contributing project authors may
18431
+# be found in the AUTHORS file in the root of the source tree.
18432
+
18433
+{
18434
+  'conditions': [
18435
+    ['include_tests==1', {
18436
+      'targets': [
18437
+        {
18438
+          'target_name': 'video_codecs_test_framework',
18439
+          'type': 'static_library',
18440
+          'dependencies': [
18441
+            '<(webrtc_root)/test/test.gyp:test_support',
18442
+          ],
18443
+          'sources': [
18444
+            'mock/mock_packet_manipulator.h',
18445
+            'packet_manipulator.h',
18446
+            'packet_manipulator.cc',
18447
+            'predictive_packet_manipulator.h',
18448
+            'predictive_packet_manipulator.cc',
18449
+            'stats.h',
18450
+            'stats.cc',
18451
+            'videoprocessor.h',
18452
+            'videoprocessor.cc',
18453
+          ],
18454
+        },
18455
+      ], # targets
18456
+    }], # include_tests
18457
+  ], # conditions
18458
+}
18459
diff --git media/webrtc/trunk/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi media/webrtc/trunk/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi
18460
new file mode 100644
18461
index 000000000000..813d3b83b430
18462
--- /dev/null
18463
+++ media/webrtc/trunk/webrtc/modules/video_coding/codecs/tools/video_codecs_tools.gypi
18464
@@ -0,0 +1,36 @@
18465
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
18466
+#
18467
+# Use of this source code is governed by a BSD-style license
18468
+# that can be found in the LICENSE file in the root of the source
18469
+# tree. An additional intellectual property rights grant can be found
18470
+# in the file PATENTS.  All contributing project authors may
18471
+# be found in the AUTHORS file in the root of the source tree.
18472
+
18473
+{
18474
+  'conditions': [
18475
+    ['include_tests==1', {
18476
+      'targets': [
18477
+        {
18478
+          'target_name': 'video_quality_measurement',
18479
+          'type': 'executable',
18480
+          'dependencies': [
18481
+            'video_codecs_test_framework',
18482
+            'webrtc_video_coding',
18483
+            '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
18484
+            '<(webrtc_root)/common.gyp:webrtc_common',
18485
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
18486
+            '<(webrtc_root)/test/test.gyp:test_support',
18487
+            '<(webrtc_vp8_dir)/vp8.gyp:webrtc_vp8',
18488
+          ],
18489
+          'sources': [
18490
+            'video_quality_measurement.cc',
18491
+          ],
18492
+          # Disable warnings to enable Win64 build, issue 1323.
18493
+          'msvs_disabled_warnings': [
18494
+            4267,  # size_t to int truncation.
18495
+          ],
18496
+        },
18497
+      ], # targets
18498
+    }], # include_tests
18499
+  ], # conditions
18500
+}
18501
diff --git media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8.gyp media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8.gyp
18502
new file mode 100644
18503
index 000000000000..6918986f6fab
18504
--- /dev/null
18505
+++ media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp8/vp8.gyp
18506
@@ -0,0 +1,82 @@
18507
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
18508
+#
18509
+# Use of this source code is governed by a BSD-style license
18510
+# that can be found in the LICENSE file in the root of the source
18511
+# tree. An additional intellectual property rights grant can be found
18512
+# in the file PATENTS.  All contributing project authors may
18513
+# be found in the AUTHORS file in the root of the source tree.
18514
+
18515
+{
18516
+  'includes': [
18517
+    '../../../../build/common.gypi',
18518
+  ],
18519
+  'targets': [
18520
+    {
18521
+      'target_name': 'webrtc_vp8',
18522
+      'type': 'static_library',
18523
+      'dependencies': [
18524
+        '<(webrtc_root)/common.gyp:webrtc_common',
18525
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
18526
+        '<(webrtc_root)/modules/video_coding/utility/video_coding_utility.gyp:video_coding_utility',
18527
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
18528
+      ],
18529
+      'include_dirs': [
18530
+        '../../../../../../../libyuv/libyuv/include',
18531
+      ],
18532
+      'conditions': [
18533
+        ['build_libvpx==1', {
18534
+          'dependencies': [
18535
+            '<(libvpx_dir)/libvpx.gyp:libvpx',
18536
+          ],
18537
+        },{
18538
+          'link_settings': {
18539
+            'libraries': [
18540
+              '$(LIBVPX_OBJ)/libvpx.a',
18541
+            ],
18542
+          },
18543
+        }],
18544
+      ],
18545
+      'sources': [
18546
+        'default_temporal_layers.cc',
18547
+        'default_temporal_layers.h',
18548
+        'include/vp8.h',
18549
+        'include/vp8_common_types.h',
18550
+        'realtime_temporal_layers.cc',
18551
+        'reference_picture_selection.cc',
18552
+        'reference_picture_selection.h',
18553
+        'screenshare_layers.cc',
18554
+        'screenshare_layers.h',
18555
+        'simulcast_encoder_adapter.cc',
18556
+        'simulcast_encoder_adapter.h',
18557
+        'temporal_layers.h',
18558
+        'vp8_impl.cc',
18559
+        'vp8_impl.h',
18560
+      ],
18561
+      # Disable warnings to enable Win64 build, issue 1323.
18562
+      'msvs_disabled_warnings': [
18563
+        4267,  # size_t to int truncation.
18564
+      ],
18565
+    },
18566
+  ], # targets
18567
+  'conditions': [
18568
+    ['include_tests==1', {
18569
+      'targets': [
18570
+        {
18571
+          'target_name': 'vp8_coder',
18572
+          'type': 'executable',
18573
+          'dependencies': [
18574
+            'webrtc_vp8',
18575
+            '<(webrtc_root)/common_video/common_video.gyp:common_video',
18576
+            '<(DEPTH)/testing/gtest.gyp:gtest',
18577
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
18578
+            '<(webrtc_root)/test/test.gyp:test_support_main',
18579
+            '<(webrtc_root)/tools/internal_tools.gyp:command_line_parser',
18580
+          ],
18581
+          'sources': [
18582
+            'vp8_sequence_coder.cc',
18583
+          ],
18584
+        },
18585
+      ], # targets
18586
+    }], # include_tests
18587
+  ],
18588
+}
18589
diff --git media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp9/vp9.gyp media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp9/vp9.gyp
18590
new file mode 100644
18591
index 000000000000..9f3193201f0b
18592
--- /dev/null
18593
+++ media/webrtc/trunk/webrtc/modules/video_coding/codecs/vp9/vp9.gyp
18594
@@ -0,0 +1,54 @@
18595
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
18596
+#
18597
+# Use of this source code is governed by a BSD-style license
18598
+# that can be found in the LICENSE file in the root of the source
18599
+# tree. An additional intellectual property rights grant can be found
18600
+# in the file PATENTS.  All contributing project authors may
18601
+# be found in the AUTHORS file in the root of the source tree.
18602
+
18603
+{
18604
+  'includes': [
18605
+    '../../../../build/common.gypi',
18606
+  ],
18607
+  'targets': [
18608
+    {
18609
+      'target_name': 'webrtc_vp9',
18610
+      'type': 'static_library',
18611
+      'conditions': [
18612
+        ['build_libvpx==1', {
18613
+          'dependencies': [
18614
+            '<(libvpx_dir)/libvpx.gyp:libvpx',
18615
+          ],
18616
+        }, {
18617
+          'include_dirs': [
18618
+            '$(MOZ_LIBVPX_CFLAGS)',
18619
+            '<(libvpx_dir)',
18620
+          ],
18621
+        }],
18622
+        ['libvpx_build_vp9==1', {
18623
+          'sources': [
18624
+            'screenshare_layers.cc',
18625
+            'screenshare_layers.h',
18626
+            'vp9_frame_buffer_pool.cc',
18627
+            'vp9_frame_buffer_pool.h',
18628
+            'vp9_impl.cc',
18629
+            'vp9_impl.h',
18630
+          ],
18631
+        }, {
18632
+          'sources': [
18633
+            'vp9_noop.cc',
18634
+          ],
18635
+        }
18636
+        ],
18637
+      ],
18638
+      'dependencies': [
18639
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
18640
+        '<(webrtc_root)/modules/video_coding/utility/video_coding_utility.gyp:video_coding_utility',
18641
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
18642
+      ],
18643
+      'sources': [
18644
+        'include/vp9.h',
18645
+      ],
18646
+    },
18647
+  ],
18648
+}
18649
diff --git media/webrtc/trunk/webrtc/modules/video_coding/utility/video_coding_utility.gyp media/webrtc/trunk/webrtc/modules/video_coding/utility/video_coding_utility.gyp
18650
new file mode 100644
18651
index 000000000000..a1e9a4258b8b
18652
--- /dev/null
18653
+++ media/webrtc/trunk/webrtc/modules/video_coding/utility/video_coding_utility.gyp
18654
@@ -0,0 +1,40 @@
18655
+# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
18656
+#
18657
+# Use of this source code is governed by a BSD-style license
18658
+# that can be found in the LICENSE file in the root of the source
18659
+# tree. An additional intellectual property rights grant can be found
18660
+# in the file PATENTS.  All contributing project authors may
18661
+# be found in the AUTHORS file in the root of the source tree.
18662
+
18663
+{
18664
+  'includes': [
18665
+    '../../../build/common.gypi',
18666
+  ],
18667
+  'targets': [
18668
+    {
18669
+      'target_name': 'video_coding_utility',
18670
+      'type': 'static_library',
18671
+      'dependencies': [
18672
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
18673
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
18674
+      ],
18675
+      'sources': [
18676
+        'default_video_bitrate_allocator.cc',
18677
+        'frame_dropper.cc',
18678
+        'frame_dropper.h',
18679
+        'ivf_file_writer.cc',
18680
+        'ivf_file_writer.h',
18681
+        'moving_average.cc',
18682
+        'moving_average.h',
18683
+        'qp_parser.cc',
18684
+        'qp_parser.h',
18685
+        'quality_scaler.cc',
18686
+        'quality_scaler.h',
18687
+        'simulcast_rate_allocator.cc',
18688
+        'simulcast_rate_allocator.h',
18689
+        'vp8_header_parser.cc',
18690
+        'vp8_header_parser.h',
18691
+      ],
18692
+    },
18693
+  ], # targets
18694
+}
18695
diff --git media/webrtc/trunk/webrtc/modules/video_coding/video_coding.gypi media/webrtc/trunk/webrtc/modules/video_coding/video_coding.gypi
18696
new file mode 100644
18697
index 000000000000..5027cda6a47f
18698
--- /dev/null
18699
+++ media/webrtc/trunk/webrtc/modules/video_coding/video_coding.gypi
18700
@@ -0,0 +1,98 @@
18701
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
18702
+#
18703
+# Use of this source code is governed by a BSD-style license
18704
+# that can be found in the LICENSE file in the root of the source
18705
+# tree. An additional intellectual property rights grant can be found
18706
+# in the file PATENTS.  All contributing project authors may
18707
+# be found in the AUTHORS file in the root of the source tree.
18708
+
18709
+{
18710
+  'targets': [
18711
+    {
18712
+      'target_name': 'webrtc_video_coding',
18713
+      'type': 'static_library',
18714
+      'dependencies': [
18715
+        'webrtc_h264',
18716
+        'webrtc_i420',
18717
+        '../base/base.gyp:rtc_task_queue',
18718
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
18719
+        '<(webrtc_root)/modules/video_coding/utility/video_coding_utility.gyp:video_coding_utility',
18720
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
18721
+        '<(webrtc_vp8_dir)/vp8.gyp:webrtc_vp8',
18722
+        '<(webrtc_vp9_dir)/vp9.gyp:webrtc_vp9',
18723
+      ],
18724
+      'sources': [
18725
+        # interfaces
18726
+        'include/video_coding.h',
18727
+        'include/video_coding_defines.h',
18728
+
18729
+        # headers
18730
+        'codec_database.h',
18731
+        'codec_timer.h',
18732
+        'decoding_state.h',
18733
+        'encoded_frame.h',
18734
+        'fec_rate_table.h',
18735
+        'frame_buffer.h',
18736
+        'frame_buffer2.h',
18737
+        'frame_object.h',
18738
+        'rtp_frame_reference_finder.h',
18739
+        'generic_decoder.h',
18740
+        'generic_encoder.h',
18741
+        'histogram.h',
18742
+        'inter_frame_delay.h',
18743
+        'internal_defines.h',
18744
+        'jitter_buffer.h',
18745
+        'jitter_buffer_common.h',
18746
+        'jitter_estimator.h',
18747
+        'media_opt_util.h',
18748
+        'media_optimization.h',
18749
+        'nack_fec_tables.h',
18750
+        'nack_module.h',
18751
+        'packet.h',
18752
+        'packet_buffer.h',
18753
+        'protection_bitrate_calculator.h',
18754
+        'receiver.h',
18755
+        'rtt_filter.h',
18756
+        'session_info.h',
18757
+        'timestamp_map.h',
18758
+        'timing.h',
18759
+        'video_coding_impl.h',
18760
+
18761
+        # sources
18762
+        'codec_database.cc',
18763
+        'codec_timer.cc',
18764
+        'decoding_state.cc',
18765
+        'encoded_frame.cc',
18766
+        'frame_buffer.cc',
18767
+        'frame_buffer2.cc',
18768
+        'frame_object.cc',
18769
+        'rtp_frame_reference_finder.cc',
18770
+        'generic_decoder.cc',
18771
+        'generic_encoder.cc',
18772
+        'h264_sprop_parameter_sets.cc',
18773
+        'h264_sps_pps_tracker.cc',
18774
+        'inter_frame_delay.cc',
18775
+        'histogram.cc',
18776
+        'jitter_buffer.cc',
18777
+        'jitter_estimator.cc',
18778
+        'media_opt_util.cc',
18779
+        'media_optimization.cc',
18780
+        'protection_bitrate_calculator.cc',
18781
+        'nack_module.cc',
18782
+        'packet.cc',
18783
+        'packet_buffer.cc',
18784
+        'receiver.cc',
18785
+        'rtt_filter.cc',
18786
+        'session_info.cc',
18787
+        'timestamp_map.cc',
18788
+        'timing.cc',
18789
+        'video_codec_initializer.cc',
18790
+        'video_coding_impl.cc',
18791
+        'video_sender.cc',
18792
+        'video_receiver.cc',
18793
+      ], # source
18794
+      # TODO(jschuh): Bug 1348: fix size_t to int truncations.
18795
+      'msvs_disabled_warnings': [ 4267, ],
18796
+    },
18797
+  ],
18798
+}
18799
diff --git media/webrtc/trunk/webrtc/modules/video_coding/video_coding_test.gypi media/webrtc/trunk/webrtc/modules/video_coding/video_coding_test.gypi
18800
new file mode 100644
18801
index 000000000000..8f7bc03ef971
18802
--- /dev/null
18803
+++ media/webrtc/trunk/webrtc/modules/video_coding/video_coding_test.gypi
18804
@@ -0,0 +1,35 @@
18805
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
18806
+# Use of this source code is governed by a BSD-style license
18807
+# that can be found in the LICENSE file in the root of the source
18808
+# tree. An additional intellectual property rights grant can be found
18809
+# in the file PATENTS.  All contributing project authors may
18810
+# be found in the AUTHORS file in the root of the source tree.
18811
+
18812
+{
18813
+  'targets': [
18814
+    {
18815
+      'target_name': 'rtp_player',
18816
+      'type': 'executable',
18817
+      'dependencies': [
18818
+         'rtp_rtcp',
18819
+         'webrtc_video_coding',
18820
+         '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
18821
+         '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
18822
+         '<(webrtc_root)/test/test.gyp:test_common',
18823
+      ],
18824
+      'sources': [
18825
+        # headers
18826
+        'test/receiver_tests.h',
18827
+        'test/rtp_player.h',
18828
+        'test/vcm_payload_sink_factory.h',
18829
+
18830
+        # sources
18831
+        'test/rtp_player.cc',
18832
+        'test/test_util.cc',
18833
+        'test/tester_main.cc',
18834
+        'test/vcm_payload_sink_factory.cc',
18835
+        'test/video_rtp_play.cc',
18836
+      ], # sources
18837
+    },
18838
+  ],
18839
+}
18840
diff --git media/webrtc/trunk/webrtc/modules/video_processing/BUILD.gn media/webrtc/trunk/webrtc/modules/video_processing/BUILD.gn
18841
index f585b64b1b1a..5ab3f457ecdc 100644
18842
--- media/webrtc/trunk/webrtc/modules/video_processing/BUILD.gn
18843
+++ media/webrtc/trunk/webrtc/modules/video_processing/BUILD.gn
18844
@@ -43,10 +43,6 @@ rtc_static_library("video_processing") {
18845
     # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
18846
     suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
18847
   }
18848
-
18849
-  if (build_with_mozilla) {
18850
-    include_dirs = [ "$rtc_libyuv_dir/include" ]
18851
-  }
18852
 }
18853
 
18854
 if (build_video_processing_sse2) {
18855
diff --git media/webrtc/trunk/webrtc/modules/video_processing/video_processing.gypi media/webrtc/trunk/webrtc/modules/video_processing/video_processing.gypi
18856
new file mode 100644
18857
index 000000000000..c34f8749326a
18858
--- /dev/null
18859
+++ media/webrtc/trunk/webrtc/modules/video_processing/video_processing.gypi
18860
@@ -0,0 +1,86 @@
18861
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
18862
+#
18863
+# Use of this source code is governed by a BSD-style license
18864
+# that can be found in the LICENSE file in the root of the source
18865
+# tree. An additional intellectual property rights grant can be found
18866
+# in the file PATENTS.  All contributing project authors may
18867
+# be found in the AUTHORS file in the root of the source tree.
18868
+
18869
+{
18870
+  'targets': [
18871
+    {
18872
+      'target_name': 'video_processing',
18873
+      'type': 'static_library',
18874
+      'include_dirs': [
18875
+        '<(libyuv_dir)/include',
18876
+      ],
18877
+      'dependencies': [
18878
+        'webrtc_utility',
18879
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
18880
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
18881
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
18882
+      ],
18883
+      'sources': [
18884
+        'include/video_processing.h',
18885
+        'include/video_processing_defines.h',
18886
+        'video_denoiser.cc',
18887
+        'video_denoiser.h',
18888
+        'util/denoiser_filter.cc',
18889
+        'util/denoiser_filter.h',
18890
+        'util/denoiser_filter_c.cc',
18891
+        'util/denoiser_filter_c.h',
18892
+        'util/noise_estimation.cc',
18893
+        'util/noise_estimation.h',
18894
+        'util/skin_detection.cc',
18895
+        'util/skin_detection.h',
18896
+      ],
18897
+      'conditions': [
18898
+        ['target_arch=="ia32" or target_arch=="x64"', {
18899
+          'dependencies': [ 'video_processing_sse2', ],
18900
+        }],
18901
+        ['target_arch=="arm" or target_arch == "arm64"', {
18902
+          'dependencies': [ 'video_processing_neon', ],
18903
+        }],
18904
+      ],
18905
+    },
18906
+  ],
18907
+  'conditions': [
18908
+    ['target_arch=="ia32" or target_arch=="x64"', {
18909
+      'targets': [
18910
+        {
18911
+          'target_name': 'video_processing_sse2',
18912
+          'type': 'static_library',
18913
+          'sources': [
18914
+            'util/denoiser_filter_sse2.cc',
18915
+            'util/denoiser_filter_sse2.h',
18916
+          ],
18917
+          'conditions': [
18918
+            ['os_posix==1 and OS!="mac"', {
18919
+              'cflags': [ '-msse2', ],
18920
+              'cflags_mozilla': [ '-msse2', ],
18921
+            }],
18922
+            ['OS=="mac"', {
18923
+              'xcode_settings': {
18924
+                'OTHER_CFLAGS': [ '-msse2', ],
18925
+              },
18926
+            }],
18927
+          ],
18928
+        },
18929
+      ],
18930
+    }],
18931
+    ['target_arch=="arm" or target_arch == "arm64"', {
18932
+      'targets': [
18933
+        {
18934
+          'target_name': 'video_processing_neon',
18935
+          'type': 'static_library',
18936
+          'includes': [ '../../build/arm_neon.gypi', ],
18937
+          'sources': [
18938
+            'util/denoiser_filter_neon.cc',
18939
+            'util/denoiser_filter_neon.h',
18940
+          ],
18941
+        },
18942
+      ],
18943
+    }],
18944
+  ],
18945
+}
18946
+
18947
diff --git media/webrtc/trunk/webrtc/p2p/p2p.gyp media/webrtc/trunk/webrtc/p2p/p2p.gyp
18948
new file mode 100644
18949
index 000000000000..9511d1c974e2
18950
--- /dev/null
18951
+++ media/webrtc/trunk/webrtc/p2p/p2p.gyp
18952
@@ -0,0 +1,145 @@
18953
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
18954
+#
18955
+# Use of this source code is governed by a BSD-style license
18956
+# that can be found in the LICENSE file in the root of the source
18957
+# tree. An additional intellectual property rights grant can be found
18958
+# in the file PATENTS.  All contributing project authors may
18959
+# be found in the AUTHORS file in the root of the source tree.
18960
+
18961
+{
18962
+  'includes': [ '../build/common.gypi', ],
18963
+  'targets': [
18964
+    {
18965
+      'target_name': 'rtc_p2p',
18966
+      'type': 'static_library',
18967
+      'dependencies': [
18968
+        '<(webrtc_root)/base/base.gyp:rtc_base',
18969
+        '<(webrtc_root)/common.gyp:webrtc_common',
18970
+      ],
18971
+      'sources': [
18972
+        'base/asyncstuntcpsocket.cc',
18973
+        'base/asyncstuntcpsocket.h',
18974
+        'base/basicpacketsocketfactory.cc',
18975
+        'base/basicpacketsocketfactory.h',
18976
+        'base/candidate.h',
18977
+        'base/common.h',
18978
+        'base/dtlstransport.h',
18979
+        'base/dtlstransportchannel.cc',
18980
+        'base/dtlstransportchannel.h',
18981
+        'base/p2pconstants.cc',
18982
+        'base/p2pconstants.h',
18983
+        'base/p2ptransport.cc',
18984
+        'base/p2ptransport.h',
18985
+        'base/p2ptransportchannel.cc',
18986
+        'base/p2ptransportchannel.h',
18987
+        'base/packetsocketfactory.h',
18988
+        'base/port.cc',
18989
+        'base/port.h',
18990
+        'base/portallocator.cc',
18991
+        'base/portallocator.h',
18992
+        'base/portinterface.h',
18993
+        'base/pseudotcp.cc',
18994
+        'base/pseudotcp.h',
18995
+        'base/relayport.cc',
18996
+        'base/relayport.h',
18997
+        'base/session.cc',
18998
+        'base/session.h',
18999
+        'base/sessiondescription.cc',
19000
+        'base/sessiondescription.h',
19001
+        'base/stun.cc',
19002
+        'base/stun.h',
19003
+        'base/stunport.cc',
19004
+        'base/stunport.h',
19005
+        'base/stunrequest.cc',
19006
+        'base/stunrequest.h',
19007
+        'base/tcpport.cc',
19008
+        'base/tcpport.h',
19009
+        'base/transport.cc',
19010
+        'base/transport.h',
19011
+        'base/transportchannel.cc',
19012
+        'base/transportchannel.h',
19013
+        'base/transportchannelimpl.h',
19014
+        'base/transportcontroller.cc',
19015
+        'base/transportcontroller.h',
19016
+        'base/transportdescription.cc',
19017
+        'base/transportdescription.h',
19018
+        'base/transportdescriptionfactory.cc',
19019
+        'base/transportdescriptionfactory.h',
19020
+        'base/transportinfo.h',
19021
+        'base/turnport.cc',
19022
+        'base/turnport.h',
19023
+        'base/udpport.h',
19024
+        'client/basicportallocator.cc',
19025
+        'client/basicportallocator.h',
19026
+        'client/httpportallocator.cc',
19027
+        'client/httpportallocator.h',
19028
+        'client/socketmonitor.cc',
19029
+        'client/socketmonitor.h',
19030
+      ],
19031
+      'direct_dependent_settings': {
19032
+        'defines': [
19033
+          'FEATURE_ENABLE_VOICEMAIL',
19034
+        ],
19035
+      },
19036
+      'conditions': [
19037
+        ['build_with_chromium==0', {
19038
+          'sources': [
19039
+            'base/relayserver.cc',
19040
+            'base/relayserver.h',
19041
+            'base/stunserver.cc',
19042
+            'base/stunserver.h',
19043
+            'base/turnserver.cc',
19044
+            'base/turnserver.h',
19045
+          ],
19046
+          'defines': [
19047
+            'FEATURE_ENABLE_VOICEMAIL',
19048
+            'FEATURE_ENABLE_PSTN',
19049
+          ],
19050
+        }],
19051
+        ['use_quic==1', {
19052
+      	  'dependencies': [
19053
+      	    '<(DEPTH)/third_party/libquic/libquic.gyp:libquic',
19054
+      	  ],
19055
+          'sources': [
19056
+            'quic/quicconnectionhelper.cc',
19057
+            'quic/quicconnectionhelper.h',
19058
+            'quic/quicsession.cc',
19059
+            'quic/quicsession.h',
19060
+            'quic/quictransport.cc',
19061
+            'quic/quictransport.h',
19062
+            'quic/quictransportchannel.cc',
19063
+            'quic/quictransportchannel.h',
19064
+            'quic/reliablequicstream.cc',
19065
+            'quic/reliablequicstream.h',
19066
+          ],
19067
+      	  'export_dependent_settings': [
19068
+      	    '<(DEPTH)/third_party/libquic/libquic.gyp:libquic',
19069
+      	  ],
19070
+        }],
19071
+      ],
19072
+    },
19073
+    {
19074
+      'target_name': 'libstunprober',
19075
+      'type': 'static_library',
19076
+      'dependencies': [
19077
+        '<(webrtc_root)/base/base.gyp:rtc_base',
19078
+        '<(webrtc_root)/common.gyp:webrtc_common',
19079
+      ],
19080
+      'sources': [
19081
+        'stunprober/stunprober.cc',
19082
+      ],
19083
+    },
19084
+    {
19085
+      'target_name': 'stun_prober',
19086
+      'type': 'executable',
19087
+      'dependencies': [
19088
+        'libstunprober',
19089
+        'rtc_p2p'
19090
+      ],
19091
+      'sources': [
19092
+        'stunprober/main.cc',
19093
+      ],
19094
+    },
19095
+  ],  # targets
19096
+}
19097
+
19098
diff --git media/webrtc/trunk/webrtc/pc/pc.gyp media/webrtc/trunk/webrtc/pc/pc.gyp
19099
new file mode 100755
19100
index 000000000000..e42e240a4cf1
19101
--- /dev/null
19102
+++ media/webrtc/trunk/webrtc/pc/pc.gyp
19103
@@ -0,0 +1,77 @@
19104
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
19105
+#
19106
+# Use of this source code is governed by a BSD-style license
19107
+# that can be found in the LICENSE file in the root of the source
19108
+# tree. An additional intellectual property rights grant can be found
19109
+# in the file PATENTS.  All contributing project authors may
19110
+# be found in the AUTHORS file in the root of the source tree.
19111
+
19112
+{
19113
+  'includes': ['../build/common.gypi'],
19114
+  'variables': {
19115
+    'rtc_pc_defines': [
19116
+      'SRTP_RELATIVE_PATH',
19117
+      'HAVE_SCTP',
19118
+      'HAVE_SRTP',
19119
+    ],
19120
+  },
19121
+  'targets': [
19122
+    {
19123
+      'target_name': 'rtc_pc',
19124
+      'type': 'static_library',
19125
+      'dependencies': [
19126
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
19127
+        '<(webrtc_root)/media/media.gyp:rtc_media',
19128
+      ],
19129
+      'conditions': [
19130
+        ['build_with_chromium==1', {
19131
+          'sources': [
19132
+            'externalhmac.h',
19133
+            'externalhmac.cc',
19134
+          ],
19135
+        }],
19136
+        # TODO: lisrtp.gyp not found
19137
+        #['build_libsrtp==1', {
19138
+        #  'dependencies': [
19139
+        #    '<(DEPTH)/third_party/libsrtp/libsrtp.gyp:libsrtp',
19140
+        #  ],
19141
+        #}],
19142
+      ],
19143
+      'defines': [
19144
+        '<@(rtc_pc_defines)',
19145
+      ],
19146
+      'include_dirs': [
19147
+        '<(DEPTH)/testing/gtest/include',
19148
+      ],
19149
+      'direct_dependent_settings': {
19150
+        'defines': [
19151
+          '<@(rtc_pc_defines)'
19152
+        ],
19153
+        'include_dirs': [
19154
+          '<(DEPTH)/testing/gtest/include',
19155
+        ],
19156
+      },
19157
+      'sources': [
19158
+        'audiomonitor.cc',
19159
+        'audiomonitor.h',
19160
+        'bundlefilter.cc',
19161
+        'bundlefilter.h',
19162
+        'channel.cc',
19163
+        'channel.h',
19164
+        'channelmanager.cc',
19165
+        'channelmanager.h',
19166
+        'currentspeakermonitor.cc',
19167
+        'currentspeakermonitor.h',
19168
+        'mediamonitor.cc',
19169
+        'mediamonitor.h',
19170
+        'mediasession.cc',
19171
+        'mediasession.h',
19172
+        'rtcpmuxfilter.cc',
19173
+        'rtcpmuxfilter.h',
19174
+        'srtpfilter.cc',
19175
+        'srtpfilter.h',
19176
+        'voicechannel.h',
19177
+      ],
19178
+    },  # target rtc_pc
19179
+  ],  # targets
19180
+}
19181
diff --git media/webrtc/trunk/webrtc/sdk/sdk.gyp media/webrtc/trunk/webrtc/sdk/sdk.gyp
19182
new file mode 100644
19183
index 000000000000..908d544abba5
19184
--- /dev/null
19185
+++ media/webrtc/trunk/webrtc/sdk/sdk.gyp
19186
@@ -0,0 +1,342 @@
19187
+# Copyright 2016 The WebRTC project authors. All Rights Reserved.
19188
+#
19189
+# Use of this source code is governed by a BSD-style license
19190
+# that can be found in the LICENSE file in the root of the source
19191
+# tree. An additional intellectual property rights grant can be found
19192
+# in the file PATENTS.  All contributing project authors may
19193
+# be found in the AUTHORS file in the root of the source tree.
19194
+
19195
+{
19196
+  'includes': [
19197
+    '../build/common.gypi',
19198
+    'sdk.gypi',
19199
+  ],
19200
+  'conditions': [
19201
+    ['OS=="ios" or (OS=="mac" and mac_deployment_target=="10.7")', {
19202
+      'targets': [
19203
+        {
19204
+          'target_name': 'rtc_sdk_common_objc',
19205
+          'type': 'static_library',
19206
+          'includes': [ '../build/objc_common.gypi' ],
19207
+          'dependencies': [
19208
+            '../base/base.gyp:rtc_base',
19209
+          ],
19210
+          'include_dirs': [
19211
+            'objc/Framework/Classes',
19212
+            'objc/Framework/Headers',
19213
+          ],
19214
+          'direct_dependent_settings': {
19215
+            'include_dirs': [
19216
+              'objc/Framework/Classes',
19217
+              'objc/Framework/Headers',
19218
+            ],
19219
+          },
19220
+          'sources': [
19221
+            'objc/Framework/Classes/NSString+StdString.h',
19222
+            'objc/Framework/Classes/NSString+StdString.mm',
19223
+            'objc/Framework/Classes/RTCDispatcher.m',
19224
+            'objc/Framework/Classes/RTCFieldTrials.mm',
19225
+            'objc/Framework/Classes/RTCLogging.mm',
19226
+            'objc/Framework/Classes/RTCMetrics.mm',
19227
+            'objc/Framework/Classes/RTCMetricsSampleInfo+Private.h',
19228
+            'objc/Framework/Classes/RTCMetricsSampleInfo.mm',
19229
+            'objc/Framework/Classes/RTCSSLAdapter.mm',
19230
+            'objc/Framework/Classes/RTCTracing.mm',
19231
+            'objc/Framework/Headers/WebRTC/RTCDispatcher.h',
19232
+            'objc/Framework/Headers/WebRTC/RTCFieldTrials.h',
19233
+            'objc/Framework/Headers/WebRTC/RTCLogging.h',
19234
+            'objc/Framework/Headers/WebRTC/RTCMacros.h',
19235
+            'objc/Framework/Headers/WebRTC/RTCMetrics.h',
19236
+            'objc/Framework/Headers/WebRTC/RTCMetricsSampleInfo.h',
19237
+            'objc/Framework/Headers/WebRTC/RTCSSLAdapter.h',
19238
+            'objc/Framework/Headers/WebRTC/RTCTracing.h',
19239
+          ],
19240
+          'conditions': [
19241
+            ['OS=="ios"', {
19242
+              'sources': [
19243
+                'objc/Framework/Classes/RTCCameraPreviewView.m',
19244
+                'objc/Framework/Classes/RTCUIApplication.h',
19245
+                'objc/Framework/Classes/RTCUIApplication.mm',
19246
+                'objc/Framework/Classes/UIDevice+RTCDevice.mm',
19247
+                'objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h',
19248
+                'objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h',
19249
+              ],
19250
+              'link_settings': {
19251
+                'xcode_settings': {
19252
+                  'OTHER_LDFLAGS': [
19253
+                    '-framework AVFoundation',
19254
+                  ],
19255
+                },
19256
+              },
19257
+            }],  # OS=="ios"
19258
+            ['build_with_chromium==0', {
19259
+              'sources': [
19260
+                'objc/Framework/Classes/RTCFileLogger.mm',
19261
+                'objc/Framework/Headers/WebRTC/RTCFileLogger.h',
19262
+              ],
19263
+            }],
19264
+          ],
19265
+        },
19266
+        {
19267
+          'target_name': 'rtc_sdk_peerconnection_objc',
19268
+          'type': 'static_library',
19269
+          'includes': [ '../build/objc_common.gypi' ],
19270
+          'dependencies': [
19271
+            '<(webrtc_root)/api/api.gyp:libjingle_peerconnection',
19272
+            'rtc_sdk_common_objc',
19273
+          ],
19274
+          'include_dirs': [
19275
+            'objc/Framework/Classes',
19276
+            'objc/Framework/Headers',
19277
+          ],
19278
+          'direct_dependent_settings': {
19279
+            'include_dirs': [
19280
+              'objc/Framework/Classes',
19281
+              'objc/Framework/Headers',
19282
+            ],
19283
+          },
19284
+          'link_settings': {
19285
+            'xcode_settings': {
19286
+              'OTHER_LDFLAGS': [
19287
+                '-framework AVFoundation',
19288
+              ],
19289
+            },
19290
+            'libraries': [
19291
+              '-lstdc++',
19292
+            ],
19293
+          }, # link_settings
19294
+          'sources': [
19295
+            'objc/Framework/Classes/RTCAVFoundationVideoSource+Private.h',
19296
+            'objc/Framework/Classes/RTCAVFoundationVideoSource.mm',
19297
+            'objc/Framework/Classes/RTCAudioSource+Private.h',
19298
+            'objc/Framework/Classes/RTCAudioSource.mm',
19299
+            'objc/Framework/Classes/RTCAudioTrack+Private.h',
19300
+            'objc/Framework/Classes/RTCAudioTrack.mm',
19301
+            'objc/Framework/Classes/RTCConfiguration+Private.h',
19302
+            'objc/Framework/Classes/RTCConfiguration.mm',
19303
+            'objc/Framework/Classes/RTCDataChannel+Private.h',
19304
+            'objc/Framework/Classes/RTCDataChannel.mm',
19305
+            'objc/Framework/Classes/RTCDataChannelConfiguration+Private.h',
19306
+            'objc/Framework/Classes/RTCDataChannelConfiguration.mm',
19307
+            'objc/Framework/Classes/RTCI420Shader.mm',
19308
+            'objc/Framework/Classes/RTCIceCandidate+Private.h',
19309
+            'objc/Framework/Classes/RTCIceCandidate.mm',
19310
+            'objc/Framework/Classes/RTCIceServer+Private.h',
19311
+            'objc/Framework/Classes/RTCIceServer.mm',
19312
+            'objc/Framework/Classes/RTCLegacyStatsReport+Private.h',
19313
+            'objc/Framework/Classes/RTCLegacyStatsReport.mm',
19314
+            'objc/Framework/Classes/RTCMediaConstraints+Private.h',
19315
+            'objc/Framework/Classes/RTCMediaConstraints.mm',
19316
+            'objc/Framework/Classes/RTCMediaSource+Private.h',
19317
+            'objc/Framework/Classes/RTCMediaSource.mm',
19318
+            'objc/Framework/Classes/RTCMediaStream+Private.h',
19319
+            'objc/Framework/Classes/RTCMediaStream.mm',
19320
+            'objc/Framework/Classes/RTCMediaStreamTrack+Private.h',
19321
+            'objc/Framework/Classes/RTCMediaStreamTrack.mm',
19322
+            'objc/Framework/Classes/RTCOpenGLDefines.h',
19323
+            'objc/Framework/Classes/RTCOpenGLVideoRenderer.h',
19324
+            'objc/Framework/Classes/RTCOpenGLVideoRenderer.mm',
19325
+            'objc/Framework/Classes/RTCPeerConnection+DataChannel.mm',
19326
+            'objc/Framework/Classes/RTCPeerConnection+Private.h',
19327
+            'objc/Framework/Classes/RTCPeerConnection+Stats.mm',
19328
+            'objc/Framework/Classes/RTCPeerConnection.mm',
19329
+            'objc/Framework/Classes/RTCPeerConnectionFactory+Private.h',
19330
+            'objc/Framework/Classes/RTCPeerConnectionFactory.mm',
19331
+            'objc/Framework/Classes/RTCRtpCodecParameters+Private.h',
19332
+            'objc/Framework/Classes/RTCRtpCodecParameters.mm',
19333
+            'objc/Framework/Classes/RTCRtpEncodingParameters+Private.h',
19334
+            'objc/Framework/Classes/RTCRtpEncodingParameters.mm',
19335
+            'objc/Framework/Classes/RTCRtpParameters+Private.h',
19336
+            'objc/Framework/Classes/RTCRtpParameters.mm',
19337
+            'objc/Framework/Classes/RTCRtpReceiver+Private.h',
19338
+            'objc/Framework/Classes/RTCRtpReceiver.mm',
19339
+            'objc/Framework/Classes/RTCRtpSender+Private.h',
19340
+            'objc/Framework/Classes/RTCRtpSender.mm',
19341
+            'objc/Framework/Classes/RTCSessionDescription+Private.h',
19342
+            'objc/Framework/Classes/RTCSessionDescription.mm',
19343
+            'objc/Framework/Classes/RTCShader+Private.h',
19344
+            'objc/Framework/Classes/RTCShader.h',
19345
+            'objc/Framework/Classes/RTCShader.mm',
19346
+            'objc/Framework/Classes/RTCVideoFrame+Private.h',
19347
+            'objc/Framework/Classes/RTCVideoFrame.mm',
19348
+            'objc/Framework/Classes/RTCVideoRendererAdapter+Private.h',
19349
+            'objc/Framework/Classes/RTCVideoRendererAdapter.h',
19350
+            'objc/Framework/Classes/RTCVideoRendererAdapter.mm',
19351
+            'objc/Framework/Classes/RTCVideoSource+Private.h',
19352
+            'objc/Framework/Classes/RTCVideoSource.mm',
19353
+            'objc/Framework/Classes/RTCVideoTrack+Private.h',
19354
+            'objc/Framework/Classes/RTCVideoTrack.mm',
19355
+            'objc/Framework/Classes/avfoundationvideocapturer.h',
19356
+            'objc/Framework/Classes/avfoundationvideocapturer.mm',
19357
+            'objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h',
19358
+            'objc/Framework/Headers/WebRTC/RTCAudioSource.h',
19359
+            'objc/Framework/Headers/WebRTC/RTCAudioTrack.h',
19360
+            'objc/Framework/Headers/WebRTC/RTCConfiguration.h',
19361
+            'objc/Framework/Headers/WebRTC/RTCDataChannel.h',
19362
+            'objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h',
19363
+            'objc/Framework/Headers/WebRTC/RTCIceCandidate.h',
19364
+            'objc/Framework/Headers/WebRTC/RTCIceServer.h',
19365
+            'objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h',
19366
+            'objc/Framework/Headers/WebRTC/RTCMediaConstraints.h',
19367
+            'objc/Framework/Headers/WebRTC/RTCMediaSource.h',
19368
+            'objc/Framework/Headers/WebRTC/RTCMediaStream.h',
19369
+            'objc/Framework/Headers/WebRTC/RTCMediaStreamTrack.h',
19370
+            'objc/Framework/Headers/WebRTC/RTCPeerConnection.h',
19371
+            'objc/Framework/Headers/WebRTC/RTCPeerConnectionFactory.h',
19372
+            'objc/Framework/Headers/WebRTC/RTCRtpCodecParameters.h',
19373
+            'objc/Framework/Headers/WebRTC/RTCRtpEncodingParameters.h',
19374
+            'objc/Framework/Headers/WebRTC/RTCRtpParameters.h',
19375
+            'objc/Framework/Headers/WebRTC/RTCRtpReceiver.h',
19376
+            'objc/Framework/Headers/WebRTC/RTCRtpSender.h',
19377
+            'objc/Framework/Headers/WebRTC/RTCSessionDescription.h',
19378
+            'objc/Framework/Headers/WebRTC/RTCVideoFrame.h',
19379
+            'objc/Framework/Headers/WebRTC/RTCVideoRenderer.h',
19380
+            'objc/Framework/Headers/WebRTC/RTCVideoSource.h',
19381
+            'objc/Framework/Headers/WebRTC/RTCVideoTrack.h',
19382
+          ], # sources
19383
+          'conditions': [
19384
+            ['build_libyuv==1', {
19385
+              'dependencies': ['<(DEPTH)/third_party/libyuv/libyuv.gyp:libyuv'],
19386
+            }],
19387
+            ['OS=="ios"', {
19388
+              'sources': [
19389
+                'objc/Framework/Classes/RTCEAGLVideoView.m',
19390
+                'objc/Framework/Classes/RTCNativeNV12Shader.mm',
19391
+                'objc/Framework/Headers/WebRTC/RTCEAGLVideoView.h',
19392
+              ],
19393
+              'link_settings': {
19394
+                'xcode_settings': {
19395
+                  'OTHER_LDFLAGS': [
19396
+                    '-framework CoreGraphics',
19397
+                    '-framework GLKit',
19398
+                    '-framework OpenGLES',
19399
+                    '-framework QuartzCore',
19400
+                  ],
19401
+                },
19402
+              },  # link_settings
19403
+            }],  # OS=="ios"
19404
+            ['OS=="mac"', {
19405
+              'sources': [
19406
+                'objc/Framework/Classes/RTCNSGLVideoView.m',
19407
+                'objc/Framework/Headers/WebRTC/RTCNSGLVideoView.h',
19408
+              ],
19409
+              'link_settings': {
19410
+                'xcode_settings': {
19411
+                  'OTHER_LDFLAGS': [
19412
+                    '-framework CoreMedia',
19413
+                    '-framework OpenGL',
19414
+                  ],
19415
+                },
19416
+              },
19417
+            }],
19418
+          ],  # conditions
19419
+        },  # rtc_sdk_peerconnection_objc
19420
+        {
19421
+          'target_name': 'rtc_sdk_framework_objc',
19422
+          'type': 'shared_library',
19423
+          'product_name': 'WebRTC',
19424
+          'mac_bundle': 1,
19425
+          'includes': [ '../build/objc_common.gypi' ],
19426
+          # Slightly hacky, but we need to re-declare files here that are C
19427
+          # interfaces because otherwise they will be dead-stripped during
19428
+          # linking (ObjC classes cannot be dead-stripped). We might consider
19429
+          # just only using ObjC interfaces.
19430
+          'sources': [
19431
+            'objc/Framework/Classes/RTCFieldTrials.mm',
19432
+            'objc/Framework/Classes/RTCLogging.mm',
19433
+            'objc/Framework/Classes/RTCMetrics.mm',
19434
+            'objc/Framework/Classes/RTCSSLAdapter.mm',
19435
+            'objc/Framework/Classes/RTCTracing.mm',
19436
+            'objc/Framework/Headers/WebRTC/RTCFieldTrials.h',
19437
+            'objc/Framework/Headers/WebRTC/RTCLogging.h',
19438
+            'objc/Framework/Headers/WebRTC/RTCSSLAdapter.h',
19439
+            'objc/Framework/Headers/WebRTC/RTCTracing.h',
19440
+            'objc/Framework/Headers/WebRTC/WebRTC.h',
19441
+            'objc/Framework/Modules/module.modulemap',
19442
+          ],
19443
+          'mac_framework_headers': [
19444
+            'objc/Framework/Headers/WebRTC/RTCAudioSource.h',
19445
+            'objc/Framework/Headers/WebRTC/RTCAudioTrack.h',
19446
+            'objc/Framework/Headers/WebRTC/RTCAVFoundationVideoSource.h',
19447
+            'objc/Framework/Headers/WebRTC/RTCCameraPreviewView.h',
19448
+            'objc/Framework/Headers/WebRTC/RTCConfiguration.h',
19449
+            'objc/Framework/Headers/WebRTC/RTCDataChannel.h',
19450
+            'objc/Framework/Headers/WebRTC/RTCDataChannelConfiguration.h',
19451
+            'objc/Framework/Headers/WebRTC/RTCDispatcher.h',
19452
+            'objc/Framework/Headers/WebRTC/RTCEAGLVideoView.h',
19453
+            'objc/Framework/Headers/WebRTC/RTCFieldTrials.h',
19454
+            'objc/Framework/Headers/WebRTC/RTCFileLogger.h',
19455
+            'objc/Framework/Headers/WebRTC/RTCIceCandidate.h',
19456
+            'objc/Framework/Headers/WebRTC/RTCIceServer.h',
19457
+            'objc/Framework/Headers/WebRTC/RTCLegacyStatsReport.h',
19458
+            'objc/Framework/Headers/WebRTC/RTCLogging.h',
19459
+            'objc/Framework/Headers/WebRTC/RTCMacros.h',
19460
+            'objc/Framework/Headers/WebRTC/RTCMediaConstraints.h',
19461
+            'objc/Framework/Headers/WebRTC/RTCMediaSource.h',
19462
+            'objc/Framework/Headers/WebRTC/RTCMediaStream.h',
19463
+            'objc/Framework/Headers/WebRTC/RTCMediaStreamTrack.h',
19464
+            'objc/Framework/Headers/WebRTC/RTCMetrics.h',
19465
+            'objc/Framework/Headers/WebRTC/RTCMetricsSampleInfo.h',
19466
+            'objc/Framework/Headers/WebRTC/RTCNSGLVideoView.h',
19467
+            'objc/Framework/Headers/WebRTC/RTCPeerConnection.h',
19468
+            'objc/Framework/Headers/WebRTC/RTCPeerConnectionFactory.h',
19469
+            'objc/Framework/Headers/WebRTC/RTCRtpCodecParameters.h',
19470
+            'objc/Framework/Headers/WebRTC/RTCRtpEncodingParameters.h',
19471
+            'objc/Framework/Headers/WebRTC/RTCRtpParameters.h',
19472
+            'objc/Framework/Headers/WebRTC/RTCRtpReceiver.h',
19473
+            'objc/Framework/Headers/WebRTC/RTCRtpSender.h',
19474
+            'objc/Framework/Headers/WebRTC/RTCSessionDescription.h',
19475
+            'objc/Framework/Headers/WebRTC/RTCSSLAdapter.h',
19476
+            'objc/Framework/Headers/WebRTC/RTCTracing.h',
19477
+            'objc/Framework/Headers/WebRTC/RTCVideoFrame.h',
19478
+            'objc/Framework/Headers/WebRTC/RTCVideoRenderer.h',
19479
+            'objc/Framework/Headers/WebRTC/RTCVideoSource.h',
19480
+            'objc/Framework/Headers/WebRTC/RTCVideoTrack.h',
19481
+            'objc/Framework/Headers/WebRTC/UIDevice+RTCDevice.h',
19482
+            'objc/Framework/Headers/WebRTC/WebRTC.h',
19483
+          ],
19484
+          'dependencies': [
19485
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:field_trial_default',
19486
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
19487
+            'rtc_sdk_peerconnection_objc',
19488
+          ],
19489
+          'xcode_settings': {
19490
+            'CODE_SIGNING_REQUIRED': 'NO',
19491
+            'CODE_SIGN_IDENTITY': '',
19492
+            'DEFINES_MODULE': 'YES',
19493
+            'INFOPLIST_FILE': 'objc/Framework/Info.plist',
19494
+            'LD_DYLIB_INSTALL_NAME': '@rpath/WebRTC.framework/WebRTC',
19495
+            'MODULEMAP_FILE': '<(webrtc_root)/sdk/Framework/Modules/module.modulemap',
19496
+          },
19497
+          'link_settings': {
19498
+            'xcode_settings': {
19499
+              'OTHER_LDFLAGS': [
19500
+                '-framework AVFoundation',
19501
+                '-framework AudioToolbox',
19502
+                '-framework CoreGraphics',
19503
+                '-framework CoreMedia',
19504
+                '-framework GLKit',
19505
+                '-framework VideoToolbox',
19506
+              ],
19507
+            },
19508
+          },  # link_settings
19509
+          'conditions': [
19510
+            # TODO(tkchin): Generate WebRTC.h based off of
19511
+            # mac_framework_headers instead of hard-coding. Ok for now since we
19512
+            # only really care about dynamic lib on iOS outside of chromium.
19513
+            ['OS!="mac"', {
19514
+              'mac_framework_headers!': [
19515
+                'objc/Framework/Headers/WebRTC/RTCNSGLVideoView.h',
19516
+              ],
19517
+            }],
19518
+            ['build_with_chromium==1', {
19519
+              'mac_framework_headers!': [
19520
+                'objc/Framework/Headers/WebRTC/RTCFileLogger.h',
19521
+              ],
19522
+            }],
19523
+          ],  # conditions
19524
+        }, # rtc_sdk_framework_objc
19525
+      ],  # targets
19526
+    }],  # OS=="ios" or (OS=="mac" and mac_deployment_target=="10.7")
19527
+  ],
19528
+}
19529
diff --git media/webrtc/trunk/webrtc/sdk/sdk.gypi media/webrtc/trunk/webrtc/sdk/sdk.gypi
19530
new file mode 100644
19531
index 000000000000..8f8ee97a9d20
19532
--- /dev/null
19533
+++ media/webrtc/trunk/webrtc/sdk/sdk.gypi
19534
@@ -0,0 +1,26 @@
19535
+# Copyright 2016 The WebRTC project authors. All Rights Reserved.
19536
+#
19537
+# Use of this source code is governed by a BSD-style license
19538
+# that can be found in the LICENSE file in the root of the source
19539
+# tree. An additional intellectual property rights grant can be found
19540
+# in the file PATENTS.  All contributing project authors may
19541
+# be found in the AUTHORS file in the root of the source tree.
19542
+
19543
+{
19544
+  'target_defaults': {
19545
+    'configurations': {
19546
+      'Profile': {
19547
+        'xcode_settings': {
19548
+          'DEBUG_INFORMARTION_FORMAT': 'dwarf-with-dsym',
19549
+          # We manually strip using strip -S and strip -x. We need to run
19550
+          # dsymutil ourselves so we need symbols around before that.
19551
+          'DEPLOYMENT_POSTPROCESSING': 'NO',
19552
+          'GCC_OPTIMIZATION_LEVEL': 's',
19553
+          'GCC_SYMBOLS_PRIVATE_EXTERN': 'YES',
19554
+          'STRIP_INSTALLED_PRODUCT': 'NO',
19555
+          'USE_HEADERMAP': 'YES',
19556
+        },
19557
+      },
19558
+    },
19559
+  },
19560
+}
19561
diff --git media/webrtc/trunk/webrtc/stats/stats.gyp media/webrtc/trunk/webrtc/stats/stats.gyp
19562
new file mode 100644
19563
index 000000000000..bbeb0213d0ba
19564
--- /dev/null
19565
+++ media/webrtc/trunk/webrtc/stats/stats.gyp
19566
@@ -0,0 +1,27 @@
19567
+# Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
19568
+#
19569
+# Use of this source code is governed by a BSD-style license
19570
+# that can be found in the LICENSE file in the root of the source
19571
+# tree. An additional intellectual property rights grant can be found
19572
+# in the file PATENTS.  All contributing project authors may
19573
+# be found in the AUTHORS file in the root of the source tree.
19574
+
19575
+{
19576
+  'includes': [ '../build/common.gypi', ],
19577
+  'targets': [
19578
+    {
19579
+      # GN version: webrtc/stats:rtc_stats
19580
+      'target_name': 'rtc_stats',
19581
+      'type': 'static_library',
19582
+      'dependencies': [
19583
+        '<(webrtc_root)/api/api.gyp:rtc_stats_api',
19584
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
19585
+      ],
19586
+      'sources': [
19587
+        'rtcstats.cc',
19588
+        'rtcstats_objects.cc',
19589
+        'rtcstatsreport.cc',
19590
+      ],
19591
+    },
19592
+  ],
19593
+}
19594
diff --git media/webrtc/trunk/webrtc/supplement.gypi media/webrtc/trunk/webrtc/supplement.gypi
19595
new file mode 100644
19596
index 000000000000..05f1deffec15
19597
--- /dev/null
19598
+++ media/webrtc/trunk/webrtc/supplement.gypi
19599
@@ -0,0 +1,64 @@
19600
+{
19601
+  'variables': {
19602
+    'variables': {
19603
+      'webrtc_root%': '<(DEPTH)', # '<(DEPTH)/webrtc',
19604
+      # Override the defaults in Chromium's build/common.gypi.
19605
+      # Needed for ARC and libc++.
19606
+      'mac_sdk_min%': '10.11',
19607
+      'mac_deployment_target%': '10.7',
19608
+      # Disable use of sysroot for Linux. It's enabled by default in Chromium,
19609
+      # but it currently lacks the libudev-dev package.
19610
+      # TODO(kjellander): Remove when crbug.com/561584 is fixed.
19611
+      'use_sysroot': 0,
19612
+    },
19613
+    'webrtc_root%': '<(webrtc_root)',
19614
+    'mac_deployment_target%': '<(mac_deployment_target)',
19615
+    'use_sysroot%': '<(use_sysroot)',
19616
+    'build_with_chromium': 0,
19617
+    'conditions': [
19618
+      ['OS=="ios"', {
19619
+        # Set target_subarch for if not already set. This is needed because the
19620
+        # Chromium iOS toolchain relies on target_subarch being set.
19621
+        'conditions': [
19622
+          ['target_arch=="arm" or target_arch=="ia32"', {
19623
+            'target_subarch%': 'arm32',
19624
+          }],
19625
+          ['target_arch=="arm64" or target_arch=="x64"', {
19626
+            'target_subarch%': 'arm64',
19627
+          }],
19628
+        ],
19629
+      }],
19630
+      ['OS=="android"', {
19631
+        # MJPEG capture is not used on Android. Disable to reduce
19632
+        # libjingle_peerconnection_so file size.
19633
+        'libyuv_disable_jpeg%': 1,
19634
+      }],
19635
+    ],
19636
+  },
19637
+  'target_defaults': {
19638
+    'target_conditions': [
19639
+      ['_target_name=="sanitizer_options"', {
19640
+        'conditions': [
19641
+          ['lsan==1', {
19642
+            # Replace Chromium's LSan suppressions with our own for WebRTC.
19643
+            'sources/': [
19644
+              ['exclude', 'lsan_suppressions.cc'],
19645
+            ],
19646
+            'sources': [
19647
+              '<(webrtc_root)/build/sanitizers/lsan_suppressions_webrtc.cc',
19648
+            ],
19649
+          }],
19650
+          ['tsan==1', {
19651
+            # Replace Chromium's TSan v2 suppressions with our own for WebRTC.
19652
+            'sources/': [
19653
+              ['exclude', 'tsan_suppressions.cc'],
19654
+            ],
19655
+            'sources': [
19656
+              '<(webrtc_root)/build/sanitizers/tsan_suppressions_webrtc.cc',
19657
+            ],
19658
+          }],
19659
+        ],
19660
+      }],
19661
+    ],
19662
+  },
19663
+}
19664
diff --git media/webrtc/trunk/webrtc/system_wrappers/BUILD.gn media/webrtc/trunk/webrtc/system_wrappers/BUILD.gn
19665
index f963f9427d7e..745867bf912b 100644
19666
--- media/webrtc/trunk/webrtc/system_wrappers/BUILD.gn
19667
+++ media/webrtc/trunk/webrtc/system_wrappers/BUILD.gn
19668
@@ -82,15 +82,7 @@ rtc_static_library("system_wrappers") {
19669
 
19670
     defines += [ "WEBRTC_THREAD_RR" ]
19671
 
19672
-    if (!build_with_mozilla) {
19673
-      deps += [ ":cpu_features_android" ]
19674
-    } else {
19675
-      include_dirs = [
19676
-        "/config/external/nspr",
19677
-        "/nsprpub/lib/ds",
19678
-        "/nsprpub/pr/include",
19679
-      ]
19680
-    }
19681
+    deps += [ ":cpu_features_android" ]
19682
 
19683
     libs += [ "log" ]
19684
   }
19685
@@ -153,7 +145,7 @@ group("system_wrappers_default") {
19686
   ]
19687
 }
19688
 
19689
-if (is_android && !build_with_mozilla) {
19690
+if (is_android) {
19691
   rtc_static_library("cpu_features_android") {
19692
     sources = [
19693
       "source/cpu_features_android.c",
19694
diff --git media/webrtc/trunk/webrtc/system_wrappers/cpu_features_chromium.gyp media/webrtc/trunk/webrtc/system_wrappers/cpu_features_chromium.gyp
19695
new file mode 100644
19696
index 000000000000..519fe4411958
19697
--- /dev/null
19698
+++ media/webrtc/trunk/webrtc/system_wrappers/cpu_features_chromium.gyp
19699
@@ -0,0 +1,26 @@
19700
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
19701
+#
19702
+# Use of this source code is governed by a BSD-style license
19703
+# that can be found in the LICENSE file in the root of the source
19704
+# tree. An additional intellectual property rights grant can be found
19705
+# in the file PATENTS.  All contributing project authors may
19706
+# be found in the AUTHORS file in the root of the source tree.
19707
+
19708
+{
19709
+  'conditions': [
19710
+    ['OS=="android"', {
19711
+      'targets': [
19712
+        {
19713
+          'target_name': 'cpu_features_android',
19714
+          'type': 'static_library',
19715
+          'sources': [
19716
+            'source/cpu_features_android.c',
19717
+          ],
19718
+          'dependencies': [
19719
+            '../../../build/android/ndk.gyp:cpu_features',
19720
+          ],
19721
+        },
19722
+      ],
19723
+    }],
19724
+  ], # conditions
19725
+}
19726
diff --git media/webrtc/trunk/webrtc/system_wrappers/cpu_features_webrtc.gyp media/webrtc/trunk/webrtc/system_wrappers/cpu_features_webrtc.gyp
19727
new file mode 100644
19728
index 000000000000..228e8730725e
19729
--- /dev/null
19730
+++ media/webrtc/trunk/webrtc/system_wrappers/cpu_features_webrtc.gyp
19731
@@ -0,0 +1,56 @@
19732
+# Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
19733
+#
19734
+# Use of this source code is governed by a BSD-style license
19735
+# that can be found in the LICENSE file in the root of the source
19736
+# tree. An additional intellectual property rights grant can be found
19737
+# in the file PATENTS.  All contributing project authors may
19738
+# be found in the AUTHORS file in the root of the source tree.
19739
+
19740
+{
19741
+  'variables': {
19742
+    'include_ndk_cpu_features%': 0,
19743
+  },
19744
+  'includes': [ '../build/common.gypi', ],
19745
+  'conditions': [
19746
+    ['OS=="android"', {
19747
+      'targets': [
19748
+        {
19749
+          'target_name': 'cpu_features_android',
19750
+          'type': 'static_library',
19751
+          'sources': [
19752
+            'source/cpu_features_android.c',
19753
+          ],
19754
+          'conditions': [
19755
+            ['include_ndk_cpu_features==1', {
19756
+              'includes': [
19757
+                 '../../build/android/cpufeatures.gypi',
19758
+               ],
19759
+            }, {
19760
+              'sources': [
19761
+                'source/droid-cpu-features.c',
19762
+                'source/droid-cpu-features.h',
19763
+              ],
19764
+            }],
19765
+          'dependencies': [
19766
+            # Not supported, please refer to the GN build.
19767
+            #'../../build/android/ndk.gyp:cpu_features',
19768
+          ],
19769
+        },
19770
+      ],
19771
+    }],
19772
+    ['OS=="linux"', {
19773
+      'targets': [
19774
+        {
19775
+          'target_name': 'cpu_features_linux',
19776
+          'type': 'static_library',
19777
+          'sources': [
19778
+            'source/cpu_features_linux.c',
19779
+          ],
19780
+          'dependencies': [
19781
+            '<(webrtc_root)/common.gyp:webrtc_common',
19782
+          ],
19783
+        },
19784
+      ],
19785
+    }],
19786
+  ], # conditions
19787
+}
19788
diff --git media/webrtc/trunk/webrtc/system_wrappers/system_wrappers.gyp media/webrtc/trunk/webrtc/system_wrappers/system_wrappers.gyp
19789
new file mode 100644
19790
index 000000000000..d16263366d1c
19791
--- /dev/null
19792
+++ media/webrtc/trunk/webrtc/system_wrappers/system_wrappers.gyp
19793
@@ -0,0 +1,194 @@
19794
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
19795
+#
19796
+# Use of this source code is governed by a BSD-style license
19797
+# that can be found in the LICENSE file in the root of the source
19798
+# tree. An additional intellectual property rights grant can be found
19799
+# in the file PATENTS.  All contributing project authors may
19800
+# be found in the AUTHORS file in the root of the source tree.
19801
+
19802
+{
19803
+  'includes': [ '../build/common.gypi', ],
19804
+  'targets': [
19805
+    {
19806
+      'target_name': 'system_wrappers',
19807
+      'type': 'static_library',
19808
+      'dependencies': [
19809
+#        '<(webrtc_root)/common.gyp:webrtc_common',
19810
+#        '../base/base.gyp:rtc_base_approved',
19811
+        'field_trial_default',
19812
+      ],
19813
+      'sources': [
19814
+        'include/aligned_array.h',
19815
+        'include/aligned_malloc.h',
19816
+        'include/atomic32.h',
19817
+        'include/clock.h',
19818
+        'include/cpu_features_wrapper.h',
19819
+        'include/cpu_info.h',
19820
+        'include/critical_section_wrapper.h',
19821
+        'include/data_log.h',
19822
+        'include/data_log_c.h',
19823
+        'include/data_log_impl.h',
19824
+        'include/event_wrapper.h',
19825
+        'include/field_trial.h',
19826
+        'include/file_wrapper.h',
19827
+        'include/fix_interlocked_exchange_pointer_win.h',
19828
+        'include/logging.h',
19829
+        'include/metrics.h',
19830
+        'include/ntp_time.h',
19831
+        'include/rtp_to_ntp.h',
19832
+        'include/rw_lock_wrapper.h',
19833
+        'include/sleep.h',
19834
+        'include/sort.h',
19835
+        'include/static_instance.h',
19836
+        'include/stl_util.h',
19837
+        'include/stringize_macros.h',
19838
+        'include/timestamp_extrapolator.h',
19839
+        'include/trace.h',
19840
+        'include/utf_util_win.h',
19841
+        'source/aligned_malloc.cc',
19842
+        'source/atomic32_win.cc',
19843
+        'source/clock.cc',
19844
+        'source/condition_variable_event_win.cc',
19845
+        'source/condition_variable_event_win.h',
19846
+        'source/cpu_features.cc',
19847
+        'source/cpu_info.cc',
19848
+# TODO: removed
19849
+#        'source/data_log_c.cc',
19850
+        'source/event.cc',
19851
+        'source/event_timer_posix.cc',
19852
+        'source/event_timer_posix.h',
19853
+        'source/event_timer_win.cc',
19854
+        'source/event_timer_win.h',
19855
+        'source/file_impl.cc',
19856
+        'source/logging.cc',
19857
+        'source/rtp_to_ntp_estimator.cc',
19858
+        'source/rw_lock.cc',
19859
+        'source/rw_lock_posix.cc',
19860
+        'source/rw_lock_posix.h',
19861
+        'source/rw_lock_win.cc',
19862
+        'source/rw_lock_win.h',
19863
+        'source/rw_lock_winxp_win.cc',
19864
+        'source/rw_lock_winxp_win.h',
19865
+        'source/sleep.cc',
19866
+# TODO: removed
19867
+#        'source/sort.cc',
19868
+        'source/timestamp_extrapolator.cc',
19869
+        'source/trace_impl.cc',
19870
+        'source/trace_impl.h',
19871
+        'source/trace_posix.cc',
19872
+        'source/trace_posix.h',
19873
+        'source/trace_win.cc',
19874
+        'source/trace_win.h',
19875
+      ],
19876
+      'conditions': [
19877
+        #TODO: missing
19878
+        #['enable_data_logging==1', {
19879
+        #  'sources': [ 'source/data_log.cc', ],
19880
+        #}, {
19881
+        #  'sources': [ 'source/data_log_no_op.cc', ],
19882
+        #},],
19883
+        ['build_with_mozilla', {
19884
+          'sources': [
19885
+            'source/metrics_default.cc',
19886
+          ],
19887
+        }],
19888
+        ['OS=="android"', {
19889
+          'defines': [
19890
+            'WEBRTC_THREAD_RR',
19891
+           ],
19892
+          'conditions': [
19893
+            ['build_with_chromium==1', {
19894
+              'dependencies': [
19895
+#                'cpu_features_chromium.gyp:cpu_features_android',
19896
+              ],
19897
+            }, {
19898
+              'dependencies': [
19899
+#                'cpu_features_webrtc.gyp:cpu_features_android',
19900
+              ],
19901
+            }],
19902
+          ],
19903
+          'link_settings': {
19904
+            'libraries': [
19905
+              '-llog',
19906
+            ],
19907
+          },
19908
+          'sources': [
19909
+            'include/logcat_trace_context.h',
19910
+            'source/logcat_trace_context.cc',
19911
+          ],
19912
+        }],
19913
+        ['OS=="linux"', {
19914
+          'defines': [
19915
+            'WEBRTC_THREAD_RR',
19916
+          ],
19917
+          'conditions': [
19918
+            ['build_with_chromium==0', {
19919
+              'dependencies': [
19920
+#                'cpu_features_webrtc.gyp:cpu_features_linux',
19921
+              ],
19922
+            }],
19923
+          ],
19924
+          'link_settings': {
19925
+            'libraries': [ '-lrt', ],
19926
+          },
19927
+        }],
19928
+        ['OS=="mac"', {
19929
+          'link_settings': {
19930
+            'libraries': [ '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', ],
19931
+          },
19932
+        }],
19933
+        ['os_bsd==1', {
19934
+          'defines': [
19935
+            'WEBRTC_THREAD_RR',
19936
+          ],
19937
+        }],
19938
+        ['OS=="linux" or OS=="android" or os_bsd==1', {
19939
+          'sources': [
19940
+            'source/atomic32_non_darwin_unix.cc',
19941
+          ],
19942
+        }],
19943
+        ['OS=="ios" or OS=="mac"', {
19944
+          'defines': [
19945
+            'WEBRTC_THREAD_RR',
19946
+          ],
19947
+          'sources': [
19948
+            'source/atomic32_darwin.cc',
19949
+          ],
19950
+        }],
19951
+        ['OS=="win"', {
19952
+          'link_settings': {
19953
+            'libraries': [ '-lwinmm.lib', ],
19954
+          },
19955
+        }],
19956
+      ], # conditions
19957
+      # Disable warnings to enable Win64 build, issue 1323.
19958
+      'msvs_disabled_warnings': [
19959
+        4267,  # size_t to int truncation.
19960
+        4334,  # Ignore warning on shift operator promotion.
19961
+      ],
19962
+    }, {
19963
+      'target_name': 'field_trial_default',
19964
+      'type': 'static_library',
19965
+      'sources': [
19966
+        'include/field_trial_default.h',
19967
+        'source/field_trial_default.cc',
19968
+      ]
19969
+    }, {
19970
+      'target_name': 'metrics_default',
19971
+      'type': 'static_library',
19972
+      'sources': [
19973
+        'include/metrics_default.h',
19974
+        'source/metrics_default.cc',
19975
+      ],
19976
+    }, {
19977
+      'target_name': 'system_wrappers_default',
19978
+      'type': 'static_library',
19979
+      'dependencies': [
19980
+#        'system_wrappers',
19981
+#        'field_trial_default',
19982
+#        'metrics_default',
19983
+      ]
19984
+    },
19985
+  ], # targets
19986
+}
19987
+
19988
diff --git media/webrtc/trunk/webrtc/test/test.gyp media/webrtc/trunk/webrtc/test/test.gyp
19989
new file mode 100644
19990
index 000000000000..c80714a4a9d3
19991
--- /dev/null
19992
+++ media/webrtc/trunk/webrtc/test/test.gyp
19993
@@ -0,0 +1,296 @@
19994
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
19995
+#
19996
+# Use of this source code is governed by a BSD-style license
19997
+# that can be found in the LICENSE file in the root of the source
19998
+# tree. An additional intellectual property rights grant can be found
19999
+# in the file PATENTS.  All contributing project authors may
20000
+# be found in the AUTHORS file in the root of the source tree.
20001
+
20002
+# TODO(andrew): consider moving test_support to src/base/test.
20003
+{
20004
+  'includes': [
20005
+    '../build/common.gypi',
20006
+  ],
20007
+  'targets': [
20008
+    {
20009
+      'target_name': 'video_test_common',
20010
+      'type': 'static_library',
20011
+      'sources': [
20012
+        'fake_texture_frame.cc',
20013
+        'fake_texture_frame.h',
20014
+        'frame_generator.cc',
20015
+        'frame_generator.h',
20016
+        'frame_utils.cc',
20017
+        'frame_utils.h',
20018
+      ],
20019
+      'dependencies': [
20020
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
20021
+      ],
20022
+    },
20023
+    {
20024
+      'target_name': 'rtp_test_utils',
20025
+      'type': 'static_library',
20026
+      'sources': [
20027
+        'rtcp_packet_parser.cc',
20028
+        'rtcp_packet_parser.h',
20029
+        'rtp_file_reader.cc',
20030
+        'rtp_file_reader.h',
20031
+        'rtp_file_writer.cc',
20032
+        'rtp_file_writer.h',
20033
+      ],
20034
+      'dependencies': [
20035
+        '<(DEPTH)/testing/gtest.gyp:gtest',
20036
+        '<(webrtc_root)/common.gyp:webrtc_common',
20037
+        '<(webrtc_root)/modules/modules.gyp:rtp_rtcp',
20038
+      ],
20039
+    },
20040
+    {
20041
+      'target_name': 'field_trial',
20042
+      'type': 'static_library',
20043
+      'sources': [
20044
+        'field_trial.cc',
20045
+        'field_trial.h',
20046
+      ],
20047
+      'dependencies': [
20048
+        '<(webrtc_root)/common.gyp:webrtc_common',
20049
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:field_trial_default',
20050
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
20051
+      ],
20052
+    },
20053
+    {
20054
+      'target_name': 'test_main',
20055
+      'type': 'static_library',
20056
+      'sources': [
20057
+        'test_main.cc',
20058
+      ],
20059
+      'dependencies': [
20060
+        'field_trial',
20061
+        'test_support',
20062
+        '<(DEPTH)/testing/gtest.gyp:gtest',
20063
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
20064
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
20065
+      ],
20066
+    },
20067
+    {
20068
+      'target_name': 'test_support',
20069
+      'type': 'static_library',
20070
+      'dependencies': [
20071
+        '<(DEPTH)/testing/gtest.gyp:gtest',
20072
+        '<(DEPTH)/testing/gmock.gyp:gmock',
20073
+        '<(webrtc_root)/base/base.gyp:gtest_prod',
20074
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
20075
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
20076
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
20077
+        'video_test_common',
20078
+      ],
20079
+      'sources': [
20080
+        'gmock.h',
20081
+        'gtest.h',
20082
+        'testsupport/fileutils.cc',
20083
+        'testsupport/fileutils.h',
20084
+        'testsupport/frame_reader.cc',
20085
+        'testsupport/frame_reader.h',
20086
+        'testsupport/frame_writer.cc',
20087
+        'testsupport/frame_writer.h',
20088
+        'testsupport/iosfileutils.mm',
20089
+        'testsupport/metrics/video_metrics.h',
20090
+        'testsupport/metrics/video_metrics.cc',
20091
+        'testsupport/mock/mock_frame_reader.h',
20092
+        'testsupport/mock/mock_frame_writer.h',
20093
+        'testsupport/packet_reader.cc',
20094
+        'testsupport/packet_reader.h',
20095
+        'testsupport/perf_test.cc',
20096
+        'testsupport/perf_test.h',
20097
+        'testsupport/trace_to_stderr.cc',
20098
+        'testsupport/trace_to_stderr.h',
20099
+      ],
20100
+      'conditions': [
20101
+        ['OS=="ios"', {
20102
+          'xcode_settings': {
20103
+            'CLANG_ENABLE_OBJC_ARC': 'YES',
20104
+          },
20105
+        }],
20106
+        ['use_x11==1', {
20107
+          'dependencies': [
20108
+            '<(DEPTH)/tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
20109
+          ],
20110
+        }],
20111
+      ],
20112
+    },
20113
+    {
20114
+      # Depend on this target when you want to have test_support but also the
20115
+      # main method needed for gtest to execute!
20116
+      'target_name': 'test_support_main',
20117
+      'type': 'static_library',
20118
+      'dependencies': [
20119
+        'field_trial',
20120
+        'test_support',
20121
+        '<(DEPTH)/testing/gmock.gyp:gmock',
20122
+        '<(DEPTH)/testing/gtest.gyp:gtest',
20123
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
20124
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
20125
+      ],
20126
+      'sources': [
20127
+        'run_all_unittests.cc',
20128
+        'test_suite.cc',
20129
+        'test_suite.h',
20130
+      ],
20131
+    },
20132
+    {
20133
+      # Depend on this target when you want to have test_support and a special
20134
+      # main for mac which will run your test on a worker thread and consume
20135
+      # events on the main thread. Useful if you want to access a webcam.
20136
+      # This main will provide all the scaffolding and objective-c black magic
20137
+      # for you. All you need to do is to implement a function in the
20138
+      # run_threaded_main_mac.h file (ImplementThisToRunYourTest).
20139
+      'target_name': 'test_support_main_threaded_mac',
20140
+      'type': 'static_library',
20141
+      'dependencies': [
20142
+        'test_support',
20143
+      ],
20144
+      'sources': [
20145
+        'testsupport/mac/run_threaded_main_mac.h',
20146
+        'testsupport/mac/run_threaded_main_mac.mm',
20147
+      ],
20148
+    },
20149
+    {
20150
+     'target_name': 'test_common',
20151
+     'type': 'static_library',
20152
+     'sources': [
20153
+       'call_test.cc',
20154
+       'call_test.h',
20155
+       'configurable_frame_size_encoder.cc',
20156
+       'configurable_frame_size_encoder.h',
20157
+       'constants.cc',
20158
+       'constants.h',
20159
+       'direct_transport.cc',
20160
+       'direct_transport.h',
20161
+       'drifting_clock.cc',
20162
+       'drifting_clock.h',
20163
+       'encoder_settings.cc',
20164
+       'encoder_settings.h',
20165
+       'fake_audio_device.cc',
20166
+       'fake_audio_device.h',
20167
+       'fake_decoder.cc',
20168
+       'fake_decoder.h',
20169
+       'fake_encoder.cc',
20170
+       'fake_encoder.h',
20171
+       'fake_network_pipe.cc',
20172
+       'fake_network_pipe.h',
20173
+       'fake_videorenderer.h',
20174
+       'frame_generator_capturer.cc',
20175
+       'frame_generator_capturer.h',
20176
+       'layer_filtering_transport.cc',
20177
+       'layer_filtering_transport.h',
20178
+       'mock_transport.h',
20179
+       'mock_voe_channel_proxy.h',
20180
+       'mock_voice_engine.h',
20181
+       'null_transport.cc',
20182
+       'null_transport.h',
20183
+       'rtp_rtcp_observer.h',
20184
+       'statistics.cc',
20185
+       'statistics.h',
20186
+       'vcm_capturer.cc',
20187
+       'vcm_capturer.h',
20188
+       'video_capturer.h',
20189
+       'win/run_loop_win.cc',
20190
+     ],
20191
+     'conditions': [
20192
+       ['OS!="win"', {
20193
+         'sources': [
20194
+            'run_loop.h',
20195
+            'run_loop.cc',
20196
+         ],
20197
+       }],
20198
+     ],
20199
+     'dependencies': [
20200
+       '<(DEPTH)/testing/gmock.gyp:gmock',
20201
+       '<(DEPTH)/testing/gtest.gyp:gtest',
20202
+       '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
20203
+       '<(webrtc_root)/base/base.gyp:rtc_base_approved',
20204
+       '<(webrtc_root)/common.gyp:webrtc_common',
20205
+       '<(webrtc_root)/modules/modules.gyp:media_file',
20206
+       '<(webrtc_root)/webrtc.gyp:webrtc',
20207
+       'rtp_test_utils',
20208
+       'test_support',
20209
+     ],
20210
+    },
20211
+    {
20212
+     'target_name': 'test_renderer',
20213
+     'type': 'static_library',
20214
+     'sources': [
20215
+       'linux/glx_renderer.cc',
20216
+       'linux/glx_renderer.h',
20217
+       'linux/video_renderer_linux.cc',
20218
+       'mac/video_renderer_mac.h',
20219
+       'mac/video_renderer_mac.mm',
20220
+       'video_renderer.cc',
20221
+       'video_renderer.h',
20222
+       'win/d3d_renderer.cc',
20223
+       'win/d3d_renderer.h',
20224
+     ],
20225
+     'conditions': [
20226
+       ['OS!="linux" and OS!="mac" and OS!="win"', {
20227
+         'sources': [
20228
+           'null_platform_renderer.cc',
20229
+         ],
20230
+       }],
20231
+       ['OS=="linux" or OS=="mac"', {
20232
+         'sources' : [
20233
+           'gl/gl_renderer.cc',
20234
+           'gl/gl_renderer.h',
20235
+         ],
20236
+       }],
20237
+       ['OS=="win"', {
20238
+         'include_dirs': [
20239
+           '<(directx_sdk_path)/Include',
20240
+         ],
20241
+       }],
20242
+       ['OS=="win" and clang==1', {
20243
+         'msvs_settings': {
20244
+           'VCCLCompilerTool': {
20245
+             'AdditionalOptions': [
20246
+               # Disable warnings failing when compiling with Clang on Windows.
20247
+               # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
20248
+               '-Wno-bool-conversion',
20249
+               '-Wno-comment',
20250
+               '-Wno-delete-non-virtual-dtor',
20251
+             ],
20252
+           },
20253
+         },
20254
+       }],
20255
+     ],
20256
+     'dependencies': [
20257
+       '<(DEPTH)/testing/gtest.gyp:gtest',
20258
+       '<(webrtc_root)/modules/modules.gyp:media_file',
20259
+       'test_support',
20260
+       'video_test_common',
20261
+     ],
20262
+     'direct_dependent_settings': {
20263
+       'conditions': [
20264
+         ['OS=="linux"', {
20265
+           'libraries': [
20266
+             '-lXext',
20267
+             '-lX11',
20268
+             '-lGL',
20269
+           ],
20270
+         }],
20271
+         ['OS=="android"', {
20272
+           'libraries' : [
20273
+             '-lGLESv2', '-llog',
20274
+           ],
20275
+         }],
20276
+         ['OS=="mac"', {
20277
+           'xcode_settings' : {
20278
+             'OTHER_LDFLAGS' : [
20279
+               '-framework Cocoa',
20280
+               '-framework OpenGL',
20281
+               '-framework CoreVideo',
20282
+             ],
20283
+           },
20284
+         }],
20285
+       ],
20286
+     },
20287
+    },
20288
+  ],
20289
+}
20290
diff --git media/webrtc/trunk/webrtc/tools/internal_tools.gyp media/webrtc/trunk/webrtc/tools/internal_tools.gyp
20291
new file mode 100644
20292
index 000000000000..bee8a8bf0e21
20293
--- /dev/null
20294
+++ media/webrtc/trunk/webrtc/tools/internal_tools.gyp
20295
@@ -0,0 +1,28 @@
20296
+ # Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
20297
+#
20298
+# Use of this source code is governed by a BSD-style license
20299
+# that can be found in the LICENSE file in the root of the source
20300
+# tree. An additional intellectual property rights grant can be found
20301
+# in the file PATENTS.  All contributing project authors may
20302
+# be found in the AUTHORS file in the root of the source tree.
20303
+
20304
+# This file is used for internal tools used by the WebRTC code only.
20305
+
20306
+{
20307
+  'includes': [
20308
+    '../build/common.gypi',
20309
+  ],
20310
+  'targets': [
20311
+    {
20312
+      'target_name': 'command_line_parser',
20313
+      'type': 'static_library',
20314
+      'sources': [
20315
+        'simple_command_line_parser.h',
20316
+        'simple_command_line_parser.cc',
20317
+      ],
20318
+      'dependencies': [
20319
+        '<(webrtc_root)/base/base.gyp:gtest_prod',
20320
+      ],
20321
+    }, # command_line_parser
20322
+  ],
20323
+}
20324
diff --git media/webrtc/trunk/webrtc/tools/tools.gyp media/webrtc/trunk/webrtc/tools/tools.gyp
20325
new file mode 100644
20326
index 000000000000..3b3a84292d5f
20327
--- /dev/null
20328
+++ media/webrtc/trunk/webrtc/tools/tools.gyp
20329
@@ -0,0 +1,146 @@
20330
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
20331
+#
20332
+# Use of this source code is governed by a BSD-style license
20333
+# that can be found in the LICENSE file in the root of the source
20334
+# tree. An additional intellectual property rights grant can be found
20335
+# in the file PATENTS.  All contributing project authors may
20336
+# be found in the AUTHORS file in the root of the source tree.
20337
+
20338
+{
20339
+  'includes': [
20340
+    '../build/common.gypi',
20341
+  ],
20342
+  'targets': [
20343
+    {
20344
+      'target_name': 'video_quality_analysis',
20345
+      'type': 'static_library',
20346
+      'dependencies': [
20347
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
20348
+      ],
20349
+      'export_dependent_settings': [
20350
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
20351
+      ],
20352
+      'sources': [
20353
+        'frame_analyzer/video_quality_analysis.h',
20354
+        'frame_analyzer/video_quality_analysis.cc',
20355
+      ],
20356
+    }, # video_quality_analysis
20357
+    {
20358
+      'target_name': 'frame_analyzer',
20359
+      'type': 'executable',
20360
+      'dependencies': [
20361
+        '<(webrtc_root)/tools/internal_tools.gyp:command_line_parser',
20362
+        'video_quality_analysis',
20363
+      ],
20364
+      'sources': [
20365
+        'frame_analyzer/frame_analyzer.cc',
20366
+      ],
20367
+    }, # frame_analyzer
20368
+    {
20369
+      'target_name': 'psnr_ssim_analyzer',
20370
+      'type': 'executable',
20371
+      'dependencies': [
20372
+        '<(webrtc_root)/tools/internal_tools.gyp:command_line_parser',
20373
+        'video_quality_analysis',
20374
+      ],
20375
+      'sources': [
20376
+        'psnr_ssim_analyzer/psnr_ssim_analyzer.cc',
20377
+      ],
20378
+    }, # psnr_ssim_analyzer
20379
+    {
20380
+      'target_name': 'rgba_to_i420_converter',
20381
+      'type': 'executable',
20382
+      'dependencies': [
20383
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
20384
+        '<(webrtc_root)/tools/internal_tools.gyp:command_line_parser',
20385
+      ],
20386
+      'sources': [
20387
+        'converter/converter.h',
20388
+        'converter/converter.cc',
20389
+        'converter/rgba_to_i420_converter.cc',
20390
+      ],
20391
+    }, # rgba_to_i420_converter
20392
+    {
20393
+      'target_name': 'frame_editing_lib',
20394
+      'type': 'static_library',
20395
+      'dependencies': [
20396
+        '<(webrtc_root)/common_video/common_video.gyp:common_video',
20397
+      ],
20398
+      'sources': [
20399
+        'frame_editing/frame_editing_lib.cc',
20400
+        'frame_editing/frame_editing_lib.h',
20401
+      ],
20402
+      # Disable warnings to enable Win64 build, issue 1323.
20403
+      'msvs_disabled_warnings': [
20404
+        4267,  # size_t to int truncation.
20405
+      ],
20406
+    }, # frame_editing_lib
20407
+    {
20408
+      'target_name': 'frame_editor',
20409
+      'type': 'executable',
20410
+      'dependencies': [
20411
+        '<(webrtc_root)/tools/internal_tools.gyp:command_line_parser',
20412
+        'frame_editing_lib',
20413
+      ],
20414
+      'sources': [
20415
+        'frame_editing/frame_editing.cc',
20416
+      ],
20417
+    }, # frame_editing
20418
+    {
20419
+      'target_name': 'force_mic_volume_max',
20420
+      'type': 'executable',
20421
+      'dependencies': [
20422
+        '<(webrtc_root)/modules/modules.gyp:audio_device',
20423
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
20424
+      ],
20425
+      'sources': [
20426
+        'force_mic_volume_max/force_mic_volume_max.cc',
20427
+      ],
20428
+    }, # force_mic_volume_max
20429
+  ],
20430
+  'conditions': [
20431
+    ['enable_protobuf==1', {
20432
+      'targets': [
20433
+        {
20434
+          'target_name': 'chart_proto',
20435
+          'type': 'static_library',
20436
+          'sources': [
20437
+            'event_log_visualizer/chart.proto',
20438
+          ],
20439
+          'variables': {
20440
+            'proto_in_dir': 'event_log_visualizer',
20441
+            'proto_out_dir': 'webrtc/tools/event_log_visualizer',
20442
+          },
20443
+          'includes': ['../build/protoc.gypi'],
20444
+        },
20445
+        {
20446
+          # RTC event log visualization library
20447
+          'target_name': 'event_log_visualizer_utils',
20448
+          'type': 'static_library',
20449
+          'dependencies': [
20450
+            '<(webrtc_root)/webrtc.gyp:rtc_event_log_impl',
20451
+            '<(webrtc_root)/webrtc.gyp:rtc_event_log_parser',
20452
+            '<(webrtc_root)/modules/modules.gyp:congestion_controller',
20453
+            '<(webrtc_root)/modules/modules.gyp:rtp_rtcp',
20454
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
20455
+            ':chart_proto',
20456
+          ],
20457
+          'sources': [
20458
+            'event_log_visualizer/analyzer.cc',
20459
+            'event_log_visualizer/analyzer.h',
20460
+            'event_log_visualizer/plot_base.cc',
20461
+            'event_log_visualizer/plot_base.h',
20462
+            'event_log_visualizer/plot_protobuf.cc',
20463
+            'event_log_visualizer/plot_protobuf.h',
20464
+            'event_log_visualizer/plot_python.cc',
20465
+            'event_log_visualizer/plot_python.h',
20466
+          ],
20467
+          'export_dependent_settings': [
20468
+            '<(webrtc_root)/webrtc.gyp:rtc_event_log_parser',
20469
+            ':chart_proto',
20470
+          ],
20471
+        },
20472
+      ],
20473
+    }],
20474
+  ], # conditions
20475
+}
20476
diff --git media/webrtc/trunk/webrtc/video/BUILD.gn media/webrtc/trunk/webrtc/video/BUILD.gn
20477
index 53422e2e56a1..3b33be38a353 100644
20478
--- media/webrtc/trunk/webrtc/video/BUILD.gn
20479
+++ media/webrtc/trunk/webrtc/video/BUILD.gn
20480
@@ -63,6 +63,7 @@ rtc_static_library("video") {
20481
     "../base:rtc_task_queue",
20482
     "../common_video",
20483
     "../logging:rtc_event_log_api",
20484
+    "../media:rtc_media_base",
20485
     "../modules/bitrate_controller",
20486
     "../modules/congestion_controller",
20487
     "../modules/pacing",
20488
@@ -74,12 +75,6 @@ rtc_static_library("video") {
20489
     "../system_wrappers",
20490
     "../voice_engine",
20491
   ]
20492
-
20493
-  if (!build_with_mozilla) {
20494
-    deps += [
20495
-      "../media:rtc_media_base",
20496
-    ]
20497
-  }
20498
 }
20499
 
20500
 if (rtc_include_tests) {
20501
@@ -91,6 +86,7 @@ if (rtc_include_tests) {
20502
     ]
20503
     deps = [
20504
       "../base:rtc_task_queue",
20505
+      "../media:rtc_media_base",
20506
       "../system_wrappers",
20507
       "//testing/gtest",
20508
       "//webrtc/test:test_renderer",
20509
@@ -102,11 +98,6 @@ if (rtc_include_tests) {
20510
       # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
20511
       suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
20512
     }
20513
-    if (!build_with_mozilla) {
20514
-      deps += [
20515
-        "../media:rtc_media_base",
20516
-      ]
20517
-    }
20518
   }
20519
 
20520
   rtc_source_set("video_full_stack_tests") {
20521
@@ -217,6 +208,7 @@ if (rtc_include_tests) {
20522
     ]
20523
     deps = [
20524
       ":video",
20525
+      "../media:rtc_media_base",
20526
       "//testing/gmock",
20527
       "//testing/gtest",
20528
     ]
20529
@@ -227,10 +219,5 @@ if (rtc_include_tests) {
20530
     if (rtc_use_h264) {
20531
       defines += [ "WEBRTC_USE_H264" ]
20532
     }
20533
-    if (!build_with_mozilla) {
20534
-      deps += [
20535
-        "../media:rtc_media_base",
20536
-      ]
20537
-    }
20538
   }
20539
 }
20540
diff --git media/webrtc/trunk/webrtc/video/webrtc_video.gypi media/webrtc/trunk/webrtc/video/webrtc_video.gypi
20541
new file mode 100644
20542
index 000000000000..8d5280282fb3
20543
--- /dev/null
20544
+++ media/webrtc/trunk/webrtc/video/webrtc_video.gypi
20545
@@ -0,0 +1,69 @@
20546
+# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
20547
+#
20548
+# Use of this source code is governed by a BSD-style license
20549
+# that can be found in the LICENSE file in the root of the source
20550
+# tree. An additional intellectual property rights grant can be found
20551
+# in the file PATENTS.  All contributing project authors may
20552
+# be found in the AUTHORS file in the root of the source tree.
20553
+{
20554
+  'variables': {
20555
+    'webrtc_video_dependencies': [
20556
+      '<(webrtc_root)/base/base.gyp:rtc_base_approved',
20557
+      '<(webrtc_root)/common.gyp:webrtc_common',
20558
+      '<(webrtc_root)/common_video/common_video.gyp:common_video',
20559
+      '<(webrtc_root)/modules/modules.gyp:bitrate_controller',
20560
+      '<(webrtc_root)/modules/modules.gyp:congestion_controller',
20561
+      '<(webrtc_root)/modules/modules.gyp:paced_sender',
20562
+      '<(webrtc_root)/modules/modules.gyp:rtp_rtcp',
20563
+      '<(webrtc_root)/modules/modules.gyp:video_capture_module',
20564
+      '<(webrtc_root)/modules/modules.gyp:video_processing',
20565
+      '<(webrtc_root)/modules/modules.gyp:webrtc_utility',
20566
+      '<(webrtc_root)/modules/modules.gyp:webrtc_video_coding',
20567
+      '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
20568
+      '<(webrtc_root)/voice_engine/voice_engine.gyp:voice_engine',
20569
+      '<(webrtc_root)/webrtc.gyp:rtc_event_log_api',
20570
+      '<(webrtc_root)/api/api.gyp:video_frame_api',
20571
+      '<(webrtc_root)/media/media.gyp:mozilla_rtc_media'
20572
+    ],
20573
+    'webrtc_video_sources': [
20574
+      'video/call_stats.cc',
20575
+      'video/call_stats.h',
20576
+      'video/encoder_rtcp_feedback.cc',
20577
+      'video/encoder_rtcp_feedback.h',
20578
+      'video/overuse_frame_detector.cc',
20579
+      'video/overuse_frame_detector.h',
20580
+      'video/payload_router.cc',
20581
+      'video/payload_router.h',
20582
+      'video/quality_threshold.cc',
20583
+      'video/quality_threshold.h',
20584
+      'video/receive_statistics_proxy.cc',
20585
+      'video/receive_statistics_proxy.h',
20586
+      'video/report_block_stats.cc',
20587
+      'video/report_block_stats.h',
20588
+      'video/rtp_stream_receiver.cc',
20589
+      'video/rtp_stream_receiver.h',
20590
+      'video/rtp_streams_synchronizer.cc',
20591
+      'video/rtp_streams_synchronizer.h',
20592
+      'video/send_delay_stats.cc',
20593
+      'video/send_delay_stats.h',
20594
+      'video/send_statistics_proxy.cc',
20595
+      'video/send_statistics_proxy.h',
20596
+      'video/stats_counter.cc',
20597
+      'video/stats_counter.h',
20598
+      'video/stream_synchronization.cc',
20599
+      'video/stream_synchronization.h',
20600
+      'video/transport_adapter.cc',
20601
+      'video/transport_adapter.h',
20602
+      'video/video_receive_stream.cc',
20603
+      'video/video_receive_stream.h',
20604
+      'video/video_send_stream.cc',
20605
+      'video/video_send_stream.h',
20606
+      'video/video_stream_decoder.cc',
20607
+      'video/video_stream_decoder.h',
20608
+      'video/vie_encoder.cc',
20609
+      'video/vie_encoder.h',
20610
+      'video/vie_remb.cc',
20611
+      'video/vie_remb.h',
20612
+    ],
20613
+  },
20614
+}
20615
diff --git media/webrtc/trunk/webrtc/voice_engine/voice_engine.gyp media/webrtc/trunk/webrtc/voice_engine/voice_engine.gyp
20616
new file mode 100644
20617
index 000000000000..63d1991dc3e3
20618
--- /dev/null
20619
+++ media/webrtc/trunk/webrtc/voice_engine/voice_engine.gyp
20620
@@ -0,0 +1,146 @@
20621
+# Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
20622
+#
20623
+# Use of this source code is governed by a BSD-style license
20624
+# that can be found in the LICENSE file in the root of the source
20625
+# tree. An additional intellectual property rights grant can be found
20626
+# in the file PATENTS.  All contributing project authors may
20627
+# be found in the AUTHORS file in the root of the source tree.
20628
+
20629
+{
20630
+  'includes': [
20631
+    '../build/common.gypi',
20632
+  ],
20633
+  'targets': [
20634
+    {
20635
+      'target_name': 'audio_coder',
20636
+      'type': 'static_library',
20637
+      'dependencies': [
20638
+        '<(webrtc_root)/common.gyp:webrtc_common',
20639
+      ],
20640
+      'sources': [
20641
+        'coder.cc',
20642
+        'coder.h',
20643
+      ]
20644
+    },
20645
+    {
20646
+      'target_name': 'file_player',
20647
+      'type': 'static_library',
20648
+      'dependencies': [
20649
+        '<(webrtc_root)/common.gyp:webrtc_common',
20650
+      ],
20651
+      'sources': [
20652
+        'file_player.cc',
20653
+        'file_player.h',
20654
+      ]
20655
+    },
20656
+    {
20657
+      'target_name': 'file_recorder',
20658
+      'type': 'static_library',
20659
+      'dependencies': [
20660
+        '<(webrtc_root)/common.gyp:webrtc_common',
20661
+      ],
20662
+      'sources': [
20663
+        'file_recorder.cc',
20664
+        'file_recorder.h',
20665
+      ]
20666
+    },
20667
+    {
20668
+      'target_name': 'voice_engine',
20669
+      'type': 'static_library',
20670
+      'dependencies': [
20671
+        '<(webrtc_root)/api/api.gyp:call_api',
20672
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
20673
+        '<(webrtc_root)/common.gyp:webrtc_common',
20674
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
20675
+        '<(webrtc_root)/modules/modules.gyp:audio_coding_module',
20676
+        '<(webrtc_root)/modules/modules.gyp:audio_conference_mixer',
20677
+        '<(webrtc_root)/modules/modules.gyp:audio_device',
20678
+        '<(webrtc_root)/modules/modules.gyp:audio_processing',
20679
+        '<(webrtc_root)/modules/modules.gyp:bitrate_controller',
20680
+        '<(webrtc_root)/modules/modules.gyp:media_file',
20681
+        '<(webrtc_root)/modules/modules.gyp:paced_sender',
20682
+        '<(webrtc_root)/modules/modules.gyp:rtp_rtcp',
20683
+        '<(webrtc_root)/modules/modules.gyp:webrtc_utility',
20684
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
20685
+        '<(webrtc_root)/webrtc.gyp:rtc_event_log_api',
20686
+        'audio_coder',
20687
+        'file_player',
20688
+        'file_recorder',
20689
+        'level_indicator',
20690
+      ],
20691
+      'export_dependent_settings': [
20692
+        '<(webrtc_root)/modules/modules.gyp:audio_coding_module',
20693
+      ],
20694
+      'sources': [
20695
+        'include/voe_audio_processing.h',
20696
+        'include/voe_base.h',
20697
+        'include/voe_codec.h',
20698
+        'include/voe_errors.h',
20699
+        'include/voe_external_media.h',
20700
+        'include/voe_file.h',
20701
+        'include/voe_hardware.h',
20702
+        'include/voe_neteq_stats.h',
20703
+        'include/voe_network.h',
20704
+        'include/voe_rtp_rtcp.h',
20705
+        'include/voe_video_sync.h',
20706
+        'include/voe_volume_control.h',
20707
+        'channel.cc',
20708
+        'channel.h',
20709
+        'channel_manager.cc',
20710
+        'channel_manager.h',
20711
+        'channel_proxy.cc',
20712
+        'channel_proxy.h',
20713
+        'monitor_module.cc',
20714
+        'monitor_module.h',
20715
+        'output_mixer.cc',
20716
+        'output_mixer.h',
20717
+        'shared_data.cc',
20718
+        'shared_data.h',
20719
+        'statistics.cc',
20720
+        'statistics.h',
20721
+        'transmit_mixer.cc',
20722
+        'transmit_mixer.h',
20723
+        'utility.cc',
20724
+        'utility.h',
20725
+        'voe_audio_processing_impl.cc',
20726
+        'voe_audio_processing_impl.h',
20727
+        'voe_base_impl.cc',
20728
+        'voe_base_impl.h',
20729
+        'voe_codec_impl.cc',
20730
+        'voe_codec_impl.h',
20731
+        'voe_external_media_impl.cc',
20732
+        'voe_external_media_impl.h',
20733
+        'voe_file_impl.cc',
20734
+        'voe_file_impl.h',
20735
+        'voe_hardware_impl.cc',
20736
+        'voe_hardware_impl.h',
20737
+        'voe_neteq_stats_impl.cc',
20738
+        'voe_neteq_stats_impl.h',
20739
+        'voe_network_impl.cc',
20740
+        'voe_network_impl.h',
20741
+        'voe_rtp_rtcp_impl.cc',
20742
+        'voe_rtp_rtcp_impl.h',
20743
+        'voe_video_sync_impl.cc',
20744
+        'voe_video_sync_impl.h',
20745
+        'voe_volume_control_impl.cc',
20746
+        'voe_volume_control_impl.h',
20747
+        'voice_engine_defines.h',
20748
+        'voice_engine_impl.cc',
20749
+        'voice_engine_impl.h',
20750
+      ],
20751
+    },
20752
+    {
20753
+      'target_name': 'level_indicator',
20754
+      'type': 'static_library',
20755
+      'dependencies': [
20756
+        '<(webrtc_root)/base/base.gyp:rtc_base_approved',
20757
+        '<(webrtc_root)/common.gyp:webrtc_common',
20758
+        '<(webrtc_root)/common_audio/common_audio.gyp:common_audio',
20759
+      ],
20760
+      'sources': [
20761
+        'level_indicator.cc',
20762
+        'level_indicator.h',
20763
+      ]
20764
+    },
20765
+  ],
20766
+}
20767
diff --git media/webrtc/trunk/webrtc/webrtc.gyp media/webrtc/trunk/webrtc/webrtc.gyp
20768
new file mode 100644
20769
index 000000000000..cefd8e5a5333
20770
--- /dev/null
20771
+++ media/webrtc/trunk/webrtc/webrtc.gyp
20772
@@ -0,0 +1,129 @@
20773
+# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
20774
+#
20775
+# Use of this source code is governed by a BSD-style license
20776
+# that can be found in the LICENSE file in the root of the source
20777
+# tree. An additional intellectual property rights grant can be found
20778
+# in the file PATENTS.  All contributing project authors may
20779
+# be found in the AUTHORS file in the root of the source tree.
20780
+{
20781
+  'includes': [
20782
+    'build/common.gypi',
20783
+    'audio/webrtc_audio.gypi',
20784
+    'call/webrtc_call.gypi',
20785
+    'video/webrtc_video.gypi',
20786
+  ],
20787
+  'targets': [
20788
+    {
20789
+      'target_name': 'webrtc_lib',
20790
+      'type': 'static_library',
20791
+      'sources': [
20792
+        'call.h',
20793
+        'config.h',
20794
+        'video_receive_stream.h',
20795
+        'video_send_stream.h',
20796
+
20797
+        '<@(webrtc_audio_sources)',
20798
+        '<@(webrtc_call_sources)',
20799
+        '<@(webrtc_video_sources)',
20800
+      ],
20801
+      'dependencies': [
20802
+        'common.gyp:*',
20803
+        '<@(webrtc_audio_dependencies)',
20804
+        '<@(webrtc_call_dependencies)',
20805
+        '<@(webrtc_video_dependencies)',
20806
+        'rtc_event_log_impl',
20807
+        '<(webrtc_root)/modules/modules.gyp:audio_mixer',
20808
+      ],
20809
+      'conditions': [
20810
+        # TODO(andresp): Chromium should link directly with this and no if
20811
+        # conditions should be needed on webrtc build files.
20812
+        ['build_with_chromium==1', {
20813
+          'dependencies': [
20814
+            '<(webrtc_root)/modules/modules.gyp:video_capture',
20815
+          ],
20816
+        }],
20817
+      ],
20818
+    },
20819
+    {
20820
+      'target_name': 'rtc_event_log_api',
20821
+      'type': 'static_library',
20822
+      'sources': [
20823
+        'logging/rtc_event_log/rtc_event_log.h',
20824
+      ],
20825
+    },
20826
+    {
20827
+      'target_name': 'rtc_event_log_impl',
20828
+      'type': 'static_library',
20829
+      'sources': [
20830
+        'logging/rtc_event_log/ringbuffer.h',
20831
+        'logging/rtc_event_log/rtc_event_log.cc',
20832
+        'logging/rtc_event_log/rtc_event_log_helper_thread.cc',
20833
+        'logging/rtc_event_log/rtc_event_log_helper_thread.h',
20834
+      ],
20835
+      'conditions': [
20836
+        # If enable_protobuf is defined, we want to compile the protobuf
20837
+        # and add rtc_event_log.pb.h and rtc_event_log.pb.cc to the sources.
20838
+        ['enable_protobuf==1', {
20839
+          'dependencies': [
20840
+            'rtc_event_log_api',
20841
+            'rtc_event_log_proto',
20842
+          ],
20843
+          'defines': [
20844
+            'ENABLE_RTC_EVENT_LOG',
20845
+          ],
20846
+        }],
20847
+      ],
20848
+    },
20849
+  ],  # targets
20850
+  'conditions': [
20851
+    ['include_tests==1', {
20852
+      'includes': [
20853
+        'webrtc_tests.gypi',
20854
+      ],
20855
+    }],
20856
+    ['enable_protobuf==1', {
20857
+      'targets': [
20858
+        {
20859
+          # This target should only be built if enable_protobuf is defined
20860
+          'target_name': 'rtc_event_log_proto',
20861
+          'type': 'static_library',
20862
+          'sources': ['logging/rtc_event_log/rtc_event_log.proto',],
20863
+          'variables': {
20864
+            'proto_in_dir': 'logging/rtc_event_log',
20865
+            'proto_out_dir': 'webrtc/logging/rtc_event_log',
20866
+          },
20867
+          'includes': ['build/protoc.gypi'],
20868
+        },
20869
+        {
20870
+          'target_name': 'rtc_event_log_parser',
20871
+          'type': 'static_library',
20872
+          'sources': [
20873
+            'logging/rtc_event_log/rtc_event_log_parser.cc',
20874
+            'logging/rtc_event_log/rtc_event_log_parser.h',
20875
+          ],
20876
+          'dependencies': [
20877
+            'rtc_event_log_proto',
20878
+          ],
20879
+          'export_dependent_settings': [
20880
+            'rtc_event_log_proto',
20881
+          ],
20882
+        },
20883
+      ],
20884
+    }],
20885
+    ['include_tests==1 and enable_protobuf==1', {
20886
+      'targets': [
20887
+        {
20888
+          'target_name': 'rtc_event_log2rtp_dump',
20889
+          'type': 'executable',
20890
+          'sources': ['logging/rtc_event_log2rtp_dump.cc',],
20891
+          'dependencies': [
20892
+            '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
20893
+            'rtc_event_log_parser',
20894
+            'rtc_event_log_proto',
20895
+            'test/test.gyp:rtp_test_utils'
20896
+          ],
20897
+        },
20898
+      ],
20899
+    }],
20900
+  ],  # conditions
20901
+}
20902
diff --git media/webrtc/trunk/webrtc/webrtc_examples.gyp media/webrtc/trunk/webrtc/webrtc_examples.gyp
20903
new file mode 100755
20904
index 000000000000..6627c3134338
20905
--- /dev/null
20906
+++ media/webrtc/trunk/webrtc/webrtc_examples.gyp
20907
@@ -0,0 +1,471 @@
20908
+# Copyright (c) 2012 The WebRTC Project Authors. All rights reserved.
20909
+#
20910
+# Use of this source code is governed by a BSD-style license
20911
+# that can be found in the LICENSE file in the root of the source
20912
+# tree. An additional intellectual property rights grant can be found
20913
+# in the file PATENTS.  All contributing project authors may
20914
+# be found in the AUTHORS file in the root of the source tree.
20915
+{
20916
+  'conditions': [
20917
+    ['OS=="linux" or OS=="win"', {
20918
+      'targets': [
20919
+        {
20920
+         'target_name': 'relayserver',
20921
+         'type': 'executable',
20922
+         'dependencies': [
20923
+           '<(webrtc_root)/base/base.gyp:rtc_base_approved',
20924
+           '<(webrtc_root)/pc/pc.gyp:rtc_pc',
20925
+         ],
20926
+         'sources': [
20927
+           'examples/relayserver/relayserver_main.cc',
20928
+         ],
20929
+       },  # target relayserver
20930
+       {
20931
+         'target_name': 'stunserver',
20932
+         'type': 'executable',
20933
+         'dependencies': [
20934
+           '<(webrtc_root)/base/base.gyp:rtc_base_approved',
20935
+           '<(webrtc_root)/pc/pc.gyp:rtc_pc',
20936
+         ],
20937
+         'sources': [
20938
+           'examples/stunserver/stunserver_main.cc',
20939
+         ],
20940
+       },  # target stunserver
20941
+       {
20942
+         'target_name': 'turnserver',
20943
+         'type': 'executable',
20944
+         'dependencies': [
20945
+           '<(webrtc_root)/base/base.gyp:rtc_base_approved',
20946
+           '<(webrtc_root)/pc/pc.gyp:rtc_pc',
20947
+         ],
20948
+         'sources': [
20949
+           'examples/turnserver/turnserver_main.cc',
20950
+         ],
20951
+       },  # target turnserver
20952
+       {
20953
+         'target_name': 'peerconnection_server',
20954
+         'type': 'executable',
20955
+         'sources': [
20956
+           'examples/peerconnection/server/data_socket.cc',
20957
+           'examples/peerconnection/server/data_socket.h',
20958
+           'examples/peerconnection/server/main.cc',
20959
+           'examples/peerconnection/server/peer_channel.cc',
20960
+           'examples/peerconnection/server/peer_channel.h',
20961
+           'examples/peerconnection/server/utils.cc',
20962
+           'examples/peerconnection/server/utils.h',
20963
+         ],
20964
+         'dependencies': [
20965
+           '<(webrtc_root)/base/base.gyp:rtc_base_approved',
20966
+           '<(webrtc_root)/common.gyp:webrtc_common',
20967
+           '<(webrtc_root)/tools/internal_tools.gyp:command_line_parser',
20968
+         ],
20969
+         # TODO(ronghuawu): crbug.com/167187 fix size_t to int truncations.
20970
+         'msvs_disabled_warnings': [ 4309, ],
20971
+       }, # target peerconnection_server
20972
+       {
20973
+          'target_name': 'peerconnection_client',
20974
+          'type': 'executable',
20975
+          'sources': [
20976
+            'examples/peerconnection/client/conductor.cc',
20977
+            'examples/peerconnection/client/conductor.h',
20978
+            'examples/peerconnection/client/defaults.cc',
20979
+            'examples/peerconnection/client/defaults.h',
20980
+            'examples/peerconnection/client/peer_connection_client.cc',
20981
+            'examples/peerconnection/client/peer_connection_client.h',
20982
+          ],
20983
+          'dependencies': [
20984
+            'api/api.gyp:libjingle_peerconnection',
20985
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:field_trial_default',
20986
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
20987
+          ],
20988
+          'conditions': [
20989
+            ['build_json==1', {
20990
+              'dependencies': [
20991
+                '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
20992
+              ],
20993
+            }],
20994
+            # TODO(ronghuawu): Move these files to a win/ directory then they
20995
+            # can be excluded automatically.
20996
+            ['OS=="win"', {
20997
+              'sources': [
20998
+                'examples/peerconnection/client/flagdefs.h',
20999
+                'examples/peerconnection/client/main.cc',
21000
+                'examples/peerconnection/client/main_wnd.cc',
21001
+                'examples/peerconnection/client/main_wnd.h',
21002
+              ],
21003
+              'msvs_settings': {
21004
+                'VCLinkerTool': {
21005
+                 'SubSystem': '2',  # Windows
21006
+                },
21007
+              },
21008
+            }],  # OS=="win"
21009
+            ['OS=="win" and clang==1', {
21010
+              'msvs_settings': {
21011
+                'VCCLCompilerTool': {
21012
+                  'AdditionalOptions': [
21013
+                    # Disable warnings failing when compiling with Clang on Windows.
21014
+                    # https://bugs.chromium.org/p/webrtc/issues/detail?id=5366
21015
+                    '-Wno-reorder',
21016
+                    '-Wno-unused-function',
21017
+                  ],
21018
+                },
21019
+              },
21020
+            }], # OS=="win" and clang==1
21021
+            ['OS=="linux"', {
21022
+              'sources': [
21023
+                'examples/peerconnection/client/linux/main.cc',
21024
+                'examples/peerconnection/client/linux/main_wnd.cc',
21025
+                'examples/peerconnection/client/linux/main_wnd.h',
21026
+              ],
21027
+              'cflags': [
21028
+                '<!@(pkg-config --cflags glib-2.0 gobject-2.0 gtk+-2.0)',
21029
+              ],
21030
+              'link_settings': {
21031
+                'ldflags': [
21032
+                  '<!@(pkg-config --libs-only-L --libs-only-other glib-2.0'
21033
+                      ' gobject-2.0 gthread-2.0 gtk+-2.0)',
21034
+                ],
21035
+                'libraries': [
21036
+                  '<!@(pkg-config --libs-only-l glib-2.0 gobject-2.0'
21037
+                      ' gthread-2.0 gtk+-2.0)',
21038
+                  '-lX11',
21039
+                  '-lXcomposite',
21040
+                  '-lXext',
21041
+                  '-lXrender',
21042
+                ],
21043
+              },
21044
+            }],  # OS=="linux"
21045
+            ['OS=="linux" and target_arch=="ia32"', {
21046
+              'cflags': [
21047
+                '-Wno-sentinel',
21048
+              ],
21049
+            }],  # OS=="linux" and target_arch=="ia32"
21050
+          ],  # conditions
21051
+        },  # target peerconnection_client
21052
+      ], # targets
21053
+    }],  # OS=="linux" or OS=="win"
21054
+
21055
+    ['OS=="ios" or (OS=="mac" and target_arch!="ia32")', {
21056
+      'targets': [
21057
+        {
21058
+          'target_name': 'apprtc_common',
21059
+          'type': 'static_library',
21060
+          'dependencies': [
21061
+            '<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_common_objc',
21062
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:field_trial_default',
21063
+            '<(webrtc_root)/system_wrappers/system_wrappers.gyp:metrics_default',
21064
+          ],
21065
+          'sources': [
21066
+            'examples/objc/AppRTCMobile/common/ARDUtilities.h',
21067
+            'examples/objc/AppRTCMobile/common/ARDUtilities.m',
21068
+          ],
21069
+          'include_dirs': [
21070
+            'examples/objc/AppRTCMobile/common',
21071
+          ],
21072
+          'direct_dependent_settings': {
21073
+            'include_dirs': [
21074
+              'examples/objc/AppRTCMobile/common',
21075
+            ],
21076
+          },
21077
+          'conditions': [
21078
+            ['OS=="ios"', {
21079
+              'xcode_settings': {
21080
+                'WARNING_CFLAGS':  [
21081
+                  # Suppress compiler warnings about deprecated that triggered
21082
+                  # when moving from ios_deployment_target 7.0 to 9.0.
21083
+                  # See webrtc:5549 for more details.
21084
+                  '-Wno-deprecated-declarations',
21085
+                ],
21086
+              },
21087
+            }],
21088
+            ['OS=="mac"', {
21089
+              'xcode_settings': {
21090
+                'MACOSX_DEPLOYMENT_TARGET' : '10.8',
21091
+              },
21092
+            }],
21093
+          ],
21094
+          'xcode_settings': {
21095
+            'CLANG_ENABLE_OBJC_ARC': 'YES',
21096
+          },
21097
+          'link_settings': {
21098
+            'xcode_settings': {
21099
+              'OTHER_LDFLAGS': [
21100
+                '-framework QuartzCore',
21101
+              ],
21102
+            },
21103
+          },
21104
+        },
21105
+        {
21106
+          'target_name': 'apprtc_signaling',
21107
+          'type': 'static_library',
21108
+          'dependencies': [
21109
+            '<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_peerconnection_objc',
21110
+            'apprtc_common',
21111
+            'socketrocket',
21112
+          ],
21113
+          'sources': [
21114
+            'examples/objc/AppRTCMobile/ARDAppClient.h',
21115
+            'examples/objc/AppRTCMobile/ARDAppClient.m',
21116
+            'examples/objc/AppRTCMobile/ARDAppClient+Internal.h',
21117
+            'examples/objc/AppRTCMobile/ARDAppEngineClient.h',
21118
+            'examples/objc/AppRTCMobile/ARDAppEngineClient.m',
21119
+            'examples/objc/AppRTCMobile/ARDBitrateTracker.h',
21120
+            'examples/objc/AppRTCMobile/ARDBitrateTracker.m',
21121
+            'examples/objc/AppRTCMobile/ARDCEODTURNClient.h',
21122
+            'examples/objc/AppRTCMobile/ARDCEODTURNClient.m',
21123
+            'examples/objc/AppRTCMobile/ARDJoinResponse.h',
21124
+            'examples/objc/AppRTCMobile/ARDJoinResponse.m',
21125
+            'examples/objc/AppRTCMobile/ARDJoinResponse+Internal.h',
21126
+            'examples/objc/AppRTCMobile/ARDMessageResponse.h',
21127
+            'examples/objc/AppRTCMobile/ARDMessageResponse.m',
21128
+            'examples/objc/AppRTCMobile/ARDMessageResponse+Internal.h',
21129
+            'examples/objc/AppRTCMobile/ARDRoomServerClient.h',
21130
+            'examples/objc/AppRTCMobile/ARDSDPUtils.h',
21131
+            'examples/objc/AppRTCMobile/ARDSDPUtils.m',
21132
+            'examples/objc/AppRTCMobile/ARDSignalingChannel.h',
21133
+            'examples/objc/AppRTCMobile/ARDSignalingMessage.h',
21134
+            'examples/objc/AppRTCMobile/ARDSignalingMessage.m',
21135
+            'examples/objc/AppRTCMobile/ARDStatsBuilder.h',
21136
+            'examples/objc/AppRTCMobile/ARDStatsBuilder.m',
21137
+            'examples/objc/AppRTCMobile/ARDTURNClient.h',
21138
+            'examples/objc/AppRTCMobile/ARDWebSocketChannel.h',
21139
+            'examples/objc/AppRTCMobile/ARDWebSocketChannel.m',
21140
+            'examples/objc/AppRTCMobile/RTCIceCandidate+JSON.h',
21141
+            'examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m',
21142
+            'examples/objc/AppRTCMobile/RTCIceServer+JSON.h',
21143
+            'examples/objc/AppRTCMobile/RTCIceServer+JSON.m',
21144
+            'examples/objc/AppRTCMobile/RTCMediaConstraints+JSON.h',
21145
+            'examples/objc/AppRTCMobile/RTCMediaConstraints+JSON.m',
21146
+            'examples/objc/AppRTCMobile/RTCSessionDescription+JSON.h',
21147
+            'examples/objc/AppRTCMobile/RTCSessionDescription+JSON.m',
21148
+          ],
21149
+          'include_dirs': [
21150
+            'examples/objc/AppRTCMobile',
21151
+          ],
21152
+          'direct_dependent_settings': {
21153
+            'include_dirs': [
21154
+              'examples/objc/AppRTCMobile',
21155
+            ],
21156
+          },
21157
+          'export_dependent_settings': [
21158
+            '<(webrtc_root)/sdk/sdk.gyp:rtc_sdk_peerconnection_objc',
21159
+          ],
21160
+          'conditions': [
21161
+            ['OS=="ios"', {
21162
+              'xcode_settings': {
21163
+                'WARNING_CFLAGS':  [
21164
+                  # Suppress compiler warnings about deprecated that triggered
21165
+                  # when moving from ios_deployment_target 7.0 to 9.0.
21166
+                  # See webrtc:5549 for more details.
21167
+                  '-Wno-deprecated-declarations',
21168
+                ],
21169
+              },
21170
+            }],
21171
+            ['OS=="mac"', {
21172
+              'xcode_settings': {
21173
+                'MACOSX_DEPLOYMENT_TARGET' : '10.8',
21174
+              },
21175
+            }],
21176
+          ],
21177
+          'xcode_settings': {
21178
+            'CLANG_ENABLE_OBJC_ARC': 'YES',
21179
+          },
21180
+        },
21181
+        {
21182
+          'target_name': 'AppRTCMobile',
21183
+          'type': 'executable',
21184
+          'product_name': 'AppRTCMobile',
21185
+          'mac_bundle': 1,
21186
+          'dependencies': [
21187
+            'apprtc_common',
21188
+            'apprtc_signaling',
21189
+          ],
21190
+          'conditions': [
21191
+            ['OS=="ios"', {
21192
+              'mac_bundle_resources': [
21193
+                'examples/objc/AppRTCMobile/ios/resources/Roboto-Regular.ttf',
21194
+                'examples/objc/AppRTCMobile/ios/resources/iPhone5@2x.png',
21195
+                'examples/objc/AppRTCMobile/ios/resources/iPhone6@2x.png',
21196
+                'examples/objc/AppRTCMobile/ios/resources/iPhone6p@3x.png',
21197
+                'examples/objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp.png',
21198
+                'examples/objc/AppRTCMobile/ios/resources/ic_call_end_black_24dp@2x.png',
21199
+                'examples/objc/AppRTCMobile/ios/resources/ic_clear_black_24dp.png',
21200
+                'examples/objc/AppRTCMobile/ios/resources/ic_clear_black_24dp@2x.png',
21201
+                'examples/objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp.png',
21202
+                'examples/objc/AppRTCMobile/ios/resources/ic_surround_sound_black_24dp@2x.png',
21203
+                'examples/objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp.png',
21204
+                'examples/objc/AppRTCMobile/ios/resources/ic_switch_video_black_24dp@2x.png',
21205
+                'examples/objc/AppRTCMobile/ios/resources/mozart.mp3',
21206
+                'examples/objc/Icon.png',
21207
+              ],
21208
+              'sources': [
21209
+                'examples/objc/AppRTCMobile/ios/ARDAppDelegate.h',
21210
+                'examples/objc/AppRTCMobile/ios/ARDAppDelegate.m',
21211
+                'examples/objc/AppRTCMobile/ios/ARDMainView.h',
21212
+                'examples/objc/AppRTCMobile/ios/ARDMainView.m',
21213
+                'examples/objc/AppRTCMobile/ios/ARDMainViewController.h',
21214
+                'examples/objc/AppRTCMobile/ios/ARDMainViewController.m',
21215
+                'examples/objc/AppRTCMobile/ios/ARDStatsView.h',
21216
+                'examples/objc/AppRTCMobile/ios/ARDStatsView.m',
21217
+                'examples/objc/AppRTCMobile/ios/ARDVideoCallView.h',
21218
+                'examples/objc/AppRTCMobile/ios/ARDVideoCallView.m',
21219
+                'examples/objc/AppRTCMobile/ios/ARDVideoCallViewController.h',
21220
+                'examples/objc/AppRTCMobile/ios/ARDVideoCallViewController.m',
21221
+                'examples/objc/AppRTCMobile/ios/AppRTCMobile-Prefix.pch',
21222
+                'examples/objc/AppRTCMobile/ios/UIImage+ARDUtilities.h',
21223
+                'examples/objc/AppRTCMobile/ios/UIImage+ARDUtilities.m',
21224
+                'examples/objc/AppRTCMobile/ios/main.m',
21225
+              ],
21226
+              'xcode_settings': {
21227
+                'INFOPLIST_FILE': 'examples/objc/AppRTCMobile/ios/Info.plist',
21228
+                'WARNING_CFLAGS':  [
21229
+                  # Suppress compiler warnings about deprecated that triggered
21230
+                  # when moving from ios_deployment_target 7.0 to 9.0.
21231
+                  # See webrtc:5549 for more details.
21232
+                  '-Wno-deprecated-declarations',
21233
+                ],
21234
+              },
21235
+            }],
21236
+            ['OS=="mac"', {
21237
+              'sources': [
21238
+                'examples/objc/AppRTCMobile/mac/APPRTCAppDelegate.h',
21239
+                'examples/objc/AppRTCMobile/mac/APPRTCAppDelegate.m',
21240
+                'examples/objc/AppRTCMobile/mac/APPRTCViewController.h',
21241
+                'examples/objc/AppRTCMobile/mac/APPRTCViewController.m',
21242
+                'examples/objc/AppRTCMobile/mac/main.m',
21243
+              ],
21244
+              'xcode_settings': {
21245
+                'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
21246
+                'INFOPLIST_FILE': 'examples/objc/AppRTCMobile/mac/Info.plist',
21247
+                'MACOSX_DEPLOYMENT_TARGET' : '10.8',
21248
+                'OTHER_LDFLAGS': [
21249
+                  '-framework AVFoundation',
21250
+                ],
21251
+              },
21252
+            }],
21253
+            ['target_arch=="ia32"', {
21254
+              'dependencies' : [
21255
+                '<(DEPTH)/testing/iossim/iossim.gyp:iossim#host',
21256
+              ],
21257
+            }],
21258
+          ],
21259
+          'xcode_settings': {
21260
+            'CLANG_ENABLE_OBJC_ARC': 'YES',
21261
+          },
21262
+        },  # target AppRTCMobile
21263
+        {
21264
+          # TODO(tkchin): move this into the real third party location and
21265
+          # have it mirrored on chrome infra.
21266
+          'target_name': 'socketrocket',
21267
+          'type': 'static_library',
21268
+          'sources': [
21269
+            'examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.h',
21270
+            'examples/objc/AppRTCMobile/third_party/SocketRocket/SRWebSocket.m',
21271
+          ],
21272
+          'conditions': [
21273
+            ['OS=="mac"', {
21274
+              'xcode_settings': {
21275
+                # SocketRocket autosynthesizes some properties. Disable the
21276
+                # warning so we can compile successfully.
21277
+                'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'NO',
21278
+                'MACOSX_DEPLOYMENT_TARGET' : '10.8',
21279
+                # SRWebSocket.m uses code with partial availability.
21280
+                # https://code.google.com/p/webrtc/issues/detail?id=4695
21281
+                'WARNING_CFLAGS!': [
21282
+                  '-Wpartial-availability',
21283
+                ],
21284
+              },
21285
+            }],
21286
+          ],
21287
+          'direct_dependent_settings': {
21288
+            'include_dirs': [
21289
+              'examples/objc/AppRTCMobile/third_party/SocketRocket',
21290
+            ],
21291
+          },
21292
+          'xcode_settings': {
21293
+            'CLANG_ENABLE_OBJC_ARC': 'YES',
21294
+            'WARNING_CFLAGS': [
21295
+              '-Wno-deprecated-declarations',
21296
+              '-Wno-nonnull',
21297
+              # Hide the warning for SecRandomCopyBytes(), till we update
21298
+              # to upstream.
21299
+              # https://bugs.chromium.org/p/webrtc/issues/detail?id=6396
21300
+              '-Wno-unused-result',
21301
+            ],
21302
+          },
21303
+          'link_settings': {
21304
+            'xcode_settings': {
21305
+              'OTHER_LDFLAGS': [
21306
+                '-framework CFNetwork',
21307
+                '-licucore',
21308
+              ],
21309
+            },
21310
+          }
21311
+        },  # target socketrocket
21312
+      ],  # targets
21313
+    }],  # OS=="ios" or (OS=="mac" and target_arch!="ia32")
21314
+
21315
+    ['OS=="android"', {
21316
+      'targets': [
21317
+        {
21318
+          'target_name': 'AppRTCMobile',
21319
+          'type': 'none',
21320
+          'dependencies': [
21321
+            'api/api_java.gyp:libjingle_peerconnection_java',
21322
+          ],
21323
+          'variables': {
21324
+            'apk_name': 'AppRTCMobile',
21325
+            'java_in_dir': 'examples/androidapp',
21326
+            'has_java_resources': 1,
21327
+            'resource_dir': 'examples/androidapp/res',
21328
+            'R_package': 'org.appspot.apprtc',
21329
+            'R_package_relpath': 'org/appspot/apprtc',
21330
+            'input_jars_paths': [
21331
+              'examples/androidapp/third_party/autobanh/lib/autobanh.jar',
21332
+             ],
21333
+            'library_dexed_jars_paths': [
21334
+              'examples/androidapp/third_party/autobanh/lib/autobanh.jar',
21335
+             ],
21336
+            'native_lib_target': 'libjingle_peerconnection_so',
21337
+            'add_to_dependents_classpaths':1,
21338
+          },
21339
+          'includes': [ '../build/java_apk.gypi' ],
21340
+        },  # target AppRTCMobile
21341
+
21342
+        {
21343
+          # AppRTCMobile creates a .jar as a side effect. Any java targets
21344
+          # that need that .jar in their classpath should depend on this target,
21345
+          # AppRTCMobile_apk. Dependents of AppRTCMobile_apk receive its
21346
+          # jar path in the variable 'apk_output_jar_path'.
21347
+          # This target should only be used by targets which instrument
21348
+          # AppRTCMobile_apk.
21349
+          'target_name': 'AppRTCMobile_apk',
21350
+          'type': 'none',
21351
+          'dependencies': [
21352
+             'AppRTCMobile',
21353
+           ],
21354
+           'includes': [ '../build/apk_fake_jar.gypi' ],
21355
+        },  # target AppRTCMobile_apk
21356
+
21357
+        {
21358
+          'target_name': 'AppRTCMobileTest',
21359
+          'type': 'none',
21360
+          'dependencies': [
21361
+            'AppRTCMobile_apk',
21362
+           ],
21363
+          'variables': {
21364
+            'apk_name': 'AppRTCMobileTest',
21365
+            'java_in_dir': 'examples/androidtests',
21366
+            'is_test_apk': 1,
21367
+            'test_type': 'instrumentation',
21368
+            'test_runner_path': '<(DEPTH)/webrtc/build/android/test_runner.py',
21369
+          },
21370
+          'includes': [
21371
+            '../build/java_apk.gypi',
21372
+            '../build/android/test_runner.gypi',
21373
+          ],
21374
+        },
21375
+      ],  # targets
21376
+    }],  # OS=="android"
21377
+  ],
21378
+}
21379
diff --git media/webrtc/trunk/webrtc/webrtc_tests.gypi media/webrtc/trunk/webrtc/webrtc_tests.gypi
21380
new file mode 100644
21381
index 000000000000..354476b883e5
21382
--- /dev/null
21383
+++ media/webrtc/trunk/webrtc/webrtc_tests.gypi
21384
@@ -0,0 +1,84 @@
21385
+# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
21386
+#
21387
+# Use of this source code is governed by a BSD-style license
21388
+# that can be found in the LICENSE file in the root of the source
21389
+# tree. An additional intellectual property rights grant can be found
21390
+# in the file PATENTS.  All contributing project authors may
21391
+# be found in the AUTHORS file in the root of the source tree.
21392
+{
21393
+  'targets': [
21394
+    {
21395
+      'target_name': 'video_quality_test',
21396
+      'type': 'static_library',
21397
+      'sources': [
21398
+        'video/video_quality_test.cc',
21399
+        'video/video_quality_test.h',
21400
+      ],
21401
+      'dependencies': [
21402
+        '<(DEPTH)/testing/gtest.gyp:gtest',
21403
+        '<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl',
21404
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
21405
+        'webrtc',
21406
+      ],
21407
+      'conditions': [
21408
+        ['OS=="android"', {
21409
+          'dependencies!': [
21410
+            '<(webrtc_root)/modules/modules.gyp:video_capture_module_internal_impl',
21411
+          ],
21412
+        }],
21413
+      ],
21414
+    },
21415
+    {
21416
+      'target_name': 'screenshare_loopback',
21417
+      'type': 'executable',
21418
+      'sources': [
21419
+        'test/mac/run_test.mm',
21420
+        'test/run_test.cc',
21421
+        'test/run_test.h',
21422
+        'video/screenshare_loopback.cc',
21423
+      ],
21424
+      'conditions': [
21425
+        ['OS=="mac"', {
21426
+          'sources!': [
21427
+            'test/run_test.cc',
21428
+          ],
21429
+        }],
21430
+      ],
21431
+      'dependencies': [
21432
+        'video_quality_test',
21433
+        '<(DEPTH)/testing/gtest.gyp:gtest',
21434
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
21435
+        'test/test.gyp:test_common',
21436
+        'test/test.gyp:test_main',
21437
+        'test/test.gyp:test_renderer',
21438
+        'webrtc',
21439
+      ],
21440
+    },
21441
+    {
21442
+      'target_name': 'video_replay',
21443
+      'type': 'executable',
21444
+      'sources': [
21445
+        'test/mac/run_test.mm',
21446
+        'test/run_test.cc',
21447
+        'test/run_test.h',
21448
+        'video/replay.cc',
21449
+      ],
21450
+      'conditions': [
21451
+        ['OS=="mac"', {
21452
+          'sources!': [
21453
+            'test/run_test.cc',
21454
+          ],
21455
+        }],
21456
+      ],
21457
+      'dependencies': [
21458
+        '<(DEPTH)/testing/gtest.gyp:gtest',
21459
+        '<(DEPTH)/third_party/gflags/gflags.gyp:gflags',
21460
+        'test/test.gyp:test_common',
21461
+        'test/test.gyp:test_renderer',
21462
+        '<(webrtc_root)/modules/modules.gyp:video_capture',
21463
+        '<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers_default',
21464
+        'webrtc',
21465
+      ],
21466
+    },
21467
+  ],
21468
+}
21469
diff --git python/mozbuild/mozbuild/gn_processor.py python/mozbuild/mozbuild/gn_processor.py
21470
index e0c84a755e85..355f0c0fa000 100644
21471
--- python/mozbuild/mozbuild/gn_processor.py
21472
+++ python/mozbuild/mozbuild/gn_processor.py
21473
@@ -67,7 +67,7 @@ class MozbuildWriter(object):
21474
         for k in sorted(context_attrs.keys()):
21475
             v = context_attrs[k]
21476
             if isinstance(v, (list, set)):
21477
-                self.write_mozbuild_list(k, v)
21478
+                self.write_mozbuild_list(k, alphabetical_sorted(v))
21479
             elif isinstance(v, dict):
21480
                 self.write_mozbuild_dict(k, v)
21481
             else:
21482
@@ -78,7 +78,7 @@ class MozbuildWriter(object):
21483
             self.write('\n')
21484
             self.write(self.indent + key)
21485
             self.write(' += [\n    ' + self.indent)
21486
-            self.write((',\n    ' + self.indent).join(alphabetical_sorted(self.mb_serialize(v) for v in value)))
21487
+            self.write((',\n    ' + self.indent).join(sorted(self.mb_serialize(v) for v in value)))
21488
             self.write('\n')
21489
             self.write_ln(']')
21490
 
(-)b/www/firefox/files/patch-bug1021761 (-3 / +3 lines)
Lines 1198-1206 index b139b8f497fd..d1f8a223c6d8 100755 Link Here
1198
 cp $1/src/cubeb_mixer.h src
1198
 cp $1/src/cubeb_mixer.h src
1199
 cp $1/src/cubeb_opensl.c src
1199
 cp $1/src/cubeb_opensl.c src
1200
+cp $1/src/cubeb_oss.c src
1200
+cp $1/src/cubeb_oss.c src
1201
 cp $1/src/cubeb_osx_run_loop.h src
1201
 cp $1/src/cubeb-jni.cpp src
1202
 cp $1/src/cubeb_panner.cpp src
1202
 cp $1/src/cubeb-jni.h src
1203
 cp $1/src/cubeb_panner.h src
1203
 cp $1/src/android/cubeb-output-latency.h src/android
1204
diff --git toolkit/library/moz.build toolkit/library/moz.build
1204
diff --git toolkit/library/moz.build toolkit/library/moz.build
1205
index a61c689c83c3..7764df6f8a6b 100644
1205
index a61c689c83c3..7764df6f8a6b 100644
1206
--- toolkit/library/moz.build
1206
--- toolkit/library/moz.build
(-)b/www/firefox/files/patch-bug1418162 (+58 lines)
Added Link Here
1
commit b2ebb8d82be2
2
Author: Tom Ritter <tom@mozilla.com>
3
Date:   Mon Feb 19 09:43:27 2018 -0600
4
5
    Bug 1418162 Use a build constant to determine update channel, and update ESR equation for 60 r?gijs,Build
6
    
7
    Previously we used Services.appinfo.defaultUpdateChannel to determine if we were on ESR
8
    and if so, we would assert to make sure the ESR equation hadn't changed. But that method
9
    is a footgun.  We could use UpdateUtils.getUpdateChannel, but for our purposes here, the
10
    compile-time constant will work just as well.
11
    
12
    If it's set correctly, for Mozilla, we will perform our assert check. If it's not set to
13
    esr (e.g. for Tor), they'll skip the assert. They probably want to control their user agent
14
    themselves anyway.
15
    
16
    MozReview-Commit-ID: DLnWSEpCVJ6
17
---
18
 .../resistfingerprinting/nsRFPService.cpp           | 21 +++++++--------------
19
 1 file changed, 7 insertions(+), 14 deletions(-)
20
21
diff --git toolkit/components/resistfingerprinting/nsRFPService.cpp toolkit/components/resistfingerprinting/nsRFPService.cpp
22
index aeb3cb6b3539..1fd6a6e8fe8d 100644
23
--- toolkit/components/resistfingerprinting/nsRFPService.cpp
24
+++ toolkit/components/resistfingerprinting/nsRFPService.cpp
25
@@ -606,26 +606,19 @@ nsRFPService::GetSpoofedUserAgent(nsACString &userAgent)
26
   uint32_t firefoxVersion = appVersion.ToInteger(&rv);
27
   NS_ENSURE_SUCCESS(rv, rv);
28
 
29
-  // Starting from Firefox 10, Firefox ESR was released once every seven
30
-  // Firefox releases, e.g. Firefox 10, 17, 24, 31, and so on.
31
-  // We infer the last and closest ESR version based on this rule.
32
-  nsCOMPtr<nsIXULRuntime> runtime =
33
-    do_GetService("@mozilla.org/xre/runtime;1", &rv);
34
-  NS_ENSURE_SUCCESS(rv, rv);
35
-
36
-  nsAutoCString updateChannel;
37
-  rv = runtime->GetDefaultUpdateChannel(updateChannel);
38
-  NS_ENSURE_SUCCESS(rv, rv);
39
-
40
   // If we are running in Firefox ESR, determine whether the formula of ESR
41
   // version has changed.  Once changed, we must update the formula in this
42
   // function.
43
-  if (updateChannel.EqualsLiteral("esr")) {
44
-    MOZ_ASSERT(((firefoxVersion % 7) == 3),
45
+  if (!strcmp(NS_STRINGIFY(MOZ_UPDATE_CHANNEL), "esr")) {
46
+    MOZ_ASSERT(((firefoxVersion % 7) == 4),
47
       "Please udpate ESR version formula in nsRFPService.cpp");
48
   }
49
 
50
-  uint32_t spoofedVersion = firefoxVersion - ((firefoxVersion - 3) % 7);
51
+  // Starting from Firefox 10, Firefox ESR was released once every seven
52
+  // Firefox releases, e.g. Firefox 10, 17, 24, 31, and so on.
53
+  // Except we used 60 as an ESR instead of 59.
54
+  // We infer the last and closest ESR version based on this rule.
55
+  uint32_t spoofedVersion = firefoxVersion - ((firefoxVersion - 4) % 7);
56
   userAgent.Assign(nsPrintfCString(
57
     "Mozilla/5.0 (%s; rv:%d.0) Gecko/%s Firefox/%d.0",
58
     SPOOFED_UA_OS, spoofedVersion, LEGACY_BUILD_ID, spoofedVersion));
(-)a/www/firefox/files/patch-bug1433747 (-24 lines)
Removed Link Here
1
Apply simd@cf87865a998a to unbreak -C target-cpu with Rust >= 1.24
2
3
diff --git third_party/rust/simd/.cargo-checksum.json third_party/rust/simd/.cargo-checksum.json
4
index 65f31b0560e6..f16d0dd4fd61 100644
5
--- third_party/rust/simd/.cargo-checksum.json
6
+++ third_party/rust/simd/.cargo-checksum.json
7
@@ -1 +1 @@
8
-{"files":{".travis.yml":"e2c720c3633b7671efce49147c62b12bcbf630d7c5d6fc65cd97620bfa4ddcea","Cargo.toml":"608aad04f17a524ee21048fa2ce9f656ae344e0473dd0e331dc954f0f9677c63","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6d3a9431e65e69c73a8923e6517b889d17549b23db406b9ec027710d16af701f","README.md":"249294a9a5f63c64c0f7fe4a607060f43f3507dce2378067aa59d25fb3ae681d","benches/mandelbrot.rs":"051b5199e66bca6cf7774e9024915fd4e1349ab39726a10a14e06b60d65d87a4","benches/matrix.rs":"048a21dacdb62365e0105d00d2c8cd6bd2396ac81134f2bff7eb4f7d095fb735","examples/axpy.rs":"4307626045d64ec08361c97c9c72c5dc8d361bdc88f64453b97ac0212041a1b2","examples/convert.rs":"8e658fde050f8a0d8b84ad7570446b10fcf544afbd551b940ca340474f324840","examples/dot-product.rs":"6fe2e007c147af5353804173a593c5b9d57dbccec156e1da37e9e32537363f91","examples/fannkuch-redux-nosimd.rs":"7b2fbde35e8666929d14d67328471cb0483d038a5325232f8db148b30865312b","examples/fannkuch-redux.rs":"ea21fdbd2274488a62cc984acad6e0b65d52f24fb4ff63b7057a3a667e9c8aae","examples/mandelbrot.rs":"8b8fdca1edac50e5a33e0e0592bd41eb75114f31839ccd40d485c61a9a664380","examples/matrix-inverse.rs":"a378d20ef20c2119bb10a86de27c92fec2c2f77f374e6bfd36707c9825a5fe92","examples/nbody-nosimd.rs":"2c8e0a7feacd202fdd65eeceb6420d6e9f43340b81f20a8e532704a587a2796b","examples/nbody.rs":"a864311affab262024479d6348ff51af43d809e9ad332ec30ea4aacceaa2eae1","examples/ops.rs":"1316f915d0afcfa98fdc4077e965ccccf6b4b21c433cbe487ff0cdc60df3cd39","examples/spectral-norm-nosimd.rs":"ffc8512ecde779078ea467f38f423a0ea623c63da7078193f9dd370200773f79","examples/spectral-norm.rs":"edb09c9d477f83939098cfb77a27cc298bc7a0c8a8e29cece0cccae0d70d890e","src/aarch64/mod.rs":"83f52775364c98de0cecb7e1509530c18972e932469f5f1522aa24a735d0fa37","src/aarch64/neon.rs":"1fe769979e07d8e2bc3c78ce116e05d735860744efe097a894cc9421153257fb","src/arm/mod.rs":"dcdd90bc0b39abaf86a0c8946d442b16313563fbae1ff03248628275c74d8617","src/arm/neon.rs":"51cc509856200e80f8e4cc2c982586e6d1cef593ec4537e153dce0cfe31d3428","src/common.rs":"62f4e7e0fefb52ad190d0f2191bc435ac4deab3f2bc70dc427f2a7f9ccb7856e","src/lib.rs":"25f0b39c038fa85af858318135dfd87865be26c33bb4bd1438aec96a1e68d8b5","src/sixty_four.rs":"510a9e00189a61e4f0a5beb7052d5dee37fc8261f94a2af45ef10327e0f3b7df","src/v256.rs":"2e328e49034876d535e0627c7a62191da2b4fb156a657614bf531a5fc75b1385","src/x86/avx.rs":"c66140abefca634b48eae307c3ec8cf5a40f2279b10e246a7e2ac602a2a2bb28","src/x86/avx2.rs":"efe3006b13a13261a3dec3d37dc1d8cb53950f3803c420069231803374949937","src/x86/mod.rs":"0acc5a5e2672e2a0fddc11065663be8b8fa2da87320ea291fa86ff8c2f33edf5","src/x86/sse2.rs":"5ceda75a401958a135fc9d851b22075314cdeed69fd483b6a7be4f11373f40da","src/x86/sse3.rs":"9bd01a4f08069ca4f445952e744d651efe887e3835b18872e757375f0d053bd2","src/x86/sse4_1.rs":"9ceb80dd70a7e7dfeef508cb935e1a2637175bc87a3b090f5dea691ff6aa0516","src/x86/sse4_2.rs":"c59321aed8decdce4d0d8570cff46aed02e1a8265647ef7702e9b180fc581254","src/x86/ssse3.rs":"2290f0269bae316b8e0491495645ee38a9bd73525c8572759c1328341c3bdb4c"},"package":"7a94d14a2ae1f1f110937de5fb69e494372560181c7e1739a097fcc2cee37ba0"}
9
\ No newline at end of file
10
+{"files":{".travis.yml":"e2c720c3633b7671efce49147c62b12bcbf630d7c5d6fc65cd97620bfa4ddcea","Cargo.toml":"608aad04f17a524ee21048fa2ce9f656ae344e0473dd0e331dc954f0f9677c63","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6d3a9431e65e69c73a8923e6517b889d17549b23db406b9ec027710d16af701f","README.md":"249294a9a5f63c64c0f7fe4a607060f43f3507dce2378067aa59d25fb3ae681d","benches/mandelbrot.rs":"051b5199e66bca6cf7774e9024915fd4e1349ab39726a10a14e06b60d65d87a4","benches/matrix.rs":"048a21dacdb62365e0105d00d2c8cd6bd2396ac81134f2bff7eb4f7d095fb735","examples/axpy.rs":"4307626045d64ec08361c97c9c72c5dc8d361bdc88f64453b97ac0212041a1b2","examples/convert.rs":"8e658fde050f8a0d8b84ad7570446b10fcf544afbd551b940ca340474f324840","examples/dot-product.rs":"6fe2e007c147af5353804173a593c5b9d57dbccec156e1da37e9e32537363f91","examples/fannkuch-redux-nosimd.rs":"7b2fbde35e8666929d14d67328471cb0483d038a5325232f8db148b30865312b","examples/fannkuch-redux.rs":"ea21fdbd2274488a62cc984acad6e0b65d52f24fb4ff63b7057a3a667e9c8aae","examples/mandelbrot.rs":"8b8fdca1edac50e5a33e0e0592bd41eb75114f31839ccd40d485c61a9a664380","examples/matrix-inverse.rs":"a378d20ef20c2119bb10a86de27c92fec2c2f77f374e6bfd36707c9825a5fe92","examples/nbody-nosimd.rs":"2c8e0a7feacd202fdd65eeceb6420d6e9f43340b81f20a8e532704a587a2796b","examples/nbody.rs":"a864311affab262024479d6348ff51af43d809e9ad332ec30ea4aacceaa2eae1","examples/ops.rs":"1316f915d0afcfa98fdc4077e965ccccf6b4b21c433cbe487ff0cdc60df3cd39","examples/spectral-norm-nosimd.rs":"ffc8512ecde779078ea467f38f423a0ea623c63da7078193f9dd370200773f79","examples/spectral-norm.rs":"edb09c9d477f83939098cfb77a27cc298bc7a0c8a8e29cece0cccae0d70d890e","src/aarch64/mod.rs":"83f52775364c98de0cecb7e1509530c18972e932469f5f1522aa24a735d0fa37","src/aarch64/neon.rs":"1fe769979e07d8e2bc3c78ce116e05d735860744efe097a894cc9421153257fb","src/arm/mod.rs":"dcdd90bc0b39abaf86a0c8946d442b16313563fbae1ff03248628275c74d8617","src/arm/neon.rs":"51cc509856200e80f8e4cc2c982586e6d1cef593ec4537e153dce0cfe31d3428","src/common.rs":"62f4e7e0fefb52ad190d0f2191bc435ac4deab3f2bc70dc427f2a7f9ccb7856e","src/lib.rs":"25f0b39c038fa85af858318135dfd87865be26c33bb4bd1438aec96a1e68d8b5","src/sixty_four.rs":"510a9e00189a61e4f0a5beb7052d5dee37fc8261f94a2af45ef10327e0f3b7df","src/v256.rs":"2e328e49034876d535e0627c7a62191da2b4fb156a657614bf531a5fc75b1385","src/x86/avx.rs":"c66140abefca634b48eae307c3ec8cf5a40f2279b10e246a7e2ac602a2a2bb28","src/x86/avx2.rs":"3bcb3f391ad5f16f0a6da0bc1301329beb478ad6265bd3b2c9c124fc2e6198e5","src/x86/mod.rs":"0acc5a5e2672e2a0fddc11065663be8b8fa2da87320ea291fa86ff8c2f33edf5","src/x86/sse2.rs":"5ceda75a401958a135fc9d851b22075314cdeed69fd483b6a7be4f11373f40da","src/x86/sse3.rs":"9bd01a4f08069ca4f445952e744d651efe887e3835b18872e757375f0d053bd2","src/x86/sse4_1.rs":"9ceb80dd70a7e7dfeef508cb935e1a2637175bc87a3b090f5dea691ff6aa0516","src/x86/sse4_2.rs":"c59321aed8decdce4d0d8570cff46aed02e1a8265647ef7702e9b180fc581254","src/x86/ssse3.rs":"2290f0269bae316b8e0491495645ee38a9bd73525c8572759c1328341c3bdb4c"},"package":"7a94d14a2ae1f1f110937de5fb69e494372560181c7e1739a097fcc2cee37ba0"}
11
\ No newline at end of file
12
diff --git third_party/rust/simd/src/x86/avx2.rs third_party/rust/simd/src/x86/avx2.rs
13
index fa92e3b60786..e86a33d3b5bb 100644
14
--- third_party/rust/simd/src/x86/avx2.rs
15
+++ third_party/rust/simd/src/x86/avx2.rs
16
@@ -42,7 +42,7 @@ extern "platform-intrinsic" {
17
     fn x86_mm256_packus_epi32(x: i32x8, y: i32x8) -> u16x16;
18
     fn x86_mm256_permutevar8x32_epi32(x: i32x8, y: i32x8) -> i32x8;
19
     fn x86_mm256_permutevar8x32_ps(x: f32x8, y: i32x8) -> f32x8;
20
-    fn x86_mm256_sad_epu8(x: u8x32, y: u8x32) -> u8x32;
21
+    fn x86_mm256_sad_epu8(x: u8x32, y: u8x32) -> u64x4;
22
     fn x86_mm256_shuffle_epi8(x: i8x32, y: i8x32) -> i8x32;
23
     fn x86_mm256_sign_epi8(x: i8x32, y: i8x32) -> i8x32;
24
     fn x86_mm256_sign_epi16(x: i16x16, y: i16x16) -> i16x16;
(-)b/www/firefox/files/patch-bug1442746 (+40 lines)
Added Link Here
1
commit 9761b190924d
2
Author: Landry Breuil <landry@openbsd.org>
3
Date:   Fri Mar 9 13:39:58 2018 +0000
4
5
    Bug 1442746 - use clock_gettime on all unices but osx, not only linux - fixes build on BSD. r=chutten
6
---
7
 toolkit/components/telemetry/Telemetry.cpp | 6 +++---
8
 1 file changed, 3 insertions(+), 3 deletions(-)
9
10
diff --git toolkit/components/telemetry/Telemetry.cpp toolkit/components/telemetry/Telemetry.cpp
11
index 98eba99fe53d..00a0334ea200 100644
12
--- toolkit/components/telemetry/Telemetry.cpp
13
+++ toolkit/components/telemetry/Telemetry.cpp
14
@@ -8,7 +8,7 @@
15
 
16
 #include <prio.h>
17
 #include <prproces.h>
18
-#ifdef XP_LINUX
19
+#if defined(XP_UNIX) && !defined(XP_DARWIN)
20
 #include <time.h>
21
 #else
22
 #include <chrono>
23
@@ -1674,7 +1674,7 @@ TelemetryImpl::MsSinceProcessStart(double* aResult)
24
 NS_IMETHODIMP
25
 TelemetryImpl::MsSystemNow(double* aResult)
26
 {
27
-#ifdef XP_LINUX
28
+#if defined(XP_UNIX) && !defined(XP_DARWIN)
29
   timespec ts;
30
   clock_gettime(CLOCK_REALTIME, &ts);
31
   *aResult = ts.tv_sec * 1000 + ts.tv_nsec / 1000000;
32
@@ -1682,7 +1682,7 @@ TelemetryImpl::MsSystemNow(double* aResult)
33
   using namespace std::chrono;
34
   milliseconds ms = duration_cast<milliseconds>(system_clock::now().time_since_epoch());
35
   *aResult = static_cast<double>(ms.count());
36
-#endif // XP_LINUX
37
+#endif // XP_UNIX && !XP_DARWIN
38
 
39
   return NS_OK;
40
 }
(-)b/www/firefox/files/patch-bug1442791 (+33 lines)
Added Link Here
1
Build Linux version of GetExecutablePathImpl() on other Unix systems
2
    
3
ANGLE system_utils* are unused in Gecko.
4
https://searchfox.org/mozilla-central/search?regexp=true&q=\bGetExecutable%28Path%7CDirectory%29\B
5
6
diff --git gfx/angle/targets/angle_common/moz.build gfx/angle/targets/angle_common/moz.build
7
index bd4b743ec0dd..3c0dbfae491a 100644
8
--- gfx/angle/targets/angle_common/moz.build
9
+++ gfx/angle/targets/angle_common/moz.build
10
@@ -118,17 +118,17 @@ SOURCES += [
11
     '../../checkout/src/common/uniform_type_info_autogen.cpp',
12
     '../../checkout/src/common/utilities.cpp',
13
 ]
14
-if CONFIG['OS_ARCH'] == 'Darwin':
15
+if CONFIG['OS_ARCH'] == 'WINNT':
16
     SOURCES += [
17
-        '../../checkout/src/common/system_utils_mac.cpp',
18
+        '../../checkout/src/common/system_utils_win.cpp',
19
     ]
20
-if CONFIG['OS_ARCH'] == 'Linux':
21
+elif CONFIG['OS_ARCH'] == 'Darwin':
22
     SOURCES += [
23
-        '../../checkout/src/common/system_utils_linux.cpp',
24
+        '../../checkout/src/common/system_utils_mac.cpp',
25
     ]
26
-if CONFIG['OS_ARCH'] == 'WINNT':
27
+else: # Android, Linux, BSDs, etc.
28
     SOURCES += [
29
-        '../../checkout/src/common/system_utils_win.cpp',
30
+        '../../checkout/src/common/system_utils_linux.cpp',
31
     ]
32
 #
33
 #LDFLAGS += [
(-)b/www/firefox/files/patch-z-bug517422 (-12 / +12 lines)
Lines 160-166 diff --git dom/media/moz.build dom/media/moz.build Link Here
160
index 86b051c58d33..fb6186dce78b 100644
160
index 86b051c58d33..fb6186dce78b 100644
161
--- dom/media/moz.build
161
--- dom/media/moz.build
162
+++ dom/media/moz.build
162
+++ dom/media/moz.build
163
@@ -318,6 +318,21 @@ if CONFIG['MOZ_WEBRTC']:
163
@@ -326,6 +326,21 @@ if CONFIG['MOZ_WEBRTC']:
164
 
164
 
165
 DEFINES['MOZILLA_INTERNAL_API'] = True
165
 DEFINES['MOZILLA_INTERNAL_API'] = True
166
 
166
 
Lines 179-194 index 86b051c58d33..fb6186dce78b 100644 Link Here
179
+if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']:
179
+if CONFIG['MOZ_SYSTEM_SOUNDTOUCH']:
180
+    CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS']
180
+    CXXFLAGS += CONFIG['MOZ_SOUNDTOUCH_CFLAGS']
181
+
181
+
182
 if CONFIG['MOZ_ANDROID_HLS_SUPPORT'] and CONFIG['MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE']:
182
 if CONFIG['MOZ_ANDROID_HLS_SUPPORT']:
183
     DEFINES['MOZ_ANDROID_HLS_SUPPORT'] = True
183
     DEFINES['MOZ_ANDROID_HLS_SUPPORT'] = True
184
 
184
 
185
diff --git dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
185
diff --git dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
186
index 078f6ea5ef60..c600db067539 100644
186
index 078f6ea5ef60..c600db067539 100644
187
--- dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
187
--- dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
188
+++ dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
188
+++ dom/media/platforms/ffmpeg/ffvpx/FFVPXRuntimeLinker.cpp
189
@@ -11,9 +11,13 @@
189
@@ -15,9 +15,13 @@
190
 #include "prmem.h"
190
 #include <windows.h>
191
 #include "prlink.h"
191
 #endif
192
 
192
 
193
+#ifdef MOZ_SYSTEM_SOUNDTOUCH
193
+#ifdef MOZ_SYSTEM_SOUNDTOUCH
194
+#include "nsXPCOMPrivate.h" // for XUL_DLL
194
+#include "nsXPCOMPrivate.h" // for XUL_DLL
Lines 200-206 index 078f6ea5ef60..c600db067539 100644 Link Here
200
 
200
 
201
 namespace mozilla {
201
 namespace mozilla {
202
 
202
 
203
@@ -54,6 +58,12 @@ FFVPXRuntimeLinker::Init()
203
@@ -64,6 +68,12 @@ FFVPXRuntimeLinker::Init()
204
 
204
 
205
   sLinkStatus = LinkStatus_FAILED;
205
   sLinkStatus = LinkStatus_FAILED;
206
 
206
 
Lines 212-224 index 078f6ea5ef60..c600db067539 100644 Link Here
212
+#else
212
+#else
213
   // We retrieve the path of the lgpllibs library as this is where mozavcodec
213
   // We retrieve the path of the lgpllibs library as this is where mozavcodec
214
   // and mozavutil libs are located.
214
   // and mozavutil libs are located.
215
   char* lgpllibsname = PR_GetLibraryName(nullptr, "lgpllibs");
215
   PathString lgpllibsname = GetLibraryName(nullptr, "lgpllibs");
216
@@ -64,6 +74,7 @@ FFVPXRuntimeLinker::Init()
216
@@ -73,6 +83,7 @@ FFVPXRuntimeLinker::Init()
217
     PR_GetLibraryFilePathname(lgpllibsname,
217
   PathString path =
218
                               (PRFuncPtr)&soundtouch::SoundTouch::getVersionId);
218
     GetLibraryFilePathname(lgpllibsname.get(),
219
   PR_FreeLibraryName(lgpllibsname);
219
                            (PRFuncPtr)&soundtouch::SoundTouch::getVersionId);
220
+#endif
220
+#endif
221
   if (!path) {
221
   if (path.IsEmpty()) {
222
     return false;
222
     return false;
223
   }
223
   }
224
diff --git media/libogg/README_MOZILLA media/libogg/README_MOZILLA
224
diff --git media/libogg/README_MOZILLA media/libogg/README_MOZILLA

Return to bug 226476