From c08eaf90ca78cc5f60a923070dd68280c5e4d399 Mon Sep 17 00:00:00 2001 From: Roy Tam Date: Fri, 21 Jun 2019 11:00:47 +0800 Subject: [PATCH] import change from rmottola/Arctic-Fox: - Bug 1142761 - Move CallSetter into ScriptedIndirectProxyHandler so it will eventually be deleted along with its only remaining caller. (a5a0b3f6b) - Bug 1143810 - Remove some XPConnect JSClass::setProperty hooks that are not needed anymore. (4eda6a60b) - Bug 1142195 - Remove some unused class declarations in the DOM Cache code (afd802623) - Bug 1145345 - Account for a greater variety of rounding errors when comparing coordinates (6a41f34f3) - Bug 1145787 - Put a misplaced assertion into its proper place. (7f760a66d) - Bug 1146059 - Remove Response.finalURL. (230d9fa50) - Bug 1134324 - Set CORS mode and credentials on Fetch event Request. r=michal (772fcac8f) - Bug 1136200 - Verify request type is not no-cors if response is opaque (396c9bfb4) - Bug 1144249 - fix fetch no-cors mode. r=bkelly (af9656291) - Bug 1144876 - Stop spamming stderr with a warning every time that we encounter a document that is not controlled by a service worker; (0a5c5fbfd) - Bug 1117172 part 1. Allow passing an optional aGivenProto to binding Wrap methods. (8aea85046) - Bug 1117172 part 2. Change the non-wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv (13146be83) - Bug 1117172 part 3. Change the wrappercached WrapObject methods to al low passing in aGivenProto. r=peterv (1621ef48d) - Bug 1146293 - Fix coding style break (intent and line length) caused by Bug 1117172 and Bug 1145631. (0822709f1) - Bug 1121298 - Part 1: refactor MozNDEFRecord cstor. (6e57a37ec) - Bug 1121298 - Part 2: Add Constructor(uri) for MozNDEFRecord. (46f921bcf) - Bug 1121298 - Part 3. add getAsURI. (e67cad94b) - Bug 1138886 - Structured Clone for MozNDEFRecord. (With adaptations of Bug 1117172 part 3) (b83b7f684) - Bug 1143504 - Disconnect the Cache object from its actor when it gets cycle collected. (dae58dcdd) --- dom/activities/Activity.cpp | 4 +- dom/activities/Activity.h | 2 +- dom/animation/Animation.cpp | 4 +- dom/animation/Animation.h | 2 +- dom/animation/AnimationEffect.cpp | 4 +- dom/animation/AnimationEffect.h | 2 +- dom/animation/AnimationPlayer.cpp | 4 +- dom/animation/AnimationPlayer.h | 2 +- dom/animation/AnimationTimeline.cpp | 4 +- dom/animation/AnimationTimeline.h | 2 +- dom/archivereader/ArchiveReader.cpp | 4 +- dom/archivereader/ArchiveReader.h | 2 +- dom/archivereader/ArchiveRequest.cpp | 4 +- dom/archivereader/ArchiveRequest.h | 2 +- dom/base/AnonymousContent.cpp | 3 +- dom/base/AnonymousContent.h | 2 +- dom/base/Attr.cpp | 4 +- dom/base/Attr.h | 2 +- dom/base/BarProps.cpp | 4 +- dom/base/BarProps.h | 2 +- dom/base/Comment.cpp | 4 +- dom/base/Comment.h | 2 +- dom/base/Console.cpp | 4 +- dom/base/Console.h | 2 +- dom/base/Crypto.cpp | 4 +- dom/base/Crypto.h | 2 +- dom/base/DOMCursor.cpp | 4 +- dom/base/DOMCursor.h | 2 +- dom/base/DOMError.cpp | 4 +- dom/base/DOMError.h | 2 +- dom/base/DOMException.cpp | 8 +- dom/base/DOMException.h | 4 +- dom/base/DOMImplementation.cpp | 4 +- dom/base/DOMImplementation.h | 2 +- dom/base/DOMMatrix.cpp | 4 +- dom/base/DOMMatrix.h | 2 +- dom/base/DOMParser.h | 4 +- dom/base/DOMPoint.cpp | 4 +- dom/base/DOMPoint.h | 2 +- dom/base/DOMQuad.cpp | 4 +- dom/base/DOMQuad.h | 2 +- dom/base/DOMRect.cpp | 12 +- dom/base/DOMRect.h | 6 +- dom/base/DOMRequest.cpp | 4 +- dom/base/DOMRequest.h | 2 +- dom/base/DOMStringList.cpp | 4 +- dom/base/DOMStringList.h | 2 +- dom/base/DocumentFragment.cpp | 4 +- dom/base/DocumentFragment.h | 2 +- dom/base/DocumentType.cpp | 4 +- dom/base/DocumentType.h | 2 +- dom/base/Element.cpp | 8 +- dom/base/Element.h | 4 +- dom/base/EventSource.cpp | 4 +- dom/base/EventSource.h | 2 +- dom/base/File.cpp | 10 +- dom/base/File.h | 4 +- dom/base/FragmentOrElement.cpp | 4 +- dom/base/FragmentOrElement.h | 2 +- dom/base/MessageChannel.cpp | 4 +- dom/base/MessageChannel.h | 2 +- dom/base/MessagePort.cpp | 6 +- dom/base/MessagePort.h | 2 +- dom/base/MessagePortList.cpp | 4 +- dom/base/MessagePortList.h | 2 +- dom/base/Navigator.cpp | 4 +- dom/base/Navigator.h | 2 +- dom/base/NodeIterator.cpp | 4 +- dom/base/NodeIterator.h | 2 +- dom/base/PerformanceEntry.cpp | 4 +- dom/base/PerformanceEntry.h | 2 +- dom/base/PerformanceMark.cpp | 4 +- dom/base/PerformanceMark.h | 2 +- dom/base/PerformanceMeasure.cpp | 4 +- dom/base/PerformanceMeasure.h | 2 +- dom/base/PerformanceResourceTiming.cpp | 4 +- dom/base/PerformanceResourceTiming.h | 2 +- dom/base/ProcessGlobal.h | 2 +- dom/base/ShadowRoot.cpp | 4 +- dom/base/ShadowRoot.h | 2 +- dom/base/StructuredCloneTags.h | 2 + dom/base/StyleSheetList.cpp | 4 +- dom/base/StyleSheetList.h | 2 +- dom/base/SubtleCrypto.cpp | 4 +- dom/base/SubtleCrypto.h | 2 +- dom/base/TreeWalker.cpp | 4 +- dom/base/TreeWalker.h | 2 +- dom/base/URL.cpp | 4 +- dom/base/URL.h | 2 +- dom/base/URLSearchParams.cpp | 4 +- dom/base/URLSearchParams.h | 2 +- dom/base/WebSocket.cpp | 4 +- dom/base/WebSocket.h | 2 +- dom/base/nsContentList.cpp | 16 +- dom/base/nsContentList.h | 10 +- dom/base/nsDOMAttributeMap.cpp | 4 +- dom/base/nsDOMAttributeMap.h | 2 +- dom/base/nsDOMCaretPosition.cpp | 4 +- dom/base/nsDOMCaretPosition.h | 2 +- dom/base/nsDOMDataChannel.cpp | 4 +- dom/base/nsDOMDataChannel.h | 2 +- dom/base/nsDOMFileReader.cpp | 4 +- dom/base/nsDOMFileReader.h | 2 +- dom/base/nsDOMMutationObserver.h | 8 +- dom/base/nsDOMSerializer.h | 4 +- dom/base/nsDOMSettableTokenList.cpp | 4 +- dom/base/nsDOMSettableTokenList.h | 2 +- dom/base/nsDOMTokenList.cpp | 4 +- dom/base/nsDOMTokenList.h | 2 +- dom/base/nsFormData.cpp | 4 +- dom/base/nsFormData.h | 2 +- dom/base/nsGlobalWindow.cpp | 2 +- dom/base/nsGlobalWindow.h | 2 +- dom/base/nsHistory.cpp | 4 +- dom/base/nsHistory.h | 2 +- dom/base/nsINode.cpp | 4 +- dom/base/nsINode.h | 4 +- dom/base/nsInProcessTabChildGlobal.h | 2 +- dom/base/nsJSEnvironment.cpp | 31 +- dom/base/nsLocation.cpp | 4 +- dom/base/nsLocation.h | 2 +- dom/base/nsMimeTypeArray.cpp | 8 +- dom/base/nsMimeTypeArray.h | 4 +- dom/base/nsPerformance.cpp | 12 +- dom/base/nsPerformance.h | 6 +- dom/base/nsPluginArray.cpp | 8 +- dom/base/nsPluginArray.h | 4 +- dom/base/nsRange.cpp | 4 +- dom/base/nsRange.h | 2 +- dom/base/nsScreen.cpp | 4 +- dom/base/nsScreen.h | 2 +- dom/base/nsTextNode.cpp | 4 +- dom/base/nsTextNode.h | 2 +- dom/base/nsWindowRoot.cpp | 4 +- dom/base/nsWindowRoot.h | 2 +- dom/base/nsWrapperCache.h | 2 +- dom/base/nsXMLHttpRequest.cpp | 4 +- dom/base/nsXMLHttpRequest.h | 6 +- dom/battery/BatteryManager.cpp | 4 +- dom/battery/BatteryManager.h | 2 +- dom/bindings/BindingUtils.cpp | 2 +- dom/bindings/BindingUtils.h | 8 +- dom/bindings/Codegen.py | 72 ++-- dom/bindings/StructuredClone.cpp | 2 +- dom/bindings/test/TestBindingHeader.h | 2 +- dom/bluetooth/BluetoothAdapter.cpp | 4 +- dom/bluetooth/BluetoothAdapter.h | 2 +- dom/bluetooth/BluetoothDevice.cpp | 4 +- dom/bluetooth/BluetoothDevice.h | 2 +- dom/bluetooth/BluetoothManager.cpp | 4 +- dom/bluetooth/BluetoothManager.h | 2 +- dom/bluetooth2/BluetoothAdapter.cpp | 4 +- dom/bluetooth2/BluetoothAdapter.h | 3 +- dom/bluetooth2/BluetoothClassOfDevice.cpp | 5 +- dom/bluetooth2/BluetoothClassOfDevice.h | 7 +- dom/bluetooth2/BluetoothDevice.cpp | 5 +- dom/bluetooth2/BluetoothDevice.h | 5 +- dom/bluetooth2/BluetoothDiscoveryHandle.cpp | 5 +- dom/bluetooth2/BluetoothDiscoveryHandle.h | 3 +- dom/bluetooth2/BluetoothGatt.cpp | 5 +- dom/bluetooth2/BluetoothGatt.h | 5 +- dom/bluetooth2/BluetoothManager.cpp | 4 +- dom/bluetooth2/BluetoothManager.h | 7 +- dom/bluetooth2/BluetoothPairingHandle.cpp | 5 +- dom/bluetooth2/BluetoothPairingHandle.h | 7 +- dom/bluetooth2/BluetoothPairingListener.cpp | 5 +- dom/bluetooth2/BluetoothPairingListener.h | 5 +- .../bluedroid/BluetoothGattManager.h | 2 +- dom/broadcastchannel/BroadcastChannel.cpp | 4 +- dom/broadcastchannel/BroadcastChannel.h | 2 +- dom/cache/AutoUtils.h | 3 - dom/cache/Cache.cpp | 22 +- dom/cache/Cache.h | 11 +- dom/cache/CacheParent.h | 3 - dom/cache/CacheStorage.cpp | 4 +- dom/cache/CacheStorage.h | 4 +- dom/cache/Context.h | 1 - dom/cache/DBSchema.h | 1 - dom/cache/FetchPut.h | 7 - dom/cache/Manager.h | 2 - dom/cache/SavedTypes.h | 5 - dom/cache/TypeUtils.h | 4 - dom/camera/DOMCameraCapabilities.cpp | 20 +- dom/camera/DOMCameraCapabilities.h | 10 +- dom/camera/DOMCameraControl.cpp | 4 +- dom/camera/DOMCameraControl.h | 2 +- dom/camera/DOMCameraDetectedFace.cpp | 4 +- dom/camera/DOMCameraDetectedFace.h | 2 +- dom/camera/DOMCameraManager.cpp | 4 +- dom/camera/DOMCameraManager.h | 2 +- dom/canvas/CanvasGradient.h | 4 +- dom/canvas/CanvasPattern.h | 4 +- dom/canvas/CanvasRenderingContext2D.cpp | 8 +- dom/canvas/CanvasRenderingContext2D.h | 4 +- dom/canvas/ImageData.cpp | 4 +- dom/canvas/ImageData.h | 2 +- dom/canvas/TextMetrics.h | 4 +- dom/canvas/WebGL1Context.cpp | 4 +- dom/canvas/WebGL1Context.h | 2 +- dom/canvas/WebGL2Context.cpp | 4 +- dom/canvas/WebGL2Context.h | 2 +- dom/canvas/WebGLActiveInfo.cpp | 4 +- dom/canvas/WebGLActiveInfo.h | 2 +- dom/canvas/WebGLBuffer.cpp | 4 +- dom/canvas/WebGLBuffer.h | 2 +- dom/canvas/WebGLContext.h | 2 +- dom/canvas/WebGLExtensions.h | 6 +- dom/canvas/WebGLFramebuffer.cpp | 4 +- dom/canvas/WebGLFramebuffer.h | 2 +- dom/canvas/WebGLProgram.cpp | 4 +- dom/canvas/WebGLProgram.h | 2 +- dom/canvas/WebGLQuery.cpp | 4 +- dom/canvas/WebGLQuery.h | 2 +- dom/canvas/WebGLRenderbuffer.cpp | 4 +- dom/canvas/WebGLRenderbuffer.h | 2 +- dom/canvas/WebGLSampler.cpp | 4 +- dom/canvas/WebGLSampler.h | 2 +- dom/canvas/WebGLShader.cpp | 4 +- dom/canvas/WebGLShader.h | 2 +- dom/canvas/WebGLShaderPrecisionFormat.cpp | 3 +- dom/canvas/WebGLShaderPrecisionFormat.h | 2 +- dom/canvas/WebGLSync.cpp | 4 +- dom/canvas/WebGLSync.h | 2 +- dom/canvas/WebGLTexture.cpp | 4 +- dom/canvas/WebGLTexture.h | 2 +- dom/canvas/WebGLTransformFeedback.cpp | 4 +- dom/canvas/WebGLTransformFeedback.h | 2 +- dom/canvas/WebGLUniformLocation.cpp | 4 +- dom/canvas/WebGLUniformLocation.h | 2 +- dom/canvas/WebGLVertexArray.cpp | 4 +- dom/canvas/WebGLVertexArray.h | 2 +- dom/cellbroadcast/CellBroadcast.cpp | 4 +- dom/cellbroadcast/CellBroadcast.h | 2 +- dom/cellbroadcast/CellBroadcastMessage.cpp | 8 +- dom/cellbroadcast/CellBroadcastMessage.h | 4 +- dom/crypto/CryptoKey.cpp | 4 +- dom/crypto/CryptoKey.h | 2 +- dom/datastore/DataStore.cpp | 4 +- dom/datastore/DataStore.h | 2 +- dom/datastore/DataStoreCursor.cpp | 3 +- dom/datastore/DataStoreCursor.h | 2 +- dom/datastore/DataStoreService.cpp | 2 +- dom/devicestorage/DeviceStorage.h | 2 +- .../DeviceStorageRequestChild.cpp | 2 +- dom/devicestorage/nsDeviceStorage.cpp | 4 +- dom/encoding/TextDecoder.h | 4 +- dom/encoding/TextEncoder.h | 4 +- dom/events/AnimationEvent.h | 4 +- dom/events/BeforeAfterKeyboardEvent.h | 4 +- dom/events/BeforeUnloadEvent.h | 4 +- dom/events/ClipboardEvent.h | 4 +- dom/events/CommandEvent.h | 4 +- dom/events/CompositionEvent.h | 4 +- dom/events/CustomEvent.cpp | 4 +- dom/events/CustomEvent.h | 2 +- dom/events/DataContainerEvent.h | 4 +- dom/events/DataTransfer.cpp | 4 +- dom/events/DataTransfer.h | 2 +- dom/events/DeviceMotionEvent.h | 12 +- dom/events/DragEvent.h | 4 +- dom/events/Event.cpp | 8 +- dom/events/Event.h | 4 +- dom/events/FocusEvent.h | 4 +- dom/events/ImageCaptureError.cpp | 4 +- dom/events/ImageCaptureError.h | 2 +- dom/events/InputEvent.h | 4 +- dom/events/KeyboardEvent.h | 4 +- dom/events/MessageEvent.cpp | 4 +- dom/events/MessageEvent.h | 2 +- dom/events/MouseEvent.h | 4 +- dom/events/MouseScrollEvent.h | 4 +- dom/events/MutationEvent.h | 4 +- dom/events/NotifyPaintEvent.h | 4 +- dom/events/PaintRequest.cpp | 8 +- dom/events/PaintRequest.h | 4 +- dom/events/PointerEvent.h | 4 +- dom/events/ScrollAreaEvent.h | 4 +- dom/events/SimpleGestureEvent.h | 4 +- dom/events/SpeechRecognitionError.h | 4 +- dom/events/StorageEvent.cpp | 4 +- dom/events/StorageEvent.h | 2 +- dom/events/Touch.cpp | 4 +- dom/events/Touch.h | 2 +- dom/events/TouchEvent.cpp | 4 +- dom/events/TouchEvent.h | 6 +- dom/events/TransitionEvent.h | 4 +- dom/events/UIEvent.h | 4 +- dom/events/WheelEvent.h | 4 +- dom/events/XULCommandEvent.h | 4 +- dom/fetch/FetchDriver.cpp | 34 +- dom/fetch/Headers.cpp | 4 +- dom/fetch/Headers.h | 2 +- dom/fetch/Request.h | 4 +- dom/fetch/Response.cpp | 13 - dom/fetch/Response.h | 13 +- dom/filesystem/Directory.cpp | 4 +- dom/filesystem/Directory.h | 2 +- dom/fmradio/FMRadio.cpp | 4 +- dom/fmradio/FMRadio.h | 2 +- dom/gamepad/Gamepad.cpp | 4 +- dom/gamepad/Gamepad.h | 2 +- dom/gamepad/GamepadButton.cpp | 4 +- dom/gamepad/GamepadButton.h | 2 +- dom/geolocation/nsGeoPosition.cpp | 8 +- dom/geolocation/nsGeoPosition.h | 4 +- dom/geolocation/nsGeolocation.cpp | 8 +- dom/geolocation/nsGeolocation.h | 4 +- dom/html/HTMLAllCollection.cpp | 4 +- dom/html/HTMLAllCollection.h | 2 +- dom/html/HTMLAnchorElement.cpp | 4 +- dom/html/HTMLAnchorElement.h | 2 +- dom/html/HTMLAreaElement.cpp | 4 +- dom/html/HTMLAreaElement.h | 2 +- dom/html/HTMLAudioElement.cpp | 4 +- dom/html/HTMLAudioElement.h | 2 +- dom/html/HTMLBRElement.cpp | 4 +- dom/html/HTMLBRElement.h | 2 +- dom/html/HTMLBodyElement.cpp | 4 +- dom/html/HTMLBodyElement.h | 2 +- dom/html/HTMLButtonElement.cpp | 4 +- dom/html/HTMLButtonElement.h | 2 +- dom/html/HTMLCanvasElement.cpp | 8 +- dom/html/HTMLCanvasElement.h | 4 +- dom/html/HTMLContentElement.cpp | 8 +- dom/html/HTMLContentElement.h | 4 +- dom/html/HTMLDataElement.cpp | 4 +- dom/html/HTMLDataElement.h | 2 +- dom/html/HTMLDataListElement.cpp | 4 +- dom/html/HTMLDataListElement.h | 2 +- dom/html/HTMLDetailsElement.cpp | 4 +- dom/html/HTMLDetailsElement.h | 2 +- dom/html/HTMLDivElement.cpp | 4 +- dom/html/HTMLDivElement.h | 2 +- dom/html/HTMLElement.cpp | 6 +- dom/html/HTMLFieldSetElement.cpp | 4 +- dom/html/HTMLFieldSetElement.h | 2 +- dom/html/HTMLFontElement.cpp | 4 +- dom/html/HTMLFontElement.h | 2 +- dom/html/HTMLFormControlsCollection.cpp | 4 +- dom/html/HTMLFormControlsCollection.h | 2 +- dom/html/HTMLFormElement.cpp | 4 +- dom/html/HTMLFormElement.h | 2 +- dom/html/HTMLFrameElement.cpp | 4 +- dom/html/HTMLFrameElement.h | 2 +- dom/html/HTMLFrameSetElement.cpp | 4 +- dom/html/HTMLFrameSetElement.h | 2 +- dom/html/HTMLHRElement.cpp | 4 +- dom/html/HTMLHRElement.h | 2 +- dom/html/HTMLHeadingElement.cpp | 4 +- dom/html/HTMLHeadingElement.h | 2 +- dom/html/HTMLIFrameElement.cpp | 4 +- dom/html/HTMLIFrameElement.h | 2 +- dom/html/HTMLImageElement.cpp | 4 +- dom/html/HTMLImageElement.h | 2 +- dom/html/HTMLInputElement.cpp | 4 +- dom/html/HTMLInputElement.h | 2 +- dom/html/HTMLLIElement.cpp | 4 +- dom/html/HTMLLIElement.h | 2 +- dom/html/HTMLLabelElement.cpp | 4 +- dom/html/HTMLLabelElement.h | 2 +- dom/html/HTMLLegendElement.cpp | 4 +- dom/html/HTMLLegendElement.h | 2 +- dom/html/HTMLLinkElement.cpp | 4 +- dom/html/HTMLLinkElement.h | 2 +- dom/html/HTMLMapElement.cpp | 4 +- dom/html/HTMLMapElement.h | 2 +- dom/html/HTMLMenuElement.cpp | 4 +- dom/html/HTMLMenuElement.h | 2 +- dom/html/HTMLMenuItemElement.cpp | 4 +- dom/html/HTMLMenuItemElement.h | 2 +- dom/html/HTMLMetaElement.cpp | 4 +- dom/html/HTMLMetaElement.h | 2 +- dom/html/HTMLMeterElement.cpp | 4 +- dom/html/HTMLMeterElement.h | 2 +- dom/html/HTMLModElement.cpp | 4 +- dom/html/HTMLModElement.h | 2 +- dom/html/HTMLObjectElement.cpp | 4 +- dom/html/HTMLObjectElement.h | 2 +- dom/html/HTMLOptGroupElement.cpp | 4 +- dom/html/HTMLOptGroupElement.h | 2 +- dom/html/HTMLOptionElement.cpp | 4 +- dom/html/HTMLOptionElement.h | 2 +- dom/html/HTMLOptionsCollection.cpp | 4 +- dom/html/HTMLOptionsCollection.h | 2 +- dom/html/HTMLOutputElement.cpp | 4 +- dom/html/HTMLOutputElement.h | 2 +- dom/html/HTMLParagraphElement.cpp | 4 +- dom/html/HTMLParagraphElement.h | 2 +- dom/html/HTMLPictureElement.cpp | 4 +- dom/html/HTMLPictureElement.h | 2 +- dom/html/HTMLPreElement.cpp | 4 +- dom/html/HTMLPreElement.h | 2 +- dom/html/HTMLProgressElement.cpp | 4 +- dom/html/HTMLProgressElement.h | 2 +- dom/html/HTMLPropertiesCollection.cpp | 8 +- dom/html/HTMLPropertiesCollection.h | 4 +- dom/html/HTMLScriptElement.cpp | 4 +- dom/html/HTMLScriptElement.h | 2 +- dom/html/HTMLSelectElement.cpp | 4 +- dom/html/HTMLSelectElement.h | 2 +- dom/html/HTMLShadowElement.cpp | 4 +- dom/html/HTMLShadowElement.h | 2 +- dom/html/HTMLSharedElement.cpp | 14 +- dom/html/HTMLSharedElement.h | 2 +- dom/html/HTMLSharedListElement.cpp | 8 +- dom/html/HTMLSharedListElement.h | 2 +- dom/html/HTMLSharedObjectElement.cpp | 6 +- dom/html/HTMLSharedObjectElement.h | 2 +- dom/html/HTMLSourceElement.cpp | 4 +- dom/html/HTMLSourceElement.h | 2 +- dom/html/HTMLSpanElement.cpp | 4 +- dom/html/HTMLSpanElement.h | 2 +- dom/html/HTMLStyleElement.cpp | 4 +- dom/html/HTMLStyleElement.h | 2 +- dom/html/HTMLSummaryElement.cpp | 4 +- dom/html/HTMLSummaryElement.h | 2 +- dom/html/HTMLTableCaptionElement.cpp | 4 +- dom/html/HTMLTableCaptionElement.h | 2 +- dom/html/HTMLTableCellElement.cpp | 4 +- dom/html/HTMLTableCellElement.h | 2 +- dom/html/HTMLTableColElement.cpp | 4 +- dom/html/HTMLTableColElement.h | 2 +- dom/html/HTMLTableElement.cpp | 10 +- dom/html/HTMLTableElement.h | 2 +- dom/html/HTMLTableRowElement.cpp | 4 +- dom/html/HTMLTableRowElement.h | 2 +- dom/html/HTMLTableSectionElement.cpp | 4 +- dom/html/HTMLTableSectionElement.h | 2 +- dom/html/HTMLTemplateElement.cpp | 4 +- dom/html/HTMLTemplateElement.h | 2 +- dom/html/HTMLTextAreaElement.cpp | 4 +- dom/html/HTMLTextAreaElement.h | 2 +- dom/html/HTMLTimeElement.cpp | 4 +- dom/html/HTMLTimeElement.h | 2 +- dom/html/HTMLTitleElement.cpp | 4 +- dom/html/HTMLTitleElement.h | 2 +- dom/html/HTMLTrackElement.cpp | 4 +- dom/html/HTMLTrackElement.h | 2 +- dom/html/HTMLUnknownElement.cpp | 4 +- dom/html/HTMLUnknownElement.h | 2 +- dom/html/HTMLVideoElement.cpp | 4 +- dom/html/HTMLVideoElement.h | 2 +- dom/html/ImageDocument.cpp | 4 +- dom/html/ImageDocument.h | 2 +- dom/html/MediaError.cpp | 4 +- dom/html/MediaError.h | 2 +- dom/html/RadioNodeList.cpp | 4 +- dom/html/RadioNodeList.h | 2 +- dom/html/TimeRanges.cpp | 4 +- dom/html/TimeRanges.h | 2 +- dom/html/UndoManager.h | 4 +- dom/html/ValidityState.cpp | 4 +- dom/html/ValidityState.h | 2 +- dom/html/nsDOMStringMap.cpp | 4 +- dom/html/nsDOMStringMap.h | 2 +- dom/html/nsHTMLDocument.cpp | 4 +- dom/html/nsHTMLDocument.h | 2 +- dom/html/nsIHTMLCollection.h | 2 +- dom/icc/Icc.cpp | 4 +- dom/icc/Icc.h | 2 +- dom/icc/IccCardLockError.cpp | 4 +- dom/icc/IccCardLockError.h | 2 +- dom/icc/IccInfo.cpp | 12 +- dom/icc/IccInfo.h | 6 +- dom/icc/IccManager.cpp | 4 +- dom/icc/IccManager.h | 2 +- dom/indexedDB/IDBCursor.cpp | 6 +- dom/indexedDB/IDBCursor.h | 2 +- dom/indexedDB/IDBDatabase.cpp | 4 +- dom/indexedDB/IDBDatabase.h | 2 +- dom/indexedDB/IDBEvents.cpp | 4 +- dom/indexedDB/IDBEvents.h | 2 +- dom/indexedDB/IDBFactory.cpp | 4 +- dom/indexedDB/IDBFactory.h | 2 +- dom/indexedDB/IDBFileHandle.cpp | 4 +- dom/indexedDB/IDBFileHandle.h | 2 +- dom/indexedDB/IDBFileRequest.cpp | 6 +- dom/indexedDB/IDBFileRequest.h | 2 +- dom/indexedDB/IDBIndex.cpp | 4 +- dom/indexedDB/IDBIndex.h | 2 +- dom/indexedDB/IDBKeyRange.cpp | 4 +- dom/indexedDB/IDBKeyRange.h | 2 +- dom/indexedDB/IDBMutableFile.cpp | 4 +- dom/indexedDB/IDBMutableFile.h | 2 +- dom/indexedDB/IDBObjectStore.cpp | 6 +- dom/indexedDB/IDBObjectStore.h | 2 +- dom/indexedDB/IDBRequest.cpp | 8 +- dom/indexedDB/IDBRequest.h | 4 +- dom/indexedDB/IDBTransaction.cpp | 4 +- dom/indexedDB/IDBTransaction.h | 2 +- dom/ipc/TabChild.h | 2 +- dom/mathml/nsMathMLElement.cpp | 4 +- dom/mathml/nsMathMLElement.h | 2 +- dom/media/AudioStreamTrack.cpp | 4 +- dom/media/AudioStreamTrack.h | 2 +- dom/media/AudioTrack.cpp | 4 +- dom/media/AudioTrack.h | 2 +- dom/media/AudioTrackList.cpp | 4 +- dom/media/AudioTrackList.h | 2 +- dom/media/DOMMediaStream.cpp | 8 +- dom/media/DOMMediaStream.h | 4 +- dom/media/GetUserMediaRequest.cpp | 4 +- dom/media/GetUserMediaRequest.h | 2 +- dom/media/MediaDevices.cpp | 4 +- dom/media/MediaDevices.h | 2 +- dom/media/MediaRecorder.cpp | 4 +- dom/media/MediaRecorder.h | 2 +- dom/media/MediaStreamError.cpp | 4 +- dom/media/MediaStreamError.h | 2 +- dom/media/MediaStreamTrack.h | 2 +- dom/media/TextTrack.cpp | 4 +- dom/media/TextTrack.h | 2 +- dom/media/TextTrackCue.cpp | 4 +- dom/media/TextTrackCue.h | 2 +- dom/media/TextTrackCueList.cpp | 4 +- dom/media/TextTrackCueList.h | 2 +- dom/media/TextTrackList.cpp | 4 +- dom/media/TextTrackList.h | 2 +- dom/media/TextTrackRegion.cpp | 4 +- dom/media/TextTrackRegion.h | 2 +- dom/media/VideoPlaybackQuality.cpp | 4 +- dom/media/VideoPlaybackQuality.h | 2 +- dom/media/VideoStreamTrack.cpp | 4 +- dom/media/VideoStreamTrack.h | 2 +- dom/media/VideoTrack.cpp | 4 +- dom/media/VideoTrack.h | 2 +- dom/media/VideoTrackList.cpp | 4 +- dom/media/VideoTrackList.h | 2 +- dom/media/imagecapture/ImageCapture.h | 4 +- dom/media/mediasource/MediaSource.cpp | 4 +- dom/media/mediasource/MediaSource.h | 2 +- dom/media/mediasource/SourceBuffer.cpp | 4 +- dom/media/mediasource/SourceBuffer.h | 2 +- dom/media/mediasource/SourceBufferList.cpp | 4 +- dom/media/mediasource/SourceBufferList.h | 2 +- dom/media/webaudio/AnalyserNode.cpp | 4 +- dom/media/webaudio/AnalyserNode.h | 2 +- dom/media/webaudio/AudioBuffer.cpp | 4 +- dom/media/webaudio/AudioBuffer.h | 2 +- dom/media/webaudio/AudioBufferSourceNode.cpp | 4 +- dom/media/webaudio/AudioBufferSourceNode.h | 2 +- dom/media/webaudio/AudioContext.cpp | 6 +- dom/media/webaudio/AudioContext.h | 2 +- dom/media/webaudio/AudioDestinationNode.cpp | 4 +- dom/media/webaudio/AudioDestinationNode.h | 2 +- dom/media/webaudio/AudioListener.cpp | 4 +- dom/media/webaudio/AudioListener.h | 2 +- dom/media/webaudio/AudioParam.cpp | 4 +- dom/media/webaudio/AudioParam.h | 2 +- dom/media/webaudio/AudioProcessingEvent.cpp | 4 +- dom/media/webaudio/AudioProcessingEvent.h | 2 +- dom/media/webaudio/BiquadFilterNode.cpp | 4 +- dom/media/webaudio/BiquadFilterNode.h | 2 +- dom/media/webaudio/ChannelMergerNode.cpp | 4 +- dom/media/webaudio/ChannelMergerNode.h | 2 +- dom/media/webaudio/ChannelSplitterNode.cpp | 4 +- dom/media/webaudio/ChannelSplitterNode.h | 2 +- dom/media/webaudio/ConvolverNode.cpp | 4 +- dom/media/webaudio/ConvolverNode.h | 2 +- dom/media/webaudio/DelayNode.cpp | 4 +- dom/media/webaudio/DelayNode.h | 2 +- dom/media/webaudio/DynamicsCompressorNode.cpp | 4 +- dom/media/webaudio/DynamicsCompressorNode.h | 2 +- dom/media/webaudio/GainNode.cpp | 4 +- dom/media/webaudio/GainNode.h | 2 +- .../webaudio/MediaElementAudioSourceNode.cpp | 4 +- .../webaudio/MediaElementAudioSourceNode.h | 2 +- .../MediaStreamAudioDestinationNode.cpp | 4 +- .../MediaStreamAudioDestinationNode.h | 2 +- .../webaudio/MediaStreamAudioSourceNode.cpp | 4 +- .../webaudio/MediaStreamAudioSourceNode.h | 2 +- .../webaudio/OfflineAudioCompletionEvent.cpp | 4 +- .../webaudio/OfflineAudioCompletionEvent.h | 2 +- dom/media/webaudio/OscillatorNode.cpp | 4 +- dom/media/webaudio/OscillatorNode.h | 2 +- dom/media/webaudio/PannerNode.cpp | 4 +- dom/media/webaudio/PannerNode.h | 2 +- dom/media/webaudio/PeriodicWave.cpp | 4 +- dom/media/webaudio/PeriodicWave.h | 2 +- dom/media/webaudio/ScriptProcessorNode.cpp | 4 +- dom/media/webaudio/ScriptProcessorNode.h | 2 +- dom/media/webaudio/StereoPannerNode.cpp | 4 +- dom/media/webaudio/StereoPannerNode.h | 2 +- dom/media/webaudio/WaveShaperNode.cpp | 4 +- dom/media/webaudio/WaveShaperNode.h | 2 +- .../webrtc/RTCIdentityProviderRegistrar.cpp | 4 +- .../webrtc/RTCIdentityProviderRegistrar.h | 2 +- .../webspeech/recognition/SpeechGrammar.cpp | 4 +- .../webspeech/recognition/SpeechGrammar.h | 2 +- .../recognition/SpeechGrammarList.cpp | 4 +- .../webspeech/recognition/SpeechGrammarList.h | 2 +- .../recognition/SpeechRecognition.cpp | 4 +- .../webspeech/recognition/SpeechRecognition.h | 2 +- .../SpeechRecognitionAlternative.cpp | 4 +- .../SpeechRecognitionAlternative.h | 2 +- .../recognition/SpeechRecognitionResult.cpp | 4 +- .../recognition/SpeechRecognitionResult.h | 2 +- .../SpeechRecognitionResultList.cpp | 4 +- .../recognition/SpeechRecognitionResultList.h | 2 +- dom/media/webspeech/synth/SpeechSynthesis.cpp | 4 +- dom/media/webspeech/synth/SpeechSynthesis.h | 2 +- .../synth/SpeechSynthesisUtterance.cpp | 4 +- .../synth/SpeechSynthesisUtterance.h | 2 +- .../webspeech/synth/SpeechSynthesisVoice.cpp | 4 +- .../webspeech/synth/SpeechSynthesisVoice.h | 2 +- dom/mobileconnection/MobileCellInfo.cpp | 4 +- dom/mobileconnection/MobileCellInfo.h | 2 +- dom/mobileconnection/MobileConnection.cpp | 4 +- dom/mobileconnection/MobileConnection.h | 2 +- .../MobileConnectionArray.cpp | 4 +- dom/mobileconnection/MobileConnectionArray.h | 2 +- dom/mobileconnection/MobileConnectionInfo.cpp | 4 +- dom/mobileconnection/MobileConnectionInfo.h | 2 +- dom/mobileconnection/MobileNetworkInfo.cpp | 4 +- dom/mobileconnection/MobileNetworkInfo.h | 2 +- dom/mobilemessage/DOMMobileMessageError.cpp | 4 +- dom/mobilemessage/DOMMobileMessageError.h | 2 +- dom/mobilemessage/MobileMessageManager.cpp | 4 +- dom/mobilemessage/MobileMessageManager.h | 2 +- dom/network/Connection.cpp | 4 +- dom/network/Connection.h | 2 +- dom/network/UDPSocket.cpp | 4 +- dom/network/UDPSocket.h | 2 +- dom/nfc/MozIsoDepTech.cpp | 4 +- dom/nfc/MozIsoDepTech.h | 2 +- dom/nfc/MozNDEFRecord.cpp | 311 +++++++++++++++--- dom/nfc/MozNDEFRecord.h | 50 ++- dom/notification/DesktopNotification.cpp | 8 +- dom/notification/DesktopNotification.h | 4 +- dom/notification/Notification.cpp | 6 +- dom/notification/Notification.h | 2 +- dom/offline/nsDOMOfflineResourceList.cpp | 4 +- dom/offline/nsDOMOfflineResourceList.h | 2 +- dom/power/PowerManager.cpp | 4 +- dom/power/PowerManager.h | 2 +- dom/power/WakeLock.cpp | 4 +- dom/power/WakeLock.h | 2 +- dom/promise/AbortablePromise.cpp | 4 +- dom/promise/AbortablePromise.h | 2 +- dom/promise/Promise.cpp | 4 +- dom/promise/Promise.h | 2 +- dom/security/nsCORSListenerProxy.cpp | 17 + dom/smil/TimeEvent.h | 4 +- dom/speakermanager/SpeakerManager.cpp | 4 +- dom/speakermanager/SpeakerManager.h | 2 +- dom/storage/DOMStorage.cpp | 4 +- dom/storage/DOMStorage.h | 2 +- dom/svg/DOMSVGAnimatedLengthList.cpp | 4 +- dom/svg/DOMSVGAnimatedLengthList.h | 2 +- dom/svg/DOMSVGAnimatedNumberList.cpp | 4 +- dom/svg/DOMSVGAnimatedNumberList.h | 2 +- dom/svg/DOMSVGLength.cpp | 4 +- dom/svg/DOMSVGLength.h | 2 +- dom/svg/DOMSVGLengthList.cpp | 4 +- dom/svg/DOMSVGLengthList.h | 2 +- dom/svg/DOMSVGNumber.cpp | 4 +- dom/svg/DOMSVGNumber.h | 2 +- dom/svg/DOMSVGNumberList.cpp | 4 +- dom/svg/DOMSVGNumberList.h | 2 +- dom/svg/DOMSVGPathSeg.h | 6 +- dom/svg/DOMSVGPathSegList.cpp | 4 +- dom/svg/DOMSVGPathSegList.h | 2 +- dom/svg/DOMSVGPointList.cpp | 4 +- dom/svg/DOMSVGPointList.h | 2 +- dom/svg/DOMSVGStringList.cpp | 4 +- dom/svg/DOMSVGStringList.h | 2 +- dom/svg/DOMSVGTransformList.cpp | 4 +- dom/svg/DOMSVGTransformList.h | 2 +- dom/svg/SVGAElement.cpp | 4 +- dom/svg/SVGAElement.h | 2 +- dom/svg/SVGAltGlyphElement.cpp | 4 +- dom/svg/SVGAltGlyphElement.h | 2 +- dom/svg/SVGAngle.cpp | 4 +- dom/svg/SVGAngle.h | 2 +- dom/svg/SVGAnimateElement.cpp | 4 +- dom/svg/SVGAnimateElement.h | 2 +- dom/svg/SVGAnimateMotionElement.cpp | 4 +- dom/svg/SVGAnimateMotionElement.h | 2 +- dom/svg/SVGAnimateTransformElement.cpp | 4 +- dom/svg/SVGAnimateTransformElement.h | 2 +- dom/svg/SVGAnimatedAngle.cpp | 4 +- dom/svg/SVGAnimatedAngle.h | 2 +- dom/svg/SVGAnimatedBoolean.cpp | 4 +- dom/svg/SVGAnimatedBoolean.h | 2 +- dom/svg/SVGAnimatedEnumeration.cpp | 4 +- dom/svg/SVGAnimatedEnumeration.h | 2 +- dom/svg/SVGAnimatedInteger.cpp | 4 +- dom/svg/SVGAnimatedInteger.h | 2 +- dom/svg/SVGAnimatedLength.cpp | 4 +- dom/svg/SVGAnimatedLength.h | 2 +- dom/svg/SVGAnimatedNumber.cpp | 4 +- dom/svg/SVGAnimatedNumber.h | 2 +- dom/svg/SVGAnimatedPreserveAspectRatio.cpp | 4 +- dom/svg/SVGAnimatedPreserveAspectRatio.h | 2 +- dom/svg/SVGAnimatedRect.cpp | 4 +- dom/svg/SVGAnimatedRect.h | 2 +- dom/svg/SVGAnimatedString.cpp | 4 +- dom/svg/SVGAnimatedString.h | 2 +- dom/svg/SVGAnimatedTransformList.cpp | 4 +- dom/svg/SVGAnimatedTransformList.h | 2 +- dom/svg/SVGCircleElement.cpp | 4 +- dom/svg/SVGCircleElement.h | 2 +- dom/svg/SVGClipPathElement.cpp | 4 +- dom/svg/SVGClipPathElement.h | 2 +- dom/svg/SVGComponentTransferFunctionElement.h | 10 +- dom/svg/SVGDefsElement.cpp | 4 +- dom/svg/SVGDefsElement.h | 2 +- dom/svg/SVGDescElement.cpp | 4 +- dom/svg/SVGDescElement.h | 2 +- dom/svg/SVGDocument.cpp | 4 +- dom/svg/SVGDocument.h | 2 +- dom/svg/SVGEllipseElement.cpp | 4 +- dom/svg/SVGEllipseElement.h | 2 +- dom/svg/SVGFEBlendElement.cpp | 4 +- dom/svg/SVGFEBlendElement.h | 2 +- dom/svg/SVGFEColorMatrixElement.cpp | 4 +- dom/svg/SVGFEColorMatrixElement.h | 2 +- dom/svg/SVGFEComponentTransferElement.cpp | 4 +- dom/svg/SVGFEComponentTransferElement.h | 2 +- dom/svg/SVGFECompositeElement.cpp | 4 +- dom/svg/SVGFECompositeElement.h | 2 +- dom/svg/SVGFEConvolveMatrixElement.cpp | 4 +- dom/svg/SVGFEConvolveMatrixElement.h | 2 +- dom/svg/SVGFEDiffuseLightingElement.cpp | 4 +- dom/svg/SVGFEDiffuseLightingElement.h | 2 +- dom/svg/SVGFEDisplacementMapElement.cpp | 4 +- dom/svg/SVGFEDisplacementMapElement.h | 2 +- dom/svg/SVGFEDistantLightElement.cpp | 4 +- dom/svg/SVGFEDistantLightElement.h | 2 +- dom/svg/SVGFEDropShadowElement.cpp | 4 +- dom/svg/SVGFEDropShadowElement.h | 2 +- dom/svg/SVGFEFloodElement.cpp | 4 +- dom/svg/SVGFEFloodElement.h | 2 +- dom/svg/SVGFEGaussianBlurElement.cpp | 4 +- dom/svg/SVGFEGaussianBlurElement.h | 2 +- dom/svg/SVGFEImageElement.cpp | 4 +- dom/svg/SVGFEImageElement.h | 2 +- dom/svg/SVGFEMergeElement.cpp | 4 +- dom/svg/SVGFEMergeElement.h | 2 +- dom/svg/SVGFEMergeNodeElement.cpp | 4 +- dom/svg/SVGFEMergeNodeElement.h | 2 +- dom/svg/SVGFEMorphologyElement.cpp | 4 +- dom/svg/SVGFEMorphologyElement.h | 2 +- dom/svg/SVGFEOffsetElement.cpp | 4 +- dom/svg/SVGFEOffsetElement.h | 2 +- dom/svg/SVGFEPointLightElement.cpp | 4 +- dom/svg/SVGFEPointLightElement.h | 2 +- dom/svg/SVGFESpecularLightingElement.cpp | 4 +- dom/svg/SVGFESpecularLightingElement.h | 2 +- dom/svg/SVGFESpotLightElement.cpp | 4 +- dom/svg/SVGFESpotLightElement.h | 2 +- dom/svg/SVGFETileElement.cpp | 4 +- dom/svg/SVGFETileElement.h | 2 +- dom/svg/SVGFETurbulenceElement.cpp | 4 +- dom/svg/SVGFETurbulenceElement.h | 2 +- dom/svg/SVGFilterElement.cpp | 4 +- dom/svg/SVGFilterElement.h | 2 +- dom/svg/SVGForeignObjectElement.cpp | 4 +- dom/svg/SVGForeignObjectElement.h | 2 +- dom/svg/SVGGElement.cpp | 4 +- dom/svg/SVGGElement.h | 2 +- dom/svg/SVGGradientElement.cpp | 8 +- dom/svg/SVGGradientElement.h | 6 +- dom/svg/SVGIRect.h | 4 +- dom/svg/SVGImageElement.cpp | 4 +- dom/svg/SVGImageElement.h | 2 +- dom/svg/SVGLineElement.cpp | 4 +- dom/svg/SVGLineElement.h | 2 +- dom/svg/SVGMPathElement.cpp | 4 +- dom/svg/SVGMPathElement.h | 2 +- dom/svg/SVGMarkerElement.cpp | 4 +- dom/svg/SVGMarkerElement.h | 2 +- dom/svg/SVGMaskElement.cpp | 4 +- dom/svg/SVGMaskElement.h | 2 +- dom/svg/SVGMatrix.cpp | 4 +- dom/svg/SVGMatrix.h | 2 +- dom/svg/SVGMetadataElement.cpp | 4 +- dom/svg/SVGMetadataElement.h | 2 +- dom/svg/SVGPathElement.cpp | 4 +- dom/svg/SVGPathElement.h | 2 +- dom/svg/SVGPatternElement.cpp | 4 +- dom/svg/SVGPatternElement.h | 2 +- dom/svg/SVGPolygonElement.cpp | 4 +- dom/svg/SVGPolygonElement.h | 2 +- dom/svg/SVGPolylineElement.cpp | 4 +- dom/svg/SVGPolylineElement.h | 2 +- dom/svg/SVGPreserveAspectRatio.cpp | 4 +- dom/svg/SVGPreserveAspectRatio.h | 2 +- dom/svg/SVGRectElement.cpp | 4 +- dom/svg/SVGRectElement.h | 2 +- dom/svg/SVGSVGElement.cpp | 4 +- dom/svg/SVGSVGElement.h | 2 +- dom/svg/SVGScriptElement.cpp | 4 +- dom/svg/SVGScriptElement.h | 2 +- dom/svg/SVGSetElement.cpp | 4 +- dom/svg/SVGSetElement.h | 2 +- dom/svg/SVGStopElement.cpp | 4 +- dom/svg/SVGStopElement.h | 2 +- dom/svg/SVGStyleElement.cpp | 4 +- dom/svg/SVGStyleElement.h | 2 +- dom/svg/SVGSwitchElement.cpp | 4 +- dom/svg/SVGSwitchElement.h | 2 +- dom/svg/SVGSymbolElement.cpp | 4 +- dom/svg/SVGSymbolElement.h | 2 +- dom/svg/SVGTSpanElement.cpp | 4 +- dom/svg/SVGTSpanElement.h | 2 +- dom/svg/SVGTextElement.cpp | 4 +- dom/svg/SVGTextElement.h | 2 +- dom/svg/SVGTextPathElement.cpp | 4 +- dom/svg/SVGTextPathElement.h | 2 +- dom/svg/SVGTitleElement.cpp | 4 +- dom/svg/SVGTitleElement.h | 2 +- dom/svg/SVGTransform.cpp | 4 +- dom/svg/SVGTransform.h | 2 +- dom/svg/SVGUseElement.cpp | 4 +- dom/svg/SVGUseElement.h | 2 +- dom/svg/SVGViewElement.cpp | 4 +- dom/svg/SVGViewElement.h | 2 +- dom/svg/SVGZoomEvent.h | 4 +- dom/svg/nsISVGPoint.h | 4 +- dom/svg/nsSVGElement.cpp | 4 +- dom/svg/nsSVGElement.h | 2 +- dom/svg/nsSVGFilters.cpp | 16 +- dom/system/gonk/AudioChannelManager.cpp | 4 +- dom/system/gonk/AudioChannelManager.h | 2 +- dom/telephony/CallsList.cpp | 4 +- dom/telephony/CallsList.h | 2 +- dom/telephony/MMICall.cpp | 4 +- dom/telephony/MMICall.h | 2 +- dom/telephony/Telephony.cpp | 4 +- dom/telephony/Telephony.h | 2 +- dom/telephony/TelephonyCall.cpp | 4 +- dom/telephony/TelephonyCall.h | 2 +- dom/telephony/TelephonyCallGroup.cpp | 4 +- dom/telephony/TelephonyCallGroup.h | 2 +- dom/telephony/TelephonyCallId.cpp | 4 +- dom/telephony/TelephonyCallId.h | 2 +- dom/telephony/USSDSession.cpp | 4 +- dom/telephony/USSDSession.h | 2 +- dom/time/TimeManager.cpp | 4 +- dom/time/TimeManager.h | 2 +- dom/tv/TVChannel.cpp | 4 +- dom/tv/TVChannel.h | 2 +- dom/tv/TVManager.cpp | 4 +- dom/tv/TVManager.h | 2 +- dom/tv/TVProgram.cpp | 4 +- dom/tv/TVProgram.h | 2 +- dom/tv/TVSource.cpp | 4 +- dom/tv/TVSource.h | 2 +- dom/tv/TVTuner.cpp | 4 +- dom/tv/TVTuner.h | 2 +- dom/voicemail/Voicemail.cpp | 4 +- dom/voicemail/Voicemail.h | 2 +- dom/voicemail/VoicemailStatus.cpp | 4 +- dom/voicemail/VoicemailStatus.h | 2 +- dom/vr/VRDevice.cpp | 15 +- dom/vr/VRDevice.h | 8 +- dom/webidl/MozNDEFRecord.webidl | 68 +++- dom/webidl/Response.webidl | 2 - dom/workers/DataStore.cpp | 4 +- dom/workers/DataStore.h | 2 +- dom/workers/DataStoreCursor.cpp | 3 +- dom/workers/DataStoreCursor.h | 2 +- dom/workers/FileReaderSync.cpp | 3 +- dom/workers/FileReaderSync.h | 2 +- dom/workers/Location.cpp | 4 +- dom/workers/Location.h | 2 +- dom/workers/MessagePort.cpp | 4 +- dom/workers/MessagePort.h | 2 +- dom/workers/Navigator.cpp | 6 +- dom/workers/Navigator.h | 2 +- dom/workers/Performance.cpp | 4 +- dom/workers/Performance.h | 2 +- dom/workers/ServiceWorker.cpp | 4 +- dom/workers/ServiceWorker.h | 2 +- dom/workers/ServiceWorkerClient.cpp | 4 +- dom/workers/ServiceWorkerClient.h | 2 +- dom/workers/ServiceWorkerClients.cpp | 4 +- dom/workers/ServiceWorkerClients.h | 2 +- dom/workers/ServiceWorkerContainer.cpp | 4 +- dom/workers/ServiceWorkerContainer.h | 2 +- dom/workers/ServiceWorkerEvents.cpp | 17 +- dom/workers/ServiceWorkerEvents.h | 12 +- dom/workers/ServiceWorkerManager.cpp | 57 +++- dom/workers/ServiceWorkerRegistration.cpp | 4 +- dom/workers/ServiceWorkerRegistration.h | 2 +- dom/workers/ServiceWorkerWindowClient.cpp | 4 +- dom/workers/ServiceWorkerWindowClient.h | 2 +- dom/workers/SharedWorker.cpp | 4 +- dom/workers/SharedWorker.h | 2 +- dom/workers/URL.cpp | 4 +- dom/workers/URL.h | 2 +- dom/workers/WorkerPrivate.cpp | 8 +- dom/workers/WorkerPrivate.h | 2 +- dom/workers/WorkerScope.cpp | 2 +- dom/workers/WorkerScope.h | 4 +- dom/workers/XMLHttpRequest.cpp | 4 +- dom/workers/XMLHttpRequest.h | 2 +- dom/workers/XMLHttpRequestUpload.cpp | 4 +- dom/workers/XMLHttpRequestUpload.h | 2 +- .../test/serviceworkers/fetch/fetch_tests.js | 92 +++++- .../test/serviceworkers/fetch/index.html | 4 +- .../test/serviceworkers/fetch_event_worker.js | 29 ++ dom/xbl/XBLChildrenElement.cpp | 4 +- dom/xbl/XBLChildrenElement.h | 2 +- dom/xml/CDATASection.cpp | 4 +- dom/xml/CDATASection.h | 2 +- dom/xml/ProcessingInstruction.cpp | 4 +- dom/xml/ProcessingInstruction.h | 2 +- dom/xml/XMLDocument.cpp | 6 +- dom/xml/XMLDocument.h | 2 +- .../XMLStylesheetProcessingInstruction.cpp | 4 +- dom/xml/XMLStylesheetProcessingInstruction.h | 2 +- dom/xml/nsXMLElement.cpp | 4 +- dom/xml/nsXMLElement.h | 2 +- dom/xslt/xpath/XPathEvaluator.cpp | 3 +- dom/xslt/xpath/XPathEvaluator.h | 2 +- dom/xslt/xpath/XPathExpression.h | 4 +- dom/xslt/xpath/XPathResult.cpp | 4 +- dom/xslt/xpath/XPathResult.h | 2 +- dom/xslt/xslt/txMozillaXSLTProcessor.cpp | 4 +- dom/xslt/xslt/txMozillaXSLTProcessor.h | 2 +- dom/xul/XULDocument.cpp | 4 +- dom/xul/XULDocument.h | 2 +- dom/xul/nsXULElement.cpp | 4 +- dom/xul/nsXULElement.h | 2 +- gfx/layers/apz/src/AsyncPanZoomController.cpp | 20 +- gfx/layers/apz/src/Axis.cpp | 14 +- gfx/layers/apz/src/Axis.h | 10 + js/src/jscntxtinlines.h | 20 -- js/src/proxy/BaseProxyHandler.cpp | 2 +- js/src/proxy/ScriptedIndirectProxyHandler.cpp | 21 ++ js/xpconnect/public/SandboxPrivate.h | 2 +- js/xpconnect/src/ExportHelpers.cpp | 36 +- js/xpconnect/src/Sandbox.cpp | 4 +- js/xpconnect/src/XPCConvert.cpp | 2 +- js/xpconnect/src/XPCWrappedNativeJSOps.cpp | 24 +- .../tests/unit/test_xpcwn_tamperproof.js | 175 ++++++++++ js/xpconnect/tests/unit/xpcshell.ini | 1 + layout/generic/Selection.h | 2 +- layout/generic/nsSelection.cpp | 4 +- layout/style/CSSRuleList.cpp | 4 +- layout/style/CSSRuleList.h | 2 +- layout/style/CSSStyleSheet.cpp | 8 +- layout/style/CSSStyleSheet.h | 2 +- layout/style/FontFace.cpp | 4 +- layout/style/FontFace.h | 2 +- layout/style/FontFaceSet.cpp | 4 +- layout/style/FontFaceSet.h | 2 +- layout/style/MediaQueryList.cpp | 4 +- layout/style/MediaQueryList.h | 2 +- layout/style/nsCSSRules.cpp | 4 +- layout/style/nsCSSRules.h | 2 +- layout/style/nsDOMCSSDeclaration.cpp | 4 +- layout/style/nsDOMCSSDeclaration.h | 2 +- layout/style/nsDOMCSSRGBColor.cpp | 4 +- layout/style/nsDOMCSSRGBColor.h | 2 +- layout/style/nsDOMCSSRect.cpp | 4 +- layout/style/nsDOMCSSRect.h | 2 +- layout/style/nsDOMCSSValueList.cpp | 4 +- layout/style/nsDOMCSSValueList.h | 2 +- layout/style/nsIMediaList.h | 2 +- layout/style/nsROCSSPrimitiveValue.cpp | 4 +- layout/style/nsROCSSPrimitiveValue.h | 2 +- layout/xul/BoxObject.cpp | 4 +- layout/xul/BoxObject.h | 2 +- layout/xul/ContainerBoxObject.cpp | 4 +- layout/xul/ContainerBoxObject.h | 2 +- layout/xul/ListBoxObject.cpp | 4 +- layout/xul/ListBoxObject.h | 2 +- layout/xul/MenuBoxObject.cpp | 4 +- layout/xul/MenuBoxObject.h | 2 +- layout/xul/PopupBoxObject.cpp | 4 +- layout/xul/PopupBoxObject.h | 2 +- layout/xul/ScrollBoxObject.cpp | 4 +- layout/xul/ScrollBoxObject.h | 2 +- layout/xul/tree/TreeBoxObject.cpp | 4 +- layout/xul/tree/TreeBoxObject.h | 2 +- layout/xul/tree/nsTreeColumns.cpp | 8 +- layout/xul/tree/nsTreeColumns.h | 4 +- .../src/peerconnection/MediaStreamList.cpp | 4 +- .../src/peerconnection/MediaStreamList.h | 2 +- .../src/peerconnection/PeerConnectionImpl.cpp | 3 +- .../src/peerconnection/PeerConnectionImpl.h | 2 +- netwerk/protocol/http/HttpBaseChannel.cpp | 30 ++ netwerk/protocol/http/HttpBaseChannel.h | 7 + .../protocol/http/nsIHttpChannelInternal.idl | 18 +- .../components/places/tests/cpp/mock_Link.h | 2 +- 988 files changed, 2628 insertions(+), 1843 deletions(-) create mode 100644 js/xpconnect/tests/unit/test_xpcwn_tamperproof.js diff --git a/dom/activities/Activity.cpp b/dom/activities/Activity.cpp index 12f246f10c..c5254317a2 100644 --- a/dom/activities/Activity.cpp +++ b/dom/activities/Activity.cpp @@ -25,9 +25,9 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(Activity, DOMRequest) NS_IMPL_CYCLE_COLLECTION_TRACE_END /* virtual */ JSObject* -Activity::WrapObject(JSContext* aCx) +Activity::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MozActivityBinding::Wrap(aCx, this); + return MozActivityBinding::Wrap(aCx, this, aGivenProto); } nsresult diff --git a/dom/activities/Activity.h b/dom/activities/Activity.h index f7c9905735..48081e0946 100644 --- a/dom/activities/Activity.h +++ b/dom/activities/Activity.h @@ -21,7 +21,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(Activity, DOMRequest) - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(const GlobalObject& aOwner, diff --git a/dom/animation/Animation.cpp b/dom/animation/Animation.cpp index 483feff47c..5916f838ef 100644 --- a/dom/animation/Animation.cpp +++ b/dom/animation/Animation.cpp @@ -66,9 +66,9 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(Animation, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(Animation, Release) JSObject* -Animation::WrapObject(JSContext* aCx) +Animation::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return AnimationBinding::Wrap(aCx, this); + return AnimationBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed diff --git a/dom/animation/Animation.h b/dom/animation/Animation.h index 8085a4e8a3..7b1273d98f 100644 --- a/dom/animation/Animation.h +++ b/dom/animation/Animation.h @@ -152,7 +152,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(Animation) nsIDocument* GetParentObject() const { return mDocument; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // FIXME: If we succeed in moving transition-specific code to a type of // AnimationEffect (as per the Web Animations API) we should remove these diff --git a/dom/animation/AnimationEffect.cpp b/dom/animation/AnimationEffect.cpp index a72e6ded97..0aed86fbab 100644 --- a/dom/animation/AnimationEffect.cpp +++ b/dom/animation/AnimationEffect.cpp @@ -15,9 +15,9 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AnimationEffect, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AnimationEffect, Release) JSObject* -AnimationEffect::WrapObject(JSContext* aCx) +AnimationEffect::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return AnimationEffectBinding::Wrap(aCx, this); + return AnimationEffectBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/animation/AnimationEffect.h b/dom/animation/AnimationEffect.h index cb4409616a..3c07e746b4 100644 --- a/dom/animation/AnimationEffect.h +++ b/dom/animation/AnimationEffect.h @@ -27,7 +27,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AnimationEffect) Animation* GetParentObject() const { return mAnimation; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // AnimationEffect interface void GetName(nsString& aRetVal) const { diff --git a/dom/animation/AnimationPlayer.cpp b/dom/animation/AnimationPlayer.cpp index 0c8a7dff1e..f132703f7b 100644 --- a/dom/animation/AnimationPlayer.cpp +++ b/dom/animation/AnimationPlayer.cpp @@ -26,9 +26,9 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AnimationPlayer) NS_INTERFACE_MAP_END JSObject* -AnimationPlayer::WrapObject(JSContext* aCx) +AnimationPlayer::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return dom::AnimationPlayerBinding::Wrap(aCx, this); + return dom::AnimationPlayerBinding::Wrap(aCx, this, aGivenProto); } Nullable diff --git a/dom/animation/AnimationPlayer.h b/dom/animation/AnimationPlayer.h index 72acd2b0a2..99dfa5d2be 100644 --- a/dom/animation/AnimationPlayer.h +++ b/dom/animation/AnimationPlayer.h @@ -63,7 +63,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationPlayer) AnimationTimeline* GetParentObject() const { return mTimeline; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; virtual CSSAnimationPlayer* AsCSSAnimationPlayer() { return nullptr; } virtual CSSTransitionPlayer* AsCSSTransitionPlayer() { return nullptr; } diff --git a/dom/animation/AnimationTimeline.cpp b/dom/animation/AnimationTimeline.cpp index 20facc2081..d83ae7389b 100644 --- a/dom/animation/AnimationTimeline.cpp +++ b/dom/animation/AnimationTimeline.cpp @@ -21,9 +21,9 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AnimationTimeline, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AnimationTimeline, Release) JSObject* -AnimationTimeline::WrapObject(JSContext* aCx) +AnimationTimeline::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return AnimationTimelineBinding::Wrap(aCx, this); + return AnimationTimelineBinding::Wrap(aCx, this, aGivenProto); } Nullable diff --git a/dom/animation/AnimationTimeline.h b/dom/animation/AnimationTimeline.h index 213972434e..6a1f320ab0 100644 --- a/dom/animation/AnimationTimeline.h +++ b/dom/animation/AnimationTimeline.h @@ -41,7 +41,7 @@ public: { return mWindow; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // AnimationTimeline methods Nullable GetCurrentTime() const; diff --git a/dom/archivereader/ArchiveReader.cpp b/dom/archivereader/ArchiveReader.cpp index c0439c644f..be02239561 100644 --- a/dom/archivereader/ArchiveReader.cpp +++ b/dom/archivereader/ArchiveReader.cpp @@ -61,9 +61,9 @@ ArchiveReader::~ArchiveReader() } /* virtual */ JSObject* -ArchiveReader::WrapObject(JSContext* aCx) +ArchiveReader::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return ArchiveReaderBinding::Wrap(aCx, this); + return ArchiveReaderBinding::Wrap(aCx, this, aGivenProto); } nsresult diff --git a/dom/archivereader/ArchiveReader.h b/dom/archivereader/ArchiveReader.h index cf352d0f9b..b84cc3c03f 100644 --- a/dom/archivereader/ArchiveReader.h +++ b/dom/archivereader/ArchiveReader.h @@ -51,7 +51,7 @@ public: return mWindow; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; already_AddRefed GetFilenames(); already_AddRefed GetFile(const nsAString& filename); diff --git a/dom/archivereader/ArchiveRequest.cpp b/dom/archivereader/ArchiveRequest.cpp index 9a8453dd81..94fdb37749 100644 --- a/dom/archivereader/ArchiveRequest.cpp +++ b/dom/archivereader/ArchiveRequest.cpp @@ -77,9 +77,9 @@ ArchiveRequest::PreHandleEvent(EventChainPreVisitor& aVisitor) } /* virtual */ JSObject* -ArchiveRequest::WrapObject(JSContext* aCx) +ArchiveRequest::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return ArchiveRequestBinding::Wrap(aCx, this); + return ArchiveRequestBinding::Wrap(aCx, this, aGivenProto); } ArchiveReader* diff --git a/dom/archivereader/ArchiveRequest.h b/dom/archivereader/ArchiveRequest.h index 1ce5d7a5d8..37129f4063 100644 --- a/dom/archivereader/ArchiveRequest.h +++ b/dom/archivereader/ArchiveRequest.h @@ -26,7 +26,7 @@ BEGIN_ARCHIVEREADER_NAMESPACE class ArchiveRequest : public mozilla::dom::DOMRequest { public: - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; ArchiveReader* Reader() const; diff --git a/dom/base/AnonymousContent.cpp b/dom/base/AnonymousContent.cpp index cee56aa879..69878bd055 100644 --- a/dom/base/AnonymousContent.cpp +++ b/dom/base/AnonymousContent.cpp @@ -131,9 +131,10 @@ AnonymousContent::GetElementById(const nsAString& aElementId) bool AnonymousContent::WrapObject(JSContext* aCx, + JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return AnonymousContentBinding::Wrap(aCx, this, aReflector); + return AnonymousContentBinding::Wrap(aCx, this, aGivenProto, aReflector); } } // dom namespace diff --git a/dom/base/AnonymousContent.h b/dom/base/AnonymousContent.h index c2ea1fa2d4..d568bb30b7 100644 --- a/dom/base/AnonymousContent.h +++ b/dom/base/AnonymousContent.h @@ -27,7 +27,7 @@ public: explicit AnonymousContent(Element* aContentNode); nsCOMPtr GetContentNode(); void SetContentNode(Element* aContentNode); - bool WrapObject(JSContext* aCx, JS::MutableHandle aReflector); + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); // WebIDL methods void SetTextContentForElement(const nsAString& aElementId, diff --git a/dom/base/Attr.cpp b/dom/base/Attr.cpp index b67b8de77a..c1bc066f83 100644 --- a/dom/base/Attr.cpp +++ b/dom/base/Attr.cpp @@ -384,9 +384,9 @@ Attr::Shutdown() } JSObject* -Attr::WrapNode(JSContext* aCx) +Attr::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return AttrBinding::Wrap(aCx, this); + return AttrBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/Attr.h b/dom/base/Attr.h index 38855dbf49..3716c4ba66 100644 --- a/dom/base/Attr.h +++ b/dom/base/Attr.h @@ -82,7 +82,7 @@ public: virtual nsIDOMNode* AsDOMNode() override { return this; } // WebIDL - virtual JSObject* WrapNode(JSContext* aCx) override; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) override; // XPCOM GetName() is OK // XPCOM GetValue() is OK diff --git a/dom/base/BarProps.cpp b/dom/base/BarProps.cpp index 3816946ff4..5517612334 100644 --- a/dom/base/BarProps.cpp +++ b/dom/base/BarProps.cpp @@ -34,9 +34,9 @@ BarProp::GetParentObject() const } JSObject* -BarProp::WrapObject(JSContext* aCx) +BarProp::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return BarPropBinding::Wrap(aCx, this); + return BarPropBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(BarProp, mDOMWindow) diff --git a/dom/base/BarProps.h b/dom/base/BarProps.h index b1f357f20c..5af8002096 100644 --- a/dom/base/BarProps.h +++ b/dom/base/BarProps.h @@ -40,7 +40,7 @@ public: nsPIDOMWindow* GetParentObject() const; virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; virtual bool GetVisible(ErrorResult& aRv) = 0; virtual void SetVisible(bool aVisible, ErrorResult& aRv) = 0; diff --git a/dom/base/Comment.cpp b/dom/base/Comment.cpp index 11a0a304a1..d89ff69e32 100644 --- a/dom/base/Comment.cpp +++ b/dom/base/Comment.cpp @@ -74,9 +74,9 @@ Comment::Constructor(const GlobalObject& aGlobal, } JSObject* -Comment::WrapNode(JSContext *aCx) +Comment::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return CommentBinding::Wrap(aCx, this); + return CommentBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/Comment.h b/dom/base/Comment.h index fd0b1ed685..572169704c 100644 --- a/dom/base/Comment.h +++ b/dom/base/Comment.h @@ -72,7 +72,7 @@ public: ErrorResult& aRv); protected: - virtual JSObject* WrapNode(JSContext *aCx) override; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) override; }; } // namespace dom diff --git a/dom/base/Console.cpp b/dom/base/Console.cpp index 1f17de29c9..89502d9301 100644 --- a/dom/base/Console.cpp +++ b/dom/base/Console.cpp @@ -722,9 +722,9 @@ Console::Observe(nsISupports* aSubject, const char* aTopic, } JSObject* -Console::WrapObject(JSContext* aCx) +Console::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return ConsoleBinding::Wrap(aCx, this); + return ConsoleBinding::Wrap(aCx, this, aGivenProto); } #define METHOD(name, string) \ diff --git a/dom/base/Console.h b/dom/base/Console.h index 32d3708052..67ca8ff359 100644 --- a/dom/base/Console.h +++ b/dom/base/Console.h @@ -44,7 +44,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void Log(JSContext* aCx, const Sequence& aData); diff --git a/dom/base/Crypto.cpp b/dom/base/Crypto.cpp index e66c231075..418e97c4c2 100644 --- a/dom/base/Crypto.cpp +++ b/dom/base/Crypto.cpp @@ -46,9 +46,9 @@ Crypto::Init(nsIGlobalObject* aParent) } /* virtual */ JSObject* -Crypto::WrapObject(JSContext* aCx) +Crypto::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CryptoBinding::Wrap(aCx, this); + return CryptoBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/base/Crypto.h b/dom/base/Crypto.h index 6135ca6c69..924e985f1d 100644 --- a/dom/base/Crypto.h +++ b/dom/base/Crypto.h @@ -50,7 +50,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static uint8_t* GetRandomValues(uint32_t aLength); diff --git a/dom/base/DOMCursor.cpp b/dom/base/DOMCursor.cpp index e8b97f29d9..cbe1b26824 100644 --- a/dom/base/DOMCursor.cpp +++ b/dom/base/DOMCursor.cpp @@ -76,9 +76,9 @@ DOMCursor::Continue(ErrorResult& aRv) } /* virtual */ JSObject* -DOMCursor::WrapObject(JSContext* aCx) +DOMCursor::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMCursorBinding::Wrap(aCx, this); + return DOMCursorBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/DOMCursor.h b/dom/base/DOMCursor.h index 9c2c296523..1f1bd20579 100644 --- a/dom/base/DOMCursor.h +++ b/dom/base/DOMCursor.h @@ -27,7 +27,7 @@ public: DOMCursor(nsPIDOMWindow* aWindow, nsICursorContinueCallback *aCallback); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; bool Done() const { diff --git a/dom/base/DOMError.cpp b/dom/base/DOMError.cpp index 15a2079324..b0ba82509a 100644 --- a/dom/base/DOMError.cpp +++ b/dom/base/DOMError.cpp @@ -57,9 +57,9 @@ DOMError::~DOMError() } JSObject* -DOMError::WrapObject(JSContext* aCx) +DOMError::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMErrorBinding::Wrap(aCx, this); + return DOMErrorBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/base/DOMError.h b/dom/base/DOMError.h index db14d17474..8e3697a55a 100644 --- a/dom/base/DOMError.h +++ b/dom/base/DOMError.h @@ -59,7 +59,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(const GlobalObject& global, const nsAString& name, diff --git a/dom/base/DOMException.cpp b/dom/base/DOMException.cpp index a9caf8968f..e90ad22139 100644 --- a/dom/base/DOMException.cpp +++ b/dom/base/DOMException.cpp @@ -475,9 +475,9 @@ Exception::Initialize(const nsACString& aMessage, nsresult aResult, } JSObject* -Exception::WrapObject(JSContext* cx) +Exception::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return ExceptionBinding::Wrap(cx, this); + return ExceptionBinding::Wrap(cx, this, aGivenProto); } void @@ -665,9 +665,9 @@ DOMException::Constructor(GlobalObject& /* unused */, } JSObject* -DOMException::WrapObject(JSContext* aCx) +DOMException::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMExceptionBinding::Wrap(aCx, this); + return DOMExceptionBinding::Wrap(aCx, this, aGivenProto); } /* static */already_AddRefed diff --git a/dom/base/DOMException.h b/dom/base/DOMException.h index 97f2d272c6..e03dd03b03 100644 --- a/dom/base/DOMException.h +++ b/dom/base/DOMException.h @@ -63,7 +63,7 @@ public: void StowJSVal(JS::Value& aVp); // WebIDL API - virtual JSObject* WrapObject(JSContext* cx) + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() const { return nullptr; } @@ -133,7 +133,7 @@ public: NS_IMETHOD ToString(nsACString& aReturn) override; // nsWrapperCache overrides - virtual JSObject* WrapObject(JSContext* aCx) + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed diff --git a/dom/base/DOMImplementation.cpp b/dom/base/DOMImplementation.cpp index ad9a2c47e8..c637fc29db 100644 --- a/dom/base/DOMImplementation.cpp +++ b/dom/base/DOMImplementation.cpp @@ -29,9 +29,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMImplementation) NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMImplementation) JSObject* -DOMImplementation::WrapObject(JSContext* aCx) +DOMImplementation::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMImplementationBinding::Wrap(aCx, this); + return DOMImplementationBinding::Wrap(aCx, this, aGivenProto); } bool diff --git a/dom/base/DOMImplementation.h b/dom/base/DOMImplementation.h index 5de2c11508..4cbf44fa27 100644 --- a/dom/base/DOMImplementation.h +++ b/dom/base/DOMImplementation.h @@ -52,7 +52,7 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // nsIDOMDOMImplementation NS_DECL_NSIDOMDOMIMPLEMENTATION diff --git a/dom/base/DOMMatrix.cpp b/dom/base/DOMMatrix.cpp index a30d2ddd04..4d1b8faae7 100644 --- a/dom/base/DOMMatrix.cpp +++ b/dom/base/DOMMatrix.cpp @@ -658,9 +658,9 @@ DOMMatrix::SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv) } JSObject* -DOMMatrix::WrapObject(JSContext* aCx) +DOMMatrix::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMMatrixBinding::Wrap(aCx, this); + return DOMMatrixBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/DOMMatrix.h b/dom/base/DOMMatrix.h index 66797c6660..7802f17fb6 100644 --- a/dom/base/DOMMatrix.h +++ b/dom/base/DOMMatrix.h @@ -166,7 +166,7 @@ public: Constructor(const GlobalObject& aGlobal, const Sequence& aNumberSequence, ErrorResult& aRv); nsISupports* GetParentObject() const { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; #define Set2DMatrixMember(entry2D, entry3D) \ { \ diff --git a/dom/base/DOMParser.h b/dom/base/DOMParser.h index dab9decc8e..9ee16934c6 100644 --- a/dom/base/DOMParser.h +++ b/dom/base/DOMParser.h @@ -75,9 +75,9 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) override + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { - return mozilla::dom::DOMParserBinding::Wrap(aCx, this); + return mozilla::dom::DOMParserBinding::Wrap(aCx, this, aGivenProto); } private: diff --git a/dom/base/DOMPoint.cpp b/dom/base/DOMPoint.cpp index d2faf3634f..c7fc4896ff 100644 --- a/dom/base/DOMPoint.cpp +++ b/dom/base/DOMPoint.cpp @@ -37,7 +37,7 @@ DOMPoint::Constructor(const GlobalObject& aGlobal, double aX, double aY, } JSObject* -DOMPoint::WrapObject(JSContext* aCx) +DOMPoint::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMPointBinding::Wrap(aCx, this); + return DOMPointBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/DOMPoint.h b/dom/base/DOMPoint.h index 75a5e8dc57..d9213293b0 100644 --- a/dom/base/DOMPoint.h +++ b/dom/base/DOMPoint.h @@ -64,7 +64,7 @@ public: double aZ, double aW, ErrorResult& aRV); nsISupports* GetParentObject() const { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void SetX(double aX) { mX = aX; } void SetY(double aY) { mY = aY; } diff --git a/dom/base/DOMQuad.cpp b/dom/base/DOMQuad.cpp index a407bd7c35..de25b5d42d 100644 --- a/dom/base/DOMQuad.cpp +++ b/dom/base/DOMQuad.cpp @@ -38,9 +38,9 @@ DOMQuad::~DOMQuad() } JSObject* -DOMQuad::WrapObject(JSContext* aCx) +DOMQuad::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMQuadBinding::Wrap(aCx, this); + return DOMQuadBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed diff --git a/dom/base/DOMQuad.h b/dom/base/DOMQuad.h index 3c9e41d5ee..9fcb1412cb 100644 --- a/dom/base/DOMQuad.h +++ b/dom/base/DOMQuad.h @@ -35,7 +35,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMQuad) nsISupports* GetParentObject() const { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(const GlobalObject& aGlobal, diff --git a/dom/base/DOMRect.cpp b/dom/base/DOMRect.cpp index 92a2a12074..ec4b0f1437 100644 --- a/dom/base/DOMRect.cpp +++ b/dom/base/DOMRect.cpp @@ -21,10 +21,10 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMRectReadOnly) NS_INTERFACE_MAP_END JSObject* -DOMRectReadOnly::WrapObject(JSContext* aCx) +DOMRectReadOnly::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { MOZ_ASSERT(mParent); - return DOMRectReadOnlyBinding::Wrap(aCx, this); + return DOMRectReadOnlyBinding::Wrap(aCx, this, aGivenProto); } // ----------------------------------------------------------------------------- @@ -47,10 +47,10 @@ FORWARD_GETTER(Width) FORWARD_GETTER(Height) JSObject* -DOMRect::WrapObject(JSContext* aCx) +DOMRect::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { MOZ_ASSERT(mParent); - return DOMRectBinding::Wrap(aCx, this); + return DOMRectBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed @@ -99,9 +99,9 @@ DOMRectList::Item(uint32_t aIndex, nsIDOMClientRect** aReturn) } JSObject* -DOMRectList::WrapObject(JSContext *cx) +DOMRectList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return mozilla::dom::DOMRectListBinding::Wrap(cx, this); + return mozilla::dom::DOMRectListBinding::Wrap(cx, this, aGivenProto); } static double diff --git a/dom/base/DOMRect.h b/dom/base/DOMRect.h index 3f0736bf1f..fb7dfaeff1 100644 --- a/dom/base/DOMRect.h +++ b/dom/base/DOMRect.h @@ -43,7 +43,7 @@ public: MOZ_ASSERT(mParent); return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; virtual double X() const = 0; virtual double Y() const = 0; @@ -98,7 +98,7 @@ public: Constructor(const GlobalObject& aGlobal, double aX, double aY, double aWidth, double aHeight, ErrorResult& aRV); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void SetRect(float aX, float aY, float aWidth, float aHeight) { mX = aX; mY = aY; mWidth = aWidth; mHeight = aHeight; @@ -161,7 +161,7 @@ public: NS_DECL_NSIDOMCLIENTRECTLIST - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() { diff --git a/dom/base/DOMRequest.cpp b/dom/base/DOMRequest.cpp index fba7204b98..9883f47218 100644 --- a/dom/base/DOMRequest.cpp +++ b/dom/base/DOMRequest.cpp @@ -66,9 +66,9 @@ NS_IMPL_ADDREF_INHERITED(DOMRequest, DOMEventTargetHelper) NS_IMPL_RELEASE_INHERITED(DOMRequest, DOMEventTargetHelper) /* virtual */ JSObject* -DOMRequest::WrapObject(JSContext* aCx) +DOMRequest::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMRequestBinding::Wrap(aCx, this); + return DOMRequestBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_EVENT_HANDLER(DOMRequest, success) diff --git a/dom/base/DOMRequest.h b/dom/base/DOMRequest.h index 3208322f49..c631fcd508 100644 --- a/dom/base/DOMRequest.h +++ b/dom/base/DOMRequest.h @@ -47,7 +47,7 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // WebIDL Interface DOMRequestReadyState ReadyState() const diff --git a/dom/base/DOMStringList.cpp b/dom/base/DOMStringList.cpp index 3b79058a6f..98560ae934 100644 --- a/dom/base/DOMStringList.cpp +++ b/dom/base/DOMStringList.cpp @@ -24,9 +24,9 @@ DOMStringList::~DOMStringList() } JSObject* -DOMStringList::WrapObject(JSContext* aCx) +DOMStringList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMStringListBinding::Wrap(aCx, this); + return DOMStringListBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/DOMStringList.h b/dom/base/DOMStringList.h index b83580d2ba..f0d47dd4c6 100644 --- a/dom/base/DOMStringList.h +++ b/dom/base/DOMStringList.h @@ -24,7 +24,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMStringList) - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() { return nullptr; diff --git a/dom/base/DocumentFragment.cpp b/dom/base/DocumentFragment.cpp index 2a2945dd50..960a7223e9 100644 --- a/dom/base/DocumentFragment.cpp +++ b/dom/base/DocumentFragment.cpp @@ -24,9 +24,9 @@ namespace mozilla { namespace dom { JSObject* -DocumentFragment::WrapNode(JSContext *aCx) +DocumentFragment::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return DocumentFragmentBinding::Wrap(aCx, this); + return DocumentFragmentBinding::Wrap(aCx, this, aGivenProto); } bool diff --git a/dom/base/DocumentFragment.h b/dom/base/DocumentFragment.h index e949893f90..6c3f0018ad 100644 --- a/dom/base/DocumentFragment.h +++ b/dom/base/DocumentFragment.h @@ -65,7 +65,7 @@ public: Init(); } - virtual JSObject* WrapNode(JSContext *aCx) override; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) override; // nsIContent nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, diff --git a/dom/base/DocumentType.cpp b/dom/base/DocumentType.cpp index 50ef9e9004..a170bf2666 100644 --- a/dom/base/DocumentType.cpp +++ b/dom/base/DocumentType.cpp @@ -60,9 +60,9 @@ namespace mozilla { namespace dom { JSObject* -DocumentType::WrapNode(JSContext *cx) +DocumentType::WrapNode(JSContext *cx, JS::Handle aGivenProto) { - return DocumentTypeBinding::Wrap(cx, this); + return DocumentTypeBinding::Wrap(cx, this, aGivenProto); } DocumentType::DocumentType(already_AddRefed& aNodeInfo, diff --git a/dom/base/DocumentType.h b/dom/base/DocumentType.h index 804849bfa9..fece250363 100644 --- a/dom/base/DocumentType.h +++ b/dom/base/DocumentType.h @@ -77,7 +77,7 @@ public: protected: virtual ~DocumentType(); - virtual JSObject* WrapNode(JSContext *cx) override; + virtual JSObject* WrapNode(JSContext *cx, JS::Handle aGivenProto) override; nsString mPublicId; nsString mSystemId; diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index 5c5a398946..1ada60309d 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -412,9 +412,9 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult) } JSObject* -Element::WrapObject(JSContext *aCx) +Element::WrapObject(JSContext *aCx, JS::Handle aGivenProto) { - JS::Rooted obj(aCx, nsINode::WrapObject(aCx)); + JS::Rooted obj(aCx, nsINode::WrapObject(aCx, aGivenProto)); if (!obj) { return nullptr; } @@ -1110,9 +1110,9 @@ DestinationInsertionPointList::IndexOf(nsIContent* aContent) } JSObject* -DestinationInsertionPointList::WrapObject(JSContext* aCx) +DestinationInsertionPointList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return NodeListBinding::Wrap(aCx, this); + return NodeListBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed diff --git a/dom/base/Element.h b/dom/base/Element.h index dd391d0390..d920d59d76 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -1002,7 +1002,7 @@ public: nsIDOMHTMLCollection** aResult); void GetClassList(nsISupports** aClassList); - virtual JSObject* WrapObject(JSContext *aCx) final override; + virtual JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) final override; nsINode* GetScopeChainParent() const override; @@ -1357,7 +1357,7 @@ public: virtual int32_t IndexOf(nsIContent* aContent) override; virtual nsINode* GetParentObject() override { return mParent; } virtual uint32_t Length() const; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; protected: virtual ~DestinationInsertionPointList(); diff --git a/dom/base/EventSource.cpp b/dom/base/EventSource.cpp index ac2095b51a..9cb4472834 100644 --- a/dom/base/EventSource.cpp +++ b/dom/base/EventSource.cpp @@ -265,9 +265,9 @@ EventSource::Init(nsISupports* aOwner, } /* virtual */ JSObject* -EventSource::WrapObject(JSContext* aCx) +EventSource::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return EventSourceBinding::Wrap(aCx, this); + return EventSourceBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/base/EventSource.h b/dom/base/EventSource.h index beeb99958f..7086b9f3f2 100644 --- a/dom/base/EventSource.h +++ b/dom/base/EventSource.h @@ -58,7 +58,7 @@ public: NS_DECL_NSIINTERFACEREQUESTOR // nsWrapperCache - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // WebIDL nsPIDOMWindow* diff --git a/dom/base/File.cpp b/dom/base/File.cpp index 466aab8bb3..6dfaf680a8 100644 --- a/dom/base/File.cpp +++ b/dom/base/File.cpp @@ -559,10 +559,10 @@ File::IsMemoryFile() } JSObject* -File::WrapObject(JSContext* aCx) +File::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return IsFile() ? FileBinding::Wrap(aCx, this) - : BlobBinding::Wrap(aCx, this); + return IsFile() ? FileBinding::Wrap(aCx, this, aGivenProto) + : BlobBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed @@ -1235,9 +1235,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(FileList) NS_IMPL_CYCLE_COLLECTING_RELEASE(FileList) JSObject* -FileList::WrapObject(JSContext *cx) +FileList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return mozilla::dom::FileListBinding::Wrap(cx, this); + return mozilla::dom::FileListBinding::Wrap(cx, this, aGivenProto); } NS_IMETHODIMP diff --git a/dom/base/File.h b/dom/base/File.h index 6f92a1db46..c8d4ac7ae2 100644 --- a/dom/base/File.h +++ b/dom/base/File.h @@ -189,7 +189,7 @@ public: const ChromeFilePropertyBag& aBag, ErrorResult& aRv); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint64_t GetSize(ErrorResult& aRv); @@ -828,7 +828,7 @@ public: NS_DECL_NSIDOMFILELIST - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() { diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index 20372ed9ff..853dba2116 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -401,9 +401,9 @@ NS_INTERFACE_TABLE_HEAD(nsChildContentList) NS_INTERFACE_MAP_END JSObject* -nsChildContentList::WrapObject(JSContext *cx) +nsChildContentList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return NodeListBinding::Wrap(cx, this); + return NodeListBinding::Wrap(cx, this, aGivenProto); } NS_IMETHODIMP diff --git a/dom/base/FragmentOrElement.h b/dom/base/FragmentOrElement.h index 46c44905c5..0e24f2e776 100644 --- a/dom/base/FragmentOrElement.h +++ b/dom/base/FragmentOrElement.h @@ -56,7 +56,7 @@ public: NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsChildContentList) // nsWrapperCache - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; // nsIDOMNodeList interface NS_DECL_NSIDOMNODELIST diff --git a/dom/base/MessageChannel.cpp b/dom/base/MessageChannel.cpp index d04edf4e94..24f3f5d899 100644 --- a/dom/base/MessageChannel.cpp +++ b/dom/base/MessageChannel.cpp @@ -81,9 +81,9 @@ MessageChannel::~MessageChannel() } JSObject* -MessageChannel::WrapObject(JSContext* aCx) +MessageChannel::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MessageChannelBinding::Wrap(aCx, this); + return MessageChannelBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/base/MessageChannel.h b/dom/base/MessageChannel.h index 2aeb754b52..87b28832a6 100644 --- a/dom/base/MessageChannel.h +++ b/dom/base/MessageChannel.h @@ -40,7 +40,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(const GlobalObject& aGlobal, ErrorResult& aRv); diff --git a/dom/base/MessagePort.cpp b/dom/base/MessagePort.cpp index e0bc4ab991..65ac92d1ca 100644 --- a/dom/base/MessagePort.cpp +++ b/dom/base/MessagePort.cpp @@ -223,7 +223,7 @@ PostMessageReadTransferStructuredClone(JSContext* aCx, port->BindToOwner(scInfo->mPort->GetOwner()); scInfo->mPorts.Put(port, nullptr); - JS::Rooted obj(aCx, port->WrapObject(aCx)); + JS::Rooted obj(aCx, port->WrapObject(aCx, JS::NullPtr())); if (!obj || !JS_WrapObject(aCx, &obj)) { return false; } @@ -414,9 +414,9 @@ MessagePort::~MessagePort() } JSObject* -MessagePort::WrapObject(JSContext* aCx) +MessagePort::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MessagePortBinding::Wrap(aCx, this); + return MessagePortBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/base/MessagePort.h b/dom/base/MessagePort.h index ed61d6b381..c713df05f1 100644 --- a/dom/base/MessagePort.h +++ b/dom/base/MessagePort.h @@ -64,7 +64,7 @@ public: explicit MessagePort(nsPIDOMWindow* aWindow); virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; virtual void PostMessageMoz(JSContext* aCx, JS::Handle aMessage, diff --git a/dom/base/MessagePortList.cpp b/dom/base/MessagePortList.cpp index dc7b3c038f..c48e1be4c7 100644 --- a/dom/base/MessagePortList.cpp +++ b/dom/base/MessagePortList.cpp @@ -20,9 +20,9 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MessagePortList) NS_INTERFACE_MAP_END JSObject* -MessagePortList::WrapObject(JSContext* aCx) +MessagePortList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MessagePortListBinding::Wrap(aCx, this); + return MessagePortListBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/MessagePortList.h b/dom/base/MessagePortList.h index 50d1403e99..5b62bf72fa 100644 --- a/dom/base/MessagePortList.h +++ b/dom/base/MessagePortList.h @@ -41,7 +41,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint32_t Length() const diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index 940a1e9f40..0147ffc25d 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -2231,9 +2231,9 @@ Navigator::GetOwnPropertyNames(JSContext* aCx, nsTArray& aNames, } JSObject* -Navigator::WrapObject(JSContext* cx) +Navigator::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return NavigatorBinding::Wrap(cx, this); + return NavigatorBinding::Wrap(cx, this, aGivenProto); } /* static */ diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h index 7eaad6f7fc..a362935185 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -321,7 +321,7 @@ public: return GetWindow(); } - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; // GetWindowFromGlobal returns the inner window for this global, if // any, else null. diff --git a/dom/base/NodeIterator.cpp b/dom/base/NodeIterator.cpp index 4fc03e66d9..2d5729348c 100644 --- a/dom/base/NodeIterator.cpp +++ b/dom/base/NodeIterator.cpp @@ -289,9 +289,9 @@ void NodeIterator::ContentRemoved(nsIDocument *aDocument, } bool -NodeIterator::WrapObject(JSContext *cx, JS::MutableHandle aReflector) +NodeIterator::WrapObject(JSContext *cx, JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return NodeIteratorBinding::Wrap(cx, this, aReflector); + return NodeIteratorBinding::Wrap(cx, this, aGivenProto, aReflector); } } // namespace dom diff --git a/dom/base/NodeIterator.h b/dom/base/NodeIterator.h index 068eac52e9..54d89f2fc1 100644 --- a/dom/base/NodeIterator.h +++ b/dom/base/NodeIterator.h @@ -69,7 +69,7 @@ public: } // The XPCOM Detach() is fine for our purposes - bool WrapObject(JSContext *cx, JS::MutableHandle aReflector); + bool WrapObject(JSContext *cx, JS::Handle aGivenProto, JS::MutableHandle aReflector); private: virtual ~NodeIterator(); diff --git a/dom/base/PerformanceEntry.cpp b/dom/base/PerformanceEntry.cpp index 1472d59fe7..0caa715727 100644 --- a/dom/base/PerformanceEntry.cpp +++ b/dom/base/PerformanceEntry.cpp @@ -34,7 +34,7 @@ PerformanceEntry::~PerformanceEntry() } JSObject* -PerformanceEntry::WrapObject(JSContext* aCx) +PerformanceEntry::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return mozilla::dom::PerformanceEntryBinding::Wrap(aCx, this); + return mozilla::dom::PerformanceEntryBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/PerformanceEntry.h b/dom/base/PerformanceEntry.h index c36eb7aba6..9efb8bd623 100644 --- a/dom/base/PerformanceEntry.h +++ b/dom/base/PerformanceEntry.h @@ -27,7 +27,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceEntry) - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsPerformance* GetParentObject() const { diff --git a/dom/base/PerformanceMark.cpp b/dom/base/PerformanceMark.cpp index 67952b256b..fadc6840a8 100644 --- a/dom/base/PerformanceMark.cpp +++ b/dom/base/PerformanceMark.cpp @@ -21,7 +21,7 @@ PerformanceMark::~PerformanceMark() } JSObject* -PerformanceMark::WrapObject(JSContext* aCx) +PerformanceMark::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PerformanceMarkBinding::Wrap(aCx, this); + return PerformanceMarkBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/PerformanceMark.h b/dom/base/PerformanceMark.h index 0be75746d1..0bd64bd6ce 100644 --- a/dom/base/PerformanceMark.h +++ b/dom/base/PerformanceMark.h @@ -18,7 +18,7 @@ public: PerformanceMark(nsPerformance* aPerformance, const nsAString& aName); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; virtual DOMHighResTimeStamp StartTime() const override { diff --git a/dom/base/PerformanceMeasure.cpp b/dom/base/PerformanceMeasure.cpp index 90d59b8984..4f492c8ae1 100644 --- a/dom/base/PerformanceMeasure.cpp +++ b/dom/base/PerformanceMeasure.cpp @@ -24,7 +24,7 @@ PerformanceMeasure::~PerformanceMeasure() } JSObject* -PerformanceMeasure::WrapObject(JSContext* aCx) +PerformanceMeasure::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PerformanceMeasureBinding::Wrap(aCx, this); + return PerformanceMeasureBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/PerformanceMeasure.h b/dom/base/PerformanceMeasure.h index a7a0d1f427..4c7ce83277 100644 --- a/dom/base/PerformanceMeasure.h +++ b/dom/base/PerformanceMeasure.h @@ -20,7 +20,7 @@ public: DOMHighResTimeStamp aStartTime, DOMHighResTimeStamp aEndTime); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; virtual DOMHighResTimeStamp StartTime() const override { diff --git a/dom/base/PerformanceResourceTiming.cpp b/dom/base/PerformanceResourceTiming.cpp index 646358e491..0b3bbc3518 100644 --- a/dom/base/PerformanceResourceTiming.cpp +++ b/dom/base/PerformanceResourceTiming.cpp @@ -43,7 +43,7 @@ PerformanceResourceTiming::StartTime() const } JSObject* -PerformanceResourceTiming::WrapObject(JSContext* aCx) +PerformanceResourceTiming::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PerformanceResourceTimingBinding::Wrap(aCx, this); + return PerformanceResourceTimingBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/PerformanceResourceTiming.h b/dom/base/PerformanceResourceTiming.h index d38929371d..a1c99de07a 100644 --- a/dom/base/PerformanceResourceTiming.h +++ b/dom/base/PerformanceResourceTiming.h @@ -31,7 +31,7 @@ public: nsPerformance* aPerformance, const nsAString& aName); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; virtual DOMHighResTimeStamp StartTime() const override; diff --git a/dom/base/ProcessGlobal.h b/dom/base/ProcessGlobal.h index d8f59239bf..5a2636b3b1 100644 --- a/dom/base/ProcessGlobal.h +++ b/dom/base/ProcessGlobal.h @@ -58,7 +58,7 @@ public: } virtual nsIPrincipal* GetPrincipal() override { return mPrincipal; } - virtual JSObject* WrapObject(JSContext* cx) override + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override { MOZ_CRASH("ProcessGlobal doesn't use DOM bindings!"); } diff --git a/dom/base/ShadowRoot.cpp b/dom/base/ShadowRoot.cpp index 405e6c3e31..8a200c415f 100644 --- a/dom/base/ShadowRoot.cpp +++ b/dom/base/ShadowRoot.cpp @@ -104,9 +104,9 @@ ShadowRoot::~ShadowRoot() } JSObject* -ShadowRoot::WrapObject(JSContext* aCx) +ShadowRoot::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return mozilla::dom::ShadowRootBinding::Wrap(aCx, this); + return mozilla::dom::ShadowRootBinding::Wrap(aCx, this, aGivenProto); } ShadowRoot* diff --git a/dom/base/ShadowRoot.h b/dom/base/ShadowRoot.h index 01ec66aa4d..37a93b5394 100644 --- a/dom/base/ShadowRoot.h +++ b/dom/base/ShadowRoot.h @@ -103,7 +103,7 @@ public: nsIContent* GetPoolHost() { return mPoolHost; } nsTArray& ShadowDescendants() { return mShadowDescendants; } - JSObject* WrapObject(JSContext* aCx) override; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static bool IsPooledNode(nsIContent* aChild, nsIContent* aContainer, nsIContent* aHost); diff --git a/dom/base/StructuredCloneTags.h b/dom/base/StructuredCloneTags.h index 6f984d5108..98e16ce176 100644 --- a/dom/base/StructuredCloneTags.h +++ b/dom/base/StructuredCloneTags.h @@ -39,6 +39,8 @@ enum StructuredCloneTags { SCTAG_DOM_SYSTEM_PRINCIPAL, SCTAG_DOM_CONTENT_PRINCIPAL, + SCTAG_DOM_NFC_NDEF, + SCTAG_DOM_MAX }; diff --git a/dom/base/StyleSheetList.cpp b/dom/base/StyleSheetList.cpp index d1d29c7bff..45cb92432a 100644 --- a/dom/base/StyleSheetList.cpp +++ b/dom/base/StyleSheetList.cpp @@ -23,9 +23,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(StyleSheetList) NS_IMPL_CYCLE_COLLECTING_RELEASE(StyleSheetList) /* virtual */ JSObject* -StyleSheetList::WrapObject(JSContext* aCx) +StyleSheetList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return StyleSheetListBinding::Wrap(aCx, this); + return StyleSheetListBinding::Wrap(aCx, this, aGivenProto); } NS_IMETHODIMP diff --git a/dom/base/StyleSheetList.h b/dom/base/StyleSheetList.h index 86ec144926..f8884ba11f 100644 --- a/dom/base/StyleSheetList.h +++ b/dom/base/StyleSheetList.h @@ -24,7 +24,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheetList) NS_DECL_NSIDOMSTYLESHEETLIST - virtual JSObject* WrapObject(JSContext* aCx) override final; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override final; virtual nsINode* GetParentObject() const = 0; diff --git a/dom/base/SubtleCrypto.cpp b/dom/base/SubtleCrypto.cpp index 7f4751243b..6718abce4d 100644 --- a/dom/base/SubtleCrypto.cpp +++ b/dom/base/SubtleCrypto.cpp @@ -29,9 +29,9 @@ SubtleCrypto::SubtleCrypto(nsIGlobalObject* aParent) } JSObject* -SubtleCrypto::WrapObject(JSContext* aCx) +SubtleCrypto::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return SubtleCryptoBinding::Wrap(aCx, this); + return SubtleCryptoBinding::Wrap(aCx, this, aGivenProto); } #define SUBTLECRYPTO_METHOD_BODY(Operation, aRv, ...) \ diff --git a/dom/base/SubtleCrypto.h b/dom/base/SubtleCrypto.h index f734313630..9712e740ae 100644 --- a/dom/base/SubtleCrypto.h +++ b/dom/base/SubtleCrypto.h @@ -38,7 +38,7 @@ public: return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; already_AddRefed Encrypt(JSContext* cx, const ObjectOrString& algorithm, diff --git a/dom/base/TreeWalker.cpp b/dom/base/TreeWalker.cpp index 409cca0fec..f62bc80d63 100644 --- a/dom/base/TreeWalker.cpp +++ b/dom/base/TreeWalker.cpp @@ -451,9 +451,9 @@ TreeWalker::NextSiblingInternal(bool aReversed, ErrorResult& aResult) } bool -TreeWalker::WrapObject(JSContext *aCx, JS::MutableHandle aReflector) +TreeWalker::WrapObject(JSContext *aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return TreeWalkerBinding::Wrap(aCx, this, aReflector); + return TreeWalkerBinding::Wrap(aCx, this, aGivenProto, aReflector); } } // namespace dom diff --git a/dom/base/TreeWalker.h b/dom/base/TreeWalker.h index 4f510a2741..bbac7fd67f 100644 --- a/dom/base/TreeWalker.h +++ b/dom/base/TreeWalker.h @@ -65,7 +65,7 @@ public: already_AddRefed PreviousNode(ErrorResult& aResult); already_AddRefed NextNode(ErrorResult& aResult); - bool WrapObject(JSContext *aCx, JS::MutableHandle aReflector); + bool WrapObject(JSContext *aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); private: nsCOMPtr mCurrentNode; diff --git a/dom/base/URL.cpp b/dom/base/URL.cpp index a18cd771aa..20c4cac691 100644 --- a/dom/base/URL.cpp +++ b/dom/base/URL.cpp @@ -47,9 +47,9 @@ URL::URL(nsIURI* aURI) } bool -URL::WrapObject(JSContext* aCx, JS::MutableHandle aReflector) +URL::WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return URLBinding::Wrap(aCx, this, aReflector); + return URLBinding::Wrap(aCx, this, aGivenProto, aReflector); } /* static */ already_AddRefed diff --git a/dom/base/URL.h b/dom/base/URL.h index 9188b11667..1ef17bf0e1 100644 --- a/dom/base/URL.h +++ b/dom/base/URL.h @@ -44,7 +44,7 @@ public: // WebIDL methods bool - WrapObject(JSContext* aCx, JS::MutableHandle aReflector); + WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aUrl, diff --git a/dom/base/URLSearchParams.cpp b/dom/base/URLSearchParams.cpp index c2d5a89f54..11b9d4d549 100644 --- a/dom/base/URLSearchParams.cpp +++ b/dom/base/URLSearchParams.cpp @@ -30,9 +30,9 @@ URLSearchParams::~URLSearchParams() } JSObject* -URLSearchParams::WrapObject(JSContext* aCx) +URLSearchParams::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return URLSearchParamsBinding::Wrap(aCx, this); + return URLSearchParamsBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/base/URLSearchParams.h b/dom/base/URLSearchParams.h index 8b9a92a8c2..86ac459008 100644 --- a/dom/base/URLSearchParams.h +++ b/dom/base/URLSearchParams.h @@ -44,7 +44,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aInit, diff --git a/dom/base/WebSocket.cpp b/dom/base/WebSocket.cpp index 941c4e8f65..36a0bd3944 100644 --- a/dom/base/WebSocket.cpp +++ b/dom/base/WebSocket.cpp @@ -978,9 +978,9 @@ WebSocket::~WebSocket() } JSObject* -WebSocket::WrapObject(JSContext* cx) +WebSocket::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return WebSocketBinding::Wrap(cx, this); + return WebSocketBinding::Wrap(cx, this, aGivenProto); } //--------------------------------------------------------------------------- diff --git a/dom/base/WebSocket.h b/dom/base/WebSocket.h index 5512a9b1c1..714f773800 100644 --- a/dom/base/WebSocket.h +++ b/dom/base/WebSocket.h @@ -62,7 +62,7 @@ public: // nsWrapperCache nsPIDOMWindow* GetParentObject() { return GetOwner(); } - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; public: // static helpers: diff --git a/dom/base/nsContentList.cpp b/dom/base/nsContentList.cpp index 5a6b9abbe5..2f5b08e70f 100644 --- a/dom/base/nsContentList.cpp +++ b/dom/base/nsContentList.cpp @@ -148,9 +148,9 @@ NS_IMPL_ADDREF_INHERITED(nsSimpleContentList, nsBaseContentList) NS_IMPL_RELEASE_INHERITED(nsSimpleContentList, nsBaseContentList) JSObject* -nsSimpleContentList::WrapObject(JSContext *cx) +nsSimpleContentList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return NodeListBinding::Wrap(cx, this); + return NodeListBinding::Wrap(cx, this, aGivenProto); } // Hashtable for storing nsContentLists @@ -260,16 +260,16 @@ const nsCacheableFuncStringContentList::ContentListType #endif JSObject* -nsCacheableFuncStringNodeList::WrapObject(JSContext *cx) +nsCacheableFuncStringNodeList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return NodeListBinding::Wrap(cx, this); + return NodeListBinding::Wrap(cx, this, aGivenProto); } JSObject* -nsCacheableFuncStringHTMLCollection::WrapObject(JSContext *cx) +nsCacheableFuncStringHTMLCollection::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return HTMLCollectionBinding::Wrap(cx, this); + return HTMLCollectionBinding::Wrap(cx, this, aGivenProto); } // Hashtable for storing nsCacheableFuncStringContentList @@ -470,9 +470,9 @@ nsContentList::~nsContentList() } JSObject* -nsContentList::WrapObject(JSContext *cx) +nsContentList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return HTMLCollectionBinding::Wrap(cx, this); + return HTMLCollectionBinding::Wrap(cx, this, aGivenProto); } NS_IMPL_ISUPPORTS_INHERITED(nsContentList, nsBaseContentList, diff --git a/dom/base/nsContentList.h b/dom/base/nsContentList.h index 4be82b6455..27bc13fae8 100644 --- a/dom/base/nsContentList.h +++ b/dom/base/nsContentList.h @@ -87,7 +87,7 @@ public: virtual int32_t IndexOf(nsIContent *aContent, bool aDoFlush); - virtual JSObject* WrapObject(JSContext *cx) + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override = 0; void SetCapacity(uint32_t aCapacity) @@ -128,7 +128,7 @@ public: { return mRoot; } - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; protected: virtual ~nsSimpleContentList() {} @@ -254,7 +254,7 @@ public: // nsWrapperCache using nsWrapperCache::GetWrapperPreserveColor; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; protected: virtual ~nsContentList(); @@ -541,7 +541,7 @@ public: #endif } - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; #ifdef DEBUG static const ContentListType sType; @@ -565,7 +565,7 @@ public: #endif } - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; #ifdef DEBUG static const ContentListType sType; diff --git a/dom/base/nsDOMAttributeMap.cpp b/dom/base/nsDOMAttributeMap.cpp index 54a472d2c1..96e8b4195c 100644 --- a/dom/base/nsDOMAttributeMap.cpp +++ b/dom/base/nsDOMAttributeMap.cpp @@ -587,7 +587,7 @@ nsDOMAttributeMap::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const } /* virtual */ JSObject* -nsDOMAttributeMap::WrapObject(JSContext* aCx) +nsDOMAttributeMap::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return NamedNodeMapBinding::Wrap(aCx, this); + return NamedNodeMapBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/nsDOMAttributeMap.h b/dom/base/nsDOMAttributeMap.h index 42e9a01174..590af229aa 100644 --- a/dom/base/nsDOMAttributeMap.h +++ b/dom/base/nsDOMAttributeMap.h @@ -140,7 +140,7 @@ public: { return mContent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // WebIDL Attr* GetNamedItem(const nsAString& aAttrName); diff --git a/dom/base/nsDOMCaretPosition.cpp b/dom/base/nsDOMCaretPosition.cpp index cbf68be7e1..a1590f1ec4 100644 --- a/dom/base/nsDOMCaretPosition.cpp +++ b/dom/base/nsDOMCaretPosition.cpp @@ -56,9 +56,9 @@ nsDOMCaretPosition::GetClientRect() const } JSObject* -nsDOMCaretPosition::WrapObject(JSContext *aCx) +nsDOMCaretPosition::WrapObject(JSContext *aCx, JS::Handle aGivenProto) { - return mozilla::dom::CaretPositionBinding::Wrap(aCx, this); + return mozilla::dom::CaretPositionBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMCaretPosition, diff --git a/dom/base/nsDOMCaretPosition.h b/dom/base/nsDOMCaretPosition.h index 0c459d0c11..1e31c1966d 100644 --- a/dom/base/nsDOMCaretPosition.h +++ b/dom/base/nsDOMCaretPosition.h @@ -85,7 +85,7 @@ public: return GetOffsetNode(); } - virtual JSObject* WrapObject(JSContext *aCx) + virtual JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) override final; protected: diff --git a/dom/base/nsDOMDataChannel.cpp b/dom/base/nsDOMDataChannel.cpp index 622665c7d6..85ffac023d 100644 --- a/dom/base/nsDOMDataChannel.cpp +++ b/dom/base/nsDOMDataChannel.cpp @@ -53,9 +53,9 @@ nsDOMDataChannel::~nsDOMDataChannel() } /* virtual */ JSObject* -nsDOMDataChannel::WrapObject(JSContext* aCx) +nsDOMDataChannel::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DataChannelBinding::Wrap(aCx, this); + return DataChannelBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataChannel) diff --git a/dom/base/nsDOMDataChannel.h b/dom/base/nsDOMDataChannel.h index 50cc8d86c5..8e4add68c2 100644 --- a/dom/base/nsDOMDataChannel.h +++ b/dom/base/nsDOMDataChannel.h @@ -42,7 +42,7 @@ public: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMDataChannel, mozilla::DOMEventTargetHelper) - virtual JSObject* WrapObject(JSContext* aCx) + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsPIDOMWindow* GetParentObject() const { diff --git a/dom/base/nsDOMFileReader.cpp b/dom/base/nsDOMFileReader.cpp index 6267e0e985..6dda3a1edc 100644 --- a/dom/base/nsDOMFileReader.cpp +++ b/dom/base/nsDOMFileReader.cpp @@ -530,7 +530,7 @@ nsDOMFileReader::GetAsDataURL(nsIDOMBlob *aFile, } /* virtual */ JSObject* -nsDOMFileReader::WrapObject(JSContext* aCx) +nsDOMFileReader::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return FileReaderBinding::Wrap(aCx, this); + return FileReaderBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/nsDOMFileReader.h b/dom/base/nsDOMFileReader.h index 65c188d288..0ba5d94fc9 100644 --- a/dom/base/nsDOMFileReader.h +++ b/dom/base/nsDOMFileReader.h @@ -62,7 +62,7 @@ public: { return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // WebIDL static already_AddRefed diff --git a/dom/base/nsDOMMutationObserver.h b/dom/base/nsDOMMutationObserver.h index dd84d39636..6b29798225 100644 --- a/dom/base/nsDOMMutationObserver.h +++ b/dom/base/nsDOMMutationObserver.h @@ -44,9 +44,9 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) override + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { - return mozilla::dom::MutationRecordBinding::Wrap(aCx, this); + return mozilla::dom::MutationRecordBinding::Wrap(aCx, this, aGivenProto); } NS_DECL_CYCLE_COLLECTING_ISUPPORTS @@ -356,9 +356,9 @@ public: mozilla::dom::MutationCallback& aCb, mozilla::ErrorResult& aRv); - virtual JSObject* WrapObject(JSContext* aCx) override + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { - return mozilla::dom::MutationObserverBinding::Wrap(aCx, this); + return mozilla::dom::MutationObserverBinding::Wrap(aCx, this, aGivenProto); } nsISupports* GetParentObject() const diff --git a/dom/base/nsDOMSerializer.h b/dom/base/nsDOMSerializer.h index 24a949c297..1560998ed9 100644 --- a/dom/base/nsDOMSerializer.h +++ b/dom/base/nsDOMSerializer.h @@ -48,9 +48,9 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) override + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { - return mozilla::dom::XMLSerializerBinding::Wrap(aCx, this); + return mozilla::dom::XMLSerializerBinding::Wrap(aCx, this, aGivenProto); } private: diff --git a/dom/base/nsDOMSettableTokenList.cpp b/dom/base/nsDOMSettableTokenList.cpp index 51453fe1e6..1bad57ef90 100644 --- a/dom/base/nsDOMSettableTokenList.cpp +++ b/dom/base/nsDOMSettableTokenList.cpp @@ -21,7 +21,7 @@ nsDOMSettableTokenList::SetValue(const nsAString& aValue, mozilla::ErrorResult& } JSObject* -nsDOMSettableTokenList::WrapObject(JSContext *cx) +nsDOMSettableTokenList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return mozilla::dom::DOMSettableTokenListBinding::Wrap(cx, this); + return mozilla::dom::DOMSettableTokenListBinding::Wrap(cx, this, aGivenProto); } diff --git a/dom/base/nsDOMSettableTokenList.h b/dom/base/nsDOMSettableTokenList.h index 766522f7c1..8d7c40b84f 100644 --- a/dom/base/nsDOMSettableTokenList.h +++ b/dom/base/nsDOMSettableTokenList.h @@ -22,7 +22,7 @@ public: nsDOMSettableTokenList(mozilla::dom::Element* aElement, nsIAtom* aAttrAtom) : nsDOMTokenList(aElement, aAttrAtom) {} - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; // WebIDL void GetValue(nsAString& aResult) { Stringify(aResult); } diff --git a/dom/base/nsDOMTokenList.cpp b/dom/base/nsDOMTokenList.cpp index ea7ed14e7b..4d58d0b55b 100644 --- a/dom/base/nsDOMTokenList.cpp +++ b/dom/base/nsDOMTokenList.cpp @@ -309,8 +309,8 @@ nsDOMTokenList::Stringify(nsAString& aResult) } JSObject* -nsDOMTokenList::WrapObject(JSContext *cx) +nsDOMTokenList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return DOMTokenListBinding::Wrap(cx, this); + return DOMTokenListBinding::Wrap(cx, this, aGivenProto); } diff --git a/dom/base/nsDOMTokenList.h b/dom/base/nsDOMTokenList.h index 5aa14c0c82..a53f9f9ba1 100644 --- a/dom/base/nsDOMTokenList.h +++ b/dom/base/nsDOMTokenList.h @@ -37,7 +37,7 @@ public: nsDOMTokenList(Element* aElement, nsIAtom* aAttrAtom); - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; Element* GetParentObject() { diff --git a/dom/base/nsFormData.cpp b/dom/base/nsFormData.cpp index e446ca031a..5e1203929a 100644 --- a/dom/base/nsFormData.cpp +++ b/dom/base/nsFormData.cpp @@ -264,9 +264,9 @@ nsFormData::Append(const nsAString& aName, nsIVariant* aValue) } /* virtual */ JSObject* -nsFormData::WrapObject(JSContext* aCx) +nsFormData::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return FormDataBinding::Wrap(aCx, this); + return FormDataBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/base/nsFormData.h b/dom/base/nsFormData.h index ae900ccf82..99e3c175d7 100644 --- a/dom/base/nsFormData.h +++ b/dom/base/nsFormData.h @@ -80,7 +80,7 @@ public: NS_DECL_NSIXHRSENDABLE // nsWrapperCache - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // WebIDL nsISupports* diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 5ed5f49db0..b13a99b24a 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -8058,7 +8058,7 @@ PostMessageReadTransferStructuredClone(JSContext* aCx, port->BindToOwner(scInfo->window); scInfo->ports.Put(port, nullptr); - JS::Rooted obj(aCx, port->WrapObject(aCx)); + JS::Rooted obj(aCx, port->WrapObject(aCx, JS::NullPtr())); if (JS_WrapObject(aCx, &obj)) { MOZ_ASSERT(port->GetOwner() == scInfo->window); returnObject.set(obj); diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 575e038325..2f5f6cfb1b 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -355,7 +355,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS // nsWrapperCache - virtual JSObject *WrapObject(JSContext *cx) override + virtual JSObject *WrapObject(JSContext *cx, JS::Handle aGivenProto) override { return IsInnerWindow() || EnsureInnerWindow() ? GetWrapper() : nullptr; } diff --git a/dom/base/nsHistory.cpp b/dom/base/nsHistory.cpp index 30cd047ac7..7f506f081d 100644 --- a/dom/base/nsHistory.cpp +++ b/dom/base/nsHistory.cpp @@ -60,9 +60,9 @@ nsHistory::GetParentObject() const } JSObject* -nsHistory::WrapObject(JSContext* aCx) +nsHistory::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return HistoryBinding::Wrap(aCx, this); + return HistoryBinding::Wrap(aCx, this, aGivenProto); } uint32_t diff --git a/dom/base/nsHistory.h b/dom/base/nsHistory.h index e08331c799..4e3a45e18d 100644 --- a/dom/base/nsHistory.h +++ b/dom/base/nsHistory.h @@ -33,7 +33,7 @@ public: explicit nsHistory(nsPIDOMWindow* aInnerWindow); nsPIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint32_t GetLength(mozilla::ErrorResult& aRv) const; void GetState(JSContext* aCx, JS::MutableHandle aResult, diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index 013b4b9ec6..5efbfbd09a 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -2896,7 +2896,7 @@ nsINode::GetElementById(const nsAString& aId) } JSObject* -nsINode::WrapObject(JSContext *aCx) +nsINode::WrapObject(JSContext *aCx, JS::Handle aGivenProto) { // Make sure one of these is true // (1) our owner document has a script handling object, @@ -2915,7 +2915,7 @@ nsINode::WrapObject(JSContext *aCx) return nullptr; } - JS::Rooted obj(aCx, WrapNode(aCx)); + JS::Rooted obj(aCx, WrapNode(aCx, aGivenProto)); MOZ_ASSERT_IF(ChromeOnlyAccess(), xpc::IsInContentXBLScope(obj) || !xpc::UseContentXBLScope(js::GetObjectCompartment(obj))); return obj; diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h index ab0525c054..2bc9871343 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -372,7 +372,7 @@ public: */ virtual bool IsNodeOfType(uint32_t aFlags) const = 0; - virtual JSObject* WrapObject(JSContext *aCx) override; + virtual JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) override; /** * returns true if we are in priviliged code or @@ -386,7 +386,7 @@ protected: * does some additional checks and fix-up that's common to all nodes. WrapNode * should just call the DOM binding's Wrap function. */ - virtual JSObject* WrapNode(JSContext *aCx) = 0; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) = 0; public: mozilla::dom::ParentObject GetParentObject() const; // Implemented in nsIDocument.h diff --git a/dom/base/nsInProcessTabChildGlobal.h b/dom/base/nsInProcessTabChildGlobal.h index 78bc083a21..e2667eae95 100644 --- a/dom/base/nsInProcessTabChildGlobal.h +++ b/dom/base/nsInProcessTabChildGlobal.h @@ -146,7 +146,7 @@ public: return mGlobal->GetJSObject(); } - virtual JSObject* WrapObject(JSContext* cx) override + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override { MOZ_CRASH("nsInProcessTabChildGlobal doesn't use DOM bindings!"); } diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp index 95317c0082..80a9dcfc4a 100644 --- a/dom/base/nsJSEnvironment.cpp +++ b/dom/base/nsJSEnvironment.cpp @@ -59,6 +59,9 @@ #include "mozilla/dom/ErrorEvent.h" #include "mozilla/dom/ImageDataBinding.h" #include "mozilla/dom/ImageData.h" +#ifdef MOZ_NFC +#include "mozilla/dom/MozNDEFRecord.h" +#endif // MOZ_NFC #include "mozilla/dom/StructuredClone.h" #include "mozilla/dom/SubtleCryptoBinding.h" #include "mozilla/ipc/BackgroundUtils.h" @@ -2472,7 +2475,7 @@ NS_DOMReadStructuredClone(JSContext* cx, if (!key->ReadStructuredClone(reader)) { result = nullptr; } else { - result = key->WrapObject(cx); + result = key->WrapObject(cx, JS::NullPtr()); } } return result; @@ -2516,6 +2519,24 @@ NS_DOMReadStructuredClone(JSContext* cx, } return result.toObjectOrNull(); + } else if (tag == SCTAG_DOM_NFC_NDEF) { +#ifdef MOZ_NFC + nsIGlobalObject *global = xpc::NativeGlobal(JS::CurrentGlobalOrNull(cx)); + if (!global) { + return nullptr; + } + + // Prevent the return value from being trashed by a GC during ~nsRefPtr. + JS::Rooted result(cx); + { + nsRefPtr ndefRecord = new MozNDEFRecord(global); + result = ndefRecord->ReadStructuredClone(cx, reader) ? + ndefRecord->WrapObject(cx, JS::NullPtr()) : nullptr; + } + return result; +#else + return nullptr; +#endif } // Don't know what this is. Bail. @@ -2567,6 +2588,14 @@ NS_DOMWriteStructuredClone(JSContext* cx, } } +#ifdef MOZ_NFC + MozNDEFRecord* ndefRecord; + if (NS_SUCCEEDED(UNWRAP_OBJECT(MozNDEFRecord, obj, ndefRecord))) { + return JS_WriteUint32Pair(writer, SCTAG_DOM_NFC_NDEF, 0) && + ndefRecord->WriteStructuredClone(cx, writer); + } +#endif // MOZ_NFC + // Don't know what this is xpc::Throw(cx, NS_ERROR_DOM_DATA_CLONE_ERR); return false; diff --git a/dom/base/nsLocation.cpp b/dom/base/nsLocation.cpp index 039a677e1c..d5d76b7ddc 100644 --- a/dom/base/nsLocation.cpp +++ b/dom/base/nsLocation.cpp @@ -1084,9 +1084,9 @@ nsLocation::CallerSubsumes() } JSObject* -nsLocation::WrapObject(JSContext* aCx) +nsLocation::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return LocationBinding::Wrap(aCx, this); + return LocationBinding::Wrap(aCx, this, aGivenProto); } URLSearchParams* diff --git a/dom/base/nsLocation.h b/dom/base/nsLocation.h index 0393025260..2db8315e4e 100644 --- a/dom/base/nsLocation.h +++ b/dom/base/nsLocation.h @@ -142,7 +142,7 @@ public: { return mInnerWindow; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // URLSearchParamsObserver void URLSearchParamsUpdated(mozilla::dom::URLSearchParams* aSearchParams) override; diff --git a/dom/base/nsMimeTypeArray.cpp b/dom/base/nsMimeTypeArray.cpp index 257abf6f56..a05cff1f9b 100644 --- a/dom/base/nsMimeTypeArray.cpp +++ b/dom/base/nsMimeTypeArray.cpp @@ -40,9 +40,9 @@ nsMimeTypeArray::~nsMimeTypeArray() } JSObject* -nsMimeTypeArray::WrapObject(JSContext* aCx) +nsMimeTypeArray::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MimeTypeArrayBinding::Wrap(aCx, this); + return MimeTypeArrayBinding::Wrap(aCx, this, aGivenProto); } void @@ -254,9 +254,9 @@ nsMimeType::GetParentObject() const } JSObject* -nsMimeType::WrapObject(JSContext* aCx) +nsMimeType::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MimeTypeBinding::Wrap(aCx, this); + return MimeTypeBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/base/nsMimeTypeArray.h b/dom/base/nsMimeTypeArray.h index d2835188dd..ee6631a532 100644 --- a/dom/base/nsMimeTypeArray.h +++ b/dom/base/nsMimeTypeArray.h @@ -26,7 +26,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsMimeTypeArray) nsPIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void Refresh(); @@ -69,7 +69,7 @@ public: uint32_t aPluginTagMimeIndex, const nsAString& aMimeType); nsMimeType(nsPIDOMWindow* aWindow, const nsAString& aMimeType); nsPIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; const nsString& Type() const { diff --git a/dom/base/nsPerformance.cpp b/dom/base/nsPerformance.cpp index 02a58760f5..3552741699 100644 --- a/dom/base/nsPerformance.cpp +++ b/dom/base/nsPerformance.cpp @@ -366,9 +366,9 @@ nsPerformanceTiming::IsInitialized() const } JSObject* -nsPerformanceTiming::WrapObject(JSContext *cx) +nsPerformanceTiming::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return PerformanceTimingBinding::Wrap(cx, this); + return PerformanceTimingBinding::Wrap(cx, this, aGivenProto); } @@ -388,9 +388,9 @@ nsPerformanceNavigation::~nsPerformanceNavigation() } JSObject* -nsPerformanceNavigation::WrapObject(JSContext *cx) +nsPerformanceNavigation::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return PerformanceNavigationBinding::Wrap(cx, this); + return PerformanceNavigationBinding::Wrap(cx, this, aGivenProto); } @@ -474,9 +474,9 @@ nsPerformance::Now() } JSObject* -nsPerformance::WrapObject(JSContext *cx) +nsPerformance::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return PerformanceBinding::Wrap(cx, this); + return PerformanceBinding::Wrap(cx, this, aGivenProto); } void diff --git a/dom/base/nsPerformance.h b/dom/base/nsPerformance.h index 21401b0307..7ece91ba2e 100644 --- a/dom/base/nsPerformance.h +++ b/dom/base/nsPerformance.h @@ -117,7 +117,7 @@ public: return duration.ToMilliseconds() + mZeroTime; } - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; // PerformanceNavigation WebIDL methods DOMTimeMilliSec NavigationStart() const { @@ -271,7 +271,7 @@ public: return mPerformance; } - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; // PerformanceNavigation WebIDL methods uint16_t Type() const { @@ -319,7 +319,7 @@ public: return mWindow.get(); } - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; // Performance WebIDL methods DOMHighResTimeStamp Now(); diff --git a/dom/base/nsPluginArray.cpp b/dom/base/nsPluginArray.cpp index 1dcd55182e..7697e825ad 100644 --- a/dom/base/nsPluginArray.cpp +++ b/dom/base/nsPluginArray.cpp @@ -51,9 +51,9 @@ nsPluginArray::GetParentObject() const } JSObject* -nsPluginArray::WrapObject(JSContext* aCx) +nsPluginArray::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PluginArrayBinding::Wrap(aCx, this); + return PluginArrayBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPluginArray) @@ -399,9 +399,9 @@ nsPluginElement::GetParentObject() const } JSObject* -nsPluginElement::WrapObject(JSContext* aCx) +nsPluginElement::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PluginBinding::Wrap(aCx, this); + return PluginBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/base/nsPluginArray.h b/dom/base/nsPluginArray.h index c3da7c3225..e9b5eb8a77 100644 --- a/dom/base/nsPluginArray.h +++ b/dom/base/nsPluginArray.h @@ -31,7 +31,7 @@ public: explicit nsPluginArray(nsPIDOMWindow* aWindow); nsPIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // nsPluginArray registers itself as an observer with a weak reference. // This can't be done in the constructor, because at that point its @@ -85,7 +85,7 @@ public: nsPluginElement(nsPIDOMWindow* aWindow, nsPluginTag* aPluginTag); nsPIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsPluginTag* PluginTag() const { diff --git a/dom/base/nsRange.cpp b/dom/base/nsRange.cpp index 3687c73b4c..99379f5559 100644 --- a/dom/base/nsRange.cpp +++ b/dom/base/nsRange.cpp @@ -42,9 +42,9 @@ using namespace mozilla; using namespace mozilla::dom; JSObject* -nsRange::WrapObject(JSContext* aCx) +nsRange::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return RangeBinding::Wrap(aCx, this); + return RangeBinding::Wrap(aCx, this, aGivenProto); } /****************************************************** diff --git a/dom/base/nsRange.h b/dom/base/nsRange.h index 28f3f8c0c3..94b8ba7796 100644 --- a/dom/base/nsRange.h +++ b/dom/base/nsRange.h @@ -219,7 +219,7 @@ public: uint32_t aEndOffset); nsINode* GetParentObject() const { return mOwner; } - virtual JSObject* WrapObject(JSContext* cx) override final; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override final; private: // no copy's or assigns diff --git a/dom/base/nsScreen.cpp b/dom/base/nsScreen.cpp index 7dda65bff8..a63e9796eb 100644 --- a/dom/base/nsScreen.cpp +++ b/dom/base/nsScreen.cpp @@ -335,9 +335,9 @@ nsScreen::IsDeviceSizePageSize() /* virtual */ JSObject* -nsScreen::WrapObject(JSContext* aCx) +nsScreen::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return ScreenBinding::Wrap(aCx, this); + return ScreenBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_ISUPPORTS(nsScreen::FullScreenEventListener, nsIDOMEventListener) diff --git a/dom/base/nsScreen.h b/dom/base/nsScreen.h index 9f131bb1fd..aa096079d0 100644 --- a/dom/base/nsScreen.h +++ b/dom/base/nsScreen.h @@ -122,7 +122,7 @@ public: bool MozLockOrientation(const mozilla::dom::Sequence& aOrientations, ErrorResult& aRv); void MozUnlockOrientation(); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void Notify(const mozilla::hal::ScreenConfiguration& aConfiguration) override; diff --git a/dom/base/nsTextNode.cpp b/dom/base/nsTextNode.cpp index 9cd7a3f4e4..7e5a7e96bf 100644 --- a/dom/base/nsTextNode.cpp +++ b/dom/base/nsTextNode.cpp @@ -100,9 +100,9 @@ NS_IMPL_ISUPPORTS_INHERITED(nsTextNode, nsGenericDOMDataNode, nsIDOMNode, nsIDOMText, nsIDOMCharacterData) JSObject* -nsTextNode::WrapNode(JSContext *aCx) +nsTextNode::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return TextBinding::Wrap(aCx, this); + return TextBinding::Wrap(aCx, this, aGivenProto); } bool diff --git a/dom/base/nsTextNode.h b/dom/base/nsTextNode.h index bf8bba6131..2b701a5f6d 100644 --- a/dom/base/nsTextNode.h +++ b/dom/base/nsTextNode.h @@ -81,7 +81,7 @@ public: protected: virtual ~nsTextNode(); - virtual JSObject* WrapNode(JSContext *aCx) override; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) override; }; #endif // nsTextNode_h diff --git a/dom/base/nsWindowRoot.cpp b/dom/base/nsWindowRoot.cpp index 283d35fabc..9a2eeb0980 100644 --- a/dom/base/nsWindowRoot.cpp +++ b/dom/base/nsWindowRoot.cpp @@ -379,9 +379,9 @@ nsWindowRoot::GetParentObject() } JSObject* -nsWindowRoot::WrapObject(JSContext* aCx) +nsWindowRoot::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return mozilla::dom::WindowRootBinding::Wrap(aCx, this); + return mozilla::dom::WindowRootBinding::Wrap(aCx, this, aGivenProto); } /////////////////////////////////////////////////////////////////////////////////// diff --git a/dom/base/nsWindowRoot.h b/dom/base/nsWindowRoot.h index 437587aca6..b5c107583a 100644 --- a/dom/base/nsWindowRoot.h +++ b/dom/base/nsWindowRoot.h @@ -70,7 +70,7 @@ public: nsIGlobalObject* GetParentObject(); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsWindowRoot, nsIDOMEventTarget) diff --git a/dom/base/nsWrapperCache.h b/dom/base/nsWrapperCache.h index dd5dd1ee68..ac6dfa0e27 100644 --- a/dom/base/nsWrapperCache.h +++ b/dom/base/nsWrapperCache.h @@ -152,7 +152,7 @@ public: * Wrap the object corresponding to this wrapper cache. If non-null is * returned, the object has already been stored in the wrapper cache. */ - virtual JSObject* WrapObject(JSContext* cx) = 0; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) = 0; /** * Returns true if the object has a non-gray wrapper. diff --git a/dom/base/nsXMLHttpRequest.cpp b/dom/base/nsXMLHttpRequest.cpp index c3ed6f4d94..2c0fb286df 100644 --- a/dom/base/nsXMLHttpRequest.cpp +++ b/dom/base/nsXMLHttpRequest.cpp @@ -277,9 +277,9 @@ NS_IMPL_ADDREF_INHERITED(nsXMLHttpRequestUpload, nsXHREventTarget) NS_IMPL_RELEASE_INHERITED(nsXMLHttpRequestUpload, nsXHREventTarget) /* virtual */ JSObject* -nsXMLHttpRequestUpload::WrapObject(JSContext* aCx) +nsXMLHttpRequestUpload::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return XMLHttpRequestUploadBinding::Wrap(aCx, this); + return XMLHttpRequestUploadBinding::Wrap(aCx, this, aGivenProto); } ///////////////////////////////////////////// diff --git a/dom/base/nsXMLHttpRequest.h b/dom/base/nsXMLHttpRequest.h index 7811909f48..fe558f3f1f 100644 --- a/dom/base/nsXMLHttpRequest.h +++ b/dom/base/nsXMLHttpRequest.h @@ -160,7 +160,7 @@ public: NS_REALLY_FORWARD_NSIDOMEVENTTARGET(nsXHREventTarget) NS_DECL_NSIXMLHTTPREQUESTUPLOAD - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() { return GetOwner(); @@ -196,9 +196,9 @@ class nsXMLHttpRequest final : public nsXHREventTarget, public: nsXMLHttpRequest(); - virtual JSObject* WrapObject(JSContext *cx) override + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override { - return mozilla::dom::XMLHttpRequestBinding::Wrap(cx, this); + return mozilla::dom::XMLHttpRequestBinding::Wrap(cx, this, aGivenProto); } nsISupports* GetParentObject() { diff --git a/dom/battery/BatteryManager.cpp b/dom/battery/BatteryManager.cpp index dbe9e68c30..64fdfe75c3 100644 --- a/dom/battery/BatteryManager.cpp +++ b/dom/battery/BatteryManager.cpp @@ -50,9 +50,9 @@ BatteryManager::Shutdown() } JSObject* -BatteryManager::WrapObject(JSContext* aCx) +BatteryManager::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return BatteryManagerBinding::Wrap(aCx, this); + return BatteryManagerBinding::Wrap(aCx, this, aGivenProto); } double diff --git a/dom/battery/BatteryManager.h b/dom/battery/BatteryManager.h index 5ddaa2d469..8fdcc58279 100644 --- a/dom/battery/BatteryManager.h +++ b/dom/battery/BatteryManager.h @@ -44,7 +44,7 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; bool Charging() const { diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index cc10ef1f4e..a732afeacc 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -800,7 +800,7 @@ NativeInterface2JSObjectAndThrowIfFailed(JSContext* aCx, if (cache && cache->IsDOMBinding()) { JS::Rooted obj(aCx, cache->GetWrapper()); if (!obj) { - obj = cache->WrapObject(aCx); + obj = cache->WrapObject(aCx, JS::NullPtr()); } if (obj && aAllowNativeWrapper && !JS_WrapObject(aCx, &obj)) { diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index 724773fcda..ee92a2fee5 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -923,7 +923,7 @@ DoGetOrCreateDOMReflector(JSContext* cx, T* value, return false; } - obj = value->WrapObject(cx); + obj = value->WrapObject(cx, JS::NullPtr()); if (!obj) { // At this point, obj is null, so just return false. // Callers seem to be testing JS_IsExceptionPending(cx) to @@ -1031,7 +1031,7 @@ WrapNewBindingNonWrapperCachedObject(JSContext* cx, } MOZ_ASSERT(js::IsObjectInContextCompartment(scope, cx)); - if (!value->WrapObject(cx, &obj)) { + if (!value->WrapObject(cx, JS::NullPtr(), &obj)) { return false; } } @@ -1077,7 +1077,7 @@ WrapNewBindingNonWrapperCachedObject(JSContext* cx, } MOZ_ASSERT(js::IsObjectInContextCompartment(scope, cx)); - if (!value->WrapObject(cx, &obj)) { + if (!value->WrapObject(cx, JS::NullPtr(), &obj)) { return false; } @@ -1513,7 +1513,7 @@ struct WrapNativeParentHelper if (!CouldBeDOMBinding(parent)) { obj = WrapNativeParentFallback::Wrap(cx, parent, cache); } else { - obj = parent->WrapObject(cx); + obj = parent->WrapObject(cx, JS::NullPtr()); } return obj; diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 2bdb5567e4..3b01df66d7 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -3182,11 +3182,8 @@ def CopyUnforgeablePropertiesToInstance(descriptor, wrapperCache): copyFunc = "JS_InitializePropertiesFromCompatibleNativeObject" copyCode.append(CGGeneric(fill( """ - // XXXbz Once we allow subclassing, we'll want to make sure that - // this uses the canonical proto, not whatever random passed-in - // proto we end up using for the object. JS::Rooted unforgeableHolder(aCx, - &js::GetReservedSlot(proto, DOM_INTERFACE_PROTO_SLOTS_BASE).toObject()); + &js::GetReservedSlot(canonicalProto, DOM_INTERFACE_PROTO_SLOTS_BASE).toObject()); if (!${copyFunc}(aCx, ${obj}, unforgeableHolder)) { $*{cleanup} return false; @@ -3242,6 +3239,30 @@ def InitMemberSlots(descriptor, wrapperCache): clearWrapper=clearWrapper) +def DeclareProto(): + """ + Declare the canonicalProto and proto we have for our wrapping operation. + """ + return dedent( + """ + JS::Handle canonicalProto = GetProtoObjectHandle(aCx, global); + if (!canonicalProto) { + return false; + } + JS::Rooted proto(aCx); + if (aGivenProto) { + proto = aGivenProto; + if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { + if (!JS_WrapObject(aCx, &proto)) { + return false; + } + } + } else { + proto = canonicalProto; + } + """) + + class CGWrapWithCacheMethod(CGAbstractMethod): """ Create a wrapper JSObject for a given native that implements nsWrapperCache. @@ -3253,6 +3274,7 @@ class CGWrapWithCacheMethod(CGAbstractMethod): args = [Argument('JSContext*', 'aCx'), Argument(descriptor.nativeType + '*', 'aObject'), Argument('nsWrapperCache*', 'aCache'), + Argument('JS::Handle', 'aGivenProto'), Argument('JS::MutableHandle', 'aReflector')] CGAbstractMethod.__init__(self, descriptor, 'Wrap', 'bool', args) self.properties = properties @@ -3260,7 +3282,8 @@ class CGWrapWithCacheMethod(CGAbstractMethod): def definition_body(self): return fill( """ - $*{assertion} + $*{assertInheritance} + MOZ_ASSERT_IF(aGivenProto, !aCache->GetWrapper()); MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), "nsISupports must be on our primary inheritance chain"); @@ -3274,15 +3297,14 @@ class CGWrapWithCacheMethod(CGAbstractMethod): // of XBL. Check for that, and bail out as needed. aReflector.set(aCache->GetWrapper()); if (aReflector) { + MOZ_ASSERT(!aGivenProto, + "How are we supposed to change the proto now?"); return true; } JSAutoCompartment ac(aCx, parent); JS::Rooted global(aCx, js::GetGlobalForObjectCrossCompartment(parent)); - JS::Handle proto = GetProtoObjectHandle(aCx, global); - if (!proto) { - return false; - } + $*{declareProto} $*{createObject} @@ -3292,7 +3314,8 @@ class CGWrapWithCacheMethod(CGAbstractMethod): creator.InitializationSucceeded(); return true; """, - assertion=AssertInheritanceChain(self.descriptor), + assertInheritance=AssertInheritanceChain(self.descriptor), + declareProto=DeclareProto(), createObject=CreateBindingJSObject(self.descriptor, self.properties), unforgeable=CopyUnforgeablePropertiesToInstance(self.descriptor, True), slots=InitMemberSlots(self.descriptor, True)) @@ -3303,14 +3326,15 @@ class CGWrapMethod(CGAbstractMethod): # XXX can we wrap if we don't have an interface prototype object? assert descriptor.interface.hasInterfacePrototypeObject() args = [Argument('JSContext*', 'aCx'), - Argument('T*', 'aObject')] + Argument('T*', 'aObject'), + Argument('JS::Handle', 'aGivenProto')] CGAbstractMethod.__init__(self, descriptor, 'Wrap', 'JSObject*', args, inline=True, templateArgs=["class T"]) def definition_body(self): return dedent(""" JS::Rooted reflector(aCx); - return Wrap(aCx, aObject, aObject, &reflector) ? reflector.get() : nullptr; + return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; """) @@ -3326,6 +3350,7 @@ class CGWrapNonWrapperCacheMethod(CGAbstractMethod): assert descriptor.interface.hasInterfacePrototypeObject() args = [Argument('JSContext*', 'aCx'), Argument(descriptor.nativeType + '*', 'aObject'), + Argument('JS::Handle', 'aGivenProto'), Argument('JS::MutableHandle', 'aReflector')] CGAbstractMethod.__init__(self, descriptor, 'Wrap', 'bool', args) self.properties = properties @@ -3336,10 +3361,7 @@ class CGWrapNonWrapperCacheMethod(CGAbstractMethod): $*{assertions} JS::Rooted global(aCx, JS::CurrentGlobalOrNull(aCx)); - JS::Handle proto = GetProtoObjectHandle(aCx, global); - if (!proto) { - return false; - } + $*{declareProto} $*{createObject} @@ -3350,6 +3372,7 @@ class CGWrapNonWrapperCacheMethod(CGAbstractMethod): return true; """, assertions=AssertInheritanceChain(self.descriptor), + declareProto=DeclareProto(), createObject=CreateBindingJSObject(self.descriptor, self.properties), unforgeable=CopyUnforgeablePropertiesToInstance(self.descriptor, False), slots=InitMemberSlots(self.descriptor, False)) @@ -3393,10 +3416,10 @@ class CGWrapGlobalMethod(CGAbstractMethod): fireOnNewGlobal = "" if self.descriptor.hasUnforgeableMembers: - declareProto = "JS::Handle proto =\n" + declareProto = "JS::Handle canonicalProto =\n" assertProto = ( - "MOZ_ASSERT(proto &&\n" - " IsDOMIfaceAndProtoClass(js::GetObjectClass(proto)));\n") + "MOZ_ASSERT(canonicalProto &&\n" + " IsDOMIfaceAndProtoClass(js::GetObjectClass(canonicalProto)));\n") else: declareProto = "" assertProto = "" @@ -13100,7 +13123,8 @@ class CGBindingImplClass(CGClass): name="aName")]), { "infallible": True })) - wrapArgs = [Argument('JSContext*', 'aCx')] + wrapArgs = [Argument('JSContext*', 'aCx'), + Argument('JS::Handle', 'aGivenProto')] self.methodDecls.insert(0, ClassMethod(wrapMethodName, "JSObject*", wrapArgs, virtual=descriptor.wrapperCache, @@ -13220,9 +13244,9 @@ class CGExampleClass(CGBindingImplClass): classImpl = ccImpl + ctordtor + "\n" + dedent(""" JSObject* - ${nativeType}::WrapObject(JSContext* aCx) + ${nativeType}::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return ${ifaceName}Binding::Wrap(aCx, this); + return ${ifaceName}Binding::Wrap(aCx, this, aGivenProto); } """) @@ -13590,7 +13614,7 @@ class CGJSImplClass(CGBindingImplClass): def getWrapObjectBody(self): return fill( """ - JS::Rooted obj(aCx, ${name}Binding::Wrap(aCx, this)); + JS::Rooted obj(aCx, ${name}Binding::Wrap(aCx, this, aGivenProto)); if (!obj) { return nullptr; } @@ -14983,7 +15007,7 @@ class CGEventClass(CGBindingImplClass): extradeclarations=baseDeclarations) def getWrapObjectBody(self): - return "return %sBinding::Wrap(aCx, this);\n" % self.descriptor.name + return "return %sBinding::Wrap(aCx, this, aGivenProto);\n" % self.descriptor.name def implTraverse(self): retVal = "" diff --git a/dom/bindings/StructuredClone.cpp b/dom/bindings/StructuredClone.cpp index e468407f18..49ce5216b8 100644 --- a/dom/bindings/StructuredClone.cpp +++ b/dom/bindings/StructuredClone.cpp @@ -32,7 +32,7 @@ ReadStructuredCloneImageData(JSContext* aCx, JSStructuredCloneReader* aReader) nsRefPtr imageData = new ImageData(width, height, dataArray.toObject()); // Wrap it in a JS::Value. - if (!imageData->WrapObject(aCx, &result)) { + if (!imageData->WrapObject(aCx, JS::NullPtr(), &result)) { return nullptr; } } diff --git a/dom/bindings/test/TestBindingHeader.h b/dom/bindings/test/TestBindingHeader.h index 76f1321e2f..cc3525e0e3 100644 --- a/dom/bindings/test/TestBindingHeader.h +++ b/dom/bindings/test/TestBindingHeader.h @@ -90,7 +90,7 @@ class TestNonWrapperCacheInterface : public nsISupports public: NS_DECL_ISUPPORTS - bool WrapObject(JSContext* aCx, JS::MutableHandle aReflector); + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); }; class OnlyForUseInConstructor : public nsISupports, diff --git a/dom/bluetooth/BluetoothAdapter.cpp b/dom/bluetooth/BluetoothAdapter.cpp index 8f0c88078a..0af6155658 100644 --- a/dom/bluetooth/BluetoothAdapter.cpp +++ b/dom/bluetooth/BluetoothAdapter.cpp @@ -1067,7 +1067,7 @@ BluetoothAdapter::SendMediaPlayStatus(const MediaPlayStatus& aMediaPlayStatus, E } JSObject* -BluetoothAdapter::WrapObject(JSContext* aCx) +BluetoothAdapter::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return BluetoothAdapterBinding::Wrap(aCx, this); + return BluetoothAdapterBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/bluetooth/BluetoothAdapter.h b/dom/bluetooth/BluetoothAdapter.h index f95c2a2595..b9fb2f1816 100644 --- a/dom/bluetooth/BluetoothAdapter.h +++ b/dom/bluetooth/BluetoothAdapter.h @@ -169,7 +169,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; private: BluetoothAdapter(nsPIDOMWindow* aOwner, const BluetoothValue& aValue); diff --git a/dom/bluetooth/BluetoothDevice.cpp b/dom/bluetooth/BluetoothDevice.cpp index d1070b6f8f..5f419c62da 100644 --- a/dom/bluetooth/BluetoothDevice.cpp +++ b/dom/bluetooth/BluetoothDevice.cpp @@ -234,7 +234,7 @@ BluetoothDevice::GetServices(JSContext* aCx, } JSObject* -BluetoothDevice::WrapObject(JSContext* aContext) +BluetoothDevice::WrapObject(JSContext* aContext, JS::Handle aGivenProto) { - return BluetoothDeviceBinding::Wrap(aContext, this); + return BluetoothDeviceBinding::Wrap(aContext, this, aGivenProto); } diff --git a/dom/bluetooth/BluetoothDevice.h b/dom/bluetooth/BluetoothDevice.h index f9833bc15d..19a35fee85 100644 --- a/dom/bluetooth/BluetoothDevice.h +++ b/dom/bluetooth/BluetoothDevice.h @@ -87,7 +87,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; virtual void DisconnectFromOwner() override; diff --git a/dom/bluetooth/BluetoothManager.cpp b/dom/bluetooth/BluetoothManager.cpp index 97dcc98fae..af6ec853d1 100644 --- a/dom/bluetooth/BluetoothManager.cpp +++ b/dom/bluetooth/BluetoothManager.cpp @@ -210,7 +210,7 @@ BluetoothManager::Notify(const BluetoothSignal& aData) } JSObject* -BluetoothManager::WrapObject(JSContext* aCx) +BluetoothManager::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return BluetoothManagerBinding::Wrap(aCx, this); + return BluetoothManagerBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/bluetooth/BluetoothManager.h b/dom/bluetooth/BluetoothManager.h index 5be05c97cf..0d7962e345 100644 --- a/dom/bluetooth/BluetoothManager.h +++ b/dom/bluetooth/BluetoothManager.h @@ -52,7 +52,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; virtual void DisconnectFromOwner() override; diff --git a/dom/bluetooth2/BluetoothAdapter.cpp b/dom/bluetooth2/BluetoothAdapter.cpp index 1cbd144fff..238548797a 100644 --- a/dom/bluetooth2/BluetoothAdapter.cpp +++ b/dom/bluetooth2/BluetoothAdapter.cpp @@ -1324,7 +1324,7 @@ BluetoothAdapter::SendMediaPlayStatus(const MediaPlayStatus& aMediaPlayStatus, E } JSObject* -BluetoothAdapter::WrapObject(JSContext* aCx) +BluetoothAdapter::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return BluetoothAdapterBinding::Wrap(aCx, this); + return BluetoothAdapterBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/bluetooth2/BluetoothAdapter.h b/dom/bluetooth2/BluetoothAdapter.h index 98fb524c46..f7b98bd7a3 100644 --- a/dom/bluetooth2/BluetoothAdapter.h +++ b/dom/bluetooth2/BluetoothAdapter.h @@ -163,7 +163,8 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; virtual void DisconnectFromOwner() override; /** diff --git a/dom/bluetooth2/BluetoothClassOfDevice.cpp b/dom/bluetooth2/BluetoothClassOfDevice.cpp index 6c19a2e18e..8d19ceb171 100644 --- a/dom/bluetooth2/BluetoothClassOfDevice.cpp +++ b/dom/bluetooth2/BluetoothClassOfDevice.cpp @@ -95,7 +95,8 @@ BluetoothClassOfDevice::Create(nsPIDOMWindow* aOwner) } JSObject* -BluetoothClassOfDevice::WrapObject(JSContext* aCx) +BluetoothClassOfDevice::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) { - return BluetoothClassOfDeviceBinding::Wrap(aCx, this); + return BluetoothClassOfDeviceBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/bluetooth2/BluetoothClassOfDevice.h b/dom/bluetooth2/BluetoothClassOfDevice.h index 43b3547e74..c518e4f954 100644 --- a/dom/bluetooth2/BluetoothClassOfDevice.h +++ b/dom/bluetooth2/BluetoothClassOfDevice.h @@ -18,8 +18,8 @@ struct JSContext; BEGIN_BLUETOOTH_NAMESPACE -class BluetoothClassOfDevice final : public nsISupports, - public nsWrapperCache +class BluetoothClassOfDevice final : public nsISupports + , public nsWrapperCache { public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS @@ -69,7 +69,8 @@ public: { return mOwnerWindow; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; private: BluetoothClassOfDevice(nsPIDOMWindow* aOwner); diff --git a/dom/bluetooth2/BluetoothDevice.cpp b/dom/bluetooth2/BluetoothDevice.cpp index cf1df22f46..9e31fb64d2 100644 --- a/dom/bluetooth2/BluetoothDevice.cpp +++ b/dom/bluetooth2/BluetoothDevice.cpp @@ -320,7 +320,8 @@ BluetoothDevice::GetGatt() } JSObject* -BluetoothDevice::WrapObject(JSContext* aContext) +BluetoothDevice::WrapObject(JSContext* aContext, + JS::Handle aGivenProto) { - return BluetoothDeviceBinding::Wrap(aContext, this); + return BluetoothDeviceBinding::Wrap(aContext, this, aGivenProto); } diff --git a/dom/bluetooth2/BluetoothDevice.h b/dom/bluetooth2/BluetoothDevice.h index 9bab245a04..7dc40f981f 100644 --- a/dom/bluetooth2/BluetoothDevice.h +++ b/dom/bluetooth2/BluetoothDevice.h @@ -30,7 +30,7 @@ class BluetoothSignal; class BluetoothSocket; class BluetoothDevice final : public DOMEventTargetHelper - , public BluetoothSignalObserver + , public BluetoothSignalObserver { public: NS_DECL_ISUPPORTS_INHERITED @@ -94,7 +94,8 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; virtual void DisconnectFromOwner() override; private: diff --git a/dom/bluetooth2/BluetoothDiscoveryHandle.cpp b/dom/bluetooth2/BluetoothDiscoveryHandle.cpp index 089fa88b5b..83b48d48a9 100644 --- a/dom/bluetooth2/BluetoothDiscoveryHandle.cpp +++ b/dom/bluetooth2/BluetoothDiscoveryHandle.cpp @@ -58,7 +58,8 @@ BluetoothDiscoveryHandle::DispatchDeviceEvent(BluetoothDevice* aDevice) } JSObject* -BluetoothDiscoveryHandle::WrapObject(JSContext* aCx) +BluetoothDiscoveryHandle::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) { - return BluetoothDiscoveryHandleBinding::Wrap(aCx, this); + return BluetoothDiscoveryHandleBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/bluetooth2/BluetoothDiscoveryHandle.h b/dom/bluetooth2/BluetoothDiscoveryHandle.h index c094253e13..675741d4f7 100644 --- a/dom/bluetooth2/BluetoothDiscoveryHandle.h +++ b/dom/bluetooth2/BluetoothDiscoveryHandle.h @@ -30,7 +30,8 @@ public: IMPL_EVENT_HANDLER(devicefound); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; private: BluetoothDiscoveryHandle(nsPIDOMWindow* aWindow); diff --git a/dom/bluetooth2/BluetoothGatt.cpp b/dom/bluetooth2/BluetoothGatt.cpp index 1580fa2c81..4ec4ef9a6f 100644 --- a/dom/bluetooth2/BluetoothGatt.cpp +++ b/dom/bluetooth2/BluetoothGatt.cpp @@ -211,7 +211,8 @@ BluetoothGatt::Notify(const BluetoothSignal& aData) } JSObject* -BluetoothGatt::WrapObject(JSContext* aContext) +BluetoothGatt::WrapObject(JSContext* aContext, + JS::Handle aGivenProto) { - return BluetoothGattBinding::Wrap(aContext, this); + return BluetoothGattBinding::Wrap(aContext, this, aGivenProto); } diff --git a/dom/bluetooth2/BluetoothGatt.h b/dom/bluetooth2/BluetoothGatt.h index 682e5a5acb..e8279e82f2 100644 --- a/dom/bluetooth2/BluetoothGatt.h +++ b/dom/bluetooth2/BluetoothGatt.h @@ -27,7 +27,7 @@ class BluetoothSignal; class BluetoothValue; class BluetoothGatt final : public DOMEventTargetHelper - , public BluetoothSignalObserver + , public BluetoothSignalObserver { public: NS_DECL_ISUPPORTS_INHERITED @@ -62,7 +62,8 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; virtual void DisconnectFromOwner() override; BluetoothGatt(nsPIDOMWindow* aOwner, diff --git a/dom/bluetooth2/BluetoothManager.cpp b/dom/bluetooth2/BluetoothManager.cpp index 0a6f0e9c17..fb347a4692 100644 --- a/dom/bluetooth2/BluetoothManager.cpp +++ b/dom/bluetooth2/BluetoothManager.cpp @@ -286,7 +286,7 @@ BluetoothManager::Notify(const BluetoothSignal& aData) } JSObject* -BluetoothManager::WrapObject(JSContext* aCx) +BluetoothManager::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return BluetoothManagerBinding::Wrap(aCx, this); + return BluetoothManagerBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/bluetooth2/BluetoothManager.h b/dom/bluetooth2/BluetoothManager.h index bdf6bbf420..e0ce4e9210 100644 --- a/dom/bluetooth2/BluetoothManager.h +++ b/dom/bluetooth2/BluetoothManager.h @@ -20,8 +20,8 @@ BEGIN_BLUETOOTH_NAMESPACE class BluetoothAdapter; class BluetoothValue; -class BluetoothManager : public DOMEventTargetHelper - , public BluetoothSignalObserver +class BluetoothManager final : public DOMEventTargetHelper + , public BluetoothSignalObserver { public: NS_DECL_ISUPPORTS_INHERITED @@ -63,7 +63,8 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; virtual void DisconnectFromOwner() override; /** diff --git a/dom/bluetooth2/BluetoothPairingHandle.cpp b/dom/bluetooth2/BluetoothPairingHandle.cpp index 3552b70f77..de4f75a80c 100644 --- a/dom/bluetooth2/BluetoothPairingHandle.cpp +++ b/dom/bluetooth2/BluetoothPairingHandle.cpp @@ -121,7 +121,8 @@ BluetoothPairingHandle::SetPairingConfirmation(bool aConfirm, ErrorResult& aRv) } JSObject* -BluetoothPairingHandle::WrapObject(JSContext* aCx) +BluetoothPairingHandle::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) { - return BluetoothPairingHandleBinding::Wrap(aCx, this); + return BluetoothPairingHandleBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/bluetooth2/BluetoothPairingHandle.h b/dom/bluetooth2/BluetoothPairingHandle.h index 7fd533c915..92434c3f03 100644 --- a/dom/bluetooth2/BluetoothPairingHandle.h +++ b/dom/bluetooth2/BluetoothPairingHandle.h @@ -21,8 +21,8 @@ BEGIN_BLUETOOTH_NAMESPACE class BluetoothDevice; -class BluetoothPairingHandle final : public nsISupports, - public nsWrapperCache +class BluetoothPairingHandle final : public nsISupports + , public nsWrapperCache { public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS @@ -39,7 +39,8 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; void GetPasskey(nsString& aPasskey) const { diff --git a/dom/bluetooth2/BluetoothPairingListener.cpp b/dom/bluetooth2/BluetoothPairingListener.cpp index dfb4ebf23e..6db9e6c65d 100644 --- a/dom/bluetooth2/BluetoothPairingListener.cpp +++ b/dom/bluetooth2/BluetoothPairingListener.cpp @@ -117,9 +117,10 @@ BluetoothPairingListener::Notify(const BluetoothSignal& aData) } JSObject* -BluetoothPairingListener::WrapObject(JSContext* aCx) +BluetoothPairingListener::WrapObject(JSContext* aCx, + JS::Handle aGivenProto) { - return BluetoothPairingListenerBinding::Wrap(aCx, this); + return BluetoothPairingListenerBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/bluetooth2/BluetoothPairingListener.h b/dom/bluetooth2/BluetoothPairingListener.h index f074731fc9..75d1513c59 100644 --- a/dom/bluetooth2/BluetoothPairingListener.h +++ b/dom/bluetooth2/BluetoothPairingListener.h @@ -17,7 +17,7 @@ class BluetoothDevice; class BluetoothSignal; class BluetoothPairingListener final : public DOMEventTargetHelper - , public BluetoothSignalObserver + , public BluetoothSignalObserver { public: NS_DECL_ISUPPORTS_INHERITED @@ -36,7 +36,8 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, + JS::Handle aGivenProto) override; virtual void DisconnectFromOwner() override; virtual void EventListenerAdded(nsIAtom* aType) override; diff --git a/dom/bluetooth2/bluedroid/BluetoothGattManager.h b/dom/bluetooth2/bluedroid/BluetoothGattManager.h index bd64904a68..687d67d27f 100644 --- a/dom/bluetooth2/bluedroid/BluetoothGattManager.h +++ b/dom/bluetooth2/bluedroid/BluetoothGattManager.h @@ -16,7 +16,7 @@ BEGIN_BLUETOOTH_NAMESPACE class BluetoothReplyRunnable; class BluetoothGattManager final : public nsIObserver - , public BluetoothGattNotificationHandler + , public BluetoothGattNotificationHandler { public: NS_DECL_ISUPPORTS diff --git a/dom/broadcastchannel/BroadcastChannel.cpp b/dom/broadcastchannel/BroadcastChannel.cpp index 7339e4c3e8..26c8b1a1e8 100644 --- a/dom/broadcastchannel/BroadcastChannel.cpp +++ b/dom/broadcastchannel/BroadcastChannel.cpp @@ -423,9 +423,9 @@ BroadcastChannel::~BroadcastChannel() } JSObject* -BroadcastChannel::WrapObject(JSContext* aCx) +BroadcastChannel::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return BroadcastChannelBinding::Wrap(aCx, this); + return BroadcastChannelBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/broadcastchannel/BroadcastChannel.h b/dom/broadcastchannel/BroadcastChannel.h index 5695729914..6ab086b5cf 100644 --- a/dom/broadcastchannel/BroadcastChannel.h +++ b/dom/broadcastchannel/BroadcastChannel.h @@ -49,7 +49,7 @@ public: static bool IsEnabled(JSContext* aCx, JSObject* aGlobal); virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aChannel, diff --git a/dom/cache/AutoUtils.h b/dom/cache/AutoUtils.h index c7996772cc..b0c2337999 100644 --- a/dom/cache/AutoUtils.h +++ b/dom/cache/AutoUtils.h @@ -25,9 +25,6 @@ class PBackgroundParent; namespace dom { class InternalRequest; -class OwningRequestOrUSVString; -class RequestOrUSVString; -template class Optional; namespace cache { diff --git a/dom/cache/Cache.cpp b/dom/cache/Cache.cpp index 0cc5bca9ea..c108d99f32 100644 --- a/dom/cache/Cache.cpp +++ b/dom/cache/Cache.cpp @@ -78,7 +78,17 @@ using mozilla::dom::workers::WorkerPrivate; NS_IMPL_CYCLE_COLLECTING_ADDREF(mozilla::dom::cache::Cache); NS_IMPL_CYCLE_COLLECTING_RELEASE(mozilla::dom::cache::Cache); -NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Cache, mGlobal, mRequestPromises) +NS_IMPL_CYCLE_COLLECTION_CLASS(mozilla::dom::cache::Cache) +NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(mozilla::dom::cache::Cache) + tmp->DisconnectFromActor(); + NS_IMPL_CYCLE_COLLECTION_UNLINK(mGlobal, mRequestPromises) + NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPER +NS_IMPL_CYCLE_COLLECTION_UNLINK_END +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(mozilla::dom::cache::Cache) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGlobal, mRequestPromises) + NS_IMPL_CYCLE_COLLECTION_TRAVERSE_SCRIPT_OBJECTS +NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END +NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(mozilla::dom::cache::Cache) NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Cache) NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY @@ -375,9 +385,9 @@ Cache::GetParentObject() const } JSObject* -Cache::WrapObject(JSContext* aContext) +Cache::WrapObject(JSContext* aContext, JS::Handle aGivenProto) { - return CacheBinding::Wrap(aContext, this); + return CacheBinding::Wrap(aContext, this, aGivenProto); } void @@ -533,6 +543,12 @@ Cache::RejectedCallback(JSContext* aCx, JS::Handle aValue) } Cache::~Cache() +{ + DisconnectFromActor(); +} + +void +Cache::DisconnectFromActor() { if (mActor) { mActor->StartDestroy(); diff --git a/dom/cache/Cache.h b/dom/cache/Cache.h index 7540535bb2..3f0b5a5783 100644 --- a/dom/cache/Cache.h +++ b/dom/cache/Cache.h @@ -21,10 +21,6 @@ namespace mozilla { class ErrorResult; -namespace ipc { - class IProtocol; -} - namespace dom { class OwningRequestOrUSVString; @@ -39,10 +35,8 @@ namespace cache { class CacheChild; class PCacheRequest; -class PCacheRequestOrVoid; class PCacheResponse; class PCacheResponseOrVoid; -class PCacheStreamControlChild; class Cache MOZ_FINAL : public PromiseNativeHandler , public nsWrapperCache @@ -77,7 +71,7 @@ public: static bool PrefEnabled(JSContext* aCx, JSObject* aObj); nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aContext) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aContext, JS::Handle aGivenProto) MOZ_OVERRIDE; // Called when CacheChild actor is being destroyed void DestroyInternal(CacheChild* aActor); @@ -113,6 +107,9 @@ public: private: ~Cache(); + // Called when we're destroyed or CCed. + void DisconnectFromActor(); + // TODO: Replace with actor-per-request model during refactor (bug 1110485) RequestId AddRequestPromise(Promise* aPromise, ErrorResult& aRv); already_AddRefed RemoveRequestPromise(RequestId aRequestId); diff --git a/dom/cache/CacheParent.h b/dom/cache/CacheParent.h index aa728516d6..e0e82d76fd 100644 --- a/dom/cache/CacheParent.h +++ b/dom/cache/CacheParent.h @@ -19,10 +19,7 @@ namespace mozilla { namespace dom { namespace cache { -class CacheDBConnection; -class CacheStreamControlParent; struct SavedResponse; -struct StreamHolder; class CacheParent MOZ_FINAL : public PCacheParent , public Manager::Listener diff --git a/dom/cache/CacheStorage.cpp b/dom/cache/CacheStorage.cpp index df226f26df..aad55e11a8 100644 --- a/dom/cache/CacheStorage.cpp +++ b/dom/cache/CacheStorage.cpp @@ -314,9 +314,9 @@ CacheStorage::GetParentObject() const } JSObject* -CacheStorage::WrapObject(JSContext* aContext) +CacheStorage::WrapObject(JSContext* aContext, JS::Handle aGivenProto) { - return mozilla::dom::CacheStorageBinding::Wrap(aContext, this); + return mozilla::dom::CacheStorageBinding::Wrap(aContext, this, aGivenProto); } void diff --git a/dom/cache/CacheStorage.h b/dom/cache/CacheStorage.h index 795f4b466d..4aaf9011c6 100644 --- a/dom/cache/CacheStorage.h +++ b/dom/cache/CacheStorage.h @@ -25,7 +25,6 @@ namespace mozilla { class ErrorResult; namespace ipc { - class IProtocol; class PrincipalInfo; } @@ -42,7 +41,6 @@ namespace cache { class CacheChild; class CacheStorageChild; class Feature; -class PCacheRequest; class PCacheResponseOrVoid; class CacheStorage MOZ_FINAL : public nsIIPCBackgroundChildCreateCallback @@ -74,7 +72,7 @@ public: static bool PrefEnabled(JSContext* aCx, JSObject* aObj); nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aContext) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aContext, JS::Handle aGivenProto) MOZ_OVERRIDE; // nsIIPCbackgroundChildCreateCallback methods virtual void ActorCreated(PBackgroundChild* aActor) MOZ_OVERRIDE; diff --git a/dom/cache/Context.h b/dom/cache/Context.h index e53b957e38..edb3da63ba 100644 --- a/dom/cache/Context.h +++ b/dom/cache/Context.h @@ -15,7 +15,6 @@ #include "nsTArray.h" class nsIEventTarget; -class nsIFile; namespace mozilla { namespace dom { diff --git a/dom/cache/DBSchema.h b/dom/cache/DBSchema.h index eeb78a9338..d597467690 100644 --- a/dom/cache/DBSchema.h +++ b/dom/cache/DBSchema.h @@ -25,7 +25,6 @@ class PCacheQueryParams; class PCacheRequest; class PCacheRequestOrVoid; class PCacheResponse; -class PCacheResponseOrVoid; struct SavedRequest; struct SavedResponse; diff --git a/dom/cache/FetchPut.h b/dom/cache/FetchPut.h index 21a87bf029..233ea85c7c 100644 --- a/dom/cache/FetchPut.h +++ b/dom/cache/FetchPut.h @@ -22,17 +22,10 @@ class nsIRunnable; class nsIThread; namespace mozilla { - -class ErrorResult; - namespace dom { -class OwningRequestOrScalarValueString; -class Promise; class Request; -class RequestOrScalarValueString; class Response; -template class Sequence; namespace cache { diff --git a/dom/cache/Manager.h b/dom/cache/Manager.h index 967e84445d..c038f00c18 100644 --- a/dom/cache/Manager.h +++ b/dom/cache/Manager.h @@ -16,7 +16,6 @@ #include "nsTArray.h" class nsIInputStream; -class nsIOutputStream; class nsIThread; namespace mozilla { @@ -29,7 +28,6 @@ class ManagerId; class PCacheQueryParams; class PCacheRequest; class PCacheRequestOrVoid; -class PCacheResponse; struct SavedRequest; struct SavedResponse; class StreamList; diff --git a/dom/cache/SavedTypes.h b/dom/cache/SavedTypes.h index 62f770ff27..ec95c68d72 100644 --- a/dom/cache/SavedTypes.h +++ b/dom/cache/SavedTypes.h @@ -20,11 +20,6 @@ namespace mozilla { namespace dom { namespace cache { -struct StreamHolder -{ - nsCOMPtr mValue; -}; - struct SavedRequest { SavedRequest() : mHasBodyId(false) { mValue.body() = void_t(); } diff --git a/dom/cache/TypeUtils.h b/dom/cache/TypeUtils.h index 90aae52b4d..065c074090 100644 --- a/dom/cache/TypeUtils.h +++ b/dom/cache/TypeUtils.h @@ -25,17 +25,13 @@ class OwningRequestOrUSVString; class Request; class RequestOrUSVString; class Response; -template class Optional; namespace cache { class PCacheQueryParams; -class PCacheReadStream; class PCacheReadStreamOrVoid; class PCacheRequest; -class PCacheRequestOrVoid; class PCacheResponse; -class PCacheStreamControlChild; class TypeUtils { diff --git a/dom/camera/DOMCameraCapabilities.cpp b/dom/camera/DOMCameraCapabilities.cpp index 1469090b00..ff124eac1a 100644 --- a/dom/camera/DOMCameraCapabilities.cpp +++ b/dom/camera/DOMCameraCapabilities.cpp @@ -94,9 +94,9 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CameraRecorderVideoProfile) NS_INTERFACE_MAP_END JSObject* -CameraRecorderVideoProfile::WrapObject(JSContext* aCx) +CameraRecorderVideoProfile::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CameraRecorderVideoProfileBinding::Wrap(aCx, this); + return CameraRecorderVideoProfileBinding::Wrap(aCx, this, aGivenProto); } CameraRecorderVideoProfile::CameraRecorderVideoProfile(nsISupports* aParent, @@ -134,9 +134,9 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CameraRecorderAudioProfile) NS_INTERFACE_MAP_END JSObject* -CameraRecorderAudioProfile::WrapObject(JSContext* aCx) +CameraRecorderAudioProfile::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CameraRecorderAudioProfileBinding::Wrap(aCx, this); + return CameraRecorderAudioProfileBinding::Wrap(aCx, this, aGivenProto); } CameraRecorderAudioProfile::CameraRecorderAudioProfile(nsISupports* aParent, @@ -174,9 +174,9 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CameraRecorderProfile) NS_INTERFACE_MAP_END JSObject* -CameraRecorderProfile::WrapObject(JSContext* aCx) +CameraRecorderProfile::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CameraRecorderProfileBinding::Wrap(aCx, this); + return CameraRecorderProfileBinding::Wrap(aCx, this, aGivenProto); } CameraRecorderProfile::CameraRecorderProfile(nsISupports* aParent, @@ -216,9 +216,9 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(CameraRecorderProfiles) NS_INTERFACE_MAP_END JSObject* -CameraRecorderProfiles::WrapObject(JSContext* aCx) +CameraRecorderProfiles::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CameraRecorderProfilesBinding::Wrap(aCx, this); + return CameraRecorderProfilesBinding::Wrap(aCx, this, aGivenProto); } CameraRecorderProfiles::CameraRecorderProfiles(nsISupports* aParent, @@ -349,9 +349,9 @@ CameraCapabilities::OnHardwareClosed() } JSObject* -CameraCapabilities::WrapObject(JSContext* aCx) +CameraCapabilities::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CameraCapabilitiesBinding::Wrap(aCx, this); + return CameraCapabilitiesBinding::Wrap(aCx, this, aGivenProto); } #define LOG_IF_ERROR(rv, param) \ diff --git a/dom/camera/DOMCameraCapabilities.h b/dom/camera/DOMCameraCapabilities.h index e009b222b0..499caff358 100644 --- a/dom/camera/DOMCameraCapabilities.h +++ b/dom/camera/DOMCameraCapabilities.h @@ -39,7 +39,7 @@ public: explicit CameraRecorderVideoProfile(nsISupports* aParent, const ICameraControl::RecorderProfile::Video& aProfile); nsISupports* GetParentObject() const { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint32_t BitsPerSecond() const { return mBitrate; } uint32_t FramesPerSecond() const { return mFramerate; } @@ -78,7 +78,7 @@ public: explicit CameraRecorderAudioProfile(nsISupports* aParent, const ICameraControl::RecorderProfile::Audio& aProfile); nsISupports* GetParentObject() const { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint32_t BitsPerSecond() const { return mBitrate; } uint32_t SamplesPerSecond() const { return mSamplerate; } @@ -112,7 +112,7 @@ public: explicit CameraRecorderProfile(nsISupports* aParent, const ICameraControl::RecorderProfile& aProfile); nsISupports* GetParentObject() const { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void GetMimeType(nsAString& aMimeType) const { aMimeType = mMimeType; } @@ -158,7 +158,7 @@ public: explicit CameraRecorderProfiles(nsISupports* aParent, ICameraControl* aCameraControl); nsISupports* GetParentObject() const { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; CameraRecorderProfile* NamedGetter(const nsAString& aName, bool& aFound); bool NameIsEnumerable(const nsAString& aName); @@ -200,7 +200,7 @@ public: nsPIDOMWindow* GetParentObject() const { return mWindow; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void GetPreviewSizes(nsTArray& aRetVal); void GetPictureSizes(nsTArray& aRetVal); diff --git a/dom/camera/DOMCameraControl.cpp b/dom/camera/DOMCameraControl.cpp index e5ed9cc947..f07c29a3f0 100644 --- a/dom/camera/DOMCameraControl.cpp +++ b/dom/camera/DOMCameraControl.cpp @@ -309,9 +309,9 @@ nsDOMCameraControl::~nsDOMCameraControl() } JSObject* -nsDOMCameraControl::WrapObject(JSContext* aCx) +nsDOMCameraControl::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CameraControlBinding::Wrap(aCx, this); + return CameraControlBinding::Wrap(aCx, this, aGivenProto); } bool diff --git a/dom/camera/DOMCameraControl.h b/dom/camera/DOMCameraControl.h index 38178128fd..f850aacf4f 100644 --- a/dom/camera/DOMCameraControl.h +++ b/dom/camera/DOMCameraControl.h @@ -123,7 +123,7 @@ public: already_AddRefed ReleaseHardware(ErrorResult& aRv); void ResumeContinuousFocus(ErrorResult& aRv); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; operator nsISupports*() { return static_cast(this); } diff --git a/dom/camera/DOMCameraDetectedFace.cpp b/dom/camera/DOMCameraDetectedFace.cpp index 72efa1744f..81b4847b97 100644 --- a/dom/camera/DOMCameraDetectedFace.cpp +++ b/dom/camera/DOMCameraDetectedFace.cpp @@ -26,9 +26,9 @@ DOMCameraDetectedFace::HasSupport(JSContext* aCx, JSObject* aGlobal) } JSObject* -DOMCameraDetectedFace::WrapObject(JSContext* aCx) +DOMCameraDetectedFace::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CameraDetectedFaceBinding::Wrap(aCx, this); + return CameraDetectedFaceBinding::Wrap(aCx, this, aGivenProto); } DOMCameraDetectedFace::DOMCameraDetectedFace(nsISupports* aParent, diff --git a/dom/camera/DOMCameraDetectedFace.h b/dom/camera/DOMCameraDetectedFace.h index 1591b482a0..92158e98c5 100644 --- a/dom/camera/DOMCameraDetectedFace.h +++ b/dom/camera/DOMCameraDetectedFace.h @@ -51,7 +51,7 @@ public: return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; protected: virtual ~DOMCameraDetectedFace() { } diff --git a/dom/camera/DOMCameraManager.cpp b/dom/camera/DOMCameraManager.cpp index 6b0dafe04f..75c28d7622 100644 --- a/dom/camera/DOMCameraManager.cpp +++ b/dom/camera/DOMCameraManager.cpp @@ -432,7 +432,7 @@ nsDOMCameraManager::IsWindowStillActive(uint64_t aWindowId) } JSObject* -nsDOMCameraManager::WrapObject(JSContext* aCx) +nsDOMCameraManager::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CameraManagerBinding::Wrap(aCx, this); + return CameraManagerBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/camera/DOMCameraManager.h b/dom/camera/DOMCameraManager.h index ea8d9af4ea..f9e37c1dcb 100644 --- a/dom/camera/DOMCameraManager.h +++ b/dom/camera/DOMCameraManager.h @@ -74,7 +74,7 @@ public: void GetListOfCameras(nsTArray& aList, mozilla::ErrorResult& aRv); nsPIDOMWindow* GetParentObject() const { return mWindow; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; #ifdef MOZ_WIDGET_GONK static void PreinitCameraHardware(); diff --git a/dom/canvas/CanvasGradient.h b/dom/canvas/CanvasGradient.h index 44e34d00c3..edf219a8d2 100644 --- a/dom/canvas/CanvasGradient.h +++ b/dom/canvas/CanvasGradient.h @@ -51,9 +51,9 @@ public: // WebIDL void AddColorStop(float offset, const nsAString& colorstr, ErrorResult& rv); - JSObject* WrapObject(JSContext* aCx) override + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { - return CanvasGradientBinding::Wrap(aCx, this); + return CanvasGradientBinding::Wrap(aCx, this, aGivenProto); } CanvasRenderingContext2D* GetParentObject() diff --git a/dom/canvas/CanvasPattern.h b/dom/canvas/CanvasPattern.h index f38aa0c100..64d26168c1 100644 --- a/dom/canvas/CanvasPattern.h +++ b/dom/canvas/CanvasPattern.h @@ -52,9 +52,9 @@ public: { } - JSObject* WrapObject(JSContext* aCx) override + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { - return CanvasPatternBinding::Wrap(aCx, this); + return CanvasPatternBinding::Wrap(aCx, this, aGivenProto); } CanvasRenderingContext2D* GetParentObject() diff --git a/dom/canvas/CanvasRenderingContext2D.cpp b/dom/canvas/CanvasRenderingContext2D.cpp index 3bf86f468f..7a1539d5f4 100644 --- a/dom/canvas/CanvasRenderingContext2D.cpp +++ b/dom/canvas/CanvasRenderingContext2D.cpp @@ -980,9 +980,9 @@ CanvasRenderingContext2D::~CanvasRenderingContext2D() } JSObject* -CanvasRenderingContext2D::WrapObject(JSContext *cx) +CanvasRenderingContext2D::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return CanvasRenderingContext2DBinding::Wrap(cx, this); + return CanvasRenderingContext2DBinding::Wrap(cx, this, aGivenProto); } bool @@ -5534,9 +5534,9 @@ CanvasPath::CanvasPath(nsISupports* aParent, already_AddRefed aPath } JSObject* -CanvasPath::WrapObject(JSContext* aCx) +CanvasPath::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return Path2DBinding::Wrap(aCx, this); + return Path2DBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed diff --git a/dom/canvas/CanvasRenderingContext2D.h b/dom/canvas/CanvasRenderingContext2D.h index a36dd86d2a..3b05d0468f 100644 --- a/dom/canvas/CanvasRenderingContext2D.h +++ b/dom/canvas/CanvasRenderingContext2D.h @@ -58,7 +58,7 @@ public: nsCOMPtr GetParentObject() { return mParent; } - JSObject* WrapObject(JSContext* aCx); + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto); static already_AddRefed Constructor(const GlobalObject& aGlobal, ErrorResult& rv); @@ -134,7 +134,7 @@ typedef HTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement public: CanvasRenderingContext2D(); - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; HTMLCanvasElement* GetCanvas() const { diff --git a/dom/canvas/ImageData.cpp b/dom/canvas/ImageData.cpp index 18961ef23f..4a21b80138 100644 --- a/dom/canvas/ImageData.cpp +++ b/dom/canvas/ImageData.cpp @@ -109,9 +109,9 @@ ImageData::DropData() } bool -ImageData::WrapObject(JSContext* aCx, JS::MutableHandle aReflector) +ImageData::WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return ImageDataBinding::Wrap(aCx, this, aReflector); + return ImageDataBinding::Wrap(aCx, this, aGivenProto, aReflector); } } // namespace dom diff --git a/dom/canvas/ImageData.h b/dom/canvas/ImageData.h index c2fd40f9c7..465662cca3 100644 --- a/dom/canvas/ImageData.h +++ b/dom/canvas/ImageData.h @@ -73,7 +73,7 @@ public: return mData; } - bool WrapObject(JSContext* aCx, JS::MutableHandle aReflector); + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); private: void HoldData(); diff --git a/dom/canvas/TextMetrics.h b/dom/canvas/TextMetrics.h index d21ff841d3..ca38b7a4ee 100644 --- a/dom/canvas/TextMetrics.h +++ b/dom/canvas/TextMetrics.h @@ -30,9 +30,9 @@ public: return width; } - bool WrapObject(JSContext* aCx, JS::MutableHandle aReflector) + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return TextMetricsBinding::Wrap(aCx, this, aReflector); + return TextMetricsBinding::Wrap(aCx, this, aGivenProto, aReflector); } private: diff --git a/dom/canvas/WebGL1Context.cpp b/dom/canvas/WebGL1Context.cpp index 87b3bce798..5dec3638e4 100644 --- a/dom/canvas/WebGL1Context.cpp +++ b/dom/canvas/WebGL1Context.cpp @@ -26,9 +26,9 @@ WebGL1Context::~WebGL1Context() } JSObject* -WebGL1Context::WrapObject(JSContext* cx) +WebGL1Context::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return dom::WebGLRenderingContextBinding::Wrap(cx, this); + return dom::WebGLRenderingContextBinding::Wrap(cx, this, aGivenProto); } } // namespace mozilla diff --git a/dom/canvas/WebGL1Context.h b/dom/canvas/WebGL1Context.h index d49bfbfabd..32084c6ad2 100644 --- a/dom/canvas/WebGL1Context.h +++ b/dom/canvas/WebGL1Context.h @@ -27,7 +27,7 @@ public: } // nsWrapperCache - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; private: virtual bool ValidateAttribPointerType(bool integerMode, GLenum type, GLsizei* alignment, const char* info) override; diff --git a/dom/canvas/WebGL2Context.cpp b/dom/canvas/WebGL2Context.cpp index 259dd4e1f6..38d171d176 100644 --- a/dom/canvas/WebGL2Context.cpp +++ b/dom/canvas/WebGL2Context.cpp @@ -40,9 +40,9 @@ WebGL2Context::Create() } JSObject* -WebGL2Context::WrapObject(JSContext* cx) +WebGL2Context::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return dom::WebGL2RenderingContextBinding::Wrap(cx, this); + return dom::WebGL2RenderingContextBinding::Wrap(cx, this, aGivenProto); } //////////////////////////////////////////////////////////////////////////////// diff --git a/dom/canvas/WebGL2Context.h b/dom/canvas/WebGL2Context.h index c87cb18ca8..935a11826e 100644 --- a/dom/canvas/WebGL2Context.h +++ b/dom/canvas/WebGL2Context.h @@ -37,7 +37,7 @@ public: // ------------------------------------------------------------------------- // IMPLEMENT nsWrapperCache - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; // ------------------------------------------------------------------------- // Buffer objects - WebGL2ContextBuffers.cpp diff --git a/dom/canvas/WebGLActiveInfo.cpp b/dom/canvas/WebGLActiveInfo.cpp index ad0b9b2493..e0a1e06b8f 100644 --- a/dom/canvas/WebGLActiveInfo.cpp +++ b/dom/canvas/WebGLActiveInfo.cpp @@ -87,9 +87,9 @@ WebGLActiveInfo::WebGLActiveInfo(WebGLContext* webgl, GLint elemCount, GLenum el //////////////////////////////////////////////////////////////////////////////// JSObject* -WebGLActiveInfo::WrapObject(JSContext* js) +WebGLActiveInfo::WrapObject(JSContext* js, JS::Handle aGivenProto) { - return dom::WebGLActiveInfoBinding::Wrap(js, this); + return dom::WebGLActiveInfoBinding::Wrap(js, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLActiveInfo) diff --git a/dom/canvas/WebGLActiveInfo.h b/dom/canvas/WebGLActiveInfo.h index 3f9bffbcc3..fd1295f42c 100644 --- a/dom/canvas/WebGLActiveInfo.h +++ b/dom/canvas/WebGLActiveInfo.h @@ -25,7 +25,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLActiveInfo) NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLActiveInfo) - virtual JSObject* WrapObject(JSContext* js) override; + virtual JSObject* WrapObject(JSContext* js, JS::Handle aGivenProto) override; WebGLContext* GetParentObject() const { return mWebGL; diff --git a/dom/canvas/WebGLBuffer.cpp b/dom/canvas/WebGLBuffer.cpp index 990a58d062..d6909bd2a1 100644 --- a/dom/canvas/WebGLBuffer.cpp +++ b/dom/canvas/WebGLBuffer.cpp @@ -82,9 +82,9 @@ WebGLBuffer::IsElementArrayUsedWithMultipleTypes() const } JSObject* -WebGLBuffer::WrapObject(JSContext* cx) +WebGLBuffer::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return dom::WebGLBufferBinding::Wrap(cx, this); + return dom::WebGLBufferBinding::Wrap(cx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLBuffer) diff --git a/dom/canvas/WebGLBuffer.h b/dom/canvas/WebGLBuffer.h index fa176b216b..76b5bfc9e6 100644 --- a/dom/canvas/WebGLBuffer.h +++ b/dom/canvas/WebGLBuffer.h @@ -50,7 +50,7 @@ public: return Context(); } - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLBuffer) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLBuffer) diff --git a/dom/canvas/WebGLContext.h b/dom/canvas/WebGLContext.h index d557f9cdcd..7608027f99 100644 --- a/dom/canvas/WebGLContext.h +++ b/dom/canvas/WebGLContext.h @@ -197,7 +197,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(WebGLContext, nsIDOMWebGLRenderingContext) - virtual JSObject* WrapObject(JSContext* aCx) override = 0; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override = 0; NS_DECL_NSIDOMWEBGLRENDERINGCONTEXT diff --git a/dom/canvas/WebGLExtensions.h b/dom/canvas/WebGLExtensions.h index 6ac50ef8a3..b41f0186d1 100644 --- a/dom/canvas/WebGLExtensions.h +++ b/dom/canvas/WebGLExtensions.h @@ -41,12 +41,12 @@ protected: }; #define DECL_WEBGL_EXTENSION_GOOP \ - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; #define IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionType) \ JSObject* \ - WebGLExtensionType::WrapObject(JSContext* cx) { \ - return dom::WebGLExtensionType##Binding::Wrap(cx, this); \ + WebGLExtensionType::WrapObject(JSContext* cx, JS::Handle aGivenProto) { \ + return dom::WebGLExtensionType##Binding::Wrap(cx, this, aGivenProto); \ } class WebGLExtensionCompressedTextureATC diff --git a/dom/canvas/WebGLFramebuffer.cpp b/dom/canvas/WebGLFramebuffer.cpp index b80a6b3de7..b406ca248a 100644 --- a/dom/canvas/WebGLFramebuffer.cpp +++ b/dom/canvas/WebGLFramebuffer.cpp @@ -16,9 +16,9 @@ namespace mozilla { JSObject* -WebGLFramebuffer::WrapObject(JSContext* cx) +WebGLFramebuffer::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return dom::WebGLFramebufferBinding::Wrap(cx, this); + return dom::WebGLFramebufferBinding::Wrap(cx, this, aGivenProto); } WebGLFramebuffer::WebGLFramebuffer(WebGLContext* webgl, GLuint fbo) diff --git a/dom/canvas/WebGLFramebuffer.h b/dom/canvas/WebGLFramebuffer.h index fe71cb2eb9..96e8ff7ed3 100644 --- a/dom/canvas/WebGLFramebuffer.h +++ b/dom/canvas/WebGLFramebuffer.h @@ -157,7 +157,7 @@ public: void FinalizeAttachments() const; - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLFramebuffer) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLFramebuffer) diff --git a/dom/canvas/WebGLProgram.cpp b/dom/canvas/WebGLProgram.cpp index 908fcb56bc..577618c8f9 100644 --- a/dom/canvas/WebGLProgram.cpp +++ b/dom/canvas/WebGLProgram.cpp @@ -718,9 +718,9 @@ WebGLProgram::FindUniformByMappedName(const nsACString& mappedName, //////////////////////////////////////////////////////////////////////////////// JSObject* -WebGLProgram::WrapObject(JSContext* js) +WebGLProgram::WrapObject(JSContext* js, JS::Handle aGivenProto) { - return dom::WebGLProgramBinding::Wrap(js, this); + return dom::WebGLProgramBinding::Wrap(js, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(WebGLProgram, mVertShader, mFragShader) diff --git a/dom/canvas/WebGLProgram.h b/dom/canvas/WebGLProgram.h index fa83251d8c..8a6c0a843c 100644 --- a/dom/canvas/WebGLProgram.h +++ b/dom/canvas/WebGLProgram.h @@ -139,7 +139,7 @@ public: return Context(); } - virtual JSObject* WrapObject(JSContext* js) override; + virtual JSObject* WrapObject(JSContext* js, JS::Handle aGivenProto) override; private: ~WebGLProgram() { diff --git a/dom/canvas/WebGLQuery.cpp b/dom/canvas/WebGLQuery.cpp index 74e3e0e6a7..afa2940d10 100644 --- a/dom/canvas/WebGLQuery.cpp +++ b/dom/canvas/WebGLQuery.cpp @@ -13,9 +13,9 @@ namespace mozilla { JSObject* -WebGLQuery::WrapObject(JSContext* cx) +WebGLQuery::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return dom::WebGLQueryBinding::Wrap(cx, this); + return dom::WebGLQueryBinding::Wrap(cx, this, aGivenProto); } WebGLQuery::WebGLQuery(WebGLContext* webgl) diff --git a/dom/canvas/WebGLQuery.h b/dom/canvas/WebGLQuery.h index 48a8779528..053e2f4d6a 100644 --- a/dom/canvas/WebGLQuery.h +++ b/dom/canvas/WebGLQuery.h @@ -36,7 +36,7 @@ public: } // NS - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLQuery) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLQuery) diff --git a/dom/canvas/WebGLRenderbuffer.cpp b/dom/canvas/WebGLRenderbuffer.cpp index 6aa947f267..52313c68ba 100644 --- a/dom/canvas/WebGLRenderbuffer.cpp +++ b/dom/canvas/WebGLRenderbuffer.cpp @@ -41,9 +41,9 @@ NeedsDepthStencilEmu(gl::GLContext* gl, GLenum internalFormat) } JSObject* -WebGLRenderbuffer::WrapObject(JSContext* cx) +WebGLRenderbuffer::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return dom::WebGLRenderbufferBinding::Wrap(cx, this); + return dom::WebGLRenderbufferBinding::Wrap(cx, this, aGivenProto); } WebGLRenderbuffer::WebGLRenderbuffer(WebGLContext* webgl) diff --git a/dom/canvas/WebGLRenderbuffer.h b/dom/canvas/WebGLRenderbuffer.h index d3320a46e7..e10dd77437 100644 --- a/dom/canvas/WebGLRenderbuffer.h +++ b/dom/canvas/WebGLRenderbuffer.h @@ -64,7 +64,7 @@ public: // Only handles a subset of `pname`s. GLint GetRenderbufferParameter(RBTarget target, RBParam pname) const; - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLRenderbuffer) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLRenderbuffer) diff --git a/dom/canvas/WebGLSampler.cpp b/dom/canvas/WebGLSampler.cpp index e2bfa5bf58..8d8cc7be50 100644 --- a/dom/canvas/WebGLSampler.cpp +++ b/dom/canvas/WebGLSampler.cpp @@ -39,9 +39,9 @@ WebGLSampler::GetParentObject() const } JSObject* -WebGLSampler::WrapObject(JSContext* cx) +WebGLSampler::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return dom::WebGLSamplerBinding::Wrap(cx, this); + return dom::WebGLSamplerBinding::Wrap(cx, this, aGivenProto); } diff --git a/dom/canvas/WebGLSampler.h b/dom/canvas/WebGLSampler.h index 5b1e90ee02..ba2ef77c9b 100644 --- a/dom/canvas/WebGLSampler.h +++ b/dom/canvas/WebGLSampler.h @@ -28,7 +28,7 @@ public: void Delete(); WebGLContext* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; private: diff --git a/dom/canvas/WebGLShader.cpp b/dom/canvas/WebGLShader.cpp index bab415777b..fe3cb6eaea 100644 --- a/dom/canvas/WebGLShader.cpp +++ b/dom/canvas/WebGLShader.cpp @@ -359,9 +359,9 @@ WebGLShader::FindUniformByMappedName(const nsACString& mappedName, // Boilerplate JSObject* -WebGLShader::WrapObject(JSContext* js) +WebGLShader::WrapObject(JSContext* js, JS::Handle aGivenProto) { - return dom::WebGLShaderBinding::Wrap(js, this); + return dom::WebGLShaderBinding::Wrap(js, this, aGivenProto); } size_t diff --git a/dom/canvas/WebGLShader.h b/dom/canvas/WebGLShader.h index 2c80b16ad2..c3080978a3 100644 --- a/dom/canvas/WebGLShader.h +++ b/dom/canvas/WebGLShader.h @@ -63,7 +63,7 @@ public: WebGLContext* GetParentObject() const { return Context(); } - virtual JSObject* WrapObject(JSContext* js) override; + virtual JSObject* WrapObject(JSContext* js, JS::Handle aGivenProto) override; NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLShader) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLShader) diff --git a/dom/canvas/WebGLShaderPrecisionFormat.cpp b/dom/canvas/WebGLShaderPrecisionFormat.cpp index 0da4ae9b84..181964c3cb 100644 --- a/dom/canvas/WebGLShaderPrecisionFormat.cpp +++ b/dom/canvas/WebGLShaderPrecisionFormat.cpp @@ -12,9 +12,10 @@ namespace mozilla { bool WebGLShaderPrecisionFormat::WrapObject(JSContext* aCx, + JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return dom::WebGLShaderPrecisionFormatBinding::Wrap(aCx, this, aReflector); + return dom::WebGLShaderPrecisionFormatBinding::Wrap(aCx, this, aGivenProto, aReflector); } } // namespace mozilla diff --git a/dom/canvas/WebGLShaderPrecisionFormat.h b/dom/canvas/WebGLShaderPrecisionFormat.h index 5fe88c6480..c7147f4a86 100644 --- a/dom/canvas/WebGLShaderPrecisionFormat.h +++ b/dom/canvas/WebGLShaderPrecisionFormat.h @@ -24,7 +24,7 @@ public: , mPrecision(precision) { } - bool WrapObject(JSContext* aCx, JS::MutableHandle aReflector); + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); // WebIDL WebGLShaderPrecisionFormat API GLint RangeMin() const { diff --git a/dom/canvas/WebGLSync.cpp b/dom/canvas/WebGLSync.cpp index 9109bf977f..3701db3888 100644 --- a/dom/canvas/WebGLSync.cpp +++ b/dom/canvas/WebGLSync.cpp @@ -34,9 +34,9 @@ WebGLSync::GetParentObject() const // ------------------------------------------------------------------------- // IMPLEMENT NS JSObject* -WebGLSync::WrapObject(JSContext* cx) +WebGLSync::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return dom::WebGLSyncBinding::Wrap(cx, this); + return dom::WebGLSyncBinding::Wrap(cx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLSync) diff --git a/dom/canvas/WebGLSync.h b/dom/canvas/WebGLSync.h index 89fe9f43d7..6abc1a19d7 100644 --- a/dom/canvas/WebGLSync.h +++ b/dom/canvas/WebGLSync.h @@ -26,7 +26,7 @@ public: void Delete(); WebGLContext* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLSync) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLSync) diff --git a/dom/canvas/WebGLTexture.cpp b/dom/canvas/WebGLTexture.cpp index d6a6ccd436..984bd72c53 100644 --- a/dom/canvas/WebGLTexture.cpp +++ b/dom/canvas/WebGLTexture.cpp @@ -18,8 +18,8 @@ namespace mozilla { JSObject* -WebGLTexture::WrapObject(JSContext* cx) { - return dom::WebGLTextureBinding::Wrap(cx, this); +WebGLTexture::WrapObject(JSContext* cx, JS::Handle aGivenProto) { + return dom::WebGLTextureBinding::Wrap(cx, this, aGivenProto); } WebGLTexture::WebGLTexture(WebGLContext* webgl, GLuint tex) diff --git a/dom/canvas/WebGLTexture.h b/dom/canvas/WebGLTexture.h index 423f0dc27d..b253e5058d 100644 --- a/dom/canvas/WebGLTexture.h +++ b/dom/canvas/WebGLTexture.h @@ -46,7 +46,7 @@ public: return Context(); } - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTexture) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTexture) diff --git a/dom/canvas/WebGLTransformFeedback.cpp b/dom/canvas/WebGLTransformFeedback.cpp index 2e3625abe8..b4dc42054a 100644 --- a/dom/canvas/WebGLTransformFeedback.cpp +++ b/dom/canvas/WebGLTransformFeedback.cpp @@ -45,9 +45,9 @@ WebGLTransformFeedback::GetParentObject() const } JSObject* -WebGLTransformFeedback::WrapObject(JSContext* cx) +WebGLTransformFeedback::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return dom::WebGLTransformFeedbackBinding::Wrap(cx, this); + return dom::WebGLTransformFeedbackBinding::Wrap(cx, this, aGivenProto); } diff --git a/dom/canvas/WebGLTransformFeedback.h b/dom/canvas/WebGLTransformFeedback.h index f3c41206e1..09e7f6e301 100644 --- a/dom/canvas/WebGLTransformFeedback.h +++ b/dom/canvas/WebGLTransformFeedback.h @@ -28,7 +28,7 @@ public: void Delete(); WebGLContext* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLTransformFeedback) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLTransformFeedback) diff --git a/dom/canvas/WebGLUniformLocation.cpp b/dom/canvas/WebGLUniformLocation.cpp index 6392c6d3cd..95cd5b3a2b 100644 --- a/dom/canvas/WebGLUniformLocation.cpp +++ b/dom/canvas/WebGLUniformLocation.cpp @@ -265,9 +265,9 @@ WebGLUniformLocation::GetUniform(JSContext* js, WebGLContext* webgl) const //////////////////////////////////////////////////////////////////////////////// JSObject* -WebGLUniformLocation::WrapObject(JSContext* js) +WebGLUniformLocation::WrapObject(JSContext* js, JS::Handle aGivenProto) { - return dom::WebGLUniformLocationBinding::Wrap(js, this); + return dom::WebGLUniformLocationBinding::Wrap(js, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLUniformLocation) diff --git a/dom/canvas/WebGLUniformLocation.h b/dom/canvas/WebGLUniformLocation.h index 6e9c6a8e7b..134d19a5c8 100644 --- a/dom/canvas/WebGLUniformLocation.h +++ b/dom/canvas/WebGLUniformLocation.h @@ -32,7 +32,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLUniformLocation) NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLUniformLocation) - virtual JSObject* WrapObject(JSContext* js) override; + virtual JSObject* WrapObject(JSContext* js, JS::Handle aGivenProto) override; WebGLContext* GetParentObject() const { return mContext; diff --git a/dom/canvas/WebGLVertexArray.cpp b/dom/canvas/WebGLVertexArray.cpp index 3b756cde63..84e7dc9d8f 100644 --- a/dom/canvas/WebGLVertexArray.cpp +++ b/dom/canvas/WebGLVertexArray.cpp @@ -15,9 +15,9 @@ namespace mozilla { JSObject* -WebGLVertexArray::WrapObject(JSContext* cx) +WebGLVertexArray::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return dom::WebGLVertexArrayBinding::Wrap(cx, this); + return dom::WebGLVertexArrayBinding::Wrap(cx, this, aGivenProto); } WebGLVertexArray::WebGLVertexArray(WebGLContext* webgl) diff --git a/dom/canvas/WebGLVertexArray.h b/dom/canvas/WebGLVertexArray.h index 53e5a30d19..10c14a99c6 100644 --- a/dom/canvas/WebGLVertexArray.h +++ b/dom/canvas/WebGLVertexArray.h @@ -54,7 +54,7 @@ public: return Context(); } - virtual JSObject* WrapObject(JSContext* cx) override; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) override; NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(WebGLVertexArray) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(WebGLVertexArray) diff --git a/dom/cellbroadcast/CellBroadcast.cpp b/dom/cellbroadcast/CellBroadcast.cpp index cf3e3aba9c..b884398aa8 100644 --- a/dom/cellbroadcast/CellBroadcast.cpp +++ b/dom/cellbroadcast/CellBroadcast.cpp @@ -102,9 +102,9 @@ CellBroadcast::~CellBroadcast() NS_IMPL_ISUPPORTS_INHERITED0(CellBroadcast, DOMEventTargetHelper) JSObject* -CellBroadcast::WrapObject(JSContext* aCx) +CellBroadcast::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MozCellBroadcastBinding::Wrap(aCx, this); + return MozCellBroadcastBinding::Wrap(aCx, this, aGivenProto); } // Forwarded nsICellBroadcastListener methods diff --git a/dom/cellbroadcast/CellBroadcast.h b/dom/cellbroadcast/CellBroadcast.h index 729a171310..d553921196 100644 --- a/dom/cellbroadcast/CellBroadcast.h +++ b/dom/cellbroadcast/CellBroadcast.h @@ -49,7 +49,7 @@ public: GetParentObject() const { return GetOwner(); } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; IMPL_EVENT_HANDLER(received) diff --git a/dom/cellbroadcast/CellBroadcastMessage.cpp b/dom/cellbroadcast/CellBroadcastMessage.cpp index 1f46a2b9b4..8161ba0930 100644 --- a/dom/cellbroadcast/CellBroadcastMessage.cpp +++ b/dom/cellbroadcast/CellBroadcastMessage.cpp @@ -102,9 +102,9 @@ CellBroadcastMessage::CellBroadcastMessage(nsPIDOMWindow* aWindow, } JSObject* -CellBroadcastMessage::WrapObject(JSContext* aCx) +CellBroadcastMessage::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MozCellBroadcastMessageBinding::Wrap(aCx, this); + return MozCellBroadcastMessageBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed @@ -144,9 +144,9 @@ CellBroadcastEtwsInfo::CellBroadcastEtwsInfo(nsPIDOMWindow* aWindow, } JSObject* -CellBroadcastEtwsInfo::WrapObject(JSContext* aCx) +CellBroadcastEtwsInfo::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MozCellBroadcastEtwsInfoBinding::Wrap(aCx, this); + return MozCellBroadcastEtwsInfoBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/cellbroadcast/CellBroadcastMessage.h b/dom/cellbroadcast/CellBroadcastMessage.h index b367e55c88..73f94786f7 100644 --- a/dom/cellbroadcast/CellBroadcastMessage.h +++ b/dom/cellbroadcast/CellBroadcastMessage.h @@ -44,7 +44,7 @@ public: nsPIDOMWindow* GetParentObject() const { return mWindow; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // WebIDL interface @@ -106,7 +106,7 @@ public: nsPIDOMWindow* GetParentObject() const { return mWindow; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // WebIDL interface diff --git a/dom/crypto/CryptoKey.cpp b/dom/crypto/CryptoKey.cpp index fa66f42b9d..940ec94798 100644 --- a/dom/crypto/CryptoKey.cpp +++ b/dom/crypto/CryptoKey.cpp @@ -83,9 +83,9 @@ CryptoKey::~CryptoKey() } JSObject* -CryptoKey::WrapObject(JSContext* aCx) +CryptoKey::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CryptoKeyBinding::Wrap(aCx, this); + return CryptoKeyBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/crypto/CryptoKey.h b/dom/crypto/CryptoKey.h index 3026036d7e..5c091fe339 100644 --- a/dom/crypto/CryptoKey.h +++ b/dom/crypto/CryptoKey.h @@ -98,7 +98,7 @@ public: return mGlobal; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; // WebIDL methods void GetType(nsString& aRetVal) const; diff --git a/dom/datastore/DataStore.cpp b/dom/datastore/DataStore.cpp index f12685a429..bdf6dbed64 100644 --- a/dom/datastore/DataStore.cpp +++ b/dom/datastore/DataStore.cpp @@ -47,9 +47,9 @@ DataStore::Constructor(GlobalObject& aGlobal, ErrorResult& aRv) } JSObject* -DataStore::WrapObject(JSContext* aCx) +DataStore::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DataStoreBinding::Wrap(aCx, this); + return DataStoreBinding::Wrap(aCx, this, aGivenProto); } /*static*/ bool diff --git a/dom/datastore/DataStore.h b/dom/datastore/DataStore.h index 8a2a80e164..c675195e76 100644 --- a/dom/datastore/DataStore.h +++ b/dom/datastore/DataStore.h @@ -33,7 +33,7 @@ public: static already_AddRefed Constructor(GlobalObject& aGlobal, ErrorResult& aRv); - virtual JSObject* WrapObject(JSContext *aCx) override; + virtual JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) override; static bool EnabledForScope(JSContext* aCx, JS::Handle aObj); diff --git a/dom/datastore/DataStoreCursor.cpp b/dom/datastore/DataStoreCursor.cpp index 7e5937a090..56296fcaf1 100644 --- a/dom/datastore/DataStoreCursor.cpp +++ b/dom/datastore/DataStoreCursor.cpp @@ -31,9 +31,10 @@ DataStoreCursor::Constructor(GlobalObject& aGlobal, ErrorResult& aRv) bool DataStoreCursor::WrapObject(JSContext* aCx, + JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return DataStoreCursorBinding::Wrap(aCx, this, aReflector); + return DataStoreCursorBinding::Wrap(aCx, this, aGivenProto, aReflector); } already_AddRefed diff --git a/dom/datastore/DataStoreCursor.h b/dom/datastore/DataStoreCursor.h index e497fa67df..c8a3243b2d 100644 --- a/dom/datastore/DataStoreCursor.h +++ b/dom/datastore/DataStoreCursor.h @@ -33,7 +33,7 @@ public: static already_AddRefed Constructor(GlobalObject& aGlobal, ErrorResult& aRv); - bool WrapObject(JSContext *aCx, JS::MutableHandle aReflector); + bool WrapObject(JSContext *aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); // WebIDL (public APIs) diff --git a/dom/datastore/DataStoreService.cpp b/dom/datastore/DataStoreService.cpp index a7f89b88e5..8242368b83 100644 --- a/dom/datastore/DataStoreService.cpp +++ b/dom/datastore/DataStoreService.cpp @@ -1020,7 +1020,7 @@ DataStoreService::GetDataStoresResolve(nsPIDOMWindow* aWindow, return; } - JS::Rooted obj(cx, exposedStore->WrapObject(cx)); + JS::Rooted obj(cx, exposedStore->WrapObject(cx, JS::NullPtr())); MOZ_ASSERT(obj); JS::Rooted exposedObject(cx, JS::ObjectValue(*obj)); diff --git a/dom/devicestorage/DeviceStorage.h b/dom/devicestorage/DeviceStorage.h index 6671bd94f9..d67190130b 100644 --- a/dom/devicestorage/DeviceStorage.h +++ b/dom/devicestorage/DeviceStorage.h @@ -215,7 +215,7 @@ public: return GetOwner(); } virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; IMPL_EVENT_HANDLER(change) diff --git a/dom/devicestorage/DeviceStorageRequestChild.cpp b/dom/devicestorage/DeviceStorageRequestChild.cpp index b7c42a4b26..de6ef61f3a 100644 --- a/dom/devicestorage/DeviceStorageRequestChild.cpp +++ b/dom/devicestorage/DeviceStorageRequestChild.cpp @@ -108,7 +108,7 @@ DeviceStorageRequestChild:: AutoJSContext cx; - JS::Rooted obj(cx, blob->WrapObject(cx)); + JS::Rooted obj(cx, blob->WrapObject(cx, JS::NullPtr())); MOZ_ASSERT(obj); JS::Rooted result(cx, JS::ObjectValue(*obj)); diff --git a/dom/devicestorage/nsDeviceStorage.cpp b/dom/devicestorage/nsDeviceStorage.cpp index 295620397c..d7daae8c20 100644 --- a/dom/devicestorage/nsDeviceStorage.cpp +++ b/dom/devicestorage/nsDeviceStorage.cpp @@ -3344,9 +3344,9 @@ nsDOMDeviceStorage::nsDOMDeviceStorage(nsPIDOMWindow* aWindow) } /* virtual */ JSObject* -nsDOMDeviceStorage::WrapObject(JSContext* aCx) +nsDOMDeviceStorage::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DeviceStorageBinding::Wrap(aCx, this); + return DeviceStorageBinding::Wrap(aCx, this, aGivenProto); } nsresult diff --git a/dom/encoding/TextDecoder.h b/dom/encoding/TextDecoder.h index e8739dc768..055d8c7896 100644 --- a/dom/encoding/TextDecoder.h +++ b/dom/encoding/TextDecoder.h @@ -49,9 +49,9 @@ public: MOZ_COUNT_DTOR(TextDecoder); } - bool WrapObject(JSContext* aCx, JS::MutableHandle aReflector) + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return TextDecoderBinding::Wrap(aCx, this, aReflector); + return TextDecoderBinding::Wrap(aCx, this, aGivenProto, aReflector); } /** diff --git a/dom/encoding/TextEncoder.h b/dom/encoding/TextEncoder.h index e7ef387934..477f785213 100644 --- a/dom/encoding/TextEncoder.h +++ b/dom/encoding/TextEncoder.h @@ -42,9 +42,9 @@ public: ~TextEncoder() {} - bool WrapObject(JSContext* aCx, JS::MutableHandle aReflector) + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return TextEncoderBinding::Wrap(aCx, this, aReflector); + return TextEncoderBinding::Wrap(aCx, this, aGivenProto, aReflector); } protected: diff --git a/dom/events/AnimationEvent.h b/dom/events/AnimationEvent.h index 9eef0ee7d7..760648190d 100644 --- a/dom/events/AnimationEvent.h +++ b/dom/events/AnimationEvent.h @@ -33,9 +33,9 @@ public: const AnimationEventInit& aParam, ErrorResult& aRv); - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return AnimationEventBinding::Wrap(aCx, this); + return AnimationEventBinding::Wrap(aCx, this, aGivenProto); } // xpidl implementation diff --git a/dom/events/BeforeAfterKeyboardEvent.h b/dom/events/BeforeAfterKeyboardEvent.h index ae0bcd2349..234228b14e 100644 --- a/dom/events/BeforeAfterKeyboardEvent.h +++ b/dom/events/BeforeAfterKeyboardEvent.h @@ -19,9 +19,9 @@ public: nsPresContext* aPresContext, InternalBeforeAfterKeyboardEvent* aEvent); - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return BeforeAfterKeyboardEventBinding::Wrap(aCx, this); + return BeforeAfterKeyboardEventBinding::Wrap(aCx, this, aGivenProto); } static already_AddRefed diff --git a/dom/events/BeforeUnloadEvent.h b/dom/events/BeforeUnloadEvent.h index 690b8e0a6f..6a35c00fb2 100644 --- a/dom/events/BeforeUnloadEvent.h +++ b/dom/events/BeforeUnloadEvent.h @@ -24,9 +24,9 @@ public: { } - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return BeforeUnloadEventBinding::Wrap(aCx, this); + return BeforeUnloadEventBinding::Wrap(aCx, this, aGivenProto); } NS_DECL_ISUPPORTS_INHERITED diff --git a/dom/events/ClipboardEvent.h b/dom/events/ClipboardEvent.h index dd627738ef..a01d8f7ce4 100644 --- a/dom/events/ClipboardEvent.h +++ b/dom/events/ClipboardEvent.h @@ -30,9 +30,9 @@ public: // Forward to base class NS_FORWARD_TO_EVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return ClipboardEventBinding::Wrap(aCx, this); + return ClipboardEventBinding::Wrap(aCx, this, aGivenProto); } static already_AddRefed diff --git a/dom/events/CommandEvent.h b/dom/events/CommandEvent.h index 1fc00c3fb1..f714661fec 100644 --- a/dom/events/CommandEvent.h +++ b/dom/events/CommandEvent.h @@ -29,9 +29,9 @@ public: // Forward to base class NS_FORWARD_TO_EVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return CommandEventBinding::Wrap(aCx, this); + return CommandEventBinding::Wrap(aCx, this, aGivenProto); } void InitCommandEvent(const nsAString& aType, diff --git a/dom/events/CompositionEvent.h b/dom/events/CompositionEvent.h index 0d490a0a92..dcf917ce70 100644 --- a/dom/events/CompositionEvent.h +++ b/dom/events/CompositionEvent.h @@ -27,9 +27,9 @@ public: NS_FORWARD_TO_UIEVENT NS_DECL_NSIDOMCOMPOSITIONEVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return CompositionEventBinding::Wrap(aCx, this); + return CompositionEventBinding::Wrap(aCx, this, aGivenProto); } void InitCompositionEvent(const nsAString& aType, diff --git a/dom/events/CustomEvent.cpp b/dom/events/CustomEvent.cpp index 6cce6f01c5..1855500397 100644 --- a/dom/events/CustomEvent.cpp +++ b/dom/events/CustomEvent.cpp @@ -53,9 +53,9 @@ CustomEvent::Constructor(const GlobalObject& aGlobal, } JSObject* -CustomEvent::WrapObjectInternal(JSContext* aCx) +CustomEvent::WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) { - return mozilla::dom::CustomEventBinding::Wrap(aCx, this); + return mozilla::dom::CustomEventBinding::Wrap(aCx, this, aGivenProto); } NS_IMETHODIMP diff --git a/dom/events/CustomEvent.h b/dom/events/CustomEvent.h index b8d9cdbb40..2d37dd3b4a 100644 --- a/dom/events/CustomEvent.h +++ b/dom/events/CustomEvent.h @@ -38,7 +38,7 @@ public: ErrorResult& aRv); virtual JSObject* - WrapObjectInternal(JSContext* aCx) override; + WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; void GetDetail(JSContext* aCx, diff --git a/dom/events/DataContainerEvent.h b/dom/events/DataContainerEvent.h index 52acb63f42..5ca205ff70 100644 --- a/dom/events/DataContainerEvent.h +++ b/dom/events/DataContainerEvent.h @@ -31,9 +31,9 @@ public: NS_DECL_NSIDOMDATACONTAINEREVENT virtual JSObject* - WrapObjectInternal(JSContext* aCx) override + WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return DataContainerEventBinding::Wrap(aCx, this); + return DataContainerEventBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed GetData(const nsAString& aKey) diff --git a/dom/events/DataTransfer.cpp b/dom/events/DataTransfer.cpp index 56e7079d7a..0e686f470d 100644 --- a/dom/events/DataTransfer.cpp +++ b/dom/events/DataTransfer.cpp @@ -167,9 +167,9 @@ DataTransfer::Constructor(const GlobalObject& aGlobal, } JSObject* -DataTransfer::WrapObject(JSContext* aCx) +DataTransfer::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DataTransferBinding::Wrap(aCx, this); + return DataTransferBinding::Wrap(aCx, this, aGivenProto); } NS_IMETHODIMP diff --git a/dom/events/DataTransfer.h b/dom/events/DataTransfer.h index b6d5e3ebac..b436db7f6a 100644 --- a/dom/events/DataTransfer.h +++ b/dom/events/DataTransfer.h @@ -104,7 +104,7 @@ public: DataTransfer(nsISupports* aParent, uint32_t aEventType, bool aIsExternal, int32_t aClipboardType); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() { return mParent; diff --git a/dom/events/DeviceMotionEvent.h b/dom/events/DeviceMotionEvent.h index 3206b29cfa..4cf9a58485 100644 --- a/dom/events/DeviceMotionEvent.h +++ b/dom/events/DeviceMotionEvent.h @@ -27,9 +27,9 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) override + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { - return DeviceRotationRateBinding::Wrap(aCx, this); + return DeviceRotationRateBinding::Wrap(aCx, this, aGivenProto); } Nullable GetAlpha() const { return mAlpha; } @@ -59,9 +59,9 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) override + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { - return DeviceAccelerationBinding::Wrap(aCx, this); + return DeviceAccelerationBinding::Wrap(aCx, this, aGivenProto); } Nullable GetX() const { return mX; } @@ -94,9 +94,9 @@ public: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeviceMotionEvent, Event) - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return DeviceMotionEventBinding::Wrap(aCx, this); + return DeviceMotionEventBinding::Wrap(aCx, this, aGivenProto); } DeviceAcceleration* GetAcceleration() const diff --git a/dom/events/DragEvent.h b/dom/events/DragEvent.h index a6bdc2a80f..88aeef1841 100644 --- a/dom/events/DragEvent.h +++ b/dom/events/DragEvent.h @@ -30,9 +30,9 @@ public: NS_FORWARD_TO_MOUSEEVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return DragEventBinding::Wrap(aCx, this); + return DragEventBinding::Wrap(aCx, this, aGivenProto); } DataTransfer* GetDataTransfer(); diff --git a/dom/events/Event.cpp b/dom/events/Event.cpp index 4db445e16a..1779f0ac4e 100644 --- a/dom/events/Event.cpp +++ b/dom/events/Event.cpp @@ -234,18 +234,18 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END JSObject* -Event::WrapObject(JSContext* aCx) +Event::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { if (mIsMainThreadEvent && !GetWrapperPreserveColor()) { nsJSContext::LikelyShortLivingObjectCreated(); } - return WrapObjectInternal(aCx); + return WrapObjectInternal(aCx, aGivenProto); } JSObject* -Event::WrapObjectInternal(JSContext* aCx) +Event::WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) { - return EventBinding::Wrap(aCx, this); + return EventBinding::Wrap(aCx, this, aGivenProto); } bool diff --git a/dom/events/Event.h b/dom/events/Event.h index 246a04b685..cef6dbe623 100644 --- a/dom/events/Event.h +++ b/dom/events/Event.h @@ -98,9 +98,9 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) override final; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override final; - virtual JSObject* WrapObjectInternal(JSContext* aCx); + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto); #define GENERATED_EVENT(EventClass_) \ virtual EventClass_* As##EventClass_() \ diff --git a/dom/events/FocusEvent.h b/dom/events/FocusEvent.h index 2d7b6173d7..ef35466662 100644 --- a/dom/events/FocusEvent.h +++ b/dom/events/FocusEvent.h @@ -23,9 +23,9 @@ public: // Forward to base class NS_FORWARD_TO_UIEVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return FocusEventBinding::Wrap(aCx, this); + return FocusEventBinding::Wrap(aCx, this, aGivenProto); } FocusEvent(EventTarget* aOwner, diff --git a/dom/events/ImageCaptureError.cpp b/dom/events/ImageCaptureError.cpp index 8e8ea4f4d9..834da1fbc9 100644 --- a/dom/events/ImageCaptureError.cpp +++ b/dom/events/ImageCaptureError.cpp @@ -37,9 +37,9 @@ ImageCaptureError::GetParentObject() const } JSObject* -ImageCaptureError::WrapObject(JSContext* aCx) +ImageCaptureError::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return ImageCaptureErrorBinding::Wrap(aCx, this); + return ImageCaptureErrorBinding::Wrap(aCx, this, aGivenProto); } uint16_t diff --git a/dom/events/ImageCaptureError.h b/dom/events/ImageCaptureError.h index 2be1fe28a5..fe5ce88b24 100644 --- a/dom/events/ImageCaptureError.h +++ b/dom/events/ImageCaptureError.h @@ -31,7 +31,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; uint16_t Code() const; diff --git a/dom/events/InputEvent.h b/dom/events/InputEvent.h index 0fd743eb07..6325d39e9c 100644 --- a/dom/events/InputEvent.h +++ b/dom/events/InputEvent.h @@ -31,9 +31,9 @@ public: const InputEventInit& aParam, ErrorResult& aRv); - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return InputEventBinding::Wrap(aCx, this); + return InputEventBinding::Wrap(aCx, this, aGivenProto); } bool IsComposing(); diff --git a/dom/events/KeyboardEvent.h b/dom/events/KeyboardEvent.h index 8641d2f6c0..9d148cb43d 100644 --- a/dom/events/KeyboardEvent.h +++ b/dom/events/KeyboardEvent.h @@ -36,9 +36,9 @@ public: const KeyboardEventInit& aParam, ErrorResult& aRv); - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return KeyboardEventBinding::Wrap(aCx, this); + return KeyboardEventBinding::Wrap(aCx, this, aGivenProto); } bool AltKey(); diff --git a/dom/events/MessageEvent.cpp b/dom/events/MessageEvent.cpp index 97866b061c..428740e587 100644 --- a/dom/events/MessageEvent.cpp +++ b/dom/events/MessageEvent.cpp @@ -60,9 +60,9 @@ MessageEvent::~MessageEvent() } JSObject* -MessageEvent::WrapObjectInternal(JSContext* aCx) +MessageEvent::WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) { - return mozilla::dom::MessageEventBinding::Wrap(aCx, this); + return mozilla::dom::MessageEventBinding::Wrap(aCx, this, aGivenProto); } NS_IMETHODIMP diff --git a/dom/events/MessageEvent.h b/dom/events/MessageEvent.h index f8fdb1ad1e..c53cbb58cb 100644 --- a/dom/events/MessageEvent.h +++ b/dom/events/MessageEvent.h @@ -46,7 +46,7 @@ public: // Forward to base class NS_FORWARD_TO_EVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override; + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; void GetData(JSContext* aCx, JS::MutableHandle aData, ErrorResult& aRv); diff --git a/dom/events/MouseEvent.h b/dom/events/MouseEvent.h index 880eb2a027..79174a0d93 100644 --- a/dom/events/MouseEvent.h +++ b/dom/events/MouseEvent.h @@ -30,9 +30,9 @@ public: // Forward to base class NS_FORWARD_TO_UIEVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return MouseEventBinding::Wrap(aCx, this); + return MouseEventBinding::Wrap(aCx, this, aGivenProto); } // Web IDL binding methods diff --git a/dom/events/MouseScrollEvent.h b/dom/events/MouseScrollEvent.h index 91d1b93588..c878d6a9aa 100644 --- a/dom/events/MouseScrollEvent.h +++ b/dom/events/MouseScrollEvent.h @@ -29,9 +29,9 @@ public: // Forward to base class NS_FORWARD_TO_MOUSEEVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return MouseScrollEventBinding::Wrap(aCx, this); + return MouseScrollEventBinding::Wrap(aCx, this, aGivenProto); } int32_t Axis(); diff --git a/dom/events/MutationEvent.h b/dom/events/MutationEvent.h index 4f5683c43c..cb6a81568b 100644 --- a/dom/events/MutationEvent.h +++ b/dom/events/MutationEvent.h @@ -30,9 +30,9 @@ public: // Forward to base class NS_FORWARD_TO_EVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return MutationEventBinding::Wrap(aCx, this); + return MutationEventBinding::Wrap(aCx, this, aGivenProto); } // xpidl implementation diff --git a/dom/events/NotifyPaintEvent.h b/dom/events/NotifyPaintEvent.h index f2f58beca3..26930119e7 100644 --- a/dom/events/NotifyPaintEvent.h +++ b/dom/events/NotifyPaintEvent.h @@ -43,9 +43,9 @@ public: NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override; NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) override; - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return NotifyPaintEventBinding::Wrap(aCx, this); + return NotifyPaintEventBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed ClientRects(); diff --git a/dom/events/PaintRequest.cpp b/dom/events/PaintRequest.cpp index 1a8843ec5e..742d71c286 100644 --- a/dom/events/PaintRequest.cpp +++ b/dom/events/PaintRequest.cpp @@ -28,9 +28,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(PaintRequest) NS_IMPL_CYCLE_COLLECTING_RELEASE(PaintRequest) /* virtual */ JSObject* -PaintRequest::WrapObject(JSContext* aCx) +PaintRequest::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PaintRequestBinding::Wrap(aCx, this); + return PaintRequestBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed @@ -71,9 +71,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(PaintRequestList) NS_IMPL_CYCLE_COLLECTING_RELEASE(PaintRequestList) JSObject* -PaintRequestList::WrapObject(JSContext* aCx) +PaintRequestList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PaintRequestListBinding::Wrap(aCx, this); + return PaintRequestListBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/events/PaintRequest.h b/dom/events/PaintRequest.h index 20e79f2364..97cf18c5a2 100644 --- a/dom/events/PaintRequest.h +++ b/dom/events/PaintRequest.h @@ -31,7 +31,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PaintRequest) NS_DECL_NSIDOMPAINTREQUEST - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsIDOMEvent* GetParentObject() const { @@ -65,7 +65,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PaintRequestList) - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() { return mParent; diff --git a/dom/events/PointerEvent.h b/dom/events/PointerEvent.h index 03862cd0dc..d30ef130f5 100644 --- a/dom/events/PointerEvent.h +++ b/dom/events/PointerEvent.h @@ -22,9 +22,9 @@ public: nsPresContext* aPresContext, WidgetPointerEvent* aEvent); - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return PointerEventBinding::Wrap(aCx, this); + return PointerEventBinding::Wrap(aCx, this, aGivenProto); } static already_AddRefed diff --git a/dom/events/ScrollAreaEvent.h b/dom/events/ScrollAreaEvent.h index aa327cb6b1..428abfa8dd 100644 --- a/dom/events/ScrollAreaEvent.h +++ b/dom/events/ScrollAreaEvent.h @@ -38,9 +38,9 @@ public: NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override; NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) override; - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return ScrollAreaEventBinding::Wrap(aCx, this); + return ScrollAreaEventBinding::Wrap(aCx, this, aGivenProto); } float X() const diff --git a/dom/events/SimpleGestureEvent.h b/dom/events/SimpleGestureEvent.h index 553e85e607..627e212c6a 100644 --- a/dom/events/SimpleGestureEvent.h +++ b/dom/events/SimpleGestureEvent.h @@ -30,9 +30,9 @@ public: // Forward to base class NS_FORWARD_TO_MOUSEEVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return SimpleGestureEventBinding::Wrap(aCx, this); + return SimpleGestureEventBinding::Wrap(aCx, this, aGivenProto); } uint32_t AllowedDirections(); diff --git a/dom/events/SpeechRecognitionError.h b/dom/events/SpeechRecognitionError.h index a95bd19a33..655a6d2b18 100644 --- a/dom/events/SpeechRecognitionError.h +++ b/dom/events/SpeechRecognitionError.h @@ -26,9 +26,9 @@ public: const SpeechRecognitionErrorInit& aParam, ErrorResult& aRv); - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return mozilla::dom::SpeechRecognitionErrorBinding::Wrap(aCx, this); + return mozilla::dom::SpeechRecognitionErrorBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/events/StorageEvent.cpp b/dom/events/StorageEvent.cpp index fa6cd2e166..0e9cf0779b 100644 --- a/dom/events/StorageEvent.cpp +++ b/dom/events/StorageEvent.cpp @@ -45,9 +45,9 @@ StorageEvent::AsStorageEvent() } JSObject* -StorageEvent::WrapObjectInternal(JSContext* aCx) +StorageEvent::WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) { - return StorageEventBinding::Wrap(aCx, this); + return StorageEventBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed diff --git a/dom/events/StorageEvent.h b/dom/events/StorageEvent.h index f17a498657..43dc7155e9 100644 --- a/dom/events/StorageEvent.h +++ b/dom/events/StorageEvent.h @@ -42,7 +42,7 @@ protected: public: virtual StorageEvent* AsStorageEvent(); - virtual JSObject* WrapObjectInternal(JSContext* aCx) override; + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override; static already_AddRefed Constructor(EventTarget* aOwner, const nsAString& aType, diff --git a/dom/events/Touch.cpp b/dom/events/Touch.cpp index ab67ca618c..17f17dad54 100644 --- a/dom/events/Touch.cpp +++ b/dom/events/Touch.cpp @@ -130,9 +130,9 @@ Touch::Equals(Touch* aTouch) } JSObject* -Touch::WrapObject(JSContext* aCx) +Touch::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return TouchBinding::Wrap(aCx, this); + return TouchBinding::Wrap(aCx, this, aGivenProto); } // Parent ourselves to the global of the target. This achieves the desirable diff --git a/dom/events/Touch.h b/dom/events/Touch.h index ae3365ef9c..869fbe826a 100644 --- a/dom/events/Touch.h +++ b/dom/events/Touch.h @@ -54,7 +54,7 @@ public: bool Equals(Touch* aTouch); - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsIGlobalObject* GetParentObject(); diff --git a/dom/events/TouchEvent.cpp b/dom/events/TouchEvent.cpp index 194217da60..b1adcdf421 100644 --- a/dom/events/TouchEvent.cpp +++ b/dom/events/TouchEvent.cpp @@ -36,9 +36,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(TouchList) NS_IMPL_CYCLE_COLLECTING_RELEASE(TouchList) JSObject* -TouchList::WrapObject(JSContext* aCx) +TouchList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return TouchListBinding::Wrap(aCx, this); + return TouchListBinding::Wrap(aCx, this, aGivenProto); } // static diff --git a/dom/events/TouchEvent.h b/dom/events/TouchEvent.h index 2fa8fc31b4..531c4231cc 100644 --- a/dom/events/TouchEvent.h +++ b/dom/events/TouchEvent.h @@ -44,7 +44,7 @@ public: mPoints.AppendElement(aPoint); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() const { @@ -89,9 +89,9 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TouchEvent, UIEvent) - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return TouchEventBinding::Wrap(aCx, this); + return TouchEventBinding::Wrap(aCx, this, aGivenProto); } TouchList* Touches(); diff --git a/dom/events/TransitionEvent.h b/dom/events/TransitionEvent.h index dd631675d6..80ede55140 100644 --- a/dom/events/TransitionEvent.h +++ b/dom/events/TransitionEvent.h @@ -33,9 +33,9 @@ public: const TransitionEventInit& aParam, ErrorResult& aRv); - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return TransitionEventBinding::Wrap(aCx, this); + return TransitionEventBinding::Wrap(aCx, this, aGivenProto); } // xpidl implementation diff --git a/dom/events/UIEvent.h b/dom/events/UIEvent.h index 9d95f8334f..3c4e67b8cd 100644 --- a/dom/events/UIEvent.h +++ b/dom/events/UIEvent.h @@ -101,9 +101,9 @@ public: const UIEventInit& aParam, ErrorResult& aRv); - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return UIEventBinding::Wrap(aCx, this); + return UIEventBinding::Wrap(aCx, this, aGivenProto); } nsIDOMWindow* GetView() const diff --git a/dom/events/WheelEvent.h b/dom/events/WheelEvent.h index 81cd8200de..ba561afbf3 100644 --- a/dom/events/WheelEvent.h +++ b/dom/events/WheelEvent.h @@ -37,9 +37,9 @@ public: const WheelEventInit& aParam, ErrorResult& aRv); - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return WheelEventBinding::Wrap(aCx, this); + return WheelEventBinding::Wrap(aCx, this, aGivenProto); } // NOTE: DeltaX(), DeltaY() and DeltaZ() return CSS pixels when deltaMode is diff --git a/dom/events/XULCommandEvent.h b/dom/events/XULCommandEvent.h index a1001d7e1a..4013acb6f4 100644 --- a/dom/events/XULCommandEvent.h +++ b/dom/events/XULCommandEvent.h @@ -31,9 +31,9 @@ public: // Forward our inherited virtual methods to the base class NS_FORWARD_TO_UIEVENT - virtual JSObject* WrapObjectInternal(JSContext* aCx) override + virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { - return XULCommandEventBinding::Wrap(aCx, this); + return XULCommandEventBinding::Wrap(aCx, this, aGivenProto); } bool AltKey(); diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp index 4f7fdd8e26..3c6bce725b 100644 --- a/dom/fetch/FetchDriver.cpp +++ b/dom/fetch/FetchDriver.cpp @@ -485,16 +485,24 @@ FetchDriver::HttpFetch(bool aCORSFlag, bool aCORSPreflightFlag, bool aAuthentica internalChan->ForceNoIntercept(); } - // Set up a CORS proxy that will handle the various requirements of the CORS - // protocol. It handles the preflight cache and CORS response headers. - // If the request is allowed, it will start our original request - // and our observer will be notified. On failure, our observer is notified - // directly. - nsRefPtr corsListener = - new nsCORSListenerProxy(this, mPrincipal, useCredentials); - rv = corsListener->Init(chan, DataURIHandling::Allow); - if (NS_WARN_IF(NS_FAILED(rv))) { - return FailWithNetworkError(); + nsCOMPtr listener = this; + + // Unless the cors mode is explicitly no-cors, we set up a cors proxy even in + // the same-origin case, since the proxy does not enforce cors header checks + // in the same-origin case. + if (mRequest->Mode() != RequestMode::No_cors) { + // Set up a CORS proxy that will handle the various requirements of the CORS + // protocol. It handles the preflight cache and CORS response headers. + // If the request is allowed, it will start our original request + // and our observer will be notified. On failure, our observer is notified + // directly. + nsRefPtr corsListener = + new nsCORSListenerProxy(this, mPrincipal, useCredentials); + rv = corsListener->Init(chan, DataURIHandling::Allow); + if (NS_WARN_IF(NS_FAILED(rv))) { + return FailWithNetworkError(); + } + listener = corsListener.forget(); } // If preflight is required, start a "CORS preflight fetch" @@ -507,12 +515,12 @@ FetchDriver::HttpFetch(bool aCORSFlag, bool aCORSPreflightFlag, bool aAuthentica nsAutoTArray unsafeHeaders; mRequest->Headers()->GetUnsafeHeaders(unsafeHeaders); - rv = NS_StartCORSPreflight(chan, corsListener, mPrincipal, + rv = NS_StartCORSPreflight(chan, listener, mPrincipal, useCredentials, unsafeHeaders, getter_AddRefs(preflightChannel)); } else { - rv = chan->AsyncOpen(corsListener, nullptr); + rv = chan->AsyncOpen(listener, nullptr); } if (NS_WARN_IF(NS_FAILED(rv))) { @@ -773,7 +781,7 @@ FetchDriver::AsyncOnChannelRedirect(nsIChannel* aOldChannel, if (!NS_IsInternalSameURIRedirect(aOldChannel, aNewChannel, aFlags)) { rv = DoesNotRequirePreflight(aNewChannel); if (NS_FAILED(rv)) { - NS_WARNING("nsXMLHttpRequest::OnChannelRedirect: " + NS_WARNING("FetchDriver::OnChannelRedirect: " "DoesNotRequirePreflight returned failure"); return rv; } diff --git a/dom/fetch/Headers.cpp b/dom/fetch/Headers.cpp index 6fadd1ed3b..836a985752 100644 --- a/dom/fetch/Headers.cpp +++ b/dom/fetch/Headers.cpp @@ -75,9 +75,9 @@ Headers::Constructor(const GlobalObject& aGlobal, } JSObject* -Headers::WrapObject(JSContext* aCx) +Headers::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return mozilla::dom::HeadersBinding::Wrap(aCx, this); + return mozilla::dom::HeadersBinding::Wrap(aCx, this, aGivenProto); } Headers::~Headers() diff --git a/dom/fetch/Headers.h b/dom/fetch/Headers.h index a551cd397b..7b4c9e4bab 100644 --- a/dom/fetch/Headers.h +++ b/dom/fetch/Headers.h @@ -110,7 +110,7 @@ public: mInternalHeaders->SetGuard(aGuard, aRv); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsISupports* GetParentObject() const { return mOwner; } private: diff --git a/dom/fetch/Request.h b/dom/fetch/Request.h index 9487ba0923..2e07ecca38 100644 --- a/dom/fetch/Request.h +++ b/dom/fetch/Request.h @@ -37,9 +37,9 @@ public: Request(nsIGlobalObject* aOwner, InternalRequest* aRequest); JSObject* - WrapObject(JSContext* aCx) override + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { - return RequestBinding::Wrap(aCx, this); + return RequestBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/fetch/Response.cpp b/dom/fetch/Response.cpp index a5b03d51bd..96907daace 100644 --- a/dom/fetch/Response.cpp +++ b/dom/fetch/Response.cpp @@ -226,18 +226,5 @@ Response::Headers_() return mHeaders; } - -void -Response::SetFinalURL(bool aFinalURL, ErrorResult& aRv) -{ - nsCString url; - mInternalResponse->GetUrl(url); - if (url.IsEmpty()) { - aRv.ThrowTypeError(MSG_RESPONSE_URL_IS_NULL); - return; - } - - mInternalResponse->SetFinalURL(aFinalURL); -} } // namespace dom } // namespace mozilla diff --git a/dom/fetch/Response.h b/dom/fetch/Response.h index 794b314add..52e0cddf7e 100644 --- a/dom/fetch/Response.h +++ b/dom/fetch/Response.h @@ -37,9 +37,9 @@ public: Response(const Response& aOther) = delete; JSObject* - WrapObject(JSContext* aCx) override + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override { - return ResponseBinding::Wrap(aCx, this); + return ResponseBinding::Wrap(aCx, this, aGivenProto); } ResponseType @@ -56,15 +56,6 @@ public: aUrl.AsAString() = NS_ConvertUTF8toUTF16(url); } - bool - GetFinalURL(ErrorResult& aRv) const - { - return mInternalResponse->FinalURL(); - } - - void - SetFinalURL(bool aFinalURL, ErrorResult& aRv); - uint16_t Status() const { diff --git a/dom/filesystem/Directory.cpp b/dom/filesystem/Directory.cpp index 799a18cb18..3bdacc0017 100644 --- a/dom/filesystem/Directory.cpp +++ b/dom/filesystem/Directory.cpp @@ -75,9 +75,9 @@ Directory::GetParentObject() const } JSObject* -Directory::WrapObject(JSContext* aCx) +Directory::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DirectoryBinding::Wrap(aCx, this); + return DirectoryBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/filesystem/Directory.h b/dom/filesystem/Directory.h index 84bac5bf33..f8655ffc35 100644 --- a/dom/filesystem/Directory.h +++ b/dom/filesystem/Directory.h @@ -56,7 +56,7 @@ public: GetParentObject() const; virtual JSObject* - WrapObject(JSContext* aCx) override; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void GetName(nsString& aRetval) const; diff --git a/dom/fmradio/FMRadio.cpp b/dom/fmradio/FMRadio.cpp index 8e7e364800..28fe19a30a 100644 --- a/dom/fmradio/FMRadio.cpp +++ b/dom/fmradio/FMRadio.cpp @@ -184,9 +184,9 @@ FMRadio::Shutdown() } JSObject* -FMRadio::WrapObject(JSContext* aCx) +FMRadio::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return FMRadioBinding::Wrap(aCx, this); + return FMRadioBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/fmradio/FMRadio.h b/dom/fmradio/FMRadio.h index 4e41c92814..71edf7fb5f 100644 --- a/dom/fmradio/FMRadio.h +++ b/dom/fmradio/FMRadio.h @@ -51,7 +51,7 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; static bool Enabled(); diff --git a/dom/gamepad/Gamepad.cpp b/dom/gamepad/Gamepad.cpp index d88f207401..c621fe130c 100644 --- a/dom/gamepad/Gamepad.cpp +++ b/dom/gamepad/Gamepad.cpp @@ -120,9 +120,9 @@ Gamepad::Clone(nsISupports* aParent) } /* virtual */ JSObject* -Gamepad::WrapObject(JSContext* aCx) +Gamepad::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return GamepadBinding::Wrap(aCx, this); + return GamepadBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/gamepad/Gamepad.h b/dom/gamepad/Gamepad.h index 3a26e4fa13..62f6ac940c 100644 --- a/dom/gamepad/Gamepad.h +++ b/dom/gamepad/Gamepad.h @@ -59,7 +59,7 @@ public: return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void GetId(nsAString& aID) const { diff --git a/dom/gamepad/GamepadButton.cpp b/dom/gamepad/GamepadButton.cpp index a46eecd457..978af033bc 100644 --- a/dom/gamepad/GamepadButton.cpp +++ b/dom/gamepad/GamepadButton.cpp @@ -19,9 +19,9 @@ NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GamepadButton, mParent) /* virtual */ JSObject* -GamepadButton::WrapObject(JSContext* aCx) +GamepadButton::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return GamepadButtonBinding::Wrap(aCx, this); + return GamepadButtonBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/gamepad/GamepadButton.h b/dom/gamepad/GamepadButton.h index 23b5a45340..c22d9c9c5a 100644 --- a/dom/gamepad/GamepadButton.h +++ b/dom/gamepad/GamepadButton.h @@ -30,7 +30,7 @@ public: return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; void SetPressed(bool aPressed) { diff --git a/dom/geolocation/nsGeoPosition.cpp b/dom/geolocation/nsGeoPosition.cpp index b922807841..1698d9378b 100644 --- a/dom/geolocation/nsGeoPosition.cpp +++ b/dom/geolocation/nsGeoPosition.cpp @@ -171,9 +171,9 @@ Position::GetParentObject() const } JSObject* -Position::WrapObject(JSContext* aCx) +Position::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PositionBinding::Wrap(aCx, this); + return PositionBinding::Wrap(aCx, this, aGivenProto); } Coordinates* @@ -224,9 +224,9 @@ Coordinates::GetParentObject() const } JSObject* -Coordinates::WrapObject(JSContext* aCx) +Coordinates::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CoordinatesBinding::Wrap(aCx, this); + return CoordinatesBinding::Wrap(aCx, this, aGivenProto); } #define GENERATE_COORDS_WRAPPED_GETTER(name) \ diff --git a/dom/geolocation/nsGeoPosition.h b/dom/geolocation/nsGeoPosition.h index 3b569ee99e..00f2aa3629 100644 --- a/dom/geolocation/nsGeoPosition.h +++ b/dom/geolocation/nsGeoPosition.h @@ -90,7 +90,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; Coordinates* Coords(); @@ -118,7 +118,7 @@ public: Position* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; double Latitude() const; diff --git a/dom/geolocation/nsGeolocation.cpp b/dom/geolocation/nsGeolocation.cpp index eb9cd5c165..df51f29dbb 100644 --- a/dom/geolocation/nsGeolocation.cpp +++ b/dom/geolocation/nsGeolocation.cpp @@ -314,9 +314,9 @@ PositionError::GetParentObject() const } JSObject* -PositionError::WrapObject(JSContext* aCx) +PositionError::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PositionErrorBinding::Wrap(aCx, this); + return PositionErrorBinding::Wrap(aCx, this, aGivenProto); } void @@ -1621,7 +1621,7 @@ Geolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request) } JSObject* -Geolocation::WrapObject(JSContext *aCtx) +Geolocation::WrapObject(JSContext *aCtx, JS::Handle aGivenProto) { - return GeolocationBinding::Wrap(aCtx, this); + return GeolocationBinding::Wrap(aCtx, this, aGivenProto); } diff --git a/dom/geolocation/nsGeolocation.h b/dom/geolocation/nsGeolocation.h index d71d48b254..595fd3462f 100644 --- a/dom/geolocation/nsGeolocation.h +++ b/dom/geolocation/nsGeolocation.h @@ -140,7 +140,7 @@ public: nsresult Init(nsIDOMWindow* contentDom=nullptr); nsIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext *aCtx) override; + virtual JSObject* WrapObject(JSContext *aCtx, JS::Handle aGivenProto) override; int32_t WatchPosition(PositionCallback& aCallback, PositionErrorCallback* aErrorCallback, const PositionOptions& aOptions, ErrorResult& aRv); void GetCurrentPosition(PositionCallback& aCallback, PositionErrorCallback* aErrorCallback, const PositionOptions& aOptions, ErrorResult& aRv); @@ -233,7 +233,7 @@ public: Geolocation* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; int16_t Code() const { return mCode; diff --git a/dom/html/HTMLAllCollection.cpp b/dom/html/HTMLAllCollection.cpp index 80acfeae0b..18151d307b 100644 --- a/dom/html/HTMLAllCollection.cpp +++ b/dom/html/HTMLAllCollection.cpp @@ -210,9 +210,9 @@ HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray& aNames JSObject* -HTMLAllCollection::WrapObject(JSContext* aCx) +HTMLAllCollection::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLAllCollectionBinding::Wrap(aCx, this); + return HTMLAllCollectionBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/html/HTMLAllCollection.h b/dom/html/HTMLAllCollection.h index 9f4799f309..f2c5b95aec 100644 --- a/dom/html/HTMLAllCollection.h +++ b/dom/html/HTMLAllCollection.h @@ -40,7 +40,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(HTMLAllCollection) - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; nsINode* GetParentObject() const; uint32_t Length(); diff --git a/dom/html/HTMLAnchorElement.cpp b/dom/html/HTMLAnchorElement.cpp index d1e960ce1d..f0d27a679a 100644 --- a/dom/html/HTMLAnchorElement.cpp +++ b/dom/html/HTMLAnchorElement.cpp @@ -76,9 +76,9 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_ELEMENT_CLONE(HTMLAnchorElement) JSObject* -HTMLAnchorElement::WrapNode(JSContext *aCx) +HTMLAnchorElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return HTMLAnchorElementBinding::Wrap(aCx, this); + return HTMLAnchorElementBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_STRING_ATTR(HTMLAnchorElement, Charset, charset) diff --git a/dom/html/HTMLAnchorElement.h b/dom/html/HTMLAnchorElement.h index 41217df06d..e36dda6f3d 100644 --- a/dom/html/HTMLAnchorElement.h +++ b/dom/html/HTMLAnchorElement.h @@ -226,7 +226,7 @@ protected: virtual void GetItemValueText(DOMString& text) override; virtual void SetItemValueText(const nsAString& text) override; - virtual JSObject* WrapNode(JSContext *aCx) override; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) override; nsRefPtr mRelList; }; diff --git a/dom/html/HTMLAreaElement.cpp b/dom/html/HTMLAreaElement.cpp index dbc704d051..23f38ceaa7 100644 --- a/dom/html/HTMLAreaElement.cpp +++ b/dom/html/HTMLAreaElement.cpp @@ -269,9 +269,9 @@ HTMLAreaElement::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const } JSObject* -HTMLAreaElement::WrapNode(JSContext* aCx) +HTMLAreaElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLAreaElementBinding::Wrap(aCx, this); + return HTMLAreaElementBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/html/HTMLAreaElement.h b/dom/html/HTMLAreaElement.h index 7eee9648eb..41eb46bab5 100644 --- a/dom/html/HTMLAreaElement.h +++ b/dom/html/HTMLAreaElement.h @@ -178,7 +178,7 @@ public: protected: virtual ~HTMLAreaElement(); - virtual JSObject* WrapNode(JSContext* aCx) override; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) override; virtual void GetItemValueText(DOMString& text) override; virtual void SetItemValueText(const nsAString& text) override; diff --git a/dom/html/HTMLAudioElement.cpp b/dom/html/HTMLAudioElement.cpp index 04d8313103..76269cc7e9 100644 --- a/dom/html/HTMLAudioElement.cpp +++ b/dom/html/HTMLAudioElement.cpp @@ -96,9 +96,9 @@ nsresult HTMLAudioElement::SetAcceptHeader(nsIHttpChannel* aChannel) } JSObject* -HTMLAudioElement::WrapNode(JSContext* aCx) +HTMLAudioElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLAudioElementBinding::Wrap(aCx, this); + return HTMLAudioElementBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/html/HTMLAudioElement.h b/dom/html/HTMLAudioElement.h index c024e4f0e8..483314502b 100644 --- a/dom/html/HTMLAudioElement.h +++ b/dom/html/HTMLAudioElement.h @@ -43,7 +43,7 @@ public: protected: virtual ~HTMLAudioElement(); - virtual JSObject* WrapNode(JSContext* aCx) override; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) override; }; } // namespace dom diff --git a/dom/html/HTMLBRElement.cpp b/dom/html/HTMLBRElement.cpp index fa213e3c6d..279d87c905 100644 --- a/dom/html/HTMLBRElement.cpp +++ b/dom/html/HTMLBRElement.cpp @@ -95,9 +95,9 @@ HTMLBRElement::GetAttributeMappingFunction() const } JSObject* -HTMLBRElement::WrapNode(JSContext *aCx) +HTMLBRElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return HTMLBRElementBinding::Wrap(aCx, this); + return HTMLBRElementBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/html/HTMLBRElement.h b/dom/html/HTMLBRElement.h index 763a6a1974..afe2bbf9bb 100644 --- a/dom/html/HTMLBRElement.h +++ b/dom/html/HTMLBRElement.h @@ -43,7 +43,7 @@ public: return SetHTMLAttr(nsGkAtoms::clear, aClear, aError); } - virtual JSObject* WrapNode(JSContext *aCx) override; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) override; private: virtual ~HTMLBRElement(); diff --git a/dom/html/HTMLBodyElement.cpp b/dom/html/HTMLBodyElement.cpp index b131eb3f8a..5d21e64e0b 100644 --- a/dom/html/HTMLBodyElement.cpp +++ b/dom/html/HTMLBodyElement.cpp @@ -189,9 +189,9 @@ HTMLBodyElement::~HTMLBodyElement() } JSObject* -HTMLBodyElement::WrapNode(JSContext *aCx) +HTMLBodyElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return HTMLBodyElementBinding::Wrap(aCx, this); + return HTMLBodyElementBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_ISUPPORTS_INHERITED(HTMLBodyElement, nsGenericHTMLElement, diff --git a/dom/html/HTMLBodyElement.h b/dom/html/HTMLBodyElement.h index a1df653c1c..60943ba82e 100644 --- a/dom/html/HTMLBodyElement.h +++ b/dom/html/HTMLBodyElement.h @@ -134,7 +134,7 @@ public: protected: virtual ~HTMLBodyElement(); - virtual JSObject* WrapNode(JSContext *aCx) override; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) override; nsRefPtr mContentStyleRule; diff --git a/dom/html/HTMLButtonElement.cpp b/dom/html/HTMLButtonElement.cpp index aa74512486..63d6fd1e28 100644 --- a/dom/html/HTMLButtonElement.cpp +++ b/dom/html/HTMLButtonElement.cpp @@ -526,9 +526,9 @@ HTMLButtonElement::IntrinsicState() const } JSObject* -HTMLButtonElement::WrapNode(JSContext* aCx) +HTMLButtonElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLButtonElementBinding::Wrap(aCx, this); + return HTMLButtonElementBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/html/HTMLButtonElement.h b/dom/html/HTMLButtonElement.h index 8dfe437213..324616ecf5 100644 --- a/dom/html/HTMLButtonElement.h +++ b/dom/html/HTMLButtonElement.h @@ -62,7 +62,7 @@ public: // nsINode virtual nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult) const override; - virtual JSObject* WrapNode(JSContext* aCx) override; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) override; // nsIContent virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp index 940430cd9c..146fd56d3c 100644 --- a/dom/html/HTMLCanvasElement.cpp +++ b/dom/html/HTMLCanvasElement.cpp @@ -72,9 +72,9 @@ HTMLCanvasPrintState::~HTMLCanvasPrintState() } /* virtual */ JSObject* -HTMLCanvasPrintState::WrapObject(JSContext* aCx) +HTMLCanvasPrintState::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MozCanvasPrintStateBinding::Wrap(aCx, this); + return MozCanvasPrintStateBinding::Wrap(aCx, this, aGivenProto); } nsISupports* @@ -137,9 +137,9 @@ NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement) NS_IMPL_ELEMENT_CLONE(HTMLCanvasElement) /* virtual */ JSObject* -HTMLCanvasElement::WrapNode(JSContext* aCx) +HTMLCanvasElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLCanvasElementBinding::Wrap(aCx, this); + return HTMLCanvasElementBinding::Wrap(aCx, this, aGivenProto); } nsIntSize diff --git a/dom/html/HTMLCanvasElement.h b/dom/html/HTMLCanvasElement.h index a133c2a6cb..48049d04f1 100644 --- a/dom/html/HTMLCanvasElement.h +++ b/dom/html/HTMLCanvasElement.h @@ -215,7 +215,7 @@ public: protected: virtual ~HTMLCanvasElement(); - virtual JSObject* WrapNode(JSContext* aCx) override; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) override; nsIntSize GetWidthHeight(); @@ -279,7 +279,7 @@ public: NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(HTMLCanvasPrintState) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(HTMLCanvasPrintState) - virtual JSObject* WrapObject(JSContext *cx) override; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) override; HTMLCanvasElement* GetParentObject() { diff --git a/dom/html/HTMLContentElement.cpp b/dom/html/HTMLContentElement.cpp index 2a134c747d..b310a0b5f0 100644 --- a/dom/html/HTMLContentElement.cpp +++ b/dom/html/HTMLContentElement.cpp @@ -43,9 +43,9 @@ NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement) NS_IMPL_ELEMENT_CLONE(HTMLContentElement) JSObject* -HTMLContentElement::WrapNode(JSContext *aCx) +HTMLContentElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return HTMLContentElementBinding::Wrap(aCx, this); + return HTMLContentElementBinding::Wrap(aCx, this, aGivenProto); } nsresult @@ -362,8 +362,8 @@ DistributedContentList::IndexOf(nsIContent* aContent) } JSObject* -DistributedContentList::WrapObject(JSContext* aCx) +DistributedContentList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return NodeListBinding::Wrap(aCx, this); + return NodeListBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/html/HTMLContentElement.h b/dom/html/HTMLContentElement.h index 8a5f5f94cf..e748861c0b 100644 --- a/dom/html/HTMLContentElement.h +++ b/dom/html/HTMLContentElement.h @@ -73,7 +73,7 @@ public: protected: virtual ~HTMLContentElement(); - virtual JSObject* WrapNode(JSContext *aCx) override; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) override; /** * Updates the destination insertion points of the fallback @@ -110,7 +110,7 @@ public: virtual nsIContent* Item(uint32_t aIndex) override; virtual int32_t IndexOf(nsIContent* aContent) override; virtual nsINode* GetParentObject() override { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) override; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; protected: virtual ~DistributedContentList(); nsRefPtr mParent; diff --git a/dom/html/HTMLDataElement.cpp b/dom/html/HTMLDataElement.cpp index f835ee89af..7b49912515 100644 --- a/dom/html/HTMLDataElement.cpp +++ b/dom/html/HTMLDataElement.cpp @@ -24,9 +24,9 @@ HTMLDataElement::~HTMLDataElement() NS_IMPL_ELEMENT_CLONE(HTMLDataElement) JSObject* -HTMLDataElement::WrapNode(JSContext* aCx) +HTMLDataElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLDataElementBinding::Wrap(aCx, this); + return HTMLDataElementBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/html/HTMLDataElement.h b/dom/html/HTMLDataElement.h index 2536506760..c41f8e2cd1 100644 --- a/dom/html/HTMLDataElement.h +++ b/dom/html/HTMLDataElement.h @@ -37,7 +37,7 @@ public: protected: virtual ~HTMLDataElement(); - virtual JSObject* WrapNode(JSContext* aCx) override; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) override; }; } // namespace dom diff --git a/dom/html/HTMLDataListElement.cpp b/dom/html/HTMLDataListElement.cpp index 2c8b99c7b5..bf304f9cc5 100644 --- a/dom/html/HTMLDataListElement.cpp +++ b/dom/html/HTMLDataListElement.cpp @@ -16,9 +16,9 @@ HTMLDataListElement::~HTMLDataListElement() } JSObject* -HTMLDataListElement::WrapNode(JSContext *aCx) +HTMLDataListElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return HTMLDataListElementBinding::Wrap(aCx, this); + return HTMLDataListElementBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_INHERITED(HTMLDataListElement, nsGenericHTMLElement, diff --git a/dom/html/HTMLDataListElement.h b/dom/html/HTMLDataListElement.h index 6c71f24f4f..9f2fe5828e 100644 --- a/dom/html/HTMLDataListElement.h +++ b/dom/html/HTMLDataListElement.h @@ -44,7 +44,7 @@ public: protected: virtual ~HTMLDataListElement(); - virtual JSObject* WrapNode(JSContext *aCx) override; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) override; //