Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv
authorBoris Zbarsky <bzbarsky@mit.edu>
Thu, 19 Mar 2015 10:13:33 -0400
changeset 234479 0b0c492a33b545fb9daa9b041969e17b5dcbe00e
parent 234478 9b2f419d98ab2258f65c2c6080b905cce1d83e6c
child 234480 0f1732c6f8d51ea1351cba8f459b9df27893c687
push id28446
push userkwierso@gmail.com
push dateFri, 20 Mar 2015 02:15:45 +0000
treeherdermozilla-central@3257d9c4b257 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspeterv
bugs1117172
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1117172 part 3. Change the wrappercached WrapObject methods to allow passing in aGivenProto. r=peterv The only manual changes here are to BindingUtils.h, BindingUtils.cpp, Codegen.py, Element.cpp, IDBFileRequest.cpp, IDBObjectStore.cpp, dom/workers/Navigator.cpp, WorkerPrivate.cpp, DeviceStorageRequestChild.cpp, Notification.cpp, nsGlobalWindow.cpp, MessagePort.cpp, nsJSEnvironment.cpp, Sandbox.cpp, XPCConvert.cpp, ExportHelpers.cpp, and DataStoreService.cpp. The rest of this diff was generated by running the following commands: find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObjectInternal\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapNode\((?:aCx|cx|aContext|aCtx|js))\)/\1, aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(WrapObject\(JSContext *\* *(?:aCx|cx|aContext|aCtx|js))\)/\1, JS::Handle<JSObject*> aGivenProto)/g' find . -name "*.h" -o -name "*.cpp" | xargs perl -pi -e 'BEGIN { $/ = undef } s/(Binding(?:_workers)?::Wrap\((?:aCx|cx|aContext|aCtx|js), [^,)]+)\)/\1, aGivenProto)/g'
dom/activities/Activity.cpp
dom/activities/Activity.h
dom/animation/Animation.cpp
dom/animation/Animation.h
dom/animation/AnimationEffect.cpp
dom/animation/AnimationEffect.h
dom/animation/AnimationPlayer.cpp
dom/animation/AnimationPlayer.h
dom/animation/AnimationTimeline.cpp
dom/animation/AnimationTimeline.h
dom/archivereader/ArchiveReader.cpp
dom/archivereader/ArchiveReader.h
dom/archivereader/ArchiveRequest.cpp
dom/archivereader/ArchiveRequest.h
dom/base/Attr.cpp
dom/base/Attr.h
dom/base/BarProps.cpp
dom/base/BarProps.h
dom/base/Comment.cpp
dom/base/Comment.h
dom/base/Console.cpp
dom/base/Console.h
dom/base/Crypto.cpp
dom/base/Crypto.h
dom/base/DOMCursor.cpp
dom/base/DOMCursor.h
dom/base/DOMError.cpp
dom/base/DOMError.h
dom/base/DOMException.cpp
dom/base/DOMException.h
dom/base/DOMImplementation.cpp
dom/base/DOMImplementation.h
dom/base/DOMMatrix.cpp
dom/base/DOMMatrix.h
dom/base/DOMParser.h
dom/base/DOMPoint.cpp
dom/base/DOMPoint.h
dom/base/DOMQuad.cpp
dom/base/DOMQuad.h
dom/base/DOMRect.cpp
dom/base/DOMRect.h
dom/base/DOMRequest.cpp
dom/base/DOMRequest.h
dom/base/DOMStringList.cpp
dom/base/DOMStringList.h
dom/base/DocumentFragment.cpp
dom/base/DocumentFragment.h
dom/base/DocumentType.cpp
dom/base/DocumentType.h
dom/base/Element.cpp
dom/base/Element.h
dom/base/EventSource.cpp
dom/base/EventSource.h
dom/base/File.cpp
dom/base/File.h
dom/base/FragmentOrElement.cpp
dom/base/FragmentOrElement.h
dom/base/MessageChannel.cpp
dom/base/MessageChannel.h
dom/base/MessagePort.cpp
dom/base/MessagePort.h
dom/base/MessagePortList.cpp
dom/base/MessagePortList.h
dom/base/Navigator.cpp
dom/base/Navigator.h
dom/base/PerformanceEntry.cpp
dom/base/PerformanceEntry.h
dom/base/PerformanceMark.cpp
dom/base/PerformanceMark.h
dom/base/PerformanceMeasure.cpp
dom/base/PerformanceMeasure.h
dom/base/PerformanceResourceTiming.cpp
dom/base/PerformanceResourceTiming.h
dom/base/ProcessGlobal.h
dom/base/ShadowRoot.cpp
dom/base/ShadowRoot.h
dom/base/StyleSheetList.cpp
dom/base/StyleSheetList.h
dom/base/SubtleCrypto.cpp
dom/base/SubtleCrypto.h
dom/base/URLSearchParams.cpp
dom/base/URLSearchParams.h
dom/base/WebSocket.cpp
dom/base/WebSocket.h
dom/base/nsContentList.cpp
dom/base/nsContentList.h
dom/base/nsDOMAttributeMap.cpp
dom/base/nsDOMAttributeMap.h
dom/base/nsDOMCaretPosition.cpp
dom/base/nsDOMCaretPosition.h
dom/base/nsDOMDataChannel.cpp
dom/base/nsDOMDataChannel.h
dom/base/nsDOMFileReader.cpp
dom/base/nsDOMFileReader.h
dom/base/nsDOMMutationObserver.h
dom/base/nsDOMSerializer.h
dom/base/nsDOMSettableTokenList.cpp
dom/base/nsDOMSettableTokenList.h
dom/base/nsDOMTokenList.cpp
dom/base/nsDOMTokenList.h
dom/base/nsFormData.cpp
dom/base/nsFormData.h
dom/base/nsGlobalWindow.cpp
dom/base/nsGlobalWindow.h
dom/base/nsHistory.cpp
dom/base/nsHistory.h
dom/base/nsINode.cpp
dom/base/nsINode.h
dom/base/nsInProcessTabChildGlobal.h
dom/base/nsJSEnvironment.cpp
dom/base/nsLocation.cpp
dom/base/nsLocation.h
dom/base/nsMimeTypeArray.cpp
dom/base/nsMimeTypeArray.h
dom/base/nsPerformance.cpp
dom/base/nsPerformance.h
dom/base/nsPluginArray.cpp
dom/base/nsPluginArray.h
dom/base/nsRange.cpp
dom/base/nsRange.h
dom/base/nsScreen.cpp
dom/base/nsScreen.h
dom/base/nsTextNode.cpp
dom/base/nsTextNode.h
dom/base/nsWindowRoot.cpp
dom/base/nsWindowRoot.h
dom/base/nsWrapperCache.h
dom/base/nsXMLHttpRequest.cpp
dom/base/nsXMLHttpRequest.h
dom/battery/BatteryManager.cpp
dom/battery/BatteryManager.h
dom/bindings/BindingUtils.cpp
dom/bindings/BindingUtils.h
dom/bindings/Codegen.py
dom/bluetooth/BluetoothAdapter.cpp
dom/bluetooth/BluetoothAdapter.h
dom/bluetooth/BluetoothDevice.cpp
dom/bluetooth/BluetoothDevice.h
dom/bluetooth/BluetoothManager.cpp
dom/bluetooth/BluetoothManager.h
dom/bluetooth2/BluetoothAdapter.cpp
dom/bluetooth2/BluetoothAdapter.h
dom/bluetooth2/BluetoothClassOfDevice.cpp
dom/bluetooth2/BluetoothClassOfDevice.h
dom/bluetooth2/BluetoothDevice.cpp
dom/bluetooth2/BluetoothDevice.h
dom/bluetooth2/BluetoothDiscoveryHandle.cpp
dom/bluetooth2/BluetoothDiscoveryHandle.h
dom/bluetooth2/BluetoothGatt.cpp
dom/bluetooth2/BluetoothGatt.h
dom/bluetooth2/BluetoothManager.cpp
dom/bluetooth2/BluetoothManager.h
dom/bluetooth2/BluetoothPairingHandle.cpp
dom/bluetooth2/BluetoothPairingHandle.h
dom/bluetooth2/BluetoothPairingListener.cpp
dom/bluetooth2/BluetoothPairingListener.h
dom/broadcastchannel/BroadcastChannel.cpp
dom/broadcastchannel/BroadcastChannel.h
dom/cache/Cache.cpp
dom/cache/Cache.h
dom/cache/CacheStorage.cpp
dom/cache/CacheStorage.h
dom/camera/DOMCameraCapabilities.cpp
dom/camera/DOMCameraCapabilities.h
dom/camera/DOMCameraControl.cpp
dom/camera/DOMCameraControl.h
dom/camera/DOMCameraDetectedFace.cpp
dom/camera/DOMCameraDetectedFace.h
dom/camera/DOMCameraManager.cpp
dom/camera/DOMCameraManager.h
dom/canvas/CanvasGradient.h
dom/canvas/CanvasPath.h
dom/canvas/CanvasPattern.h
dom/canvas/CanvasRenderingContext2D.cpp
dom/canvas/CanvasRenderingContext2D.h
dom/canvas/WebGL1Context.cpp
dom/canvas/WebGL1Context.h
dom/canvas/WebGL2Context.cpp
dom/canvas/WebGL2Context.h
dom/canvas/WebGLActiveInfo.cpp
dom/canvas/WebGLActiveInfo.h
dom/canvas/WebGLBuffer.cpp
dom/canvas/WebGLBuffer.h
dom/canvas/WebGLContext.h
dom/canvas/WebGLExtensions.h
dom/canvas/WebGLFramebuffer.cpp
dom/canvas/WebGLFramebuffer.h
dom/canvas/WebGLProgram.cpp
dom/canvas/WebGLProgram.h
dom/canvas/WebGLQuery.cpp
dom/canvas/WebGLQuery.h
dom/canvas/WebGLRenderbuffer.cpp
dom/canvas/WebGLRenderbuffer.h
dom/canvas/WebGLSampler.cpp
dom/canvas/WebGLSampler.h
dom/canvas/WebGLShader.cpp
dom/canvas/WebGLShader.h
dom/canvas/WebGLSync.cpp
dom/canvas/WebGLSync.h
dom/canvas/WebGLTexture.cpp
dom/canvas/WebGLTexture.h
dom/canvas/WebGLTransformFeedback.cpp
dom/canvas/WebGLTransformFeedback.h
dom/canvas/WebGLUniformLocation.cpp
dom/canvas/WebGLUniformLocation.h
dom/canvas/WebGLVertexArray.cpp
dom/canvas/WebGLVertexArray.h
dom/cellbroadcast/CellBroadcast.cpp
dom/cellbroadcast/CellBroadcast.h
dom/cellbroadcast/CellBroadcastMessage.cpp
dom/cellbroadcast/CellBroadcastMessage.h
dom/crypto/CryptoKey.cpp
dom/crypto/CryptoKey.h
dom/datastore/DataStore.cpp
dom/datastore/DataStore.h
dom/datastore/DataStoreService.cpp
dom/devicestorage/DeviceStorage.h
dom/devicestorage/DeviceStorageRequestChild.cpp
dom/devicestorage/nsDeviceStorage.cpp
dom/events/AnimationEvent.h
dom/events/BeforeAfterKeyboardEvent.h
dom/events/BeforeUnloadEvent.h
dom/events/ClipboardEvent.h
dom/events/CommandEvent.h
dom/events/CompositionEvent.h
dom/events/CustomEvent.cpp
dom/events/CustomEvent.h
dom/events/DataContainerEvent.h
dom/events/DataTransfer.cpp
dom/events/DataTransfer.h
dom/events/DeviceMotionEvent.h
dom/events/DragEvent.h
dom/events/Event.cpp
dom/events/Event.h
dom/events/FocusEvent.h
dom/events/ImageCaptureError.cpp
dom/events/ImageCaptureError.h
dom/events/InputEvent.h
dom/events/KeyboardEvent.h
dom/events/MessageEvent.cpp
dom/events/MessageEvent.h
dom/events/MouseEvent.h
dom/events/MouseScrollEvent.h
dom/events/MutationEvent.h
dom/events/NotifyPaintEvent.h
dom/events/PaintRequest.cpp
dom/events/PaintRequest.h
dom/events/PointerEvent.h
dom/events/ScrollAreaEvent.h
dom/events/SimpleGestureEvent.h
dom/events/SpeechRecognitionError.h
dom/events/StorageEvent.cpp
dom/events/StorageEvent.h
dom/events/Touch.cpp
dom/events/Touch.h
dom/events/TouchEvent.cpp
dom/events/TouchEvent.h
dom/events/TransitionEvent.h
dom/events/UIEvent.h
dom/events/WheelEvent.h
dom/events/XULCommandEvent.h
dom/fetch/Headers.cpp
dom/fetch/Headers.h
dom/fetch/Request.h
dom/fetch/Response.h
dom/filesystem/Directory.cpp
dom/filesystem/Directory.h
dom/fmradio/FMRadio.cpp
dom/fmradio/FMRadio.h
dom/gamepad/Gamepad.cpp
dom/gamepad/Gamepad.h
dom/gamepad/GamepadButton.cpp
dom/gamepad/GamepadButton.h
dom/geolocation/nsGeoPosition.cpp
dom/geolocation/nsGeoPosition.h
dom/geolocation/nsGeolocation.cpp
dom/geolocation/nsGeolocation.h
dom/html/HTMLAllCollection.cpp
dom/html/HTMLAllCollection.h
dom/html/HTMLAnchorElement.cpp
dom/html/HTMLAnchorElement.h
dom/html/HTMLAreaElement.cpp
dom/html/HTMLAreaElement.h
dom/html/HTMLAudioElement.cpp
dom/html/HTMLAudioElement.h
dom/html/HTMLBRElement.cpp
dom/html/HTMLBRElement.h
dom/html/HTMLBodyElement.cpp
dom/html/HTMLBodyElement.h
dom/html/HTMLButtonElement.cpp
dom/html/HTMLButtonElement.h
dom/html/HTMLCanvasElement.cpp
dom/html/HTMLCanvasElement.h
dom/html/HTMLContentElement.cpp
dom/html/HTMLContentElement.h
dom/html/HTMLDataElement.cpp
dom/html/HTMLDataElement.h
dom/html/HTMLDataListElement.cpp
dom/html/HTMLDataListElement.h
dom/html/HTMLDivElement.cpp
dom/html/HTMLDivElement.h
dom/html/HTMLElement.cpp
dom/html/HTMLFieldSetElement.cpp
dom/html/HTMLFieldSetElement.h
dom/html/HTMLFontElement.cpp
dom/html/HTMLFontElement.h
dom/html/HTMLFormControlsCollection.cpp
dom/html/HTMLFormControlsCollection.h
dom/html/HTMLFormElement.cpp
dom/html/HTMLFormElement.h
dom/html/HTMLFrameElement.cpp
dom/html/HTMLFrameElement.h
dom/html/HTMLFrameSetElement.cpp
dom/html/HTMLFrameSetElement.h
dom/html/HTMLHRElement.cpp
dom/html/HTMLHRElement.h
dom/html/HTMLHeadingElement.cpp
dom/html/HTMLHeadingElement.h
dom/html/HTMLIFrameElement.cpp
dom/html/HTMLIFrameElement.h
dom/html/HTMLImageElement.cpp
dom/html/HTMLImageElement.h
dom/html/HTMLInputElement.cpp
dom/html/HTMLInputElement.h
dom/html/HTMLLIElement.cpp
dom/html/HTMLLIElement.h
dom/html/HTMLLabelElement.cpp
dom/html/HTMLLabelElement.h
dom/html/HTMLLegendElement.cpp
dom/html/HTMLLegendElement.h
dom/html/HTMLLinkElement.cpp
dom/html/HTMLLinkElement.h
dom/html/HTMLMapElement.cpp
dom/html/HTMLMapElement.h
dom/html/HTMLMenuElement.cpp
dom/html/HTMLMenuElement.h
dom/html/HTMLMenuItemElement.cpp
dom/html/HTMLMenuItemElement.h
dom/html/HTMLMetaElement.cpp
dom/html/HTMLMetaElement.h
dom/html/HTMLMeterElement.cpp
dom/html/HTMLMeterElement.h
dom/html/HTMLModElement.cpp
dom/html/HTMLModElement.h
dom/html/HTMLObjectElement.cpp
dom/html/HTMLObjectElement.h
dom/html/HTMLOptGroupElement.cpp
dom/html/HTMLOptGroupElement.h
dom/html/HTMLOptionElement.cpp
dom/html/HTMLOptionElement.h
dom/html/HTMLOptionsCollection.cpp
dom/html/HTMLOptionsCollection.h
dom/html/HTMLOutputElement.cpp
dom/html/HTMLOutputElement.h
dom/html/HTMLParagraphElement.cpp
dom/html/HTMLParagraphElement.h
dom/html/HTMLPictureElement.cpp
dom/html/HTMLPictureElement.h
dom/html/HTMLPreElement.cpp
dom/html/HTMLPreElement.h
dom/html/HTMLProgressElement.cpp
dom/html/HTMLProgressElement.h
dom/html/HTMLPropertiesCollection.cpp
dom/html/HTMLPropertiesCollection.h
dom/html/HTMLScriptElement.cpp
dom/html/HTMLScriptElement.h
dom/html/HTMLSelectElement.cpp
dom/html/HTMLSelectElement.h
dom/html/HTMLShadowElement.cpp
dom/html/HTMLShadowElement.h
dom/html/HTMLSharedElement.cpp
dom/html/HTMLSharedElement.h
dom/html/HTMLSharedListElement.cpp
dom/html/HTMLSharedListElement.h
dom/html/HTMLSharedObjectElement.cpp
dom/html/HTMLSharedObjectElement.h
dom/html/HTMLSourceElement.cpp
dom/html/HTMLSourceElement.h
dom/html/HTMLSpanElement.cpp
dom/html/HTMLSpanElement.h
dom/html/HTMLStyleElement.cpp
dom/html/HTMLStyleElement.h
dom/html/HTMLTableCaptionElement.cpp
dom/html/HTMLTableCaptionElement.h
dom/html/HTMLTableCellElement.cpp
dom/html/HTMLTableCellElement.h
dom/html/HTMLTableColElement.cpp
dom/html/HTMLTableColElement.h
dom/html/HTMLTableElement.cpp
dom/html/HTMLTableElement.h
dom/html/HTMLTableRowElement.cpp
dom/html/HTMLTableRowElement.h
dom/html/HTMLTableSectionElement.cpp
dom/html/HTMLTableSectionElement.h
dom/html/HTMLTemplateElement.cpp
dom/html/HTMLTemplateElement.h
dom/html/HTMLTextAreaElement.cpp
dom/html/HTMLTextAreaElement.h
dom/html/HTMLTimeElement.cpp
dom/html/HTMLTimeElement.h
dom/html/HTMLTitleElement.cpp
dom/html/HTMLTitleElement.h
dom/html/HTMLTrackElement.cpp
dom/html/HTMLTrackElement.h
dom/html/HTMLUnknownElement.cpp
dom/html/HTMLUnknownElement.h
dom/html/HTMLVideoElement.cpp
dom/html/HTMLVideoElement.h
dom/html/ImageDocument.cpp
dom/html/ImageDocument.h
dom/html/MediaError.cpp
dom/html/MediaError.h
dom/html/RadioNodeList.cpp
dom/html/RadioNodeList.h
dom/html/UndoManager.h
dom/html/ValidityState.cpp
dom/html/ValidityState.h
dom/html/nsDOMStringMap.cpp
dom/html/nsDOMStringMap.h
dom/html/nsHTMLDocument.cpp
dom/html/nsHTMLDocument.h
dom/html/nsIHTMLCollection.h
dom/icc/Icc.cpp
dom/icc/Icc.h
dom/icc/IccCardLockError.cpp
dom/icc/IccCardLockError.h
dom/icc/IccInfo.cpp
dom/icc/IccInfo.h
dom/icc/IccManager.cpp
dom/icc/IccManager.h
dom/indexedDB/IDBCursor.cpp
dom/indexedDB/IDBCursor.h
dom/indexedDB/IDBDatabase.cpp
dom/indexedDB/IDBDatabase.h
dom/indexedDB/IDBEvents.cpp
dom/indexedDB/IDBEvents.h
dom/indexedDB/IDBFactory.cpp
dom/indexedDB/IDBFactory.h
dom/indexedDB/IDBFileHandle.cpp
dom/indexedDB/IDBFileHandle.h
dom/indexedDB/IDBFileRequest.cpp
dom/indexedDB/IDBFileRequest.h
dom/indexedDB/IDBIndex.cpp
dom/indexedDB/IDBIndex.h
dom/indexedDB/IDBMutableFile.cpp
dom/indexedDB/IDBMutableFile.h
dom/indexedDB/IDBObjectStore.cpp
dom/indexedDB/IDBObjectStore.h
dom/indexedDB/IDBRequest.cpp
dom/indexedDB/IDBRequest.h
dom/indexedDB/IDBTransaction.cpp
dom/indexedDB/IDBTransaction.h
dom/ipc/TabChild.h
dom/mathml/nsMathMLElement.cpp
dom/mathml/nsMathMLElement.h
dom/media/AudioStreamTrack.cpp
dom/media/AudioStreamTrack.h
dom/media/AudioTrack.cpp
dom/media/AudioTrack.h
dom/media/AudioTrackList.cpp
dom/media/AudioTrackList.h
dom/media/DOMMediaStream.cpp
dom/media/DOMMediaStream.h
dom/media/GetUserMediaRequest.cpp
dom/media/GetUserMediaRequest.h
dom/media/MediaDevices.cpp
dom/media/MediaDevices.h
dom/media/MediaRecorder.cpp
dom/media/MediaRecorder.h
dom/media/MediaStreamError.cpp
dom/media/MediaStreamError.h
dom/media/MediaStreamTrack.h
dom/media/RTCIdentityProviderRegistrar.cpp
dom/media/RTCIdentityProviderRegistrar.h
dom/media/TextTrack.cpp
dom/media/TextTrack.h
dom/media/TextTrackCue.cpp
dom/media/TextTrackCue.h
dom/media/TextTrackCueList.cpp
dom/media/TextTrackCueList.h
dom/media/TextTrackList.cpp
dom/media/TextTrackList.h
dom/media/TextTrackRegion.cpp
dom/media/TextTrackRegion.h
dom/media/VideoPlaybackQuality.cpp
dom/media/VideoPlaybackQuality.h
dom/media/VideoStreamTrack.cpp
dom/media/VideoStreamTrack.h
dom/media/VideoTrack.cpp
dom/media/VideoTrack.h
dom/media/VideoTrackList.cpp
dom/media/VideoTrackList.h
dom/media/eme/MediaEncryptedEvent.cpp
dom/media/eme/MediaEncryptedEvent.h
dom/media/eme/MediaKeyError.cpp
dom/media/eme/MediaKeyError.h
dom/media/eme/MediaKeyMessageEvent.cpp
dom/media/eme/MediaKeyMessageEvent.h
dom/media/eme/MediaKeySession.cpp
dom/media/eme/MediaKeySession.h
dom/media/eme/MediaKeyStatusMap.cpp
dom/media/eme/MediaKeyStatusMap.h
dom/media/eme/MediaKeySystemAccess.cpp
dom/media/eme/MediaKeySystemAccess.h
dom/media/eme/MediaKeys.cpp
dom/media/eme/MediaKeys.h
dom/media/imagecapture/ImageCapture.h
dom/media/mediasource/MediaSource.cpp
dom/media/mediasource/MediaSource.h
dom/media/mediasource/SourceBuffer.cpp
dom/media/mediasource/SourceBuffer.h
dom/media/mediasource/SourceBufferList.cpp
dom/media/mediasource/SourceBufferList.h
dom/media/webaudio/AnalyserNode.cpp
dom/media/webaudio/AnalyserNode.h
dom/media/webaudio/AudioBuffer.cpp
dom/media/webaudio/AudioBuffer.h
dom/media/webaudio/AudioBufferSourceNode.cpp
dom/media/webaudio/AudioBufferSourceNode.h
dom/media/webaudio/AudioContext.cpp
dom/media/webaudio/AudioContext.h
dom/media/webaudio/AudioDestinationNode.cpp
dom/media/webaudio/AudioDestinationNode.h
dom/media/webaudio/AudioListener.cpp
dom/media/webaudio/AudioListener.h
dom/media/webaudio/AudioParam.cpp
dom/media/webaudio/AudioParam.h
dom/media/webaudio/AudioProcessingEvent.cpp
dom/media/webaudio/AudioProcessingEvent.h
dom/media/webaudio/BiquadFilterNode.cpp
dom/media/webaudio/BiquadFilterNode.h
dom/media/webaudio/ChannelMergerNode.cpp
dom/media/webaudio/ChannelMergerNode.h
dom/media/webaudio/ChannelSplitterNode.cpp
dom/media/webaudio/ChannelSplitterNode.h
dom/media/webaudio/ConvolverNode.cpp
dom/media/webaudio/ConvolverNode.h
dom/media/webaudio/DelayNode.cpp
dom/media/webaudio/DelayNode.h
dom/media/webaudio/DynamicsCompressorNode.cpp
dom/media/webaudio/DynamicsCompressorNode.h
dom/media/webaudio/GainNode.cpp
dom/media/webaudio/GainNode.h
dom/media/webaudio/MediaElementAudioSourceNode.cpp
dom/media/webaudio/MediaElementAudioSourceNode.h
dom/media/webaudio/MediaStreamAudioDestinationNode.cpp
dom/media/webaudio/MediaStreamAudioDestinationNode.h
dom/media/webaudio/MediaStreamAudioSourceNode.cpp
dom/media/webaudio/MediaStreamAudioSourceNode.h
dom/media/webaudio/OfflineAudioCompletionEvent.cpp
dom/media/webaudio/OfflineAudioCompletionEvent.h
dom/media/webaudio/OscillatorNode.cpp
dom/media/webaudio/OscillatorNode.h
dom/media/webaudio/PannerNode.cpp
dom/media/webaudio/PannerNode.h
dom/media/webaudio/PeriodicWave.cpp
dom/media/webaudio/PeriodicWave.h
dom/media/webaudio/ScriptProcessorNode.cpp
dom/media/webaudio/ScriptProcessorNode.h
dom/media/webaudio/StereoPannerNode.cpp
dom/media/webaudio/StereoPannerNode.h
dom/media/webaudio/WaveShaperNode.cpp
dom/media/webaudio/WaveShaperNode.h
dom/media/webspeech/recognition/SpeechGrammar.cpp
dom/media/webspeech/recognition/SpeechGrammar.h
dom/media/webspeech/recognition/SpeechGrammarList.cpp
dom/media/webspeech/recognition/SpeechGrammarList.h
dom/media/webspeech/recognition/SpeechRecognition.cpp
dom/media/webspeech/recognition/SpeechRecognition.h
dom/media/webspeech/recognition/SpeechRecognitionAlternative.cpp
dom/media/webspeech/recognition/SpeechRecognitionAlternative.h
dom/media/webspeech/recognition/SpeechRecognitionResult.cpp
dom/media/webspeech/recognition/SpeechRecognitionResult.h
dom/media/webspeech/recognition/SpeechRecognitionResultList.cpp
dom/media/webspeech/recognition/SpeechRecognitionResultList.h
dom/media/webspeech/synth/SpeechSynthesis.cpp
dom/media/webspeech/synth/SpeechSynthesis.h
dom/media/webspeech/synth/SpeechSynthesisUtterance.cpp
dom/media/webspeech/synth/SpeechSynthesisUtterance.h
dom/media/webspeech/synth/SpeechSynthesisVoice.cpp
dom/media/webspeech/synth/SpeechSynthesisVoice.h
dom/mobileconnection/MobileCellInfo.cpp
dom/mobileconnection/MobileCellInfo.h
dom/mobileconnection/MobileConnection.cpp
dom/mobileconnection/MobileConnection.h
dom/mobileconnection/MobileConnectionArray.cpp
dom/mobileconnection/MobileConnectionArray.h
dom/mobileconnection/MobileConnectionInfo.cpp
dom/mobileconnection/MobileConnectionInfo.h
dom/mobileconnection/MobileNetworkInfo.cpp
dom/mobileconnection/MobileNetworkInfo.h
dom/mobilemessage/DOMMobileMessageError.cpp
dom/mobilemessage/DOMMobileMessageError.h
dom/mobilemessage/MobileMessageManager.cpp
dom/mobilemessage/MobileMessageManager.h
dom/network/Connection.cpp
dom/network/Connection.h
dom/network/UDPSocket.cpp
dom/network/UDPSocket.h
dom/nfc/MozIsoDepTech.cpp
dom/nfc/MozIsoDepTech.h
dom/nfc/MozNDEFRecord.cpp
dom/nfc/MozNDEFRecord.h
dom/notification/DesktopNotification.cpp
dom/notification/DesktopNotification.h
dom/notification/Notification.cpp
dom/notification/Notification.h
dom/offline/nsDOMOfflineResourceList.cpp
dom/offline/nsDOMOfflineResourceList.h
dom/power/PowerManager.cpp
dom/power/PowerManager.h
dom/power/WakeLock.cpp
dom/power/WakeLock.h
dom/promise/AbortablePromise.cpp
dom/promise/AbortablePromise.h
dom/promise/Promise.cpp
dom/promise/Promise.h
dom/smil/TimeEvent.h
dom/speakermanager/SpeakerManager.cpp
dom/speakermanager/SpeakerManager.h
dom/storage/DOMStorage.cpp
dom/storage/DOMStorage.h
dom/svg/DOMSVGAnimatedLengthList.cpp
dom/svg/DOMSVGAnimatedLengthList.h
dom/svg/DOMSVGAnimatedNumberList.cpp
dom/svg/DOMSVGAnimatedNumberList.h
dom/svg/DOMSVGLength.cpp
dom/svg/DOMSVGLength.h
dom/svg/DOMSVGLengthList.cpp
dom/svg/DOMSVGLengthList.h
dom/svg/DOMSVGNumber.cpp
dom/svg/DOMSVGNumber.h
dom/svg/DOMSVGNumberList.cpp
dom/svg/DOMSVGNumberList.h
dom/svg/DOMSVGPathSeg.h
dom/svg/DOMSVGPathSegList.cpp
dom/svg/DOMSVGPathSegList.h
dom/svg/DOMSVGPointList.cpp
dom/svg/DOMSVGPointList.h
dom/svg/DOMSVGStringList.cpp
dom/svg/DOMSVGStringList.h
dom/svg/DOMSVGTransformList.cpp
dom/svg/DOMSVGTransformList.h
dom/svg/SVGAElement.cpp
dom/svg/SVGAElement.h
dom/svg/SVGAltGlyphElement.cpp
dom/svg/SVGAltGlyphElement.h
dom/svg/SVGAngle.cpp
dom/svg/SVGAngle.h
dom/svg/SVGAnimateElement.cpp
dom/svg/SVGAnimateElement.h
dom/svg/SVGAnimateMotionElement.cpp
dom/svg/SVGAnimateMotionElement.h
dom/svg/SVGAnimateTransformElement.cpp
dom/svg/SVGAnimateTransformElement.h
dom/svg/SVGAnimatedAngle.cpp
dom/svg/SVGAnimatedAngle.h
dom/svg/SVGAnimatedBoolean.cpp
dom/svg/SVGAnimatedBoolean.h
dom/svg/SVGAnimatedEnumeration.cpp
dom/svg/SVGAnimatedEnumeration.h
dom/svg/SVGAnimatedInteger.cpp
dom/svg/SVGAnimatedInteger.h
dom/svg/SVGAnimatedLength.cpp
dom/svg/SVGAnimatedLength.h
dom/svg/SVGAnimatedNumber.cpp
dom/svg/SVGAnimatedNumber.h
dom/svg/SVGAnimatedPreserveAspectRatio.cpp
dom/svg/SVGAnimatedPreserveAspectRatio.h
dom/svg/SVGAnimatedRect.cpp
dom/svg/SVGAnimatedRect.h
dom/svg/SVGAnimatedString.cpp
dom/svg/SVGAnimatedString.h
dom/svg/SVGAnimatedTransformList.cpp
dom/svg/SVGAnimatedTransformList.h
dom/svg/SVGCircleElement.cpp
dom/svg/SVGCircleElement.h
dom/svg/SVGClipPathElement.cpp
dom/svg/SVGClipPathElement.h
dom/svg/SVGComponentTransferFunctionElement.h
dom/svg/SVGDefsElement.cpp
dom/svg/SVGDefsElement.h
dom/svg/SVGDescElement.cpp
dom/svg/SVGDescElement.h
dom/svg/SVGDocument.cpp
dom/svg/SVGDocument.h
dom/svg/SVGEllipseElement.cpp
dom/svg/SVGEllipseElement.h
dom/svg/SVGFEBlendElement.cpp
dom/svg/SVGFEBlendElement.h
dom/svg/SVGFEColorMatrixElement.cpp
dom/svg/SVGFEColorMatrixElement.h
dom/svg/SVGFEComponentTransferElement.cpp
dom/svg/SVGFEComponentTransferElement.h
dom/svg/SVGFECompositeElement.cpp
dom/svg/SVGFECompositeElement.h
dom/svg/SVGFEConvolveMatrixElement.cpp
dom/svg/SVGFEConvolveMatrixElement.h
dom/svg/SVGFEDiffuseLightingElement.cpp
dom/svg/SVGFEDiffuseLightingElement.h
dom/svg/SVGFEDisplacementMapElement.cpp
dom/svg/SVGFEDisplacementMapElement.h
dom/svg/SVGFEDistantLightElement.cpp
dom/svg/SVGFEDistantLightElement.h
dom/svg/SVGFEDropShadowElement.cpp
dom/svg/SVGFEDropShadowElement.h
dom/svg/SVGFEFloodElement.cpp
dom/svg/SVGFEFloodElement.h
dom/svg/SVGFEGaussianBlurElement.cpp
dom/svg/SVGFEGaussianBlurElement.h
dom/svg/SVGFEImageElement.cpp
dom/svg/SVGFEImageElement.h
dom/svg/SVGFEMergeElement.cpp
dom/svg/SVGFEMergeElement.h
dom/svg/SVGFEMergeNodeElement.cpp
dom/svg/SVGFEMergeNodeElement.h
dom/svg/SVGFEMorphologyElement.cpp
dom/svg/SVGFEMorphologyElement.h
dom/svg/SVGFEOffsetElement.cpp
dom/svg/SVGFEOffsetElement.h
dom/svg/SVGFEPointLightElement.cpp
dom/svg/SVGFEPointLightElement.h
dom/svg/SVGFESpecularLightingElement.cpp
dom/svg/SVGFESpecularLightingElement.h
dom/svg/SVGFESpotLightElement.cpp
dom/svg/SVGFESpotLightElement.h
dom/svg/SVGFETileElement.cpp
dom/svg/SVGFETileElement.h
dom/svg/SVGFETurbulenceElement.cpp
dom/svg/SVGFETurbulenceElement.h
dom/svg/SVGFilterElement.cpp
dom/svg/SVGFilterElement.h
dom/svg/SVGForeignObjectElement.cpp
dom/svg/SVGForeignObjectElement.h
dom/svg/SVGGElement.cpp
dom/svg/SVGGElement.h
dom/svg/SVGGradientElement.cpp
dom/svg/SVGGradientElement.h
dom/svg/SVGIRect.h
dom/svg/SVGImageElement.cpp
dom/svg/SVGImageElement.h
dom/svg/SVGLineElement.cpp
dom/svg/SVGLineElement.h
dom/svg/SVGMPathElement.cpp
dom/svg/SVGMPathElement.h
dom/svg/SVGMarkerElement.cpp
dom/svg/SVGMarkerElement.h
dom/svg/SVGMaskElement.cpp
dom/svg/SVGMaskElement.h
dom/svg/SVGMatrix.cpp
dom/svg/SVGMatrix.h
dom/svg/SVGMetadataElement.cpp
dom/svg/SVGMetadataElement.h
dom/svg/SVGPathElement.cpp
dom/svg/SVGPathElement.h
dom/svg/SVGPatternElement.cpp
dom/svg/SVGPatternElement.h
dom/svg/SVGPolygonElement.cpp
dom/svg/SVGPolygonElement.h
dom/svg/SVGPolylineElement.cpp
dom/svg/SVGPolylineElement.h
dom/svg/SVGPreserveAspectRatio.cpp
dom/svg/SVGPreserveAspectRatio.h
dom/svg/SVGRectElement.cpp
dom/svg/SVGRectElement.h
dom/svg/SVGSVGElement.cpp
dom/svg/SVGSVGElement.h
dom/svg/SVGScriptElement.cpp
dom/svg/SVGScriptElement.h
dom/svg/SVGSetElement.cpp
dom/svg/SVGSetElement.h
dom/svg/SVGStopElement.cpp
dom/svg/SVGStopElement.h
dom/svg/SVGStyleElement.cpp
dom/svg/SVGStyleElement.h
dom/svg/SVGSwitchElement.cpp
dom/svg/SVGSwitchElement.h
dom/svg/SVGSymbolElement.cpp
dom/svg/SVGSymbolElement.h
dom/svg/SVGTSpanElement.cpp
dom/svg/SVGTSpanElement.h
dom/svg/SVGTextElement.cpp
dom/svg/SVGTextElement.h
dom/svg/SVGTextPathElement.cpp
dom/svg/SVGTextPathElement.h
dom/svg/SVGTitleElement.cpp
dom/svg/SVGTitleElement.h
dom/svg/SVGTransform.cpp
dom/svg/SVGTransform.h
dom/svg/SVGUseElement.cpp
dom/svg/SVGUseElement.h
dom/svg/SVGViewElement.cpp
dom/svg/SVGViewElement.h
dom/svg/SVGZoomEvent.h
dom/svg/nsISVGPoint.h
dom/svg/nsSVGElement.cpp
dom/svg/nsSVGElement.h
dom/svg/nsSVGFilters.cpp
dom/system/gonk/AudioChannelManager.cpp
dom/system/gonk/AudioChannelManager.h
dom/telephony/CallsList.cpp
dom/telephony/CallsList.h
dom/telephony/MMICall.cpp
dom/telephony/MMICall.h
dom/telephony/Telephony.cpp
dom/telephony/Telephony.h
dom/telephony/TelephonyCall.cpp
dom/telephony/TelephonyCall.h
dom/telephony/TelephonyCallGroup.cpp
dom/telephony/TelephonyCallGroup.h
dom/telephony/TelephonyCallId.cpp
dom/telephony/TelephonyCallId.h
dom/telephony/USSDSession.cpp
dom/telephony/USSDSession.h
dom/time/TimeManager.cpp
dom/time/TimeManager.h
dom/tv/TVChannel.cpp
dom/tv/TVChannel.h
dom/tv/TVManager.cpp
dom/tv/TVManager.h
dom/tv/TVProgram.cpp
dom/tv/TVProgram.h
dom/tv/TVSource.cpp
dom/tv/TVSource.h
dom/tv/TVTuner.cpp
dom/tv/TVTuner.h
dom/voicemail/Voicemail.cpp
dom/voicemail/Voicemail.h
dom/voicemail/VoicemailStatus.cpp
dom/voicemail/VoicemailStatus.h
dom/vr/VRDevice.cpp
dom/vr/VRDevice.h
dom/workers/DataStore.cpp
dom/workers/DataStore.h
dom/workers/Location.cpp
dom/workers/Location.h
dom/workers/MessagePort.cpp
dom/workers/MessagePort.h
dom/workers/Navigator.cpp
dom/workers/Navigator.h
dom/workers/Performance.cpp
dom/workers/Performance.h
dom/workers/ServiceWorker.cpp
dom/workers/ServiceWorker.h
dom/workers/ServiceWorkerClient.cpp
dom/workers/ServiceWorkerClient.h
dom/workers/ServiceWorkerClients.cpp
dom/workers/ServiceWorkerClients.h
dom/workers/ServiceWorkerContainer.cpp
dom/workers/ServiceWorkerContainer.h
dom/workers/ServiceWorkerEvents.h
dom/workers/ServiceWorkerRegistration.cpp
dom/workers/ServiceWorkerRegistration.h
dom/workers/ServiceWorkerWindowClient.cpp
dom/workers/ServiceWorkerWindowClient.h
dom/workers/SharedWorker.cpp
dom/workers/SharedWorker.h
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerPrivate.h
dom/workers/WorkerScope.cpp
dom/workers/WorkerScope.h
dom/workers/XMLHttpRequest.cpp
dom/workers/XMLHttpRequest.h
dom/workers/XMLHttpRequestUpload.cpp
dom/workers/XMLHttpRequestUpload.h
dom/xbl/XBLChildrenElement.cpp
dom/xbl/XBLChildrenElement.h
dom/xml/CDATASection.cpp
dom/xml/CDATASection.h
dom/xml/ProcessingInstruction.cpp
dom/xml/ProcessingInstruction.h
dom/xml/XMLDocument.cpp
dom/xml/XMLDocument.h
dom/xml/XMLStylesheetProcessingInstruction.cpp
dom/xml/XMLStylesheetProcessingInstruction.h
dom/xml/nsXMLElement.cpp
dom/xml/nsXMLElement.h
dom/xslt/xpath/XPathResult.cpp
dom/xslt/xpath/XPathResult.h
dom/xslt/xslt/txMozillaXSLTProcessor.cpp
dom/xslt/xslt/txMozillaXSLTProcessor.h
dom/xul/XULDocument.cpp
dom/xul/XULDocument.h
dom/xul/nsXULElement.cpp
dom/xul/nsXULElement.h
js/xpconnect/public/SandboxPrivate.h
js/xpconnect/src/ExportHelpers.cpp
js/xpconnect/src/Sandbox.cpp
js/xpconnect/src/XPCConvert.cpp
layout/generic/Selection.h
layout/generic/nsSelection.cpp
layout/style/CSSRuleList.cpp
layout/style/CSSRuleList.h
layout/style/CSSStyleSheet.cpp
layout/style/CSSStyleSheet.h
layout/style/FontFace.cpp
layout/style/FontFace.h
layout/style/FontFaceSet.cpp
layout/style/FontFaceSet.h
layout/style/MediaQueryList.cpp
layout/style/MediaQueryList.h
layout/style/nsCSSRules.cpp
layout/style/nsCSSRules.h
layout/style/nsDOMCSSDeclaration.cpp
layout/style/nsDOMCSSDeclaration.h
layout/style/nsDOMCSSRGBColor.cpp
layout/style/nsDOMCSSRGBColor.h
layout/style/nsDOMCSSRect.cpp
layout/style/nsDOMCSSRect.h
layout/style/nsDOMCSSValueList.cpp
layout/style/nsDOMCSSValueList.h
layout/style/nsIMediaList.h
layout/style/nsROCSSPrimitiveValue.cpp
layout/style/nsROCSSPrimitiveValue.h
layout/xul/BoxObject.cpp
layout/xul/BoxObject.h
layout/xul/ContainerBoxObject.cpp
layout/xul/ContainerBoxObject.h
layout/xul/ListBoxObject.cpp
layout/xul/ListBoxObject.h
layout/xul/MenuBoxObject.cpp
layout/xul/MenuBoxObject.h
layout/xul/PopupBoxObject.cpp
layout/xul/PopupBoxObject.h
layout/xul/ScrollBoxObject.cpp
layout/xul/ScrollBoxObject.h
layout/xul/tree/TreeBoxObject.cpp
layout/xul/tree/TreeBoxObject.h
layout/xul/tree/nsTreeColumns.cpp
layout/xul/tree/nsTreeColumns.h
media/webrtc/signaling/src/peerconnection/MediaStreamList.cpp
media/webrtc/signaling/src/peerconnection/MediaStreamList.h
toolkit/components/places/tests/cpp/mock_Link.h
--- a/dom/activities/Activity.cpp
+++ b/dom/activities/Activity.cpp
@@ -20,19 +20,19 @@ NS_IMPL_RELEASE_INHERITED(Activity, DOMR
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(Activity, DOMRequest,
                                    mProxy)
 
 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<JSObject*> aGivenProto)
 {
-  return MozActivityBinding::Wrap(aCx, this);
+  return MozActivityBinding::Wrap(aCx, this, aGivenProto);
 }
 
 nsresult
 Activity::Initialize(nsPIDOMWindow* aWindow,
                      JSContext* aCx,
                      const ActivityOptions& aOptions)
 {
   MOZ_ASSERT(aWindow);
--- a/dom/activities/Activity.h
+++ b/dom/activities/Activity.h
@@ -16,17 +16,17 @@ namespace mozilla {
 namespace dom {
 
 class Activity : public DOMRequest
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(Activity, DOMRequest)
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   static already_AddRefed<Activity>
   Constructor(const GlobalObject& aOwner,
               const ActivityOptions& aOptions,
               ErrorResult& aRv)
   {
     nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aOwner.GetAsSupports());
     if (!window) {
--- a/dom/animation/Animation.cpp
+++ b/dom/animation/Animation.cpp
@@ -61,19 +61,19 @@ const double ComputedTiming::kNullTimeFr
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Animation, mDocument, mTarget)
 
 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<JSObject*> aGivenProto)
 {
-  return AnimationBinding::Wrap(aCx, this);
+  return AnimationBinding::Wrap(aCx, this, aGivenProto);
 }
 
 already_AddRefed<AnimationEffect>
 Animation::GetEffect()
 {
   nsRefPtr<AnimationEffect> effect = new AnimationEffect(this);
   return effect.forget();
 }
--- a/dom/animation/Animation.h
+++ b/dom/animation/Animation.h
@@ -184,17 +184,17 @@ public:
   {
     MOZ_ASSERT(aTarget, "null animation target is not yet supported");
   }
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(Animation)
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(Animation)
 
   nsIDocument* GetParentObject() const { return mDocument; }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_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
   // virtual methods.
   virtual ElementPropertyTransition* AsTransition() { return nullptr; }
   virtual const ElementPropertyTransition* AsTransition() const {
     return nullptr;
   }
--- a/dom/animation/AnimationEffect.cpp
+++ b/dom/animation/AnimationEffect.cpp
@@ -10,15 +10,15 @@ namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AnimationEffect, mAnimation)
 
 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<JSObject*> aGivenProto)
 {
-  return AnimationEffectBinding::Wrap(aCx, this);
+  return AnimationEffectBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/animation/AnimationEffect.h
+++ b/dom/animation/AnimationEffect.h
@@ -22,17 +22,17 @@ public:
     : mAnimation(aAnimation)
   {
   }
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AnimationEffect)
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AnimationEffect)
 
   Animation* GetParentObject() const { return mAnimation; }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // AnimationEffect interface
   void GetName(nsString& aRetVal) const {
     aRetVal = mAnimation->Name();
   }
 
 private:
   ~AnimationEffect() { }
