1# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2# vim: set filetype=python:
3# This Source Code Form is subject to the terms of the Mozilla Public
4# License, v. 2.0. If a copy of the MPL was not distributed with this
5# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7with Files("**"):
8    BUG_COMPONENT = ("Core", "DOM: Content Processes")
9
10DIRS += ["jsactor"]
11
12XPIDL_SOURCES += [
13    "nsIDOMProcessChild.idl",
14    "nsIDOMProcessParent.idl",
15    "nsIHangReport.idl",
16]
17
18XPIDL_MODULE = "dom"
19
20EXTRA_JS_MODULES += [
21    "ManifestMessagesChild.jsm",
22]
23
24EXPORTS.mozilla.dom.ipc += [
25    "IdType.h",
26    "MemMapSnapshot.h",
27    "SharedMap.h",
28    "SharedMapChangeEvent.h",
29    "SharedStringMap.h",
30    "StringTable.h",
31    "StructuredCloneData.h",
32]
33
34EXPORTS.mozilla.dom += [
35    "BrowserBridgeChild.h",
36    "BrowserBridgeHost.h",
37    "BrowserBridgeParent.h",
38    "BrowserChild.h",
39    "BrowserHost.h",
40    "BrowserParent.h",
41    "ClonedErrorHolder.h",
42    "CoalescedInputData.h",
43    "CoalescedMouseData.h",
44    "CoalescedTouchData.h",
45    "CoalescedWheelData.h",
46    "ContentChild.h",
47    "ContentParent.h",
48    "ContentProcess.h",
49    "ContentProcessManager.h",
50    "CSPMessageUtils.h",
51    "DocShellMessageUtils.h",
52    "EffectsInfo.h",
53    "FilePickerParent.h",
54    "InProcessChild.h",
55    "InProcessParent.h",
56    "MaybeDiscarded.h",
57    "MemoryReportRequest.h",
58    "NativeThreadId.h",
59    "PermissionMessageUtils.h",
60    "ProcessActor.h",
61    "PropertyBagUtils.h",
62    "ReferrerInfoUtils.h",
63    "RefMessageBodyService.h",
64    "RemoteBrowser.h",
65    "RemoteType.h",
66    "RemoteWebProgressRequest.h",
67    "SharedMessageBody.h",
68    "TabContext.h",
69    "TabMessageTypes.h",
70    "TabMessageUtils.h",
71    "URLClassifierChild.h",
72    "URLClassifierParent.h",
73    "UserActivationIPCUtils.h",
74    "VsyncChild.h",
75    "VsyncParent.h",
76    "WindowGlobalActor.h",
77    "WindowGlobalChild.h",
78    "WindowGlobalParent.h",
79]
80
81EXPORTS.mozilla += [
82    "PreallocatedProcessManager.h",
83    "ProcessHangMonitor.h",
84    "ProcessHangMonitorIPC.h",
85    "ProcessPriorityManager.h",
86]
87
88UNIFIED_SOURCES += [
89    "BrowserBridgeChild.cpp",
90    "BrowserBridgeHost.cpp",
91    "BrowserBridgeParent.cpp",
92    "BrowserChild.cpp",
93    "BrowserHost.cpp",
94    "BrowserParent.cpp",
95    "ClonedErrorHolder.cpp",
96    "CoalescedInputData.cpp",
97    "CoalescedMouseData.cpp",
98    "CoalescedTouchData.cpp",
99    "CoalescedWheelData.cpp",
100    "ColorPickerParent.cpp",
101    "ContentParent.cpp",
102    "ContentProcess.cpp",
103    "ContentProcessManager.cpp",
104    "CSPMessageUtils.cpp",
105    "DocShellMessageUtils.cpp",
106    "FilePickerParent.cpp",
107    "InProcessImpl.cpp",
108    "MemMapSnapshot.cpp",
109    "MemoryReportRequest.cpp",
110    "MMPrinter.cpp",
111    "PermissionMessageUtils.cpp",
112    "PreallocatedProcessManager.cpp",
113    "ProcessActor.cpp",
114    "ProcessPriorityManager.cpp",
115    "PropertyBagUtils.cpp",
116    "ReferrerInfoUtils.cpp",
117    "RefMessageBodyService.cpp",
118    "RemoteBrowser.cpp",
119    "RemoteWebProgressRequest.cpp",
120    "SharedMap.cpp",
121    "SharedMessageBody.cpp",
122    "SharedStringMap.cpp",
123    "StructuredCloneData.cpp",
124    "TabContext.cpp",
125    "TabMessageUtils.cpp",
126    "URLClassifierParent.cpp",
127    "WindowGlobalActor.cpp",
128    "WindowGlobalChild.cpp",
129    "WindowGlobalParent.cpp",
130]
131
132# ContentChild.cpp cannot be compiled in unified mode on  linux due to Time conflict
133SOURCES += [
134    "ContentChild.cpp",
135    "ProcessHangMonitor.cpp",
136    "VsyncChild.cpp",
137    "VsyncParent.cpp",
138]
139
140PREPROCESSED_IPDL_SOURCES += [
141    "PBrowser.ipdl",
142    "PBrowserBridge.ipdl",
143    "PContent.ipdl",
144]
145
146IPDL_SOURCES += [
147    "DOMTypes.ipdlh",
148    "MemoryReportTypes.ipdlh",
149    "PColorPicker.ipdl",
150    "PContentPermission.ipdlh",
151    "PContentPermissionRequest.ipdl",
152    "PCycleCollectWithLogs.ipdl",
153    "PFilePicker.ipdl",
154    "PInProcess.ipdl",
155    "PLoginReputation.ipdl",
156    "PProcessHangMonitor.ipdl",
157    "PrefsTypes.ipdlh",
158    "PTabContext.ipdlh",
159    "PURLClassifier.ipdl",
160    "PURLClassifierInfo.ipdlh",
161    "PURLClassifierLocal.ipdl",
162    "PVsync.ipdl",
163    "PWindowGlobal.ipdl",
164    "ServiceWorkerConfiguration.ipdlh",
165    "WindowGlobalTypes.ipdlh",
166]
167
168include("/ipc/chromium/chromium-config.mozbuild")
169
170FINAL_LIBRARY = "xul"
171
172if CONFIG["MOZ_SANDBOX"] and (CONFIG["OS_TARGET"] in ["Darwin", "Linux"]):
173    USE_LIBS += [
174        "mozsandbox",
175    ]
176
177LOCAL_INCLUDES += [
178    "/caps",
179    "/chrome",
180    "/docshell/base",
181    "/dom/base",
182    "/dom/bindings",
183    "/dom/events",
184    "/dom/filesystem",
185    "/dom/geolocation",
186    "/dom/media/webrtc",
187    "/dom/media/webspeech/synth/ipc",
188    "/dom/security",
189    "/dom/storage",
190    "/extensions/spellcheck/src",
191    "/gfx/2d",
192    "/hal/sandbox",
193    "/js/xpconnect/loader",
194    "/js/xpconnect/src",
195    "/layout/base",
196    "/media/webrtc",
197    "/netwerk/base",
198    "/netwerk/protocol/http",
199    "/toolkit/components/printingui/ipc",
200    "/toolkit/crashreporter",
201    "/toolkit/xre",
202    "/uriloader/exthandler",
203    "/widget",
204    "/xpcom/base",
205    "/xpcom/threads",
206]
207
208if CONFIG["MOZ_SANDBOX"] and CONFIG["OS_ARCH"] == "WINNT":
209    LOCAL_INCLUDES += [
210        "/security/sandbox/chromium",
211        "/security/sandbox/chromium-shim",
212    ]
213
214if CONFIG["OS_ARCH"] != "WINNT":
215    LOCAL_INCLUDES += [
216        "/modules/libjar",
217    ]
218
219DEFINES["BIN_SUFFIX"] = '"%s"' % CONFIG["BIN_SUFFIX"]
220
221DEFINES["MOZ_APP_NAME"] = '"%s"' % CONFIG["MOZ_APP_NAME"]
222
223if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android":
224    DEFINES["MOZ_ENABLE_FREETYPE"] = True
225
226JAR_MANIFESTS += ["jar.mn"]
227
228BROWSER_CHROME_MANIFESTS += [
229    "tests/browser.ini",
230    "tests/JSProcessActor/browser.ini",
231    "tests/JSWindowActor/browser.ini",
232]
233
234MOCHITEST_CHROME_MANIFESTS += ["tests/chrome.ini"]
235MOCHITEST_MANIFESTS += ["tests/mochitest.ini"]
236XPCSHELL_TESTS_MANIFESTS += ["tests/xpcshell.ini"]
237
238CXXFLAGS += CONFIG["TK_CFLAGS"]
239
240if CONFIG["CC_TYPE"] in ("clang", "gcc"):
241    CXXFLAGS += ["-Wno-error=shadow"]
242
243if CONFIG["FUZZING"] and CONFIG["FUZZING_INTERFACES"]:
244    TEST_DIRS += ["fuzztest"]
245
246# Add libFuzzer configuration directives
247include("/tools/fuzzing/libfuzzer-config.mozbuild")
248