summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-04-26 12:56:46 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-04-26 12:56:46 +0200
commit98fe8b0ccbea37c2681ad8c788baa91554871f4d (patch)
tree0e269a27661fea619ab07a533e0c1fa195c3c671
parente08a4ad1c8096fc8de64fac4f36cf0c569cb4420 (diff)
parent519030e688dd7075a7cd9f14dd6fb9e210b5a689 (diff)
downloadUXP-4b8656a4eaa0fe8758cbddf2910089395bdfd1d6.tar
UXP-4b8656a4eaa0fe8758cbddf2910089395bdfd1d6.tar.gz
UXP-4b8656a4eaa0fe8758cbddf2910089395bdfd1d6.tar.lz
UXP-4b8656a4eaa0fe8758cbddf2910089395bdfd1d6.tar.xz
UXP-4b8656a4eaa0fe8758cbddf2910089395bdfd1d6.zip
Merge branch 'redwood' into 28.9-platformRELBASE_20200426
-rw-r--r--build/moz.configure/init.configure43
-rw-r--r--build/moz.configure/old.configure1
-rw-r--r--build/mozconfig.common5
-rw-r--r--docs/UXP Coding Style.md14
-rw-r--r--dom/animation/AnimationComparator.h2
-rw-r--r--dom/animation/AnimationEffectReadOnly.cpp1
-rw-r--r--dom/animation/AnimationPerformanceWarning.h3
-rw-r--r--dom/animation/CSSPseudoElement.cpp1
-rw-r--r--dom/animation/KeyframeEffect.cpp1
-rw-r--r--dom/animation/KeyframeEffectReadOnly.cpp2
-rw-r--r--dom/animation/moz.build7
-rw-r--r--dom/archivereader/ArchiveRequest.cpp2
-rw-r--r--dom/archivereader/ArchiveZipFile.cpp1
-rw-r--r--dom/archivereader/moz.build2
-rw-r--r--dom/audiochannel/moz.build6
-rw-r--r--dom/broadcastchannel/moz.build10
-rw-r--r--dom/cache/CacheOpParent.cpp1
-rw-r--r--dom/cache/CacheStorage.cpp3
-rw-r--r--dom/cache/CacheStreamControlChild.cpp1
-rw-r--r--dom/cache/CacheStreamControlParent.cpp2
-rw-r--r--dom/cache/ReadStream.h3
-rw-r--r--dom/cache/TypeUtils.cpp1
-rw-r--r--dom/cache/moz.build2
-rw-r--r--dom/canvas/CanvasImageCache.cpp1
-rw-r--r--dom/canvas/CanvasRenderingContextHelper.cpp2
-rw-r--r--dom/canvas/ImageBitmap.cpp12
-rw-r--r--dom/canvas/ImageBitmap.h2
-rw-r--r--dom/canvas/ImageBitmapColorUtils.cpp3
-rw-r--r--dom/canvas/ImageBitmapRenderingContext.cpp10
-rw-r--r--dom/canvas/ImageBitmapUtils.h1
-rw-r--r--dom/canvas/OffscreenCanvas.cpp8
-rw-r--r--dom/canvas/WebGL2ContextUniforms.cpp1
-rw-r--r--dom/canvas/WebGLContextBuffers.cpp1
-rw-r--r--dom/canvas/WebGLContextVertices.cpp1
-rw-r--r--dom/canvas/WebGLExtensionDebugGet.cpp1
-rw-r--r--dom/canvas/WebGLExtensions.h2
-rw-r--r--dom/canvas/WebGLFramebuffer.h2
-rw-r--r--dom/canvas/WebGLObjectModel.h1
-rw-r--r--dom/canvas/WebGLSampler.h1
-rw-r--r--dom/canvas/WebGLTransformFeedback.h3
-rw-r--r--dom/canvas/WebGLVertexAttribData.cpp1
-rw-r--r--dom/canvas/WebGLVertexAttribData.h1
-rw-r--r--dom/canvas/moz.build4
-rw-r--r--dom/console/moz.build2
-rw-r--r--dom/crypto/WebCryptoThreadPool.cpp3
-rw-r--r--dom/crypto/WebCryptoThreadPool.h2
-rw-r--r--dom/crypto/moz.build2
-rw-r--r--dom/encoding/moz.build7
-rw-r--r--dom/events/DOMEventTargetHelper.cpp1
-rw-r--r--dom/events/EventTarget.cpp1
-rw-r--r--dom/events/IMEContentObserver.h1
-rw-r--r--dom/events/IMEStateManager.cpp1
-rw-r--r--dom/events/TextClause.h1
-rw-r--r--dom/events/TouchEvent.cpp2
-rw-r--r--dom/events/moz.build10
-rw-r--r--dom/fetch/FetchConsumer.h2
-rw-r--r--dom/fetch/FetchUtil.cpp1
-rw-r--r--dom/fetch/InternalRequest.cpp1
-rw-r--r--dom/fetch/InternalResponse.cpp1
-rw-r--r--dom/fetch/InternalResponse.h1
-rw-r--r--dom/fetch/Request.cpp13
-rw-r--r--dom/fetch/Response.cpp1
-rw-r--r--dom/fetch/moz.build9
-rw-r--r--dom/filehandle/moz.build2
-rw-r--r--dom/filesystem/FileSystemBase.cpp1
-rw-r--r--dom/filesystem/FileSystemRequestParent.cpp3
-rw-r--r--dom/filesystem/FileSystemSecurity.cpp3
-rw-r--r--dom/filesystem/FileSystemTaskBase.cpp2
-rw-r--r--dom/filesystem/FileSystemUtils.cpp3
-rw-r--r--dom/filesystem/FileSystemUtils.h2
-rw-r--r--dom/filesystem/GetDirectoryListingTask.cpp3
-rw-r--r--dom/filesystem/GetFileOrDirectoryTask.cpp3
-rw-r--r--dom/filesystem/GetFilesHelper.cpp8
-rw-r--r--dom/filesystem/GetFilesHelper.h3
-rw-r--r--dom/filesystem/GetFilesTask.cpp3
-rw-r--r--dom/filesystem/moz.build2
-rw-r--r--dom/gamepad/GamepadManager.cpp1
-rw-r--r--dom/gamepad/GamepadManager.h3
-rw-r--r--dom/gamepad/GamepadPlatformService.h1
-rw-r--r--dom/gamepad/GamepadPoseState.h2
-rw-r--r--dom/gamepad/GamepadServiceTest.cpp2
-rw-r--r--dom/gamepad/android/AndroidGamepad.cpp1
-rw-r--r--dom/gamepad/cocoa/CocoaGamepad.cpp2
-rw-r--r--dom/gamepad/ipc/GamepadEventChannelParent.cpp4
-rw-r--r--dom/gamepad/ipc/GamepadTestChannelParent.cpp1
-rw-r--r--dom/gamepad/linux/LinuxGamepad.cpp1
-rw-r--r--dom/gamepad/moz.build12
-rw-r--r--dom/gamepad/windows/WindowsGamepad.cpp1
-rw-r--r--dom/geolocation/moz.build2
-rw-r--r--dom/geolocation/nsGeoPosition.h1
-rw-r--r--dom/grid/GridDimension.h2
-rw-r--r--dom/grid/GridLines.cpp1
-rw-r--r--dom/grid/GridLines.h7
-rw-r--r--dom/grid/moz.build2
-rw-r--r--dom/html/HTMLBodyElement.cpp1
-rw-r--r--dom/html/HTMLFrameSetElement.cpp1
-rw-r--r--dom/html/HTMLLabelElement.cpp1
-rw-r--r--dom/html/HTMLMetaElement.cpp1
-rw-r--r--dom/html/ValidityState.h1
-rw-r--r--dom/html/moz.build8
-rw-r--r--dom/html/nsBrowserElement.cpp2
-rw-r--r--dom/html/nsHTMLDocument.cpp1
-rw-r--r--dom/html/nsIConstraintValidation.cpp2
-rw-r--r--dom/indexedDB/IDBDatabase.cpp7
-rw-r--r--dom/indexedDB/IDBFactory.cpp2
-rw-r--r--dom/indexedDB/IDBFileHandle.cpp2
-rw-r--r--dom/indexedDB/IDBIndex.cpp3
-rw-r--r--dom/indexedDB/IDBObjectStore.cpp2
-rw-r--r--dom/indexedDB/IDBTransaction.cpp1
-rw-r--r--dom/indexedDB/KeyPath.cpp2
-rw-r--r--dom/indexedDB/ScriptErrorHelper.h2
-rw-r--r--dom/indexedDB/moz.build2
-rw-r--r--dom/ipc/ContentParent.cpp2
-rw-r--r--dom/ipc/StructuredCloneData.cpp1
-rw-r--r--dom/ipc/TabChild.cpp1
-rw-r--r--dom/ipc/moz.build13
-rw-r--r--dom/ipc/nsIContentParent.cpp1
-rw-r--r--dom/json/moz.build12
-rw-r--r--dom/jsurl/moz.build2
-rw-r--r--dom/mathml/moz.build7
-rw-r--r--dom/media/Benchmark.cpp1
-rw-r--r--dom/media/CanvasCaptureMediaStream.cpp1
-rw-r--r--dom/media/CubebUtils.cpp2
-rwxr-xr-xdom/media/DOMMediaStream.cpp2
-rw-r--r--dom/media/MediaDecoder.cpp7
-rw-r--r--dom/media/MediaDecoderReader.cpp1
-rw-r--r--dom/media/MediaStreamListener.h2
-rw-r--r--dom/media/MediaStreamTrack.cpp4
-rw-r--r--dom/media/eme/MediaKeySystemAccess.cpp2
-rw-r--r--dom/media/eme/mediadrm/moz.build2
-rw-r--r--dom/media/eme/moz.build2
-rw-r--r--dom/media/encoder/OpusTrackEncoder.cpp2
-rw-r--r--dom/media/encoder/moz.build6
-rw-r--r--dom/media/flac/FlacDemuxer.cpp8
-rw-r--r--dom/media/flac/FlacDemuxer.h9
-rw-r--r--dom/media/flac/FlacFrameParser.cpp1
-rw-r--r--dom/media/flac/moz.build2
-rw-r--r--dom/media/fmp4/moz.build7
-rw-r--r--dom/media/gmp/GMPDecryptorParent.cpp2
-rw-r--r--dom/media/gmp/GMPUtils.cpp2
-rw-r--r--dom/media/gmp/moz.build4
-rw-r--r--dom/media/imagecapture/CaptureTask.cpp18
-rw-r--r--dom/media/imagecapture/CaptureTask.h18
-rw-r--r--dom/media/imagecapture/moz.build2
-rw-r--r--dom/media/mediasink/DecodedStream.cpp2
-rw-r--r--dom/media/mediasink/VideoSink.cpp2
-rw-r--r--dom/media/mediasink/moz.build2
-rw-r--r--dom/media/mediasource/TrackBuffersManager.cpp1
-rw-r--r--dom/media/mediasource/moz.build2
-rw-r--r--dom/media/moz.build8
-rw-r--r--dom/media/mp3/moz.build2
-rw-r--r--dom/media/ogg/OggDemuxer.cpp1
-rw-r--r--dom/media/ogg/moz.build2
-rw-r--r--dom/media/platforms/PlatformDecoderModule.h2
-rw-r--r--dom/media/platforms/agnostic/TheoraDecoder.cpp1
-rw-r--r--dom/media/platforms/agnostic/eme/moz.build2
-rw-r--r--dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp1
-rw-r--r--dom/media/platforms/agnostic/gmp/moz.build2
-rw-r--r--dom/media/platforms/apple/AppleCMLinker.cpp2
-rw-r--r--dom/media/platforms/apple/AppleVTDecoder.cpp5
-rw-r--r--dom/media/platforms/apple/AppleVTLinker.cpp2
-rw-r--r--dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp1
-rw-r--r--dom/media/platforms/ffmpeg/ffmpeg57/moz.build2
-rw-r--r--dom/media/platforms/ffmpeg/ffmpeg58/moz.build2
-rw-r--r--dom/media/platforms/ffmpeg/ffvpx/moz.build2
-rw-r--r--dom/media/platforms/ffmpeg/libav53/moz.build2
-rw-r--r--dom/media/platforms/ffmpeg/libav54/moz.build2
-rw-r--r--dom/media/platforms/ffmpeg/libav55/moz.build2
-rw-r--r--dom/media/platforms/ffmpeg/moz.build2
-rw-r--r--dom/media/platforms/moz.build10
-rw-r--r--dom/media/platforms/omx/OmxPlatformLayer.cpp2
-rw-r--r--dom/media/platforms/omx/OmxPlatformLayer.h1
-rw-r--r--dom/media/platforms/omx/moz.build2
-rw-r--r--dom/media/platforms/wmf/moz.build1
-rw-r--r--dom/media/platforms/wrappers/FuzzingWrapper.cpp2
-rw-r--r--dom/media/platforms/wrappers/H264Converter.cpp2
-rw-r--r--dom/media/standalone/moz.build2
-rw-r--r--dom/media/systemservices/MediaParent.cpp1
-rw-r--r--dom/media/systemservices/MediaSystemResourceManager.cpp1
-rw-r--r--dom/media/systemservices/moz.build12
-rw-r--r--dom/media/wave/moz.build2
-rwxr-xr-xdom/media/webaudio/AudioContext.cpp1
-rw-r--r--dom/media/webaudio/AudioDestinationNode.cpp1
-rw-r--r--dom/media/webaudio/AudioEventTimeline.h1
-rw-r--r--dom/media/webaudio/AudioNodeEngine.cpp1
-rw-r--r--dom/media/webaudio/AudioNodeStream.cpp1
-rw-r--r--dom/media/webaudio/ConstantSourceNode.cpp2
-rw-r--r--dom/media/webaudio/DelayBuffer.h1
-rw-r--r--dom/media/webaudio/IIRFilterNode.cpp6
-rw-r--r--dom/media/webaudio/MediaBufferDecoder.cpp1
-rw-r--r--dom/media/webaudio/MediaStreamAudioSourceNode.cpp2
-rw-r--r--dom/media/webaudio/WebAudioUtils.cpp1
-rw-r--r--dom/media/webaudio/moz.build2
-rw-r--r--dom/media/webm/moz.build8
-rw-r--r--dom/media/webrtc/MediaEngineRemoteVideoSource.cpp3
-rw-r--r--dom/media/webrtc/MediaEngineTabVideoSource.cpp1
-rw-r--r--dom/media/webrtc/MediaEngineWebRTCAudio.cpp1
-rw-r--r--dom/media/webrtc/MediaTrackConstraints.cpp1
-rw-r--r--dom/media/webrtc/PeerIdentity.h2
-rw-r--r--dom/media/webrtc/moz.build11
-rw-r--r--dom/media/webspeech/recognition/SpeechGrammarList.cpp1
-rw-r--r--dom/media/webspeech/recognition/SpeechGrammarList.h1
-rw-r--r--dom/media/webspeech/recognition/SpeechRecognition.cpp1
-rw-r--r--dom/media/webspeech/recognition/moz.build6
-rw-r--r--dom/media/webspeech/synth/moz.build4
-rw-r--r--dom/media/webspeech/synth/pico/moz.build2
-rw-r--r--dom/media/webspeech/synth/speechd/moz.build2
-rw-r--r--dom/media/webspeech/synth/windows/moz.build2
-rw-r--r--dom/messagechannel/moz.build6
-rw-r--r--dom/network/TCPServerSocketParent.cpp5
-rw-r--r--dom/network/TCPSocket.cpp2
-rw-r--r--dom/network/TCPSocketParent.cpp1
-rw-r--r--dom/network/UDPSocket.cpp2
-rw-r--r--dom/network/UDPSocketChild.cpp2
-rw-r--r--dom/network/UDPSocketParent.cpp5
-rw-r--r--dom/network/moz.build2
-rw-r--r--dom/notification/moz.build7
-rw-r--r--dom/offline/moz.build13
-rw-r--r--dom/performance/PerformanceMainThread.cpp5
-rw-r--r--dom/performance/PerformanceService.cpp1
-rwxr-xr-xdom/performance/PerformanceTiming.cpp1
-rw-r--r--dom/performance/moz.build2
-rw-r--r--dom/permission/PermissionUtils.cpp1
-rw-r--r--dom/permission/Permissions.cpp1
-rw-r--r--dom/permission/moz.build2
-rw-r--r--dom/plugins/base/moz.build17
-rw-r--r--dom/plugins/base/nsNPAPIPluginInstance.cpp1
-rw-r--r--dom/plugins/base/nsNPAPIPluginStreamListener.cpp2
-rw-r--r--dom/plugins/base/nsNPAPIPluginStreamListener.h1
-rw-r--r--dom/plugins/base/nsPluginInstanceOwner.cpp2
-rw-r--r--dom/plugins/base/nsPluginNativeWindowWin.cpp1
-rw-r--r--dom/plugins/base/nsPluginStreamListenerPeer.cpp1
-rw-r--r--dom/plugins/base/nsPluginTags.cpp2
-rw-r--r--dom/plugins/ipc/D3D11SurfaceHolder.h1
-rw-r--r--dom/plugins/ipc/PluginAsyncSurrogate.h1
-rw-r--r--dom/plugins/ipc/PluginInstanceParent.cpp4
-rwxr-xr-xdom/plugins/ipc/PluginModuleParent.cpp5
-rw-r--r--dom/plugins/ipc/PluginQuirks.h2
-rw-r--r--dom/plugins/ipc/PluginUtilsWin.h1
-rw-r--r--dom/plugins/ipc/hangui/moz.build2
-rw-r--r--dom/plugins/ipc/interpose/moz.build2
-rw-r--r--dom/plugins/ipc/moz.build19
-rw-r--r--dom/power/moz.build2
-rw-r--r--dom/push/PushSubscriptionOptions.cpp1
-rw-r--r--dom/push/PushUtil.cpp1
-rw-r--r--dom/push/PushUtil.h1
-rw-r--r--dom/push/moz.build2
-rw-r--r--dom/quota/QuotaManagerService.cpp1
-rw-r--r--dom/quota/QuotaRequests.cpp1
-rw-r--r--dom/quota/QuotaResults.h1
-rw-r--r--dom/quota/StorageManager.cpp3
-rw-r--r--dom/quota/StorageManager.h2
-rw-r--r--dom/quota/moz.build2
-rw-r--r--dom/security/SRICheck.h1
-rw-r--r--dom/security/moz.build7
-rw-r--r--dom/security/nsCSPParser.h1
-rw-r--r--dom/security/nsCSPUtils.cpp27
-rw-r--r--dom/security/nsContentSecurityManager.cpp10
-rw-r--r--dom/security/nsMixedContentBlocker.cpp4
-rw-r--r--dom/smil/moz.build2
-rw-r--r--dom/smil/nsSMILAnimationFunction.cpp1
-rw-r--r--dom/smil/nsSMILCSSProperty.cpp1
-rw-r--r--dom/smil/nsSMILCSSValueType.cpp1
-rw-r--r--dom/smil/nsSMILCompositor.cpp3
-rw-r--r--dom/smil/nsSMILInstanceTime.h1
-rw-r--r--dom/smil/nsSMILTimeContainer.cpp2
-rw-r--r--dom/storage/DOMStorageDBUpdater.cpp4
-rw-r--r--dom/storage/DOMStorageManager.cpp1
-rw-r--r--dom/storage/moz.build11
-rw-r--r--dom/svg/SVGDocument.cpp2
-rw-r--r--dom/svg/SVGElementFactory.cpp2
-rw-r--r--dom/svg/SVGElementFactory.h5
-rw-r--r--dom/svg/SVGGraphicsElement.cpp2
-rw-r--r--dom/svg/SVGSymbolElement.cpp2
-rw-r--r--dom/svg/SVGTests.cpp1
-rw-r--r--dom/svg/moz.build2
-rw-r--r--dom/system/moz.build2
-rw-r--r--dom/time/moz.build6
-rw-r--r--dom/u2f/moz.build2
-rw-r--r--dom/url/moz.build6
-rw-r--r--dom/workers/ServiceWorkerCommon.h2
-rw-r--r--dom/workers/ServiceWorkerEvents.cpp2
-rw-r--r--dom/workers/ServiceWorkerInfo.cpp2
-rw-r--r--dom/workers/ServiceWorkerInfo.h1
-rw-r--r--dom/workers/ServiceWorkerJob.cpp1
-rw-r--r--dom/workers/ServiceWorkerRegisterJob.cpp1
-rw-r--r--dom/workers/ServiceWorkerRegistrationInfo.cpp4
-rw-r--r--dom/workers/ServiceWorkerRegistrationInfo.h1
-rw-r--r--dom/workers/ServiceWorkerUnregisterJob.cpp4
-rw-r--r--dom/workers/ServiceWorkerUpdateJob.cpp4
-rw-r--r--dom/workers/ServiceWorkerUpdateJob.h2
-rw-r--r--dom/workers/ServiceWorkerWindowClient.cpp3
-rw-r--r--dom/workers/SharedWorker.cpp1
-rw-r--r--dom/workers/WorkerRunnable.cpp2
-rw-r--r--dom/workers/WorkerRunnable.h1
-rw-r--r--dom/workers/moz.build3
-rw-r--r--dom/worklet/moz.build2
-rw-r--r--dom/xbl/moz.build2
-rw-r--r--dom/xhr/XMLHttpRequestString.cpp91
-rw-r--r--dom/xhr/XMLHttpRequestString.h95
-rw-r--r--dom/xhr/XMLHttpRequestWorker.cpp2
-rw-r--r--dom/xhr/moz.build2
-rw-r--r--dom/xml/moz.build2
-rw-r--r--dom/xml/nsXMLPrettyPrinter.cpp1
-rw-r--r--dom/xslt/base/moz.build2
-rw-r--r--dom/xslt/xml/moz.build2
-rw-r--r--dom/xslt/xpath/moz.build2
-rw-r--r--dom/xslt/xslt/moz.build2
-rw-r--r--dom/xslt/xslt/txExecutionState.cpp3
-rw-r--r--dom/xslt/xslt/txMozillaXSLTProcessor.cpp2
-rw-r--r--dom/xul/moz.build4
-rw-r--r--dom/xul/nsXULContentSink.cpp2
-rw-r--r--dom/xul/templates/moz.build2
-rw-r--r--dom/xul/templates/nsInstantiationNode.cpp3
-rw-r--r--dom/xul/templates/nsTemplateMap.h2
-rw-r--r--dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp4
-rw-r--r--dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp2
-rw-r--r--dom/xul/templates/nsXULTreeBuilder.cpp3
-rw-r--r--layout/build/moz.build2
-rw-r--r--layout/build/nsLayoutStatics.cpp2
-rw-r--r--layout/forms/moz.build2
-rw-r--r--layout/forms/nsHTMLButtonControlFrame.cpp1
-rw-r--r--layout/forms/nsLegendFrame.cpp2
-rw-r--r--layout/forms/nsTextControlFrame.cpp1
-rw-r--r--layout/inspector/moz.build4
-rw-r--r--layout/ipc/moz.build5
-rw-r--r--layout/mathml/moz.build2
-rw-r--r--layout/mathml/nsMathMLOperators.cpp1
-rw-r--r--layout/mathml/nsMathMLmfencedFrame.cpp2
-rw-r--r--layout/tools/layout-debug/src/moz.build2
-rw-r--r--old-configure.in41
-rwxr-xr-xpython/mozbuild/mozbuild/mozinfo.py2
-rw-r--r--toolkit/components/contextualidentity/ContextualIdentityService.jsm344
-rw-r--r--toolkit/components/contextualidentity/moz.build7
-rw-r--r--toolkit/components/moz.build1
-rw-r--r--toolkit/components/prompts/content/tabprompts.xml28
-rw-r--r--toolkit/identity/Identity.jsm309
-rw-r--r--toolkit/identity/IdentityCryptoService.cpp571
-rw-r--r--toolkit/identity/IdentityProvider.jsm496
-rw-r--r--toolkit/identity/IdentityStore.jsm97
-rw-r--r--toolkit/identity/IdentityUtils.jsm111
-rw-r--r--toolkit/identity/LogUtils.jsm103
-rw-r--r--toolkit/identity/MinimalIdentity.jsm242
-rw-r--r--toolkit/identity/RelyingParty.jsm367
-rw-r--r--toolkit/identity/Sandbox.jsm152
-rw-r--r--toolkit/identity/jwcrypto.jsm180
-rw-r--r--toolkit/identity/moz.build25
-rw-r--r--toolkit/identity/nsIIdentityCryptoService.idl106
-rw-r--r--toolkit/modules/AppConstants.jsm9
-rw-r--r--toolkit/modules/LightweightThemeConsumer.jsm2
-rw-r--r--toolkit/modules/moz.build3
-rw-r--r--toolkit/moz.build1
-rw-r--r--toolkit/moz.configure14
353 files changed, 860 insertions, 3554 deletions
diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
index 713b2ce61..2e6034e8e 100644
--- a/build/moz.configure/init.configure
+++ b/build/moz.configure/init.configure
@@ -610,7 +610,7 @@ imply_option('--enable-project', application)
def default_project(build_env, help):
if build_env.topobjdir.endswith('/js/src'):
return 'js'
- return 'browser'
+ return 'application/xulrunner'
option('--enable-project', nargs=1, default=default_project,
help='Project to build')
@@ -618,28 +618,22 @@ option('--enable-project', nargs=1, default=default_project,
option('--with-external-source-dir', env='EXTERNAL_SOURCE_DIR', nargs=1,
help='External directory containing additional build files')
-@depends('--enable-project', '--with-external-source-dir',
- check_build_environment, '--help')
+@depends('--enable-project', '--with-external-source-dir', check_build_environment, '--help')
@imports(_from='os.path', _import='exists')
def include_project_configure(project, external_source_dir, build_env, help):
- if not project:
- die('--enable-project is required.')
-
base_dir = build_env.topsrcdir
+
if external_source_dir:
base_dir = os.path.join(base_dir, external_source_dir[0])
-
+
build_app = project[0]
- if not external_source_dir and build_app not in ('xulrunner', 'js'):
- die('Cannot find project %s', build_app)
-
path_project_src_dir_root = os.path.join(base_dir, build_app, 'moz.configure')
if exists(path_project_src_dir_root):
return path_project_src_dir_root
else:
- die('Cannot find project %s', build_app)
+ return os.path.join(build_env.topsrcdir, 'toolkit', 'moz.configure')
@depends('--with-external-source-dir')
def external_source_dir(value):
@@ -649,12 +643,29 @@ def external_source_dir(value):
set_config('EXTERNAL_SOURCE_DIR', external_source_dir)
add_old_configure_assignment('EXTERNAL_SOURCE_DIR', external_source_dir)
+@depends('--enable-project', '--with-external-source-dir', check_build_environment, '--help')
+@imports(_from='os.path', _import='exists')
+def build_project(project, external_source_dir, build_env, help):
+ if not project:
+ die('--enable-project is required.')
+
+ base_dir = build_env.topsrcdir
+
+ if external_source_dir:
+ base_dir = os.path.join(base_dir, external_source_dir[0])
+
+ build_app = project[0]
+
+ if not external_source_dir and build_app not in ('xulrunner', 'js'):
+ die('Cannot find project %s', build_app)
+
+ build_app_abspath = os.path.join(base_dir, build_app)
+
+ if exists(build_app_abspath):
+ return os.path.relpath(build_app_abspath, build_env.topsrcdir)
+ else:
+ die('Cannot find project %s', build_app)
-@depends(include_project_configure, check_build_environment, '--help')
-def build_project(include_project_configure, build_env, help):
- ret = os.path.dirname(os.path.relpath(include_project_configure,
- build_env.topsrcdir))
- return ret
set_config('MOZ_BUILD_APP', build_project)
set_define('MOZ_BUILD_APP', build_project)
diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
index d0f6909b9..aba1edf85 100644
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -157,6 +157,7 @@ def old_configure_options(*options):
'--enable-accessibility',
'--enable-address-sanitizer',
'--enable-alsa',
+ '--enable-av1',
'--enable-b2g-bt',
'--enable-b2g-camera',
'--enable-b2g-ril',
diff --git a/build/mozconfig.common b/build/mozconfig.common
index 3d2d0b289..1bdf69ddc 100644
--- a/build/mozconfig.common
+++ b/build/mozconfig.common
@@ -16,11 +16,6 @@ ac_add_options --enable-crashreporter
ac_add_options --enable-release
-# Disable checking that add-ons are signed by the trusted root
-MOZ_ADDON_SIGNING=${MOZ_ADDON_SIGNING-0}
-# Disable enforcing that add-ons are signed by the trusted root
-MOZ_REQUIRE_SIGNING=${MOZ_REQUIRE_SIGNING-0}
-
ac_add_options --enable-js-shell
. "$topsrcdir/build/mozconfig.automation"
diff --git a/docs/UXP Coding Style.md b/docs/UXP Coding Style.md
index 5dc4fd2a5..fc025584f 100644
--- a/docs/UXP Coding Style.md
+++ b/docs/UXP Coding Style.md
@@ -126,7 +126,7 @@ switch (variable) {
code_for_1;
code_for_1;
break;
- case value2:
+ case value2: // Comment describing 2 (alternative)
code_for_2;
code_for_2;
// fallthrough
@@ -273,7 +273,7 @@ Applies to `*.js` and `*.jsm`.
}
}, false);
```
-- Use a single space between `{` `}` braces in empty js objects.
+- Don't use a space between `{` `}` braces in empty js objects, `{` `}` braces in empty function scopes, or `[` `]` brackets in empty arrays.
### Flow control
Flow control expressions should follow the following guidelines:
@@ -343,7 +343,7 @@ switch (variable) {
code_for_1;
code_for_1;
break;
- case value2:
+ case value2: // Comment describing 2 (alternative)
code_for_2;
code_for_2;
// fallthrough
@@ -397,8 +397,7 @@ try {
try {
do_something();
-} catch(e) {
-}
+} catch(e) {}
try {
do_something();
@@ -414,11 +413,6 @@ try {
// No error processing
do_something_else();
}
-
-// No closing brace on its own line
-try {
- do_something();
-} catch(ex) { }
```
### Long line wrapping
diff --git a/dom/animation/AnimationComparator.h b/dom/animation/AnimationComparator.h
index ff665e82a..730d62f48 100644
--- a/dom/animation/AnimationComparator.h
+++ b/dom/animation/AnimationComparator.h
@@ -7,6 +7,8 @@
#ifndef mozilla_AnimationComparator_h
#define mozilla_AnimationComparator_h
+#include "mozilla/dom/Animation.h"
+
namespace mozilla {
// Although this file is called AnimationComparator, we don't actually
diff --git a/dom/animation/AnimationEffectReadOnly.cpp b/dom/animation/AnimationEffectReadOnly.cpp
index 63d633c2f..7eb0880c7 100644
--- a/dom/animation/AnimationEffectReadOnly.cpp
+++ b/dom/animation/AnimationEffectReadOnly.cpp
@@ -6,6 +6,7 @@
#include "mozilla/dom/AnimationEffectReadOnly.h"
#include "mozilla/dom/AnimationEffectReadOnlyBinding.h"
+#include "mozilla/dom/Animation.h"
#include "mozilla/AnimationUtils.h"
#include "mozilla/FloatingPoint.h"
diff --git a/dom/animation/AnimationPerformanceWarning.h b/dom/animation/AnimationPerformanceWarning.h
index 025857e0c..a1ac35cba 100644
--- a/dom/animation/AnimationPerformanceWarning.h
+++ b/dom/animation/AnimationPerformanceWarning.h
@@ -9,6 +9,9 @@
#include <initializer_list>
+#include "mozilla/Maybe.h"
+#include "nsTArray.h"
+
class nsXPIDLString;
namespace mozilla {
diff --git a/dom/animation/CSSPseudoElement.cpp b/dom/animation/CSSPseudoElement.cpp
index a4dede0b3..09aad01ef 100644
--- a/dom/animation/CSSPseudoElement.cpp
+++ b/dom/animation/CSSPseudoElement.cpp
@@ -7,6 +7,7 @@
#include "mozilla/dom/CSSPseudoElement.h"
#include "mozilla/dom/CSSPseudoElementBinding.h"
#include "mozilla/dom/Element.h"
+#include "mozilla/dom/KeyframeEffectBinding.h" // for ElementOrCSSPseudoElement class
#include "mozilla/AnimationComparator.h"
namespace mozilla {
diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp
index decbf6305..32f6bd1a1 100644
--- a/dom/animation/KeyframeEffect.cpp
+++ b/dom/animation/KeyframeEffect.cpp
@@ -11,6 +11,7 @@
#include "mozilla/dom/AnimationEffectTiming.h"
#include "mozilla/dom/KeyframeEffectBinding.h"
#include "mozilla/KeyframeUtils.h"
+#include "nsContentUtils.h"
#include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch
#include "nsIScriptError.h"
diff --git a/dom/animation/KeyframeEffectReadOnly.cpp b/dom/animation/KeyframeEffectReadOnly.cpp
index 639e0b2b0..95f657449 100644
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -6,6 +6,7 @@
#include "mozilla/dom/KeyframeEffectReadOnly.h"
+#include "mozilla/dom/Animation.h"
#include "mozilla/dom/KeyframeAnimationOptionsBinding.h"
// For UnrestrictedDoubleOrKeyframeAnimationOptions;
#include "mozilla/dom/CSSPseudoElement.h"
@@ -25,6 +26,7 @@
#include "nsCSSPseudoElements.h" // For CSSPseudoElementType
#include "nsIPresShell.h"
#include "nsIScriptError.h"
+#include "nsRefreshDriver.h"
namespace mozilla {
diff --git a/dom/animation/moz.build b/dom/animation/moz.build
index bd8c93707..356980f00 100644
--- a/dom/animation/moz.build
+++ b/dom/animation/moz.build
@@ -37,6 +37,11 @@ EXPORTS.mozilla += [
]
UNIFIED_SOURCES += [
+ 'KeyframeEffect.cpp',
+ 'KeyframeEffectReadOnly.cpp',
+]
+
+SOURCES += [
'Animation.cpp',
'AnimationEffectReadOnly.cpp',
'AnimationEffectTiming.cpp',
@@ -50,9 +55,7 @@ UNIFIED_SOURCES += [
'DocumentTimeline.cpp',
'EffectCompositor.cpp',
'EffectSet.cpp',
- 'KeyframeEffect.cpp',
'KeyframeEffectParams.cpp',
- 'KeyframeEffectReadOnly.cpp',
'KeyframeUtils.cpp',
'PendingAnimationTracker.cpp',
'TimingParams.cpp',
diff --git a/dom/archivereader/ArchiveRequest.cpp b/dom/archivereader/ArchiveRequest.cpp
index ec1686804..8505f0e1f 100644
--- a/dom/archivereader/ArchiveRequest.cpp
+++ b/dom/archivereader/ArchiveRequest.cpp
@@ -8,10 +8,12 @@
#include "mozilla/EventDispatcher.h"
#include "mozilla/dom/ArchiveRequestBinding.h"
+#include "mozilla/dom/File.h"
#include "mozilla/dom/ScriptSettings.h"
#include "nsContentUtils.h"
using namespace mozilla;
+using namespace mozilla::dom;
USING_ARCHIVEREADER_NAMESPACE
diff --git a/dom/archivereader/ArchiveZipFile.cpp b/dom/archivereader/ArchiveZipFile.cpp
index d374fe91f..e1716f348 100644
--- a/dom/archivereader/ArchiveZipFile.cpp
+++ b/dom/archivereader/ArchiveZipFile.cpp
@@ -12,6 +12,7 @@
#include "mozilla/Attributes.h"
#include "mozilla/dom/File.h"
+using namespace mozilla;
using namespace mozilla::dom;
USING_ARCHIVEREADER_NAMESPACE
diff --git a/dom/archivereader/moz.build b/dom/archivereader/moz.build
index 57dbfa121..a5d853c91 100644
--- a/dom/archivereader/moz.build
+++ b/dom/archivereader/moz.build
@@ -13,7 +13,7 @@ EXPORTS.mozilla.dom.archivereader += [
'ArchiveZipFile.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'ArchiveEvent.cpp',
'ArchiveReader.cpp',
'ArchiveRequest.cpp',
diff --git a/dom/audiochannel/moz.build b/dom/audiochannel/moz.build
index 46923db3c..547cce24a 100644
--- a/dom/audiochannel/moz.build
+++ b/dom/audiochannel/moz.build
@@ -16,14 +16,12 @@ EXPORTS += [
'AudioChannelService.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'AudioChannelAgent.cpp',
'AudioChannelService.cpp',
]
-LOCAL_INCLUDES += [
- '/dom/base/',
-]
+LOCAL_INCLUDES += ['/dom/base/']
include('/ipc/chromium/chromium-config.mozbuild')
diff --git a/dom/broadcastchannel/moz.build b/dom/broadcastchannel/moz.build
index a076331e5..c9d687cbc 100644
--- a/dom/broadcastchannel/moz.build
+++ b/dom/broadcastchannel/moz.build
@@ -8,20 +8,16 @@ EXPORTS.mozilla.dom += [
'BroadcastChannel.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'BroadcastChannel.cpp',
'BroadcastChannelChild.cpp',
'BroadcastChannelParent.cpp',
'BroadcastChannelService.cpp',
]
-IPDL_SOURCES += [
- 'PBroadcastChannel.ipdl',
-]
+IPDL_SOURCES += ['PBroadcastChannel.ipdl']
-LOCAL_INCLUDES += [
- '../workers',
-]
+LOCAL_INCLUDES += ['../workers']
MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
BROWSER_CHROME_MANIFESTS += ['tests/browser.ini']
diff --git a/dom/cache/CacheOpParent.cpp b/dom/cache/CacheOpParent.cpp
index 992ee82a7..37fcbc0f3 100644
--- a/dom/cache/CacheOpParent.cpp
+++ b/dom/cache/CacheOpParent.cpp
@@ -12,6 +12,7 @@
#include "mozilla/dom/cache/SavedTypes.h"
#include "mozilla/ipc/FileDescriptorSetParent.h"
#include "mozilla/ipc/InputStreamUtils.h"
+#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/SendStream.h"
namespace mozilla {
diff --git a/dom/cache/CacheStorage.cpp b/dom/cache/CacheStorage.cpp
index 937e3826f..a0f486445 100644
--- a/dom/cache/CacheStorage.cpp
+++ b/dom/cache/CacheStorage.cpp
@@ -7,6 +7,7 @@
#include "mozilla/dom/cache/CacheStorage.h"
#include "mozilla/Unused.h"
+#include "mozilla/dom/CacheBinding.h"
#include "mozilla/dom/CacheStorageBinding.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/Response.h"
@@ -29,6 +30,8 @@
#include "nsURLParsers.h"
#include "WorkerPrivate.h"
+using namespace mozilla::dom;
+
namespace mozilla {
namespace dom {
namespace cache {
diff --git a/dom/cache/CacheStreamControlChild.cpp b/dom/cache/CacheStreamControlChild.cpp
index b7ca3a0e7..978019ab6 100644
--- a/dom/cache/CacheStreamControlChild.cpp
+++ b/dom/cache/CacheStreamControlChild.cpp
@@ -11,6 +11,7 @@
#include "mozilla/dom/cache/CacheTypes.h"
#include "mozilla/dom/cache/ReadStream.h"
#include "mozilla/ipc/FileDescriptorSetChild.h"
+#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/ipc/PFileDescriptorSetChild.h"
#include "nsISupportsImpl.h"
diff --git a/dom/cache/CacheStreamControlParent.cpp b/dom/cache/CacheStreamControlParent.cpp
index 54eef01d8..02f2fd2d3 100644
--- a/dom/cache/CacheStreamControlParent.cpp
+++ b/dom/cache/CacheStreamControlParent.cpp
@@ -11,6 +11,7 @@
#include "mozilla/dom/cache/ReadStream.h"
#include "mozilla/dom/cache/StreamList.h"
#include "mozilla/ipc/FileDescriptorSetParent.h"
+#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundParent.h"
#include "mozilla/ipc/PFileDescriptorSetParent.h"
#include "nsISupportsImpl.h"
@@ -20,6 +21,7 @@ namespace dom {
namespace cache {
using mozilla::dom::OptionalFileDescriptorSet;
+using mozilla::ipc::AutoIPCStream;
using mozilla::ipc::FileDescriptor;
using mozilla::ipc::FileDescriptorSetParent;
using mozilla::ipc::PFileDescriptorSetParent;
diff --git a/dom/cache/ReadStream.h b/dom/cache/ReadStream.h
index 824cedb02..6744f30c2 100644
--- a/dom/cache/ReadStream.h
+++ b/dom/cache/ReadStream.h
@@ -12,9 +12,12 @@
#include "nsID.h"
#include "nsIInputStream.h"
#include "nsISupportsImpl.h"
+#include "mozilla/ErrorResult.h"
#include "mozilla/RefPtr.h"
#include "nsTArrayForwardDeclare.h"
+using namespace mozilla;
+
namespace mozilla {
namespace ipc {
class AutoIPCStream;
diff --git a/dom/cache/TypeUtils.cpp b/dom/cache/TypeUtils.cpp
index 2d4cb30eb..f8c5cd7be 100644
--- a/dom/cache/TypeUtils.cpp
+++ b/dom/cache/TypeUtils.cpp
@@ -14,6 +14,7 @@
#include "mozilla/dom/cache/CacheTypes.h"
#include "mozilla/dom/cache/ReadStream.h"
#include "mozilla/ipc/BackgroundChild.h"
+#include "mozilla/ipc/IPCStreamUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"
#include "mozilla/ipc/PFileDescriptorSetChild.h"
#include "mozilla/ipc/InputStreamUtils.h"
diff --git a/dom/cache/moz.build b/dom/cache/moz.build
index 66f9f30fd..a536e5d75 100644
--- a/dom/cache/moz.build
+++ b/dom/cache/moz.build
@@ -38,7 +38,7 @@ EXPORTS.mozilla.dom.cache += [
'TypeUtils.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'Action.cpp',
'ActorChild.cpp',
'AutoUtils.cpp',
diff --git a/dom/canvas/CanvasImageCache.cpp b/dom/canvas/CanvasImageCache.cpp
index 82b3f277c..2e4e90d33 100644
--- a/dom/canvas/CanvasImageCache.cpp
+++ b/dom/canvas/CanvasImageCache.cpp
@@ -7,6 +7,7 @@
#include "nsAutoPtr.h"
#include "nsIImageLoadingContent.h"
#include "nsExpirationTracker.h"
+#include "imgIContainer.h"
#include "imgIRequest.h"
#include "mozilla/dom/Element.h"
#include "nsTHashtable.h"
diff --git a/dom/canvas/CanvasRenderingContextHelper.cpp b/dom/canvas/CanvasRenderingContextHelper.cpp
index 61317fb51..229801ffa 100644
--- a/dom/canvas/CanvasRenderingContextHelper.cpp
+++ b/dom/canvas/CanvasRenderingContextHelper.cpp
@@ -4,6 +4,8 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "CanvasRenderingContextHelper.h"
+
+#include "CanvasUtils.h"
#include "ImageBitmapRenderingContext.h"
#include "ImageEncoder.h"
#include "mozilla/dom/CanvasRenderingContext2D.h"
diff --git a/dom/canvas/ImageBitmap.cpp b/dom/canvas/ImageBitmap.cpp
index 6efe1b318..e4b145d46 100644
--- a/dom/canvas/ImageBitmap.cpp
+++ b/dom/canvas/ImageBitmap.cpp
@@ -5,19 +5,29 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/ImageBitmap.h"
+
#include "mozilla/CheckedInt.h"
+#include "mozilla/dom/File.h" // for Blob
+#include "mozilla/dom/HTMLImageElement.h"
#include "mozilla/dom/ImageBitmapBinding.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/StructuredCloneTags.h"
+#include "mozilla/dom/UnionTypes.h" // for ArrayBufferViewOrArrayBuffer
#include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/dom/WorkerRunnable.h"
-#include "mozilla/gfx/2D.h"
+#include "CanvasRenderingContext2D.h"
+#include "gfxUtils.h"
#include "ImageBitmapColorUtils.h"
#include "ImageBitmapUtils.h"
+#include "ImageData.h"
+#include "ImageLayers.h"
#include "ImageUtils.h"
#include "imgTools.h"
#include "libyuv.h"
+#include "nsLayoutUtils.h"
+#include "OffscreenCanvas.h"
+using namespace mozilla::dom;
using namespace mozilla::gfx;
using namespace mozilla::layers;
diff --git a/dom/canvas/ImageBitmap.h b/dom/canvas/ImageBitmap.h
index 25084b6ac..22953e541 100644
--- a/dom/canvas/ImageBitmap.h
+++ b/dom/canvas/ImageBitmap.h
@@ -13,7 +13,9 @@
#include "mozilla/gfx/Rect.h"
#include "mozilla/Maybe.h"
#include "mozilla/UniquePtr.h"
+#include "CanvasRenderingContextHelper.h"
#include "nsCycleCollectionParticipant.h"
+#include "nsIGlobalObject.h"
struct JSContext;
struct JSStructuredCloneReader;
diff --git a/dom/canvas/ImageBitmapColorUtils.cpp b/dom/canvas/ImageBitmapColorUtils.cpp
index 2b65c1f10..4ef4ade86 100644
--- a/dom/canvas/ImageBitmapColorUtils.cpp
+++ b/dom/canvas/ImageBitmapColorUtils.cpp
@@ -6,6 +6,9 @@
#include "ImageBitmapColorUtils.h"
+#include "js/LegacyIntTypes.h"
+#include <cmath>
+
namespace mozilla {
namespace dom {
diff --git a/dom/canvas/ImageBitmapRenderingContext.cpp b/dom/canvas/ImageBitmapRenderingContext.cpp
index ad313906a..9c7af2522 100644
--- a/dom/canvas/ImageBitmapRenderingContext.cpp
+++ b/dom/canvas/ImageBitmapRenderingContext.cpp
@@ -4,9 +4,19 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "ImageBitmapRenderingContext.h"
+
#include "mozilla/dom/ImageBitmapRenderingContextBinding.h"
+#include "mozilla/gfx/2D.h"
+#include "mozilla/gfx/DataSurfaceHelpers.h"
+#include "ImageBitmap.h"
#include "ImageContainer.h"
+#include "ImageEncoder.h"
#include "ImageLayers.h"
+#include "imgIEncoder.h"
+#include "Layers.h"
+
+using namespace mozilla::gfx;
+using namespace mozilla::layers;
namespace mozilla {
namespace dom {
diff --git a/dom/canvas/ImageBitmapUtils.h b/dom/canvas/ImageBitmapUtils.h
index 39be43d8a..bc8d6ad15 100644
--- a/dom/canvas/ImageBitmapUtils.h
+++ b/dom/canvas/ImageBitmapUtils.h
@@ -7,6 +7,7 @@
#ifndef mozilla_dom_ImageBitmapUtils_h
#define mozilla_dom_ImageBitmapUtils_h
+#include "ImageBitmap.h"
#include "mozilla/UniquePtr.h"
#include "nsTArrayForwardDeclare.h"
diff --git a/dom/canvas/OffscreenCanvas.cpp b/dom/canvas/OffscreenCanvas.cpp
index 0d188c24e..981faf1b1 100644
--- a/dom/canvas/OffscreenCanvas.cpp
+++ b/dom/canvas/OffscreenCanvas.cpp
@@ -6,6 +6,9 @@
#include "OffscreenCanvas.h"
+#include "mozilla/dom/File.h" // for Blob
+#include "mozilla/dom/ImageEncoder.h"
+#include "mozilla/dom/Promise.h"
#include "mozilla/dom/OffscreenCanvasBinding.h"
#include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/dom/WorkerScope.h"
@@ -15,10 +18,15 @@
#include "mozilla/Telemetry.h"
#include "CanvasRenderingContext2D.h"
#include "CanvasUtils.h"
+#include "GLContext.h"
#include "GLScreenBuffer.h"
+#include "ImageBitmap.h"
#include "WebGL1Context.h"
#include "WebGL2Context.h"
+using namespace mozilla::layers;
+using namespace mozilla::dom::workers;
+
namespace mozilla {
namespace dom {
diff --git a/dom/canvas/WebGL2ContextUniforms.cpp b/dom/canvas/WebGL2ContextUniforms.cpp
index 7f8c07332..900f845fd 100644
--- a/dom/canvas/WebGL2ContextUniforms.cpp
+++ b/dom/canvas/WebGL2ContextUniforms.cpp
@@ -11,6 +11,7 @@
#include "WebGLBuffer.h"
#include "WebGLContext.h"
#include "WebGLProgram.h"
+#include "WebGLTransformFeedback.h"
#include "WebGLUniformLocation.h"
#include "WebGLVertexArray.h"
#include "WebGLVertexAttribData.h"
diff --git a/dom/canvas/WebGLContextBuffers.cpp b/dom/canvas/WebGLContextBuffers.cpp
index f53f9d7d7..e787b9914 100644
--- a/dom/canvas/WebGLContextBuffers.cpp
+++ b/dom/canvas/WebGLContextBuffers.cpp
@@ -7,6 +7,7 @@
#include "GLContext.h"
#include "WebGLBuffer.h"
+#include "WebGLTransformFeedback.h"
#include "WebGLVertexArray.h"
#include "mozilla/CheckedInt.h"
diff --git a/dom/canvas/WebGLContextVertices.cpp b/dom/canvas/WebGLContextVertices.cpp
index ba3156693..5daf1102a 100644
--- a/dom/canvas/WebGLContextVertices.cpp
+++ b/dom/canvas/WebGLContextVertices.cpp
@@ -7,6 +7,7 @@
#include "GLContext.h"
#include "mozilla/CheckedInt.h"
+#include "WebGL2Context.h"
#include "WebGLBuffer.h"
#include "WebGLFramebuffer.h"
#include "WebGLProgram.h"
diff --git a/dom/canvas/WebGLExtensionDebugGet.cpp b/dom/canvas/WebGLExtensionDebugGet.cpp
index 39bb3c57a..a849bd17e 100644
--- a/dom/canvas/WebGLExtensionDebugGet.cpp
+++ b/dom/canvas/WebGLExtensionDebugGet.cpp
@@ -6,6 +6,7 @@
#include "WebGLExtensions.h"
#include "mozilla/dom/WebGLRenderingContextBinding.h"
+#include "GLContext.h"
#include "WebGLContext.h"
#include "WebGLContextUtils.h"
diff --git a/dom/canvas/WebGLExtensions.h b/dom/canvas/WebGLExtensions.h
index 7b6b6b54b..595d1c948 100644
--- a/dom/canvas/WebGLExtensions.h
+++ b/dom/canvas/WebGLExtensions.h
@@ -8,7 +8,7 @@
#include "mozilla/AlreadyAddRefed.h"
#include "nsWrapperCache.h"
-#include "WebGLObjectModel.h"
+#include "WebGLContext.h"
#include "WebGLTypes.h"
namespace mozilla {
diff --git a/dom/canvas/WebGLFramebuffer.h b/dom/canvas/WebGLFramebuffer.h
index ac457c098..53e01dfe7 100644
--- a/dom/canvas/WebGLFramebuffer.h
+++ b/dom/canvas/WebGLFramebuffer.h
@@ -12,7 +12,7 @@
#include "mozilla/WeakPtr.h"
#include "nsWrapperCache.h"
-#include "WebGLObjectModel.h"
+#include "WebGLContext.h"
#include "WebGLRenderbuffer.h"
#include "WebGLStrongTypes.h"
#include "WebGLTexture.h"
diff --git a/dom/canvas/WebGLObjectModel.h b/dom/canvas/WebGLObjectModel.h
index 6371c7b03..7c6caf2c4 100644
--- a/dom/canvas/WebGLObjectModel.h
+++ b/dom/canvas/WebGLObjectModel.h
@@ -15,7 +15,6 @@ namespace mozilla {
template<typename> class LinkedList;
class WebGLContext;
-
////
// This class is a mixin for objects that are tied to a specific
diff --git a/dom/canvas/WebGLSampler.h b/dom/canvas/WebGLSampler.h
index 1cf039984..73e550dfe 100644
--- a/dom/canvas/WebGLSampler.h
+++ b/dom/canvas/WebGLSampler.h
@@ -8,6 +8,7 @@
#include "mozilla/LinkedList.h"
#include "nsWrapperCache.h"
+#include "WebGLContext.h"
#include "WebGLObjectModel.h"
#include "WebGLStrongTypes.h"
diff --git a/dom/canvas/WebGLTransformFeedback.h b/dom/canvas/WebGLTransformFeedback.h
index aa57372a5..378794b9f 100644
--- a/dom/canvas/WebGLTransformFeedback.h
+++ b/dom/canvas/WebGLTransformFeedback.h
@@ -6,8 +6,11 @@
#ifndef WEBGL_TRANSFORM_FEEDBACK_H_
#define WEBGL_TRANSFORM_FEEDBACK_H_
+#include <vector>
#include "mozilla/LinkedList.h"
#include "nsWrapperCache.h"
+#include "WebGLBuffer.h"
+#include "WebGLContext.h"
#include "WebGLObjectModel.h"
namespace mozilla {
diff --git a/dom/canvas/WebGLVertexAttribData.cpp b/dom/canvas/WebGLVertexAttribData.cpp
index b5aee18e5..cea78eb14 100644
--- a/dom/canvas/WebGLVertexAttribData.cpp
+++ b/dom/canvas/WebGLVertexAttribData.cpp
@@ -7,6 +7,7 @@
#include "GLContext.h"
#include "WebGLBuffer.h"
+#include "WebGLContext.h"
namespace mozilla {
diff --git a/dom/canvas/WebGLVertexAttribData.h b/dom/canvas/WebGLVertexAttribData.h
index 9d79b4f94..6318b06d2 100644
--- a/dom/canvas/WebGLVertexAttribData.h
+++ b/dom/canvas/WebGLVertexAttribData.h
@@ -7,6 +7,7 @@
#define WEBGL_VERTEX_ATTRIB_DATA_H_
#include "GLDefs.h"
+#include "WebGLBuffer.h"
#include "WebGLObjectModel.h"
namespace mozilla {
diff --git a/dom/canvas/moz.build b/dom/canvas/moz.build
index 6d5e2756f..fe39425ec 100644
--- a/dom/canvas/moz.build
+++ b/dom/canvas/moz.build
@@ -42,7 +42,7 @@ EXPORTS.mozilla.dom += [
]
# Canvas 2D and common sources
-UNIFIED_SOURCES += [
+SOURCES += [
'CanvasImageCache.cpp',
'CanvasRenderingContext2D.cpp',
'CanvasRenderingContextHelper.cpp',
@@ -60,7 +60,7 @@ SOURCES += [
]
# WebGL Sources
-UNIFIED_SOURCES += [
+SOURCES += [
'TexUnpackBlob.cpp',
'WebGL1Context.cpp',
'WebGL1ContextUniforms.cpp',
diff --git a/dom/console/moz.build b/dom/console/moz.build
index 79bd1cf09..82623e442 100644
--- a/dom/console/moz.build
+++ b/dom/console/moz.build
@@ -22,7 +22,7 @@ EXPORTS.mozilla.dom += [
'Console.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'Console.cpp',
'ConsoleReportCollector.cpp',
]
diff --git a/dom/crypto/WebCryptoThreadPool.cpp b/dom/crypto/WebCryptoThreadPool.cpp
index 6a1e78608..a2b8e6239 100644
--- a/dom/crypto/WebCryptoThreadPool.cpp
+++ b/dom/crypto/WebCryptoThreadPool.cpp
@@ -9,6 +9,9 @@
#include "mozilla/Services.h"
#include "mozilla/StaticPtr.h"
#include "nsComponentManagerUtils.h"
+#include "nsContentUtils.h"
+#include "nsNSSComponent.h"
+#include "nsString.h"
#include "nsXPCOMCIDInternal.h"
#include "nsXPCOMPrivate.h"
#include "nsIObserverService.h"
diff --git a/dom/crypto/WebCryptoThreadPool.h b/dom/crypto/WebCryptoThreadPool.h
index 77c4afb24..76bf74708 100644
--- a/dom/crypto/WebCryptoThreadPool.h
+++ b/dom/crypto/WebCryptoThreadPool.h
@@ -7,6 +7,8 @@
#ifndef mozilla_dom_WebCryptoThreadPool_h
#define mozilla_dom_WebCryptoThreadPool_h
+#include "mozilla/Mutex.h"
+#include "nsIObserver.h"
#include "nsIObserverService.h"
#include "nsIThreadPool.h"
diff --git a/dom/crypto/moz.build b/dom/crypto/moz.build
index ba0b5f2cd..eb15a5530 100644
--- a/dom/crypto/moz.build
+++ b/dom/crypto/moz.build
@@ -13,7 +13,7 @@ EXPORTS.mozilla.dom += [
'WebCryptoThreadPool.h'
]
-UNIFIED_SOURCES += [
+SOURCES += [
'CryptoBuffer.cpp',
'CryptoKey.cpp',
'KeyAlgorithmProxy.cpp',
diff --git a/dom/encoding/moz.build b/dom/encoding/moz.build
index 37292d6e5..7dc360aaf 100644
--- a/dom/encoding/moz.build
+++ b/dom/encoding/moz.build
@@ -11,7 +11,7 @@ EXPORTS.mozilla.dom += [
'TextEncoder.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'EncodingUtils.cpp',
'FallbackEncoding.cpp',
'TextDecoder.cpp',
@@ -19,9 +19,8 @@ UNIFIED_SOURCES += [
]
FINAL_LIBRARY = 'xul'
-LOCAL_INCLUDES += [
- '/intl/locale',
-]
+
+LOCAL_INCLUDES += ['/intl/locale']
props2arrays = '/intl/locale/props2arrays.py'
prefixes = (
diff --git a/dom/events/DOMEventTargetHelper.cpp b/dom/events/DOMEventTargetHelper.cpp
index dd9a01d8d..7daf7f7a7 100644
--- a/dom/events/DOMEventTargetHelper.cpp
+++ b/dom/events/DOMEventTargetHelper.cpp
@@ -13,6 +13,7 @@
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/Likely.h"
+#include "mozilla/Unused.h"
namespace mozilla {
diff --git a/dom/events/EventTarget.cpp b/dom/events/EventTarget.cpp
index 6c4cbf2d0..b111b9f9d 100644
--- a/dom/events/EventTarget.cpp
+++ b/dom/events/EventTarget.cpp
@@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/EventListenerManager.h"
+#include "mozilla/dom/Event.h"
#include "mozilla/dom/EventTarget.h"
#include "mozilla/dom/EventTargetBinding.h"
#include "nsThreadUtils.h"
diff --git a/dom/events/IMEContentObserver.h b/dom/events/IMEContentObserver.h
index d2f65e186..e459096d9 100644
--- a/dom/events/IMEContentObserver.h
+++ b/dom/events/IMEContentObserver.h
@@ -7,6 +7,7 @@
#ifndef mozilla_IMEContentObserver_h_
#define mozilla_IMEContentObserver_h_
+#include "ContentEventHandler.h"
#include "mozilla/Attributes.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
diff --git a/dom/events/IMEStateManager.cpp b/dom/events/IMEStateManager.cpp
index 80abad3cc..fd628fb6f 100644
--- a/dom/events/IMEStateManager.cpp
+++ b/dom/events/IMEStateManager.cpp
@@ -18,6 +18,7 @@
#include "mozilla/TextComposition.h"
#include "mozilla/TextEvents.h"
#include "mozilla/Unused.h"
+#include "mozilla/dom/Event.h"
#include "mozilla/dom/HTMLFormElement.h"
#include "mozilla/dom/TabParent.h"
diff --git a/dom/events/TextClause.h b/dom/events/TextClause.h
index 7f85333e8..b9f3c1519 100644
--- a/dom/events/TextClause.h
+++ b/dom/events/TextClause.h
@@ -12,6 +12,7 @@
#include "mozilla/ErrorResult.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "nsCycleCollectionParticipant.h"
+#include "nsPIDOMWindow.h"
#include "nsWrapperCache.h"
namespace mozilla {
diff --git a/dom/events/TouchEvent.cpp b/dom/events/TouchEvent.cpp
index 9b7a74ac2..0656021a0 100644
--- a/dom/events/TouchEvent.cpp
+++ b/dom/events/TouchEvent.cpp
@@ -16,6 +16,8 @@
namespace mozilla {
+using namespace widget;
+
namespace dom {
/******************************************************************************
diff --git a/dom/events/moz.build b/dom/events/moz.build
index ec3813207..661f56c7e 100644
--- a/dom/events/moz.build
+++ b/dom/events/moz.build
@@ -76,7 +76,7 @@ EXPORTS.mozilla.dom += [
if CONFIG['MOZ_WEBSPEECH']:
EXPORTS.mozilla.dom += ['SpeechRecognitionError.h']
-UNIFIED_SOURCES += [
+SOURCES += [
'AnimationEvent.cpp',
'AsyncEventDispatcher.cpp',
'BeforeAfterKeyboardEvent.cpp',
@@ -97,6 +97,7 @@ UNIFIED_SOURCES += [
'EventDispatcher.cpp',
'EventListenerManager.cpp',
'EventListenerService.cpp',
+ 'EventStateManager.cpp',
'EventTarget.cpp',
'FocusEvent.cpp',
'ImageCaptureError.cpp',
@@ -126,13 +127,8 @@ UNIFIED_SOURCES += [
'XULCommandEvent.cpp',
]
-# nsEventStateManager.cpp should be built separately because of Mac OS X headers.
-SOURCES += [
- 'EventStateManager.cpp',
-]
-
if CONFIG['MOZ_WEBSPEECH']:
- UNIFIED_SOURCES += ['SpeechRecognitionError.cpp']
+ SOURCES += ['SpeechRecognitionError.cpp']
include('/ipc/chromium/chromium-config.mozbuild')
diff --git a/dom/fetch/FetchConsumer.h b/dom/fetch/FetchConsumer.h
index a7509a0ae..2b5725342 100644
--- a/dom/fetch/FetchConsumer.h
+++ b/dom/fetch/FetchConsumer.h
@@ -8,11 +8,13 @@
#define mozilla_dom_FetchConsumer_h
#include "Fetch.h"
+#include "nsIInputStream.h"
#include "nsIObserver.h"
#include "nsWeakReference.h"
#include "mozilla/dom/MutableBlobStorage.h"
class nsIThread;
+class nsIInputStreamPump;
namespace mozilla {
namespace dom {
diff --git a/dom/fetch/FetchUtil.cpp b/dom/fetch/FetchUtil.cpp
index 601d99216..b384c4f81 100644
--- a/dom/fetch/FetchUtil.cpp
+++ b/dom/fetch/FetchUtil.cpp
@@ -2,6 +2,7 @@
#include "nsError.h"
#include "nsIUnicodeDecoder.h"
+#include "nsNetUtil.h"
#include "nsString.h"
#include "mozilla/dom/EncodingUtils.h"
diff --git a/dom/fetch/InternalRequest.cpp b/dom/fetch/InternalRequest.cpp
index b2631da6a..65f8095e2 100644
--- a/dom/fetch/InternalRequest.cpp
+++ b/dom/fetch/InternalRequest.cpp
@@ -8,6 +8,7 @@
#include "nsIContentPolicy.h"
#include "nsIDocument.h"
+#include "nsIHttpChannelInternal.h"
#include "nsStreamUtils.h"
#include "mozilla/ErrorResult.h"
diff --git a/dom/fetch/InternalResponse.cpp b/dom/fetch/InternalResponse.cpp
index cb7d74597..1b1ae13e3 100644
--- a/dom/fetch/InternalResponse.cpp
+++ b/dom/fetch/InternalResponse.cpp
@@ -7,6 +7,7 @@
#include "InternalResponse.h"
#include "mozilla/Assertions.h"
+#include "mozilla/dom/FetchTypes.h"
#include "mozilla/dom/InternalHeaders.h"
#include "mozilla/dom/cache/CacheTypes.h"
#include "mozilla/ipc/PBackgroundSharedTypes.h"
diff --git a/dom/fetch/InternalResponse.h b/dom/fetch/InternalResponse.h
index 35467836a..0801e3250 100644
--- a/dom/fetch/InternalResponse.h
+++ b/dom/fetch/InternalResponse.h
@@ -12,6 +12,7 @@
#include "mozilla/dom/ResponseBinding.h"
#include "mozilla/dom/ChannelInfo.h"
+#include "mozilla/dom/InternalHeaders.h"
#include "mozilla/UniquePtr.h"
namespace mozilla {
diff --git a/dom/fetch/Request.cpp b/dom/fetch/Request.cpp
index 7ca5b43c4..6a7885b1a 100644
--- a/dom/fetch/Request.cpp
+++ b/dom/fetch/Request.cpp
@@ -7,6 +7,7 @@
#include "Request.h"
#include "nsIURI.h"
+#include "nsNetUtil.h"
#include "nsPIDOMWindow.h"
#include "mozilla/ErrorResult.h"
@@ -15,14 +16,18 @@
#include "mozilla/dom/FetchUtil.h"
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/URL.h"
-#include "mozilla/dom/WorkerPrivate.h"
#include "mozilla/Unused.h"
#include "WorkerPrivate.h"
+#include "WorkerRunnable.h"
+#include "WorkerScope.h"
+#include "Workers.h"
namespace mozilla {
namespace dom {
+using namespace workers;
+
NS_IMPL_CYCLE_COLLECTING_ADDREF(Request)
NS_IMPL_CYCLE_COLLECTING_RELEASE(Request)
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Request, mOwner, mHeaders)
@@ -237,14 +242,14 @@ GetRequestURLFromWorker(const GlobalObject& aGlobal, const nsAString& aInput,
}
}
-class ReferrerSameOriginChecker final : public workers::WorkerMainThreadRunnable
+class ReferrerSameOriginChecker final : public WorkerMainThreadRunnable
{
public:
ReferrerSameOriginChecker(workers::WorkerPrivate* aWorkerPrivate,
const nsAString& aReferrerURL,
nsresult& aResult)
- : workers::WorkerMainThreadRunnable(aWorkerPrivate,
- NS_LITERAL_CSTRING("Fetch :: Referrer same origin check")),
+ : WorkerMainThreadRunnable(aWorkerPrivate,
+ NS_LITERAL_CSTRING("Fetch :: Referrer same origin check")),
mReferrerURL(aReferrerURL),
mResult(aResult)
{
diff --git a/dom/fetch/Response.cpp b/dom/fetch/Response.cpp
index 3b3ada6d3..e35de0e12 100644
--- a/dom/fetch/Response.cpp
+++ b/dom/fetch/Response.cpp
@@ -8,6 +8,7 @@
#include "nsISupportsImpl.h"
#include "nsIURI.h"
+#include "nsNetUtil.h"
#include "nsPIDOMWindow.h"
#include "mozilla/ErrorResult.h"
diff --git a/dom/fetch/moz.build b/dom/fetch/moz.build
index fb2279fe7..be820ab57 100644
--- a/dom/fetch/moz.build
+++ b/dom/fetch/moz.build
@@ -19,17 +19,20 @@ EXPORTS.mozilla.dom += [
]
UNIFIED_SOURCES += [
- 'ChannelInfo.cpp',
'Fetch.cpp',
'FetchConsumer.cpp',
+ 'Request.cpp',
+ 'Response.cpp',
+]
+
+SOURCES += [
+ 'ChannelInfo.cpp',
'FetchDriver.cpp',
'FetchUtil.cpp',
'Headers.cpp',
'InternalHeaders.cpp',
'InternalRequest.cpp',
'InternalResponse.cpp',
- 'Request.cpp',
- 'Response.cpp',
]
IPDL_SOURCES += [
diff --git a/dom/filehandle/moz.build b/dom/filehandle/moz.build
index b4e3b64c0..37e5c22a7 100644
--- a/dom/filehandle/moz.build
+++ b/dom/filehandle/moz.build
@@ -18,7 +18,7 @@ EXPORTS.mozilla.dom += [
'MutableFileBase.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'ActorsChild.cpp',
'ActorsParent.cpp',
'FileHandleBase.cpp',
diff --git a/dom/filesystem/FileSystemBase.cpp b/dom/filesystem/FileSystemBase.cpp
index f44f4fbf1..b19e12738 100644
--- a/dom/filesystem/FileSystemBase.cpp
+++ b/dom/filesystem/FileSystemBase.cpp
@@ -7,6 +7,7 @@
#include "mozilla/dom/FileSystemBase.h"
#include "nsCharSeparatedTokenizer.h"
+#include "FileSystemUtils.h"
#include "OSFileSystem.h"
namespace mozilla {
diff --git a/dom/filesystem/FileSystemRequestParent.cpp b/dom/filesystem/FileSystemRequestParent.cpp
index 0b9d6c18a..95a316b96 100644
--- a/dom/filesystem/FileSystemRequestParent.cpp
+++ b/dom/filesystem/FileSystemRequestParent.cpp
@@ -9,12 +9,15 @@
#include "GetDirectoryListingTask.h"
#include "GetFileOrDirectoryTask.h"
+#include "GetFilesTask.h"
+#include "OSFileSystem.h"
#include "mozilla/AppProcessChecker.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/FileSystemBase.h"
#include "mozilla/dom/FileSystemSecurity.h"
#include "mozilla/ipc/BackgroundParent.h"
+#include "mozilla/Preferences.h"
#include "mozilla/Unused.h"
#include "nsProxyRelease.h"
diff --git a/dom/filesystem/FileSystemSecurity.cpp b/dom/filesystem/FileSystemSecurity.cpp
index b3d425817..7c70374a0 100644
--- a/dom/filesystem/FileSystemSecurity.cpp
+++ b/dom/filesystem/FileSystemSecurity.cpp
@@ -8,6 +8,9 @@
#include "FileSystemUtils.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticPtr.h"
+#include "mozilla/ipc/BackgroundParent.h"
+
+using namespace mozilla::ipc;
namespace mozilla {
namespace dom {
diff --git a/dom/filesystem/FileSystemTaskBase.cpp b/dom/filesystem/FileSystemTaskBase.cpp
index 481002b7d..e9eed90ee 100644
--- a/dom/filesystem/FileSystemTaskBase.cpp
+++ b/dom/filesystem/FileSystemTaskBase.cpp
@@ -19,6 +19,8 @@
#include "mozilla/Unused.h"
#include "nsProxyRelease.h"
+using namespace mozilla::ipc;
+
namespace mozilla {
namespace dom {
diff --git a/dom/filesystem/FileSystemUtils.cpp b/dom/filesystem/FileSystemUtils.cpp
index 872e049ee..56293cbda 100644
--- a/dom/filesystem/FileSystemUtils.cpp
+++ b/dom/filesystem/FileSystemUtils.cpp
@@ -5,6 +5,9 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/FileSystemUtils.h"
+#include "nsCharSeparatedTokenizer.h"
+#include "nsString.h"
+#include "nsTArray.h"
namespace mozilla {
namespace dom {
diff --git a/dom/filesystem/FileSystemUtils.h b/dom/filesystem/FileSystemUtils.h
index ae302e07c..42fc5573c 100644
--- a/dom/filesystem/FileSystemUtils.h
+++ b/dom/filesystem/FileSystemUtils.h
@@ -7,6 +7,8 @@
#ifndef mozilla_dom_FileSystemUtils_h
#define mozilla_dom_FileSystemUtils_h
+#include "nsString.h"
+
class nsIFile;
namespace mozilla {
diff --git a/dom/filesystem/GetDirectoryListingTask.cpp b/dom/filesystem/GetDirectoryListingTask.cpp
index e3ac2933f..999366fe8 100644
--- a/dom/filesystem/GetDirectoryListingTask.cpp
+++ b/dom/filesystem/GetDirectoryListingTask.cpp
@@ -16,10 +16,13 @@
#include "mozilla/dom/UnionTypes.h"
#include "mozilla/dom/ipc/BlobChild.h"
#include "mozilla/dom/ipc/BlobParent.h"
+#include "mozilla/ipc/BackgroundParent.h"
#include "nsIFile.h"
#include "nsISimpleEnumerator.h"
#include "nsStringGlue.h"
+using namespace mozilla::ipc;
+
namespace mozilla {
namespace dom {
diff --git a/dom/filesystem/GetFileOrDirectoryTask.cpp b/dom/filesystem/GetFileOrDirectoryTask.cpp
index f71976503..446c641f4 100644
--- a/dom/filesystem/GetFileOrDirectoryTask.cpp
+++ b/dom/filesystem/GetFileOrDirectoryTask.cpp
@@ -14,9 +14,12 @@
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/ipc/BlobChild.h"
#include "mozilla/dom/ipc/BlobParent.h"
+#include "mozilla/ipc/BackgroundParent.h"
#include "nsIFile.h"
#include "nsStringGlue.h"
+using namespace mozilla::ipc;
+
namespace mozilla {
namespace dom {
diff --git a/dom/filesystem/GetFilesHelper.cpp b/dom/filesystem/GetFilesHelper.cpp
index 21d228a60..c4cbe7f14 100644
--- a/dom/filesystem/GetFilesHelper.cpp
+++ b/dom/filesystem/GetFilesHelper.cpp
@@ -5,8 +5,16 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GetFilesHelper.h"
+#include "FileSystemUtils.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/ContentParent.h"
+#include "mozilla/dom/Directory.h"
+#include "mozilla/dom/Promise.h"
+#include "mozilla/dom/UnionTypes.h"
+#include "mozilla/dom/ipc/BlobParent.h"
+#include "nsContentUtils.h"
+#include "nsNetCID.h"
+#include "nsISimpleEnumerator.h"
#include "nsProxyRelease.h"
namespace mozilla {
diff --git a/dom/filesystem/GetFilesHelper.h b/dom/filesystem/GetFilesHelper.h
index a1bb1b27a..371c73ef2 100644
--- a/dom/filesystem/GetFilesHelper.h
+++ b/dom/filesystem/GetFilesHelper.h
@@ -9,9 +9,12 @@
#include "mozilla/Mutex.h"
#include "mozilla/RefPtr.h"
+#include "mozilla/dom/File.h"
+#include "nsClassHashtable.h"
#include "nsCycleCollectionTraversalCallback.h"
#include "nsTArray.h"
#include "nsTHashtable.h"
+#include "nsThreadUtils.h"
class nsIGlobalObject;
diff --git a/dom/filesystem/GetFilesTask.cpp b/dom/filesystem/GetFilesTask.cpp
index 6682fb7d3..b283eec54 100644
--- a/dom/filesystem/GetFilesTask.cpp
+++ b/dom/filesystem/GetFilesTask.cpp
@@ -15,9 +15,12 @@
#include "mozilla/dom/Promise.h"
#include "mozilla/dom/ipc/BlobChild.h"
#include "mozilla/dom/ipc/BlobParent.h"
+#include "mozilla/ipc/BackgroundParent.h"
#include "nsIFile.h"
#include "nsStringGlue.h"
+using namespace mozilla::ipc;
+
namespace mozilla {
namespace dom {
diff --git a/dom/filesystem/moz.build b/dom/filesystem/moz.build
index 6e516c3a7..1b6a8d3ca 100644
--- a/dom/filesystem/moz.build
+++ b/dom/filesystem/moz.build
@@ -19,7 +19,7 @@ EXPORTS.mozilla.dom += [
'OSFileSystem.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'Directory.cpp',
'FileSystemBase.cpp',
'FileSystemRequestParent.cpp',
diff --git a/dom/gamepad/GamepadManager.cpp b/dom/gamepad/GamepadManager.cpp
index e17829652..0c05b3ddb 100644
--- a/dom/gamepad/GamepadManager.cpp
+++ b/dom/gamepad/GamepadManager.cpp
@@ -20,7 +20,6 @@
#include "mozilla/StaticPtr.h"
#include "nsAutoPtr.h"
-#include "nsGlobalWindow.h"
#include "nsIDOMEvent.h"
#include "nsIDOMDocument.h"
#include "nsIDOMWindow.h"
diff --git a/dom/gamepad/GamepadManager.h b/dom/gamepad/GamepadManager.h
index a772221ca..38fdfc342 100644
--- a/dom/gamepad/GamepadManager.h
+++ b/dom/gamepad/GamepadManager.h
@@ -7,11 +7,14 @@
#ifndef mozilla_dom_GamepadManager_h_
#define mozilla_dom_GamepadManager_h_
+#include "nsGlobalWindow.h"
#include "nsIIPCBackgroundChildCreateCallback.h"
#include "nsIObserver.h"
// Needed for GamepadMappingType
#include "mozilla/dom/GamepadBinding.h"
+#include "mozilla/dom/GamepadPoseState.h"
#include "mozilla/dom/GamepadServiceType.h"
+#include "nsRefPtrHashtable.h"
class nsGlobalWindow;
diff --git a/dom/gamepad/GamepadPlatformService.h b/dom/gamepad/GamepadPlatformService.h
index 0a61281e4..77a08ae17 100644
--- a/dom/gamepad/GamepadPlatformService.h
+++ b/dom/gamepad/GamepadPlatformService.h
@@ -15,6 +15,7 @@
namespace mozilla {
namespace dom {
+class GamepadChangeEvent;
class GamepadEventChannelParent;
// Platform Service for building and transmitting IPDL messages
diff --git a/dom/gamepad/GamepadPoseState.h b/dom/gamepad/GamepadPoseState.h
index 958b26139..dc5903aba 100644
--- a/dom/gamepad/GamepadPoseState.h
+++ b/dom/gamepad/GamepadPoseState.h
@@ -2,6 +2,8 @@
#ifndef mozilla_dom_gamepad_GamepadPoseState_h_
#define mozilla_dom_gamepad_GamepadPoseState_h_
+#include "mozilla/TypedEnumBits.h"
+
namespace mozilla{
namespace dom{
diff --git a/dom/gamepad/GamepadServiceTest.cpp b/dom/gamepad/GamepadServiceTest.cpp
index 89429b52a..e8ec46cfe 100644
--- a/dom/gamepad/GamepadServiceTest.cpp
+++ b/dom/gamepad/GamepadServiceTest.cpp
@@ -22,6 +22,8 @@
#include "nsIObserver.h"
#include "nsIObserverService.h"
+using namespace mozilla::ipc;
+
namespace mozilla {
namespace dom {
diff --git a/dom/gamepad/android/AndroidGamepad.cpp b/dom/gamepad/android/AndroidGamepad.cpp
index 706d02617..6ed1ef2ee 100644
--- a/dom/gamepad/android/AndroidGamepad.cpp
+++ b/dom/gamepad/android/AndroidGamepad.cpp
@@ -7,6 +7,7 @@
#include "GeneratedJNIWrappers.h"
#include "GeneratedJNINatives.h"
#include "nsThreadUtils.h"
+#include "mozilla/dom/Gamepad.h"
namespace mozilla {
namespace dom {
diff --git a/dom/gamepad/cocoa/CocoaGamepad.cpp b/dom/gamepad/cocoa/CocoaGamepad.cpp
index e7c986e22..7fcf48532 100644
--- a/dom/gamepad/cocoa/CocoaGamepad.cpp
+++ b/dom/gamepad/cocoa/CocoaGamepad.cpp
@@ -7,8 +7,10 @@
// mostly derived from the Allegro source code at:
// http://alleg.svn.sourceforge.net/viewvc/alleg/allegro/branches/4.9/src/macosx/hidjoy.m?revision=13760&view=markup
+#include "mozilla/dom/Gamepad.h"
#include "mozilla/dom/GamepadPlatformService.h"
#include "mozilla/ArrayUtils.h"
+#include "mozilla/Unused.h"
#include "nsThreadUtils.h"
#include <CoreFoundation/CoreFoundation.h>
#include <IOKit/hid/IOHIDBase.h>
diff --git a/dom/gamepad/ipc/GamepadEventChannelParent.cpp b/dom/gamepad/ipc/GamepadEventChannelParent.cpp
index c3c8fd2c8..806081789 100644
--- a/dom/gamepad/ipc/GamepadEventChannelParent.cpp
+++ b/dom/gamepad/ipc/GamepadEventChannelParent.cpp
@@ -1,9 +1,13 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
+
#include "GamepadEventChannelParent.h"
+
#include "GamepadPlatformService.h"
+#include "mozilla/Unused.h"
#include "mozilla/dom/GamepadMonitoring.h"
+#include "mozilla/ipc/BackgroundParent.h"
#include "nsThreadUtils.h"
namespace mozilla {
diff --git a/dom/gamepad/ipc/GamepadTestChannelParent.cpp b/dom/gamepad/ipc/GamepadTestChannelParent.cpp
index 421447fe0..9730f7d16 100644
--- a/dom/gamepad/ipc/GamepadTestChannelParent.cpp
+++ b/dom/gamepad/ipc/GamepadTestChannelParent.cpp
@@ -5,6 +5,7 @@
#include "GamepadTestChannelParent.h"
#include "mozilla/dom/GamepadPlatformService.h"
+#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/Unused.h"
namespace mozilla {
diff --git a/dom/gamepad/linux/LinuxGamepad.cpp b/dom/gamepad/linux/LinuxGamepad.cpp
index c45f4174a..8c6e8ea75 100644
--- a/dom/gamepad/linux/LinuxGamepad.cpp
+++ b/dom/gamepad/linux/LinuxGamepad.cpp
@@ -19,6 +19,7 @@
#include <sys/ioctl.h>
#include <unistd.h>
#include "nscore.h"
+#include "mozilla/dom/Gamepad.h"
#include "mozilla/dom/GamepadPlatformService.h"
#include "udev.h"
diff --git a/dom/gamepad/moz.build b/dom/gamepad/moz.build
index a809d1eba..81ff37631 100644
--- a/dom/gamepad/moz.build
+++ b/dom/gamepad/moz.build
@@ -31,7 +31,7 @@ if CONFIG['MOZ_GAMEPAD']:
'ipc/GamepadTestChannelParent.h'
]
- UNIFIED_SOURCES = [
+ SOURCES = [
'Gamepad.cpp',
'GamepadButton.cpp',
'GamepadManager.cpp',
@@ -46,23 +46,23 @@ if CONFIG['MOZ_GAMEPAD']:
]
if CONFIG['MOZ_GAMEPAD_BACKEND'] == 'stub':
- UNIFIED_SOURCES += [
+ SOURCES += [
'fallback/FallbackGamepad.cpp'
]
elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'cocoa':
- UNIFIED_SOURCES += [
+ SOURCES += [
'cocoa/CocoaGamepad.cpp'
]
elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'windows':
- UNIFIED_SOURCES += [
+ SOURCES += [
'windows/WindowsGamepad.cpp'
]
elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'linux':
- UNIFIED_SOURCES += [
+ SOURCES += [
'linux/LinuxGamepad.cpp'
]
elif CONFIG['MOZ_GAMEPAD_BACKEND'] == 'android':
- UNIFIED_SOURCES += [
+ SOURCES += [
'android/AndroidGamepad.cpp'
]
diff --git a/dom/gamepad/windows/WindowsGamepad.cpp b/dom/gamepad/windows/WindowsGamepad.cpp
index e1965c00c..ddab2f28c 100644
--- a/dom/gamepad/windows/WindowsGamepad.cpp
+++ b/dom/gamepad/windows/WindowsGamepad.cpp
@@ -24,6 +24,7 @@
#include "mozilla/Services.h"
#include "mozilla/ipc/BackgroundParent.h"
+#include "mozilla/dom/Gamepad.h"
#include "mozilla/dom/GamepadPlatformService.h"
namespace {
diff --git a/dom/geolocation/moz.build b/dom/geolocation/moz.build
index 4339d5a7f..8ac79e8b3 100644
--- a/dom/geolocation/moz.build
+++ b/dom/geolocation/moz.build
@@ -13,7 +13,7 @@ SOURCES += [
'nsGeolocation.cpp',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'MLSFallback.cpp',
'nsGeoPosition.cpp',
]
diff --git a/dom/geolocation/nsGeoPosition.h b/dom/geolocation/nsGeoPosition.h
index 06b406c32..cefb4ae8d 100644
--- a/dom/geolocation/nsGeoPosition.h
+++ b/dom/geolocation/nsGeoPosition.h
@@ -7,6 +7,7 @@
#ifndef nsGeoPosition_h
#define nsGeoPosition_h
+#include "nsCOMPtr.h"
#include "nsIDOMGeoPositionCoords.h"
#include "nsIDOMGeoPosition.h"
#include "nsString.h"
diff --git a/dom/grid/GridDimension.h b/dom/grid/GridDimension.h
index 7a3373521..ec9635444 100644
--- a/dom/grid/GridDimension.h
+++ b/dom/grid/GridDimension.h
@@ -7,11 +7,13 @@
#ifndef mozilla_dom_GridDimension_h
#define mozilla_dom_GridDimension_h
+#include "mozilla/dom/GridBinding.h"
#include "nsWrapperCache.h"
namespace mozilla {
struct ComputedGridTrackInfo;
+struct ComputedGridLineInfo;
namespace dom {
diff --git a/dom/grid/GridLines.cpp b/dom/grid/GridLines.cpp
index 898885346..2604eff6c 100644
--- a/dom/grid/GridLines.cpp
+++ b/dom/grid/GridLines.cpp
@@ -6,6 +6,7 @@
#include "GridLines.h"
+#include "GridArea.h"
#include "GridDimension.h"
#include "GridLine.h"
#include "mozilla/dom/GridBinding.h"
diff --git a/dom/grid/GridLines.h b/dom/grid/GridLines.h
index 921168204..784fe2d28 100644
--- a/dom/grid/GridLines.h
+++ b/dom/grid/GridLines.h
@@ -7,10 +7,15 @@
#ifndef mozilla_dom_GridLines_h
#define mozilla_dom_GridLines_h
-#include "nsTArray.h"
+#include "mozilla/dom/GridBinding.h"
+#include "nsGridContainerFrame.h"
#include "nsWrapperCache.h"
namespace mozilla {
+
+struct ComputedGridTrackInfo;
+struct ComputedGridLineInfo;
+
namespace dom {
class GridDimension;
diff --git a/dom/grid/moz.build b/dom/grid/moz.build
index 96d5c3151..62025c98e 100644
--- a/dom/grid/moz.build
+++ b/dom/grid/moz.build
@@ -16,7 +16,7 @@ EXPORTS.mozilla.dom += [
'GridTracks.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'Grid.cpp',
'GridArea.cpp',
'GridDimension.cpp',
diff --git a/dom/html/HTMLBodyElement.cpp b/dom/html/HTMLBodyElement.cpp
index 6230cb6ca..ee1bced02 100644
--- a/dom/html/HTMLBodyElement.cpp
+++ b/dom/html/HTMLBodyElement.cpp
@@ -7,6 +7,7 @@
#include "HTMLBodyElement.h"
#include "mozilla/dom/HTMLBodyElementBinding.h"
#include "nsAttrValueInlines.h"
+#include "nsContentUtils.h"
#include "nsGkAtoms.h"
#include "nsStyleConsts.h"
#include "nsPresContext.h"
diff --git a/dom/html/HTMLFrameSetElement.cpp b/dom/html/HTMLFrameSetElement.cpp
index 6d39caa19..5d49cd78e 100644
--- a/dom/html/HTMLFrameSetElement.cpp
+++ b/dom/html/HTMLFrameSetElement.cpp
@@ -7,6 +7,7 @@
#include "HTMLFrameSetElement.h"
#include "mozilla/dom/HTMLFrameSetElementBinding.h"
#include "mozilla/dom/EventHandlerBinding.h"
+#include "nsContentUtils.h"
#include "nsGlobalWindow.h"
#include "mozilla/UniquePtrExtensions.h"
diff --git a/dom/html/HTMLLabelElement.cpp b/dom/html/HTMLLabelElement.cpp
index d1c037336..ec36c8b99 100644
--- a/dom/html/HTMLLabelElement.cpp
+++ b/dom/html/HTMLLabelElement.cpp
@@ -8,6 +8,7 @@
* Implementation of HTML <label> elements.
*/
#include "HTMLLabelElement.h"
+#include "HTMLFormElement.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/dom/HTMLLabelElementBinding.h"
diff --git a/dom/html/HTMLMetaElement.cpp b/dom/html/HTMLMetaElement.cpp
index 47effa2bc..de7dc184c 100644
--- a/dom/html/HTMLMetaElement.cpp
+++ b/dom/html/HTMLMetaElement.cpp
@@ -11,6 +11,7 @@
#include "nsContentUtils.h"
#include "nsStyleConsts.h"
#include "nsIContentSecurityPolicy.h"
+#include "nsIDOMDocument.h"
NS_IMPL_NS_NEW_HTML_ELEMENT(Meta)
diff --git a/dom/html/ValidityState.h b/dom/html/ValidityState.h
index 4dbb94aad..adbd86c1d 100644
--- a/dom/html/ValidityState.h
+++ b/dom/html/ValidityState.h
@@ -11,6 +11,7 @@
#include "nsIConstraintValidation.h"
#include "nsWrapperCache.h"
#include "js/TypeDecls.h"
+#include "nsCOMPtr.h"
namespace mozilla {
namespace dom {
diff --git a/dom/html/moz.build b/dom/html/moz.build
index c86c169b5..82d6e07b3 100644
--- a/dom/html/moz.build
+++ b/dom/html/moz.build
@@ -122,7 +122,7 @@ EXPORTS.mozilla.dom += [
'ValidityState.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'HTMLAllCollection.cpp',
'HTMLAnchorElement.cpp',
'HTMLAreaElement.cpp',
@@ -206,6 +206,7 @@ UNIFIED_SOURCES += [
'nsIConstraintValidation.cpp',
'nsRadioVisitor.cpp',
'nsTextEditorState.cpp',
+ 'PluginDocument.cpp',
'RadioNodeList.cpp',
'TextTrackManager.cpp',
'TimeRanges.cpp',
@@ -213,11 +214,6 @@ UNIFIED_SOURCES += [
'VideoDocument.cpp',
]
-SOURCES += [
- # Includes npapi.h.
- 'PluginDocument.cpp',
-]
-
EXTRA_COMPONENTS += [
'htmlMenuBuilder.js',
'htmlMenuBuilder.manifest'
diff --git a/dom/html/nsBrowserElement.cpp b/dom/html/nsBrowserElement.cpp
index 858d1c7cb..1c2f00c15 100644
--- a/dom/html/nsBrowserElement.cpp
+++ b/dom/html/nsBrowserElement.cpp
@@ -18,8 +18,10 @@
#include "mozIApplication.h"
#include "nsComponentManagerUtils.h"
+#include "nsContentUtils.h"
#include "nsFrameLoader.h"
#include "nsIAppsService.h"
+#include "nsIDOMDocument.h"
#include "nsIDOMDOMRequest.h"
#include "nsIDOMElement.h"
#include "nsIMozBrowserFrame.h"
diff --git a/dom/html/nsHTMLDocument.cpp b/dom/html/nsHTMLDocument.cpp
index 0f2d90673..fc5268acc 100644
--- a/dom/html/nsHTMLDocument.cpp
+++ b/dom/html/nsHTMLDocument.cpp
@@ -28,6 +28,7 @@
#include "nsIDOMElement.h"
#include "nsPIDOMWindow.h"
#include "nsDOMString.h"
+#include "nsIProtocolHandler.h"
#include "nsIStreamListener.h"
#include "nsIURI.h"
#include "nsIIOService.h"
diff --git a/dom/html/nsIConstraintValidation.cpp b/dom/html/nsIConstraintValidation.cpp
index 00f34df67..db69cba07 100644
--- a/dom/html/nsIConstraintValidation.cpp
+++ b/dom/html/nsIConstraintValidation.cpp
@@ -13,6 +13,8 @@
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/ValidityState.h"
#include "nsIFormControl.h"
+#include "nsIMutableArray.h"
+#include "nsISimpleEnumerator.h"
#include "nsContentUtils.h"
#include "nsIFormSubmitObserver.h"
diff --git a/dom/indexedDB/IDBDatabase.cpp b/dom/indexedDB/IDBDatabase.cpp
index 6ef352801..8a1fa4b21 100644
--- a/dom/indexedDB/IDBDatabase.cpp
+++ b/dom/indexedDB/IDBDatabase.cpp
@@ -16,6 +16,7 @@
#include "IDBTransaction.h"
#include "IDBFactory.h"
#include "IndexedDatabaseManager.h"
+#include "KeyPath.h"
#include "mozilla/ErrorResult.h"
#include "mozilla/EventDispatcher.h"
#include "MainThreadUtils.h"
@@ -54,13 +55,15 @@
// Include this last to avoid path problems on Windows.
#include "ActorsChild.h"
-namespace mozilla {
-namespace dom {
+using namespace mozilla::dom::indexedDB;
using namespace mozilla::dom::quota;
using namespace mozilla::ipc;
using namespace mozilla::services;
+namespace mozilla {
+namespace dom {
+
namespace {
const char kCycleCollectionObserverTopic[] = "cycle-collector-end";
diff --git a/dom/indexedDB/IDBFactory.cpp b/dom/indexedDB/IDBFactory.cpp
index 66471fe24..1fae686b4 100644
--- a/dom/indexedDB/IDBFactory.cpp
+++ b/dom/indexedDB/IDBFactory.cpp
@@ -41,6 +41,8 @@
#include "nsContentUtils.h" // For assertions.
#endif
+using namespace mozilla::dom::indexedDB;
+
namespace mozilla {
namespace dom {
diff --git a/dom/indexedDB/IDBFileHandle.cpp b/dom/indexedDB/IDBFileHandle.cpp
index 8b88e1722..3287cf404 100644
--- a/dom/indexedDB/IDBFileHandle.cpp
+++ b/dom/indexedDB/IDBFileHandle.cpp
@@ -12,6 +12,8 @@
#include "mozilla/dom/IDBFileHandleBinding.h"
#include "mozilla/dom/filehandle/ActorsChild.h"
#include "mozilla/EventDispatcher.h"
+#include "nsContentUtils.h"
+#include "nsQueryObject.h"
#include "nsServiceManagerUtils.h"
#include "nsWidgetsCID.h"
diff --git a/dom/indexedDB/IDBIndex.cpp b/dom/indexedDB/IDBIndex.cpp
index af50926e6..f47098fce 100644
--- a/dom/indexedDB/IDBIndex.cpp
+++ b/dom/indexedDB/IDBIndex.cpp
@@ -23,6 +23,9 @@
// Include this last to avoid path problems on Windows.
#include "ActorsChild.h"
+using namespace mozilla::dom;
+using namespace mozilla::dom::indexedDB;
+
namespace mozilla {
namespace dom {
diff --git a/dom/indexedDB/IDBObjectStore.cpp b/dom/indexedDB/IDBObjectStore.cpp
index cbac30894..1216c8f84 100644
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -52,6 +52,8 @@
// Include this last to avoid path problems on Windows.
#include "ActorsChild.h"
+using namespace mozilla::dom::indexedDB;
+
namespace mozilla {
namespace dom {
diff --git a/dom/indexedDB/IDBTransaction.cpp b/dom/indexedDB/IDBTransaction.cpp
index a50489898..61b49b137 100644
--- a/dom/indexedDB/IDBTransaction.cpp
+++ b/dom/indexedDB/IDBTransaction.cpp
@@ -18,6 +18,7 @@
#include "mozilla/ipc/BackgroundChild.h"
#include "nsAutoPtr.h"
#include "nsPIDOMWindow.h"
+#include "nsQueryObject.h"
#include "nsServiceManagerUtils.h"
#include "nsTHashtable.h"
#include "ProfilerHelpers.h"
diff --git a/dom/indexedDB/KeyPath.cpp b/dom/indexedDB/KeyPath.cpp
index 0221c9450..74316f465 100644
--- a/dom/indexedDB/KeyPath.cpp
+++ b/dom/indexedDB/KeyPath.cpp
@@ -11,10 +11,12 @@
#include "nsCharSeparatedTokenizer.h"
#include "nsJSUtils.h"
+#include "nsPrintfCString.h"
#include "xpcpublic.h"
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/BlobBinding.h"
+#include "mozilla/dom/File.h" // for Blob
#include "mozilla/dom/IDBObjectStoreBinding.h"
namespace mozilla {
diff --git a/dom/indexedDB/ScriptErrorHelper.h b/dom/indexedDB/ScriptErrorHelper.h
index d1cd8c749..1716af87f 100644
--- a/dom/indexedDB/ScriptErrorHelper.h
+++ b/dom/indexedDB/ScriptErrorHelper.h
@@ -7,6 +7,8 @@
#ifndef mozilla_dom_indexeddb_scripterrorhelper_h__
#define mozilla_dom_indexeddb_scripterrorhelper_h__
+#include "nsString.h"
+
class nsAString;
namespace mozilla {
diff --git a/dom/indexedDB/moz.build b/dom/indexedDB/moz.build
index d8c217f38..050599393 100644
--- a/dom/indexedDB/moz.build
+++ b/dom/indexedDB/moz.build
@@ -45,7 +45,7 @@ EXPORTS.mozilla.dom.indexedDB += [
'SerializationHelpers.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'ActorsChild.cpp',
'FileInfo.cpp',
'FileSnapshot.cpp',
diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp
index 0d11fb889..deea691f3 100644
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -109,6 +109,7 @@
#include "nsIDOMWindow.h"
#include "nsIExternalProtocolService.h"
#include "nsIFormProcessor.h"
+#include "nsIFrameLoader.h"
#include "nsIGfxInfo.h"
#include "nsIIdleService.h"
#include "nsIInterfaceRequestorUtils.h"
@@ -229,6 +230,7 @@ static NS_DEFINE_CID(kCClipboardCID, NS_CLIPBOARD_CID);
using base::ChildPrivileges;
using base::KillProcess;
+using namespace mozilla::dom;
using namespace mozilla::dom::power;
using namespace mozilla::media;
using namespace mozilla::embedding;
diff --git a/dom/ipc/StructuredCloneData.cpp b/dom/ipc/StructuredCloneData.cpp
index 2c1fff2ac..6b3ee0cd1 100644
--- a/dom/ipc/StructuredCloneData.cpp
+++ b/dom/ipc/StructuredCloneData.cpp
@@ -13,6 +13,7 @@
#include "ipc/IPCMessageUtils.h"
#include "mozilla/dom/BindingUtils.h"
#include "mozilla/dom/BlobBinding.h"
+#include "mozilla/dom/DOMTypes.h"
#include "mozilla/dom/File.h"
#include "mozilla/dom/ToJSValue.h"
#include "nsContentUtils.h"
diff --git a/dom/ipc/TabChild.cpp b/dom/ipc/TabChild.cpp
index e1355adee..aac95ae02 100644
--- a/dom/ipc/TabChild.cpp
+++ b/dom/ipc/TabChild.cpp
@@ -71,6 +71,7 @@
#include "nsIURI.h"
#include "nsIURIFixup.h"
#include "nsCDefaultURIFixup.h"
+#include "nsISupportsPrimitives.h"
#include "nsIWebBrowser.h"
#include "nsIWebBrowserFocus.h"
#include "nsIWebBrowserSetup.h"
diff --git a/dom/ipc/moz.build b/dom/ipc/moz.build
index 5629ab2c6..455d0eff7 100644
--- a/dom/ipc/moz.build
+++ b/dom/ipc/moz.build
@@ -44,11 +44,13 @@ EXPORTS.mozilla += [
'ProcessPriorityManager.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'AppProcessChecker.cpp',
+ 'Blob.cpp',
'ColorPickerParent.cpp',
'ContentBridgeChild.cpp',
'ContentBridgeParent.cpp',
+ 'ContentChild.cpp',
'ContentParent.cpp',
'ContentProcess.cpp',
'ContentProcessManager.cpp',
@@ -57,6 +59,7 @@ UNIFIED_SOURCES += [
'nsIContentParent.cpp',
'PermissionMessageUtils.cpp',
'PreallocatedProcessManager.cpp',
+ 'ProcessHangMonitor.cpp',
'ProcessPriorityManager.cpp',
'ScreenManagerParent.cpp',
'StructuredCloneData.cpp',
@@ -66,14 +69,6 @@ UNIFIED_SOURCES += [
'TabParent.cpp',
]
-# Blob.cpp cannot be compiled in unified mode because it triggers a fatal gcc warning.
-# ContentChild.cpp cannot be compiled in unified mode on linux due to Time conflict
-SOURCES += [
- 'Blob.cpp',
- 'ContentChild.cpp',
- 'ProcessHangMonitor.cpp',
-]
-
IPDL_SOURCES += [
'BlobTypes.ipdlh',
'DOMTypes.ipdlh',
diff --git a/dom/ipc/nsIContentParent.cpp b/dom/ipc/nsIContentParent.cpp
index 0ef1abdf7..77bfae4c7 100644
--- a/dom/ipc/nsIContentParent.cpp
+++ b/dom/ipc/nsIContentParent.cpp
@@ -27,6 +27,7 @@
#include "nsPrintfCString.h"
#include "xpcpublic.h"
+using namespace mozilla::ipc;
using namespace mozilla::jsipc;
// XXX need another bug to move this to a common header.
diff --git a/dom/json/moz.build b/dom/json/moz.build
index 635dca255..28711b19a 100644
--- a/dom/json/moz.build
+++ b/dom/json/moz.build
@@ -4,17 +4,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-EXPORTS += [
- 'nsJSON.h',
-]
+EXPORTS += ['nsJSON.h']
-UNIFIED_SOURCES += [
- 'nsJSON.cpp',
-]
+SOURCES += ['nsJSON.cpp']
-LOCAL_INCLUDES += [
- '/dom/base',
-]
+LOCAL_INCLUDES += ['/dom/base']
FINAL_LIBRARY = 'xul'
diff --git a/dom/jsurl/moz.build b/dom/jsurl/moz.build
index f5579b64d..c0c82a141 100644
--- a/dom/jsurl/moz.build
+++ b/dom/jsurl/moz.build
@@ -8,7 +8,7 @@ EXPORTS += [
'nsJSProtocolHandler.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'nsJSProtocolHandler.cpp',
]
diff --git a/dom/mathml/moz.build b/dom/mathml/moz.build
index 307c1603e..d483008aa 100644
--- a/dom/mathml/moz.build
+++ b/dom/mathml/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'nsMathMLElement.cpp',
'nsMathMLElementFactory.cpp',
]
@@ -12,6 +12,5 @@ UNIFIED_SOURCES += [
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
-LOCAL_INCLUDES += [
- '/dom/base',
-]
+
+LOCAL_INCLUDES += ['/dom/base']
diff --git a/dom/media/Benchmark.cpp b/dom/media/Benchmark.cpp
index 7394f8036..e2b4abe7b 100644
--- a/dom/media/Benchmark.cpp
+++ b/dom/media/Benchmark.cpp
@@ -11,6 +11,7 @@
#include "PDMFactory.h"
#include "WebMDemuxer.h"
#include "mozilla/Preferences.h"
+#include "mozilla/SharedThreadPool.h"
#include "mozilla/dom/ContentChild.h"
#ifndef MOZ_WIDGET_ANDROID
diff --git a/dom/media/CanvasCaptureMediaStream.cpp b/dom/media/CanvasCaptureMediaStream.cpp
index f40f01e21..acf2059c7 100644
--- a/dom/media/CanvasCaptureMediaStream.cpp
+++ b/dom/media/CanvasCaptureMediaStream.cpp
@@ -8,6 +8,7 @@
#include "gfxPlatform.h"
#include "ImageContainer.h"
#include "MediaStreamGraph.h"
+#include "MediaStreamListener.h"
#include "mozilla/dom/CanvasCaptureMediaStreamBinding.h"
#include "mozilla/gfx/2D.h"
#include "mozilla/Atomics.h"
diff --git a/dom/media/CubebUtils.cpp b/dom/media/CubebUtils.cpp
index 6bb846afe..7f203ce62 100644
--- a/dom/media/CubebUtils.cpp
+++ b/dom/media/CubebUtils.cpp
@@ -10,6 +10,8 @@
#include "nsDebug.h"
#include "nsString.h"
#include "mozilla/Preferences.h"
+#include "mozilla/Services.h"
+#include "mozilla/Sprintf.h"
#include "mozilla/StaticMutex.h"
#include "mozilla/StaticPtr.h"
#include "mozilla/Telemetry.h"
diff --git a/dom/media/DOMMediaStream.cpp b/dom/media/DOMMediaStream.cpp
index 118d845a3..53d096d6e 100755
--- a/dom/media/DOMMediaStream.cpp
+++ b/dom/media/DOMMediaStream.cpp
@@ -14,6 +14,7 @@
#include "mozilla/dom/MediaStreamTrackEvent.h"
#include "mozilla/dom/LocalMediaStreamBinding.h"
#include "mozilla/dom/AudioNode.h"
+#include "AudioCaptureStream.h"
#include "AudioChannelAgent.h"
#include "mozilla/dom/AudioTrack.h"
#include "mozilla/dom/AudioTrackList.h"
@@ -22,6 +23,7 @@
#include "mozilla/dom/HTMLCanvasElement.h"
#include "mozilla/media/MediaUtils.h"
#include "MediaStreamGraph.h"
+#include "MediaStreamListener.h"
#include "AudioStreamTrack.h"
#include "VideoStreamTrack.h"
#include "Layers.h"
diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp
index 0cce91ccb..b1f2f95d7 100644
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -788,6 +788,13 @@ MediaDecoder::CallSeek(const SeekTarget& aTarget, dom::Promise* aPromise)
&MediaDecoder::OnSeekResolved, &MediaDecoder::OnSeekRejected));
}
+// GetCurrentTime is defined in winbase.h as a zero argument macro forwarding to
+// GetTickCount(), which conflicts with the MediaDecoder::GetCurrentTime
+// implementation here. Clear the macro.
+#ifdef GetCurrentTime
+#undef GetCurrentTime
+#endif
+
double
MediaDecoder::GetCurrentTime()
{
diff --git a/dom/media/MediaDecoderReader.cpp b/dom/media/MediaDecoderReader.cpp
index b6cdf9080..046f81b2e 100644
--- a/dom/media/MediaDecoderReader.cpp
+++ b/dom/media/MediaDecoderReader.cpp
@@ -14,6 +14,7 @@
#include "nsPrintfCString.h"
#include "mozilla/mozalloc.h"
#include "mozilla/Mutex.h"
+#include "mozilla/SharedThreadPool.h"
#include <stdint.h>
#include <algorithm>
diff --git a/dom/media/MediaStreamListener.h b/dom/media/MediaStreamListener.h
index 2b6be85cf..eefd4adac 100644
--- a/dom/media/MediaStreamListener.h
+++ b/dom/media/MediaStreamListener.h
@@ -7,7 +7,9 @@
#ifndef MOZILLA_MEDIASTREAMLISTENER_h_
#define MOZILLA_MEDIASTREAMLISTENER_h_
+#include "MediaStreamGraph.h"
#include "StreamTracks.h"
+#include "MediaStreamGraph.h"
namespace mozilla {
diff --git a/dom/media/MediaStreamTrack.cpp b/dom/media/MediaStreamTrack.cpp
index 75cdeb1d1..648ec82a0 100644
--- a/dom/media/MediaStreamTrack.cpp
+++ b/dom/media/MediaStreamTrack.cpp
@@ -7,8 +7,10 @@
#include "DOMMediaStream.h"
#include "MediaStreamGraph.h"
+#include "nsContentUtils.h"
#include "nsIUUIDGenerator.h"
#include "nsServiceManagerUtils.h"
+#include "MediaStreamError.h"
#include "MediaStreamListener.h"
#include "systemservices/MediaUtils.h"
@@ -21,6 +23,8 @@
static mozilla::LazyLogModule gMediaStreamTrackLog("MediaStreamTrack");
#define LOG(type, msg) MOZ_LOG(gMediaStreamTrackLog, type, msg)
+using namespace mozilla::media;
+
namespace mozilla {
namespace dom {
diff --git a/dom/media/eme/MediaKeySystemAccess.cpp b/dom/media/eme/MediaKeySystemAccess.cpp
index 4a5a7a30c..e4e86f4c5 100644
--- a/dom/media/eme/MediaKeySystemAccess.cpp
+++ b/dom/media/eme/MediaKeySystemAccess.cpp
@@ -36,9 +36,11 @@
#include "mozilla/ClearOnShutdown.h"
#include "nsUnicharUtils.h"
#include "mozilla/dom/MediaSource.h"
+#include "DecoderTraits.h"
#ifdef MOZ_WIDGET_ANDROID
#include "FennecJNIWrappers.h"
#endif
+
namespace mozilla {
namespace dom {
diff --git a/dom/media/eme/mediadrm/moz.build b/dom/media/eme/mediadrm/moz.build
index c01f7a52e..83479d670 100644
--- a/dom/media/eme/mediadrm/moz.build
+++ b/dom/media/eme/mediadrm/moz.build
@@ -10,7 +10,7 @@ EXPORTS.mozilla += [
'MediaDrmProxySupport.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'MediaDrmCDMCallbackProxy.cpp',
'MediaDrmCDMProxy.cpp',
'MediaDrmProxySupport.cpp',
diff --git a/dom/media/eme/moz.build b/dom/media/eme/moz.build
index 47e622ae3..b55ae3df5 100644
--- a/dom/media/eme/moz.build
+++ b/dom/media/eme/moz.build
@@ -23,7 +23,7 @@ EXPORTS.mozilla += [
'EMEUtils.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'CDMCaps.cpp',
'DetailedPromise.cpp',
'EMEUtils.cpp',
diff --git a/dom/media/encoder/OpusTrackEncoder.cpp b/dom/media/encoder/OpusTrackEncoder.cpp
index 4b55b3954..aa732b392 100644
--- a/dom/media/encoder/OpusTrackEncoder.cpp
+++ b/dom/media/encoder/OpusTrackEncoder.cpp
@@ -2,7 +2,9 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
+
#include "OpusTrackEncoder.h"
+#include "VideoUtils.h"
#include "nsString.h"
#include "GeckoProfiler.h"
diff --git a/dom/media/encoder/moz.build b/dom/media/encoder/moz.build
index f29430cb0..925c36f90 100644
--- a/dom/media/encoder/moz.build
+++ b/dom/media/encoder/moz.build
@@ -16,7 +16,7 @@ EXPORTS += [
'TrackMetadataBase.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'MediaEncoder.cpp',
'OpusTrackEncoder.cpp',
'TrackEncoder.cpp',
@@ -25,8 +25,10 @@ UNIFIED_SOURCES += [
if CONFIG['MOZ_WEBM_ENCODER']:
EXPORTS += ['VP8TrackEncoder.h',
]
- UNIFIED_SOURCES += ['VP8TrackEncoder.cpp',
+
+ SOURCES += ['VP8TrackEncoder.cpp',
]
+
LOCAL_INCLUDES += ['/media/libyuv/include']
FINAL_LIBRARY = 'xul'
diff --git a/dom/media/flac/FlacDemuxer.cpp b/dom/media/flac/FlacDemuxer.cpp
index 7a98edbee..6df09cc25 100644
--- a/dom/media/flac/FlacDemuxer.cpp
+++ b/dom/media/flac/FlacDemuxer.cpp
@@ -33,14 +33,6 @@ namespace flac {
// flac::FrameHeader - Holds the flac frame header and its parsing
// state.
-#define FLAC_MAX_CHANNELS 8
-#define FLAC_MIN_BLOCKSIZE 16
-#define FLAC_MAX_BLOCKSIZE 65535
-#define FLAC_MIN_FRAME_SIZE 11
-#define FLAC_MAX_FRAME_HEADER_SIZE 16
-#define FLAC_MAX_FRAME_SIZE (FLAC_MAX_FRAME_HEADER_SIZE \
- +FLAC_MAX_BLOCKSIZE*FLAC_MAX_CHANNELS*3)
-
class FrameHeader {
public:
const AudioInfo& Info() const { return mInfo; }
diff --git a/dom/media/flac/FlacDemuxer.h b/dom/media/flac/FlacDemuxer.h
index fd0e35c94..248ae861f 100644
--- a/dom/media/flac/FlacDemuxer.h
+++ b/dom/media/flac/FlacDemuxer.h
@@ -13,6 +13,15 @@
namespace mozilla {
namespace flac {
+
+#define FLAC_MAX_CHANNELS 8
+#define FLAC_MIN_BLOCKSIZE 16
+#define FLAC_MAX_BLOCKSIZE 65535
+#define FLAC_MIN_FRAME_SIZE 11
+#define FLAC_MAX_FRAME_HEADER_SIZE 16
+#define FLAC_MAX_FRAME_SIZE (FLAC_MAX_FRAME_HEADER_SIZE \
+ +FLAC_MAX_BLOCKSIZE*FLAC_MAX_CHANNELS*3)
+
class Frame;
class FrameParser;
}
diff --git a/dom/media/flac/FlacFrameParser.cpp b/dom/media/flac/FlacFrameParser.cpp
index f2d6c1367..c31161cbc 100644
--- a/dom/media/flac/FlacFrameParser.cpp
+++ b/dom/media/flac/FlacFrameParser.cpp
@@ -7,6 +7,7 @@
#include "FlacFrameParser.h"
#include "mp4_demuxer/ByteReader.h"
#include "nsTArray.h"
+#include "FlacDemuxer.h"
#include "OggCodecState.h"
#include "OpusParser.h"
#include "VideoUtils.h"
diff --git a/dom/media/flac/moz.build b/dom/media/flac/moz.build
index 6933ded1f..86427e0dd 100644
--- a/dom/media/flac/moz.build
+++ b/dom/media/flac/moz.build
@@ -10,7 +10,7 @@ EXPORTS += [
'FlacFrameParser.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'FlacDecoder.cpp',
'FlacDemuxer.cpp',
'FlacFrameParser.cpp',
diff --git a/dom/media/fmp4/moz.build b/dom/media/fmp4/moz.build
index a79fb0229..535a99253 100644
--- a/dom/media/fmp4/moz.build
+++ b/dom/media/fmp4/moz.build
@@ -10,13 +10,10 @@ EXPORTS += [
'MP4Stream.h',
]
-UNIFIED_SOURCES += [
- 'MP4Decoder.cpp',
- 'MP4Stream.cpp',
-]
-
SOURCES += [
+ 'MP4Decoder.cpp',
'MP4Demuxer.cpp',
+ 'MP4Stream.cpp',
]
FINAL_LIBRARY = 'xul'
diff --git a/dom/media/gmp/GMPDecryptorParent.cpp b/dom/media/gmp/GMPDecryptorParent.cpp
index 4f5402160..56474e973 100644
--- a/dom/media/gmp/GMPDecryptorParent.cpp
+++ b/dom/media/gmp/GMPDecryptorParent.cpp
@@ -4,7 +4,9 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "GMPDecryptorParent.h"
+
#include "GMPContentParent.h"
+#include "GMPUtils.h"
#include "MediaData.h"
#include "mozilla/Unused.h"
diff --git a/dom/media/gmp/GMPUtils.cpp b/dom/media/gmp/GMPUtils.cpp
index d27523760..6c2147ae2 100644
--- a/dom/media/gmp/GMPUtils.cpp
+++ b/dom/media/gmp/GMPUtils.cpp
@@ -10,8 +10,10 @@
#include "nsCOMPtr.h"
#include "nsLiteralString.h"
#include "nsCRTGlue.h"
+#include "mozIGeckoMediaPluginService.h"
#include "mozilla/Base64.h"
#include "nsISimpleEnumerator.h"
+#include "prio.h"
namespace mozilla {
diff --git a/dom/media/gmp/moz.build b/dom/media/gmp/moz.build
index 79de6e1d9..8595ee0de 100644
--- a/dom/media/gmp/moz.build
+++ b/dom/media/gmp/moz.build
@@ -87,7 +87,7 @@ if CONFIG['OS_TARGET'] == 'Android':
'rlz',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'GMPAudioDecoderChild.cpp',
'GMPAudioDecoderParent.cpp',
'GMPAudioHost.cpp',
@@ -123,7 +123,7 @@ UNIFIED_SOURCES += [
]
if CONFIG['MOZ_EME']:
- UNIFIED_SOURCES += [
+ SOURCES += [
'GMPCDMCallbackProxy.cpp',
'GMPCDMProxy.cpp',
]
diff --git a/dom/media/imagecapture/CaptureTask.cpp b/dom/media/imagecapture/CaptureTask.cpp
index 589ba5a42..9f1eea9ef 100644
--- a/dom/media/imagecapture/CaptureTask.cpp
+++ b/dom/media/imagecapture/CaptureTask.cpp
@@ -15,24 +15,6 @@
namespace mozilla {
-class CaptureTask::MediaStreamEventListener : public MediaStreamTrackListener
-{
-public:
- explicit MediaStreamEventListener(CaptureTask* aCaptureTask)
- : mCaptureTask(aCaptureTask) {};
-
- // MediaStreamListener methods.
- void NotifyEnded() override
- {
- if(!mCaptureTask->mImageGrabbedOrTrackEnd) {
- mCaptureTask->PostTrackEndEvent();
- }
- }
-
-private:
- CaptureTask* mCaptureTask;
-};
-
CaptureTask::CaptureTask(dom::ImageCapture* aImageCapture)
: mImageCapture(aImageCapture)
, mEventListener(new MediaStreamEventListener(this))
diff --git a/dom/media/imagecapture/CaptureTask.h b/dom/media/imagecapture/CaptureTask.h
index 2b4f0a04c..f9c810158 100644
--- a/dom/media/imagecapture/CaptureTask.h
+++ b/dom/media/imagecapture/CaptureTask.h
@@ -86,6 +86,24 @@ protected:
bool mPrincipalChanged;
};
+class CaptureTask::MediaStreamEventListener : public MediaStreamTrackListener
+{
+public:
+ explicit MediaStreamEventListener(CaptureTask* aCaptureTask)
+ : mCaptureTask(aCaptureTask) {};
+
+ // MediaStreamListener methods.
+ void NotifyEnded() override
+ {
+ if(!mCaptureTask->mImageGrabbedOrTrackEnd) {
+ mCaptureTask->PostTrackEndEvent();
+ }
+ }
+
+private:
+ CaptureTask* mCaptureTask;
+};
+
} // namespace mozilla
#endif // CAPTURETASK_H
diff --git a/dom/media/imagecapture/moz.build b/dom/media/imagecapture/moz.build
index f47649c5e..c1a58ff37 100644
--- a/dom/media/imagecapture/moz.build
+++ b/dom/media/imagecapture/moz.build
@@ -8,7 +8,7 @@ EXPORTS.mozilla.dom += [
'ImageCapture.h'
]
-UNIFIED_SOURCES += [
+SOURCES += [
'CaptureTask.cpp',
'ImageCapture.cpp',
]
diff --git a/dom/media/mediasink/DecodedStream.cpp b/dom/media/mediasink/DecodedStream.cpp
index 00bc5ea49..54161be5c 100644
--- a/dom/media/mediasink/DecodedStream.cpp
+++ b/dom/media/mediasink/DecodedStream.cpp
@@ -19,6 +19,8 @@
#include "VideoSegment.h"
#include "VideoUtils.h"
+#include "nsPrintfCString.h"
+
namespace mozilla {
#undef DUMP_LOG
diff --git a/dom/media/mediasink/VideoSink.cpp b/dom/media/mediasink/VideoSink.cpp
index 18c0b22ad..a438cf8a4 100644
--- a/dom/media/mediasink/VideoSink.cpp
+++ b/dom/media/mediasink/VideoSink.cpp
@@ -4,9 +4,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include "MediaStreamGraph.h"
#include "MediaQueue.h"
#include "VideoSink.h"
#include "MediaPrefs.h"
+#include "nsPrintfCString.h"
namespace mozilla {
diff --git a/dom/media/mediasink/moz.build b/dom/media/mediasink/moz.build
index c09341374..34c78a749 100644
--- a/dom/media/mediasink/moz.build
+++ b/dom/media/mediasink/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'AudioSinkWrapper.cpp',
'DecodedAudioDataSink.cpp',
'DecodedStream.cpp',
diff --git a/dom/media/mediasource/TrackBuffersManager.cpp b/dom/media/mediasource/TrackBuffersManager.cpp
index 9a2d00ad8..b9cf19492 100644
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -40,6 +40,7 @@ using media::TimeUnit;
using media::TimeInterval;
using media::TimeIntervals;
typedef SourceBufferTask::AppendBufferResult AppendBufferResult;
+typedef SourceBufferAttributes::AppendState AppendState;
static const char*
AppendStateToStr(SourceBufferAttributes::AppendState aState)
diff --git a/dom/media/mediasource/moz.build b/dom/media/mediasource/moz.build
index a1689c216..dfa227a86 100644
--- a/dom/media/mediasource/moz.build
+++ b/dom/media/mediasource/moz.build
@@ -21,7 +21,7 @@ EXPORTS.mozilla.dom += [
'SourceBufferList.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'ContainerParser.cpp',
'MediaSource.cpp',
'MediaSourceDecoder.cpp',
diff --git a/dom/media/moz.build b/dom/media/moz.build
index 41267a6ef..4cb514a08 100644
--- a/dom/media/moz.build
+++ b/dom/media/moz.build
@@ -184,7 +184,7 @@ EXPORTS.mozilla.dom += [
'VideoTrackList.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'AccurateSeekTask.cpp',
'ADTSDecoder.cpp',
'ADTSDemuxer.cpp',
@@ -201,6 +201,7 @@ UNIFIED_SOURCES += [
'CanvasCaptureMediaStream.cpp',
'CubebUtils.cpp',
'DecoderDoctorDiagnostics.cpp',
+ 'DecoderTraits.cpp',
'DOMMediaStream.cpp',
'EncodedBufferCache.cpp',
'FileBlockCache.cpp',
@@ -256,11 +257,6 @@ UNIFIED_SOURCES += [
if CONFIG['OS_TARGET'] == 'WINNT':
SOURCES += [ 'ThreadPoolCOMListener.cpp' ]
-# DecoderTraits.cpp needs to be built separately because of Mac OS X headers.
-SOURCES += [
- 'DecoderTraits.cpp',
-]
-
# Some codec-related code uses multi-character constants, which GCC and clang
# warn about. Suppress turning this warning into an error.
if CONFIG['GNU_CC'] or CONFIG['CLANG_CL']:
diff --git a/dom/media/mp3/moz.build b/dom/media/mp3/moz.build
index 596d061f8..838a5a854 100644
--- a/dom/media/mp3/moz.build
+++ b/dom/media/mp3/moz.build
@@ -9,7 +9,7 @@ EXPORTS += [
'MP3Demuxer.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'MP3Decoder.cpp',
'MP3Demuxer.cpp',
]
diff --git a/dom/media/ogg/OggDemuxer.cpp b/dom/media/ogg/OggDemuxer.cpp
index 0cc484687..f9475700a 100644
--- a/dom/media/ogg/OggDemuxer.cpp
+++ b/dom/media/ogg/OggDemuxer.cpp
@@ -21,6 +21,7 @@
#include <algorithm>
extern mozilla::LazyLogModule gMediaDemuxerLog;
+#define LOG(type, msg) MOZ_LOG(gMediaDecoderLog, type, msg)
#define OGG_DEBUG(arg, ...) MOZ_LOG(gMediaDemuxerLog, mozilla::LogLevel::Debug, ("OggDemuxer(%p)::%s: " arg, this, __func__, ##__VA_ARGS__))
// Un-comment to enable logging of seek bisections.
diff --git a/dom/media/ogg/moz.build b/dom/media/ogg/moz.build
index 07e195b6f..c47abf690 100644
--- a/dom/media/ogg/moz.build
+++ b/dom/media/ogg/moz.build
@@ -13,7 +13,7 @@ EXPORTS += [
'OpusParser.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'OggCodecState.cpp',
'OggCodecStore.cpp',
'OggDecoder.cpp',
diff --git a/dom/media/platforms/PlatformDecoderModule.h b/dom/media/platforms/PlatformDecoderModule.h
index 7480d8ff9..5684dea2d 100644
--- a/dom/media/platforms/PlatformDecoderModule.h
+++ b/dom/media/platforms/PlatformDecoderModule.h
@@ -7,6 +7,8 @@
#if !defined(PlatformDecoderModule_h_)
#define PlatformDecoderModule_h_
+#include "ImageContainer.h"
+#include "DecoderDoctorDiagnostics.h"
#include "MediaDecoderReader.h"
#include "MediaInfo.h"
#include "mozilla/MozPromise.h"
diff --git a/dom/media/platforms/agnostic/TheoraDecoder.cpp b/dom/media/platforms/agnostic/TheoraDecoder.cpp
index b216791e4..695e697d7 100644
--- a/dom/media/platforms/agnostic/TheoraDecoder.cpp
+++ b/dom/media/platforms/agnostic/TheoraDecoder.cpp
@@ -10,6 +10,7 @@
#include "nsError.h"
#include "TimeUnits.h"
#include "mozilla/PodOperations.h"
+#include "mozilla/SyncRunnable.h"
#include <algorithm>
diff --git a/dom/media/platforms/agnostic/eme/moz.build b/dom/media/platforms/agnostic/eme/moz.build
index 78b76d4d4..e48d49d80 100644
--- a/dom/media/platforms/agnostic/eme/moz.build
+++ b/dom/media/platforms/agnostic/eme/moz.build
@@ -11,7 +11,7 @@ EXPORTS += [
'SamplesWaitingForKey.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'EMEAudioDecoder.cpp',
'EMEDecoderModule.cpp',
'EMEVideoDecoder.cpp',
diff --git a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
index 912b88ce1..26d029da0 100644
--- a/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
+++ b/dom/media/platforms/agnostic/gmp/GMPVideoDecoder.cpp
@@ -10,6 +10,7 @@
#include "prsystem.h"
#include "MediaData.h"
#include "GMPDecoderModule.h"
+#include "MP4Decoder.h"
#include "VPXDecoder.h"
namespace mozilla {
diff --git a/dom/media/platforms/agnostic/gmp/moz.build b/dom/media/platforms/agnostic/gmp/moz.build
index eb2738e26..644df47a3 100644
--- a/dom/media/platforms/agnostic/gmp/moz.build
+++ b/dom/media/platforms/agnostic/gmp/moz.build
@@ -11,7 +11,7 @@ EXPORTS += [
'MediaDataDecoderProxy.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'GMPAudioDecoder.cpp',
'GMPDecoderModule.cpp',
'GMPVideoDecoder.cpp',
diff --git a/dom/media/platforms/apple/AppleCMLinker.cpp b/dom/media/platforms/apple/AppleCMLinker.cpp
index 5227bf9e5..b1417b46a 100644
--- a/dom/media/platforms/apple/AppleCMLinker.cpp
+++ b/dom/media/platforms/apple/AppleCMLinker.cpp
@@ -7,7 +7,9 @@
#include <dlfcn.h>
#include "AppleCMLinker.h"
+#include "PlatformDecoderModule.h"
#include "mozilla/ArrayUtils.h"
+#include "mozilla/Logging.h"
#include "nsDebug.h"
#define LOG(...) MOZ_LOG(sPDMLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
diff --git a/dom/media/platforms/apple/AppleVTDecoder.cpp b/dom/media/platforms/apple/AppleVTDecoder.cpp
index 81638870a..93a480266 100644
--- a/dom/media/platforms/apple/AppleVTDecoder.cpp
+++ b/dom/media/platforms/apple/AppleVTDecoder.cpp
@@ -11,12 +11,15 @@
#include "AppleUtils.h"
#include "AppleVTDecoder.h"
#include "AppleVTLinker.h"
+#include "MacIOSurfaceImage.h"
#include "MediaData.h"
#include "mozilla/ArrayUtils.h"
#include "mp4_demuxer/H264.h"
#include "nsAutoPtr.h"
#include "nsThreadUtils.h"
#include "mozilla/Logging.h"
+#include "mozilla/SyncRunnable.h"
+#include "mozilla/gfx/MacIOSurface.h"
#include "VideoUtils.h"
#include "gfxPlatform.h"
@@ -360,7 +363,7 @@ AppleVTDecoder::OutputFrame(CVPixelBufferRef aImage,
RefPtr<MacIOSurface> macSurface = new MacIOSurface(surface);
- RefPtr<layers::Image> image = new MacIOSurfaceImage(macSurface);
+ RefPtr<layers::Image> image = new layers::MacIOSurfaceImage(macSurface);
data =
VideoData::CreateFromImage(info,
diff --git a/dom/media/platforms/apple/AppleVTLinker.cpp b/dom/media/platforms/apple/AppleVTLinker.cpp
index 51a8a0122..287de3ed3 100644
--- a/dom/media/platforms/apple/AppleVTLinker.cpp
+++ b/dom/media/platforms/apple/AppleVTLinker.cpp
@@ -7,7 +7,9 @@
#include <dlfcn.h>
#include "AppleVTLinker.h"
+#include "PlatformDecoderModule.h"
#include "mozilla/ArrayUtils.h"
+#include "mozilla/Logging.h"
#include "nsDebug.h"
#define LOG(...) MOZ_LOG(sPDMLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
diff --git a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
index f3101e44c..f9e8a2d26 100644
--- a/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
+++ b/dom/media/platforms/ffmpeg/FFmpegVideoDecoder.cpp
@@ -16,6 +16,7 @@
#include "FFmpegVideoDecoder.h"
#include "FFmpegLog.h"
#include "mozilla/PodOperations.h"
+#include "prsystem.h" // for PR_GetNumberOfProcessors
#include "libavutil/pixfmt.h"
#if LIBAVCODEC_VERSION_MAJOR < 54
diff --git a/dom/media/platforms/ffmpeg/ffmpeg57/moz.build b/dom/media/platforms/ffmpeg/ffmpeg57/moz.build
index 6bd5db8d7..7a55d7685 100644
--- a/dom/media/platforms/ffmpeg/ffmpeg57/moz.build
+++ b/dom/media/platforms/ffmpeg/ffmpeg57/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',
diff --git a/dom/media/platforms/ffmpeg/ffmpeg58/moz.build b/dom/media/platforms/ffmpeg/ffmpeg58/moz.build
index 6bd5db8d7..7a55d7685 100644
--- a/dom/media/platforms/ffmpeg/ffmpeg58/moz.build
+++ b/dom/media/platforms/ffmpeg/ffmpeg58/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',
diff --git a/dom/media/platforms/ffmpeg/ffvpx/moz.build b/dom/media/platforms/ffmpeg/ffvpx/moz.build
index c0041a4d4..95f8eec65 100644
--- a/dom/media/platforms/ffmpeg/ffvpx/moz.build
+++ b/dom/media/platforms/ffmpeg/ffvpx/moz.build
@@ -9,7 +9,7 @@ EXPORTS += [
'FFVPXRuntimeLinker.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',
diff --git a/dom/media/platforms/ffmpeg/libav53/moz.build b/dom/media/platforms/ffmpeg/libav53/moz.build
index 2bdc1dc34..471edd701 100644
--- a/dom/media/platforms/ffmpeg/libav53/moz.build
+++ b/dom/media/platforms/ffmpeg/libav53/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',
diff --git a/dom/media/platforms/ffmpeg/libav54/moz.build b/dom/media/platforms/ffmpeg/libav54/moz.build
index 2bdc1dc34..471edd701 100644
--- a/dom/media/platforms/ffmpeg/libav54/moz.build
+++ b/dom/media/platforms/ffmpeg/libav54/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',
diff --git a/dom/media/platforms/ffmpeg/libav55/moz.build b/dom/media/platforms/ffmpeg/libav55/moz.build
index 6bd5db8d7..7a55d7685 100644
--- a/dom/media/platforms/ffmpeg/libav55/moz.build
+++ b/dom/media/platforms/ffmpeg/libav55/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'../FFmpegAudioDecoder.cpp',
'../FFmpegDataDecoder.cpp',
'../FFmpegDecoderModule.cpp',
diff --git a/dom/media/platforms/ffmpeg/moz.build b/dom/media/platforms/ffmpeg/moz.build
index af96fb521..e42a8aa4d 100644
--- a/dom/media/platforms/ffmpeg/moz.build
+++ b/dom/media/platforms/ffmpeg/moz.build
@@ -16,7 +16,7 @@ DIRS += [
'ffmpeg58',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'FFmpegRuntimeLinker.cpp',
]
diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
index c46d52e3f..23bea20dd 100644
--- a/dom/media/platforms/moz.build
+++ b/dom/media/platforms/moz.build
@@ -16,7 +16,7 @@ EXPORTS += [
'wrappers/H264Converter.h'
]
-UNIFIED_SOURCES += [
+SOURCES += [
'agnostic/AgnosticDecoderModule.cpp',
'agnostic/BlankDecoderModule.cpp',
'agnostic/OpusDecoder.cpp',
@@ -42,7 +42,7 @@ if CONFIG['MOZ_WMF']:
if CONFIG['MOZ_FFVPX'] or CONFIG['MOZ_FFMPEG']:
# common code to either FFmpeg or FFVPX
- UNIFIED_SOURCES += [
+ SOURCES += [
'ffmpeg/FFmpegLibWrapper.cpp',
]
@@ -60,7 +60,7 @@ if CONFIG['MOZ_AV1']:
EXPORTS += [
'agnostic/AOMDecoder.h',
]
- UNIFIED_SOURCES += [
+ SOURCES += [
'agnostic/AOMDecoder.cpp',
]
@@ -68,7 +68,7 @@ if CONFIG['MOZ_APPLEMEDIA']:
EXPORTS += [
'apple/AppleDecoderModule.h',
]
- UNIFIED_SOURCES += [
+ SOURCES += [
'apple/AppleATDecoder.cpp',
'apple/AppleCMLinker.cpp',
'apple/AppleDecoderModule.cpp',
@@ -85,7 +85,7 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
EXPORTS += [
'android/AndroidDecoderModule.h',
]
- UNIFIED_SOURCES += [
+ SOURCES += [
'android/AndroidDecoderModule.cpp',
'android/MediaCodecDataDecoder.cpp',
'android/RemoteDataDecoder.cpp',
diff --git a/dom/media/platforms/omx/OmxPlatformLayer.cpp b/dom/media/platforms/omx/OmxPlatformLayer.cpp
index 15b3062a4..12a7d0595 100644
--- a/dom/media/platforms/omx/OmxPlatformLayer.cpp
+++ b/dom/media/platforms/omx/OmxPlatformLayer.cpp
@@ -6,6 +6,8 @@
#include "OmxPlatformLayer.h"
+#include "OmxDataDecoder.h"
+
#include "OMX_VideoExt.h" // For VP8.
#include "VPXDecoder.h"
diff --git a/dom/media/platforms/omx/OmxPlatformLayer.h b/dom/media/platforms/omx/OmxPlatformLayer.h
index 67d9e448f..8e751e1a7 100644
--- a/dom/media/platforms/omx/OmxPlatformLayer.h
+++ b/dom/media/platforms/omx/OmxPlatformLayer.h
@@ -7,6 +7,7 @@
#if !defined(OmxPlatformLayer_h_)
#define OmxPlatformLayer_h_
+#include "OMX_Component.h"
#include "OMX_Core.h"
#include "OMX_Types.h"
diff --git a/dom/media/platforms/omx/moz.build b/dom/media/platforms/omx/moz.build
index 661e280e0..ee7202bd3 100644
--- a/dom/media/platforms/omx/moz.build
+++ b/dom/media/platforms/omx/moz.build
@@ -8,7 +8,7 @@ EXPORTS += [
'OmxDecoderModule.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'OmxDataDecoder.cpp',
'OmxDecoderModule.cpp',
'OmxPlatformLayer.cpp',
diff --git a/dom/media/platforms/wmf/moz.build b/dom/media/platforms/wmf/moz.build
index fa966bea2..83c2249e1 100644
--- a/dom/media/platforms/wmf/moz.build
+++ b/dom/media/platforms/wmf/moz.build
@@ -14,6 +14,7 @@ EXPORTS += [
'WMFUtils.h',
'WMFVideoMFTManager.h',
]
+
UNIFIED_SOURCES += [
'DXVA2Manager.cpp',
'MFTDecoder.cpp',
diff --git a/dom/media/platforms/wrappers/FuzzingWrapper.cpp b/dom/media/platforms/wrappers/FuzzingWrapper.cpp
index 7df020f46..e8b451cc8 100644
--- a/dom/media/platforms/wrappers/FuzzingWrapper.cpp
+++ b/dom/media/platforms/wrappers/FuzzingWrapper.cpp
@@ -6,6 +6,8 @@
#include "FuzzingWrapper.h"
+#include "mozilla/SharedThreadPool.h"
+
mozilla::LogModule* GetFuzzingWrapperLog() {
static mozilla::LazyLogModule log("MediaFuzzingWrapper");
return log;
diff --git a/dom/media/platforms/wrappers/H264Converter.cpp b/dom/media/platforms/wrappers/H264Converter.cpp
index 0edbfc10c..cca03fceb 100644
--- a/dom/media/platforms/wrappers/H264Converter.cpp
+++ b/dom/media/platforms/wrappers/H264Converter.cpp
@@ -6,9 +6,11 @@
#include "mozilla/TaskQueue.h"
+#include "DecoderDoctorDiagnostics.h"
#include "H264Converter.h"
#include "ImageContainer.h"
#include "MediaInfo.h"
+#include "PDMFactory.h"
#include "mp4_demuxer/AnnexB.h"
#include "mp4_demuxer/H264.h"
diff --git a/dom/media/standalone/moz.build b/dom/media/standalone/moz.build
index 959703765..a3cc3545f 100644
--- a/dom/media/standalone/moz.build
+++ b/dom/media/standalone/moz.build
@@ -7,7 +7,7 @@
if CONFIG['OS_TARGET'] != 'WINNT':
Library('media_standalone')
-UNIFIED_SOURCES += [
+SOURCES += [
'../AudioChannelFormat.cpp',
'../AudioSegment.cpp',
'../SimpleImageBuffer.cpp',
diff --git a/dom/media/systemservices/MediaParent.cpp b/dom/media/systemservices/MediaParent.cpp
index 89a495f6a..16c399f37 100644
--- a/dom/media/systemservices/MediaParent.cpp
+++ b/dom/media/systemservices/MediaParent.cpp
@@ -23,6 +23,7 @@
#include "nsAppDirectoryServiceDefs.h"
#include "nsISupportsImpl.h"
#include "mozilla/Logging.h"
+#include "mozilla/MediaManager.h"
#undef LOG
mozilla::LazyLogModule gMediaParentLog("MediaParent");
diff --git a/dom/media/systemservices/MediaSystemResourceManager.cpp b/dom/media/systemservices/MediaSystemResourceManager.cpp
index 29db0ef3e..a66e946eb 100644
--- a/dom/media/systemservices/MediaSystemResourceManager.cpp
+++ b/dom/media/systemservices/MediaSystemResourceManager.cpp
@@ -7,6 +7,7 @@
#include "mozilla/TaskQueue.h"
#include "gfxPrefs.h"
+#include "MediaSystemResourceClient.h"
#include "MediaSystemResourceManagerChild.h"
#include "mozilla/layers/ImageBridgeChild.h"
diff --git a/dom/media/systemservices/moz.build b/dom/media/systemservices/moz.build
index 82a5c5e72..c582b7ba1 100644
--- a/dom/media/systemservices/moz.build
+++ b/dom/media/systemservices/moz.build
@@ -12,7 +12,7 @@ if CONFIG['MOZ_WEBRTC']:
'LoadManagerFactory.h',
'LoadMonitor.h',
]
- UNIFIED_SOURCES += [
+ SOURCES += [
'CamerasChild.cpp',
'CamerasParent.cpp',
'LoadManager.cpp',
@@ -24,6 +24,7 @@ if CONFIG['MOZ_WEBRTC']:
'/media/webrtc/signaling',
'/media/webrtc/trunk',
]
+
if CONFIG['OS_TARGET'] == 'WINNT':
DEFINES['WEBRTC_WIN'] = True
else:
@@ -34,12 +35,12 @@ if CONFIG['OS_TARGET'] == 'Android':
EXPORTS += [
'OpenSLESProvider.h'
]
- UNIFIED_SOURCES += [
+ SOURCES += [
'OpenSLESProvider.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
- UNIFIED_SOURCES += ['OSXRunLoopSingleton.cpp']
+ SOURCES += ['OSXRunLoopSingleton.cpp']
EXPORTS += ['OSXRunLoopSingleton.h']
if CONFIG['_MSC_VER']:
@@ -66,7 +67,8 @@ EXPORTS.mozilla.media += ['CamerasTypes.h',
'MediaTaskUtils.h',
'MediaUtils.h',
]
-UNIFIED_SOURCES += [
+
+SOURCES += [
'MediaChild.cpp',
'MediaParent.cpp',
'MediaSystemResourceClient.cpp',
@@ -76,11 +78,13 @@ UNIFIED_SOURCES += [
'MediaSystemResourceService.cpp',
'MediaUtils.cpp',
]
+
IPDL_SOURCES += [
'PCameras.ipdl',
'PMedia.ipdl',
'PMediaSystemResourceManager.ipdl',
]
+
# /dom/base needed for nsGlobalWindow.h in MediaChild.cpp
LOCAL_INCLUDES += [
'/dom/base',
diff --git a/dom/media/wave/moz.build b/dom/media/wave/moz.build
index f91e8eaeb..d62d3bea4 100644
--- a/dom/media/wave/moz.build
+++ b/dom/media/wave/moz.build
@@ -9,7 +9,7 @@ EXPORTS += [
'WaveDemuxer.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'WaveDecoder.cpp',
'WaveDemuxer.cpp',
]
diff --git a/dom/media/webaudio/AudioContext.cpp b/dom/media/webaudio/AudioContext.cpp
index d58441309..75f57a630 100755
--- a/dom/media/webaudio/AudioContext.cpp
+++ b/dom/media/webaudio/AudioContext.cpp
@@ -22,6 +22,7 @@
#include "AudioChannelService.h"
#include "AudioDestinationNode.h"
#include "AudioListener.h"
+#include "AudioNodeStream.h"
#include "AudioStream.h"
#include "BiquadFilterNode.h"
#include "ChannelMergerNode.h"
diff --git a/dom/media/webaudio/AudioDestinationNode.cpp b/dom/media/webaudio/AudioDestinationNode.cpp
index 29a9de736..f23eb0377 100644
--- a/dom/media/webaudio/AudioDestinationNode.cpp
+++ b/dom/media/webaudio/AudioDestinationNode.cpp
@@ -7,6 +7,7 @@
#include "AudioDestinationNode.h"
#include "AlignmentUtils.h"
#include "AudioContext.h"
+#include "mozilla/dom/AudioContextBinding.h"
#include "mozilla/dom/AudioDestinationNodeBinding.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/Services.h"
diff --git a/dom/media/webaudio/AudioEventTimeline.h b/dom/media/webaudio/AudioEventTimeline.h
index ae06ad4db..ba6da56a3 100644
--- a/dom/media/webaudio/AudioEventTimeline.h
+++ b/dom/media/webaudio/AudioEventTimeline.h
@@ -13,6 +13,7 @@
#include "mozilla/PodOperations.h"
#include "MainThreadUtils.h"
+#include "MediaStreamGraph.h"
#include "nsTArray.h"
#include "math.h"
#include "WebAudioUtils.h"
diff --git a/dom/media/webaudio/AudioNodeEngine.cpp b/dom/media/webaudio/AudioNodeEngine.cpp
index 91170adb3..89eefef31 100644
--- a/dom/media/webaudio/AudioNodeEngine.cpp
+++ b/dom/media/webaudio/AudioNodeEngine.cpp
@@ -14,6 +14,7 @@
#include "AlignmentUtils.h"
#include "AudioNodeEngineSSE2.h"
#endif
+#include "AudioBlock.h"
namespace mozilla {
diff --git a/dom/media/webaudio/AudioNodeStream.cpp b/dom/media/webaudio/AudioNodeStream.cpp
index 0e5aa3fc7..ba002b70e 100644
--- a/dom/media/webaudio/AudioNodeStream.cpp
+++ b/dom/media/webaudio/AudioNodeStream.cpp
@@ -5,6 +5,7 @@
#include "AudioNodeStream.h"
+#include "AlignmentUtils.h"
#include "MediaStreamGraphImpl.h"
#include "MediaStreamListener.h"
#include "AudioNodeEngine.h"
diff --git a/dom/media/webaudio/ConstantSourceNode.cpp b/dom/media/webaudio/ConstantSourceNode.cpp
index b6884105c..8b9df7c89 100644
--- a/dom/media/webaudio/ConstantSourceNode.cpp
+++ b/dom/media/webaudio/ConstantSourceNode.cpp
@@ -7,6 +7,8 @@
#include "ConstantSourceNode.h"
#include "AudioDestinationNode.h"
+#include "AudioNodeEngine.h"
+#include "AudioNodeStream.h"
#include "nsContentUtils.h"
namespace mozilla {
diff --git a/dom/media/webaudio/DelayBuffer.h b/dom/media/webaudio/DelayBuffer.h
index e55d0ba83..e6c9434bf 100644
--- a/dom/media/webaudio/DelayBuffer.h
+++ b/dom/media/webaudio/DelayBuffer.h
@@ -8,6 +8,7 @@
#define DelayBuffer_h_
#include "nsTArray.h"
+#include "AudioBlock.h"
#include "AudioSegment.h"
#include "mozilla/dom/AudioNodeBinding.h" // for ChannelInterpretation
diff --git a/dom/media/webaudio/IIRFilterNode.cpp b/dom/media/webaudio/IIRFilterNode.cpp
index 3a69a94c8..9175cc4c9 100644
--- a/dom/media/webaudio/IIRFilterNode.cpp
+++ b/dom/media/webaudio/IIRFilterNode.cpp
@@ -5,7 +5,13 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "IIRFilterNode.h"
+#include "AlignmentUtils.h"
+#include "AudioBlock.h"
#include "AudioNodeEngine.h"
+#include "AudioNodeStream.h"
+#include "AudioDestinationNode.h"
+#include "PlayingRefChangeHandler.h"
+#include "mozilla/dom/AudioDestinationNodeBinding.h"
#include "blink/IIRFilter.h"
diff --git a/dom/media/webaudio/MediaBufferDecoder.cpp b/dom/media/webaudio/MediaBufferDecoder.cpp
index f3b75ca1a..f590d2f68 100644
--- a/dom/media/webaudio/MediaBufferDecoder.cpp
+++ b/dom/media/webaudio/MediaBufferDecoder.cpp
@@ -16,6 +16,7 @@
#include "DecoderTraits.h"
#include "AudioContext.h"
#include "AudioBuffer.h"
+#include "AudioNodeEngine.h"
#include "nsContentUtils.h"
#include "nsIScriptObjectPrincipal.h"
#include "nsIScriptError.h"
diff --git a/dom/media/webaudio/MediaStreamAudioSourceNode.cpp b/dom/media/webaudio/MediaStreamAudioSourceNode.cpp
index beedd5300..31b276a54 100644
--- a/dom/media/webaudio/MediaStreamAudioSourceNode.cpp
+++ b/dom/media/webaudio/MediaStreamAudioSourceNode.cpp
@@ -9,7 +9,9 @@
#include "AudioNodeEngine.h"
#include "AudioNodeExternalInputStream.h"
#include "AudioStreamTrack.h"
+#include "nsContentUtils.h"
#include "nsIDocument.h"
+#include "nsIScriptError.h"
#include "mozilla/CORSMode.h"
namespace mozilla {
diff --git a/dom/media/webaudio/WebAudioUtils.cpp b/dom/media/webaudio/WebAudioUtils.cpp
index 6289f803b..aa0c7f9ea 100644
--- a/dom/media/webaudio/WebAudioUtils.cpp
+++ b/dom/media/webaudio/WebAudioUtils.cpp
@@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "WebAudioUtils.h"
+#include "AudioEventTimeline.h"
#include "AudioNodeStream.h"
#include "blink/HRTFDatabaseLoader.h"
diff --git a/dom/media/webaudio/moz.build b/dom/media/webaudio/moz.build
index d1a9f5680..c4bfcea60 100644
--- a/dom/media/webaudio/moz.build
+++ b/dom/media/webaudio/moz.build
@@ -75,7 +75,7 @@ EXPORTS.mozilla.dom += [
'WaveShaperNode.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'AnalyserNode.cpp',
'AudioBlock.cpp',
'AudioBuffer.cpp',
diff --git a/dom/media/webm/moz.build b/dom/media/webm/moz.build
index f2898fafd..4dacfe095 100644
--- a/dom/media/webm/moz.build
+++ b/dom/media/webm/moz.build
@@ -11,7 +11,7 @@ EXPORTS += [
'WebMDemuxer.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'WebMBufferedParser.cpp',
'WebMDecoder.cpp',
'WebMDemuxer.cpp',
@@ -19,8 +19,10 @@ UNIFIED_SOURCES += [
if CONFIG['MOZ_WEBM_ENCODER']:
EXPORTS += ['WebMWriter.h']
- UNIFIED_SOURCES += ['EbmlComposer.cpp',
- 'WebMWriter.cpp',
+
+ SOURCES += [
+ 'EbmlComposer.cpp',
+ 'WebMWriter.cpp',
]
CXXFLAGS += CONFIG['MOZ_LIBVPX_CFLAGS']
diff --git a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
index 881d85b4a..e79d8249c 100644
--- a/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineRemoteVideoSource.cpp
@@ -6,6 +6,7 @@
#include "MediaEngineRemoteVideoSource.h"
#include "mozilla/RefPtr.h"
+#include "Layers.h"
#include "VideoUtils.h"
#include "nsIPrefService.h"
#include "MediaTrackConstraints.h"
@@ -15,6 +16,8 @@ extern mozilla::LogModule* GetMediaManagerLog();
#define LOG(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Debug, msg)
#define LOGFRAME(msg) MOZ_LOG(GetMediaManagerLog(), mozilla::LogLevel::Verbose, msg)
+typedef mozilla::gfx::IntSize IntSize;
+
namespace mozilla {
// These need a definition somewhere because template
diff --git a/dom/media/webrtc/MediaEngineTabVideoSource.cpp b/dom/media/webrtc/MediaEngineTabVideoSource.cpp
index d101bab1e..1ac24aae5 100644
--- a/dom/media/webrtc/MediaEngineTabVideoSource.cpp
+++ b/dom/media/webrtc/MediaEngineTabVideoSource.cpp
@@ -29,6 +29,7 @@
namespace mozilla {
using namespace mozilla::gfx;
+using namespace mozilla::dom;
NS_IMPL_ISUPPORTS(MediaEngineTabVideoSource, nsIDOMEventListener, nsITimerCallback)
diff --git a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
index 1e2e13d01..0eda3aac1 100644
--- a/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
+++ b/dom/media/webrtc/MediaEngineWebRTCAudio.cpp
@@ -9,6 +9,7 @@
#include "MediaTrackConstraints.h"
#include "mtransport/runnable_utils.h"
#include "nsAutoPtr.h"
+#include "nsContentUtils.h"
// scoped_ptr.h uses FF
#ifdef FF
diff --git a/dom/media/webrtc/MediaTrackConstraints.cpp b/dom/media/webrtc/MediaTrackConstraints.cpp
index 6225b6d49..42582e3c2 100644
--- a/dom/media/webrtc/MediaTrackConstraints.cpp
+++ b/dom/media/webrtc/MediaTrackConstraints.cpp
@@ -5,6 +5,7 @@
#include "MediaTrackConstraints.h"
#include "mozilla/dom/MediaStreamTrackBinding.h"
+#include "mozilla/Unused.h"
#include <limits>
#include <algorithm>
diff --git a/dom/media/webrtc/PeerIdentity.h b/dom/media/webrtc/PeerIdentity.h
index bdfa1d2b3..1f3413bf6 100644
--- a/dom/media/webrtc/PeerIdentity.h
+++ b/dom/media/webrtc/PeerIdentity.h
@@ -13,6 +13,8 @@
#include "nsStringAPI.h"
#endif
+#include "mozilla/RefCounted.h"
+
template <class T> class nsCOMPtr;
class nsIIDNService;
diff --git a/dom/media/webrtc/moz.build b/dom/media/webrtc/moz.build
index 66def8719..5b76e17cb 100644
--- a/dom/media/webrtc/moz.build
+++ b/dom/media/webrtc/moz.build
@@ -31,15 +31,14 @@ if CONFIG['MOZ_WEBRTC']:
UNIFIED_SOURCES += [
'MediaEngineCameraVideoSource.cpp',
'MediaEngineRemoteVideoSource.cpp',
+ ]
+ SOURCES += [
'MediaEngineTabVideoSource.cpp',
+ 'MediaEngineWebRTC.cpp',
'MediaEngineWebRTCAudio.cpp',
'RTCCertificate.cpp',
'RTCIdentityProviderRegistrar.cpp',
]
- # MediaEngineWebRTC.cpp needs to be built separately.
- SOURCES += [
- 'MediaEngineWebRTC.cpp',
- ]
LOCAL_INCLUDES += [
'/dom/base',
'/media/libyuv/include',
@@ -53,8 +52,10 @@ XPIDL_SOURCES += [
]
UNIFIED_SOURCES += [
- 'MediaEngineDefault.cpp',
'MediaTrackConstraints.cpp',
+]
+SOURCES += [
+ 'MediaEngineDefault.cpp',
'PeerIdentity.cpp',
]
diff --git a/dom/media/webspeech/recognition/SpeechGrammarList.cpp b/dom/media/webspeech/recognition/SpeechGrammarList.cpp
index d4883378f..925e591aa 100644
--- a/dom/media/webspeech/recognition/SpeechGrammarList.cpp
+++ b/dom/media/webspeech/recognition/SpeechGrammarList.cpp
@@ -10,6 +10,7 @@
#include "mozilla/ErrorResult.h"
#include "nsCOMPtr.h"
#include "nsXPCOMStrings.h"
+#include "SpeechGrammar.h"
#include "SpeechRecognition.h"
namespace mozilla {
diff --git a/dom/media/webspeech/recognition/SpeechGrammarList.h b/dom/media/webspeech/recognition/SpeechGrammarList.h
index dbe7117fe..32c0ddbdd 100644
--- a/dom/media/webspeech/recognition/SpeechGrammarList.h
+++ b/dom/media/webspeech/recognition/SpeechGrammarList.h
@@ -9,6 +9,7 @@
#include "mozilla/Attributes.h"
#include "nsCOMPtr.h"
+#include "nsTArray.h"
#include "nsCycleCollectionParticipant.h"
#include "nsWrapperCache.h"
diff --git a/dom/media/webspeech/recognition/SpeechRecognition.cpp b/dom/media/webspeech/recognition/SpeechRecognition.cpp
index 48b1177b2..cd57f03ca 100644
--- a/dom/media/webspeech/recognition/SpeechRecognition.cpp
+++ b/dom/media/webspeech/recognition/SpeechRecognition.cpp
@@ -22,6 +22,7 @@
#include "AudioSegment.h"
#include "endpointer.h"
+#include "SpeechGrammar.h"
#include "mozilla/dom/SpeechRecognitionEvent.h"
#include "nsContentUtils.h"
#include "nsIDocument.h"
diff --git a/dom/media/webspeech/recognition/moz.build b/dom/media/webspeech/recognition/moz.build
index 0a26021b0..c296cd40d 100644
--- a/dom/media/webspeech/recognition/moz.build
+++ b/dom/media/webspeech/recognition/moz.build
@@ -31,7 +31,7 @@ if CONFIG['MOZ_WEBSPEECH_POCKETSPHINX']:
'PocketSphinxSpeechRecognitionService.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'endpointer.cc',
'energy_endpointer.cc',
'energy_endpointer_params.cc',
@@ -45,12 +45,12 @@ UNIFIED_SOURCES += [
]
if CONFIG['MOZ_WEBSPEECH_TEST_BACKEND']:
- UNIFIED_SOURCES += [
+ SOURCES += [
'test/FakeSpeechRecognitionService.cpp',
]
if CONFIG['MOZ_WEBSPEECH_POCKETSPHINX']:
- UNIFIED_SOURCES += [
+ SOURCES += [
'PocketSphinxSpeechRecognitionService.cpp',
]
diff --git a/dom/media/webspeech/synth/moz.build b/dom/media/webspeech/synth/moz.build
index bb26515af..7b8c4cd31 100644
--- a/dom/media/webspeech/synth/moz.build
+++ b/dom/media/webspeech/synth/moz.build
@@ -26,7 +26,7 @@ if CONFIG['MOZ_WEBSPEECH']:
'SpeechSynthesisVoice.h',
]
- UNIFIED_SOURCES += [
+ SOURCES += [
'ipc/SpeechSynthesisChild.cpp',
'ipc/SpeechSynthesisParent.cpp',
'nsSpeechTask.cpp',
@@ -37,7 +37,7 @@ if CONFIG['MOZ_WEBSPEECH']:
]
if CONFIG['MOZ_WEBSPEECH_TEST_BACKEND']:
- UNIFIED_SOURCES += [
+ SOURCES += [
'test/FakeSynthModule.cpp',
'test/nsFakeSynthServices.cpp'
]
diff --git a/dom/media/webspeech/synth/pico/moz.build b/dom/media/webspeech/synth/pico/moz.build
index 01ef30450..8c360bc85 100644
--- a/dom/media/webspeech/synth/pico/moz.build
+++ b/dom/media/webspeech/synth/pico/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'nsPicoService.cpp',
'PicoModule.cpp'
]
diff --git a/dom/media/webspeech/synth/speechd/moz.build b/dom/media/webspeech/synth/speechd/moz.build
index 51d675c10..552ccf856 100644
--- a/dom/media/webspeech/synth/speechd/moz.build
+++ b/dom/media/webspeech/synth/speechd/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'SpeechDispatcherModule.cpp',
'SpeechDispatcherService.cpp'
]
diff --git a/dom/media/webspeech/synth/windows/moz.build b/dom/media/webspeech/synth/windows/moz.build
index f0ff9f2c9..2ab20c05a 100644
--- a/dom/media/webspeech/synth/windows/moz.build
+++ b/dom/media/webspeech/synth/windows/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'SapiModule.cpp',
'SapiService.cpp'
]
diff --git a/dom/messagechannel/moz.build b/dom/messagechannel/moz.build
index 679d7eeb8..6ace4d77f 100644
--- a/dom/messagechannel/moz.build
+++ b/dom/messagechannel/moz.build
@@ -13,7 +13,7 @@ EXPORTS.mozilla.dom += [
'MessagePortParent.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'MessageChannel.cpp',
'MessagePort.cpp',
'MessagePortChild.cpp',
@@ -22,9 +22,7 @@ UNIFIED_SOURCES += [
'SharedMessagePortMessage.cpp',
]
-IPDL_SOURCES += [
- 'PMessagePort.ipdl',
-]
+IPDL_SOURCES += ['PMessagePort.ipdl']
LOCAL_INCLUDES += [
'../base',
diff --git a/dom/network/TCPServerSocketParent.cpp b/dom/network/TCPServerSocketParent.cpp
index 8f98d8b78..aec0ad198 100644
--- a/dom/network/TCPServerSocketParent.cpp
+++ b/dom/network/TCPServerSocketParent.cpp
@@ -4,15 +4,18 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include "TCPServerSocketParent.h"
+
#include "nsIScriptSecurityManager.h"
+#include "TCPSocket.h"
#include "TCPServerSocket.h"
-#include "TCPServerSocketParent.h"
#include "nsJSUtils.h"
#include "TCPSocketParent.h"
#include "mozilla/Unused.h"
#include "mozilla/AppProcessChecker.h"
#include "mozilla/dom/ContentParent.h"
#include "mozilla/dom/TabParent.h"
+#include "mozilla/dom/TCPServerSocketEvent.h"
namespace mozilla {
namespace dom {
diff --git a/dom/network/TCPSocket.cpp b/dom/network/TCPSocket.cpp
index 38827a9ac..3f4fb696e 100644
--- a/dom/network/TCPSocket.cpp
+++ b/dom/network/TCPSocket.cpp
@@ -6,7 +6,9 @@
#include "mozilla/ErrorResult.h"
#include "TCPSocket.h"
#include "TCPServerSocket.h"
+#include "TCPSocketParent.h"
#include "TCPSocketChild.h"
+#include "mozilla/Unused.h"
#include "mozilla/dom/DOMError.h"
#include "mozilla/dom/TCPSocketBinding.h"
#include "mozilla/dom/TCPSocketErrorEvent.h"
diff --git a/dom/network/TCPSocketParent.cpp b/dom/network/TCPSocketParent.cpp
index 54167234e..5fd53067d 100644
--- a/dom/network/TCPSocketParent.cpp
+++ b/dom/network/TCPSocketParent.cpp
@@ -5,6 +5,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "TCPSocketParent.h"
+#include "TCPSocket.h"
#include "jsapi.h"
#include "jsfriendapi.h"
#include "nsJSUtils.h"
diff --git a/dom/network/UDPSocket.cpp b/dom/network/UDPSocket.cpp
index e275e3902..3e18463ae 100644
--- a/dom/network/UDPSocket.cpp
+++ b/dom/network/UDPSocket.cpp
@@ -17,6 +17,8 @@
#include "nsINetAddr.h"
#include "nsStringStream.h"
+using namespace mozilla::net;
+
namespace mozilla {
namespace dom {
diff --git a/dom/network/UDPSocketChild.cpp b/dom/network/UDPSocketChild.cpp
index d205e7e8a..9d6ec0978 100644
--- a/dom/network/UDPSocketChild.cpp
+++ b/dom/network/UDPSocketChild.cpp
@@ -5,6 +5,8 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "UDPSocketChild.h"
+
+#include "UDPSocket.h"
#include "mozilla/Unused.h"
#include "mozilla/ipc/InputStreamUtils.h"
#include "mozilla/net/NeckoChild.h"
diff --git a/dom/network/UDPSocketParent.cpp b/dom/network/UDPSocketParent.cpp
index 904a995ed..2f258badb 100644
--- a/dom/network/UDPSocketParent.cpp
+++ b/dom/network/UDPSocketParent.cpp
@@ -6,9 +6,11 @@
#include "nsIServiceManager.h"
#include "UDPSocketParent.h"
+#include "UDPSocket.h"
#include "nsComponentManagerUtils.h"
#include "nsIUDPSocket.h"
#include "nsINetAddr.h"
+#include "nsNetCID.h"
#include "mozilla/AppProcessChecker.h"
#include "mozilla/Unused.h"
#include "mozilla/ipc/InputStreamUtils.h"
@@ -17,9 +19,12 @@
#include "mozilla/net/PNeckoParent.h"
#include "nsIPermissionManager.h"
#include "nsIScriptSecurityManager.h"
+#include "mozilla/dom/ContentParent.h"
#include "mozilla/ipc/PBackgroundParent.h"
#include "mtransport/runnable_utils.h"
+using namespace mozilla::net;
+
namespace mozilla {
namespace dom {
diff --git a/dom/network/moz.build b/dom/network/moz.build
index ffb90d116..79f8fe009 100644
--- a/dom/network/moz.build
+++ b/dom/network/moz.build
@@ -27,7 +27,7 @@ EXPORTS.mozilla.dom.network += [
'UDPSocketParent.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'Connection.cpp',
'TCPServerSocket.cpp',
'TCPServerSocketChild.cpp',
diff --git a/dom/notification/moz.build b/dom/notification/moz.build
index d966b160d..8297daa6b 100644
--- a/dom/notification/moz.build
+++ b/dom/notification/moz.build
@@ -9,9 +9,7 @@ EXTRA_COMPONENTS += [
'NotificationStorage.manifest',
]
-EXTRA_JS_MODULES += [
- 'NotificationDB.jsm'
-]
+EXTRA_JS_MODULES += ['NotificationDB.jsm']
EXPORTS.mozilla.dom += [
'DesktopNotification.h',
@@ -19,7 +17,7 @@ EXPORTS.mozilla.dom += [
'NotificationEvent.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'DesktopNotification.cpp',
'Notification.cpp',
'NotificationEvent.cpp',
@@ -28,6 +26,7 @@ UNIFIED_SOURCES += [
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
+
LOCAL_INCLUDES += [
'/dom/base',
'/dom/ipc',
diff --git a/dom/offline/moz.build b/dom/offline/moz.build
index 1e3c192c5..2baa12496 100644
--- a/dom/offline/moz.build
+++ b/dom/offline/moz.build
@@ -4,15 +4,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-EXPORTS += [
- 'nsDOMOfflineResourceList.h',
-]
-UNIFIED_SOURCES += [
- 'nsDOMOfflineResourceList.cpp',
-]
+EXPORTS += ['nsDOMOfflineResourceList.h']
-LOCAL_INCLUDES += [
- '/dom/base',
-]
+SOURCES += ['nsDOMOfflineResourceList.cpp']
+
+LOCAL_INCLUDES += ['/dom/base']
FINAL_LIBRARY = 'xul'
diff --git a/dom/performance/PerformanceMainThread.cpp b/dom/performance/PerformanceMainThread.cpp
index b95a91ea6..60eccf595 100644
--- a/dom/performance/PerformanceMainThread.cpp
+++ b/dom/performance/PerformanceMainThread.cpp
@@ -6,7 +6,12 @@
#include "PerformanceMainThread.h"
#include "PerformanceNavigation.h"
+#include "PerformanceNavigationTiming.h"
+#include "PerformanceResourceTiming.h"
+#include "PerformanceTiming.h"
#include "nsICacheInfoChannel.h"
+#include "nsITimedChannel.h"
+#include "mozilla/dom/Event.h"
namespace mozilla {
namespace dom {
diff --git a/dom/performance/PerformanceService.cpp b/dom/performance/PerformanceService.cpp
index cf119af89..21d1aaa26 100644
--- a/dom/performance/PerformanceService.cpp
+++ b/dom/performance/PerformanceService.cpp
@@ -9,6 +9,7 @@
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/StaticMutex.h"
#include "mozilla/StaticPtr.h"
+#include "prtime.h"
namespace mozilla {
namespace dom {
diff --git a/dom/performance/PerformanceTiming.cpp b/dom/performance/PerformanceTiming.cpp
index 887a23938..f1d75ca03 100755
--- a/dom/performance/PerformanceTiming.cpp
+++ b/dom/performance/PerformanceTiming.cpp
@@ -6,6 +6,7 @@
#include "PerformanceTiming.h"
#include "mozilla/dom/PerformanceTimingBinding.h"
+#include "nsITimedChannel.h"
namespace mozilla {
namespace dom {
diff --git a/dom/performance/moz.build b/dom/performance/moz.build
index e1f96fec8..454f8f544 100644
--- a/dom/performance/moz.build
+++ b/dom/performance/moz.build
@@ -18,7 +18,7 @@ EXPORTS.mozilla.dom += [
'PerformanceTiming.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'Performance.cpp',
'PerformanceEntry.cpp',
'PerformanceMainThread.cpp',
diff --git a/dom/permission/PermissionUtils.cpp b/dom/permission/PermissionUtils.cpp
index 1bb1c1c0d..a1d4fea43 100644
--- a/dom/permission/PermissionUtils.cpp
+++ b/dom/permission/PermissionUtils.cpp
@@ -4,6 +4,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include "nsIPermissionManager.h"
#include "PermissionUtils.h"
namespace mozilla {
diff --git a/dom/permission/Permissions.cpp b/dom/permission/Permissions.cpp
index ddbfc5ffe..99654055a 100644
--- a/dom/permission/Permissions.cpp
+++ b/dom/permission/Permissions.cpp
@@ -11,6 +11,7 @@
#include "mozilla/dom/Promise.h"
#include "mozilla/Services.h"
#include "nsIPermissionManager.h"
+#include "PermissionStatus.h"
#include "PermissionUtils.h"
namespace mozilla {
diff --git a/dom/permission/moz.build b/dom/permission/moz.build
index 0be8a7535..ea17c738f 100644
--- a/dom/permission/moz.build
+++ b/dom/permission/moz.build
@@ -9,7 +9,7 @@ EXPORTS.mozilla.dom += [
'PermissionStatus.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'PermissionObserver.cpp',
'Permissions.cpp',
'PermissionStatus.cpp',
diff --git a/dom/plugins/base/moz.build b/dom/plugins/base/moz.build
index a159d6fc1..d63ca51ce 100644
--- a/dom/plugins/base/moz.build
+++ b/dom/plugins/base/moz.build
@@ -38,10 +38,12 @@ EXPORTS.mozilla += [
'PluginPRLibrary.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'nsJSNPRuntime.cpp',
+ 'nsNPAPIPlugin.cpp',
'nsNPAPIPluginInstance.cpp',
'nsNPAPIPluginStreamListener.cpp',
+ 'nsPluginHost.cpp',
'nsPluginInstanceOwner.cpp',
'nsPluginModule.cpp',
'nsPluginStreamListenerPeer.cpp',
@@ -49,24 +51,19 @@ UNIFIED_SOURCES += [
'PluginPRLibrary.cpp',
]
-SOURCES += [
- 'nsNPAPIPlugin.cpp', # Conflict with X11 headers
- 'nsPluginHost.cpp', # Conflict with NS_NPAPIPLUGIN_CALLBACK
-]
-
if CONFIG['OS_ARCH'] == 'WINNT':
- UNIFIED_SOURCES += [
+ SOURCES += [
'nsPluginDirServiceProvider.cpp',
'nsPluginNativeWindowWin.cpp',
'nsPluginsDirWin.cpp',
]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
- UNIFIED_SOURCES += [
+ SOURCES += [
'nsPluginNativeWindow.cpp',
'nsPluginsDirDarwin.cpp',
]
else:
- UNIFIED_SOURCES += [
+ SOURCES += [
'nsPluginsDirUnix.cpp',
]
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
@@ -75,7 +72,7 @@ else:
'nsPluginNativeWindowGtk.cpp',
]
else:
- UNIFIED_SOURCES += [
+ SOURCES += [
'nsPluginNativeWindow.cpp',
]
diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp
index ce24b6296..7ee71c8f7 100644
--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
+++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ -36,6 +36,7 @@
#include "nsILoadContext.h"
#include "mozilla/dom/HTMLObjectElementBinding.h"
#include "AudioChannelService.h"
+#include "GeckoProfiler.h"
using namespace mozilla;
using namespace mozilla::dom;
diff --git a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp
index 0f500a1ae..2b5f65ef4 100644
--- a/dom/plugins/base/nsNPAPIPluginStreamListener.cpp
+++ b/dom/plugins/base/nsNPAPIPluginStreamListener.cpp
@@ -9,11 +9,13 @@
#include "nsDirectoryServiceDefs.h"
#include "nsDirectoryServiceUtils.h"
#include "nsIFile.h"
+#include "nsIHttpChannel.h"
#include "nsNetUtil.h"
#include "nsPluginHost.h"
#include "nsNPAPIPlugin.h"
#include "nsPluginLogging.h"
#include "nsPluginStreamListenerPeer.h"
+#include "GeckoProfiler.h"
#include <stdint.h>
#include <algorithm>
diff --git a/dom/plugins/base/nsNPAPIPluginStreamListener.h b/dom/plugins/base/nsNPAPIPluginStreamListener.h
index dd567f99b..cb9c616d0 100644
--- a/dom/plugins/base/nsNPAPIPluginStreamListener.h
+++ b/dom/plugins/base/nsNPAPIPluginStreamListener.h
@@ -10,6 +10,7 @@
#include "nsIHTTPHeaderListener.h"
#include "nsIRequest.h"
#include "nsITimer.h"
+#include "nsCOMPtr.h"
#include "nsCOMArray.h"
#include "nsIOutputStream.h"
#include "nsIPluginInstanceOwner.h"
diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp
index 22c4783ca..0d4dc68cc 100644
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -64,6 +64,7 @@ using mozilla::DefaultXDisplay;
#include "mozilla/IMEStateManager.h"
#include "mozilla/TextComposition.h"
#include "mozilla/AutoRestore.h"
+#include "mozilla/plugins/PluginAsyncSurrogate.h"
#include "nsContentCID.h"
#include "nsWidgetsCID.h"
@@ -90,6 +91,7 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::layers;
+using namespace mozilla::plugins;
static inline nsPoint AsNsPoint(const nsIntPoint &p) {
return nsPoint(p.x, p.y);
diff --git a/dom/plugins/base/nsPluginNativeWindowWin.cpp b/dom/plugins/base/nsPluginNativeWindowWin.cpp
index 106dcaf77..82f851174 100644
--- a/dom/plugins/base/nsPluginNativeWindowWin.cpp
+++ b/dom/plugins/base/nsPluginNativeWindowWin.cpp
@@ -5,6 +5,7 @@
#include "mozilla/BasicEvents.h"
#include "mozilla/DebugOnly.h"
+#include "nsPluginHost.h"
#include "windows.h"
#include "windowsx.h"
diff --git a/dom/plugins/base/nsPluginStreamListenerPeer.cpp b/dom/plugins/base/nsPluginStreamListenerPeer.cpp
index 0476315d5..603f2408c 100644
--- a/dom/plugins/base/nsPluginStreamListenerPeer.cpp
+++ b/dom/plugins/base/nsPluginStreamListenerPeer.cpp
@@ -34,6 +34,7 @@
#include "nsPluginInstanceOwner.h"
#include "nsDataHashtable.h"
#include "nsNullPrincipal.h"
+#include "prtime.h"
#define BYTERANGE_REQUEST_CONTEXT 0x01020304
diff --git a/dom/plugins/base/nsPluginTags.cpp b/dom/plugins/base/nsPluginTags.cpp
index 58b413388..5fd63f377 100644
--- a/dom/plugins/base/nsPluginTags.cpp
+++ b/dom/plugins/base/nsPluginTags.cpp
@@ -13,6 +13,7 @@
#include "nsIBlocklistService.h"
#include "nsIUnicodeDecoder.h"
#include "nsIPlatformCharset.h"
+#include "nsIURI.h"
#include "nsPluginLogging.h"
#include "nsNPAPIPlugin.h"
#include "nsCharSeparatedTokenizer.h"
@@ -26,6 +27,7 @@
using mozilla::dom::EncodingUtils;
using mozilla::dom::FakePluginTagInit;
+using mozilla::dom::FakePluginMimeEntry;
using namespace mozilla;
// These legacy flags are used in the plugin registry. The states are now
diff --git a/dom/plugins/ipc/D3D11SurfaceHolder.h b/dom/plugins/ipc/D3D11SurfaceHolder.h
index 16cd2d182..2d2342347 100644
--- a/dom/plugins/ipc/D3D11SurfaceHolder.h
+++ b/dom/plugins/ipc/D3D11SurfaceHolder.h
@@ -6,6 +6,7 @@
#define _include_dom_plugins_ipc_D3D11SurfaceHolder_h__
#include "ipc/IPCMessageUtils.h"
+#include "mozilla/gfx/2D.h"
#include "mozilla/gfx/Point.h"
#include "mozilla/gfx/Types.h"
diff --git a/dom/plugins/ipc/PluginAsyncSurrogate.h b/dom/plugins/ipc/PluginAsyncSurrogate.h
index 5b6315715..8e69a57a4 100644
--- a/dom/plugins/ipc/PluginAsyncSurrogate.h
+++ b/dom/plugins/ipc/PluginAsyncSurrogate.h
@@ -8,6 +8,7 @@
#define dom_plugins_ipc_PluginAsyncSurrogate_h
#include "mozilla/UniquePtr.h"
+#include "mozilla/WeakPtr.h"
#include "npapi.h"
#include "npfunctions.h"
#include "npruntime.h"
diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp
index 24b1410bc..523dc5c80 100644
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -9,6 +9,8 @@
#include "mozilla/BasicEvents.h"
#include "mozilla/Preferences.h"
+#include "mozilla/D3DMessageUtils.h"
+#include "D3D11SurfaceHolder.h"
#include "PluginInstanceParent.h"
#include "BrowserStreamParent.h"
#include "PluginAsyncSurrogate.h"
@@ -69,8 +71,10 @@ extern const wchar_t* kFlashFullscreenClass;
#include <ApplicationServices/ApplicationServices.h>
#endif // defined(XP_MACOSX)
+using namespace mozilla;
using namespace mozilla::plugins;
using namespace mozilla::layers;
+using namespace mozilla::gfx;
using namespace mozilla::gl;
void
diff --git a/dom/plugins/ipc/PluginModuleParent.cpp b/dom/plugins/ipc/PluginModuleParent.cpp
index 4a509676d..6ea205ef0 100755
--- a/dom/plugins/ipc/PluginModuleParent.cpp
+++ b/dom/plugins/ipc/PluginModuleParent.cpp
@@ -29,10 +29,14 @@
#include "nsNPAPIPlugin.h"
#include "nsPrintfCString.h"
#include "prsystem.h"
+#include "PluginBackgroundDestroyer.h"
#include "PluginQuirks.h"
+#include "PluginStreamParent.h"
+#include "StreamNotifyParent.h"
#include "GeckoProfiler.h"
#include "nsPluginTags.h"
#include "nsUnicharUtils.h"
+#include "mozilla/layers/ImageBridgeChild.h"
#include "mozilla/layers/TextureClientRecycleAllocator.h"
#ifdef XP_WIN
@@ -56,6 +60,7 @@ using mozilla::ipc::MessageChannel;
using mozilla::ipc::GeckoChildProcessHost;
using namespace mozilla;
+using namespace mozilla::layers;
using namespace mozilla::plugins;
using namespace mozilla::plugins::parent;
diff --git a/dom/plugins/ipc/PluginQuirks.h b/dom/plugins/ipc/PluginQuirks.h
index f0a6b6a30..66dc8fba6 100644
--- a/dom/plugins/ipc/PluginQuirks.h
+++ b/dom/plugins/ipc/PluginQuirks.h
@@ -7,6 +7,8 @@
#ifndef dom_plugins_PluginQuirks_h
#define dom_plugins_PluginQuirks_h
+#include "nsString.h"
+
namespace mozilla {
namespace plugins {
diff --git a/dom/plugins/ipc/PluginUtilsWin.h b/dom/plugins/ipc/PluginUtilsWin.h
index 097ae5262..a1a7c2aa6 100644
--- a/dom/plugins/ipc/PluginUtilsWin.h
+++ b/dom/plugins/ipc/PluginUtilsWin.h
@@ -8,6 +8,7 @@
#define dom_plugins_PluginUtilsWin_h 1
#include "npapi.h"
+#include "PluginModuleParent.h"
namespace mozilla {
namespace plugins {
diff --git a/dom/plugins/ipc/hangui/moz.build b/dom/plugins/ipc/hangui/moz.build
index 0b84cfb8f..52c2f1495 100644
--- a/dom/plugins/ipc/hangui/moz.build
+++ b/dom/plugins/ipc/hangui/moz.build
@@ -6,7 +6,7 @@
Program('plugin-hang-ui')
-UNIFIED_SOURCES += [
+SOURCES += [
'MiniShmChild.cpp',
'PluginHangUIChild.cpp',
]
diff --git a/dom/plugins/ipc/interpose/moz.build b/dom/plugins/ipc/interpose/moz.build
index 8bd8ee651..10171afd0 100644
--- a/dom/plugins/ipc/interpose/moz.build
+++ b/dom/plugins/ipc/interpose/moz.build
@@ -6,7 +6,7 @@
SharedLibrary('plugin_child_interpose')
-UNIFIED_SOURCES += [ "%s.mm" % (LIBRARY_NAME) ]
+SOURCES += [ "%s.mm" % (LIBRARY_NAME) ]
OS_LIBS += ['-framework Carbon']
diff --git a/dom/plugins/ipc/moz.build b/dom/plugins/ipc/moz.build
index 051d5a3b4..182a11562 100644
--- a/dom/plugins/ipc/moz.build
+++ b/dom/plugins/ipc/moz.build
@@ -48,13 +48,11 @@ if CONFIG['OS_ARCH'] == 'WINNT':
EXPORTS.mozilla.plugins += [
'PluginSurfaceParent.h',
]
- UNIFIED_SOURCES += [
+ SOURCES += [
+ 'MiniShmParent.cpp',
'PluginHangUIParent.cpp',
'PluginSurfaceParent.cpp',
]
- SOURCES += [
- 'MiniShmParent.cpp', # Issues with CreateEvent
- ]
DEFINES['MOZ_HANGUI_PROCESS_NAME'] = '"plugin-hang-ui%s"' % CONFIG['BIN_SUFFIX']
LOCAL_INCLUDES += [
'/widget',
@@ -66,15 +64,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
'PluginInterposeOSX.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'BrowserStreamChild.cpp',
'BrowserStreamParent.cpp',
'ChildAsyncCall.cpp',
'ChildTimer.cpp',
'PluginAsyncSurrogate.cpp',
'PluginBackgroundDestroyer.cpp',
+ 'PluginInstanceChild.cpp',
'PluginInstanceParent.cpp',
'PluginMessageUtils.cpp',
+ 'PluginModuleChild.cpp',
'PluginModuleParent.cpp',
'PluginProcessChild.cpp',
'PluginProcessParent.cpp',
@@ -83,23 +83,18 @@ UNIFIED_SOURCES += [
'PluginScriptableObjectParent.cpp',
'PluginStreamChild.cpp',
'PluginStreamParent.cpp',
-]
-
-SOURCES += [
- 'PluginInstanceChild.cpp', # 'PluginThreadCallback' : ambiguous symbol
- 'PluginModuleChild.cpp', # Redefinition of mozilla::WindowsDllInterceptor sUser32Intercept
'PluginWidgetChild.cpp',
'PluginWidgetParent.cpp',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
- UNIFIED_SOURCES += [
+ SOURCES += [
'PluginInterposeOSX.mm',
'PluginUtilsOSX.mm',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
- UNIFIED_SOURCES += [
+ SOURCES += [
'D3D11SurfaceHolder.cpp',
'PluginUtilsWin.cpp'
]
diff --git a/dom/power/moz.build b/dom/power/moz.build
index cdd99264d..5474ebada 100644
--- a/dom/power/moz.build
+++ b/dom/power/moz.build
@@ -21,7 +21,7 @@ EXPORTS.mozilla.dom.power += [
'Types.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'PowerManager.cpp',
'PowerManagerService.cpp',
'WakeLock.cpp',
diff --git a/dom/push/PushSubscriptionOptions.cpp b/dom/push/PushSubscriptionOptions.cpp
index 39252e9e8..8f6ce5499 100644
--- a/dom/push/PushSubscriptionOptions.cpp
+++ b/dom/push/PushSubscriptionOptions.cpp
@@ -6,6 +6,7 @@
#include "mozilla/dom/PushSubscriptionOptionsBinding.h"
#include "mozilla/HoldDropJSObjects.h"
+#include "PushUtil.h"
namespace mozilla {
namespace dom {
diff --git a/dom/push/PushUtil.cpp b/dom/push/PushUtil.cpp
index 408b62048..1aba0e066 100644
--- a/dom/push/PushUtil.cpp
+++ b/dom/push/PushUtil.cpp
@@ -3,6 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/PushUtil.h"
+#include "mozilla/dom/UnionTypes.h" // for OwningArrayBufferViewOrArrayBuffer
namespace mozilla {
namespace dom {
diff --git a/dom/push/PushUtil.h b/dom/push/PushUtil.h
index 548ae2349..71a7af478 100644
--- a/dom/push/PushUtil.h
+++ b/dom/push/PushUtil.h
@@ -7,6 +7,7 @@
#include "nsTArray.h"
+#include "mozilla/ErrorResult.h"
#include "mozilla/dom/TypedArray.h"
namespace mozilla {
diff --git a/dom/push/moz.build b/dom/push/moz.build
index d138b270c..ca72c5f5d 100644
--- a/dom/push/moz.build
+++ b/dom/push/moz.build
@@ -37,7 +37,7 @@ EXPORTS.mozilla.dom += [
'PushUtil.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'PushManager.cpp',
'PushNotifier.cpp',
'PushSubscription.cpp',
diff --git a/dom/quota/QuotaManagerService.cpp b/dom/quota/QuotaManagerService.cpp
index fb5f0f3a1..bd811dc9b 100644
--- a/dom/quota/QuotaManagerService.cpp
+++ b/dom/quota/QuotaManagerService.cpp
@@ -16,6 +16,7 @@
#include "mozilla/ipc/BackgroundParent.h"
#include "mozilla/ipc/BackgroundUtils.h"
#include "mozilla/ipc/PBackgroundChild.h"
+#include "nsContentUtils.h"
#include "nsIIdleService.h"
#include "nsIIPCBackgroundChildCreateCallback.h"
#include "nsIObserverService.h"
diff --git a/dom/quota/QuotaRequests.cpp b/dom/quota/QuotaRequests.cpp
index 369bc790c..7d1c37731 100644
--- a/dom/quota/QuotaRequests.cpp
+++ b/dom/quota/QuotaRequests.cpp
@@ -8,6 +8,7 @@
#include "ActorsChild.h"
#include "nsIQuotaCallbacks.h"
+#include "nsIVariant.h"
namespace mozilla {
namespace dom {
diff --git a/dom/quota/QuotaResults.h b/dom/quota/QuotaResults.h
index 73fe6b790..246bfe9c9 100644
--- a/dom/quota/QuotaResults.h
+++ b/dom/quota/QuotaResults.h
@@ -8,6 +8,7 @@
#define mozilla_dom_quota_QuotaResults_h
#include "nsIQuotaResults.h"
+#include "nsString.h"
namespace mozilla {
namespace dom {
diff --git a/dom/quota/StorageManager.cpp b/dom/quota/StorageManager.cpp
index 4e9f0cf8c..3aad3c3e7 100644
--- a/dom/quota/StorageManager.cpp
+++ b/dom/quota/StorageManager.cpp
@@ -13,9 +13,12 @@
#include "mozilla/ErrorResult.h"
#include "nsIQuotaCallbacks.h"
#include "nsIQuotaRequests.h"
+#include "nsIQuotaResults.h"
#include "nsPIDOMWindow.h"
+#include "QuotaManagerService.h"
using namespace mozilla::dom::workers;
+using namespace mozilla::dom::quota;
namespace mozilla {
namespace dom {
diff --git a/dom/quota/StorageManager.h b/dom/quota/StorageManager.h
index 162390f48..11dc01b6f 100644
--- a/dom/quota/StorageManager.h
+++ b/dom/quota/StorageManager.h
@@ -7,8 +7,10 @@
#ifndef mozilla_dom_StorageManager_h
#define mozilla_dom_StorageManager_h
+#include "mozilla/ErrorResult.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
+#include "nsIGlobalObject.h"
#include "nsISupports.h"
#include "nsWrapperCache.h"
diff --git a/dom/quota/moz.build b/dom/quota/moz.build
index 66c4f4f45..182696569 100644
--- a/dom/quota/moz.build
+++ b/dom/quota/moz.build
@@ -31,7 +31,7 @@ EXPORTS.mozilla.dom.quota += [
'UsageInfo.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'ActorsChild.cpp',
'ActorsParent.cpp',
'FileStreams.cpp',
diff --git a/dom/security/SRICheck.h b/dom/security/SRICheck.h
index 82929fe36..46de0532f 100644
--- a/dom/security/SRICheck.h
+++ b/dom/security/SRICheck.h
@@ -9,6 +9,7 @@
#include "nsCOMPtr.h"
#include "nsICryptoHash.h"
+#include "nsString.h"
class nsIChannel;
class nsIUnicharStreamLoader;
diff --git a/dom/security/moz.build b/dom/security/moz.build
index 00f7376a8..587e1e898 100644
--- a/dom/security/moz.build
+++ b/dom/security/moz.build
@@ -24,12 +24,15 @@ EXPORTS += [
]
UNIFIED_SOURCES += [
+ 'nsCSPContext.cpp',
+ 'nsCSPUtils.cpp',
+]
+
+SOURCES += [
'ContentVerifier.cpp',
'nsContentSecurityManager.cpp',
- 'nsCSPContext.cpp',
'nsCSPParser.cpp',
'nsCSPService.cpp',
- 'nsCSPUtils.cpp',
'nsMixedContentBlocker.cpp',
'SRICheck.cpp',
'SRIMetadata.cpp',
diff --git a/dom/security/nsCSPParser.h b/dom/security/nsCSPParser.h
index d500a1c18..59f5d2d6d 100644
--- a/dom/security/nsCSPParser.h
+++ b/dom/security/nsCSPParser.h
@@ -7,6 +7,7 @@
#ifndef nsCSPParser_h___
#define nsCSPParser_h___
+#include "nsCSPContext.h"
#include "nsCSPUtils.h"
#include "nsIURI.h"
#include "nsString.h"
diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp
index 6d4f297d6..e9f218c14 100644
--- a/dom/security/nsCSPUtils.cpp
+++ b/dom/security/nsCSPUtils.cpp
@@ -17,6 +17,10 @@
#include "nsIURL.h"
#include "nsReadableUtils.h"
#include "nsSandboxFlags.h"
+#include "nsString.h"
+#include "mozilla/Logging.h"
+
+using namespace mozilla;
#define DEFAULT_PORT -1
@@ -30,6 +34,29 @@ GetCspUtilsLog()
#define CSPUTILSLOG(args) MOZ_LOG(GetCspUtilsLog(), mozilla::LogLevel::Debug, args)
#define CSPUTILSLOGENABLED() MOZ_LOG_TEST(GetCspUtilsLog(), mozilla::LogLevel::Debug)
+static const char16_t PERCENT_SIGN = '%';
+
+static bool
+isCharacterToken(char16_t aSymbol)
+{
+ return (aSymbol >= 'a' && aSymbol <= 'z') ||
+ (aSymbol >= 'A' && aSymbol <= 'Z');
+}
+
+static bool
+isNumberToken(char16_t aSymbol)
+{
+ return (aSymbol >= '0' && aSymbol <= '9');
+}
+
+static bool
+isValidHexDig(char16_t aHexDig)
+{
+ return (isNumberToken(aHexDig) ||
+ (aHexDig >= 'A' && aHexDig <= 'F') ||
+ (aHexDig >= 'a' && aHexDig <= 'f'));
+}
+
void
CSP_PercentDecodeStr(const nsAString& aEncStr, nsAString& outDecStr)
{
diff --git a/dom/security/nsContentSecurityManager.cpp b/dom/security/nsContentSecurityManager.cpp
index 5c6701992..298dc810e 100644
--- a/dom/security/nsContentSecurityManager.cpp
+++ b/dom/security/nsContentSecurityManager.cpp
@@ -5,16 +5,26 @@
#include "nsIStreamListener.h"
#include "nsILoadInfo.h"
#include "nsIOService.h"
+#include "nsIProtocolHandler.h"
#include "nsContentUtils.h"
#include "nsCORSListenerProxy.h"
#include "nsIStreamListener.h"
+#include "nsIScriptError.h"
#include "nsCDefaultURIFixup.h"
#include "nsIURIFixup.h"
#include "nsIImageLoadingContent.h"
+#include "nsNetUtil.h"
+#include "mozilla/ArrayUtils.h"
+#include "nsString.h"
+#include "nsMimeTypes.h"
+#include "nsContentPolicyUtils.h"
+#include "nsCharSeparatedTokenizer.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/TabChild.h"
+using namespace mozilla;
+
NS_IMPL_ISUPPORTS(nsContentSecurityManager,
nsIContentSecurityManager,
nsIChannelEventSink)
diff --git a/dom/security/nsMixedContentBlocker.cpp b/dom/security/nsMixedContentBlocker.cpp
index 543429aff..85fb06d8d 100644
--- a/dom/security/nsMixedContentBlocker.cpp
+++ b/dom/security/nsMixedContentBlocker.cpp
@@ -20,6 +20,8 @@
#include "nsIContentViewer.h"
#include "nsIChannel.h"
#include "nsIHttpChannel.h"
+#include "nsIProtocolHandler.h"
+#include "nsIInterfaceRequestorUtils.h"
#include "nsIParentChannel.h"
#include "mozilla/Preferences.h"
#include "nsIScriptObjectPrincipal.h"
@@ -33,12 +35,12 @@
#include "nsAsyncRedirectVerifyHelper.h"
#include "mozilla/LoadInfo.h"
#include "nsISiteSecurityService.h"
+#include "nsNetUtil.h"
#include "mozilla/Logging.h"
#include "mozilla/dom/ContentChild.h"
#include "mozilla/ipc/URIUtils.h"
-
using namespace mozilla;
enum nsMixedContentBlockerMessageType {
diff --git a/dom/smil/moz.build b/dom/smil/moz.build
index 5b37ce642..3c432898f 100644
--- a/dom/smil/moz.build
+++ b/dom/smil/moz.build
@@ -35,7 +35,7 @@ EXPORTS.mozilla.dom += [
'TimeEvent.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'nsSMILAnimationController.cpp',
'nsSMILAnimationFunction.cpp',
'nsSMILCompositor.cpp',
diff --git a/dom/smil/nsSMILAnimationFunction.cpp b/dom/smil/nsSMILAnimationFunction.cpp
index 767181897..cd57054fb 100644
--- a/dom/smil/nsSMILAnimationFunction.cpp
+++ b/dom/smil/nsSMILAnimationFunction.cpp
@@ -24,6 +24,7 @@
#include <math.h>
#include <algorithm>
+using namespace mozilla;
using namespace mozilla::dom;
//----------------------------------------------------------------------
diff --git a/dom/smil/nsSMILCSSProperty.cpp b/dom/smil/nsSMILCSSProperty.cpp
index e74512443..14e428c05 100644
--- a/dom/smil/nsSMILCSSProperty.cpp
+++ b/dom/smil/nsSMILCSSProperty.cpp
@@ -17,6 +17,7 @@
#include "nsIDOMElement.h"
#include "nsIDocument.h"
+using namespace mozilla;
using namespace mozilla::dom;
// Helper function
diff --git a/dom/smil/nsSMILCSSValueType.cpp b/dom/smil/nsSMILCSSValueType.cpp
index ed89e7710..2940c1367 100644
--- a/dom/smil/nsSMILCSSValueType.cpp
+++ b/dom/smil/nsSMILCSSValueType.cpp
@@ -18,6 +18,7 @@
#include "nsDebug.h"
#include "nsStyleUtil.h"
#include "nsIDocument.h"
+#include "nsComputedDOMStyle.h"
using namespace mozilla::dom;
using mozilla::StyleAnimationValue;
diff --git a/dom/smil/nsSMILCompositor.cpp b/dom/smil/nsSMILCompositor.cpp
index fe7b2c828..e7bf60932 100644
--- a/dom/smil/nsSMILCompositor.cpp
+++ b/dom/smil/nsSMILCompositor.cpp
@@ -9,6 +9,9 @@
#include "nsCSSProps.h"
#include "nsHashKeys.h"
#include "nsSMILCSSProperty.h"
+#include "mozilla/CSSEnabledState.h"
+
+using namespace mozilla;
// PLDHashEntryHdr methods
bool
diff --git a/dom/smil/nsSMILInstanceTime.h b/dom/smil/nsSMILInstanceTime.h
index d5a5807e3..4602c9127 100644
--- a/dom/smil/nsSMILInstanceTime.h
+++ b/dom/smil/nsSMILInstanceTime.h
@@ -8,6 +8,7 @@
#define NS_SMILINSTANCETIME_H_
#include "nsSMILTimeValue.h"
+#include "nsISupports.h"
class nsSMILInterval;
class nsSMILTimeContainer;
diff --git a/dom/smil/nsSMILTimeContainer.cpp b/dom/smil/nsSMILTimeContainer.cpp
index 3df8a64ca..e3ebf5b09 100644
--- a/dom/smil/nsSMILTimeContainer.cpp
+++ b/dom/smil/nsSMILTimeContainer.cpp
@@ -11,6 +11,8 @@
#include "mozilla/AutoRestore.h"
+using namespace mozilla;
+
nsSMILTimeContainer::nsSMILTimeContainer()
:
mParent(nullptr),
diff --git a/dom/storage/DOMStorageDBUpdater.cpp b/dom/storage/DOMStorageDBUpdater.cpp
index 8e3f07d7c..61d86ca6c 100644
--- a/dom/storage/DOMStorageDBUpdater.cpp
+++ b/dom/storage/DOMStorageDBUpdater.cpp
@@ -4,12 +4,16 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include "DOMStorageDBThread.h"
#include "DOMStorageManager.h"
#include "mozIStorageBindingParamsArray.h"
#include "mozIStorageBindingParams.h"
#include "mozIStorageValueArray.h"
#include "mozIStorageFunction.h"
+
+#include "mozStorageHelper.h"
+
#include "mozilla/BasePrincipal.h"
#include "nsVariant.h"
#include "mozilla/Services.h"
diff --git a/dom/storage/DOMStorageManager.cpp b/dom/storage/DOMStorageManager.cpp
index 8f50fcfb4..55a360e16 100644
--- a/dom/storage/DOMStorageManager.cpp
+++ b/dom/storage/DOMStorageManager.cpp
@@ -14,6 +14,7 @@
#include "nsNetUtil.h"
#include "nsNetCID.h"
#include "nsIURL.h"
+#include "nsPIDOMWindow.h"
#include "nsPrintfCString.h"
#include "nsXULAppAPI.h"
#include "nsThreadUtils.h"
diff --git a/dom/storage/moz.build b/dom/storage/moz.build
index 47c2fb85f..7d52d6d7b 100644
--- a/dom/storage/moz.build
+++ b/dom/storage/moz.build
@@ -9,7 +9,7 @@ EXPORTS.mozilla.dom += [
'DOMStorageIPC.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'DOMStorage.cpp',
'DOMStorageCache.cpp',
'DOMStorageDBThread.cpp',
@@ -19,16 +19,13 @@ UNIFIED_SOURCES += [
'DOMStorageObserver.cpp',
]
-IPDL_SOURCES += [
- 'PStorage.ipdl',
-]
+IPDL_SOURCES += ['PStorage.ipdl']
include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
-LOCAL_INCLUDES += [
- '/dom/base',
-]
+
+LOCAL_INCLUDES += ['/dom/base']
if CONFIG['ENABLE_TESTS']:
DEFINES['DOM_STORAGE_TESTS'] = True
diff --git a/dom/svg/SVGDocument.cpp b/dom/svg/SVGDocument.cpp
index f992e52f5..8b677d2e3 100644
--- a/dom/svg/SVGDocument.cpp
+++ b/dom/svg/SVGDocument.cpp
@@ -21,6 +21,8 @@
#include "nsSVGElement.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
+#include "nsContentUtils.h"
+#include "nsLayoutUtils.h"
using namespace mozilla::css;
using namespace mozilla::dom;
diff --git a/dom/svg/SVGElementFactory.cpp b/dom/svg/SVGElementFactory.cpp
index abbb0a865..3738275f3 100644
--- a/dom/svg/SVGElementFactory.cpp
+++ b/dom/svg/SVGElementFactory.cpp
@@ -7,9 +7,7 @@
#include "SVGElementFactory.h"
#include "nsGkAtoms.h"
#include "nsIContent.h"
-#include "mozilla/dom/NodeInfo.h"
#include "mozilla/dom/Element.h"
-#include "mozilla/dom/FromParser.h"
using namespace mozilla;
using namespace mozilla::dom;
diff --git a/dom/svg/SVGElementFactory.h b/dom/svg/SVGElementFactory.h
index 3a75ef750..4c57b296d 100644
--- a/dom/svg/SVGElementFactory.h
+++ b/dom/svg/SVGElementFactory.h
@@ -7,6 +7,11 @@
#ifndef mozilla_dom_SVGElementFactory_h
#define mozilla_dom_SVGElementFactory_h
+#include "nsError.h"
+#include "nsIContent.h"
+#include "mozilla/dom/FromParser.h"
+#include "mozilla/dom/NodeInfo.h"
+
class nsIAtom;
namespace mozilla {
diff --git a/dom/svg/SVGGraphicsElement.cpp b/dom/svg/SVGGraphicsElement.cpp
index ba6306680..4b85c9abb 100644
--- a/dom/svg/SVGGraphicsElement.cpp
+++ b/dom/svg/SVGGraphicsElement.cpp
@@ -6,6 +6,8 @@
#include "mozilla/dom/SVGGraphicsElement.h"
+#include "nsContentUtils.h"
+
namespace mozilla {
namespace dom {
diff --git a/dom/svg/SVGSymbolElement.cpp b/dom/svg/SVGSymbolElement.cpp
index 42de96efd..a1b52bfab 100644
--- a/dom/svg/SVGSymbolElement.cpp
+++ b/dom/svg/SVGSymbolElement.cpp
@@ -7,6 +7,8 @@
#include "mozilla/dom/SVGSymbolElement.h"
#include "mozilla/dom/SVGSymbolElementBinding.h"
+#include "nsContentUtils.h"
+
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(Symbol)
namespace mozilla {
diff --git a/dom/svg/SVGTests.cpp b/dom/svg/SVGTests.cpp
index 963ac27e4..03b205f67 100644
--- a/dom/svg/SVGTests.cpp
+++ b/dom/svg/SVGTests.cpp
@@ -11,6 +11,7 @@
#include "nsCharSeparatedTokenizer.h"
#include "nsStyleUtil.h"
#include "mozilla/Preferences.h"
+#include "nsIContentInlines.h"
namespace mozilla {
namespace dom {
diff --git a/dom/svg/moz.build b/dom/svg/moz.build
index 298a7293d..3bbb26dd8 100644
--- a/dom/svg/moz.build
+++ b/dom/svg/moz.build
@@ -101,7 +101,7 @@ EXPORTS.mozilla.dom += [
'SVGZoomEvent.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'DOMSVGAnimatedLengthList.cpp',
'DOMSVGAnimatedNumberList.cpp',
'DOMSVGLength.cpp',
diff --git a/dom/system/moz.build b/dom/system/moz.build
index fc8cf533b..cb0818b34 100644
--- a/dom/system/moz.build
+++ b/dom/system/moz.build
@@ -30,7 +30,7 @@ EXPORTS.mozilla += [
'OSFileConstants.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'nsDeviceSensors.cpp',
'OSFileConstants.cpp',
]
diff --git a/dom/time/moz.build b/dom/time/moz.build
index f6ef682c6..b68f5c089 100644
--- a/dom/time/moz.build
+++ b/dom/time/moz.build
@@ -4,9 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPIDL_SOURCES += [
- 'nsITimeService.idl',
-]
+XPIDL_SOURCES += ['nsITimeService.idl']
XPIDL_MODULE = 'dom_time'
@@ -17,7 +15,7 @@ EXPORTS.mozilla.dom.time += [
'TimeService.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'DateCacheCleaner.cpp',
'TimeChangeObserver.cpp',
'TimeManager.cpp',
diff --git a/dom/u2f/moz.build b/dom/u2f/moz.build
index 1c851e1d8..19325205a 100644
--- a/dom/u2f/moz.build
+++ b/dom/u2f/moz.build
@@ -10,7 +10,7 @@ EXPORTS.mozilla.dom += [
'USBToken.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'NSSU2FTokenRemote.cpp',
'U2F.cpp',
'USBToken.cpp',
diff --git a/dom/url/moz.build b/dom/url/moz.build
index 628b69101..4e88f2723 100644
--- a/dom/url/moz.build
+++ b/dom/url/moz.build
@@ -9,14 +9,12 @@ EXPORTS.mozilla.dom += [
'URLSearchParams.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'URL.cpp',
'URLSearchParams.cpp',
]
-LOCAL_INCLUDES += [
- '../workers',
-]
+LOCAL_INCLUDES += ['../workers']
MOCHITEST_MANIFESTS += ['tests/mochitest.ini']
MOCHITEST_CHROME_MANIFESTS += [ 'tests/chrome.ini' ]
diff --git a/dom/workers/ServiceWorkerCommon.h b/dom/workers/ServiceWorkerCommon.h
index 1c272c125..d7e2ec21b 100644
--- a/dom/workers/ServiceWorkerCommon.h
+++ b/dom/workers/ServiceWorkerCommon.h
@@ -7,6 +7,8 @@
#ifndef mozilla_dom_ServiceWorkerCommon_h
#define mozilla_dom_ServiceWorkerCommon_h
+#include "mozilla/TypedEnumBits.h"
+
namespace mozilla {
namespace dom {
diff --git a/dom/workers/ServiceWorkerEvents.cpp b/dom/workers/ServiceWorkerEvents.cpp
index 8b375c635..a8b69bc48 100644
--- a/dom/workers/ServiceWorkerEvents.cpp
+++ b/dom/workers/ServiceWorkerEvents.cpp
@@ -28,6 +28,7 @@
#include "ServiceWorkerManager.h"
#include "mozilla/ErrorResult.h"
+#include "mozilla/Move.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/BodyUtil.h"
#include "mozilla/dom/DOMException.h"
@@ -50,6 +51,7 @@
#include "WorkerPrivate.h"
#include "xpcpublic.h"
+using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::dom::workers;
diff --git a/dom/workers/ServiceWorkerInfo.cpp b/dom/workers/ServiceWorkerInfo.cpp
index fa08b97a6..04fba7f8e 100644
--- a/dom/workers/ServiceWorkerInfo.cpp
+++ b/dom/workers/ServiceWorkerInfo.cpp
@@ -6,6 +6,8 @@
#include "ServiceWorkerInfo.h"
+#include "ServiceWorker.h"
+#include "ServiceWorkerPrivate.h"
#include "ServiceWorkerScriptCache.h"
BEGIN_WORKERS_NAMESPACE
diff --git a/dom/workers/ServiceWorkerInfo.h b/dom/workers/ServiceWorkerInfo.h
index 80910bdad..8c3220c1a 100644
--- a/dom/workers/ServiceWorkerInfo.h
+++ b/dom/workers/ServiceWorkerInfo.h
@@ -9,6 +9,7 @@
#include "mozilla/dom/ServiceWorkerBinding.h" // For ServiceWorkerState
#include "nsIServiceWorkerManager.h"
+#include "Workers.h"
namespace mozilla {
namespace dom {
diff --git a/dom/workers/ServiceWorkerJob.cpp b/dom/workers/ServiceWorkerJob.cpp
index 3d0a8e2cd..d80dddfb6 100644
--- a/dom/workers/ServiceWorkerJob.cpp
+++ b/dom/workers/ServiceWorkerJob.cpp
@@ -9,6 +9,7 @@
#include "nsProxyRelease.h"
#include "nsThreadUtils.h"
#include "Workers.h"
+#include "ServiceWorkerManager.h"
namespace mozilla {
namespace dom {
diff --git a/dom/workers/ServiceWorkerRegisterJob.cpp b/dom/workers/ServiceWorkerRegisterJob.cpp
index 8f771e762..595c029e1 100644
--- a/dom/workers/ServiceWorkerRegisterJob.cpp
+++ b/dom/workers/ServiceWorkerRegisterJob.cpp
@@ -6,6 +6,7 @@
#include "ServiceWorkerRegisterJob.h"
+#include "ServiceWorkerManager.h"
#include "Workers.h"
namespace mozilla {
diff --git a/dom/workers/ServiceWorkerRegistrationInfo.cpp b/dom/workers/ServiceWorkerRegistrationInfo.cpp
index 26ad74bda..28d9fa9de 100644
--- a/dom/workers/ServiceWorkerRegistrationInfo.cpp
+++ b/dom/workers/ServiceWorkerRegistrationInfo.cpp
@@ -6,6 +6,10 @@
#include "ServiceWorkerRegistrationInfo.h"
+#include "ServiceWorkerManager.h"
+#include "ServiceWorkerPrivate.h"
+#include "nsProxyRelease.h"
+
BEGIN_WORKERS_NAMESPACE
namespace {
diff --git a/dom/workers/ServiceWorkerRegistrationInfo.h b/dom/workers/ServiceWorkerRegistrationInfo.h
index d2d217be0..a7175ef58 100644
--- a/dom/workers/ServiceWorkerRegistrationInfo.h
+++ b/dom/workers/ServiceWorkerRegistrationInfo.h
@@ -8,6 +8,7 @@
#define mozilla_dom_workers_serviceworkerregistrationinfo_h
#include "mozilla/dom/workers/ServiceWorkerInfo.h"
+#include "mozilla/dom/workers/ServiceWorkerCommon.h"
namespace mozilla {
namespace dom {
diff --git a/dom/workers/ServiceWorkerUnregisterJob.cpp b/dom/workers/ServiceWorkerUnregisterJob.cpp
index 8fd76b63d..9fd377700 100644
--- a/dom/workers/ServiceWorkerUnregisterJob.cpp
+++ b/dom/workers/ServiceWorkerUnregisterJob.cpp
@@ -7,6 +7,10 @@
#include "ServiceWorkerUnregisterJob.h"
#include "nsIPushService.h"
+#include "nsServiceManagerUtils.h"
+#include "mozilla/Unused.h"
+#include "Workers.h"
+#include "ServiceWorkerManager.h"
namespace mozilla {
namespace dom {
diff --git a/dom/workers/ServiceWorkerUpdateJob.cpp b/dom/workers/ServiceWorkerUpdateJob.cpp
index 69877dfe4..38f58a3f9 100644
--- a/dom/workers/ServiceWorkerUpdateJob.cpp
+++ b/dom/workers/ServiceWorkerUpdateJob.cpp
@@ -6,9 +6,13 @@
#include "ServiceWorkerUpdateJob.h"
+#include "nsProxyRelease.h"
#include "nsIScriptError.h"
#include "nsIURL.h"
+#include "nsNetUtil.h"
#include "ServiceWorkerScriptCache.h"
+#include "ServiceWorkerPrivate.h"
+#include "ServiceWorkerManager.h"
#include "Workers.h"
namespace mozilla {
diff --git a/dom/workers/ServiceWorkerUpdateJob.h b/dom/workers/ServiceWorkerUpdateJob.h
index 77adb2212..e5bfdc81d 100644
--- a/dom/workers/ServiceWorkerUpdateJob.h
+++ b/dom/workers/ServiceWorkerUpdateJob.h
@@ -8,6 +8,8 @@
#define mozilla_dom_workers_serviceworkerupdatejob_h
#include "ServiceWorkerJob.h"
+#include "ServiceWorkerRegistrationInfo.h"
+#include "nsILoadGroup.h"
namespace mozilla {
namespace dom {
diff --git a/dom/workers/ServiceWorkerWindowClient.cpp b/dom/workers/ServiceWorkerWindowClient.cpp
index bae747214..bf22a7b28 100644
--- a/dom/workers/ServiceWorkerWindowClient.cpp
+++ b/dom/workers/ServiceWorkerWindowClient.cpp
@@ -19,16 +19,19 @@
#include "nsIDocShellLoadInfo.h"
#include "nsIDocument.h"
#include "nsIGlobalObject.h"
+#include "nsIInterfaceRequestor.h"
#include "nsIPrincipal.h"
#include "nsIScriptSecurityManager.h"
#include "nsIWebNavigation.h"
#include "nsIWebProgress.h"
#include "nsIWebProgressListener.h"
+#include "nsNetUtil.h"
#include "nsString.h"
#include "nsWeakReference.h"
#include "ServiceWorker.h"
#include "ServiceWorkerInfo.h"
#include "ServiceWorkerManager.h"
+#include "ServiceWorkerPrivate.h"
#include "WorkerPrivate.h"
#include "WorkerScope.h"
diff --git a/dom/workers/SharedWorker.cpp b/dom/workers/SharedWorker.cpp
index 99bb50339..a9192e626 100644
--- a/dom/workers/SharedWorker.cpp
+++ b/dom/workers/SharedWorker.cpp
@@ -8,6 +8,7 @@
#include "nsPIDOMWindow.h"
+#include "mozilla/dom/Event.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/MessagePort.h"
diff --git a/dom/workers/WorkerRunnable.cpp b/dom/workers/WorkerRunnable.cpp
index 60d69d4e4..8944c751c 100644
--- a/dom/workers/WorkerRunnable.cpp
+++ b/dom/workers/WorkerRunnable.cpp
@@ -14,6 +14,7 @@
#include "mozilla/DebugOnly.h"
#include "mozilla/ErrorResult.h"
+#include "mozilla/Unused.h"
#include "mozilla/dom/ScriptSettings.h"
#include "js/RootingAPI.h"
@@ -22,6 +23,7 @@
#include "WorkerPrivate.h"
#include "WorkerScope.h"
+using namespace mozilla;
USING_WORKERS_NAMESPACE
namespace {
diff --git a/dom/workers/WorkerRunnable.h b/dom/workers/WorkerRunnable.h
index 8249a8053..2c9fb3b1d 100644
--- a/dom/workers/WorkerRunnable.h
+++ b/dom/workers/WorkerRunnable.h
@@ -14,6 +14,7 @@
#include "mozilla/Atomics.h"
#include "nsISupportsImpl.h"
#include "nsThreadUtils.h" /* nsRunnable */
+#include "WorkerHolder.h"
struct JSContext;
class nsIEventTarget;
diff --git a/dom/workers/moz.build b/dom/workers/moz.build
index 9fea84193..0ba7d9ad6 100644
--- a/dom/workers/moz.build
+++ b/dom/workers/moz.build
@@ -22,6 +22,7 @@ EXPORTS.mozilla.dom += [
EXPORTS.mozilla.dom.workers += [
'RuntimeService.h',
+ 'ServiceWorkerCommon.h',
'ServiceWorkerInfo.h',
'ServiceWorkerManager.h',
'ServiceWorkerRegistrationInfo.h',
@@ -46,7 +47,7 @@ XPIDL_SOURCES += [
'nsIWorkerDebuggerManager.idl',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'ChromeWorkerScope.cpp',
'FileReaderSync.cpp',
'Principal.cpp',
diff --git a/dom/worklet/moz.build b/dom/worklet/moz.build
index 80c0bf0c9..7903dcf88 100644
--- a/dom/worklet/moz.build
+++ b/dom/worklet/moz.build
@@ -9,7 +9,7 @@ EXPORTS.mozilla.dom += [
'WorkletGlobalScope.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'Worklet.cpp',
'WorkletGlobalScope.cpp',
]
diff --git a/dom/xbl/moz.build b/dom/xbl/moz.build
index 0950db036..7a8814878 100644
--- a/dom/xbl/moz.build
+++ b/dom/xbl/moz.build
@@ -16,7 +16,7 @@ EXPORTS.mozilla.dom += [
'XBLChildrenElement.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'nsBindingManager.cpp',
'nsXBLBinding.cpp',
'nsXBLContentSink.cpp',
diff --git a/dom/xhr/XMLHttpRequestString.cpp b/dom/xhr/XMLHttpRequestString.cpp
index c668b94f6..c2bde5e0e 100644
--- a/dom/xhr/XMLHttpRequestString.cpp
+++ b/dom/xhr/XMLHttpRequestString.cpp
@@ -12,97 +12,6 @@
namespace mozilla {
namespace dom {
-class XMLHttpRequestStringBuffer final
-{
- friend class XMLHttpRequestStringWriterHelper;
- friend class XMLHttpRequestStringSnapshotReaderHelper;
-
-public:
- NS_INLINE_DECL_THREADSAFE_REFCOUNTING(XMLHttpRequestStringBuffer)
- NS_DECL_OWNINGTHREAD
-
- XMLHttpRequestStringBuffer()
- : mMutex("XMLHttpRequestStringBuffer::mMutex")
- {
- }
-
- uint32_t
- Length()
- {
- MutexAutoLock lock(mMutex);
- return mData.Length();
- }
-
- uint32_t
- UnsafeLength() const
- {
- return mData.Length();
- }
-
- void
- Append(const nsAString& aString)
- {
- NS_ASSERT_OWNINGTHREAD(XMLHttpRequestStringBuffer);
-
- MutexAutoLock lock(mMutex);
- mData.Append(aString);
- }
-
- MOZ_MUST_USE bool
- GetAsString(nsAString& aString)
- {
- MutexAutoLock lock(mMutex);
- return aString.Assign(mData, mozilla::fallible);
- }
-
- size_t
- SizeOfThis(MallocSizeOf aMallocSizeOf) const
- {
- return mData.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
- }
-
- MOZ_MUST_USE bool
- GetAsString(DOMString& aString, uint32_t aLength)
- {
- MutexAutoLock lock(mMutex);
- MOZ_ASSERT(aLength <= mData.Length());
- nsStringBuffer* buf = nsStringBuffer::FromString(mData);
- if (buf) {
- // We have to use SetEphemeralStringBuffer, because once we release our
- // mutex mData can get mutated from some other thread while the DOMString
- // is still alive.
- aString.SetEphemeralStringBuffer(buf, aLength);
- return true;
- }
-
- // We can get here if mData is empty. In that case it won't have an
- // nsStringBuffer....
- MOZ_ASSERT(mData.IsEmpty());
- return aString.AsAString().Assign(mData.BeginReading(), aLength,
- mozilla::fallible);
- }
-
- void
- CreateSnapshot(XMLHttpRequestStringSnapshot& aSnapshot)
- {
- MutexAutoLock lock(mMutex);
- aSnapshot.Set(this, mData.Length());
- }
-
-private:
- ~XMLHttpRequestStringBuffer()
- {}
-
- nsString& UnsafeData()
- {
- return mData;
- }
-
- Mutex mMutex;
-
- // The following member variable is protected by mutex.
- nsString mData;
-};
// ---------------------------------------------------------------------------
// XMLHttpRequestString
diff --git a/dom/xhr/XMLHttpRequestString.h b/dom/xhr/XMLHttpRequestString.h
index b6b12483f..5709c1aa2 100644
--- a/dom/xhr/XMLHttpRequestString.h
+++ b/dom/xhr/XMLHttpRequestString.h
@@ -7,6 +7,9 @@
#ifndef mozilla_dom_XMLHttpRequestString_h
#define mozilla_dom_XMLHttpRequestString_h
+#include "mozilla/Mutex.h"
+#include "mozilla/RefPtr.h"
+#include "mozilla/dom/DOMString.h"
#include "nsString.h"
namespace mozilla {
@@ -155,6 +158,98 @@ private:
MutexAutoLock mLock;
};
+class XMLHttpRequestStringBuffer final
+{
+ friend class XMLHttpRequestStringWriterHelper;
+ friend class XMLHttpRequestStringSnapshotReaderHelper;
+
+public:
+ NS_INLINE_DECL_THREADSAFE_REFCOUNTING(XMLHttpRequestStringBuffer)
+ NS_DECL_OWNINGTHREAD
+
+ XMLHttpRequestStringBuffer()
+ : mMutex("XMLHttpRequestStringBuffer::mMutex")
+ {
+ }
+
+ uint32_t
+ Length()
+ {
+ MutexAutoLock lock(mMutex);
+ return mData.Length();
+ }
+
+ uint32_t
+ UnsafeLength() const
+ {
+ return mData.Length();
+ }
+
+ void
+ Append(const nsAString& aString)
+ {
+ NS_ASSERT_OWNINGTHREAD(XMLHttpRequestStringBuffer);
+
+ MutexAutoLock lock(mMutex);
+ mData.Append(aString);
+ }
+
+ MOZ_MUST_USE bool
+ GetAsString(nsAString& aString)
+ {
+ MutexAutoLock lock(mMutex);
+ return aString.Assign(mData, mozilla::fallible);
+ }
+
+ size_t
+ SizeOfThis(MallocSizeOf aMallocSizeOf) const
+ {
+ return mData.SizeOfExcludingThisIfUnshared(aMallocSizeOf);
+ }
+
+ MOZ_MUST_USE bool
+ GetAsString(DOMString& aString, uint32_t aLength)
+ {
+ MutexAutoLock lock(mMutex);
+ MOZ_ASSERT(aLength <= mData.Length());
+ nsStringBuffer* buf = nsStringBuffer::FromString(mData);
+ if (buf) {
+ // We have to use SetEphemeralStringBuffer, because once we release our
+ // mutex mData can get mutated from some other thread while the DOMString
+ // is still alive.
+ aString.SetEphemeralStringBuffer(buf, aLength);
+ return true;
+ }
+
+ // We can get here if mData is empty. In that case it won't have an
+ // nsStringBuffer....
+ MOZ_ASSERT(mData.IsEmpty());
+ return aString.AsAString().Assign(mData.BeginReading(), aLength,
+ mozilla::fallible);
+ }
+
+ void
+ CreateSnapshot(XMLHttpRequestStringSnapshot& aSnapshot)
+ {
+ MutexAutoLock lock(mMutex);
+ aSnapshot.Set(this, mData.Length());
+ }
+
+private:
+ ~XMLHttpRequestStringBuffer()
+ {}
+
+ nsString& UnsafeData()
+ {
+ return mData;
+ }
+
+ Mutex mMutex;
+
+ // The following member variable is protected by mutex.
+ nsString mData;
+};
+
} // dom namespace
} // mozilla namespace
diff --git a/dom/xhr/XMLHttpRequestWorker.cpp b/dom/xhr/XMLHttpRequestWorker.cpp
index 2af61bd7d..7bec379aa 100644
--- a/dom/xhr/XMLHttpRequestWorker.cpp
+++ b/dom/xhr/XMLHttpRequestWorker.cpp
@@ -33,6 +33,8 @@
#include "WorkerScope.h"
#include "WorkerPrivate.h"
#include "WorkerRunnable.h"
+#include "XMLHttpRequestMainThread.h"
+#include "XMLHttpRequestString.h"
#include "XMLHttpRequestUpload.h"
#include "mozilla/UniquePtr.h"
diff --git a/dom/xhr/moz.build b/dom/xhr/moz.build
index 4ad91deea..d4803015f 100644
--- a/dom/xhr/moz.build
+++ b/dom/xhr/moz.build
@@ -18,7 +18,7 @@ EXPORTS.mozilla.dom += [
'XMLHttpRequestUpload.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'XMLHttpRequest.cpp',
'XMLHttpRequestEventTarget.cpp',
'XMLHttpRequestMainThread.cpp',
diff --git a/dom/xml/moz.build b/dom/xml/moz.build
index f3af9968d..0eb3ee686 100644
--- a/dom/xml/moz.build
+++ b/dom/xml/moz.build
@@ -20,7 +20,7 @@ EXPORTS.mozilla.dom += [
'XMLStylesheetProcessingInstruction.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'CDATASection.cpp',
'nsXMLContentSink.cpp',
'nsXMLElement.cpp',
diff --git a/dom/xml/nsXMLPrettyPrinter.cpp b/dom/xml/nsXMLPrettyPrinter.cpp
index 2e086dde0..7f1f2b07a 100644
--- a/dom/xml/nsXMLPrettyPrinter.cpp
+++ b/dom/xml/nsXMLPrettyPrinter.cpp
@@ -11,6 +11,7 @@
#include "nsIXSLTProcessor.h"
#include "nsSyncLoadService.h"
#include "nsPIDOMWindow.h"
+#include "nsIDOMDocument.h"
#include "nsIDOMElement.h"
#include "nsIServiceManager.h"
#include "nsNetUtil.h"
diff --git a/dom/xslt/base/moz.build b/dom/xslt/base/moz.build
index 7d9cd70fa..d08db4935 100644
--- a/dom/xslt/base/moz.build
+++ b/dom/xslt/base/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'txDouble.cpp',
'txExpandedName.cpp',
'txExpandedNameMap.cpp',
diff --git a/dom/xslt/xml/moz.build b/dom/xslt/xml/moz.build
index f20a27bba..967035466 100644
--- a/dom/xslt/xml/moz.build
+++ b/dom/xslt/xml/moz.build
@@ -4,7 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-UNIFIED_SOURCES += [
+SOURCES += [
'txXMLParser.cpp',
'txXMLUtils.cpp',
]
diff --git a/dom/xslt/xpath/moz.build b/dom/xslt/xpath/moz.build
index 1a7dbf89f..aa989ee91 100644
--- a/dom/xslt/xpath/moz.build
+++ b/dom/xslt/xpath/moz.build
@@ -10,7 +10,7 @@ EXPORTS.mozilla.dom += [
'XPathResult.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'txBooleanExpr.cpp',
'txBooleanResult.cpp',
'txCoreFunctionCall.cpp',
diff --git a/dom/xslt/xslt/moz.build b/dom/xslt/xslt/moz.build
index d629e1d3e..8c9e98a0a 100644
--- a/dom/xslt/xslt/moz.build
+++ b/dom/xslt/xslt/moz.build
@@ -8,7 +8,7 @@ EXPORTS.mozilla.dom += [
'txMozillaXSLTProcessor.h'
]
-UNIFIED_SOURCES += [
+SOURCES += [
'txBufferingHandler.cpp',
'txCurrentFunctionCall.cpp',
'txDocumentFunctionCall.cpp',
diff --git a/dom/xslt/xslt/txExecutionState.cpp b/dom/xslt/xslt/txExecutionState.cpp
index 869c3968b..5caaf77f0 100644
--- a/dom/xslt/xslt/txExecutionState.cpp
+++ b/dom/xslt/xslt/txExecutionState.cpp
@@ -13,6 +13,9 @@
#include "txLog.h"
#include "txURIUtils.h"
#include "txXMLParser.h"
+#include "mozilla/Logging.h"
+
+using mozilla::LogLevel;
const int32_t txExecutionState::kMaxRecursionDepth = 20000;
diff --git a/dom/xslt/xslt/txMozillaXSLTProcessor.cpp b/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
index facb435b4..24c0595dd 100644
--- a/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
+++ b/dom/xslt/xslt/txMozillaXSLTProcessor.cpp
@@ -37,7 +37,9 @@
#include "nsVariant.h"
#include "mozilla/dom/DocumentFragment.h"
#include "mozilla/dom/XSLTProcessorBinding.h"
+#include "mozilla/ErrorResult.h"
+using namespace mozilla;
using namespace mozilla::dom;
static NS_DEFINE_CID(kXMLDocumentCID, NS_XMLDOCUMENT_CID);
diff --git a/dom/xul/moz.build b/dom/xul/moz.build
index 8dff722be..dad38a2c4 100644
--- a/dom/xul/moz.build
+++ b/dom/xul/moz.build
@@ -19,7 +19,7 @@ if CONFIG['MOZ_XUL']:
'nsIXULDocument.h',
]
- UNIFIED_SOURCES += [
+ SOURCES += [
'nsXULCommandDispatcher.cpp',
'nsXULContentSink.cpp',
'nsXULElement.cpp',
@@ -36,7 +36,7 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'xul'
-UNIFIED_SOURCES += [
+SOURCES += [
'nsXULControllers.cpp',
]
diff --git a/dom/xul/nsXULContentSink.cpp b/dom/xul/nsXULContentSink.cpp
index 7103be758..edeee8728 100644
--- a/dom/xul/nsXULContentSink.cpp
+++ b/dom/xul/nsXULContentSink.cpp
@@ -42,6 +42,7 @@
#include "nsReadableUtils.h"
#include "nsXULElement.h"
#include "mozilla/Logging.h"
+#include "mozilla/CheckedInt.h"
#include "prmem.h"
#include "nsCRT.h"
@@ -57,6 +58,7 @@
#include "nsIScriptError.h"
#include "nsContentTypeParser.h"
+using namespace mozilla;
static mozilla::LazyLogModule gContentSinkLog("nsXULContentSink");;
//----------------------------------------------------------------------
diff --git a/dom/xul/templates/moz.build b/dom/xul/templates/moz.build
index 3beb0b7e5..780f01941 100644
--- a/dom/xul/templates/moz.build
+++ b/dom/xul/templates/moz.build
@@ -17,7 +17,7 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'xultmpl'
-UNIFIED_SOURCES += [
+SOURCES += [
'nsContentSupportMap.cpp',
'nsContentTestNode.cpp',
'nsInstantiationNode.cpp',
diff --git a/dom/xul/templates/nsInstantiationNode.cpp b/dom/xul/templates/nsInstantiationNode.cpp
index 9079d4189..ebf12acad 100644
--- a/dom/xul/templates/nsInstantiationNode.cpp
+++ b/dom/xul/templates/nsInstantiationNode.cpp
@@ -8,6 +8,9 @@
#include "nsXULTemplateQueryProcessorRDF.h"
#include "mozilla/Logging.h"
+
+using namespace mozilla;
+
extern mozilla::LazyLogModule gXULTemplateLog;
nsInstantiationNode::nsInstantiationNode(nsXULTemplateQueryProcessorRDF* aProcessor,
diff --git a/dom/xul/templates/nsTemplateMap.h b/dom/xul/templates/nsTemplateMap.h
index cb828b093..dfa7d611a 100644
--- a/dom/xul/templates/nsTemplateMap.h
+++ b/dom/xul/templates/nsTemplateMap.h
@@ -9,6 +9,8 @@
#include "PLDHashTable.h"
#include "nsXULElement.h"
+using mozilla::fallible;
+
class nsTemplateMap {
protected:
struct Entry : public PLDHashEntryHdr {
diff --git a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp
index 732e545d0..ecf6b64c5 100644
--- a/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp
+++ b/dom/xul/templates/nsXULTemplateQueryProcessorRDF.cpp
@@ -35,6 +35,10 @@
#include "nsXULSortService.h"
#include "nsIDocument.h"
+#include "mozilla/Logging.h"
+
+using namespace mozilla;
+
//----------------------------------------------------------------------
#define PARSE_TYPE_INTEGER "Integer"
diff --git a/dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp b/dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp
index a70307bf5..cd7c32eae 100644
--- a/dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp
+++ b/dom/xul/templates/nsXULTemplateQueryProcessorStorage.cpp
@@ -28,6 +28,8 @@
#include "nsIDocument.h"
#include "nsNetUtil.h"
+using mozilla::fallible;
+
//----------------------------------------------------------------------
//
// nsXULTemplateResultSetStorage
diff --git a/dom/xul/templates/nsXULTreeBuilder.cpp b/dom/xul/templates/nsXULTreeBuilder.cpp
index b42133484..3356700be 100644
--- a/dom/xul/templates/nsXULTreeBuilder.cpp
+++ b/dom/xul/templates/nsXULTreeBuilder.cpp
@@ -32,6 +32,9 @@
#include "nsTreeContentView.h"
#include "nsIXULStore.h"
#include "mozilla/BinarySearch.h"
+#include "mozilla/Logging.h"
+
+using mozilla::LogLevel;
// For security check
#include "nsIDocument.h"
diff --git a/layout/build/moz.build b/layout/build/moz.build
index ecf180d78..360fe3c97 100644
--- a/layout/build/moz.build
+++ b/layout/build/moz.build
@@ -10,7 +10,7 @@ EXPORTS += [
'nsLayoutStatics.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'nsContentDLF.cpp',
'nsLayoutModule.cpp',
'nsLayoutStatics.cpp',
diff --git a/layout/build/nsLayoutStatics.cpp b/layout/build/nsLayoutStatics.cpp
index 0f4560afe..124bcbf10 100644
--- a/layout/build/nsLayoutStatics.cpp
+++ b/layout/build/nsLayoutStatics.cpp
@@ -112,11 +112,13 @@
#include "nsApplicationCacheService.h"
#include "mozilla/dom/CustomElementRegistry.h"
#include "mozilla/dom/time/DateCacheCleaner.h"
+#include "mozilla/dom/workers/ServiceWorkerManager.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/IMEStateManager.h"
#include "mozilla/dom/HTMLVideoElement.h"
#include "TouchManager.h"
#include "MediaDecoder.h"
+#include "MediaManager.h"
#include "MediaPrefs.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/StaticPresData.h"
diff --git a/layout/forms/moz.build b/layout/forms/moz.build
index 4fecbad38..50e364ce2 100644
--- a/layout/forms/moz.build
+++ b/layout/forms/moz.build
@@ -18,7 +18,7 @@ EXPORTS += [
'nsITextControlFrame.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'nsButtonFrameRenderer.cpp',
'nsColorControlFrame.cpp',
'nsComboboxControlFrame.cpp',
diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp
index 2e4fa9f67..c6d8e1c4f 100644
--- a/layout/forms/nsHTMLButtonControlFrame.cpp
+++ b/layout/forms/nsHTMLButtonControlFrame.cpp
@@ -7,6 +7,7 @@
#include "nsContainerFrame.h"
#include "nsIFormControlFrame.h"
+#include "nsIFrameInlines.h"
#include "nsPresContext.h"
#include "nsGkAtoms.h"
#include "nsButtonFrameRenderer.h"
diff --git a/layout/forms/nsLegendFrame.cpp b/layout/forms/nsLegendFrame.cpp
index 60056f15d..95efc2c87 100644
--- a/layout/forms/nsLegendFrame.cpp
+++ b/layout/forms/nsLegendFrame.cpp
@@ -12,6 +12,8 @@
#include "nsStyleConsts.h"
#include "nsFormControlFrame.h"
+using namespace mozilla;
+
nsIFrame*
NS_NewLegendFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
{
diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp
index f8fdf3420..a65e5b972 100644
--- a/layout/forms/nsTextControlFrame.cpp
+++ b/layout/forms/nsTextControlFrame.cpp
@@ -55,6 +55,7 @@
#define DEFAULT_COLUMN_WIDTH 20
using namespace mozilla;
+using namespace mozilla::dom;
nsIFrame*
NS_NewTextControlFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
diff --git a/layout/inspector/moz.build b/layout/inspector/moz.build
index 1576b7d14..bbf808292 100644
--- a/layout/inspector/moz.build
+++ b/layout/inspector/moz.build
@@ -26,7 +26,7 @@ EXPORTS += [
'nsFontFaceList.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'inCSSValueSearch.cpp',
'inDeepTreeWalker.cpp',
'inDOMUtils.cpp',
@@ -37,7 +37,7 @@ UNIFIED_SOURCES += [
]
if CONFIG['MOZ_XUL']:
- UNIFIED_SOURCES += [
+ SOURCES += [
'inDOMView.cpp',
]
diff --git a/layout/ipc/moz.build b/layout/ipc/moz.build
index d9cf962ca..919a9df7a 100644
--- a/layout/ipc/moz.build
+++ b/layout/ipc/moz.build
@@ -14,12 +14,9 @@ EXPORTS.mozilla.layout += [
'VsyncParent.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'RenderFrameChild.cpp',
'RenderFrameParent.cpp',
-]
-
-SOURCES += [
'VsyncChild.cpp',
'VsyncParent.cpp',
]
diff --git a/layout/mathml/moz.build b/layout/mathml/moz.build
index f40b2c2c6..07dd446a3 100644
--- a/layout/mathml/moz.build
+++ b/layout/mathml/moz.build
@@ -16,7 +16,7 @@ if CONFIG['ENABLE_TESTS']:
'tests/chrome.ini',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'nsMathMLChar.cpp',
'nsMathMLContainerFrame.cpp',
'nsMathMLFrame.cpp',
diff --git a/layout/mathml/nsMathMLOperators.cpp b/layout/mathml/nsMathMLOperators.cpp
index bbb03014b..9a9f413b4 100644
--- a/layout/mathml/nsMathMLOperators.cpp
+++ b/layout/mathml/nsMathMLOperators.cpp
@@ -7,6 +7,7 @@
#include "nsCOMPtr.h"
#include "nsDataHashtable.h"
#include "nsHashKeys.h"
+#include "nsNetUtil.h"
#include "nsTArray.h"
#include "nsIPersistentProperties2.h"
diff --git a/layout/mathml/nsMathMLmfencedFrame.cpp b/layout/mathml/nsMathMLmfencedFrame.cpp
index ca780e649..a5f5ed4d9 100644
--- a/layout/mathml/nsMathMLmfencedFrame.cpp
+++ b/layout/mathml/nsMathMLmfencedFrame.cpp
@@ -3,13 +3,13 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
#include "nsMathMLmfencedFrame.h"
#include "nsRenderingContext.h"
#include "nsMathMLChar.h"
#include <algorithm>
using namespace mozilla;
+using namespace mozilla::gfx;
//
// <mfenced> -- surround content with a pair of fences
diff --git a/layout/tools/layout-debug/src/moz.build b/layout/tools/layout-debug/src/moz.build
index be7abcab0..b3f7d5e06 100644
--- a/layout/tools/layout-debug/src/moz.build
+++ b/layout/tools/layout-debug/src/moz.build
@@ -15,7 +15,7 @@ EXPORTS += [
'nsLayoutDebugCIID.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'nsDebugFactory.cpp',
'nsLayoutDebugCLH.cpp',
'nsLayoutDebuggingTools.cpp',
diff --git a/old-configure.in b/old-configure.in
index 86cf2ae18..2965f60b7 100644
--- a/old-configure.in
+++ b/old-configure.in
@@ -2113,6 +2113,7 @@ if test "$MOZ_IOS"; then
MOZ_AUTH_EXTENSION=
fi
MOZ_RAW=
+MOZ_AV1=
MOZ_VORBIS=
MOZ_TREMOR=
MOZ_SAMPLE_TYPE_FLOAT32=
@@ -2167,6 +2168,7 @@ MOZ_LDAP_XPCOM=
MOZ_MORK=
MOZ_MAPI_SUPPORT=
MOZ_INCOMPLETE_EXTERNAL_LINKAGE=
+MOZ_CAN_DRAW_IN_TITLEBAR=
case "$target_os" in
mingw*)
@@ -2816,6 +2818,22 @@ fi
AC_SUBST(MOZ_MAPI_SUPPORT)
dnl ========================================================
+dnl = Client drawing in titlebar
+dnl ========================================================
+if test -n "$MOZ_CAN_DRAW_IN_TITLEBAR"; then
+ case "$OS_TARGET" in
+ WINNT|Darwin)
+ AC_DEFINE(MOZ_CAN_DRAW_IN_TITLEBAR)
+ ;;
+ *)
+ AC_MSG_ERROR([Drawing in the titlebar is only supported on Windows and Macintosh targets])
+ ;;
+ esac
+fi
+
+AC_SUBST(MOZ_CAN_DRAW_IN_TITLEBAR)
+
+dnl ========================================================
dnl = Enable WebRTC code
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(webrtc,
@@ -2898,6 +2916,20 @@ fi
AC_SUBST(MOZ_RAW)
dnl ========================================================
+dnl = Enable Libaom AV1 Codec
+dnl ========================================================
+MOZ_ARG_ENABLE_BOOL(av1,
+[ --enable-av1 Enable libaom for av1 video support],
+ MOZ_AV1=1,
+ MOZ_AV1=)
+
+if test -n "$MOZ_AV1"; then
+ AC_DEFINE(MOZ_AV1)
+fi
+
+AC_SUBST(MOZ_AV1)
+
+dnl ========================================================
dnl = Apple platform decoder support
dnl ========================================================
if test "$COMPILE_ENVIRONMENT"; then
@@ -4897,15 +4929,6 @@ AC_SUBST(MOZ_FIX_LINK_PATHS)
AC_SUBST(MOZ_POST_PROGRAM_COMMAND)
AC_SUBST(MOZ_LINKER_EXTRACT)
-AC_SUBST(MOZ_ADDON_SIGNING)
-if test "$MOZ_ADDON_SIGNING" = 1; then
- AC_DEFINE(MOZ_ADDON_SIGNING)
-fi
-AC_SUBST(MOZ_REQUIRE_SIGNING)
-if test "$MOZ_REQUIRE_SIGNING" = 1; then
- AC_DEFINE(MOZ_REQUIRE_SIGNING)
-fi
-
AC_SUBST(MOZ_JSDOWNLOADS)
if test -n "$MOZ_JSDOWNLOADS"; then
AC_DEFINE(MOZ_JSDOWNLOADS)
diff --git a/python/mozbuild/mozbuild/mozinfo.py b/python/mozbuild/mozbuild/mozinfo.py
index 230ca119a..3bdde249c 100755
--- a/python/mozbuild/mozbuild/mozinfo.py
+++ b/python/mozbuild/mozbuild/mozinfo.py
@@ -88,8 +88,6 @@ def build_dict(config, env=os.environ):
d['telemetry'] = substs.get('MOZ_TELEMETRY_REPORTING') == '1'
d['tests_enabled'] = substs.get('ENABLE_TESTS') == "1"
d['bin_suffix'] = substs.get('BIN_SUFFIX', '')
- d['addon_signing'] = substs.get('MOZ_ADDON_SIGNING') == '1'
- d['require_signing'] = substs.get('MOZ_REQUIRE_SIGNING') == '1'
d['official'] = bool(substs.get('MC_OFFICIAL'))
def guess_platform():
diff --git a/toolkit/components/contextualidentity/ContextualIdentityService.jsm b/toolkit/components/contextualidentity/ContextualIdentityService.jsm
deleted file mode 100644
index 6aae3673d..000000000
--- a/toolkit/components/contextualidentity/ContextualIdentityService.jsm
+++ /dev/null
@@ -1,344 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-this.EXPORTED_SYMBOLS = ["ContextualIdentityService"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-const DEFAULT_TAB_COLOR = "#909090";
-const SAVE_DELAY_MS = 1500;
-
-XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
- return Services.strings.createBundle("chrome://browser/locale/browser.properties");
-});
-
-XPCOMUtils.defineLazyGetter(this, "gTextDecoder", function () {
- return new TextDecoder();
-});
-
-XPCOMUtils.defineLazyGetter(this, "gTextEncoder", function () {
- return new TextEncoder();
-});
-
-XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
- "resource://gre/modules/AsyncShutdown.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
- "resource://gre/modules/DeferredTask.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-
-function _ContextualIdentityService(path) {
- this.init(path);
-}
-
-_ContextualIdentityService.prototype = {
- _defaultIdentities: [
- { userContextId: 1,
- public: true,
- icon: "fingerprint",
- color: "blue",
- l10nID: "userContextPersonal.label",
- accessKey: "userContextPersonal.accesskey",
- telemetryId: 1,
- },
- { userContextId: 2,
- public: true,
- icon: "briefcase",
- color: "orange",
- l10nID: "userContextWork.label",
- accessKey: "userContextWork.accesskey",
- telemetryId: 2,
- },
- { userContextId: 3,
- public: true,
- icon: "dollar",
- color: "green",
- l10nID: "userContextBanking.label",
- accessKey: "userContextBanking.accesskey",
- telemetryId: 3,
- },
- { userContextId: 4,
- public: true,
- icon: "cart",
- color: "pink",
- l10nID: "userContextShopping.label",
- accessKey: "userContextShopping.accesskey",
- telemetryId: 4,
- },
- { userContextId: 5,
- public: false,
- icon: "",
- color: "",
- name: "userContextIdInternal.thumbnail",
- accessKey: "" },
- ],
-
- _identities: null,
- _openedIdentities: new Set(),
- _lastUserContextId: 0,
-
- _path: null,
- _dataReady: false,
-
- _saver: null,
-
- init(path) {
- this._path = path;
- this._saver = new DeferredTask(() => this.save(), SAVE_DELAY_MS);
- AsyncShutdown.profileBeforeChange.addBlocker("ContextualIdentityService: writing data",
- () => this._saver.finalize());
-
- this.load();
- },
-
- load() {
- OS.File.read(this._path).then(bytes => {
- // If synchronous loading happened in the meantime, exit now.
- if (this._dataReady) {
- return;
- }
-
- try {
- let data = JSON.parse(gTextDecoder.decode(bytes));
- if (data.version == 1) {
- this.resetDefault();
- }
- if (data.version != 2) {
- dump("ERROR - ContextualIdentityService - Unknown version found in " + this._path + "\n");
- this.loadError(null);
- return;
- }
-
- this._identities = data.identities;
- this._lastUserContextId = data.lastUserContextId;
-
- this._dataReady = true;
- } catch (error) {
- this.loadError(error);
- }
- }, (error) => {
- this.loadError(error);
- });
- },
-
- resetDefault() {
- this._identities = this._defaultIdentities;
- this._lastUserContextId = this._defaultIdentities.length;
-
- this._dataReady = true;
-
- this.saveSoon();
- },
-
- loadError(error) {
- if (error != null &&
- !(error instanceof OS.File.Error && error.becauseNoSuchFile) &&
- !(error instanceof Components.Exception &&
- error.result == Cr.NS_ERROR_FILE_NOT_FOUND)) {
- // Let's report the error.
- Cu.reportError(error);
- }
-
- // If synchronous loading happened in the meantime, exit now.
- if (this._dataReady) {
- return;
- }
-
- this.resetDefault();
- },
-
- saveSoon() {
- this._saver.arm();
- },
-
- save() {
- let object = {
- version: 2,
- lastUserContextId: this._lastUserContextId,
- identities: this._identities
- };
-
- let bytes = gTextEncoder.encode(JSON.stringify(object));
- return OS.File.writeAtomic(this._path, bytes,
- { tmpPath: this._path + ".tmp" });
- },
-
- create(name, icon, color) {
- let identity = {
- userContextId: ++this._lastUserContextId,
- public: true,
- icon,
- color,
- name
- };
-
- this._identities.push(identity);
- this.saveSoon();
-
- return Cu.cloneInto(identity, {});
- },
-
- update(userContextId, name, icon, color) {
- let identity = this._identities.find(identity => identity.userContextId == userContextId &&
- identity.public);
- if (identity && name) {
- identity.name = name;
- identity.color = color;
- identity.icon = icon;
- delete identity.l10nID;
- delete identity.accessKey;
- this.saveSoon();
- }
-
- return !!identity;
- },
-
- remove(userContextId) {
- let index = this._identities.findIndex(i => i.userContextId == userContextId && i.public);
- if (index == -1) {
- return false;
- }
-
- Services.obs.notifyObservers(null, "clear-origin-attributes-data",
- JSON.stringify({ userContextId }));
-
- this._identities.splice(index, 1);
- this._openedIdentities.delete(userContextId);
- this.saveSoon();
-
- return true;
- },
-
- ensureDataReady() {
- if (this._dataReady) {
- return;
- }
-
- try {
- // This reads the file and automatically detects the UTF-8 encoding.
- let inputStream = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- inputStream.init(new FileUtils.File(this._path),
- FileUtils.MODE_RDONLY, FileUtils.PERMS_FILE, 0);
- try {
- let json = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON);
- let data = json.decodeFromStream(inputStream,
- inputStream.available());
- this._identities = data.identities;
- this._lastUserContextId = data.lastUserContextId;
-
- this._dataReady = true;
- } finally {
- inputStream.close();
- }
- } catch (error) {
- this.loadError(error);
- return;
- }
- },
-
- getIdentities() {
- this.ensureDataReady();
- return Cu.cloneInto(this._identities.filter(info => info.public), {});
- },
-
- getPrivateIdentity(name) {
- this.ensureDataReady();
- return Cu.cloneInto(this._identities.find(info => !info.public && info.name == name), {});
- },
-
- getIdentityFromId(userContextId) {
- this.ensureDataReady();
- return Cu.cloneInto(this._identities.find(info => info.userContextId == userContextId &&
- info.public), {});
- },
-
- getUserContextLabel(userContextId) {
- let identity = this.getIdentityFromId(userContextId);
- if (!identity || !identity.public) {
- return "";
- }
-
- // We cannot localize the user-created identity names.
- if (identity.name) {
- return identity.name;
- }
-
- return gBrowserBundle.GetStringFromName(identity.l10nID);
- },
-
- setTabStyle(tab) {
- if (!tab.hasAttribute("usercontextid")) {
- return;
- }
-
- let userContextId = tab.getAttribute("usercontextid");
- let identity = this.getIdentityFromId(userContextId);
- tab.setAttribute("data-identity-color", identity ? identity.color : "");
- },
-
- countContainerTabs() {
- let count = 0;
- this._forEachContainerTab(function() { ++count; });
- return count;
- },
-
- closeAllContainerTabs() {
- this._forEachContainerTab(function(tab, tabbrowser) {
- tabbrowser.removeTab(tab);
- });
- },
-
- _forEachContainerTab(callback) {
- let windowList = Services.wm.getEnumerator("navigator:browser");
- while (windowList.hasMoreElements()) {
- let win = windowList.getNext();
-
- if (win.closed || !win.gBrowser) {
- continue;
- }
-
- let tabbrowser = win.gBrowser;
- for (let i = tabbrowser.tabContainer.childNodes.length - 1; i >= 0; --i) {
- let tab = tabbrowser.tabContainer.childNodes[i];
- if (tab.hasAttribute("usercontextid")) {
- callback(tab, tabbrowser);
- }
- }
- }
- },
-
- telemetry(userContextId) {
- let identity = this.getIdentityFromId(userContextId);
-
- // Let's ignore unknown identities for now.
- if (!identity || !identity.public) {
- return;
- }
-
- if (!this._openedIdentities.has(userContextId)) {
- this._openedIdentities.add(userContextId);
- Services.telemetry.getHistogramById("UNIQUE_CONTAINERS_OPENED").add(1);
- }
-
- Services.telemetry.getHistogramById("TOTAL_CONTAINERS_OPENED").add(1);
-
- if (identity.telemetryId) {
- Services.telemetry.getHistogramById("CONTAINER_USED")
- .add(identity.telemetryId);
- }
- },
-
- createNewInstanceForTesting(path) {
- return new _ContextualIdentityService(path);
- },
-};
-
-let path = OS.Path.join(OS.Constants.Path.profileDir, "containers.json");
-this.ContextualIdentityService = new _ContextualIdentityService(path);
diff --git a/toolkit/components/contextualidentity/moz.build b/toolkit/components/contextualidentity/moz.build
deleted file mode 100644
index 524d5e779..000000000
--- a/toolkit/components/contextualidentity/moz.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXTRA_JS_MODULES += ['ContextualIdentityService.jsm']
diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build
index ff71d7c9d..8c72e4b17 100644
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -21,7 +21,6 @@ DIRS += [
'commandlines',
'console',
'contentprefs',
- 'contextualidentity',
'cookie',
'crashmonitor',
'downloads',
diff --git a/toolkit/components/prompts/content/tabprompts.xml b/toolkit/components/prompts/content/tabprompts.xml
index 07c6c8efb..0ce13203c 100644
--- a/toolkit/components/prompts/content/tabprompts.xml
+++ b/toolkit/components/prompts/content/tabprompts.xml
@@ -323,21 +323,19 @@
let bnum = this.args.defaultButtonNum || 0;
let defaultButton = this.ui["button" + bnum];
- let { AppConstants } =
- Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
- if (AppConstants.platform == "macosx") {
- // On OS X, the default button always stays marked as such (until
- // the entire prompt blurs).
- defaultButton.setAttribute("default", true);
- } else {
- // On other platforms, the default button is only marked as such
- // when no other button has focus. XUL buttons on not-OSX will
- // react to pressing enter as a command, so you can't trigger the
- // default without tabbing to it or something that isn't a button.
- let focusedDefault = (event.originalTarget == defaultButton);
- let someButtonFocused = event.originalTarget instanceof Ci.nsIDOMXULButtonElement;
- defaultButton.setAttribute("default", focusedDefault || !someButtonFocused);
- }
+#ifdef XP_MACOSX
+ // On OS X, the default button always stays marked as such (until
+ // the entire prompt blurs).
+ defaultButton.setAttribute("default", true);
+#else
+ // On other platforms, the default button is only marked as such
+ // when no other button has focus. XUL buttons on not-OSX will
+ // react to pressing enter as a command, so you can't trigger the
+ // default without tabbing to it or something that isn't a button.
+ let focusedDefault = (event.originalTarget == defaultButton);
+ let someButtonFocused = event.originalTarget instanceof Ci.nsIDOMXULButtonElement;
+ defaultButton.setAttribute("default", focusedDefault || !someButtonFocused);
+#endif
</handler>
<handler event="blur">
// If focus shifted to somewhere else in the browser, don't make
diff --git a/toolkit/identity/Identity.jsm b/toolkit/identity/Identity.jsm
deleted file mode 100644
index a27b7c93d..000000000
--- a/toolkit/identity/Identity.jsm
+++ /dev/null
@@ -1,309 +0,0 @@
-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["IdentityService"];
-
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
-Cu.import("resource://gre/modules/identity/IdentityStore.jsm");
-Cu.import("resource://gre/modules/identity/RelyingParty.jsm");
-Cu.import("resource://gre/modules/identity/IdentityProvider.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this,
- "jwcrypto",
- "resource://gre/modules/identity/jwcrypto.jsm");
-
-function log(...aMessageArgs) {
- Logger.log.apply(Logger, ["core"].concat(aMessageArgs));
-}
-function reportError(...aMessageArgs) {
- Logger.reportError.apply(Logger, ["core"].concat(aMessageArgs));
-}
-
-function IDService() {
- Services.obs.addObserver(this, "quit-application-granted", false);
- Services.obs.addObserver(this, "identity-auth-complete", false);
-
- this._store = IdentityStore;
- this.RP = RelyingParty;
- this.IDP = IdentityProvider;
-}
-
-IDService.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
-
- observe: function observe(aSubject, aTopic, aData) {
- switch (aTopic) {
- case "quit-application-granted":
- Services.obs.removeObserver(this, "quit-application-granted");
- this.shutdown();
- break;
- case "identity-auth-complete":
- if (!aSubject || !aSubject.wrappedJSObject)
- break;
- let subject = aSubject.wrappedJSObject;
- log("Auth complete:", aSubject.wrappedJSObject);
- // We have authenticated in order to provision an identity.
- // So try again.
- this.selectIdentity(subject.rpId, subject.identity);
- break;
- }
- },
-
- reset: function reset() {
- // Explicitly call reset() on our RP and IDP classes.
- // This is here to make testing easier. When the
- // quit-application-granted signal is emitted, reset() will be
- // called here, on RP, on IDP, and on the store. So you don't
- // need to use this :)
- this._store.reset();
- this.RP.reset();
- this.IDP.reset();
- },
-
- shutdown: function shutdown() {
- log("shutdown");
- Services.obs.removeObserver(this, "identity-auth-complete");
- // try to prevent abort/crash during shutdown of mochitest-browser2...
- try {
- Services.obs.removeObserver(this, "quit-application-granted");
- } catch (e) {}
- },
-
- /**
- * Parse an email into username and domain if it is valid, else return null
- */
- parseEmail: function parseEmail(email) {
- var match = email.match(/^([^@]+)@([^@^/]+.[a-z]+)$/);
- if (match) {
- return {
- username: match[1],
- domain: match[2]
- };
- }
- return null;
- },
-
- /**
- * The UX wants to add a new identity
- * often followed by selectIdentity()
- *
- * @param aIdentity
- * (string) the email chosen for login
- */
- addIdentity: function addIdentity(aIdentity) {
- if (this._store.fetchIdentity(aIdentity) === null) {
- this._store.addIdentity(aIdentity, null, null);
- }
- },
-
- /**
- * The UX comes back and calls selectIdentity once the user has picked
- * an identity.
- *
- * @param aRPId
- * (integer) the id of the doc object obtained in .watch() and
- * passed to the UX component.
- *
- * @param aIdentity
- * (string) the email chosen for login
- */
- selectIdentity: function selectIdentity(aRPId, aIdentity) {
- log("selectIdentity: RP id:", aRPId, "identity:", aIdentity);
-
- // Get the RP that was stored when watch() was invoked.
- let rp = this.RP._rpFlows[aRPId];
- if (!rp) {
- reportError("selectIdentity", "Invalid RP id: ", aRPId);
- return;
- }
-
- // It's possible that we are in the process of provisioning an
- // identity.
- let provId = rp.provId;
-
- let rpLoginOptions = {
- loggedInUser: aIdentity,
- origin: rp.origin
- };
- log("selectIdentity: provId:", provId, "origin:", rp.origin);
-
- // Once we have a cert, and once the user is authenticated with the
- // IdP, we can generate an assertion and deliver it to the doc.
- let self = this;
- this.RP._generateAssertion(rp.origin, aIdentity, function hadReadyAssertion(err, assertion) {
- if (!err && assertion) {
- self.RP._doLogin(rp, rpLoginOptions, assertion);
- return;
-
- }
- // Need to provision an identity first. Begin by discovering
- // the user's IdP.
- self._discoverIdentityProvider(aIdentity, function gotIDP(err, idpParams) {
- if (err) {
- rp.doError(err);
- return;
- }
-
- // The idpParams tell us where to go to provision and authenticate
- // the identity.
- self.IDP._provisionIdentity(aIdentity, idpParams, provId, function gotID(err, aProvId) {
-
- // Provision identity may have created a new provision flow
- // for us. To make it easier to relate provision flows with
- // RP callers, we cross index the two here.
- rp.provId = aProvId;
- self.IDP._provisionFlows[aProvId].rpId = aRPId;
-
- // At this point, we already have a cert. If the user is also
- // already authenticated with the IdP, then we can try again
- // to generate an assertion and login.
- if (err) {
- // We are not authenticated. If we have already tried to
- // authenticate and failed, then this is a "hard fail" and
- // we give up. Otherwise we try to authenticate with the
- // IdP.
-
- if (self.IDP._provisionFlows[aProvId].didAuthentication) {
- self.IDP._cleanUpProvisionFlow(aProvId);
- self.RP._cleanUpProvisionFlow(aRPId, aProvId);
- log("ERROR: selectIdentity: authentication hard fail");
- rp.doError("Authentication fail.");
- return;
- }
- // Try to authenticate with the IdP. Note that we do
- // not clean up the provision flow here. We will continue
- // to use it.
- self.IDP._doAuthentication(aProvId, idpParams);
- return;
- }
-
- // Provisioning flows end when a certificate has been registered.
- // Thus IdentityProvider's registerCertificate() cleans up the
- // current provisioning flow. We only do this here on error.
- self.RP._generateAssertion(rp.origin, aIdentity, function gotAssertion(err, assertion) {
- if (err) {
- rp.doError(err);
- return;
- }
- self.RP._doLogin(rp, rpLoginOptions, assertion);
- self.RP._cleanUpProvisionFlow(aRPId, aProvId);
- return;
- });
- });
- });
- });
- },
-
- // methods for chrome and add-ons
-
- /**
- * Discover the IdP for an identity
- *
- * @param aIdentity
- * (string) the email we're logging in with
- *
- * @param aCallback
- * (function) callback to invoke on completion
- * with first-positional parameter the error.
- */
- _discoverIdentityProvider: function _discoverIdentityProvider(aIdentity, aCallback) {
- // XXX bug 767610 - validate email address call
- // When that is available, we can remove this custom parser
- var parsedEmail = this.parseEmail(aIdentity);
- if (parsedEmail === null) {
- aCallback("Could not parse email: " + aIdentity);
- return;
- }
- log("_discoverIdentityProvider: identity:", aIdentity, "domain:", parsedEmail.domain);
-
- this._fetchWellKnownFile(parsedEmail.domain, function fetchedWellKnown(err, idpParams) {
- // idpParams includes the pk, authorization url, and
- // provisioning url.
-
- // XXX bug 769861 follow any authority delegations
- // if no well-known at any point in the delegation
- // fall back to browserid.org as IdP
- return aCallback(err, idpParams);
- });
- },
-
- /**
- * Fetch the well-known file from the domain.
- *
- * @param aDomain
- *
- * @param aScheme
- * (string) (optional) Protocol to use. Default is https.
- * This is necessary because we are unable to test
- * https.
- *
- * @param aCallback
- *
- */
- _fetchWellKnownFile: function _fetchWellKnownFile(aDomain, aCallback, aScheme='https') {
- // XXX bug 769854 make tests https and remove aScheme option
- let url = aScheme + '://' + aDomain + "/.well-known/browserid";
- log("_fetchWellKnownFile:", url);
-
- // this appears to be a more successful way to get at xmlhttprequest (which supposedly will close with a window
- let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
- .createInstance(Ci.nsIXMLHttpRequest);
-
- // XXX bug 769865 gracefully handle being off-line
- // XXX bug 769866 decide on how to handle redirects
- req.open("GET", url, true);
- req.responseType = "json";
- req.mozBackgroundRequest = true;
- req.onload = function _fetchWellKnownFile_onload() {
- if (req.status < 200 || req.status >= 400) {
- log("_fetchWellKnownFile", url, ": server returned status:", req.status);
- return aCallback("Error");
- }
- try {
- let idpParams = req.response;
-
- // Verify that the IdP returned a valid configuration
- if (! (idpParams.provisioning &&
- idpParams.authentication &&
- idpParams['public-key'])) {
- let errStr= "Invalid well-known file from: " + aDomain;
- log("_fetchWellKnownFile:", errStr);
- return aCallback(errStr);
- }
-
- let callbackObj = {
- domain: aDomain,
- idpParams: idpParams,
- };
- log("_fetchWellKnownFile result: ", callbackObj);
- // Yay. Valid IdP configuration for the domain.
- return aCallback(null, callbackObj);
-
- } catch (err) {
- reportError("_fetchWellKnownFile", "Bad configuration from", aDomain, err);
- return aCallback(err.toString());
- }
- };
- req.onerror = function _fetchWellKnownFile_onerror() {
- log("_fetchWellKnownFile", "ERROR:", req.status, req.statusText);
- log("ERROR: _fetchWellKnownFile:", err);
- return aCallback("Error");
- };
- req.send(null);
- },
-
-};
-
-this.IdentityService = new IDService();
diff --git a/toolkit/identity/IdentityCryptoService.cpp b/toolkit/identity/IdentityCryptoService.cpp
deleted file mode 100644
index cafe07999..000000000
--- a/toolkit/identity/IdentityCryptoService.cpp
+++ /dev/null
@@ -1,571 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIIdentityCryptoService.h"
-#include "mozilla/ModuleUtils.h"
-#include "nsServiceManagerUtils.h"
-#include "nsNSSShutDown.h"
-#include "nsIThread.h"
-#include "nsThreadUtils.h"
-#include "nsCOMPtr.h"
-#include "nsProxyRelease.h"
-#include "nsString.h"
-#include "mozilla/ArrayUtils.h" // ArrayLength
-#include "mozilla/Base64.h"
-#include "ScopedNSSTypes.h"
-#include "NSSErrorsService.h"
-
-#include "nss.h"
-#include "pk11pub.h"
-#include "secmod.h"
-#include "secerr.h"
-#include "keyhi.h"
-#include "cryptohi.h"
-
-#include <limits.h>
-
-using namespace mozilla;
-
-namespace {
-
-void
-HexEncode(const SECItem * it, nsACString & result)
-{
- const char * digits = "0123456789ABCDEF";
- result.SetCapacity((it->len * 2) + 1);
- result.SetLength(it->len * 2);
- char * p = result.BeginWriting();
- for (unsigned int i = 0; i < it->len; ++i) {
- *p++ = digits[it->data[i] >> 4];
- *p++ = digits[it->data[i] & 0x0f];
- }
-}
-
-#define DSA_KEY_TYPE_STRING (NS_LITERAL_CSTRING("DS160"))
-#define RSA_KEY_TYPE_STRING (NS_LITERAL_CSTRING("RS256"))
-
-class KeyPair : public nsIIdentityKeyPair, public nsNSSShutDownObject
-{
-public:
- NS_DECL_THREADSAFE_ISUPPORTS
- NS_DECL_NSIIDENTITYKEYPAIR
-
- KeyPair(SECKEYPrivateKey* aPrivateKey, SECKEYPublicKey* aPublicKey,
- nsIEventTarget* aOperationThread);
-
-private:
- ~KeyPair()
- {
- nsNSSShutDownPreventionLock locker;
- if (isAlreadyShutDown()) {
- return;
- }
- destructorSafeDestroyNSSReference();
- shutdown(ShutdownCalledFrom::Object);
- }
-
- void virtualDestroyNSSReference() override
- {
- destructorSafeDestroyNSSReference();
- }
-
- void destructorSafeDestroyNSSReference()
- {
- SECKEY_DestroyPrivateKey(mPrivateKey);
- mPrivateKey = nullptr;
- SECKEY_DestroyPublicKey(mPublicKey);
- mPublicKey = nullptr;
- }
-
- SECKEYPrivateKey * mPrivateKey;
- SECKEYPublicKey * mPublicKey;
- nsCOMPtr<nsIEventTarget> mThread;
-
- KeyPair(const KeyPair &) = delete;
- void operator=(const KeyPair &) = delete;
-};
-
-NS_IMPL_ISUPPORTS(KeyPair, nsIIdentityKeyPair)
-
-class KeyGenRunnable : public Runnable, public nsNSSShutDownObject
-{
-public:
- NS_DECL_NSIRUNNABLE
-
- KeyGenRunnable(KeyType keyType, nsIIdentityKeyGenCallback * aCallback,
- nsIEventTarget* aOperationThread);
-
-private:
- ~KeyGenRunnable()
- {
- nsNSSShutDownPreventionLock locker;
- if (isAlreadyShutDown()) {
- return;
- }
- destructorSafeDestroyNSSReference();
- shutdown(ShutdownCalledFrom::Object);
- }
-
- virtual void virtualDestroyNSSReference() override
- {
- destructorSafeDestroyNSSReference();
- }
-
- void destructorSafeDestroyNSSReference()
- {
- }
-
- const KeyType mKeyType; // in
- nsMainThreadPtrHandle<nsIIdentityKeyGenCallback> mCallback; // in
- nsresult mRv; // out
- nsCOMPtr<nsIIdentityKeyPair> mKeyPair; // out
- nsCOMPtr<nsIEventTarget> mThread;
-
- KeyGenRunnable(const KeyGenRunnable &) = delete;
- void operator=(const KeyGenRunnable &) = delete;
-};
-
-class SignRunnable : public Runnable, public nsNSSShutDownObject
-{
-public:
- NS_DECL_NSIRUNNABLE
-
- SignRunnable(const nsACString & textToSign, SECKEYPrivateKey * privateKey,
- nsIIdentitySignCallback * aCallback);
-
-private:
- ~SignRunnable()
- {
- nsNSSShutDownPreventionLock locker;
- if (isAlreadyShutDown()) {
- return;
- }
- destructorSafeDestroyNSSReference();
- shutdown(ShutdownCalledFrom::Object);
- }
-
- void virtualDestroyNSSReference() override
- {
- destructorSafeDestroyNSSReference();
- }
-
- void destructorSafeDestroyNSSReference()
- {
- SECKEY_DestroyPrivateKey(mPrivateKey);
- mPrivateKey = nullptr;
- }
-
- const nsCString mTextToSign; // in
- SECKEYPrivateKey* mPrivateKey; // in
- nsMainThreadPtrHandle<nsIIdentitySignCallback> mCallback; // in
- nsresult mRv; // out
- nsCString mSignature; // out
-
-private:
- SignRunnable(const SignRunnable &) = delete;
- void operator=(const SignRunnable &) = delete;
-};
-
-class IdentityCryptoService final : public nsIIdentityCryptoService
-{
-public:
- NS_DECL_THREADSAFE_ISUPPORTS
- NS_DECL_NSIIDENTITYCRYPTOSERVICE
-
- IdentityCryptoService() { }
- nsresult Init()
- {
- nsresult rv;
- nsCOMPtr<nsISupports> dummyUsedToEnsureNSSIsInitialized
- = do_GetService("@mozilla.org/psm;1", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIThread> thread;
- rv = NS_NewNamedThread("IdentityCrypto", getter_AddRefs(thread));
- NS_ENSURE_SUCCESS(rv, rv);
-
- mThread = thread.forget();
-
- return NS_OK;
- }
-
-private:
- ~IdentityCryptoService() { }
- IdentityCryptoService(const KeyPair &) = delete;
- void operator=(const IdentityCryptoService &) = delete;
-
- nsCOMPtr<nsIEventTarget> mThread;
-};
-
-NS_IMPL_ISUPPORTS(IdentityCryptoService, nsIIdentityCryptoService)
-
-NS_IMETHODIMP
-IdentityCryptoService::GenerateKeyPair(
- const nsACString & keyTypeString, nsIIdentityKeyGenCallback * callback)
-{
- KeyType keyType;
- if (keyTypeString.Equals(RSA_KEY_TYPE_STRING)) {
- keyType = rsaKey;
- } else if (keyTypeString.Equals(DSA_KEY_TYPE_STRING)) {
- keyType = dsaKey;
- } else {
- return NS_ERROR_UNEXPECTED;
- }
-
- nsCOMPtr<nsIRunnable> r = new KeyGenRunnable(keyType, callback, mThread);
- nsresult rv = mThread->Dispatch(r.forget(), NS_DISPATCH_NORMAL);
- NS_ENSURE_SUCCESS(rv, rv);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-IdentityCryptoService::Base64UrlEncode(const nsACString & utf8Input,
- nsACString & result)
-{
- return Base64URLEncode(utf8Input.Length(),
- reinterpret_cast<const uint8_t*>(utf8Input.BeginReading()),
- Base64URLEncodePaddingPolicy::Include, result);
-}
-
-KeyPair::KeyPair(SECKEYPrivateKey * privateKey, SECKEYPublicKey * publicKey,
- nsIEventTarget* operationThread)
- : mPrivateKey(privateKey)
- , mPublicKey(publicKey)
- , mThread(operationThread)
-{
- MOZ_ASSERT(!NS_IsMainThread());
-}
-
-NS_IMETHODIMP
-KeyPair::GetHexRSAPublicKeyExponent(nsACString & result)
-{
- MOZ_ASSERT(NS_IsMainThread());
- NS_ENSURE_TRUE(mPublicKey, NS_ERROR_NOT_AVAILABLE);
- NS_ENSURE_TRUE(mPublicKey->keyType == rsaKey, NS_ERROR_NOT_AVAILABLE);
- HexEncode(&mPublicKey->u.rsa.publicExponent, result);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-KeyPair::GetHexRSAPublicKeyModulus(nsACString & result)
-{
- MOZ_ASSERT(NS_IsMainThread());
- NS_ENSURE_TRUE(mPublicKey, NS_ERROR_NOT_AVAILABLE);
- NS_ENSURE_TRUE(mPublicKey->keyType == rsaKey, NS_ERROR_NOT_AVAILABLE);
- HexEncode(&mPublicKey->u.rsa.modulus, result);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-KeyPair::GetHexDSAPrime(nsACString & result)
-{
- MOZ_ASSERT(NS_IsMainThread());
- NS_ENSURE_TRUE(mPublicKey, NS_ERROR_NOT_AVAILABLE);
- NS_ENSURE_TRUE(mPublicKey->keyType == dsaKey, NS_ERROR_NOT_AVAILABLE);
- HexEncode(&mPublicKey->u.dsa.params.prime, result);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-KeyPair::GetHexDSASubPrime(nsACString & result)
-{
- MOZ_ASSERT(NS_IsMainThread());
- NS_ENSURE_TRUE(mPublicKey, NS_ERROR_NOT_AVAILABLE);
- NS_ENSURE_TRUE(mPublicKey->keyType == dsaKey, NS_ERROR_NOT_AVAILABLE);
- HexEncode(&mPublicKey->u.dsa.params.subPrime, result);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-KeyPair::GetHexDSAGenerator(nsACString & result)
-{
- MOZ_ASSERT(NS_IsMainThread());
- NS_ENSURE_TRUE(mPublicKey, NS_ERROR_NOT_AVAILABLE);
- NS_ENSURE_TRUE(mPublicKey->keyType == dsaKey, NS_ERROR_NOT_AVAILABLE);
- HexEncode(&mPublicKey->u.dsa.params.base, result);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-KeyPair::GetHexDSAPublicValue(nsACString & result)
-{
- MOZ_ASSERT(NS_IsMainThread());
- NS_ENSURE_TRUE(mPublicKey, NS_ERROR_NOT_AVAILABLE);
- NS_ENSURE_TRUE(mPublicKey->keyType == dsaKey, NS_ERROR_NOT_AVAILABLE);
- HexEncode(&mPublicKey->u.dsa.publicValue, result);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-KeyPair::GetKeyType(nsACString & result)
-{
- MOZ_ASSERT(NS_IsMainThread());
- NS_ENSURE_TRUE(mPublicKey, NS_ERROR_NOT_AVAILABLE);
-
- switch (mPublicKey->keyType) {
- case rsaKey: result = RSA_KEY_TYPE_STRING; return NS_OK;
- case dsaKey: result = DSA_KEY_TYPE_STRING; return NS_OK;
- default: return NS_ERROR_UNEXPECTED;
- }
-}
-
-NS_IMETHODIMP
-KeyPair::Sign(const nsACString & textToSign,
- nsIIdentitySignCallback* callback)
-{
- MOZ_ASSERT(NS_IsMainThread());
- nsCOMPtr<nsIRunnable> r = new SignRunnable(textToSign, mPrivateKey,
- callback);
-
- return mThread->Dispatch(r, NS_DISPATCH_NORMAL);
-}
-
-KeyGenRunnable::KeyGenRunnable(KeyType keyType,
- nsIIdentityKeyGenCallback * callback,
- nsIEventTarget* operationThread)
- : mKeyType(keyType)
- , mCallback(new nsMainThreadPtrHolder<nsIIdentityKeyGenCallback>(callback))
- , mRv(NS_ERROR_NOT_INITIALIZED)
- , mThread(operationThread)
-{
-}
-
-MOZ_MUST_USE nsresult
-GenerateKeyPair(PK11SlotInfo * slot,
- SECKEYPrivateKey ** privateKey,
- SECKEYPublicKey ** publicKey,
- CK_MECHANISM_TYPE mechanism,
- void * params)
-{
- *publicKey = nullptr;
- *privateKey = PK11_GenerateKeyPair(slot, mechanism, params, publicKey,
- PR_FALSE /*isPerm*/,
- PR_TRUE /*isSensitive*/,
- nullptr /*&pwdata*/);
- if (!*privateKey) {
- MOZ_ASSERT(!*publicKey);
- return mozilla::psm::GetXPCOMFromNSSError(PR_GetError());
- }
- if (!*publicKey) {
- SECKEY_DestroyPrivateKey(*privateKey);
- *privateKey = nullptr;
- MOZ_CRASH("PK11_GnerateKeyPair returned private key without public key");
- }
-
- return NS_OK;
-}
-
-
-MOZ_MUST_USE nsresult
-GenerateRSAKeyPair(PK11SlotInfo * slot,
- SECKEYPrivateKey ** privateKey,
- SECKEYPublicKey ** publicKey)
-{
- MOZ_ASSERT(!NS_IsMainThread());
-
- PK11RSAGenParams rsaParams;
- rsaParams.keySizeInBits = 2048;
- rsaParams.pe = 0x10001;
- return GenerateKeyPair(slot, privateKey, publicKey, CKM_RSA_PKCS_KEY_PAIR_GEN,
- &rsaParams);
-}
-
-MOZ_MUST_USE nsresult
-GenerateDSAKeyPair(PK11SlotInfo * slot,
- SECKEYPrivateKey ** privateKey,
- SECKEYPublicKey ** publicKey)
-{
- MOZ_ASSERT(!NS_IsMainThread());
-
- // XXX: These could probably be static const arrays, but this way we avoid
- // compiler warnings and also we avoid having to worry much about whether the
- // functions that take these inputs will (unexpectedly) modify them.
-
- // Using NIST parameters. Some other BrowserID components require that these
- // exact parameters are used.
- uint8_t P[] = {
- 0xFF,0x60,0x04,0x83,0xDB,0x6A,0xBF,0xC5,0xB4,0x5E,0xAB,0x78,
- 0x59,0x4B,0x35,0x33,0xD5,0x50,0xD9,0xF1,0xBF,0x2A,0x99,0x2A,
- 0x7A,0x8D,0xAA,0x6D,0xC3,0x4F,0x80,0x45,0xAD,0x4E,0x6E,0x0C,
- 0x42,0x9D,0x33,0x4E,0xEE,0xAA,0xEF,0xD7,0xE2,0x3D,0x48,0x10,
- 0xBE,0x00,0xE4,0xCC,0x14,0x92,0xCB,0xA3,0x25,0xBA,0x81,0xFF,
- 0x2D,0x5A,0x5B,0x30,0x5A,0x8D,0x17,0xEB,0x3B,0xF4,0xA0,0x6A,
- 0x34,0x9D,0x39,0x2E,0x00,0xD3,0x29,0x74,0x4A,0x51,0x79,0x38,
- 0x03,0x44,0xE8,0x2A,0x18,0xC4,0x79,0x33,0x43,0x8F,0x89,0x1E,
- 0x22,0xAE,0xEF,0x81,0x2D,0x69,0xC8,0xF7,0x5E,0x32,0x6C,0xB7,
- 0x0E,0xA0,0x00,0xC3,0xF7,0x76,0xDF,0xDB,0xD6,0x04,0x63,0x8C,
- 0x2E,0xF7,0x17,0xFC,0x26,0xD0,0x2E,0x17
- };
-
- uint8_t Q[] = {
- 0xE2,0x1E,0x04,0xF9,0x11,0xD1,0xED,0x79,0x91,0x00,0x8E,0xCA,
- 0xAB,0x3B,0xF7,0x75,0x98,0x43,0x09,0xC3
- };
-
- uint8_t G[] = {
- 0xC5,0x2A,0x4A,0x0F,0xF3,0xB7,0xE6,0x1F,0xDF,0x18,0x67,0xCE,
- 0x84,0x13,0x83,0x69,0xA6,0x15,0x4F,0x4A,0xFA,0x92,0x96,0x6E,
- 0x3C,0x82,0x7E,0x25,0xCF,0xA6,0xCF,0x50,0x8B,0x90,0xE5,0xDE,
- 0x41,0x9E,0x13,0x37,0xE0,0x7A,0x2E,0x9E,0x2A,0x3C,0xD5,0xDE,
- 0xA7,0x04,0xD1,0x75,0xF8,0xEB,0xF6,0xAF,0x39,0x7D,0x69,0xE1,
- 0x10,0xB9,0x6A,0xFB,0x17,0xC7,0xA0,0x32,0x59,0x32,0x9E,0x48,
- 0x29,0xB0,0xD0,0x3B,0xBC,0x78,0x96,0xB1,0x5B,0x4A,0xDE,0x53,
- 0xE1,0x30,0x85,0x8C,0xC3,0x4D,0x96,0x26,0x9A,0xA8,0x90,0x41,
- 0xF4,0x09,0x13,0x6C,0x72,0x42,0xA3,0x88,0x95,0xC9,0xD5,0xBC,
- 0xCA,0xD4,0xF3,0x89,0xAF,0x1D,0x7A,0x4B,0xD1,0x39,0x8B,0xD0,
- 0x72,0xDF,0xFA,0x89,0x62,0x33,0x39,0x7A
- };
-
- static_assert(MOZ_ARRAY_LENGTH(P) == 1024 / CHAR_BIT, "bad DSA P");
- static_assert(MOZ_ARRAY_LENGTH(Q) == 160 / CHAR_BIT, "bad DSA Q");
- static_assert(MOZ_ARRAY_LENGTH(G) == 1024 / CHAR_BIT, "bad DSA G");
-
- PQGParams pqgParams = {
- nullptr /*arena*/,
- { siBuffer, P, static_cast<unsigned int>(mozilla::ArrayLength(P)) },
- { siBuffer, Q, static_cast<unsigned int>(mozilla::ArrayLength(Q)) },
- { siBuffer, G, static_cast<unsigned int>(mozilla::ArrayLength(G)) }
- };
-
- return GenerateKeyPair(slot, privateKey, publicKey, CKM_DSA_KEY_PAIR_GEN,
- &pqgParams);
-}
-
-NS_IMETHODIMP
-KeyGenRunnable::Run()
-{
- if (!NS_IsMainThread()) {
- nsNSSShutDownPreventionLock locker;
- if (isAlreadyShutDown()) {
- mRv = NS_ERROR_NOT_AVAILABLE;
- } else {
- // We always want to use the internal slot for BrowserID; in particular,
- // we want to avoid smartcard slots.
- PK11SlotInfo *slot = PK11_GetInternalSlot();
- if (!slot) {
- mRv = NS_ERROR_UNEXPECTED;
- } else {
- SECKEYPrivateKey *privk = nullptr;
- SECKEYPublicKey *pubk = nullptr;
-
- switch (mKeyType) {
- case rsaKey:
- mRv = GenerateRSAKeyPair(slot, &privk, &pubk);
- break;
- case dsaKey:
- mRv = GenerateDSAKeyPair(slot, &privk, &pubk);
- break;
- default:
- MOZ_CRASH("unknown key type");
- }
-
- PK11_FreeSlot(slot);
-
- if (NS_SUCCEEDED(mRv)) {
- MOZ_ASSERT(privk);
- MOZ_ASSERT(pubk);
- // mKeyPair will take over ownership of privk and pubk
- mKeyPair = new KeyPair(privk, pubk, mThread);
- }
- }
- }
-
- NS_DispatchToMainThread(this);
- } else {
- // Back on Main Thread
- (void) mCallback->GenerateKeyPairFinished(mRv, mKeyPair);
- }
- return NS_OK;
-}
-
-SignRunnable::SignRunnable(const nsACString & aText,
- SECKEYPrivateKey * privateKey,
- nsIIdentitySignCallback * aCallback)
- : mTextToSign(aText)
- , mPrivateKey(SECKEY_CopyPrivateKey(privateKey))
- , mCallback(new nsMainThreadPtrHolder<nsIIdentitySignCallback>(aCallback))
- , mRv(NS_ERROR_NOT_INITIALIZED)
-{
-}
-
-NS_IMETHODIMP
-SignRunnable::Run()
-{
- if (!NS_IsMainThread()) {
- nsNSSShutDownPreventionLock locker;
- if (isAlreadyShutDown()) {
- mRv = NS_ERROR_NOT_AVAILABLE;
- } else {
- // We need the output in PKCS#11 format, not DER encoding, so we must use
- // PK11_HashBuf and PK11_Sign instead of SEC_SignData.
-
- SECItem sig = { siBuffer, nullptr, 0 };
- int sigLength = PK11_SignatureLen(mPrivateKey);
- if (sigLength <= 0) {
- mRv = mozilla::psm::GetXPCOMFromNSSError(PR_GetError());
- } else if (!SECITEM_AllocItem(nullptr, &sig, sigLength)) {
- mRv = mozilla::psm::GetXPCOMFromNSSError(PR_GetError());
- } else {
- uint8_t hash[32]; // big enough for SHA-1 or SHA-256
- SECOidTag hashAlg = mPrivateKey->keyType == dsaKey ? SEC_OID_SHA1
- : SEC_OID_SHA256;
- SECItem hashItem = { siBuffer, hash,
- hashAlg == SEC_OID_SHA1 ? 20u : 32u };
-
- mRv = MapSECStatus(PK11_HashBuf(hashAlg, hash,
- const_cast<uint8_t*>(reinterpret_cast<const uint8_t *>(
- mTextToSign.get())),
- mTextToSign.Length()));
- if (NS_SUCCEEDED(mRv)) {
- mRv = MapSECStatus(PK11_Sign(mPrivateKey, &sig, &hashItem));
- }
- if (NS_SUCCEEDED(mRv)) {
- mRv = Base64URLEncode(sig.len, sig.data,
- Base64URLEncodePaddingPolicy::Include,
- mSignature);
- }
- SECITEM_FreeItem(&sig, false);
- }
- }
-
- NS_DispatchToMainThread(this);
- } else {
- // Back on Main Thread
- (void) mCallback->SignFinished(mRv, mSignature);
- }
-
- return NS_OK;
-}
-
-// XPCOM module registration
-
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(IdentityCryptoService, Init)
-
-#define NS_IDENTITYCRYPTOSERVICE_CID \
- {0xbea13a3a, 0x44e8, 0x4d7f, {0xa0, 0xa2, 0x2c, 0x67, 0xf8, 0x4e, 0x3a, 0x97}}
-
-NS_DEFINE_NAMED_CID(NS_IDENTITYCRYPTOSERVICE_CID);
-
-const mozilla::Module::CIDEntry kCIDs[] = {
- { &kNS_IDENTITYCRYPTOSERVICE_CID, false, nullptr, IdentityCryptoServiceConstructor },
- { nullptr }
-};
-
-const mozilla::Module::ContractIDEntry kContracts[] = {
- { "@mozilla.org/identity/crypto-service;1", &kNS_IDENTITYCRYPTOSERVICE_CID },
- { nullptr }
-};
-
-const mozilla::Module kModule = {
- mozilla::Module::kVersion,
- kCIDs,
- kContracts
-};
-
-} // unnamed namespace
-
-NSMODULE_DEFN(identity) = &kModule;
diff --git a/toolkit/identity/IdentityProvider.jsm b/toolkit/identity/IdentityProvider.jsm
deleted file mode 100644
index 11529bfba..000000000
--- a/toolkit/identity/IdentityProvider.jsm
+++ /dev/null
@@ -1,496 +0,0 @@
-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
-Cu.import("resource://gre/modules/identity/Sandbox.jsm");
-
-this.EXPORTED_SYMBOLS = ["IdentityProvider"];
-const FALLBACK_PROVIDER = "browserid.org";
-
-XPCOMUtils.defineLazyModuleGetter(this,
- "jwcrypto",
- "resource://gre/modules/identity/jwcrypto.jsm");
-
-function log(...aMessageArgs) {
- Logger.log.apply(Logger, ["IDP"].concat(aMessageArgs));
-}
-function reportError(...aMessageArgs) {
- Logger.reportError.apply(Logger, ["IDP"].concat(aMessageArgs));
-}
-
-
-function IdentityProviderService() {
- XPCOMUtils.defineLazyModuleGetter(this,
- "_store",
- "resource://gre/modules/identity/IdentityStore.jsm",
- "IdentityStore");
-
- this.reset();
-}
-
-IdentityProviderService.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
- _sandboxConfigured: false,
-
- observe: function observe(aSubject, aTopic, aData) {
- switch (aTopic) {
- case "quit-application-granted":
- Services.obs.removeObserver(this, "quit-application-granted");
- this.shutdown();
- break;
- }
- },
-
- reset: function IDP_reset() {
- // Clear the provisioning flows. Provision flows contain an
- // identity, idpParams (how to reach the IdP to provision and
- // authenticate), a callback (a completion callback for when things
- // are done), and a provisioningFrame (which is the provisioning
- // sandbox). Additionally, two callbacks will be attached:
- // beginProvisioningCallback and genKeyPairCallback.
- this._provisionFlows = {};
-
- // Clear the authentication flows. Authentication flows attach
- // to provision flows. In the process of provisioning an id, it
- // may be necessary to authenticate with an IdP. The authentication
- // flow maintains the state of that authentication process.
- this._authenticationFlows = {};
- },
-
- getProvisionFlow: function getProvisionFlow(aProvId, aErrBack) {
- let provFlow = this._provisionFlows[aProvId];
- if (provFlow) {
- return provFlow;
- }
-
- let err = "No provisioning flow found with id " + aProvId;
- log("ERROR:", err);
- if (typeof aErrBack === 'function') {
- aErrBack(err);
- }
-
- return undefined;
- },
-
- shutdown: function RP_shutdown() {
- this.reset();
-
- if (this._sandboxConfigured) {
- // Tear down message manager listening on the hidden window
- Cu.import("resource://gre/modules/DOMIdentity.jsm");
- DOMIdentity._configureMessages(Services.appShell.hiddenDOMWindow, false);
- this._sandboxConfigured = false;
- }
-
- Services.obs.removeObserver(this, "quit-application-granted");
- },
-
- get securityLevel() {
- return 1;
- },
-
- get certDuration() {
- switch (this.securityLevel) {
- default:
- return 3600;
- }
- },
-
- /**
- * Provision an Identity
- *
- * @param aIdentity
- * (string) the email we're logging in with
- *
- * @param aIDPParams
- * (object) parameters of the IdP
- *
- * @param aCallback
- * (function) callback to invoke on completion
- * with first-positional parameter the error.
- */
- _provisionIdentity: function _provisionIdentity(aIdentity, aIDPParams, aProvId, aCallback) {
- let provPath = aIDPParams.idpParams.provisioning;
- let url = Services.io.newURI("https://" + aIDPParams.domain, null, null).resolve(provPath);
- log("_provisionIdentity: identity:", aIdentity, "url:", url);
-
- // If aProvId is not null, then we already have a flow
- // with a sandbox. Otherwise, get a sandbox and create a
- // new provision flow.
-
- if (aProvId) {
- // Re-use an existing sandbox
- log("_provisionIdentity: re-using sandbox in provisioning flow with id:", aProvId);
- this._provisionFlows[aProvId].provisioningSandbox.reload();
-
- } else {
- this._createProvisioningSandbox(url, function createdSandbox(aSandbox) {
- // create a provisioning flow, using the sandbox id, and
- // stash callback associated with this provisioning workflow.
-
- let provId = aSandbox.id;
- this._provisionFlows[provId] = {
- identity: aIdentity,
- idpParams: aIDPParams,
- securityLevel: this.securityLevel,
- provisioningSandbox: aSandbox,
- callback: function doCallback(aErr) {
- aCallback(aErr, provId);
- },
- };
-
- log("_provisionIdentity: Created sandbox and provisioning flow with id:", provId);
- // XXX bug 769862 - provisioning flow should timeout after N seconds
-
- }.bind(this));
- }
- },
-
- // DOM Methods
- /**
- * the provisioning iframe sandbox has called navigator.id.beginProvisioning()
- *
- * @param aCaller
- * (object) the iframe sandbox caller with all callbacks and
- * other information. Callbacks include:
- * - doBeginProvisioningCallback(id, duration_s)
- * - doGenKeyPairCallback(pk)
- */
- beginProvisioning: function beginProvisioning(aCaller) {
- log("beginProvisioning:", aCaller.id);
-
- // Expect a flow for this caller already to be underway.
- let provFlow = this.getProvisionFlow(aCaller.id, aCaller.doError);
-
- // keep the caller object around
- provFlow.caller = aCaller;
-
- let identity = provFlow.identity;
- let frame = provFlow.provisioningFrame;
-
- // Determine recommended length of cert.
- let duration = this.certDuration;
-
- // Make a record that we have begun provisioning. This is required
- // for genKeyPair.
- provFlow.didBeginProvisioning = true;
-
- // Let the sandbox know to invoke the callback to beginProvisioning with
- // the identity and cert length.
- return aCaller.doBeginProvisioningCallback(identity, duration);
- },
-
- /**
- * the provisioning iframe sandbox has called
- * navigator.id.raiseProvisioningFailure()
- *
- * @param aProvId
- * (int) the identifier of the provisioning flow tied to that sandbox
- * @param aReason
- */
- raiseProvisioningFailure: function raiseProvisioningFailure(aProvId, aReason) {
- reportError("Provisioning failure", aReason);
-
- // look up the provisioning caller and its callback
- let provFlow = this.getProvisionFlow(aProvId);
-
- // Sandbox is deleted in _cleanUpProvisionFlow in case we re-use it.
-
- // This may be either a "soft" or "hard" fail. If it's a
- // soft fail, we'll flow through setAuthenticationFlow, where
- // the provision flow data will be copied into a new auth
- // flow. If it's a hard fail, then the callback will be
- // responsible for cleaning up the now defunct provision flow.
-
- // invoke the callback with an error.
- provFlow.callback(aReason);
- },
-
- /**
- * When navigator.id.genKeyPair is called from provisioning iframe sandbox.
- * Generates a keypair for the current user being provisioned.
- *
- * @param aProvId
- * (int) the identifier of the provisioning caller tied to that sandbox
- *
- * It is an error to call genKeypair without receiving the callback for
- * the beginProvisioning() call first.
- */
- genKeyPair: function genKeyPair(aProvId) {
- // Look up the provisioning caller and make sure it's valid.
- let provFlow = this.getProvisionFlow(aProvId);
-
- if (!provFlow.didBeginProvisioning) {
- let errStr = "ERROR: genKeyPair called before beginProvisioning";
- log(errStr);
- provFlow.callback(errStr);
- return;
- }
-
- // Ok generate a keypair
- jwcrypto.generateKeyPair(jwcrypto.ALGORITHMS.DS160, function gkpCb(err, kp) {
- log("in gkp callback");
- if (err) {
- log("ERROR: genKeyPair:", err);
- provFlow.callback(err);
- return;
- }
-
- provFlow.kp = kp;
-
- // Serialize the publicKey of the keypair and send it back to the
- // sandbox.
- log("genKeyPair: generated keypair for provisioning flow with id:", aProvId);
- provFlow.caller.doGenKeyPairCallback(provFlow.kp.serializedPublicKey);
- }.bind(this));
- },
-
- /**
- * When navigator.id.registerCertificate is called from provisioning iframe
- * sandbox.
- *
- * Sets the certificate for the user for which a certificate was requested
- * via a preceding call to beginProvisioning (and genKeypair).
- *
- * @param aProvId
- * (integer) the identifier of the provisioning caller tied to that
- * sandbox
- *
- * @param aCert
- * (String) A JWT representing the signed certificate for the user
- * being provisioned, provided by the IdP.
- */
- registerCertificate: function registerCertificate(aProvId, aCert) {
- log("registerCertificate:", aProvId, aCert);
-
- // look up provisioning caller, make sure it's valid.
- let provFlow = this.getProvisionFlow(aProvId);
-
- if (!provFlow.caller) {
- reportError("registerCertificate", "No provision flow or caller");
- return;
- }
- if (!provFlow.kp) {
- let errStr = "Cannot register a certificate without a keypair";
- reportError("registerCertificate", errStr);
- provFlow.callback(errStr);
- return;
- }
-
- // store the keypair and certificate just provided in IDStore.
- this._store.addIdentity(provFlow.identity, provFlow.kp, aCert);
-
- // Great success!
- provFlow.callback(null);
-
- // Clean up the flow.
- this._cleanUpProvisionFlow(aProvId);
- },
-
- /**
- * Begin the authentication process with an IdP
- *
- * @param aProvId
- * (int) the identifier of the provisioning flow which failed
- *
- * @param aCallback
- * (function) to invoke upon completion, with
- * first-positional-param error.
- */
- _doAuthentication: function _doAuthentication(aProvId, aIDPParams) {
- log("_doAuthentication: provId:", aProvId, "idpParams:", aIDPParams);
- // create an authentication caller and its identifier AuthId
- // stash aIdentity, idpparams, and callback in it.
-
- // extract authentication URL from idpParams
- let authPath = aIDPParams.idpParams.authentication;
- let authURI = Services.io.newURI("https://" + aIDPParams.domain, null, null).resolve(authPath);
-
- // beginAuthenticationFlow causes the "identity-auth" topic to be
- // observed. Since it's sending a notification to the DOM, there's
- // no callback. We wait for the DOM to trigger the next phase of
- // provisioning.
- this._beginAuthenticationFlow(aProvId, authURI);
-
- // either we bind the AuthID to the sandbox ourselves, or UX does that,
- // in which case we need to tell UX the AuthId.
- // Currently, the UX creates the UI and gets the AuthId from the window
- // and sets is with setAuthenticationFlow
- },
-
- /**
- * The authentication frame has called navigator.id.beginAuthentication
- *
- * IMPORTANT: the aCaller is *always* non-null, even if this is called from
- * a regular content page. We have to make sure, on every DOM call, that
- * aCaller is an expected authentication-flow identifier. If not, we throw
- * an error or something.
- *
- * @param aCaller
- * (object) the authentication caller
- *
- */
- beginAuthentication: function beginAuthentication(aCaller) {
- log("beginAuthentication: caller id:", aCaller.id);
-
- // Begin the authentication flow after having concluded a provisioning
- // flow. The aCaller that the DOM gives us will have the same ID as
- // the provisioning flow we just concluded. (see setAuthenticationFlow)
- let authFlow = this._authenticationFlows[aCaller.id];
- if (!authFlow) {
- return aCaller.doError("beginAuthentication: no flow for caller id", aCaller.id);
- }
-
- authFlow.caller = aCaller;
-
- let identity = this._provisionFlows[authFlow.provId].identity;
-
- // tell the UI to start the authentication process
- log("beginAuthentication: authFlow:", aCaller.id, "identity:", identity);
- return authFlow.caller.doBeginAuthenticationCallback(identity);
- },
-
- /**
- * The auth frame has called navigator.id.completeAuthentication
- *
- * @param aAuthId
- * (int) the identifier of the authentication caller tied to that sandbox
- *
- */
- completeAuthentication: function completeAuthentication(aAuthId) {
- log("completeAuthentication:", aAuthId);
-
- // look up the AuthId caller, and get its callback.
- let authFlow = this._authenticationFlows[aAuthId];
- if (!authFlow) {
- reportError("completeAuthentication", "No auth flow with id", aAuthId);
- return;
- }
- let provId = authFlow.provId;
-
- // delete caller
- delete authFlow['caller'];
- delete this._authenticationFlows[aAuthId];
-
- let provFlow = this.getProvisionFlow(provId);
- provFlow.didAuthentication = true;
- let subject = {
- rpId: provFlow.rpId,
- identity: provFlow.identity,
- };
- Services.obs.notifyObservers({ wrappedJSObject: subject }, "identity-auth-complete", aAuthId);
- },
-
- /**
- * The auth frame has called navigator.id.cancelAuthentication
- *
- * @param aAuthId
- * (int) the identifier of the authentication caller
- *
- */
- cancelAuthentication: function cancelAuthentication(aAuthId) {
- log("cancelAuthentication:", aAuthId);
-
- // look up the AuthId caller, and get its callback.
- let authFlow = this._authenticationFlows[aAuthId];
- if (!authFlow) {
- reportError("cancelAuthentication", "No auth flow with id:", aAuthId);
- return;
- }
- let provId = authFlow.provId;
-
- // delete caller
- delete authFlow['caller'];
- delete this._authenticationFlows[aAuthId];
-
- let provFlow = this.getProvisionFlow(provId);
- provFlow.didAuthentication = true;
- Services.obs.notifyObservers(null, "identity-auth-complete", aAuthId);
-
- // invoke callback with ERROR.
- let errStr = "Authentication canceled by IDP";
- log("ERROR: cancelAuthentication:", errStr);
- provFlow.callback(errStr);
- },
-
- /**
- * Called by the UI to set the ID and caller for the authentication flow after it gets its ID
- */
- setAuthenticationFlow: function(aAuthId, aProvId) {
- // this is the transition point between the two flows,
- // provision and authenticate. We tell the auth flow which
- // provisioning flow it is started from.
- log("setAuthenticationFlow: authId:", aAuthId, "provId:", aProvId);
- this._authenticationFlows[aAuthId] = { provId: aProvId };
- this._provisionFlows[aProvId].authId = aAuthId;
- },
-
- /**
- * Load the provisioning URL in a hidden frame to start the provisioning
- * process.
- */
- _createProvisioningSandbox: function _createProvisioningSandbox(aURL, aCallback) {
- log("_createProvisioningSandbox:", aURL);
-
- if (!this._sandboxConfigured) {
- // Configure message manager listening on the hidden window
- Cu.import("resource://gre/modules/DOMIdentity.jsm");
- DOMIdentity._configureMessages(Services.appShell.hiddenDOMWindow, true);
- this._sandboxConfigured = true;
- }
-
- new Sandbox(aURL, aCallback);
- },
-
- /**
- * Load the authentication UI to start the authentication process.
- */
- _beginAuthenticationFlow: function _beginAuthenticationFlow(aProvId, aURL) {
- log("_beginAuthenticationFlow:", aProvId, aURL);
- let propBag = {provId: aProvId};
-
- Services.obs.notifyObservers({wrappedJSObject:propBag}, "identity-auth", aURL);
- },
-
- /**
- * Clean up a provision flow and the authentication flow and sandbox
- * that may be attached to it.
- */
- _cleanUpProvisionFlow: function _cleanUpProvisionFlow(aProvId) {
- log('_cleanUpProvisionFlow:', aProvId);
- let prov = this._provisionFlows[aProvId];
-
- // Clean up the sandbox, if there is one.
- if (prov.provisioningSandbox) {
- let sandbox = this._provisionFlows[aProvId]['provisioningSandbox'];
- if (sandbox.free) {
- log('_cleanUpProvisionFlow: freeing sandbox');
- sandbox.free();
- }
- delete this._provisionFlows[aProvId]['provisioningSandbox'];
- }
-
- // Clean up a related authentication flow, if there is one.
- if (this._authenticationFlows[prov.authId]) {
- delete this._authenticationFlows[prov.authId];
- }
-
- // Finally delete the provision flow
- delete this._provisionFlows[aProvId];
- }
-
-};
-
-this.IdentityProvider = new IdentityProviderService();
diff --git a/toolkit/identity/IdentityStore.jsm b/toolkit/identity/IdentityStore.jsm
deleted file mode 100644
index 1827a839e..000000000
--- a/toolkit/identity/IdentityStore.jsm
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-this.EXPORTED_SYMBOLS = ["IdentityStore"];
-
-// the data store for IDService
-// written as a separate thing so it can easily be mocked
-function IDServiceStore() {
- this.reset();
-}
-
-// Note: eventually these methods may be async, but we haven no need for this
-// for now, since we're not storing to disk.
-IDServiceStore.prototype = {
- addIdentity: function addIdentity(aEmail, aKeyPair, aCert) {
- this._identities[aEmail] = {keyPair: aKeyPair, cert: aCert};
- },
- fetchIdentity: function fetchIdentity(aEmail) {
- return aEmail in this._identities ? this._identities[aEmail] : null;
- },
- removeIdentity: function removeIdentity(aEmail) {
- let data = this._identities[aEmail];
- delete this._identities[aEmail];
- return data;
- },
- getIdentities: function getIdentities() {
- // XXX - should clone?
- return this._identities;
- },
- clearCert: function clearCert(aEmail) {
- // XXX - should remove key from store?
- this._identities[aEmail].cert = null;
- this._identities[aEmail].keyPair = null;
- },
-
- /**
- * set the login state for a given origin
- *
- * @param aOrigin
- * (string) a web origin
- *
- * @param aState
- * (boolean) whether or not the user is logged in
- *
- * @param aEmail
- * (email) the email address the user is logged in with,
- * or, if not logged in, the default email for that origin.
- */
- setLoginState: function setLoginState(aOrigin, aState, aEmail) {
- if (aState && !aEmail) {
- throw "isLoggedIn cannot be set to true without an email";
- }
- return this._loginStates[aOrigin] = {isLoggedIn: aState, email: aEmail};
- },
- getLoginState: function getLoginState(aOrigin) {
- return aOrigin in this._loginStates ? this._loginStates[aOrigin] : null;
- },
- clearLoginState: function clearLoginState(aOrigin) {
- delete this._loginStates[aOrigin];
- },
-
- reset: function Store_reset() {
- // _identities associates emails with keypairs and certificates
- this._identities = {};
-
- // _loginStates associates. remote origins with a login status and
- // the email the user has chosen as his or her identity when logging
- // into that origin.
- this._loginStates = {};
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
-
- observe: function observe(aSubject, aTopic, aData) {
- switch (aTopic) {
- case "quit-application-granted":
- Services.obs.removeObserver(this, "quit-application-granted");
- this.reset();
- break;
- }
- },
-};
-
-this.IdentityStore = new IDServiceStore();
diff --git a/toolkit/identity/IdentityUtils.jsm b/toolkit/identity/IdentityUtils.jsm
deleted file mode 100644
index a34c0b133..000000000
--- a/toolkit/identity/IdentityUtils.jsm
+++ /dev/null
@@ -1,111 +0,0 @@
-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// functions common to Identity.jsm and MinimalIdentity.jsm
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = [
- "checkDeprecated",
- "checkRenamed",
- "getRandomId",
- "objectCopy",
- "makeMessageObject",
-];
-
-const Cu = Components.utils;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "uuidgen",
- "@mozilla.org/uuid-generator;1",
- "nsIUUIDGenerator");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Logger",
- "resource://gre/modules/identity/LogUtils.jsm");
-
-function log(...aMessageArgs) {
- Logger.log.apply(Logger, ["Identity"].concat(aMessageArgs));
-}
-
-function defined(item) {
- return typeof item !== 'undefined';
-}
-
-var checkDeprecated = this.checkDeprecated = function checkDeprecated(aOptions, aField) {
- if (defined(aOptions[aField])) {
- log("WARNING: field is deprecated:", aField);
- return true;
- }
- return false;
-};
-
-this.checkRenamed = function checkRenamed(aOptions, aOldName, aNewName) {
- if (defined(aOptions[aOldName]) &&
- defined(aOptions[aNewName])) {
- let err = "You cannot provide both " + aOldName + " and " + aNewName;
- Logger.reportError(err);
- throw new Error(err);
- }
-
- if (checkDeprecated(aOptions, aOldName)) {
- aOptions[aNewName] = aOptions[aOldName];
- delete(aOptions[aOldName]);
- }
-};
-
-this.getRandomId = function getRandomId() {
- return uuidgen.generateUUID().toString();
-};
-
-/*
- * copy source object into target, excluding private properties
- * (those whose names begin with an underscore)
- */
-this.objectCopy = function objectCopy(source, target) {
- let desc;
- Object.getOwnPropertyNames(source).forEach(function(name) {
- if (name[0] !== '_') {
- desc = Object.getOwnPropertyDescriptor(source, name);
- Object.defineProperty(target, name, desc);
- }
- });
-};
-
-this.makeMessageObject = function makeMessageObject(aRpCaller) {
- let options = {};
-
- options.id = aRpCaller.id;
- options.origin = aRpCaller.origin;
-
- // Backwards compatibility with Persona beta:
- // loggedInUser can be undefined, null, or a string
- options.loggedInUser = aRpCaller.loggedInUser;
-
- // Special flag for internal calls for Persona in b2g
- options._internal = aRpCaller._internal;
-
- Object.keys(aRpCaller).forEach(function(option) {
- // Duplicate the callerobject, scrubbing out functions and other
- // internal variables (like _mm, the message manager object)
- if (!Object.hasOwnProperty(this, option)
- && option[0] !== '_'
- && typeof aRpCaller[option] !== 'function') {
- options[option] = aRpCaller[option];
- }
- });
-
- // check validity of message structure
- if ((typeof options.id === 'undefined') ||
- (typeof options.origin === 'undefined')) {
- let err = "id and origin required in relying-party message: " + JSON.stringify(options);
- reportError(err);
- throw new Error(err);
- }
-
- return options;
-}
-
diff --git a/toolkit/identity/LogUtils.jsm b/toolkit/identity/LogUtils.jsm
deleted file mode 100644
index ec0f4c420..000000000
--- a/toolkit/identity/LogUtils.jsm
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["Logger"];
-const PREF_DEBUG = "toolkit.identity.debug";
-
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-function IdentityLogger() {
- Services.prefs.addObserver(PREF_DEBUG, this, false);
- this._debug = Services.prefs.getBoolPref(PREF_DEBUG);
- return this;
-}
-
-IdentityLogger.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
-
- observe: function observe(aSubject, aTopic, aData) {
- switch (aTopic) {
- case "nsPref:changed":
- this._debug = Services.prefs.getBoolPref(PREF_DEBUG);
- break;
-
- case "quit-application-granted":
- Services.prefs.removeObserver(PREF_DEBUG, this);
- break;
-
- default:
- this.log("Logger observer", "Unknown topic:", aTopic);
- break;
- }
- },
-
- _generateLogMessage: function _generateLogMessage(aPrefix, args) {
- // create a string representation of a list of arbitrary things
- let strings = [];
-
- // XXX bug 770418 - args look like flattened array, not list of strings
-
- args.forEach(function(arg) {
- if (typeof arg === 'string') {
- strings.push(arg);
- } else if (typeof arg === 'undefined') {
- strings.push('undefined');
- } else if (arg === null) {
- strings.push('null');
- } else {
- try {
- strings.push(JSON.stringify(arg, null, 2));
- } catch (err) {
- strings.push("<<something>>");
- }
- }
- });
- return 'Identity ' + aPrefix + ': ' + strings.join(' ');
- },
-
- /**
- * log() - utility function to print a list of arbitrary things
- *
- * Enable with about:config pref toolkit.identity.debug
- */
- log: function log(aPrefix, ...args) {
- if (!this._debug) {
- return;
- }
- let output = this._generateLogMessage(aPrefix, args);
- dump(output + "\n");
-
- // Additionally, make the output visible in the Error Console
- Services.console.logStringMessage(output);
- },
-
- /**
- * reportError() - report an error through component utils as well as
- * our log function
- */
- reportError: function reportError(aPrefix, ...aArgs) {
- let prefix = aPrefix + ' ERROR';
-
- // Report the error in the browser
- let output = this._generateLogMessage(aPrefix, aArgs);
- Cu.reportError(output);
- dump("ERROR: " + output + "\n");
- for (let frame = Components.stack.caller; frame; frame = frame.caller) {
- dump(frame + "\n");
- }
- }
-
-};
-
-this.Logger = new IdentityLogger();
diff --git a/toolkit/identity/MinimalIdentity.jsm b/toolkit/identity/MinimalIdentity.jsm
deleted file mode 100644
index bceb65659..000000000
--- a/toolkit/identity/MinimalIdentity.jsm
+++ /dev/null
@@ -1,242 +0,0 @@
-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * This alternate implementation of IdentityService provides just the
- * channels for navigator.id, leaving the certificate storage to a
- * server-provided app.
- *
- * On b2g, the messages identity-controller-watch, -request, and
- * -logout, are observed by the component SignInToWebsite.jsm.
- */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["IdentityService"];
-
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "objectCopy",
- "resource://gre/modules/identity/IdentityUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "makeMessageObject",
- "resource://gre/modules/identity/IdentityUtils.jsm");
-
-function log(...aMessageArgs) {
- Logger.log.apply(Logger, ["minimal core"].concat(aMessageArgs));
-}
-function reportError(...aMessageArgs) {
- Logger.reportError.apply(Logger, ["core"].concat(aMessageArgs));
-}
-
-function IDService() {
- Services.obs.addObserver(this, "quit-application-granted", false);
-
- // simplify, it's one object
- this.RP = this;
- this.IDP = this;
-
- // keep track of flows
- this._rpFlows = {};
- this._authFlows = {};
- this._provFlows = {};
-}
-
-IDService.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
-
- observe: function observe(aSubject, aTopic, aData) {
- switch (aTopic) {
- case "quit-application-granted":
- this.shutdown();
- break;
- }
- },
-
- shutdown: function() {
- Services.obs.removeObserver(this, "quit-application-granted");
- },
-
- /**
- * Parse an email into username and domain if it is valid, else return null
- */
- parseEmail: function parseEmail(email) {
- var match = email.match(/^([^@]+)@([^@^/]+.[a-z]+)$/);
- if (match) {
- return {
- username: match[1],
- domain: match[2]
- };
- }
- return null;
- },
-
- /**
- * Register a listener for a given windowID as a result of a call to
- * navigator.id.watch().
- *
- * @param aCaller
- * (Object) an object that represents the caller document, and
- * is expected to have properties:
- * - id (unique, e.g. uuid)
- * - loggedInUser (string or null)
- * - origin (string)
- *
- * and a bunch of callbacks
- * - doReady()
- * - doLogin()
- * - doLogout()
- * - doError()
- * - doCancel()
- *
- */
- watch: function watch(aRpCaller) {
- // store the caller structure and notify the UI observers
- this._rpFlows[aRpCaller.id] = aRpCaller;
-
- log("flows:", Object.keys(this._rpFlows).join(', '));
-
- let options = makeMessageObject(aRpCaller);
- log("sending identity-controller-watch:", options);
- Services.obs.notifyObservers({wrappedJSObject: options}, "identity-controller-watch", null);
- },
-
- /*
- * The RP has gone away; remove handles to the hidden iframe.
- * It's probable that the frame will already have been cleaned up.
- */
- unwatch: function unwatch(aRpId, aTargetMM) {
- let rp = this._rpFlows[aRpId];
- if (!rp) {
- return;
- }
-
- let options = makeMessageObject({
- id: aRpId,
- origin: rp.origin,
- messageManager: aTargetMM
- });
- log("sending identity-controller-unwatch for id", options.id, options.origin);
- Services.obs.notifyObservers({wrappedJSObject: options}, "identity-controller-unwatch", null);
-
- // Stop sending messages to this window
- delete this._rpFlows[aRpId];
- },
-
- /**
- * Initiate a login with user interaction as a result of a call to
- * navigator.id.request().
- *
- * @param aRPId
- * (integer) the id of the doc object obtained in .watch()
- *
- * @param aOptions
- * (Object) options including privacyPolicy, termsOfService
- */
- request: function request(aRPId, aOptions) {
- let rp = this._rpFlows[aRPId];
- if (!rp) {
- reportError("request() called before watch()");
- return;
- }
-
- // Notify UX to display identity picker.
- // Pass the doc id to UX so it can pass it back to us later.
- let options = makeMessageObject(rp);
- objectCopy(aOptions, options);
- Services.obs.notifyObservers({wrappedJSObject: options}, "identity-controller-request", null);
- },
-
- /**
- * Invoked when a user wishes to logout of a site (for instance, when clicking
- * on an in-content logout button).
- *
- * @param aRpCallerId
- * (integer) the id of the doc object obtained in .watch()
- *
- */
- logout: function logout(aRpCallerId) {
- let rp = this._rpFlows[aRpCallerId];
- if (!rp) {
- reportError("logout() called before watch()");
- return;
- }
-
- let options = makeMessageObject(rp);
- Services.obs.notifyObservers({wrappedJSObject: options}, "identity-controller-logout", null);
- },
-
- childProcessShutdown: function childProcessShutdown(messageManager) {
- Object.keys(this._rpFlows).forEach(function(key) {
- if (this._rpFlows[key]._mm === messageManager) {
- log("child process shutdown for rp", key, "- deleting flow");
- delete this._rpFlows[key];
- }
- }, this);
- },
-
- /*
- * once the UI-and-display-logic components have received
- * notifications, they call back with direct invocation of the
- * following functions (doLogin, doLogout, or doReady)
- */
-
- doLogin: function doLogin(aRpCallerId, aAssertion, aInternalParams) {
- let rp = this._rpFlows[aRpCallerId];
- if (!rp) {
- log("WARNING: doLogin found no rp to go with callerId " + aRpCallerId);
- return;
- }
-
- rp.doLogin(aAssertion, aInternalParams);
- },
-
- doLogout: function doLogout(aRpCallerId) {
- let rp = this._rpFlows[aRpCallerId];
- if (!rp) {
- log("WARNING: doLogout found no rp to go with callerId " + aRpCallerId);
- return;
- }
-
- // Logout from every site with the same origin
- let origin = rp.origin;
- Object.keys(this._rpFlows).forEach(function(key) {
- let rp = this._rpFlows[key];
- if (rp.origin === origin) {
- rp.doLogout();
- }
- }.bind(this));
- },
-
- doReady: function doReady(aRpCallerId) {
- let rp = this._rpFlows[aRpCallerId];
- if (!rp) {
- log("WARNING: doReady found no rp to go with callerId " + aRpCallerId);
- return;
- }
-
- rp.doReady();
- },
-
- doCancel: function doCancel(aRpCallerId) {
- let rp = this._rpFlows[aRpCallerId];
- if (!rp) {
- log("WARNING: doCancel found no rp to go with callerId " + aRpCallerId);
- return;
- }
-
- rp.doCancel();
- }
-};
-
-this.IdentityService = new IDService();
diff --git a/toolkit/identity/RelyingParty.jsm b/toolkit/identity/RelyingParty.jsm
deleted file mode 100644
index 5996383ca..000000000
--- a/toolkit/identity/RelyingParty.jsm
+++ /dev/null
@@ -1,367 +0,0 @@
-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
-Cu.import("resource://gre/modules/identity/IdentityStore.jsm");
-
-this.EXPORTED_SYMBOLS = ["RelyingParty"];
-
-XPCOMUtils.defineLazyModuleGetter(this, "objectCopy",
- "resource://gre/modules/identity/IdentityUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this,
- "jwcrypto",
- "resource://gre/modules/identity/jwcrypto.jsm");
-
-function log(...aMessageArgs) {
- Logger.log.apply(Logger, ["RP"].concat(aMessageArgs));
-}
-function reportError(...aMessageArgs) {
- Logger.reportError.apply(Logger, ["RP"].concat(aMessageArgs));
-}
-
-function IdentityRelyingParty() {
- // The store is a singleton shared among Identity, RelyingParty, and
- // IdentityProvider. The Identity module takes care of resetting
- // state in the _store on shutdown.
- this._store = IdentityStore;
-
- this.reset();
-}
-
-IdentityRelyingParty.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
-
- observe: function observe(aSubject, aTopic, aData) {
- switch (aTopic) {
- case "quit-application-granted":
- Services.obs.removeObserver(this, "quit-application-granted");
- this.shutdown();
- break;
-
- }
- },
-
- reset: function RP_reset() {
- // Forget all documents that call in. (These are sometimes
- // referred to as callers.)
- this._rpFlows = {};
- },
-
- shutdown: function RP_shutdown() {
- this.reset();
- Services.obs.removeObserver(this, "quit-application-granted");
- },
-
- /**
- * Register a listener for a given windowID as a result of a call to
- * navigator.id.watch().
- *
- * @param aCaller
- * (Object) an object that represents the caller document, and
- * is expected to have properties:
- * - id (unique, e.g. uuid)
- * - loggedInUser (string or null)
- * - origin (string)
- *
- * and a bunch of callbacks
- * - doReady()
- * - doLogin()
- * - doLogout()
- * - doError()
- * - doCancel()
- *
- */
- watch: function watch(aRpCaller) {
- this._rpFlows[aRpCaller.id] = aRpCaller;
- let origin = aRpCaller.origin;
- let state = this._store.getLoginState(origin) || { isLoggedIn: false, email: null };
-
- log("watch: rpId:", aRpCaller.id,
- "origin:", origin,
- "loggedInUser:", aRpCaller.loggedInUser,
- "loggedIn:", state.isLoggedIn,
- "email:", state.email);
-
- // If the user is already logged in, then there are three cases
- // to deal with:
- //
- // 1. the email is valid and unchanged: 'ready'
- // 2. the email is null: 'login'; 'ready'
- // 3. the email has changed: 'login'; 'ready'
- if (state.isLoggedIn) {
- if (state.email && aRpCaller.loggedInUser === state.email) {
- this._notifyLoginStateChanged(aRpCaller.id, state.email);
- return aRpCaller.doReady();
-
- } else if (aRpCaller.loggedInUser === null) {
- // Generate assertion for existing login
- let options = {loggedInUser: state.email, origin: origin};
- return this._doLogin(aRpCaller, options);
- }
- // A loggedInUser different from state.email has been specified.
- // Change login identity.
-
- let options = {loggedInUser: state.email, origin: origin};
- return this._doLogin(aRpCaller, options);
-
- // If the user is not logged in, there are two cases:
- //
- // 1. a logged in email was provided: 'ready'; 'logout'
- // 2. not logged in, no email given: 'ready';
-
- }
- if (aRpCaller.loggedInUser) {
- return this._doLogout(aRpCaller, {origin: origin});
- }
- return aRpCaller.doReady();
- },
-
- /**
- * A utility for watch() to set state and notify the dom
- * on login
- *
- * Note that this calls _getAssertion
- */
- _doLogin: function _doLogin(aRpCaller, aOptions, aAssertion) {
- log("_doLogin: rpId:", aRpCaller.id, "origin:", aOptions.origin);
-
- let loginWithAssertion = function loginWithAssertion(assertion) {
- this._store.setLoginState(aOptions.origin, true, aOptions.loggedInUser);
- this._notifyLoginStateChanged(aRpCaller.id, aOptions.loggedInUser);
- aRpCaller.doLogin(assertion);
- aRpCaller.doReady();
- }.bind(this);
-
- if (aAssertion) {
- loginWithAssertion(aAssertion);
- } else {
- this._getAssertion(aOptions, function gotAssertion(err, assertion) {
- if (err) {
- reportError("_doLogin:", "Failed to get assertion on login attempt:", err);
- this._doLogout(aRpCaller);
- } else {
- loginWithAssertion(assertion);
- }
- }.bind(this));
- }
- },
-
- /**
- * A utility for watch() to set state and notify the dom
- * on logout.
- */
- _doLogout: function _doLogout(aRpCaller, aOptions) {
- log("_doLogout: rpId:", aRpCaller.id, "origin:", aOptions.origin);
-
- let state = this._store.getLoginState(aOptions.origin) || {};
-
- state.isLoggedIn = false;
- this._notifyLoginStateChanged(aRpCaller.id, null);
-
- aRpCaller.doLogout();
- aRpCaller.doReady();
- },
-
- /**
- * For use with login or logout, emit 'identity-login-state-changed'
- *
- * The notification will send the rp caller id in the properties,
- * and the email of the user in the message.
- *
- * @param aRpCallerId
- * (integer) The id of the RP caller
- *
- * @param aIdentity
- * (string) The email of the user whose login state has changed
- */
- _notifyLoginStateChanged: function _notifyLoginStateChanged(aRpCallerId, aIdentity) {
- log("_notifyLoginStateChanged: rpId:", aRpCallerId, "identity:", aIdentity);
-
- let options = {rpId: aRpCallerId};
- Services.obs.notifyObservers({wrappedJSObject: options},
- "identity-login-state-changed",
- aIdentity);
- },
-
- /**
- * Initiate a login with user interaction as a result of a call to
- * navigator.id.request().
- *
- * @param aRPId
- * (integer) the id of the doc object obtained in .watch()
- *
- * @param aOptions
- * (Object) options including privacyPolicy, termsOfService
- */
- request: function request(aRPId, aOptions) {
- log("request: rpId:", aRPId);
- let rp = this._rpFlows[aRPId];
-
- // Notify UX to display identity picker.
- // Pass the doc id to UX so it can pass it back to us later.
- let options = {rpId: aRPId, origin: rp.origin};
- objectCopy(aOptions, options);
-
- // Append URLs after resolving
- let baseURI = Services.io.newURI(rp.origin, null, null);
- for (let optionName of ["privacyPolicy", "termsOfService"]) {
- if (aOptions[optionName]) {
- options[optionName] = baseURI.resolve(aOptions[optionName]);
- }
- }
-
- Services.obs.notifyObservers({wrappedJSObject: options}, "identity-request", null);
- },
-
- /**
- * Invoked when a user wishes to logout of a site (for instance, when clicking
- * on an in-content logout button).
- *
- * @param aRpCallerId
- * (integer) the id of the doc object obtained in .watch()
- *
- */
- logout: function logout(aRpCallerId) {
- log("logout: RP caller id:", aRpCallerId);
- let rp = this._rpFlows[aRpCallerId];
- if (rp && rp.origin) {
- let origin = rp.origin;
- log("logout: origin:", origin);
- this._doLogout(rp, {origin: origin});
- } else {
- log("logout: no RP found with id:", aRpCallerId);
- }
- // We don't delete this._rpFlows[aRpCallerId], because
- // the user might log back in again.
- },
-
- getDefaultEmailForOrigin: function getDefaultEmailForOrigin(aOrigin) {
- let identities = this.getIdentitiesForSite(aOrigin);
- let result = identities.lastUsed || null;
- log("getDefaultEmailForOrigin:", aOrigin, "->", result);
- return result;
- },
-
- /**
- * Return the list of identities a user may want to use to login to aOrigin.
- */
- getIdentitiesForSite: function getIdentitiesForSite(aOrigin) {
- let rv = { result: [] };
- for (let id in this._store.getIdentities()) {
- rv.result.push(id);
- }
- let loginState = this._store.getLoginState(aOrigin);
- if (loginState && loginState.email)
- rv.lastUsed = loginState.email;
- return rv;
- },
-
- /**
- * Obtain a BrowserID assertion with the specified characteristics.
- *
- * @param aCallback
- * (Function) Callback to be called with (err, assertion) where 'err'
- * can be an Error or NULL, and 'assertion' can be NULL or a valid
- * BrowserID assertion. If no callback is provided, an exception is
- * thrown.
- *
- * @param aOptions
- * (Object) An object that may contain the following properties:
- *
- * "audience" : The audience for which the assertion is to be
- * issued. If this property is not set an exception
- * will be thrown.
- *
- * Any properties not listed above will be ignored.
- */
- _getAssertion: function _getAssertion(aOptions, aCallback) {
- let audience = aOptions.origin;
- let email = aOptions.loggedInUser || this.getDefaultEmailForOrigin(audience);
- log("_getAssertion: audience:", audience, "email:", email);
- if (!audience) {
- throw "audience required for _getAssertion";
- }
-
- // We might not have any identity info for this email
- if (!this._store.fetchIdentity(email)) {
- this._store.addIdentity(email, null, null);
- }
-
- let cert = this._store.fetchIdentity(email)['cert'];
- if (cert) {
- this._generateAssertion(audience, email, function generatedAssertion(err, assertion) {
- if (err) {
- log("ERROR: _getAssertion:", err);
- }
- log("_getAssertion: generated assertion:", assertion);
- return aCallback(err, assertion);
- });
- }
- },
-
- /**
- * Generate an assertion, including provisioning via IdP if necessary,
- * but no user interaction, so if provisioning fails, aCallback is invoked
- * with an error.
- *
- * @param aAudience
- * (string) web origin
- *
- * @param aIdentity
- * (string) the email we're logging in with
- *
- * @param aCallback
- * (function) callback to invoke on completion
- * with first-positional parameter the error.
- */
- _generateAssertion: function _generateAssertion(aAudience, aIdentity, aCallback) {
- log("_generateAssertion: audience:", aAudience, "identity:", aIdentity);
-
- let id = this._store.fetchIdentity(aIdentity);
- if (! (id && id.cert)) {
- let errStr = "Cannot generate an assertion without a certificate";
- log("ERROR: _generateAssertion:", errStr);
- aCallback(errStr);
- return;
- }
-
- let kp = id.keyPair;
-
- if (!kp) {
- let errStr = "Cannot generate an assertion without a keypair";
- log("ERROR: _generateAssertion:", errStr);
- aCallback(errStr);
- return;
- }
-
- jwcrypto.generateAssertion(id.cert, kp, aAudience, aCallback);
- },
-
- /**
- * Clean up references to the provisioning flow for the specified RP.
- */
- _cleanUpProvisionFlow: function RP_cleanUpProvisionFlow(aRPId, aProvId) {
- let rp = this._rpFlows[aRPId];
- if (rp) {
- delete rp['provId'];
- } else {
- log("Error: Couldn't delete provision flow ", aProvId, " for RP ", aRPId);
- }
- },
-
-};
-
-this.RelyingParty = new IdentityRelyingParty();
diff --git a/toolkit/identity/Sandbox.jsm b/toolkit/identity/Sandbox.jsm
deleted file mode 100644
index 68757c212..000000000
--- a/toolkit/identity/Sandbox.jsm
+++ /dev/null
@@ -1,152 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["Sandbox"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-const XHTML_NS = "http://www.w3.org/1999/xhtml";
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this,
- "Logger",
- "resource://gre/modules/identity/LogUtils.jsm");
-
-/**
- * An object that represents a sandbox in an iframe loaded with aURL. The
- * callback provided to the constructor will be invoked when the sandbox is
- * ready to be used. The callback will receive this object as its only argument.
- *
- * You must call free() when you are finished with the sandbox to explicitly
- * free up all associated resources.
- *
- * @param aURL
- * (string) URL to load in the sandbox.
- *
- * @param aCallback
- * (function) Callback to be invoked with a Sandbox, when ready.
- */
-this.Sandbox = function Sandbox(aURL, aCallback) {
- // Normalize the URL so the comparison in _makeSandboxContentLoaded works
- this._url = Services.io.newURI(aURL, null, null).spec;
- this._log("Creating sandbox for:", this._url);
- this._createFrame();
- this._createSandbox(aCallback);
-};
-
-this.Sandbox.prototype = {
-
- /**
- * Use the outer window ID as the identifier of the sandbox.
- */
- get id() {
- return this._frame.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils).outerWindowID;
- },
-
- /**
- * Reload the URL in the sandbox. This is useful to reuse a Sandbox (same
- * id and URL).
- */
- reload: function Sandbox_reload(aCallback) {
- this._log("reload:", this.id, ":", this._url);
- this._createSandbox(function createdSandbox(aSandbox) {
- this._log("reloaded sandbox id:", aSandbox.id);
- aCallback(aSandbox);
- }.bind(this));
- },
-
- /**
- * Frees the sandbox and releases the iframe created to host it.
- */
- free: function Sandbox_free() {
- this._log("free:", this.id);
- this._container.removeChild(this._frame);
- this._frame = null;
- this._container = null;
- this._url = null;
- },
-
- /**
- * Creates an empty, hidden iframe and sets it to the _frame
- * property of this object.
- */
- _createFrame: function Sandbox__createFrame() {
- let hiddenWindow = Services.appShell.hiddenDOMWindow;
- let doc = hiddenWindow.document;
-
- // Insert iframe in to create docshell.
- let frame = doc.createElementNS(XHTML_NS, "iframe");
- frame.setAttribute("mozframetype", "content");
- frame.sandbox = "allow-forms allow-scripts allow-same-origin";
- frame.style.visibility = "collapse";
- doc.documentElement.appendChild(frame);
-
- let docShell = frame.contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDocShell);
-
- // Stop about:blank from being loaded.
- docShell.stop(Ci.nsIWebNavigation.STOP_NETWORK);
-
- // Disable some types of content
- docShell.allowAuth = false;
- docShell.allowPlugins = false;
- docShell.allowImages = false;
- docShell.allowMedia = false;
- docShell.allowWindowControl = false;
-
- // Disable stylesheet loading since the document is not visible.
- let markupDocViewer = docShell.contentViewer;
- markupDocViewer.authorStyleDisabled = true;
-
- // Set instance properties.
- this._frame = frame;
- this._container = doc.documentElement;
- },
-
- _createSandbox: function Sandbox__createSandbox(aCallback) {
- let self = this;
- function _makeSandboxContentLoaded(event) {
- self._log("_makeSandboxContentLoaded:", self.id,
- event.target.location.toString());
- if (event.target != self._frame.contentDocument) {
- return;
- }
- self._frame.removeEventListener(
- "DOMWindowCreated", _makeSandboxContentLoaded, true
- );
-
- aCallback(self);
- }
-
- this._frame.addEventListener("DOMWindowCreated",
- _makeSandboxContentLoaded,
- true);
-
- // Load the iframe.
- let webNav = this._frame.contentWindow
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation);
-
- webNav.loadURI(
- this._url,
- Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_CACHE,
- null, // referrer
- null, // postData
- null // headers
- );
-
- },
-
- _log: function Sandbox__log(...aMessageArgs) {
- Logger.log.apply(Logger, ["sandbox"].concat(aMessageArgs));
- },
-
-};
diff --git a/toolkit/identity/jwcrypto.jsm b/toolkit/identity/jwcrypto.jsm
deleted file mode 100644
index 4bcba730f..000000000
--- a/toolkit/identity/jwcrypto.jsm
+++ /dev/null
@@ -1,180 +0,0 @@
-/* -*- js-indent-level: 2; indent-tabs-mode: nil -*- */
-/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-
-const Cu = Components.utils;
-const Ci = Components.interfaces;
-const Cc = Components.classes;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this,
- "IdentityCryptoService",
- "@mozilla.org/identity/crypto-service;1",
- "nsIIdentityCryptoService");
-
-this.EXPORTED_SYMBOLS = ["jwcrypto"];
-
-const ALGORITHMS = { RS256: "RS256", DS160: "DS160" };
-const DURATION_MS = 1000 * 60 * 2; // 2 minutes default assertion lifetime
-
-function log(...aMessageArgs) {
- Logger.log.apply(Logger, ["jwcrypto"].concat(aMessageArgs));
-}
-
-function generateKeyPair(aAlgorithmName, aCallback) {
- log("Generate key pair; alg =", aAlgorithmName);
-
- IdentityCryptoService.generateKeyPair(aAlgorithmName, function(rv, aKeyPair) {
- if (!Components.isSuccessCode(rv)) {
- return aCallback("key generation failed");
- }
-
- var publicKey;
-
- switch (aKeyPair.keyType) {
- case ALGORITHMS.RS256:
- publicKey = {
- algorithm: "RS",
- exponent: aKeyPair.hexRSAPublicKeyExponent,
- modulus: aKeyPair.hexRSAPublicKeyModulus
- };
- break;
-
- case ALGORITHMS.DS160:
- publicKey = {
- algorithm: "DS",
- y: aKeyPair.hexDSAPublicValue,
- p: aKeyPair.hexDSAPrime,
- q: aKeyPair.hexDSASubPrime,
- g: aKeyPair.hexDSAGenerator
- };
- break;
-
- default:
- return aCallback("unknown key type");
- }
-
- let keyWrapper = {
- serializedPublicKey: JSON.stringify(publicKey),
- _kp: aKeyPair
- };
-
- return aCallback(null, keyWrapper);
- });
-}
-
-function sign(aPayload, aKeypair, aCallback) {
- aKeypair._kp.sign(aPayload, function(rv, signature) {
- if (!Components.isSuccessCode(rv)) {
- log("ERROR: signer.sign failed");
- return aCallback("Sign failed");
- }
- log("signer.sign: success");
- return aCallback(null, signature);
- });
-}
-
-function jwcryptoClass()
-{
-}
-
-jwcryptoClass.prototype = {
- /*
- * Determine the expiration of the assertion. Returns expiry date
- * in milliseconds as integer.
- *
- * @param localtimeOffsetMsec (optional)
- * The number of milliseconds that must be added to the local clock
- * for it to agree with the server. For example, if the local clock
- * if two minutes fast, localtimeOffsetMsec would be -120000
- *
- * @param now (options)
- * Current date in milliseconds. Useful for mocking clock
- * skew in testing.
- */
- getExpiration: function(duration=DURATION_MS, localtimeOffsetMsec=0, now=Date.now()) {
- return now + localtimeOffsetMsec + duration;
- },
-
- isCertValid: function(aCert, aCallback) {
- // XXX check expiration, bug 769850
- aCallback(true);
- },
-
- generateKeyPair: function(aAlgorithmName, aCallback) {
- log("generating");
- generateKeyPair(aAlgorithmName, aCallback);
- },
-
- /*
- * Generate an assertion and return it through the provided callback.
- *
- * @param aCert
- * Identity certificate
- *
- * @param aKeyPair
- * KeyPair object
- *
- * @param aAudience
- * Audience of the assertion
- *
- * @param aOptions (optional)
- * Can include:
- * {
- * localtimeOffsetMsec: <clock offset in milliseconds>,
- * now: <current date in milliseconds>
- * duration: <validity duration for this assertion in milliseconds>
- * }
- *
- * localtimeOffsetMsec is the number of milliseconds that need to be
- * added to the local clock time to make it concur with the server.
- * For example, if the local clock is two minutes fast, the offset in
- * milliseconds would be -120000.
- *
- * @param aCallback
- * Function to invoke with resulting assertion. Assertion
- * will be string or null on failure.
- */
- generateAssertion: function(aCert, aKeyPair, aAudience, aOptions, aCallback) {
- if (typeof aOptions == "function") {
- aCallback = aOptions;
- aOptions = { };
- }
-
- // for now, we hack the algorithm name
- // XXX bug 769851
- var header = {"alg": "DS128"};
- var headerBytes = IdentityCryptoService.base64UrlEncode(
- JSON.stringify(header));
-
- var payload = {
- exp: this.getExpiration(
- aOptions.duration, aOptions.localtimeOffsetMsec, aOptions.now),
- aud: aAudience
- };
- var payloadBytes = IdentityCryptoService.base64UrlEncode(
- JSON.stringify(payload));
-
- log("payload bytes", payload, payloadBytes);
- sign(headerBytes + "." + payloadBytes, aKeyPair, function(err, signature) {
- if (err)
- return aCallback(err);
-
- var signedAssertion = headerBytes + "." + payloadBytes + "." + signature;
- return aCallback(null, aCert + "~" + signedAssertion);
- });
- }
-
-};
-
-this.jwcrypto = new jwcryptoClass();
-this.jwcrypto.ALGORITHMS = ALGORITHMS;
diff --git a/toolkit/identity/moz.build b/toolkit/identity/moz.build
deleted file mode 100644
index fd2ba9c8c..000000000
--- a/toolkit/identity/moz.build
+++ /dev/null
@@ -1,25 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPIDL_SOURCES += ['nsIIdentityCryptoService.idl']
-
-XPIDL_MODULE = 'identity'
-
-SOURCES += ['IdentityCryptoService.cpp']
-
-EXTRA_JS_MODULES.identity += [
- 'Identity.jsm',
- 'IdentityProvider.jsm',
- 'IdentityStore.jsm',
- 'IdentityUtils.jsm',
- 'jwcrypto.jsm',
- 'LogUtils.jsm',
- 'MinimalIdentity.jsm',
- 'RelyingParty.jsm',
- 'Sandbox.jsm',
-]
-
-FINAL_LIBRARY = 'xul'
diff --git a/toolkit/identity/nsIIdentityCryptoService.idl b/toolkit/identity/nsIIdentityCryptoService.idl
deleted file mode 100644
index 90149e2e8..000000000
--- a/toolkit/identity/nsIIdentityCryptoService.idl
+++ /dev/null
@@ -1,106 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIURI;
-interface nsIIdentityKeyGenCallback;
-interface nsIIdentitySignCallback;
-
-/* Naming and calling conventions:
- *
- * A"hex" prefix means "hex-encoded string representation of a byte sequence"
- * e.g. "ae34bcdf123"
- *
- * A "base64url" prefix means "base-64-URL-encoded string repressentation of a
- * byte sequence.
- * e.g. "eyJhbGciOiJSUzI1NiJ9"
- * http://en.wikipedia.org/wiki/Base64#Variants_summary_table
- * we use the padded approach to base64-url-encoding
- *
- * Callbacks take an "in nsresult rv" argument that indicates whether the async
- * operation succeeded. On success, rv will be a success code
- * (NS_SUCCEEDED(rv) / Components.isSuccessCode(rv)) and the remaining
- * arguments are as defined in the documentation for the callback. When the
- * operation fails, rv will be a failure code (NS_FAILED(rv) /
- * !Components.isSuccessCode(rv)) and the values of the remaining arguments will
- * be unspecified.
- *
- * Key Types:
- *
- * "RS256": RSA + SHA-256.
- *
- * "DS160": DSA with SHA-1. A 1024-bit prime and a 160-bit subprime with SHA-1.
- *
- * we use these abbreviated algorithm names as per the JWA spec
- * http://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms-02
- */
-
-// "@mozilla.org/identity/crypto-service;1"
-[scriptable, builtinclass, uuid(f087e6bc-dd33-4f6c-a106-dd786e052ee9)]
-interface nsIIdentityCryptoService : nsISupports
-{
- void generateKeyPair(in AUTF8String algorithm,
- in nsIIdentityKeyGenCallback callback);
-
- ACString base64UrlEncode(in AUTF8String toEncode);
-};
-
-/**
- * This interface provides a keypair and signing interface for Identity functionality
- */
-[scriptable, uuid(73962dc7-8ee7-4346-a12b-b039e1d9b54d)]
-interface nsIIdentityKeyPair : nsISupports
-{
- readonly attribute AUTF8String keyType;
-
- // RSA properties, only accessible when keyType == "RS256"
-
- readonly attribute AUTF8String hexRSAPublicKeyExponent;
- readonly attribute AUTF8String hexRSAPublicKeyModulus;
-
- // DSA properties, only accessible when keyType == "DS128"
- readonly attribute AUTF8String hexDSAPrime; // p
- readonly attribute AUTF8String hexDSASubPrime; // q
- readonly attribute AUTF8String hexDSAGenerator; // g
- readonly attribute AUTF8String hexDSAPublicValue; // y
-
- void sign(in AUTF8String aText,
- in nsIIdentitySignCallback callback);
-
- // XXX implement verification bug 769856
- // AUTF8String verify(in AUTF8String aSignature, in AUTF8String encodedPublicKey);
-
-};
-
-/**
- * This interface provides a JavaScript callback object used to collect the
- * nsIIdentityServeKeyPair when the keygen operation is complete
- *
- * though there is discussion as to whether we need the nsresult,
- * we keep it so we can track deeper crypto errors.
- */
-[scriptable, function, uuid(90f24ca2-2b05-4ca9-8aec-89d38e2f905a)]
-interface nsIIdentityKeyGenCallback : nsISupports
-{
- void generateKeyPairFinished(in nsresult rv,
- in nsIIdentityKeyPair keyPair);
-};
-
-/**
- * This interface provides a JavaScript callback object used to collect the
- * AUTF8String signature
- */
-[scriptable, function, uuid(2d3e5036-374b-4b47-a430-1196b67b890f)]
-interface nsIIdentitySignCallback : nsISupports
-{
- /** On success, base64urlSignature is the base-64-URL-encoded signature
- *
- * For RS256 signatures, XXX bug 769858
- *
- * For DSA128 signatures, the signature is the r value concatenated with the
- * s value, each component padded with leading zeroes as necessary.
- */
- void signFinished(in nsresult rv, in ACString base64urlSignature);
-};
diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm
index 41b398efc..5eea04b0f 100644
--- a/toolkit/modules/AppConstants.jsm
+++ b/toolkit/modules/AppConstants.jsm
@@ -194,13 +194,6 @@ MOZ_SAFE_BROWSING:
false,
#endif
- MOZ_REQUIRE_SIGNING:
-#ifdef MOZ_REQUIRE_SIGNING
- true,
-#else
- false,
-#endif
-
MENUBAR_CAN_AUTOHIDE:
#ifdef MENUBAR_CAN_AUTOHIDE
true,
@@ -209,7 +202,7 @@ MOZ_SAFE_BROWSING:
#endif
CAN_DRAW_IN_TITLEBAR:
-#ifdef CAN_DRAW_IN_TITLEBAR
+#ifdef MOZ_CAN_DRAW_IN_TITLEBAR
true,
#else
false,
diff --git a/toolkit/modules/LightweightThemeConsumer.jsm b/toolkit/modules/LightweightThemeConsumer.jsm
index 325f711b7..4010a9ff2 100644
--- a/toolkit/modules/LightweightThemeConsumer.jsm
+++ b/toolkit/modules/LightweightThemeConsumer.jsm
@@ -147,7 +147,7 @@ LightweightThemeConsumer.prototype = {
footer.removeAttribute("lwthemefooter");
}
-#ifdef XP_MACOSX
+#if defined(XP_MACOSX) && defined(MOZ_CAN_DRAW_IN_TITLEBAR)
// On OS X, we extend the lightweight theme into the titlebar, which means setting
// the chromemargin attribute. Some XUL applications already draw in the titlebar,
// so we need to save the chromemargin value before we overwrite it with the value
diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build
index 8a364df8c..54adae4cf 100644
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -92,9 +92,6 @@ EXTRA_PP_JS_MODULES += [
'WindowDraggingUtils.jsm',
]
-if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
- DEFINES['CAN_DRAW_IN_TITLEBAR'] = 1
-
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3'):
DEFINES['MENUBAR_CAN_AUTOHIDE'] = 1
diff --git a/toolkit/moz.build b/toolkit/moz.build
index 9c5102a01..708a6ff37 100644
--- a/toolkit/moz.build
+++ b/toolkit/moz.build
@@ -8,7 +8,6 @@ DIRS += [
'components',
'content',
'forgetaboutsite',
- 'identity',
'locales',
'modules',
'mozapps/downloads',
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
index 128402257..fe14cb567 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -345,20 +345,6 @@ set_config('MOZ_FMP4', fmp4)
set_define('MOZ_FMP4', fmp4)
add_old_configure_assignment('MOZ_FMP4', fmp4)
-# Libaom AV1 Video Codec Support
-# ==============================================================
-option('--enable-av1',
- help='Enable libaom for av1 video support')
-
-@depends('--enable-av1')
-def av1(value):
- enabled = bool(value)
- if enabled:
- return True
-
-set_config('MOZ_AV1', av1)
-set_define('MOZ_AV1', av1)
-
# Miscellaneous
# ==============================================================
option(name='--enable-chrome-format',