--- a/dom/animation/AnimationPlayer.cpp
+++ b/dom/animation/AnimationPlayer.cpp
@@ -21,19 +21,19 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(An
 NS_IMPL_CYCLE_COLLECTING_ADDREF(AnimationPlayer)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(AnimationPlayer)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AnimationPlayer)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 JSObject*
-AnimationPlayer::WrapObject(JSContext* aCx)
+AnimationPlayer::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return dom::AnimationPlayerBinding::Wrap(aCx, this);
+  return dom::AnimationPlayerBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
 AnimationPlayer::SetStartTime(const Nullable<TimeDuration>& aNewStartTime)
 {
 #if 1
   // Bug 1096776: once we support inactive/missing timelines we'll want to take
   // the disabled branch.
--- a/dom/animation/AnimationPlayer.h
+++ b/dom/animation/AnimationPlayer.h
@@ -59,17 +59,17 @@ public:
     , mIsRelevant(false)
   {
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AnimationPlayer)
 
   AnimationTimeline* GetParentObject() const { return mTimeline; }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   virtual CSSAnimationPlayer* AsCSSAnimationPlayer() { return nullptr; }
   virtual CSSTransitionPlayer* AsCSSTransitionPlayer() { return nullptr; }
 
   // AnimationPlayer methods
   Animation* GetSource() const { return mSource; }
   AnimationTimeline* Timeline() const { return mTimeline; }
   Nullable<TimeDuration> GetStartTime() const { return mStartTime; }
--- a/dom/animation/AnimationTimeline.cpp
+++ b/dom/animation/AnimationTimeline.cpp
@@ -16,19 +16,19 @@ namespace mozilla {
 namespace dom {
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(AnimationTimeline, mDocument, mWindow)
 
 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<JSObject*> aGivenProto)
 {
-  return AnimationTimelineBinding::Wrap(aCx, this);
+  return AnimationTimelineBinding::Wrap(aCx, this, aGivenProto);
 }
 
 Nullable<TimeDuration>
 AnimationTimeline::GetCurrentTime() const
 {
   return ToTimelineTime(GetCurrentTimeStamp());
 }
 
--- a/dom/animation/AnimationTimeline.h
+++ b/dom/animation/AnimationTimeline.h
@@ -36,17 +36,17 @@ protected:
 public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(AnimationTimeline)
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AnimationTimeline)
 
   nsIGlobalObject* GetParentObject() const
   {
     return mWindow;
   }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // AnimationTimeline methods
   Nullable<TimeDuration> GetCurrentTime() const;
 
   // Wrapper functions for AnimationTimeline DOM methods when called from
   // script.
   Nullable<double> GetCurrentTimeAsDouble() const;
 
--- a/dom/archivereader/ArchiveReader.cpp
+++ b/dom/archivereader/ArchiveReader.cpp
@@ -56,19 +56,19 @@ ArchiveReader::ArchiveReader(File& aBlob
   MOZ_ASSERT(aWindow);
 }
 
 ArchiveReader::~ArchiveReader()
 {
 }
 
 /* virtual */ JSObject*
-ArchiveReader::WrapObject(JSContext* aCx)
+ArchiveReader::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return ArchiveReaderBinding::Wrap(aCx, this);
+  return ArchiveReaderBinding::Wrap(aCx, this, aGivenProto);
 }
 
 nsresult
 ArchiveReader::RegisterRequest(ArchiveRequest* aRequest)
 {
   switch (mStatus) {
     // Append to the list and let's start to work:
     case NOT_STARTED:
--- a/dom/archivereader/ArchiveReader.h
+++ b/dom/archivereader/ArchiveReader.h
@@ -46,17 +46,17 @@ public:
   ArchiveReader(File& aBlob, nsPIDOMWindow* aWindow,
                 const nsACString& aEncoding);
 
   nsIDOMWindow* GetParentObject() const
   {
     return mWindow;
   }
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   already_AddRefed<ArchiveRequest> GetFilenames();
   already_AddRefed<ArchiveRequest> GetFile(const nsAString& filename);
   already_AddRefed<ArchiveRequest> GetFiles();
 
   nsresult GetInputStream(nsIInputStream** aInputStream);
   nsresult GetSize(uint64_t* aSize);
 
--- a/dom/archivereader/ArchiveRequest.cpp
+++ b/dom/archivereader/ArchiveRequest.cpp
@@ -72,19 +72,19 @@ nsresult
 ArchiveRequest::PreHandleEvent(EventChainPreVisitor& aVisitor)
 {
   aVisitor.mCanHandle = true;
   aVisitor.mParentTarget = nullptr;
   return NS_OK;
 }
 
 /* virtual */ JSObject*
-ArchiveRequest::WrapObject(JSContext* aCx)
+ArchiveRequest::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return ArchiveRequestBinding::Wrap(aCx, this);
+  return ArchiveRequestBinding::Wrap(aCx, this, aGivenProto);
 }
 
 ArchiveReader*
 ArchiveRequest::Reader() const
 {
   NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
 
   return mArchiveReader;
--- a/dom/archivereader/ArchiveRequest.h
+++ b/dom/archivereader/ArchiveRequest.h
@@ -21,17 +21,17 @@ BEGIN_ARCHIVEREADER_NAMESPACE
 
 /**
  * This is the ArchiveRequest that handles any operation
  * related to ArchiveReader
  */
 class ArchiveRequest : public mozilla::dom::DOMRequest
 {
 public:
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   ArchiveReader* Reader() const;
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ArchiveRequest, DOMRequest)
 
   ArchiveRequest(nsPIDOMWindow* aWindow,
--- a/dom/base/Attr.cpp
+++ b/dom/base/Attr.cpp
@@ -379,15 +379,15 @@ Attr::Initialize()
 
 void
 Attr::Shutdown()
 {
   sInitialized = false;
 }
 
 JSObject*
-Attr::WrapNode(JSContext* aCx)
+Attr::WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return AttrBinding::Wrap(aCx, this);
+  return AttrBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/Attr.h
+++ b/dom/base/Attr.h
@@ -77,17 +77,17 @@ public:
   static void Shutdown();
 
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Attr,
                                                                    nsIAttribute)
 
   virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
 
   // WebIDL
-  virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // XPCOM GetName() is OK
   // XPCOM GetValue() is OK
 
   void SetValue(const nsAString& aValue, ErrorResult& aRv);
 
   bool Specified() const;
 
--- a/dom/base/BarProps.cpp
+++ b/dom/base/BarProps.cpp
@@ -29,19 +29,19 @@ BarProp::~BarProp()
 
 nsPIDOMWindow*
 BarProp::GetParentObject() const
 {
   return mDOMWindow;
 }
 
 JSObject*
-BarProp::WrapObject(JSContext* aCx)
+BarProp::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return BarPropBinding::Wrap(aCx, this);
+  return BarPropBinding::Wrap(aCx, this, aGivenProto);
 }
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(BarProp, mDOMWindow)
 NS_IMPL_CYCLE_COLLECTING_ADDREF(BarProp)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(BarProp)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(BarProp)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
--- a/dom/base/BarProps.h
+++ b/dom/base/BarProps.h
@@ -35,17 +35,17 @@ public:
   explicit BarProp(nsGlobalWindow *aWindow);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(BarProp)
 
   nsPIDOMWindow* GetParentObject() const;
 
   virtual JSObject*
-  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   virtual bool GetVisible(ErrorResult& aRv) = 0;
   virtual void SetVisible(bool aVisible, ErrorResult& aRv) = 0;
 
 protected:
   virtual ~BarProp();
 
   bool GetVisibleByFlag(uint32_t aChromeFlag, ErrorResult& aRv);
--- a/dom/base/Comment.cpp
+++ b/dom/base/Comment.cpp
@@ -69,15 +69,15 @@ Comment::Constructor(const GlobalObject&
     aRv.Throw(NS_ERROR_FAILURE);
     return nullptr;
   }
 
   return window->GetDoc()->CreateComment(aData);
 }
 
 JSObject*
