author | Boris Zbarsky <bzbarsky@mit.edu> |
Thu, 19 Mar 2015 10:13:33 -0400 | |
changeset 234479 | 0b0c492a33b545fb9daa9b041969e17b5dcbe00e |
parent 234478 | 9b2f419d98ab2258f65c2c6080b905cce1d83e6c |
child 234480 | 0f1732c6f8d51ea1351cba8f459b9df27893c687 |
push id | 28446 |
push user | kwierso@gmail.com |
push date | Fri, 20 Mar 2015 02:15:45 +0000 |
treeherder | mozilla-central@3257d9c4b257 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | peterv |
bugs | 1117172 |
milestone | 39.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
|
--- 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) {