-Comment::WrapNode(JSContext *aCx)
+Comment::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return CommentBinding::Wrap(aCx, this);
+  return CommentBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/Comment.h
+++ b/dom/base/Comment.h
@@ -67,15 +67,15 @@ public:
   }
 #endif
 
   static already_AddRefed<Comment>
   Constructor(const GlobalObject& aGlobal, const nsAString& aData,
               ErrorResult& aRv);
 
 protected:
-  virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 };
 
 } // namespace dom
 } // namespace mozilla
 
 #endif // mozilla_dom_Comment_h
--- a/dom/base/Console.cpp
+++ b/dom/base/Console.cpp
@@ -717,19 +717,19 @@ Console::Observe(nsISupports* aSubject, 
 
     mTimerRegistry.Clear();
   }
 
   return NS_OK;
 }
 
 JSObject*
-Console::WrapObject(JSContext* aCx)
+Console::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return ConsoleBinding::Wrap(aCx, this);
+  return ConsoleBinding::Wrap(aCx, this, aGivenProto);
 }
 
 #define METHOD(name, string)                                          \
   void                                                                \
   Console::name(JSContext* aCx, const Sequence<JS::Value>& aData)     \
   {                                                                   \
     Method(aCx, Method##name, NS_LITERAL_STRING(string), aData);      \
   }
--- a/dom/base/Console.h
+++ b/dom/base/Console.h
@@ -39,17 +39,17 @@ public:
 
   // WebIDL methods
   nsISupports* GetParentObject() const
   {
     return mWindow;
   }
 
   virtual JSObject*
-  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   void
   Log(JSContext* aCx, const Sequence<JS::Value>& aData);
 
   void
   Info(JSContext* aCx, const Sequence<JS::Value>& aData);
 
   void
--- a/dom/base/Crypto.cpp
+++ b/dom/base/Crypto.cpp
@@ -41,19 +41,19 @@ Crypto::~Crypto()
 void
 Crypto::Init(nsIGlobalObject* aParent)
 {
   mParent = do_QueryInterface(aParent);
   MOZ_ASSERT(mParent);
 }
 
 /* virtual */ JSObject*
-Crypto::WrapObject(JSContext* aCx)
+Crypto::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return CryptoBinding::Wrap(aCx, this);
+  return CryptoBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
 Crypto::GetRandomValues(JSContext* aCx, const ArrayBufferView& aArray,
                         JS::MutableHandle<JSObject*> aRetval,
                         ErrorResult& aRv)
 {
   MOZ_ASSERT(NS_IsMainThread(), "Called on the wrong thread");
--- a/dom/base/Crypto.h
+++ b/dom/base/Crypto.h
@@ -45,17 +45,17 @@ public:
 
   nsIGlobalObject*
   GetParentObject() const
   {
     return mParent;
   }
 
   virtual JSObject*
-  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   static uint8_t*
   GetRandomValues(uint32_t aLength);
 
 private:
   nsCOMPtr<nsIGlobalObject> mParent;
   nsRefPtr<SubtleCrypto> mSubtle;
 };
--- a/dom/base/DOMCursor.cpp
+++ b/dom/base/DOMCursor.cpp
@@ -71,15 +71,15 @@ DOMCursor::Continue(ErrorResult& aRv)
     return;
   }
 
   Reset();
   mCallback->HandleContinue();
 }
 
 /* virtual */ JSObject*
-DOMCursor::WrapObject(JSContext* aCx)
+DOMCursor::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DOMCursorBinding::Wrap(aCx, this);
+  return DOMCursorBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/DOMCursor.h
+++ b/dom/base/DOMCursor.h
@@ -22,17 +22,17 @@ class DOMCursor : public DOMRequest
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMDOMCURSOR
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DOMCursor,
                                            DOMRequest)
 
   DOMCursor(nsPIDOMWindow* aWindow, nsICursorContinueCallback *aCallback);
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   bool Done() const
   {
     return mFinished;
   }
   virtual void Continue(ErrorResult& aRv);
 
   void Reset();
--- a/dom/base/DOMError.cpp
+++ b/dom/base/DOMError.cpp
@@ -50,19 +50,19 @@ DOMError::DOMError(nsPIDOMWindow* aWindo
 {
 }
 
 DOMError::~DOMError()
 {
 }
 
 JSObject*
-DOMError::WrapObject(JSContext* aCx)
+DOMError::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DOMErrorBinding::Wrap(aCx, this);
+  return DOMErrorBinding::Wrap(aCx, this, aGivenProto);
 }
 
 /* static */ already_AddRefed<DOMError>
 DOMError::Constructor(const GlobalObject& aGlobal,
                       const nsAString& aName, const nsAString& aMessage,
                       ErrorResult& aRv)
 {
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
--- a/dom/base/DOMError.h
+++ b/dom/base/DOMError.h
@@ -54,17 +54,17 @@ public:
            const nsAString& aMessage);
 
   nsPIDOMWindow* GetParentObject() const
   {
     return mWindow;
   }
 
   virtual JSObject*
-  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   static already_AddRefed<DOMError>
   Constructor(const GlobalObject& global, const nsAString& name,
               const nsAString& message, ErrorResult& aRv);
 
   void GetName(nsString& aRetval) const
   {
     aRetval = mName;
--- a/dom/base/DOMException.cpp
+++ b/dom/base/DOMException.cpp
@@ -485,19 +485,19 @@ Exception::Initialize(const nsACString& 
   mData = aData;
   mInner = aInner;
 
   mInitialized = true;
   return NS_OK;
 }
 
 JSObject*
-Exception::WrapObject(JSContext* cx)
+Exception::WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return ExceptionBinding::Wrap(cx, this);
+  return ExceptionBinding::Wrap(cx, this, aGivenProto);
 }
 
 void
 Exception::GetMessageMoz(nsString& retval)
 {
   nsCString str;
 #ifdef DEBUG
   DebugOnly<nsresult> rv =
@@ -701,19 +701,19 @@ DOMException::Constructor(GlobalObject& 
     new DOMException(exceptionResult,
                      NS_ConvertUTF16toUTF8(aMessage),
                      name,
                      exceptionCode);
   return retval.forget();
 }
 
 JSObject*
-DOMException::WrapObject(JSContext* aCx)
+DOMException::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DOMExceptionBinding::Wrap(aCx, this);
+  return DOMExceptionBinding::Wrap(aCx, this, aGivenProto);
 }
 
 /* static */already_AddRefed<DOMException>
 DOMException::Create(nsresult aRv)
 {
   nsCString name;
   nsCString message;
   uint16_t code;
--- a/dom/base/DOMException.h
+++ b/dom/base/DOMException.h
@@ -58,17 +58,17 @@ public:
   NS_DECL_NSIXPCEXCEPTION
 
   // Cruft used by XPConnect for exceptions originating in JS implemented
   // components.
   bool StealJSVal(JS::Value* aVp);
   void StowJSVal(JS::Value& aVp);
 
   // WebIDL API
-  virtual JSObject* WrapObject(JSContext* cx)
+  virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
     MOZ_OVERRIDE;
 
   nsISupports* GetParentObject() const { return nullptr; }
 
   void GetMessageMoz(nsString& retval);
 
   uint32_t Result() const;
 
@@ -131,17 +131,17 @@ public:
 
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMDOMEXCEPTION
 
   // nsIException overrides
   NS_IMETHOD ToString(nsACString& aReturn) MOZ_OVERRIDE;
 
   // nsWrapperCache overrides
-  virtual JSObject* WrapObject(JSContext* aCx)
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
     MOZ_OVERRIDE;
 
   static already_AddRefed<DOMException>
   Constructor(GlobalObject& /* unused */,
               const nsAString& aMessage,
               const Optional<nsAString>& aName,
               ErrorResult& aError);
 
--- a/dom/base/DOMImplementation.cpp
+++ b/dom/base/DOMImplementation.cpp
@@ -24,19 +24,19 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DOMImplementation, mOwner)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMImplementation)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMImplementation)
 
 JSObject*
-DOMImplementation::WrapObject(JSContext* aCx)
+DOMImplementation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DOMImplementationBinding::Wrap(aCx, this);
+  return DOMImplementationBinding::Wrap(aCx, this, aGivenProto);
 }
 
 bool
 DOMImplementation::HasFeature(const nsAString& aFeature,
                               const nsAString& aVersion)
 {
   return nsContentUtils::InternalIsSupported(
            static_cast<nsIDOMDOMImplementation*>(this),
--- a/dom/base/DOMImplementation.h
+++ b/dom/base/DOMImplementation.h
@@ -47,17 +47,17 @@ public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMImplementation)
 
   nsIDocument* GetParentObject() const
   {
     return mOwner;
   }
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // nsIDOMDOMImplementation
   NS_DECL_NSIDOMDOMIMPLEMENTATION
 
   bool HasFeature(const nsAString& aFeature, const nsAString& aVersion);
 
   already_AddRefed<DocumentType>
   CreateDocumentType(const nsAString& aQualifiedName,
--- a/dom/base/DOMMatrix.cpp
+++ b/dom/base/DOMMatrix.cpp
@@ -653,15 +653,15 @@ DOMMatrix::SetMatrixValue(const nsAStrin
     SetE(result._31);
     SetF(result._32);
   }
 
   return this;
 }
 
 JSObject*
-DOMMatrix::WrapObject(JSContext* aCx)
+DOMMatrix::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DOMMatrixBinding::Wrap(aCx, this);
+  return DOMMatrixBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/DOMMatrix.h
+++ b/dom/base/DOMMatrix.h
@@ -161,17 +161,17 @@ public:
   static already_AddRefed<DOMMatrix>
   Constructor(const GlobalObject& aGlobal, const Float32Array& aArray32, ErrorResult& aRv);
   static already_AddRefed<DOMMatrix>
   Constructor(const GlobalObject& aGlobal, const Float64Array& aArray64, ErrorResult& aRv);
   static already_AddRefed<DOMMatrix>
   Constructor(const GlobalObject& aGlobal, const Sequence<double>& aNumberSequence, ErrorResult& aRv);
 
   nsISupports* GetParentObject() const { return mParent; }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
 #define Set2DMatrixMember(entry2D, entry3D) \
 { \
   if (mMatrix3D) { \
     mMatrix3D->entry3D = v; \
   } else { \
     mMatrix2D->entry2D = v; \
   } \
--- a/dom/base/DOMParser.h
+++ b/dom/base/DOMParser.h
@@ -70,19 +70,19 @@ public:
   void Init(nsIPrincipal* aPrincipal, nsIURI* aDocumentURI,
             nsIURI* aBaseURI, mozilla::ErrorResult& rv);
 
   nsISupports* GetParentObject() const
   {
     return mOwner;
   }
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE
   {
-    return mozilla::dom::DOMParserBinding::Wrap(aCx, this);
+    return mozilla::dom::DOMParserBinding::Wrap(aCx, this, aGivenProto);
   }
 
 private:
   explicit DOMParser(nsISupports* aOwner) : mOwner(aOwner), mAttemptedInit(false)
   {
     MOZ_ASSERT(aOwner);
   }
 
--- a/dom/base/DOMPoint.cpp
+++ b/dom/base/DOMPoint.cpp
@@ -32,12 +32,12 @@ DOMPoint::Constructor(const GlobalObject
                       double aZ, double aW, ErrorResult& aRV)
 {
   nsRefPtr<DOMPoint> obj =
     new DOMPoint(aGlobal.GetAsSupports(), aX, aY, aZ, aW);
   return obj.forget();
 }
 
 JSObject*
-DOMPoint::WrapObject(JSContext* aCx)
+DOMPoint::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DOMPointBinding::Wrap(aCx, this);
+  return DOMPointBinding::Wrap(aCx, this, aGivenProto);
 }
--- a/dom/base/DOMPoint.h
+++ b/dom/base/DOMPoint.h
@@ -59,17 +59,17 @@ public:
   static already_AddRefed<DOMPoint>
   Constructor(const GlobalObject& aGlobal, const DOMPointInit& aParams,
               ErrorResult& aRV);
   static already_AddRefed<DOMPoint>
   Constructor(const GlobalObject& aGlobal, double aX, double aY,
               double aZ, double aW, ErrorResult& aRV);
 
   nsISupports* GetParentObject() const { return mParent; }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   void SetX(double aX) { mX = aX; }
   void SetY(double aY) { mY = aY; }
   void SetZ(double aZ) { mZ = aZ; }
   void SetW(double aW) { mW = aW; }
 };
 
 }
--- a/dom/base/DOMQuad.cpp
+++ b/dom/base/DOMQuad.cpp
@@ -33,19 +33,19 @@ DOMQuad::DOMQuad(nsISupports* aParent)
 {
 }
 
 DOMQuad::~DOMQuad()
 {
 }
 
 JSObject*
-DOMQuad::WrapObject(JSContext* aCx)
+DOMQuad::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DOMQuadBinding::Wrap(aCx, this);
+  return DOMQuadBinding::Wrap(aCx, this, aGivenProto);
 }
 
 already_AddRefed<DOMQuad>
 DOMQuad::Constructor(const GlobalObject& aGlobal,
                      const DOMPointInit& aP1,
                      const DOMPointInit& aP2,
                      const DOMPointInit& aP3,
                      const DOMPointInit& aP4,
--- a/dom/base/DOMQuad.h
+++ b/dom/base/DOMQuad.h
@@ -30,17 +30,17 @@ class DOMQuad MOZ_FINAL : public nsWrapp
 public:
   DOMQuad(nsISupports* aParent, CSSPoint aPoints[4]);
   explicit DOMQuad(nsISupports* aParent);
 
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(DOMQuad)
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMQuad)
 
   nsISupports* GetParentObject() const { return mParent; }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   static already_AddRefed<DOMQuad>
   Constructor(const GlobalObject& aGlobal,
               const DOMPointInit& aP1,
               const DOMPointInit& aP2,
               const DOMPointInit& aP3,
               const DOMPointInit& aP4,
               ErrorResult& aRV);
--- a/dom/base/DOMRect.cpp
+++ b/dom/base/DOMRect.cpp
@@ -16,20 +16,20 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(DO
 NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMRectReadOnly)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMRectReadOnly)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMRectReadOnly)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 JSObject*
-DOMRectReadOnly::WrapObject(JSContext* aCx)
+DOMRectReadOnly::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   MOZ_ASSERT(mParent);
-  return DOMRectReadOnlyBinding::Wrap(aCx, this);
+  return DOMRectReadOnlyBinding::Wrap(aCx, this, aGivenProto);
 }
 
 // -----------------------------------------------------------------------------
 
 NS_IMPL_ISUPPORTS_INHERITED(DOMRect, DOMRectReadOnly, nsIDOMClientRect)
 
 #define FORWARD_GETTER(_name)                                                   \
   NS_IMETHODIMP                                                                 \
@@ -42,20 +42,20 @@ NS_IMPL_ISUPPORTS_INHERITED(DOMRect, DOM
 FORWARD_GETTER(Left)
 FORWARD_GETTER(Top)
 FORWARD_GETTER(Right)
 FORWARD_GETTER(Bottom)
 FORWARD_GETTER(Width)
 FORWARD_GETTER(Height)
 
 JSObject*
-DOMRect::WrapObject(JSContext* aCx)
+DOMRect::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
   MOZ_ASSERT(mParent);
-  return DOMRectBinding::Wrap(aCx, this);
+  return DOMRectBinding::Wrap(aCx, this, aGivenProto);
 }
 
 already_AddRefed<DOMRect>
 DOMRect::Constructor(const GlobalObject& aGlobal, ErrorResult& aRV)
 {
   nsRefPtr<DOMRect> obj =
     new DOMRect(aGlobal.GetAsSupports(), 0.0, 0.0, 0.0, 0.0);
   return obj.forget();
@@ -94,19 +94,19 @@ DOMRectList::GetLength(uint32_t* aLength
 NS_IMETHODIMP    
 DOMRectList::Item(uint32_t aIndex, nsIDOMClientRect** aReturn)
 {
   NS_IF_ADDREF(*aReturn = Item(aIndex));
   return NS_OK;
 }
 
 JSObject*
-DOMRectList::WrapObject(JSContext *cx)
+DOMRectList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return mozilla::dom::DOMRectListBinding::Wrap(cx, this);
+  return mozilla::dom::DOMRectListBinding::Wrap(cx, this, aGivenProto);
 }
 
 static double
 RoundFloat(double aValue)
 {
   return floor(aValue + 0.5);
 }
 
--- a/dom/base/DOMRect.h
+++ b/dom/base/DOMRect.h
@@ -38,17 +38,17 @@ public:
   {
   }
 
   nsISupports* GetParentObject() const
   {
     MOZ_ASSERT(mParent);
     return mParent;
   }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   virtual double X() const = 0;
   virtual double Y() const = 0;
   virtual double Width() const = 0;
   virtual double Height() const = 0;
 
   double Left() const
   {
@@ -93,17 +93,17 @@ public:
   NS_DECL_NSIDOMCLIENTRECT
 
   static already_AddRefed<DOMRect>
   Constructor(const GlobalObject& aGlobal, ErrorResult& aRV);
   static already_AddRefed<DOMRect>
   Constructor(const GlobalObject& aGlobal, double aX, double aY,
               double aWidth, double aHeight, ErrorResult& aRV);
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   void SetRect(float aX, float aY, float aWidth, float aHeight) {
     mX = aX; mY = aY; mWidth = aWidth; mHeight = aHeight;
   }
   void SetLayoutRect(const nsRect& aLayoutRect);
 
   virtual double X() const MOZ_OVERRIDE
   {
@@ -156,17 +156,17 @@ public:
   {
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMRectList)
 
   NS_DECL_NSIDOMCLIENTRECTLIST
   
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   nsISupports* GetParentObject()
   {
     return mParent;
   }
 
   void Append(DOMRect* aElement) { mArray.AppendElement(aElement); }
 
--- a/dom/base/DOMRequest.cpp
+++ b/dom/base/DOMRequest.cpp
@@ -61,19 +61,19 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_END
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(DOMRequest)
   NS_INTERFACE_MAP_ENTRY(nsIDOMDOMRequest)
 NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
 
 NS_IMPL_ADDREF_INHERITED(DOMRequest, DOMEventTargetHelper)
 NS_IMPL_RELEASE_INHERITED(DOMRequest, DOMEventTargetHelper)
 
 /* virtual */ JSObject*
-DOMRequest::WrapObject(JSContext* aCx)
+DOMRequest::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DOMRequestBinding::Wrap(aCx, this);
+  return DOMRequestBinding::Wrap(aCx, this, aGivenProto);
 }
 
 NS_IMPL_EVENT_HANDLER(DOMRequest, success)
 NS_IMPL_EVENT_HANDLER(DOMRequest, error)
 
 NS_IMETHODIMP
 DOMRequest::GetReadyState(nsAString& aReadyState)
 {
--- a/dom/base/DOMRequest.h
+++ b/dom/base/DOMRequest.h
@@ -42,17 +42,17 @@ public:
                                                          DOMEventTargetHelper)
 
   // WrapperCache
   nsPIDOMWindow* GetParentObject() const
   {
     return GetOwner();
   }
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // WebIDL Interface
   DOMRequestReadyState ReadyState() const
   {
     return mDone ? DOMRequestReadyState::Done
                  : DOMRequestReadyState::Pending;
   }
 
--- a/dom/base/DOMStringList.cpp
+++ b/dom/base/DOMStringList.cpp
@@ -19,15 +19,15 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 DOMStringList::~DOMStringList()
 {
 }
 
 JSObject*
-DOMStringList::WrapObject(JSContext* aCx)
+DOMStringList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DOMStringListBinding::Wrap(aCx, this);
+  return DOMStringListBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/DOMStringList.h
+++ b/dom/base/DOMStringList.h
@@ -19,17 +19,17 @@ class DOMStringList : public nsISupports
 {
 protected:
   virtual ~DOMStringList();
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMStringList)
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
   nsISupports* GetParentObject()
   {
     return nullptr;
   }
 
   void IndexedGetter(uint32_t aIndex, bool& aFound, nsAString& aResult)
   {
     EnsureFresh();
--- a/dom/base/DocumentFragment.cpp
+++ b/dom/base/DocumentFragment.cpp
@@ -19,19 +19,19 @@
 #include "nsPIDOMWindow.h"
 #include "nsIDocument.h"
 #include "mozilla/IntegerPrintfMacros.h"
 
 namespace mozilla {
 namespace dom {
 
 JSObject*
-DocumentFragment::WrapNode(JSContext *aCx)
+DocumentFragment::WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DocumentFragmentBinding::Wrap(aCx, this);
+  return DocumentFragmentBinding::Wrap(aCx, this, aGivenProto);
 }
 
 bool
 DocumentFragment::IsNodeOfType(uint32_t aFlags) const
 {
   return !(aFlags & ~(eCONTENT | eDOCUMENT_FRAGMENT));
 }
 
--- a/dom/base/DocumentFragment.h
+++ b/dom/base/DocumentFragment.h
@@ -60,17 +60,17 @@ public:
                                             nsGkAtoms::documentFragmentNodeName,
                                             nullptr, kNameSpaceID_None,
                                             nsIDOMNode::DOCUMENT_FRAGMENT_NODE)),
       mHost(nullptr)
   {
     Init();
   }
 
-  virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // nsIContent
   nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
                    const nsAString& aValue, bool aNotify)
   {
     return SetAttr(aNameSpaceID, aName, nullptr, aValue, aNotify);
   }
   virtual nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName,
--- a/dom/base/DocumentType.cpp
+++ b/dom/base/DocumentType.cpp
@@ -55,19 +55,19 @@ NS_NewDOMDocumentType(nsNodeInfoManager*
     new mozilla::dom::DocumentType(ni, aPublicId, aSystemId, aInternalSubset);
   return docType.forget();
 }
 
 namespace mozilla {
 namespace dom {
 
 JSObject*
-DocumentType::WrapNode(JSContext *cx)
+DocumentType::WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DocumentTypeBinding::Wrap(cx, this);
+  return DocumentTypeBinding::Wrap(cx, this, aGivenProto);
 }
 
 DocumentType::DocumentType(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo,
                            const nsAString& aPublicId,
                            const nsAString& aSystemId,
                            const nsAString& aInternalSubset) :
   DocumentTypeForward(aNodeInfo),
   mPublicId(aPublicId),
--- a/dom/base/DocumentType.h
+++ b/dom/base/DocumentType.h
@@ -72,17 +72,17 @@ public:
   virtual nsGenericDOMDataNode* CloneDataNode(mozilla::dom::NodeInfo *aNodeInfo,
                                               bool aCloneText) const MOZ_OVERRIDE;
 
   virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; }
 
 protected:
   virtual ~DocumentType();
 
-  virtual JSObject* WrapNode(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapNode(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   nsString mPublicId;
   nsString mSystemId;
   nsString mInternalSubset;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -401,19 +401,19 @@ Element::GetBindingURL(nsIDocument *aDoc
   NS_ENSURE_TRUE(sc, false);
 
   *aResult = sc->StyleDisplay()->mBinding;
 
   return true;
 }
 
 JSObject*
-Element::WrapObject(JSContext *aCx)
+Element::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  JS::Rooted<JSObject*> obj(aCx, nsINode::WrapObject(aCx));
+  JS::Rooted<JSObject*> obj(aCx, nsINode::WrapObject(aCx, aGivenProto));
   if (!obj) {
     return nullptr;
   }
 
   // Custom element prototype swizzling.
   CustomElementData* data = GetCustomElementData();
   if (obj && data) {
     // If this is a registered custom element then fix the prototype.
@@ -1103,19 +1103,19 @@ DestinationInsertionPointList::GetLength
 
 int32_t
 DestinationInsertionPointList::IndexOf(nsIContent* aContent)
 {
   return mDestinationPoints.IndexOf(aContent);
 }
 
 JSObject*
-DestinationInsertionPointList::WrapObject(JSContext* aCx)
+DestinationInsertionPointList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return NodeListBinding::Wrap(aCx, this);
+  return NodeListBinding::Wrap(aCx, this, aGivenProto);
 }
 
 already_AddRefed<DestinationInsertionPointList>
 Element::GetDestinationInsertionPoints()
 {
   nsRefPtr<DestinationInsertionPointList> list =
     new DestinationInsertionPointList(this);
   return list.forget();
--- a/dom/base/Element.h
+++ b/dom/base/Element.h
@@ -955,17 +955,17 @@ public:
     GetElementsByTagNameNS(const nsAString& aNamespaceURI,
                            const nsAString& aLocalName,
                            nsIDOMHTMLCollection** aResult);
   nsresult
     GetElementsByClassName(const nsAString& aClassNames,
                            nsIDOMHTMLCollection** aResult);
   void GetClassList(nsISupports** aClassList);
 
-  virtual JSObject* WrapObject(JSContext *aCx) MOZ_FINAL MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) MOZ_FINAL MOZ_OVERRIDE;
 
   nsINode* GetScopeChainParent() const MOZ_OVERRIDE;
 
   /**
    * Locate an nsIEditor rooted at this content node, if there is one.
    */
   nsIEditor* GetEditorInternal();
 
@@ -1310,17 +1310,17 @@ public:
   // nsIDOMNodeList
   NS_DECL_NSIDOMNODELIST
 
   // nsINodeList
   virtual nsIContent* Item(uint32_t aIndex) MOZ_OVERRIDE;
   virtual int32_t IndexOf(nsIContent* aContent) MOZ_OVERRIDE;
   virtual nsINode* GetParentObject() MOZ_OVERRIDE { return mParent; }
   virtual uint32_t Length() const;
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 protected:
   virtual ~DestinationInsertionPointList();
 
   nsRefPtr<Element> mParent;
   nsCOMArray<nsIContent> mDestinationPoints;
 };
 
 NS_DEFINE_STATIC_IID_ACCESSOR(Element, NS_ELEMENT_IID)
--- a/dom/base/EventSource.cpp
+++ b/dom/base/EventSource.cpp
@@ -260,19 +260,19 @@ EventSource::Init(nsISupports* aOwner,
   // url parameter, so we don't care about the InitChannelAndRequestEventSource
   // result.
   InitChannelAndRequestEventSource();
 
   return NS_OK;
 }
 
 /* virtual */ JSObject*
-EventSource::WrapObject(JSContext* aCx)
+EventSource::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return EventSourceBinding::Wrap(aCx, this);
+  return EventSourceBinding::Wrap(aCx, this, aGivenProto);
 }
 
 /* static */ already_AddRefed<EventSource>
 EventSource::Constructor(const GlobalObject& aGlobal,
                          const nsAString& aURL,
                          const EventSourceInit& aEventSourceInitDict,
                          ErrorResult& aRv)
 {
--- a/dom/base/EventSource.h
+++ b/dom/base/EventSource.h
@@ -53,17 +53,17 @@ public:
 
   NS_DECL_NSIOBSERVER
   NS_DECL_NSISTREAMLISTENER
   NS_DECL_NSIREQUESTOBSERVER
   NS_DECL_NSICHANNELEVENTSINK
   NS_DECL_NSIINTERFACEREQUESTOR
 
   // nsWrapperCache
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // WebIDL
   nsPIDOMWindow*
   GetParentObject() const
   {
     return GetOwner();
   }
   static already_AddRefed<EventSource>
--- a/dom/base/File.cpp
+++ b/dom/base/File.cpp
@@ -554,20 +554,20 @@ File::SetMutable(bool aMutable)
 
 NS_IMETHODIMP_(bool)
 File::IsMemoryFile()
 {
   return mImpl->IsMemoryFile();
 }
 
 JSObject*
-File::WrapObject(JSContext* aCx)
+File::WrapObject(JSContext* aCx, JS::Handle<JSObject*> 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<File>
 File::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
 {
   nsRefPtr<MultipartFileImpl> impl = new MultipartFileImpl();
 
   impl->InitializeBlob();
@@ -1230,19 +1230,19 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMFileList)
   NS_INTERFACE_MAP_ENTRY(nsIDOMFileList)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(FileList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(FileList)
 
 JSObject*
-FileList::WrapObject(JSContext *cx)
+FileList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return mozilla::dom::FileListBinding::Wrap(cx, this);
+  return mozilla::dom::FileListBinding::Wrap(cx, this, aGivenProto);
 }
 
 NS_IMETHODIMP
 FileList::GetLength(uint32_t* aLength)
 {
   *aLength = Length();
 
   return NS_OK;
--- a/dom/base/File.h
+++ b/dom/base/File.h
@@ -184,17 +184,17 @@ public:
 
   // File constructor - ChromeOnly
   static already_AddRefed<File>
   Constructor(const GlobalObject& aGlobal,
               nsIFile* aData,
               const ChromeFilePropertyBag& aBag,
               ErrorResult& aRv);
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   uint64_t GetSize(ErrorResult& aRv);
 
   // XPCOM GetType is OK
 
   // XPCOM GetName is OK
 
   int64_t GetLastModified(ErrorResult& aRv);
@@ -823,17 +823,17 @@ public:
   {
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FileList)
 
   NS_DECL_NSIDOMFILELIST
 
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   nsISupports* GetParentObject()
   {
     return mParent;
   }
 
   void Disconnect()
   {
--- a/dom/base/FragmentOrElement.cpp
+++ b/dom/base/FragmentOrElement.cpp
@@ -396,19 +396,19 @@ NS_IMPL_CYCLE_COLLECTION_CAN_SKIP_THIS_E
 
 NS_INTERFACE_TABLE_HEAD(nsChildContentList)
   NS_WRAPPERCACHE_INTERFACE_TABLE_ENTRY
   NS_INTERFACE_TABLE(nsChildContentList, nsINodeList, nsIDOMNodeList)
   NS_INTERFACE_TABLE_TO_MAP_SEGUE_CYCLE_COLLECTION(nsChildContentList)
 NS_INTERFACE_MAP_END
 
 JSObject*
-nsChildContentList::WrapObject(JSContext *cx)
+nsChildContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return NodeListBinding::Wrap(cx, this);
+  return NodeListBinding::Wrap(cx, this, aGivenProto);
 }
 
 NS_IMETHODIMP
 nsChildContentList::GetLength(uint32_t* aLength)
 {
   *aLength = mNode ? mNode->GetChildCount() : 0;
 
   return NS_OK;
--- a/dom/base/FragmentOrElement.h
+++ b/dom/base/FragmentOrElement.h
@@ -51,17 +51,17 @@ public:
     : mNode(aNode)
   {
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsChildContentList)
 
   // nsWrapperCache
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // nsIDOMNodeList interface
   NS_DECL_NSIDOMNODELIST
 
   // nsINodeList interface
   virtual int32_t IndexOf(nsIContent* aContent) MOZ_OVERRIDE;
   virtual nsIContent* Item(uint32_t aIndex) MOZ_OVERRIDE;
 
--- a/dom/base/MessageChannel.cpp
+++ b/dom/base/MessageChannel.cpp
@@ -76,19 +76,19 @@ MessageChannel::MessageChannel(nsPIDOMWi
 }
 
 MessageChannel::~MessageChannel()
 {
   MOZ_COUNT_DTOR(MessageChannel);
 }
 
 JSObject*
-MessageChannel::WrapObject(JSContext* aCx)
+MessageChannel::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return MessageChannelBinding::Wrap(aCx, this);
+  return MessageChannelBinding::Wrap(aCx, this, aGivenProto);
 }
 
 /* static */ already_AddRefed<MessageChannel>
 MessageChannel::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
 {
   nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.GetAsSupports());
   if (!window) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
--- a/dom/base/MessageChannel.h
+++ b/dom/base/MessageChannel.h
@@ -35,17 +35,17 @@ public:
 
   nsPIDOMWindow*
   GetParentObject() const
   {
     return mWindow;
   }
 
   virtual JSObject*
-  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   static already_AddRefed<MessageChannel>
   Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
 
   MessagePort*
   Port1() const
   {
     return mPort1;
--- a/dom/base/MessagePort.cpp
+++ b/dom/base/MessagePort.cpp
@@ -218,17 +218,17 @@ PostMessageReadTransferStructuredClone(J
   StructuredCloneInfo* scInfo = static_cast<StructuredCloneInfo*>(aClosure);
   NS_ASSERTION(scInfo, "Must have scInfo!");
 
   if (tag == SCTAG_DOM_MAP_MESSAGEPORT) {
     MessagePort* port = static_cast<MessagePort*>(data);
     port->BindToOwner(scInfo->mPort->GetOwner());
     scInfo->mPorts.Put(port, nullptr);
 
-    JS::Rooted<JSObject*> obj(aCx, port->WrapObject(aCx));
+    JS::Rooted<JSObject*> obj(aCx, port->WrapObject(aCx, JS::NullPtr()));
     if (!obj || !JS_WrapObject(aCx, &obj)) {
       return false;
     }
 
     MOZ_ASSERT(port->GetOwner() == scInfo->mPort->GetOwner());
     returnObject.set(obj);
     return true;
   }
@@ -409,19 +409,19 @@ MessagePort::MessagePort(nsPIDOMWindow* 
 }
 
 MessagePort::~MessagePort()
 {
   Close();
 }
 
 JSObject*
-MessagePort::WrapObject(JSContext* aCx)
+MessagePort::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return MessagePortBinding::Wrap(aCx, this);
+  return MessagePortBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
 MessagePort::PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,
                             const Optional<Sequence<JS::Value>>& aTransferable,
                             ErrorResult& aRv)
 {
   nsRefPtr<PostMessageRunnable> event = new PostMessageRunnable();
--- a/dom/base/MessagePort.h
+++ b/dom/base/MessagePort.h
@@ -59,17 +59,17 @@ class MessagePort MOZ_FINAL : public Mes
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MessagePort,
                                            DOMEventTargetHelper)
 
   explicit MessagePort(nsPIDOMWindow* aWindow);
 
   virtual JSObject*
-  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   virtual void
   PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,
                  const Optional<Sequence<JS::Value>>& aTransferable,
                  ErrorResult& aRv) MOZ_OVERRIDE;
 
   virtual void
   Start() MOZ_OVERRIDE;
--- a/dom/base/MessagePortList.cpp
+++ b/dom/base/MessagePortList.cpp
@@ -15,15 +15,15 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Me
 NS_IMPL_CYCLE_COLLECTING_ADDREF(MessagePortList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(MessagePortList)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MessagePortList)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 JSObject*
-MessagePortList::WrapObject(JSContext* aCx)
+MessagePortList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return MessagePortListBinding::Wrap(aCx, this);
+  return MessagePortListBinding::Wrap(aCx, this, aGivenProto);
 }
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/base/MessagePortList.h
+++ b/dom/base/MessagePortList.h
@@ -36,17 +36,17 @@ public:
 
   nsISupports*
   GetParentObject() const
   {
     return mOwner;
   }
 
   virtual JSObject*
-  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   uint32_t
   Length() const
   {
     return mPorts.Length();
   }
 
   MessagePortBase*
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -2229,19 +2229,19 @@ Navigator::GetOwnPropertyNames(JSContext
     return;
   }
 
   NavigatorNameEnumeratorClosure closure(aCx, GetWrapper(), aNames);
   nameSpaceManager->EnumerateNavigatorNames(SaveNavigatorName, &closure);
 }
 
 JSObject*
-Navigator::WrapObject(JSContext* cx)
+Navigator::WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return NavigatorBinding::Wrap(cx, this);
+  return NavigatorBinding::Wrap(cx, this, aGivenProto);
 }
 
 /* static */
 bool
 Navigator::HasWakeLockSupport(JSContext* /* unused*/, JSObject* /*unused */)
 {
   nsCOMPtr<nsIPowerManagerService> pmService =
     do_GetService(POWERMANAGERSERVICE_CONTRACTID);
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -319,17 +319,17 @@ public:
 
   static bool IsE10sEnabled(JSContext* aCx, JSObject* aGlobal);
 
   nsPIDOMWindow* GetParentObject() const
   {
     return GetWindow();
   }
 
-  virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // GetWindowFromGlobal returns the inner window for this global, if
   // any, else null.
   static already_AddRefed<nsPIDOMWindow> GetWindowFromGlobal(JSObject* aGlobal);
 
 #ifdef MOZ_EME
   already_AddRefed<Promise>
   RequestMediaKeySystemAccess(const nsAString& aKeySystem,
--- a/dom/base/PerformanceEntry.cpp
+++ b/dom/base/PerformanceEntry.cpp
@@ -29,12 +29,12 @@ PerformanceEntry::PerformanceEntry(nsPer
   MOZ_ASSERT(aPerformance, "Parent performance object should be provided");
 }
 
 PerformanceEntry::~PerformanceEntry()
 {
 }
 
 JSObject*
-PerformanceEntry::WrapObject(JSContext* aCx)
+PerformanceEntry::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return mozilla::dom::PerformanceEntryBinding::Wrap(aCx, this);
+  return mozilla::dom::PerformanceEntryBinding::Wrap(aCx, this, aGivenProto);
 }
--- a/dom/base/PerformanceEntry.h
+++ b/dom/base/PerformanceEntry.h
@@ -22,17 +22,17 @@ protected:
 public:
   PerformanceEntry(nsPerformance* aPerformance,
                    const nsAString& aName,
                    const nsAString& aEntryType);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceEntry)
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   nsPerformance* GetParentObject() const
   {
     return mPerformance;
   }
 
   void GetName(nsAString& aName) const
   {
--- a/dom/base/PerformanceMark.cpp
+++ b/dom/base/PerformanceMark.cpp
@@ -16,12 +16,12 @@ PerformanceMark::PerformanceMark(nsPerfo
   mStartTime = aPerformance->GetDOMTiming()->TimeStampToDOMHighRes(mozilla::TimeStamp::Now());
 }
 
 PerformanceMark::~PerformanceMark()
 {
 }
 
 JSObject*
-PerformanceMark::WrapObject(JSContext* aCx)
+PerformanceMark::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return PerformanceMarkBinding::Wrap(aCx, this);
+  return PerformanceMarkBinding::Wrap(aCx, this, aGivenProto);
 }
--- a/dom/base/PerformanceMark.h
+++ b/dom/base/PerformanceMark.h
@@ -13,17 +13,17 @@ namespace dom {
 
 // http://www.w3.org/TR/user-timing/#performancemark
 class PerformanceMark MOZ_FINAL : public PerformanceEntry
 {
 public:
   PerformanceMark(nsPerformance* aPerformance,
                   const nsAString& aName);
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   virtual DOMHighResTimeStamp StartTime() const MOZ_OVERRIDE
   {
     return mStartTime;
   }
 
 protected:
   virtual ~PerformanceMark();
--- a/dom/base/PerformanceMeasure.cpp
+++ b/dom/base/PerformanceMeasure.cpp
@@ -19,12 +19,12 @@ PerformanceMeasure::PerformanceMeasure(n
   MOZ_ASSERT(aPerformance, "Parent performance object should be provided");
 }
 
 PerformanceMeasure::~PerformanceMeasure()
 {
 }
 
 JSObject*
-PerformanceMeasure::WrapObject(JSContext* aCx)
+PerformanceMeasure::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return PerformanceMeasureBinding::Wrap(aCx, this);
+  return PerformanceMeasureBinding::Wrap(aCx, this, aGivenProto);
 }
--- a/dom/base/PerformanceMeasure.h
+++ b/dom/base/PerformanceMeasure.h
@@ -15,17 +15,17 @@ namespace dom {
 class PerformanceMeasure MOZ_FINAL : public PerformanceEntry
 {
 public:
   PerformanceMeasure(nsPerformance* aPerformance,
                      const nsAString& aName,
                      DOMHighResTimeStamp aStartTime,
                      DOMHighResTimeStamp aEndTime);
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   virtual DOMHighResTimeStamp StartTime() const MOZ_OVERRIDE
   {
     return mStartTime;
   }
 
   virtual DOMHighResTimeStamp Duration() const MOZ_OVERRIDE
   {
--- a/dom/base/PerformanceResourceTiming.cpp
+++ b/dom/base/PerformanceResourceTiming.cpp
@@ -38,12 +38,12 @@ PerformanceResourceTiming::~PerformanceR
 DOMHighResTimeStamp
 PerformanceResourceTiming::StartTime() const
 {
   DOMHighResTimeStamp startTime = mTiming->RedirectStartHighRes();
   return startTime ? startTime : mTiming->FetchStartHighRes();
 }
 
 JSObject*
-PerformanceResourceTiming::WrapObject(JSContext* aCx)
+PerformanceResourceTiming::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return PerformanceResourceTimingBinding::Wrap(aCx, this);
+  return PerformanceResourceTimingBinding::Wrap(aCx, this, aGivenProto);
 }
--- a/dom/base/PerformanceResourceTiming.h
+++ b/dom/base/PerformanceResourceTiming.h
@@ -26,17 +26,17 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(
       PerformanceResourceTiming,
       PerformanceEntry)
 
   PerformanceResourceTiming(nsPerformanceTiming* aPerformanceTiming,
                             nsPerformance* aPerformance,
                             const nsAString& aName);
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
 
   virtual DOMHighResTimeStamp StartTime() const MOZ_OVERRIDE;
 
   virtual DOMHighResTimeStamp Duration() const MOZ_OVERRIDE
   {
     return ResponseEnd() - StartTime();
   }
--- a/dom/base/ProcessGlobal.h
+++ b/dom/base/ProcessGlobal.h
@@ -53,17 +53,17 @@ public:
     if (!mGlobal) {
       return nullptr;
     }
 
     return mGlobal->GetJSObject();
   }
   virtual nsIPrincipal* GetPrincipal() MOZ_OVERRIDE { return mPrincipal; }
 
-  virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE
+  virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE
   {
     MOZ_CRASH("ProcessGlobal doesn't use DOM bindings!");
   }
 
 protected:
   virtual ~ProcessGlobal();
 
 private:
--- a/dom/base/ShadowRoot.cpp
+++ b/dom/base/ShadowRoot.cpp
@@ -99,19 +99,19 @@ ShadowRoot::~ShadowRoot()
 
   // nsINode destructor expects mSubtreeRoot == this.
   SetSubtreeRootPointer(this);
 
   SetHost(nullptr);
 }
 
 JSObject*
-ShadowRoot::WrapObject(JSContext* aCx)
+ShadowRoot::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return mozilla::dom::ShadowRootBinding::Wrap(aCx, this);
+  return mozilla::dom::ShadowRootBinding::Wrap(aCx, this, aGivenProto);
 }
 
 ShadowRoot*
 ShadowRoot::FromNode(nsINode* aNode)
 {
   if (aNode->IsInShadowTree() && !aNode->GetParentNode()) {
     MOZ_ASSERT(aNode->NodeType() == nsIDOMNode::DOCUMENT_FRAGMENT_NODE,
                "ShadowRoot is a document fragment.");
--- a/dom/base/ShadowRoot.h
+++ b/dom/base/ShadowRoot.h
@@ -98,17 +98,17 @@ public:
 
   void SetAssociatedBinding(nsXBLBinding* aBinding) { mAssociatedBinding = aBinding; }
 
   nsISupports* GetParentObject() const { return mPoolHost; }
 
   nsIContent* GetPoolHost() { return mPoolHost; }
   nsTArray<HTMLShadowElement*>& ShadowDescendants() { return mShadowDescendants; }
 
-  JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   static bool IsPooledNode(nsIContent* aChild, nsIContent* aContainer,
                            nsIContent* aHost);
   static ShadowRoot* FromNode(nsINode* aNode);
   static bool IsShadowInsertionPoint(nsIContent* aContent);
 
   static void RemoveDestInsertionPoint(nsIContent* aInsertionPoint,
                                        nsTArray<nsIContent*>& aDestInsertionPoints);
--- a/dom/base/StyleSheetList.cpp
+++ b/dom/base/StyleSheetList.cpp
@@ -18,19 +18,19 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
   NS_INTERFACE_MAP_ENTRY(nsIDOMStyleSheetList)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(StyleSheetList)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(StyleSheetList)
 
 /* virtual */ JSObject*
-StyleSheetList::WrapObject(JSContext* aCx)
+StyleSheetList::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return StyleSheetListBinding::Wrap(aCx, this);
+  return StyleSheetListBinding::Wrap(aCx, this, aGivenProto);
 }
 
 NS_IMETHODIMP
 StyleSheetList::GetLength(uint32_t* aLength)
 {
   *aLength = Length();
   return NS_OK;
 }
--- a/dom/base/StyleSheetList.h
+++ b/dom/base/StyleSheetList.h
@@ -19,17 +19,17 @@ namespace dom {
 class StyleSheetList : public nsIDOMStyleSheetList
                      , public nsWrapperCache
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheetList)
   NS_DECL_NSIDOMSTYLESHEETLIST
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE MOZ_FINAL;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE MOZ_FINAL;
 
   virtual nsINode* GetParentObject() const = 0;
 
   virtual uint32_t Length() = 0;
   virtual CSSStyleSheet* IndexedGetter(uint32_t aIndex, bool& aFound) = 0;
   CSSStyleSheet* Item(uint32_t aIndex)
   {
     bool dummy = false;
--- a/dom/base/SubtleCrypto.cpp
+++ b/dom/base/SubtleCrypto.cpp
@@ -24,19 +24,19 @@ NS_INTERFACE_MAP_END
 
 
 SubtleCrypto::SubtleCrypto(nsIGlobalObject* aParent)
   : mParent(aParent)
 {
 }
 
 JSObject*
-SubtleCrypto::WrapObject(JSContext* aCx)
+SubtleCrypto::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return SubtleCryptoBinding::Wrap(aCx, this);
+  return SubtleCryptoBinding::Wrap(aCx, this, aGivenProto);
 }
 
 #define SUBTLECRYPTO_METHOD_BODY(Operation, aRv, ...)                   \
   MOZ_ASSERT(mParent);                                                  \
   nsRefPtr<Promise> p = Promise::Create(mParent, aRv);                  \
   if (aRv.Failed()) {                                                   \
     return nullptr;                                                     \
   }                                                                     \
--- a/dom/base/SubtleCrypto.h
+++ b/dom/base/SubtleCrypto.h
@@ -33,17 +33,17 @@ public:
 public:
   explicit SubtleCrypto(nsIGlobalObject* aParent);
 
   nsIGlobalObject* GetParentObject() const
   {
     return mParent;
   }
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   already_AddRefed<Promise> Encrypt(JSContext* cx,
                                     const ObjectOrString& algorithm,
                                     CryptoKey& key,
                                     const CryptoOperationData& data,
                                     ErrorResult& aRv);
 
   already_AddRefed<Promise> Decrypt(JSContext* cx,
--- a/dom/base/URLSearchParams.cpp
+++ b/dom/base/URLSearchParams.cpp
@@ -25,19 +25,19 @@ URLSearchParams::URLSearchParams()
 }
 
 URLSearchParams::~URLSearchParams()
 {
   DeleteAll();
 }
 
 JSObject*
-URLSearchParams::WrapObject(JSContext* aCx)
+URLSearchParams::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return URLSearchParamsBinding::Wrap(aCx, this);
+  return URLSearchParamsBinding::Wrap(aCx, this, aGivenProto);
 }
 
 /* static */ already_AddRefed<URLSearchParams>
 URLSearchParams::Constructor(const GlobalObject& aGlobal,
                              const nsAString& aInit,
                              ErrorResult& aRv)
 {
   nsRefPtr<URLSearchParams> sp = new URLSearchParams();
--- a/dom/base/URLSearchParams.h
+++ b/dom/base/URLSearchParams.h
@@ -39,17 +39,17 @@ public:
 
   // WebIDL methods
   nsISupports* GetParentObject() const
   {
     return nullptr;
   }
 
   virtual JSObject*
-  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   static already_AddRefed<URLSearchParams>
   Constructor(const GlobalObject& aGlobal, const nsAString& aInit,
               ErrorResult& aRv);
 
   static already_AddRefed<URLSearchParams>
   Constructor(const GlobalObject& aGlobal, URLSearchParams& aInit,
               ErrorResult& aRv);
--- a/dom/base/WebSocket.cpp
+++ b/dom/base/WebSocket.cpp
@@ -904,19 +904,19 @@ WebSocket::WebSocket(nsPIDOMWindow* aOwn
   mIsMainThread = mImpl->mIsMainThread;
 }
 
 WebSocket::~WebSocket()
 {
 }
 
 JSObject*
-WebSocket::WrapObject(JSContext* cx)
+WebSocket::WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return WebSocketBinding::Wrap(cx, this);
+  return WebSocketBinding::Wrap(cx, this, aGivenProto);
 }
 
 //---------------------------------------------------------------------------
 // WebIDL
 //---------------------------------------------------------------------------
 
 // Constructor:
 already_AddRefed<WebSocket>
--- a/dom/base/WebSocket.h
+++ b/dom/base/WebSocket.h
@@ -57,17 +57,17 @@ public:
   virtual void EventListenerAdded(nsIAtom* aType) MOZ_OVERRIDE;
   virtual void EventListenerRemoved(nsIAtom* aType) MOZ_OVERRIDE;
 
   virtual void DisconnectFromOwner() MOZ_OVERRIDE;
 
   // nsWrapperCache
   nsPIDOMWindow* GetParentObject() { return GetOwner(); }
 
-  virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
 public: // static helpers:
 
   // Determine if preferences allow WebSocket
   static bool PrefEnabled(JSContext* aCx = nullptr, JSObject* aGlobal = nullptr);
 
 public: // WebIDL interface:
 
--- a/dom/base/nsContentList.cpp
+++ b/dom/base/nsContentList.cpp
@@ -142,19 +142,19 @@ NS_IMPL_CYCLE_COLLECTION_INHERITED(nsSim
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(nsSimpleContentList)
 NS_INTERFACE_MAP_END_INHERITING(nsBaseContentList)
 
 
 NS_IMPL_ADDREF_INHERITED(nsSimpleContentList, nsBaseContentList)
 NS_IMPL_RELEASE_INHERITED(nsSimpleContentList, nsBaseContentList)
 
 JSObject*
-nsSimpleContentList::WrapObject(JSContext *cx)
+nsSimpleContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return NodeListBinding::Wrap(cx, this);
+  return NodeListBinding::Wrap(cx, this, aGivenProto);
 }
 
 // Hashtable for storing nsContentLists
 static PLDHashTable gContentListHashTable;
 
 #define RECENTLY_USED_CONTENT_LIST_CACHE_SIZE 31
 static nsContentList*
   sRecentlyUsedContentLists[RECENTLY_USED_CONTENT_LIST_CACHE_SIZE] = {};
@@ -254,26 +254,26 @@ NS_GetContentList(nsINode* aRootNode,
 #ifdef DEBUG
 const nsCacheableFuncStringContentList::ContentListType
   nsCacheableFuncStringNodeList::sType = nsCacheableFuncStringContentList::eNodeList;
 const nsCacheableFuncStringContentList::ContentListType
   nsCacheableFuncStringHTMLCollection::sType = nsCacheableFuncStringContentList::eHTMLCollection;
 #endif
 
 JSObject*
-nsCacheableFuncStringNodeList::WrapObject(JSContext *cx)
+nsCacheableFuncStringNodeList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return NodeListBinding::Wrap(cx, this);
+  return NodeListBinding::Wrap(cx, this, aGivenProto);
 }
 
 
 JSObject*
-nsCacheableFuncStringHTMLCollection::WrapObject(JSContext *cx)
+nsCacheableFuncStringHTMLCollection::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return HTMLCollectionBinding::Wrap(cx, this);
+  return HTMLCollectionBinding::Wrap(cx, this, aGivenProto);
 }
 
 // Hashtable for storing nsCacheableFuncStringContentList
 static PLDHashTable gFuncStringContentListHashTable;
 
 struct FuncStringContentListHashEntry : public PLDHashEntryHdr
 {
   nsCacheableFuncStringContentList* mContentList;
@@ -464,19 +464,19 @@ nsContentList::~nsContentList()
 
   if (mDestroyFunc) {
     // Clean up mData
     (*mDestroyFunc)(mData);
   }
 }
 
 JSObject*
-nsContentList::WrapObject(JSContext *cx)
+nsContentList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return HTMLCollectionBinding::Wrap(cx, this);
+  return HTMLCollectionBinding::Wrap(cx, this, aGivenProto);
 }
 
 NS_IMPL_ISUPPORTS_INHERITED(nsContentList, nsBaseContentList,
                             nsIHTMLCollection, nsIDOMHTMLCollection,
                             nsIMutationObserver)
 
 uint32_t
 nsContentList::Length(bool aDoFlush)
--- a/dom/base/nsContentList.h
+++ b/dom/base/nsContentList.h
@@ -82,17 +82,17 @@ public:
   }
 
   void Reset() {
     mElements.Clear();
   }
 
   virtual int32_t IndexOf(nsIContent *aContent, bool aDoFlush);
 
-  virtual JSObject* WrapObject(JSContext *cx)
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
     MOZ_OVERRIDE = 0;
 
   void SetCapacity(uint32_t aCapacity)
   {
     mElements.SetCapacity(aCapacity);
   }
 protected:
   virtual ~nsBaseContentList();
@@ -120,17 +120,17 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsSimpleContentList,
                                            nsBaseContentList)
 
   virtual nsINode* GetParentObject() MOZ_OVERRIDE
   {
     return mRoot;
   }
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
 protected:
   virtual ~nsSimpleContentList() {}
 
 private:
   // This has to be a strong reference, the root might go away before the list.
   nsCOMPtr<nsINode> mRoot;
 };
@@ -246,17 +246,17 @@ public:
                 void* aData,
                 bool aDeep = true,
                 nsIAtom* aMatchAtom = nullptr,
                 int32_t aMatchNameSpaceId = kNameSpaceID_None,
                 bool aFuncMayDependOnAttr = true);
 
   // nsWrapperCache
   using nsWrapperCache::GetWrapperPreserveColor;
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 protected:
   virtual ~nsContentList();
 
   virtual JSObject* GetWrapperPreserveColorInternal() MOZ_OVERRIDE
   {
     return nsWrapperCache::GetWrapperPreserveColor();
   }
 public:
@@ -531,17 +531,17 @@ public:
     : nsCacheableFuncStringContentList(aRootNode, aFunc, aDestroyFunc,
                                        aDataAllocator, aString)
   {
 #ifdef DEBUG
     mType = eNodeList;
 #endif
   }
 
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
 #ifdef DEBUG
   static const ContentListType sType;
 #endif
 };
 
 class nsCacheableFuncStringHTMLCollection
   : public nsCacheableFuncStringContentList
@@ -555,16 +555,16 @@ public:
     : nsCacheableFuncStringContentList(aRootNode, aFunc, aDestroyFunc,
                                        aDataAllocator, aString)
   {
 #ifdef DEBUG
     mType = eHTMLCollection;
 #endif
   }
 
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
 #ifdef DEBUG
   static const ContentListType sType;
 #endif
 };
 
 #endif // nsContentList_h___
--- a/dom/base/nsDOMAttributeMap.cpp
+++ b/dom/base/nsDOMAttributeMap.cpp
@@ -582,12 +582,12 @@ nsDOMAttributeMap::SizeOfIncludingThis(M
                                             aMallocSizeOf)
      : 0;
 
   // NB: mContent is non-owning and thus not counted.
   return n;
 }
 
 /* virtual */ JSObject*
-nsDOMAttributeMap::WrapObject(JSContext* aCx)
+nsDOMAttributeMap::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return NamedNodeMapBinding::Wrap(aCx, this);
+  return NamedNodeMapBinding::Wrap(aCx, this, aGivenProto);
 }
--- a/dom/base/nsDOMAttributeMap.h
+++ b/dom/base/nsDOMAttributeMap.h
@@ -135,17 +135,17 @@ public:
    * @return The number of attribute nodes that aFunc was called for.
    */
   uint32_t Enumerate(AttrCache::EnumReadFunction aFunc, void *aUserArg) const;
 
   Element* GetParentObject() const
   {
     return mContent;
   }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // WebIDL
   Attr* GetNamedItem(const nsAString& aAttrName);
   Attr* NamedGetter(const nsAString& aAttrName, bool& aFound);
   bool NameIsEnumerable(const nsAString& aName);
   already_AddRefed<Attr>
   SetNamedItem(Attr& aAttr, ErrorResult& aError)
   {
--- a/dom/base/nsDOMCaretPosition.cpp
+++ b/dom/base/nsDOMCaretPosition.cpp
@@ -51,19 +51,19 @@ nsDOMCaretPosition::GetClientRect() cons
   NS_ASSERTION(domRange, "unable to retrieve valid dom range from CaretPosition");
 
   rect = domRange->GetBoundingClientRect(false);
 
   return rect.forget();
 }
 
 JSObject*
-nsDOMCaretPosition::WrapObject(JSContext *aCx)
+nsDOMCaretPosition::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return mozilla::dom::CaretPositionBinding::Wrap(aCx, this);
+  return mozilla::dom::CaretPositionBinding::Wrap(aCx, this, aGivenProto);
 }
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMCaretPosition,
                                       mOffsetNode, mAnonymousContentNode)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsDOMCaretPosition)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsDOMCaretPosition)
 
--- a/dom/base/nsDOMCaretPosition.h
+++ b/dom/base/nsDOMCaretPosition.h
@@ -80,17 +80,17 @@ public:
     mAnonymousContentNode = aNode;
   }
 
   nsISupports* GetParentObject() const
   {
     return GetOffsetNode();
   }
 
-  virtual JSObject* WrapObject(JSContext *aCx)
+  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
     MOZ_OVERRIDE MOZ_FINAL;
 
 protected:
   virtual ~nsDOMCaretPosition();
 
   uint32_t mOffset;
   nsCOMPtr<nsINode> mOffsetNode;
   nsCOMPtr<nsINode> mAnonymousContentNode;
--- a/dom/base/nsDOMDataChannel.cpp
+++ b/dom/base/nsDOMDataChannel.cpp
@@ -48,19 +48,19 @@ nsDOMDataChannel::~nsDOMDataChannel()
   // one) once we block GC until all the (appropriate) onXxxx handlers
   // are dropped. (See WebRTC spec)
   LOG(("Close()ing %p", mDataChannel.get()));
   mDataChannel->SetListener(nullptr, nullptr);
   mDataChannel->Close();
 }
 
 /* virtual */ JSObject*
-nsDOMDataChannel::WrapObject(JSContext* aCx)
+nsDOMDataChannel::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DataChannelBinding::Wrap(aCx, this);
+  return DataChannelBinding::Wrap(aCx, this, aGivenProto);
 }
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataChannel)
 
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(nsDOMDataChannel,
                                                   DOMEventTargetHelper)
 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
 
--- a/dom/base/nsDOMDataChannel.h
+++ b/dom/base/nsDOMDataChannel.h
@@ -37,17 +37,17 @@ public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIDOMDATACHANNEL
 
   NS_REALLY_FORWARD_NSIDOMEVENTTARGET(mozilla::DOMEventTargetHelper)
 
   NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMDataChannel,
                                            mozilla::DOMEventTargetHelper)
 
-  virtual JSObject* WrapObject(JSContext* aCx)
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
     MOZ_OVERRIDE;
   nsPIDOMWindow* GetParentObject() const
   {
     return GetOwner();
   }
 
   // WebIDL
   // Uses XPIDL GetLabel.
--- a/dom/base/nsDOMFileReader.cpp
+++ b/dom/base/nsDOMFileReader.cpp
@@ -525,12 +525,12 @@ nsDOMFileReader::GetAsDataURL(nsIDOMBlob
   if (!AppendASCIItoUTF16(encodedData, aResult, fallible)) {
     return NS_ERROR_OUT_OF_MEMORY;
   }
 
   return NS_OK;
 }
 
 /* virtual */ JSObject*
-nsDOMFileReader::WrapObject(JSContext* aCx)
+nsDOMFileReader::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return FileReaderBinding::Wrap(aCx, this);
+  return FileReaderBinding::Wrap(aCx, this, aGivenProto);
 }
--- a/dom/base/nsDOMFileReader.h
+++ b/dom/base/nsDOMFileReader.h
@@ -57,17 +57,17 @@ public:
 
   virtual nsresult DoOnLoadEnd(nsresult aStatus, nsAString& aSuccessEvent,
                                nsAString& aTerminationEvent) MOZ_OVERRIDE;
 
   nsPIDOMWindow* GetParentObject() const
   {
     return GetOwner();
   }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // WebIDL
   static already_AddRefed<nsDOMFileReader>
   Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
   void ReadAsArrayBuffer(JSContext* aCx, File& aBlob, ErrorResult& aRv)
   {
     ReadFileContent(aBlob, EmptyString(), FILE_AS_ARRAYBUFFER, aRv);
   }
--- a/dom/base/nsDOMMutationObserver.h
+++ b/dom/base/nsDOMMutationObserver.h
@@ -43,19 +43,19 @@ public:
   {
   }
 
   nsISupports* GetParentObject() const
   {
     return mOwner;
   }
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE
   {
-    return mozilla::dom::MutationRecordBinding::Wrap(aCx, this);
+    return mozilla::dom::MutationRecordBinding::Wrap(aCx, this, aGivenProto);
   }
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMMutationRecord)
 
   void GetType(mozilla::dom::DOMString& aRetVal) const
   {
     aRetVal.SetOwnedAtom(mType, mozilla::dom::DOMString::eNullNotExpected);
@@ -456,19 +456,19 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMMutationObserver)
   NS_DECLARE_STATIC_IID_ACCESSOR(NS_DOM_MUTATION_OBSERVER_IID)
 
   static already_AddRefed<nsDOMMutationObserver>
   Constructor(const mozilla::dom::GlobalObject& aGlobal,
               mozilla::dom::MutationCallback& aCb,
               mozilla::ErrorResult& aRv);
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE
   {
-    return mozilla::dom::MutationObserverBinding::Wrap(aCx, this);
+    return mozilla::dom::MutationObserverBinding::Wrap(aCx, this, aGivenProto);
   }
 
   nsISupports* GetParentObject() const
   {
     return mOwner;
   }
 
   void Observe(nsINode& aTarget,
--- a/dom/base/nsDOMSerializer.h
+++ b/dom/base/nsDOMSerializer.h
@@ -43,19 +43,19 @@ public:
   SerializeToStream(nsINode& aRoot, nsIOutputStream* aStream,
                     const nsAString& aCharset, mozilla::ErrorResult& rv);
 
   nsISupports* GetParentObject() const
   {
     return mOwner;
   }
 
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE
   {
-    return mozilla::dom::XMLSerializerBinding::Wrap(aCx, this);
+    return mozilla::dom::XMLSerializerBinding::Wrap(aCx, this, aGivenProto);
   }
 
 private:
   virtual ~nsDOMSerializer();
 
   explicit nsDOMSerializer(nsISupports* aOwner) : mOwner(aOwner)
   {
     MOZ_ASSERT(aOwner);
--- a/dom/base/nsDOMSettableTokenList.cpp
+++ b/dom/base/nsDOMSettableTokenList.cpp
@@ -16,12 +16,12 @@ nsDOMSettableTokenList::SetValue(const n
   if (!mElement) {
     return;
   }
 
   rv = mElement->SetAttr(kNameSpaceID_None, mAttrAtom, aValue, true);
 }
 
 JSObject*
-nsDOMSettableTokenList::WrapObject(JSContext *cx)
+nsDOMSettableTokenList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return mozilla::dom::DOMSettableTokenListBinding::Wrap(cx, this);
+  return mozilla::dom::DOMSettableTokenListBinding::Wrap(cx, this, aGivenProto);
 }
--- a/dom/base/nsDOMSettableTokenList.h
+++ b/dom/base/nsDOMSettableTokenList.h
@@ -17,17 +17,17 @@ class nsIAtom;
 // because nsDOMSettableTokenList is traversed by Element.
 class nsDOMSettableTokenList MOZ_FINAL : public nsDOMTokenList
 {
 public:
 
   nsDOMSettableTokenList(mozilla::dom::Element* aElement, nsIAtom* aAttrAtom)
     : nsDOMTokenList(aElement, aAttrAtom) {}
 
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // WebIDL
   void GetValue(nsAString& aResult) { Stringify(aResult); }
   void SetValue(const nsAString& aValue, mozilla::ErrorResult& rv);
 };
 
 #endif // nsDOMSettableTokenList_h___
 
--- a/dom/base/nsDOMTokenList.cpp
+++ b/dom/base/nsDOMTokenList.cpp
@@ -304,13 +304,13 @@ nsDOMTokenList::Stringify(nsAString& aRe
     aResult.Truncate();
     return;
   }
 
   mElement->GetAttr(kNameSpaceID_None, mAttrAtom, aResult);
 }
 
 JSObject*
-nsDOMTokenList::WrapObject(JSContext *cx)
+nsDOMTokenList::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return DOMTokenListBinding::Wrap(cx, this);
+  return DOMTokenListBinding::Wrap(cx, this, aGivenProto);
 }
 
--- a/dom/base/nsDOMTokenList.h
+++ b/dom/base/nsDOMTokenList.h
@@ -32,17 +32,17 @@ protected:
   typedef mozilla::dom::Element Element;
 
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsDOMTokenList)
 
   nsDOMTokenList(Element* aElement, nsIAtom* aAttrAtom);
 
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   Element* GetParentObject()
   {
     return mElement;
   }
 
   uint32_t Length();
   void Item(uint32_t aIndex, nsAString& aResult)
--- a/dom/base/nsFormData.cpp
+++ b/dom/base/nsFormData.cpp
@@ -259,19 +259,19 @@ nsFormData::Append(const nsAString& aNam
   nsString valAsString;
   valAsString.Adopt(stringData, stringLen);
 
   Append(aName, valAsString);
   return NS_OK;
 }
 
 /* virtual */ JSObject*
-nsFormData::WrapObject(JSContext* aCx)
+nsFormData::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return FormDataBinding::Wrap(aCx, this);
+  return FormDataBinding::Wrap(aCx, this, aGivenProto);
 }
 
 /* static */ already_AddRefed<nsFormData>
 nsFormData::Constructor(const GlobalObject& aGlobal,
                         const Optional<NonNull<HTMLFormElement> >& aFormElement,
                         ErrorResult& aRv)
 {
   nsRefPtr<nsFormData> formData = new nsFormData(aGlobal.GetAsSupports());
--- a/dom/base/nsFormData.h
+++ b/dom/base/nsFormData.h
@@ -75,17 +75,17 @@ public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsFormData,
                                                          nsIDOMFormData)
 
   NS_DECL_NSIDOMFORMDATA
   NS_DECL_NSIXHRSENDABLE
 
   // nsWrapperCache
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // WebIDL
   nsISupports*
   GetParentObject() const
   {
     return mOwner;
   }
   static already_AddRefed<nsFormData>
--- a/dom/base/nsGlobalWindow.cpp
+++ b/dom/base/nsGlobalWindow.cpp
@@ -8012,17 +8012,17 @@ PostMessageReadTransferStructuredClone(J
   StructuredCloneInfo* scInfo = static_cast<StructuredCloneInfo*>(aClosure);
   NS_ASSERTION(scInfo, "Must have scInfo!");
 
   if (tag == SCTAG_DOM_MAP_MESSAGEPORT) {
     MessagePort* port = static_cast<MessagePort*>(aData);
     port->BindToOwner(scInfo->window);
     scInfo->ports.Put(port, nullptr);
 
-    JS::Rooted<JSObject*> obj(aCx, port->WrapObject(aCx));
+    JS::Rooted<JSObject*> obj(aCx, port->WrapObject(aCx, JS::NullPtr()));
     if (JS_WrapObject(aCx, &obj)) {
       MOZ_ASSERT(port->GetOwner() == scInfo->window);
       returnObject.set(obj);
     }
 
     return true;
   }
 
--- a/dom/base/nsGlobalWindow.h
+++ b/dom/base/nsGlobalWindow.h
@@ -350,17 +350,17 @@ public:
 
   // callback for close event
   void ReallyCloseWindow();
 
   // nsISupports
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
 
   // nsWrapperCache
-  virtual JSObject *WrapObject(JSContext *cx) MOZ_OVERRIDE
+  virtual JSObject *WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE
   {
     return IsInnerWindow() || EnsureInnerWindow() ? GetWrapper() : nullptr;
   }
 
   // nsIGlobalJSObjectHolder
   virtual JSObject* GetGlobalJSObject() MOZ_OVERRIDE;
 
   // nsIScriptGlobalObject
--- a/dom/base/nsHistory.cpp
+++ b/dom/base/nsHistory.cpp
@@ -55,19 +55,19 @@ nsHistory::~nsHistory()
 nsPIDOMWindow*
 nsHistory::GetParentObject() const
 {
   nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mInnerWindow));
   return win;
 }
 
 JSObject*
-nsHistory::WrapObject(JSContext* aCx)
+nsHistory::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return HistoryBinding::Wrap(aCx, this);
+  return HistoryBinding::Wrap(aCx, this, aGivenProto);
 }
 
 uint32_t
 nsHistory::GetLength(ErrorResult& aRv) const
 {
   nsCOMPtr<nsPIDOMWindow> win(do_QueryReferent(mInnerWindow));
   if (!win || !win->HasActiveDocument()) {
     aRv.Throw(NS_ERROR_DOM_SECURITY_ERR);
--- a/dom/base/nsHistory.h
+++ b/dom/base/nsHistory.h
@@ -28,17 +28,17 @@ class nsHistory MOZ_FINAL : public nsIDO
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsHistory)
 
 public:
   explicit nsHistory(nsPIDOMWindow* aInnerWindow);
 
   nsPIDOMWindow* GetParentObject() const;
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   uint32_t GetLength(mozilla::ErrorResult& aRv) const;
   void GetState(JSContext* aCx, JS::MutableHandle<JS::Value> aResult,
                 mozilla::ErrorResult& aRv) const;
   void Go(int32_t aDelta, mozilla::ErrorResult& aRv);
   void Back(mozilla::ErrorResult& aRv);
   void Forward(mozilla::ErrorResult& aRv);
   void PushState(JSContext* aCx, JS::Handle<JS::Value> aData,
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -2659,17 +2659,17 @@ nsINode::GetElementById(const nsAString&
     if (id && id->Equals(aId)) {
       return kid->AsElement();
     }
   }
   return nullptr;
 }
 
 JSObject*
-nsINode::WrapObject(JSContext *aCx)
+nsINode::WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto)
 {
   // Make sure one of these is true
   // (1) our owner document has a script handling object,
   // (2) Our owner document has had a script handling object, or has been marked
   //     to have had one,
   // (3) we are running a privileged script.
   // Event handling is possible only if (1). If (2) event handling is
   // prevented.
@@ -2678,17 +2678,17 @@ nsINode::WrapObject(JSContext *aCx)
   bool hasHadScriptHandlingObject = false;
   if (!OwnerDoc()->GetScriptHandlingObject(hasHadScriptHandlingObject) &&
       !hasHadScriptHandlingObject &&
       !nsContentUtils::IsCallerChrome()) {
     Throw(aCx, NS_ERROR_UNEXPECTED);
     return nullptr;
   }
 
-  JS::Rooted<JSObject*> obj(aCx, WrapNode(aCx));
+  JS::Rooted<JSObject*> obj(aCx, WrapNode(aCx, aGivenProto));
   MOZ_ASSERT_IF(ChromeOnlyAccess(),
                 xpc::IsInContentXBLScope(obj) || !xpc::UseContentXBLScope(js::GetObjectCompartment(obj)));
   return obj;
 }
 
 already_AddRefed<nsINode>
 nsINode::CloneNode(bool aDeep, ErrorResult& aError)
 {
--- a/dom/base/nsINode.h
+++ b/dom/base/nsINode.h
@@ -362,31 +362,35 @@ public:
    * type, such as Text, Document, Comment ...  Use this when you can instead of
    * checking the tag.
    *
    * @param aFlags what types you want to test for (see above)
    * @return whether the content matches ALL flags passed in
    */
   virtual bool IsNodeOfType(uint32_t aFlags) const = 0;
 
-  virtual JSObject* WrapObject(JSContext *aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   /**
    * returns true if we are in priviliged code or
    * layout.css.getBoxQuads.enabled == true.
    */
   static bool HasBoxQuadsSupport(JSContext* aCx, JSObject* /* unused */);
 
 protected:
   /**
    * WrapNode is called from WrapObject to actually wrap this node, WrapObject
    * does some additional checks and fix-up that's common to all nodes. WrapNode
    * should just call the DOM binding's Wrap function.
+   *
+   * aGivenProto is the prototype to use (or null if the default one should be
+   * used) and should just be passed directly on to the DOM binding's Wrap
+   * function.
    */
-  virtual JSObject* WrapNode(JSContext *aCx) = 0;
+  virtual JSObject* WrapNode(JSContext *aCx, JS::Handle<JSObject*> aGivenProto) = 0;
 
 public:
   mozilla::dom::ParentObject GetParentObject() const; // Implemented in nsIDocument.h
 
   /**
    * Return the scope chain parent for this node, for use in things
    * like event handler compilation.  Returning null means to use the
    * global object as the scope chain parent.
--- a/dom/base/nsInProcessTabChildGlobal.h
+++ b/dom/base/nsInProcessTabChildGlobal.h
@@ -141,17 +141,17 @@ public:
 
   virtual JSObject* GetGlobalJSObject() MOZ_OVERRIDE {
     if (!mGlobal) {
       return nullptr;
     }
 
     return mGlobal->GetJSObject();
   }
-  virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE
+  virtual JSObject* WrapObject(JSContext* cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE
   {
     MOZ_CRASH("nsInProcessTabChildGlobal doesn't use DOM bindings!");
   }
 protected:
   virtual ~nsInProcessTabChildGlobal();
 
   nsresult Init();
   nsresult InitTabChildGlobal();
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -2468,17 +2468,17 @@ NS_DOMReadStructuredClone(JSContext* cx,
 
     // Prevent the return value from being trashed by a GC during ~nsRefPtr.
     JS::Rooted<JSObject*> result(cx);
     {
       nsRefPtr<CryptoKey> key = new CryptoKey(global);
       if (!key->ReadStructuredClone(reader)) {
         result = nullptr;
       } else {
-        result = key->WrapObject(cx);
+        result = key->WrapObject(cx, JS::NullPtr());
       }
     }
     return result;
   } else if (tag == SCTAG_DOM_NULL_PRINCIPAL ||
              tag == SCTAG_DOM_SYSTEM_PRINCIPAL ||
              tag == SCTAG_DOM_CONTENT_PRINCIPAL) {
     mozilla::ipc::PrincipalInfo info;
     if (tag == SCTAG_DOM_SYSTEM_PRINCIPAL) {
@@ -2524,17 +2524,17 @@ NS_DOMReadStructuredClone(JSContext* cx,
       return nullptr;
     }
 
     // Prevent the return value from being trashed by a GC during ~nsRefPtr.
     JS::Rooted<JSObject*> result(cx);
     {
       nsRefPtr<MozNDEFRecord> ndefRecord = new MozNDEFRecord(global);
       result = ndefRecord->ReadStructuredClone(cx, reader) ?
-               ndefRecord->WrapObject(cx) : nullptr;
+               ndefRecord->WrapObject(cx, JS::NullPtr()) : nullptr;
     }
     return result;
 #else
     return nullptr;
 #endif
   }
 
   // Don't know what this is. Bail.
--- a/dom/base/nsLocation.cpp
+++ b/dom/base/nsLocation.cpp
@@ -1048,19 +1048,19 @@ nsLocation::CallerSubsumes()
   nsCOMPtr<nsIScriptObjectPrincipal> sop = do_QueryInterface(outer);
   bool subsumes = false;
   nsresult rv = nsContentUtils::SubjectPrincipal()->SubsumesConsideringDomain(sop->GetPrincipal(), &subsumes);
   NS_ENSURE_SUCCESS(rv, false);
   return subsumes;
 }
 
 JSObject*
-nsLocation::WrapObject(JSContext* aCx)
+nsLocation::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return LocationBinding::Wrap(aCx, this);
+  return LocationBinding::Wrap(aCx, this, aGivenProto);
 }
 
 URLSearchParams*
 nsLocation::GetDocShellSearchParams()
 {
   nsCOMPtr<nsIDocShell> docShell = GetDocShell();
   if (!docShell) {
     return nullptr;
--- a/dom/base/nsLocation.h
+++ b/dom/base/nsLocation.h
@@ -137,17 +137,17 @@ public:
   void Stringify(nsAString& aRetval, ErrorResult& aError)
   {
     GetHref(aRetval, aError);
   }
   nsPIDOMWindow* GetParentObject() const
   {
     return mInnerWindow;
   }
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // URLSearchParamsObserver
   void URLSearchParamsUpdated(mozilla::dom::URLSearchParams* aSearchParams) MOZ_OVERRIDE;
 
 protected:
   virtual ~nsLocation();
 
   nsresult SetSearchInternal(const nsAString& aSearch);
--- a/dom/base/nsMimeTypeArray.cpp
+++ b/dom/base/nsMimeTypeArray.cpp
@@ -35,19 +35,19 @@ nsMimeTypeArray::nsMimeTypeArray(nsPIDOM
 {
 }
 
 nsMimeTypeArray::~nsMimeTypeArray()
 {
 }
 
 JSObject*
-nsMimeTypeArray::WrapObject(JSContext* aCx)
+nsMimeTypeArray::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return MimeTypeArrayBinding::Wrap(aCx, this);
+  return MimeTypeArrayBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
 nsMimeTypeArray::Refresh()
 {
   mMimeTypes.Clear();
   mHiddenMimeTypes.Clear();
 }
@@ -249,19 +249,19 @@ nsMimeType::~nsMimeType()
 nsPIDOMWindow*
 nsMimeType::GetParentObject() const
 {
   MOZ_ASSERT(mWindow);
   return mWindow;
 }
 
 JSObject*
-nsMimeType::WrapObject(JSContext* aCx)
+nsMimeType::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return MimeTypeBinding::Wrap(aCx, this);
+  return MimeTypeBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
 nsMimeType::GetDescription(nsString& retval) const
 {
   retval.Truncate();
 
   if (mPluginElement) {
--- a/dom/base/nsMimeTypeArray.h
+++ b/dom/base/nsMimeTypeArray.h
@@ -21,17 +21,17 @@ class nsMimeTypeArray MOZ_FINAL : public
 {
 public:
   explicit nsMimeTypeArray(nsPIDOMWindow* aWindow);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsMimeTypeArray)
 
   nsPIDOMWindow* GetParentObject() const;
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   void Refresh();
 
   // MimeTypeArray WebIDL methods
   nsMimeType* Item(uint32_t index);
   nsMimeType* NamedItem(const nsAString& name);
   nsMimeType* IndexedGetter(uint32_t index, bool &found);
   nsMimeType* NamedGetter(const nsAString& name, bool &found);
@@ -64,17 +64,17 @@ class nsMimeType MOZ_FINAL : public nsWr
 public:
   NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsMimeType)
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(nsMimeType)
 
   nsMimeType(nsPIDOMWindow* aWindow, nsPluginElement* aPluginElement,
              uint32_t aPluginTagMimeIndex, const nsAString& aMimeType);
   nsMimeType(nsPIDOMWindow* aWindow, const nsAString& aMimeType);
   nsPIDOMWindow* GetParentObject() const;
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   const nsString& Type() const
   {
     return mType;
   }
 
   // MimeType WebIDL methods
   void GetDescription(nsString& retval) const;
--- a/dom/base/nsPerformance.cpp
+++ b/dom/base/nsPerformance.cpp
@@ -356,19 +356,19 @@ nsPerformanceTiming::ResponseEnd()
 
 bool
 nsPerformanceTiming::IsInitialized() const
 {
   return mInitialized;
 }
 
 JSObject*
-nsPerformanceTiming::WrapObject(JSContext *cx)
+nsPerformanceTiming::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return PerformanceTimingBinding::Wrap(cx, this);
+  return PerformanceTimingBinding::Wrap(cx, this, aGivenProto);
 }
 
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsPerformanceNavigation, mPerformance)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(nsPerformanceNavigation, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(nsPerformanceNavigation, Release)
 
@@ -378,19 +378,19 @@ nsPerformanceNavigation::nsPerformanceNa
   MOZ_ASSERT(aPerformance, "Parent performance object should be provided");
 }
 
 nsPerformanceNavigation::~nsPerformanceNavigation()
 {
 }
 
 JSObject*
-nsPerformanceNavigation::WrapObject(JSContext *cx)
+nsPerformanceNavigation::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return PerformanceNavigationBinding::Wrap(cx, this);
+  return PerformanceNavigationBinding::Wrap(cx, this, aGivenProto);
 }
 
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(nsPerformance, DOMEventTargetHelper,
                                    mWindow, mTiming,
                                    mNavigation, mEntries,
                                    mParentPerformance)
 NS_IMPL_ADDREF_INHERITED(nsPerformance, DOMEventTargetHelper)
@@ -461,19 +461,19 @@ nsPerformance::Navigation()
 
 DOMHighResTimeStamp
 nsPerformance::Now()
 {
   return GetDOMTiming()->TimeStampToDOMHighRes(TimeStamp::Now());
 }
 
 JSObject*
-nsPerformance::WrapObject(JSContext *cx)
+nsPerformance::WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto)
 {
-  return PerformanceBinding::Wrap(cx, this);
+  return PerformanceBinding::Wrap(cx, this, aGivenProto);
 }
 
 void
 nsPerformance::GetEntries(nsTArray<nsRefPtr<PerformanceEntry> >& retval)
 {
   MOZ_ASSERT(NS_IsMainThread());
 
   retval = mEntries;
--- a/dom/base/nsPerformance.h
+++ b/dom/base/nsPerformance.h
@@ -112,17 +112,17 @@ public:
   inline DOMHighResTimeStamp TimeStampToDOMHighRes(TimeStamp aStamp) const
   {
     MOZ_ASSERT(!aStamp.IsNull());
     mozilla::TimeDuration duration =
         aStamp - GetDOMTiming()->GetNavigationStartTimeStamp();
     return duration.ToMilliseconds() + mZeroTime;
   }
 
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // PerformanceNavigation WebIDL methods
   DOMTimeMilliSec NavigationStart() const {
     if (!nsContentUtils::IsPerformanceTimingEnabled()) {
       return 0;
     }
     return GetDOMTiming()->GetNavigationStart();
   }
@@ -266,17 +266,17 @@ public:
   nsDOMNavigationTiming* GetDOMTiming() const;
   nsPerformanceTiming* GetPerformanceTiming() const;
 
   nsPerformance* GetParentObject() const
   {
     return mPerformance;
   }
 
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // PerformanceNavigation WebIDL methods
   uint16_t Type() const {
     return GetDOMTiming()->GetType();
   }
   uint16_t RedirectCount() const {
     return GetPerformanceTiming()->GetRedirectCount();
   }
@@ -314,17 +314,17 @@ public:
     return mParentPerformance;
   }
 
   nsPIDOMWindow* GetParentObject() const
   {
     return mWindow.get();
   }
 
-  virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // Performance WebIDL methods
   DOMHighResTimeStamp Now();
   nsPerformanceTiming* Timing();
   nsPerformanceNavigation* Navigation();
 
   void GetEntries(nsTArray<nsRefPtr<PerformanceEntry> >& retval);
   void GetEntriesByType(const nsAString& entryType,
--- a/dom/base/nsPluginArray.cpp
+++ b/dom/base/nsPluginArray.cpp
@@ -46,19 +46,19 @@ nsPluginArray::~nsPluginArray()
 nsPIDOMWindow*
 nsPluginArray::GetParentObject() const
 {
   MOZ_ASSERT(mWindow);
   return mWindow;
 }
 
 JSObject*
-nsPluginArray::WrapObject(JSContext* aCx)
+nsPluginArray::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return PluginArrayBinding::Wrap(aCx, this);
+  return PluginArrayBinding::Wrap(aCx, this, aGivenProto);
 }
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(nsPluginArray)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(nsPluginArray)
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsPluginArray)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIObserver)
   NS_INTERFACE_MAP_ENTRY(nsIObserver)
@@ -394,19 +394,19 @@ nsPluginElement::~nsPluginElement()
 nsPIDOMWindow*
 nsPluginElement::GetParentObject() const
 {
   MOZ_ASSERT(mWindow);
   return mWindow;
 }
 
 JSObject*
-nsPluginElement::WrapObject(JSContext* aCx)
+nsPluginElement::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return PluginBinding::Wrap(aCx, this);
+  return PluginBinding::Wrap(aCx, this, aGivenProto);
 }
 
 void
 nsPluginElement::GetDescription(nsString& retval) const
 {
   CopyUTF8toUTF16(mPluginTag->mDescription, retval);
 }
 
--- a/dom/base/nsPluginArray.h
+++ b/dom/base/nsPluginArray.h
@@ -26,17 +26,17 @@ public:
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(nsPluginArray,
                                                          nsIObserver)
 
   // nsIObserver
   NS_DECL_NSIOBSERVER
 
   explicit nsPluginArray(nsPIDOMWindow* aWindow);
   nsPIDOMWindow* GetParentObject() const;
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   // nsPluginArray registers itself as an observer with a weak reference.
   // This can't be done in the constructor, because at that point its
   // refcount is 0 (and it gets destroyed upon registration). So, Init()
   // must be called after construction.
   void Init();
   void Invalidate();
 
@@ -80,17 +80,17 @@ class nsPluginElement MOZ_FINAL : public
 {
 public:
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(nsPluginElement)
 
   nsPluginElement(nsPIDOMWindow* aWindow, nsPluginTag* aPluginTag);
 
   nsPIDOMWindow* GetParentObject() const;
-  virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE;
+  virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) MOZ_OVERRIDE;
 
   nsPluginTag* PluginTag() const
   {
     return mPluginTag;
   }
 
   // Plugin WebIDL methods
 
--- a/dom/base/nsRange.cpp
+++ b/dom/base/nsRange.cpp
@@ -33,19 +33,19 @@
 #include "mozilla/Telemetry.h"
 #include "mozilla/Likely.h"
 #include "nsCSSFrameConstructor.h"
 
 using namespace mozilla;
 using namespace mozilla::dom;
 
 JSObject*
-nsRange::WrapObject(JSContext* aCx)
+nsRange::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
 {
-  return RangeBinding::Wrap(aCx, this);
+  return RangeBinding::Wrap(aCx, this, aGivenProto);
 }
 
 /******************************************************
  * stack based utilty class for managing monitor
  ******************************************************/
 
 static void InvalidateAllFrames(nsINode* aNode)
 {
--- a/dom/base/nsRange.h
+++ b/dom/base/nsRange.h
@@ -239,17 +239,17 @@ public:
   void SetStartBefore(nsINode& aNode, ErrorResult& aErr);