diff --git a/accessible/base/MarkupMap.h b/accessible/base/MarkupMap.h index c2a1d8560d60..741cae563e55 100644 --- a/accessible/base/MarkupMap.h +++ b/accessible/base/MarkupMap.h @@ -205,22 +205,22 @@ MARKUPMAP(mmultiscripts_, roles::MATHML_MULTISCRIPTS) MARKUPMAP(mtable_, - New_HyperText, + New_HTMLTableAccessible, roles::MATHML_TABLE, AttrFromDOM(align, align), AttrFromDOM(columnlines_, columnlines_), AttrFromDOM(rowlines_, rowlines_)) MARKUPMAP(mlabeledtr_, - New_HyperText, + New_HTMLTableRowAccessible, roles::MATHML_LABELED_ROW) MARKUPMAP(mtr_, - New_HyperText, + New_HTMLTableRowAccessible, roles::MATHML_TABLE_ROW) MARKUPMAP(mtd_, - New_HyperText, + New_HTMLTableCellAccessible, roles::MATHML_CELL) MARKUPMAP(maction_, diff --git a/accessible/base/nsAccessibilityService.cpp b/accessible/base/nsAccessibilityService.cpp index 11fb96250b49..9d6b5e0976f0 100644 --- a/accessible/base/nsAccessibilityService.cpp +++ b/accessible/base/nsAccessibilityService.cpp @@ -200,6 +200,18 @@ static Accessible* New_HTMLOutput(nsIContent* aContent, Accessible* aContext) static Accessible* New_HTMLProgress(nsIContent* aContent, Accessible* aContext) { return new HTMLProgressMeterAccessible(aContent, aContext->Document()); } +static Accessible* +New_HTMLTableAccessible(nsIContent* aContent, Accessible* aContext) + { return new HTMLTableAccessible(aContent, aContext->Document()); } + +static Accessible* +New_HTMLTableRowAccessible(nsIContent* aContent, Accessible* aContext) + { return new HTMLTableRowAccessible(aContent, aContext->Document()); } + +static Accessible* +New_HTMLTableCellAccessible(nsIContent* aContent, Accessible* aContext) + { return new HTMLTableCellAccessible(aContent, aContext->Document()); } + static Accessible* New_HTMLTableHeaderCell(nsIContent* aContent, Accessible* aContext) { diff --git a/accessible/html/HTMLTableAccessible.cpp b/accessible/html/HTMLTableAccessible.cpp index e6ae5d43a262..acd7595f6edd 100644 --- a/accessible/html/HTMLTableAccessible.cpp +++ b/accessible/html/HTMLTableAccessible.cpp @@ -60,6 +60,9 @@ NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableCellAccessible, HyperTextAccessible) role HTMLTableCellAccessible::NativeRole() { + if (mContent->IsMathMLElement(nsGkAtoms::mtd_)) { + return roles::MATHML_CELL; + } return roles::CELL; } @@ -148,8 +151,7 @@ HTMLTableCellAccessible::Table() const { Accessible* parent = const_cast(this); while ((parent = parent->Parent())) { - roles::Role role = parent->Role(); - if (role == roles::TABLE || role == roles::TREE_TABLE) + if (parent->IsTable()) return parent->AsTable(); } @@ -349,6 +351,11 @@ NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableRowAccessible, Accessible) role HTMLTableRowAccessible::NativeRole() { + if (mContent->IsMathMLElement(nsGkAtoms::mtr_)) { + return roles::MATHML_TABLE_ROW; + } else if (mContent->IsMathMLElement(nsGkAtoms::mlabeledtr_)) { + return roles::MATHML_LABELED_ROW; + } return roles::ROW; } @@ -384,6 +391,9 @@ HTMLTableAccessible::CacheChildren() role HTMLTableAccessible::NativeRole() { + if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) { + return roles::MATHML_TABLE; + } return roles::TABLE; } @@ -421,6 +431,11 @@ HTMLTableAccessible::NativeAttributes() { nsCOMPtr attributes = AccessibleWrap::NativeAttributes(); + + if (mContent->IsMathMLElement(nsGkAtoms::mtable_)) { + GetAccService()->MarkupAttributes(mContent, attributes); + } + if (IsProbablyLayoutTable()) { nsAutoString unused; attributes->SetStringProperty(NS_LITERAL_CSTRING("layout-guess"), diff --git a/accessible/tests/mochitest/table.js b/accessible/tests/mochitest/table.js index 5bd37bd12ee8..d6b0452803e9 100644 --- a/accessible/tests/mochitest/table.js +++ b/accessible/tests/mochitest/table.js @@ -27,6 +27,13 @@ const kNoColumnHeader = 0; const kListboxColumnHeader = 1; const kTreeColumnHeader = 2; +/** + * Constants to define table type. + */ +const kTable = 0; +const kTreeTable = 1; +const kMathTable = 2; + /** * Test table structure and related methods. * @@ -37,10 +44,11 @@ const kTreeColumnHeader = 2; * arranged into the list. * @param aCaption [in] caption text if any * @param aSummary [in] summary text if any - * @param aIsTreeTable [in] specifies whether given table is tree table + * @param aTableType [in] specifies the table type. + * @param aRowRoles [in] array of row roles. */ function testTableStruct(aIdentifier, aCellsArray, aColHeaderType, - aCaption, aSummary, aIsTreeTable) + aCaption, aSummary, aTableType, aRowRoles) { var tableNode = getNode(aIdentifier); var isGrid = tableNode.getAttribute("role") == "grid" || @@ -52,9 +60,19 @@ function testTableStruct(aIdentifier, aCellsArray, aColHeaderType, // Test table accessible tree. var tableObj = { - role: aIsTreeTable ? ROLE_TREE_TABLE : ROLE_TABLE, children: [] }; + switch (aTableType) { + case kTable: + tableObj.role = ROLE_TABLE; + break; + case kTreeTable: + tableObj.role = ROLE_TREE_TABLE; + break; + case kMathTable: + tableObj.role = ROLE_MATHML_TABLE; + break; + } // caption accessible handling if (aCaption) { @@ -99,7 +117,7 @@ function testTableStruct(aIdentifier, aCellsArray, aColHeaderType, // rows and cells accessibles for (var rowIdx = 0; rowIdx < rowCount; rowIdx++) { var rowObj = { - role: ROLE_ROW, + role: aRowRoles ? aRowRoles[rowIdx] : ROLE_ROW, children: [] }; @@ -109,7 +127,8 @@ function testTableStruct(aIdentifier, aCellsArray, aColHeaderType, var role = ROLE_NOTHING; switch (celltype) { case kDataCell: - role = (isGrid ? ROLE_GRID_CELL : ROLE_CELL); + role = (aTableType == kMathTable ? ROLE_MATHML_CELL : + (isGrid ? ROLE_GRID_CELL : ROLE_CELL)); break; case kRowHeaderCell: role = ROLE_ROWHEADER; diff --git a/accessible/tests/mochitest/table/a11y.ini b/accessible/tests/mochitest/table/a11y.ini index 20800d758596..bfd6995a766c 100644 --- a/accessible/tests/mochitest/table/a11y.ini +++ b/accessible/tests/mochitest/table/a11y.ini @@ -9,6 +9,7 @@ [test_indexes_table.html] [test_indexes_tree.xul] [test_layoutguess.html] +[test_mtable.html] [test_sels_ariagrid.html] [test_sels_listbox.xul] [test_sels_table.html] diff --git a/accessible/tests/mochitest/table/test_mtable.html b/accessible/tests/mochitest/table/test_mtable.html new file mode 100644 index 000000000000..37ea8af50d95 --- /dev/null +++ b/accessible/tests/mochitest/table/test_mtable.html @@ -0,0 +1,128 @@ + + + + MathML table tests + + + + + + + + + + + +

+ +
+  
+ + + + + + 1 + + + 0 + + + + + 0 + + + 1 + + + + + + + + 1 x 3 + + + + + 2 x 2 + + + 1 x 1 + + + + + 1 x 1 + + + + + + + 1 + label + + + + + + diff --git a/accessible/tests/mochitest/table/test_struct_ariatreegrid.html b/accessible/tests/mochitest/table/test_struct_ariatreegrid.html index 5f5ae6e82b52..7c97adb9bac7 100644 --- a/accessible/tests/mochitest/table/test_struct_ariatreegrid.html +++ b/accessible/tests/mochitest/table/test_struct_ariatreegrid.html @@ -28,7 +28,8 @@ [kDataCell, kDataCell, kDataCell] ]; - testTableStruct("treegrid", cellsArray, kNoColumnHeader, "", "", true); + testTableStruct("treegrid", cellsArray, kNoColumnHeader, "", "", + kTreeTable); SimpleTest.finish(); } diff --git a/b2g/components/Frames.jsm b/b2g/components/Frames.jsm index e84c2f247c81..96745bbe2559 100644 --- a/b2g/components/Frames.jsm +++ b/b2g/components/Frames.jsm @@ -25,7 +25,7 @@ const Observer = { start: function () { Services.obs.addObserver(this, 'remote-browser-shown', false); Services.obs.addObserver(this, 'inprocess-browser-shown', false); - Services.obs.addObserver(this, 'message-manager-disconnect', false); + Services.obs.addObserver(this, 'message-manager-close', false); SystemAppProxy.getFrames().forEach(frame => { let mm = frame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager; @@ -40,7 +40,7 @@ const Observer = { stop: function () { Services.obs.removeObserver(this, 'remote-browser-shown'); Services.obs.removeObserver(this, 'inprocess-browser-shown'); - Services.obs.removeObserver(this, 'message-manager-disconnect'); + Services.obs.removeObserver(this, 'message-manager-close'); this._frames.clear(); this._apps.clear(); }, @@ -61,7 +61,7 @@ const Observer = { break; // Every time an iframe is destroyed, its message manager also is - case 'message-manager-disconnect': + case 'message-manager-close': this.onMessageManagerDestroyed(subject); break; } diff --git a/browser/components/sessionstore/content/content-sessionStore.js b/browser/components/sessionstore/content/content-sessionStore.js index c30b6d792793..7066c9473ad9 100644 --- a/browser/components/sessionstore/content/content-sessionStore.js +++ b/browser/components/sessionstore/content/content-sessionStore.js @@ -754,7 +754,7 @@ function handleRevivedTab() { // won't be sent or received. The child-process message manager works though, // despite the fact that we're really running in the parent process. let browser = docShell.chromeEventHandler; - cpmm.sendSyncMessage("SessionStore:RemoteTabRevived", null, {browser: browser}); + cpmm.sendAsyncMessage("SessionStore:RemoteTabRevived", null, {browser: browser}); } } diff --git a/browser/components/sessionstore/test/browser.ini b/browser/components/sessionstore/test/browser.ini index 5467e39b8348..d0a75352121d 100644 --- a/browser/components/sessionstore/test/browser.ini +++ b/browser/components/sessionstore/test/browser.ini @@ -72,7 +72,7 @@ support-files = [browser_cleaner.js] [browser_cookies.js] [browser_crashedTabs.js] -skip-if = !e10s || os == "linux" # Waiting on OMTC enabled by default on Linux (Bug 994541) +skip-if = !e10s || !crashreporter [browser_dying_cache.js] [browser_dynamic_frames.js] [browser_form_restore_events.js] diff --git a/browser/components/sessionstore/test/browser_crashedTabs.js b/browser/components/sessionstore/test/browser_crashedTabs.js index e64c304573ad..ed93f9d0da90 100644 --- a/browser/components/sessionstore/test/browser_crashedTabs.js +++ b/browser/components/sessionstore/test/browser_crashedTabs.js @@ -15,6 +15,9 @@ registerCleanupFunction(() => { // Allow tabs to restore on demand so we can test pending states Services.prefs.clearUserPref("browser.sessionstore.restore_on_demand"); +// Running this test in ASAN is slow. +requestLongerTimeout(2); + /** * Returns a Promise that resolves once a remote has experienced * a crash. Also does the job of cleaning up the minidump of the crash. diff --git a/browser/components/uitour/UITour.jsm b/browser/components/uitour/UITour.jsm index ee2363f3212d..0db7a8bff9c2 100644 --- a/browser/components/uitour/UITour.jsm +++ b/browser/components/uitour/UITour.jsm @@ -684,7 +684,7 @@ this.UITour = { } this.tourBrowsersByWindow.get(window).add(browser); - Services.obs.addObserver(this, "message-manager-disconnect", false); + Services.obs.addObserver(this, "message-manager-close", false); window.addEventListener("SSWindowClosing", this); @@ -736,7 +736,7 @@ this.UITour = { switch (aTopic) { // The browser message manager is disconnected when the is // destroyed and we want to teardown at that point. - case "message-manager-disconnect": { + case "message-manager-close": { let winEnum = Services.wm.getEnumerator("navigator:browser"); while (winEnum.hasMoreElements()) { let window = winEnum.getNext(); diff --git a/browser/devtools/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js b/browser/devtools/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js index 7704bd627599..70cabdfbfbd3 100644 --- a/browser/devtools/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js +++ b/browser/devtools/webconsole/test/browser_webconsole_bug_585991_autocomplete_keys.js @@ -50,9 +50,9 @@ let consoleOpened = Task.async(function*(aHud) { // 4 values, and the following properties: // __defineGetter__ __defineSetter__ __lookupGetter__ __lookupSetter__ - // hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString - // toSource unwatch valueOf watch constructor. - is(popup.itemCount, 18, "popup.itemCount is correct"); + // __proto__ hasOwnProperty isPrototypeOf propertyIsEnumerable + // toLocaleString toString toSource unwatch valueOf watch constructor. + is(popup.itemCount, 19, "popup.itemCount is correct"); let sameItems = popup.getItems().reverse().map(function(e) {return e.label;}); ok(sameItems.every(function(prop, index) { @@ -61,6 +61,7 @@ let consoleOpened = Task.async(function*(aHud) { "__defineSetter__", "__lookupGetter__", "__lookupSetter__", + "__proto__", "constructor", "hasOwnProperty", "isPrototypeOf", @@ -77,7 +78,7 @@ let consoleOpened = Task.async(function*(aHud) { "watch", ][index] === prop}), "getItems returns the items we expect"); - is(popup.selectedIndex, 17, + is(popup.selectedIndex, 18, "Index of the first item from bottom is selected."); EventUtils.synthesizeKey("VK_DOWN", {}); @@ -115,7 +116,7 @@ let consoleOpened = Task.async(function*(aHud) { ok(popup.selectedIndex < currentSelectionIndex, "Index is less after Page UP"); EventUtils.synthesizeKey("VK_END", {}); - is(popup.selectedIndex, 17, "index is last after End"); + is(popup.selectedIndex, 18, "index is last after End"); EventUtils.synthesizeKey("VK_HOME", {}); is(popup.selectedIndex, 0, "index is first after Home"); @@ -152,9 +153,9 @@ function popupHideAfterTab() ok(popup.isOpen, "popup is open"); - is(popup.itemCount, 18, "popup.itemCount is correct"); + is(popup.itemCount, 19, "popup.itemCount is correct"); - is(popup.selectedIndex, 17, "First index from bottom is selected"); + is(popup.selectedIndex, 18, "First index from bottom is selected"); EventUtils.synthesizeKey("VK_DOWN", {}); let prefix = jsterm.inputNode.value.replace(/[\S]/g, " "); @@ -201,9 +202,9 @@ function testReturnKey() ok(popup.isOpen, "popup is open"); - is(popup.itemCount, 18, "popup.itemCount is correct"); + is(popup.itemCount, 19, "popup.itemCount is correct"); - is(popup.selectedIndex, 17, "First index from bottom is selected"); + is(popup.selectedIndex, 18, "First index from bottom is selected"); EventUtils.synthesizeKey("VK_DOWN", {}); let prefix = jsterm.inputNode.value.replace(/[\S]/g, " "); diff --git a/build/autoconf/toolchain.m4 b/build/autoconf/toolchain.m4 index 7b5c6285a23b..bcf58dda0f8f 100644 --- a/build/autoconf/toolchain.m4 +++ b/build/autoconf/toolchain.m4 @@ -101,9 +101,9 @@ AC_SUBST(CLANG_CXX) AC_SUBST(CLANG_CL) if test -n "$GNU_CC" -a -z "$CLANG_CC" ; then - if test "$GCC_MAJOR_VERSION" -eq 4 -a "$GCC_MINOR_VERSION" -lt 6 || + if test "$GCC_MAJOR_VERSION" -eq 4 -a "$GCC_MINOR_VERSION" -lt 7 || test "$GCC_MAJOR_VERSION" -lt 4; then - AC_MSG_ERROR([Only GCC 4.6 or newer supported]) + AC_MSG_ERROR([Only GCC 4.7 or newer supported]) fi fi ]) diff --git a/dom/activities/Activity.cpp b/dom/activities/Activity.cpp index 12f246f10c58..c5254317a218 100644 --- a/dom/activities/Activity.cpp +++ b/dom/activities/Activity.cpp @@ -25,9 +25,9 @@ NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(Activity, DOMRequest) NS_IMPL_CYCLE_COLLECTION_TRACE_END /* virtual */ JSObject* -Activity::WrapObject(JSContext* aCx) +Activity::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MozActivityBinding::Wrap(aCx, this); + return MozActivityBinding::Wrap(aCx, this, aGivenProto); } nsresult diff --git a/dom/activities/Activity.h b/dom/activities/Activity.h index a657024b4637..7e06eb57552b 100644 --- a/dom/activities/Activity.h +++ b/dom/activities/Activity.h @@ -21,7 +21,7 @@ public: NS_DECL_ISUPPORTS_INHERITED NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(Activity, DOMRequest) - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; static already_AddRefed Constructor(const GlobalObject& aOwner, diff --git a/dom/animation/Animation.cpp b/dom/animation/Animation.cpp index 483feff47c35..5916f838ef53 100644 --- a/dom/animation/Animation.cpp +++ b/dom/animation/Animation.cpp @@ -66,9 +66,9 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(Animation, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(Animation, Release) JSObject* -Animation::WrapObject(JSContext* aCx) +Animation::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return AnimationBinding::Wrap(aCx, this); + return AnimationBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed diff --git a/dom/animation/Animation.h b/dom/animation/Animation.h index d0510e331881..3e38b8ae23d3 100644 --- a/dom/animation/Animation.h +++ b/dom/animation/Animation.h @@ -189,7 +189,7 @@ public: 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 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 diff --git a/dom/animation/AnimationEffect.cpp b/dom/animation/AnimationEffect.cpp index a72e6ded9760..0aed86fbab99 100644 --- a/dom/animation/AnimationEffect.cpp +++ b/dom/animation/AnimationEffect.cpp @@ -15,9 +15,9 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AnimationEffect, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AnimationEffect, Release) JSObject* -AnimationEffect::WrapObject(JSContext* aCx) +AnimationEffect::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return AnimationEffectBinding::Wrap(aCx, this); + return AnimationEffectBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/animation/AnimationEffect.h b/dom/animation/AnimationEffect.h index 55abb7b6cf47..60261e7dafac 100644 --- a/dom/animation/AnimationEffect.h +++ b/dom/animation/AnimationEffect.h @@ -27,7 +27,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(AnimationEffect) Animation* GetParentObject() const { return mAnimation; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // AnimationEffect interface void GetName(nsString& aRetVal) const { diff --git a/dom/animation/AnimationPlayer.cpp b/dom/animation/AnimationPlayer.cpp index 20e27a1b225f..a9166819d653 100644 --- a/dom/animation/AnimationPlayer.cpp +++ b/dom/animation/AnimationPlayer.cpp @@ -26,9 +26,9 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AnimationPlayer) NS_INTERFACE_MAP_END JSObject* -AnimationPlayer::WrapObject(JSContext* aCx) +AnimationPlayer::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return dom::AnimationPlayerBinding::Wrap(aCx, this); + return dom::AnimationPlayerBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/animation/AnimationPlayer.h b/dom/animation/AnimationPlayer.h index aa04a29c6f70..09e680ebdc78 100644 --- a/dom/animation/AnimationPlayer.h +++ b/dom/animation/AnimationPlayer.h @@ -64,7 +64,7 @@ public: 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 aGivenProto) MOZ_OVERRIDE; virtual CSSAnimationPlayer* AsCSSAnimationPlayer() { return nullptr; } virtual CSSTransitionPlayer* AsCSSTransitionPlayer() { return nullptr; } diff --git a/dom/animation/AnimationTimeline.cpp b/dom/animation/AnimationTimeline.cpp index 20facc2081f8..d83ae7389b9f 100644 --- a/dom/animation/AnimationTimeline.cpp +++ b/dom/animation/AnimationTimeline.cpp @@ -21,9 +21,9 @@ NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(AnimationTimeline, AddRef) NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(AnimationTimeline, Release) JSObject* -AnimationTimeline::WrapObject(JSContext* aCx) +AnimationTimeline::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return AnimationTimelineBinding::Wrap(aCx, this); + return AnimationTimelineBinding::Wrap(aCx, this, aGivenProto); } Nullable diff --git a/dom/animation/AnimationTimeline.h b/dom/animation/AnimationTimeline.h index d9f7b7db6c2f..81905de124aa 100644 --- a/dom/animation/AnimationTimeline.h +++ b/dom/animation/AnimationTimeline.h @@ -41,7 +41,7 @@ public: { return mWindow; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // AnimationTimeline methods Nullable GetCurrentTime() const; diff --git a/dom/archivereader/ArchiveReader.cpp b/dom/archivereader/ArchiveReader.cpp index c0439c644fc7..be0223956146 100644 --- a/dom/archivereader/ArchiveReader.cpp +++ b/dom/archivereader/ArchiveReader.cpp @@ -61,9 +61,9 @@ ArchiveReader::~ArchiveReader() } /* virtual */ JSObject* -ArchiveReader::WrapObject(JSContext* aCx) +ArchiveReader::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return ArchiveReaderBinding::Wrap(aCx, this); + return ArchiveReaderBinding::Wrap(aCx, this, aGivenProto); } nsresult diff --git a/dom/archivereader/ArchiveReader.h b/dom/archivereader/ArchiveReader.h index 2187a54a0a4f..90991897a9c0 100644 --- a/dom/archivereader/ArchiveReader.h +++ b/dom/archivereader/ArchiveReader.h @@ -51,7 +51,7 @@ public: return mWindow; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; already_AddRefed GetFilenames(); already_AddRefed GetFile(const nsAString& filename); diff --git a/dom/archivereader/ArchiveRequest.cpp b/dom/archivereader/ArchiveRequest.cpp index 9a8453dd81f0..94fdb37749d7 100644 --- a/dom/archivereader/ArchiveRequest.cpp +++ b/dom/archivereader/ArchiveRequest.cpp @@ -77,9 +77,9 @@ ArchiveRequest::PreHandleEvent(EventChainPreVisitor& aVisitor) } /* virtual */ JSObject* -ArchiveRequest::WrapObject(JSContext* aCx) +ArchiveRequest::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return ArchiveRequestBinding::Wrap(aCx, this); + return ArchiveRequestBinding::Wrap(aCx, this, aGivenProto); } ArchiveReader* diff --git a/dom/archivereader/ArchiveRequest.h b/dom/archivereader/ArchiveRequest.h index 982d4fde19d4..2ce5cced21cc 100644 --- a/dom/archivereader/ArchiveRequest.h +++ b/dom/archivereader/ArchiveRequest.h @@ -26,7 +26,7 @@ BEGIN_ARCHIVEREADER_NAMESPACE class ArchiveRequest : public mozilla::dom::DOMRequest { public: - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; ArchiveReader* Reader() const; diff --git a/dom/base/AnonymousContent.cpp b/dom/base/AnonymousContent.cpp index cee56aa879ba..69878bd05510 100644 --- a/dom/base/AnonymousContent.cpp +++ b/dom/base/AnonymousContent.cpp @@ -131,9 +131,10 @@ AnonymousContent::GetElementById(const nsAString& aElementId) bool AnonymousContent::WrapObject(JSContext* aCx, + JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return AnonymousContentBinding::Wrap(aCx, this, aReflector); + return AnonymousContentBinding::Wrap(aCx, this, aGivenProto, aReflector); } } // dom namespace diff --git a/dom/base/AnonymousContent.h b/dom/base/AnonymousContent.h index 72832b95f9e2..ab7c78153618 100644 --- a/dom/base/AnonymousContent.h +++ b/dom/base/AnonymousContent.h @@ -27,7 +27,7 @@ public: explicit AnonymousContent(Element* aContentNode); nsCOMPtr GetContentNode(); void SetContentNode(Element* aContentNode); - bool WrapObject(JSContext* aCx, JS::MutableHandle aReflector); + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); // WebIDL methods void SetTextContentForElement(const nsAString& aElementId, diff --git a/dom/base/Attr.cpp b/dom/base/Attr.cpp index b67b8de77a10..c1bc066f8370 100644 --- a/dom/base/Attr.cpp +++ b/dom/base/Attr.cpp @@ -384,9 +384,9 @@ Attr::Shutdown() } JSObject* -Attr::WrapNode(JSContext* aCx) +Attr::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return AttrBinding::Wrap(aCx, this); + return AttrBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/Attr.h b/dom/base/Attr.h index d6b486229ccf..a44c6c484269 100644 --- a/dom/base/Attr.h +++ b/dom/base/Attr.h @@ -82,7 +82,7 @@ public: virtual nsIDOMNode* AsDOMNode() MOZ_OVERRIDE { return this; } // WebIDL - virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // XPCOM GetName() is OK // XPCOM GetValue() is OK diff --git a/dom/base/BarProps.cpp b/dom/base/BarProps.cpp index 3816946ff46d..55176123341e 100644 --- a/dom/base/BarProps.cpp +++ b/dom/base/BarProps.cpp @@ -34,9 +34,9 @@ BarProp::GetParentObject() const } JSObject* -BarProp::WrapObject(JSContext* aCx) +BarProp::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return BarPropBinding::Wrap(aCx, this); + return BarPropBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(BarProp, mDOMWindow) diff --git a/dom/base/BarProps.h b/dom/base/BarProps.h index b7f2642bb2c3..4b401ff2221b 100644 --- a/dom/base/BarProps.h +++ b/dom/base/BarProps.h @@ -40,7 +40,7 @@ public: nsPIDOMWindow* GetParentObject() const; virtual JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; virtual bool GetVisible(ErrorResult& aRv) = 0; virtual void SetVisible(bool aVisible, ErrorResult& aRv) = 0; diff --git a/dom/base/Comment.cpp b/dom/base/Comment.cpp index 11a0a304a149..d89ff69e320a 100644 --- a/dom/base/Comment.cpp +++ b/dom/base/Comment.cpp @@ -74,9 +74,9 @@ Comment::Constructor(const GlobalObject& aGlobal, } JSObject* -Comment::WrapNode(JSContext *aCx) +Comment::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return CommentBinding::Wrap(aCx, this); + return CommentBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/Comment.h b/dom/base/Comment.h index 5bef6d711cf6..15aa1e6179fe 100644 --- a/dom/base/Comment.h +++ b/dom/base/Comment.h @@ -72,7 +72,7 @@ public: ErrorResult& aRv); protected: - virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; }; } // namespace dom diff --git a/dom/base/Console.cpp b/dom/base/Console.cpp index 2d0e6082d0e7..c1f63ed1151e 100644 --- a/dom/base/Console.cpp +++ b/dom/base/Console.cpp @@ -722,9 +722,9 @@ Console::Observe(nsISupports* aSubject, const char* aTopic, } JSObject* -Console::WrapObject(JSContext* aCx) +Console::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return ConsoleBinding::Wrap(aCx, this); + return ConsoleBinding::Wrap(aCx, this, aGivenProto); } #define METHOD(name, string) \ diff --git a/dom/base/Console.h b/dom/base/Console.h index bc096793f834..64d083409bbd 100644 --- a/dom/base/Console.h +++ b/dom/base/Console.h @@ -44,7 +44,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; void Log(JSContext* aCx, const Sequence& aData); diff --git a/dom/base/Crypto.cpp b/dom/base/Crypto.cpp index 83b769cde768..a260b58c21f1 100644 --- a/dom/base/Crypto.cpp +++ b/dom/base/Crypto.cpp @@ -46,9 +46,9 @@ Crypto::Init(nsIGlobalObject* aParent) } /* virtual */ JSObject* -Crypto::WrapObject(JSContext* aCx) +Crypto::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CryptoBinding::Wrap(aCx, this); + return CryptoBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/base/Crypto.h b/dom/base/Crypto.h index a6d8eea91b65..56ac96d5b278 100644 --- a/dom/base/Crypto.h +++ b/dom/base/Crypto.h @@ -50,7 +50,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; static uint8_t* GetRandomValues(uint32_t aLength); diff --git a/dom/base/DOMCursor.cpp b/dom/base/DOMCursor.cpp index e8b97f29d979..cbe1b2682459 100644 --- a/dom/base/DOMCursor.cpp +++ b/dom/base/DOMCursor.cpp @@ -76,9 +76,9 @@ DOMCursor::Continue(ErrorResult& aRv) } /* virtual */ JSObject* -DOMCursor::WrapObject(JSContext* aCx) +DOMCursor::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMCursorBinding::Wrap(aCx, this); + return DOMCursorBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/DOMCursor.h b/dom/base/DOMCursor.h index abb6bcb45b49..f55177a17c7b 100644 --- a/dom/base/DOMCursor.h +++ b/dom/base/DOMCursor.h @@ -27,7 +27,7 @@ public: DOMCursor(nsPIDOMWindow* aWindow, nsICursorContinueCallback *aCallback); - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; bool Done() const { diff --git a/dom/base/DOMError.cpp b/dom/base/DOMError.cpp index c956c82e7887..6e2bde3b7a61 100644 --- a/dom/base/DOMError.cpp +++ b/dom/base/DOMError.cpp @@ -55,9 +55,9 @@ DOMError::~DOMError() } JSObject* -DOMError::WrapObject(JSContext* aCx) +DOMError::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMErrorBinding::Wrap(aCx, this); + return DOMErrorBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/base/DOMError.h b/dom/base/DOMError.h index b4532698b3f8..1d32f4333157 100644 --- a/dom/base/DOMError.h +++ b/dom/base/DOMError.h @@ -59,7 +59,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; static already_AddRefed Constructor(const GlobalObject& global, const nsAString& name, diff --git a/dom/base/DOMException.cpp b/dom/base/DOMException.cpp index 8508ac9e18d1..0836d42fe36e 100644 --- a/dom/base/DOMException.cpp +++ b/dom/base/DOMException.cpp @@ -490,9 +490,9 @@ Exception::Initialize(const nsACString& aMessage, nsresult aResult, } JSObject* -Exception::WrapObject(JSContext* cx) +Exception::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return ExceptionBinding::Wrap(cx, this); + return ExceptionBinding::Wrap(cx, this, aGivenProto); } void @@ -706,9 +706,9 @@ DOMException::Constructor(GlobalObject& /* unused */, } JSObject* -DOMException::WrapObject(JSContext* aCx) +DOMException::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMExceptionBinding::Wrap(aCx, this); + return DOMExceptionBinding::Wrap(aCx, this, aGivenProto); } /* static */already_AddRefed diff --git a/dom/base/DOMException.h b/dom/base/DOMException.h index 89bfd1e8669d..5e1edb56a751 100644 --- a/dom/base/DOMException.h +++ b/dom/base/DOMException.h @@ -63,7 +63,7 @@ public: void StowJSVal(JS::Value& aVp); // WebIDL API - virtual JSObject* WrapObject(JSContext* cx) + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsISupports* GetParentObject() const { return nullptr; } @@ -136,7 +136,7 @@ public: NS_IMETHOD ToString(nsACString& aReturn) MOZ_OVERRIDE; // nsWrapperCache overrides - virtual JSObject* WrapObject(JSContext* aCx) + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; static already_AddRefed diff --git a/dom/base/DOMImplementation.cpp b/dom/base/DOMImplementation.cpp index ad9a2c47e861..c637fc29db1e 100644 --- a/dom/base/DOMImplementation.cpp +++ b/dom/base/DOMImplementation.cpp @@ -29,9 +29,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(DOMImplementation) NS_IMPL_CYCLE_COLLECTING_RELEASE(DOMImplementation) JSObject* -DOMImplementation::WrapObject(JSContext* aCx) +DOMImplementation::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMImplementationBinding::Wrap(aCx, this); + return DOMImplementationBinding::Wrap(aCx, this, aGivenProto); } bool diff --git a/dom/base/DOMImplementation.h b/dom/base/DOMImplementation.h index 1dd114cbb42a..284c153d6ddb 100644 --- a/dom/base/DOMImplementation.h +++ b/dom/base/DOMImplementation.h @@ -52,7 +52,7 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // nsIDOMDOMImplementation NS_DECL_NSIDOMDOMIMPLEMENTATION diff --git a/dom/base/DOMMatrix.cpp b/dom/base/DOMMatrix.cpp index a30d2ddd0431..4d1b8faae795 100644 --- a/dom/base/DOMMatrix.cpp +++ b/dom/base/DOMMatrix.cpp @@ -658,9 +658,9 @@ DOMMatrix::SetMatrixValue(const nsAString& aTransformList, ErrorResult& aRv) } JSObject* -DOMMatrix::WrapObject(JSContext* aCx) +DOMMatrix::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMMatrixBinding::Wrap(aCx, this); + return DOMMatrixBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/DOMMatrix.h b/dom/base/DOMMatrix.h index 64d52d5564bb..5e815a5714e5 100644 --- a/dom/base/DOMMatrix.h +++ b/dom/base/DOMMatrix.h @@ -166,7 +166,7 @@ public: Constructor(const GlobalObject& aGlobal, const Sequence& aNumberSequence, ErrorResult& aRv); nsISupports* GetParentObject() const { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; #define Set2DMatrixMember(entry2D, entry3D) \ { \ diff --git a/dom/base/DOMParser.h b/dom/base/DOMParser.h index 287426d4d3a0..afe69546b863 100644 --- a/dom/base/DOMParser.h +++ b/dom/base/DOMParser.h @@ -75,9 +75,9 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE { - return mozilla::dom::DOMParserBinding::Wrap(aCx, this); + return mozilla::dom::DOMParserBinding::Wrap(aCx, this, aGivenProto); } private: diff --git a/dom/base/DOMPoint.cpp b/dom/base/DOMPoint.cpp index d2faf3634fe5..c7fc4896ffea 100644 --- a/dom/base/DOMPoint.cpp +++ b/dom/base/DOMPoint.cpp @@ -37,7 +37,7 @@ DOMPoint::Constructor(const GlobalObject& aGlobal, double aX, double aY, } JSObject* -DOMPoint::WrapObject(JSContext* aCx) +DOMPoint::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMPointBinding::Wrap(aCx, this); + return DOMPointBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/DOMPoint.h b/dom/base/DOMPoint.h index e700730c772f..8a12a3c24c99 100644 --- a/dom/base/DOMPoint.h +++ b/dom/base/DOMPoint.h @@ -64,7 +64,7 @@ public: double aZ, double aW, ErrorResult& aRV); nsISupports* GetParentObject() const { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; void SetX(double aX) { mX = aX; } void SetY(double aY) { mY = aY; } diff --git a/dom/base/DOMQuad.cpp b/dom/base/DOMQuad.cpp index 9c4581fcee70..735fc2c650de 100644 --- a/dom/base/DOMQuad.cpp +++ b/dom/base/DOMQuad.cpp @@ -38,9 +38,9 @@ DOMQuad::~DOMQuad() } JSObject* -DOMQuad::WrapObject(JSContext* aCx) +DOMQuad::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMQuadBinding::Wrap(aCx, this); + return DOMQuadBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed diff --git a/dom/base/DOMQuad.h b/dom/base/DOMQuad.h index 132a052e8d40..b5f22b96da30 100644 --- a/dom/base/DOMQuad.h +++ b/dom/base/DOMQuad.h @@ -35,7 +35,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(DOMQuad) nsISupports* GetParentObject() const { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; static already_AddRefed Constructor(const GlobalObject& aGlobal, diff --git a/dom/base/DOMRect.cpp b/dom/base/DOMRect.cpp index 92a2a1207467..ec4b0f1437d5 100644 --- a/dom/base/DOMRect.cpp +++ b/dom/base/DOMRect.cpp @@ -21,10 +21,10 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(DOMRectReadOnly) NS_INTERFACE_MAP_END JSObject* -DOMRectReadOnly::WrapObject(JSContext* aCx) +DOMRectReadOnly::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { MOZ_ASSERT(mParent); - return DOMRectReadOnlyBinding::Wrap(aCx, this); + return DOMRectReadOnlyBinding::Wrap(aCx, this, aGivenProto); } // ----------------------------------------------------------------------------- @@ -47,10 +47,10 @@ FORWARD_GETTER(Width) FORWARD_GETTER(Height) JSObject* -DOMRect::WrapObject(JSContext* aCx) +DOMRect::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { MOZ_ASSERT(mParent); - return DOMRectBinding::Wrap(aCx, this); + return DOMRectBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed @@ -99,9 +99,9 @@ DOMRectList::Item(uint32_t aIndex, nsIDOMClientRect** aReturn) } JSObject* -DOMRectList::WrapObject(JSContext *cx) +DOMRectList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return mozilla::dom::DOMRectListBinding::Wrap(cx, this); + return mozilla::dom::DOMRectListBinding::Wrap(cx, this, aGivenProto); } static double diff --git a/dom/base/DOMRect.h b/dom/base/DOMRect.h index a3f8510f911f..501e17d1bee4 100644 --- a/dom/base/DOMRect.h +++ b/dom/base/DOMRect.h @@ -43,7 +43,7 @@ public: MOZ_ASSERT(mParent); return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; virtual double X() const = 0; virtual double Y() const = 0; @@ -98,7 +98,7 @@ public: Constructor(const GlobalObject& aGlobal, double aX, double aY, double aWidth, double aHeight, ErrorResult& aRV); - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; void SetRect(float aX, float aY, float aWidth, float aHeight) { mX = aX; mY = aY; mWidth = aWidth; mHeight = aHeight; @@ -161,7 +161,7 @@ public: NS_DECL_NSIDOMCLIENTRECTLIST - virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsISupports* GetParentObject() { diff --git a/dom/base/DOMRequest.cpp b/dom/base/DOMRequest.cpp index fba7204b985d..9883f472187e 100644 --- a/dom/base/DOMRequest.cpp +++ b/dom/base/DOMRequest.cpp @@ -66,9 +66,9 @@ NS_IMPL_ADDREF_INHERITED(DOMRequest, DOMEventTargetHelper) NS_IMPL_RELEASE_INHERITED(DOMRequest, DOMEventTargetHelper) /* virtual */ JSObject* -DOMRequest::WrapObject(JSContext* aCx) +DOMRequest::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMRequestBinding::Wrap(aCx, this); + return DOMRequestBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_EVENT_HANDLER(DOMRequest, success) diff --git a/dom/base/DOMRequest.h b/dom/base/DOMRequest.h index 53bd27e28565..cb2cf462a26a 100644 --- a/dom/base/DOMRequest.h +++ b/dom/base/DOMRequest.h @@ -47,7 +47,7 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // WebIDL Interface DOMRequestReadyState ReadyState() const diff --git a/dom/base/DOMStringList.cpp b/dom/base/DOMStringList.cpp index 3b79058a6f50..98560ae93446 100644 --- a/dom/base/DOMStringList.cpp +++ b/dom/base/DOMStringList.cpp @@ -24,9 +24,9 @@ DOMStringList::~DOMStringList() } JSObject* -DOMStringList::WrapObject(JSContext* aCx) +DOMStringList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DOMStringListBinding::Wrap(aCx, this); + return DOMStringListBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/DOMStringList.h b/dom/base/DOMStringList.h index 03b28a3d1de7..b6c5b2c968e9 100644 --- a/dom/base/DOMStringList.h +++ b/dom/base/DOMStringList.h @@ -24,7 +24,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMStringList) - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsISupports* GetParentObject() { return nullptr; diff --git a/dom/base/DocumentFragment.cpp b/dom/base/DocumentFragment.cpp index 2a2945dd50f1..960a7223e944 100644 --- a/dom/base/DocumentFragment.cpp +++ b/dom/base/DocumentFragment.cpp @@ -24,9 +24,9 @@ namespace mozilla { namespace dom { JSObject* -DocumentFragment::WrapNode(JSContext *aCx) +DocumentFragment::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return DocumentFragmentBinding::Wrap(aCx, this); + return DocumentFragmentBinding::Wrap(aCx, this, aGivenProto); } bool diff --git a/dom/base/DocumentFragment.h b/dom/base/DocumentFragment.h index 92ff12af0998..9877b4145ed8 100644 --- a/dom/base/DocumentFragment.h +++ b/dom/base/DocumentFragment.h @@ -65,7 +65,7 @@ public: Init(); } - virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // nsIContent nsresult SetAttr(int32_t aNameSpaceID, nsIAtom* aName, diff --git a/dom/base/DocumentType.cpp b/dom/base/DocumentType.cpp index 50ef9e9004f6..a170bf266618 100644 --- a/dom/base/DocumentType.cpp +++ b/dom/base/DocumentType.cpp @@ -60,9 +60,9 @@ namespace mozilla { namespace dom { JSObject* -DocumentType::WrapNode(JSContext *cx) +DocumentType::WrapNode(JSContext *cx, JS::Handle aGivenProto) { - return DocumentTypeBinding::Wrap(cx, this); + return DocumentTypeBinding::Wrap(cx, this, aGivenProto); } DocumentType::DocumentType(already_AddRefed& aNodeInfo, diff --git a/dom/base/DocumentType.h b/dom/base/DocumentType.h index da32636e74aa..defb5ed51a3f 100644 --- a/dom/base/DocumentType.h +++ b/dom/base/DocumentType.h @@ -77,7 +77,7 @@ public: protected: virtual ~DocumentType(); - virtual JSObject* WrapNode(JSContext *cx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsString mPublicId; nsString mSystemId; diff --git a/dom/base/Element.cpp b/dom/base/Element.cpp index abb740915451..87306a3de382 100644 --- a/dom/base/Element.cpp +++ b/dom/base/Element.cpp @@ -406,9 +406,9 @@ Element::GetBindingURL(nsIDocument *aDocument, css::URLValue **aResult) } JSObject* -Element::WrapObject(JSContext *aCx) +Element::WrapObject(JSContext *aCx, JS::Handle aGivenProto) { - JS::Rooted obj(aCx, nsINode::WrapObject(aCx)); + JS::Rooted obj(aCx, nsINode::WrapObject(aCx, aGivenProto)); if (!obj) { return nullptr; } @@ -1108,9 +1108,9 @@ DestinationInsertionPointList::IndexOf(nsIContent* aContent) } JSObject* -DestinationInsertionPointList::WrapObject(JSContext* aCx) +DestinationInsertionPointList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return NodeListBinding::Wrap(aCx, this); + return NodeListBinding::Wrap(aCx, this, aGivenProto); } already_AddRefed diff --git a/dom/base/Element.h b/dom/base/Element.h index a531f827936c..6e5277f77045 100644 --- a/dom/base/Element.h +++ b/dom/base/Element.h @@ -960,7 +960,7 @@ public: nsIDOMHTMLCollection** aResult); void GetClassList(nsISupports** aClassList); - virtual JSObject* WrapObject(JSContext *aCx) MOZ_FINAL MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) MOZ_FINAL MOZ_OVERRIDE; nsINode* GetScopeChainParent() const MOZ_OVERRIDE; @@ -1315,7 +1315,7 @@ public: 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 aGivenProto) MOZ_OVERRIDE; protected: virtual ~DestinationInsertionPointList(); diff --git a/dom/base/EventSource.cpp b/dom/base/EventSource.cpp index ae596e25f844..48ccb933aae2 100644 --- a/dom/base/EventSource.cpp +++ b/dom/base/EventSource.cpp @@ -265,9 +265,9 @@ EventSource::Init(nsISupports* aOwner, } /* virtual */ JSObject* -EventSource::WrapObject(JSContext* aCx) +EventSource::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return EventSourceBinding::Wrap(aCx, this); + return EventSourceBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/base/EventSource.h b/dom/base/EventSource.h index 5cf486cf4044..92b3cc535290 100644 --- a/dom/base/EventSource.h +++ b/dom/base/EventSource.h @@ -58,7 +58,7 @@ public: NS_DECL_NSIINTERFACEREQUESTOR // nsWrapperCache - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // WebIDL nsPIDOMWindow* diff --git a/dom/base/File.cpp b/dom/base/File.cpp index 93611359c140..a38220f2fc96 100644 --- a/dom/base/File.cpp +++ b/dom/base/File.cpp @@ -559,10 +559,10 @@ File::IsMemoryFile() } JSObject* -File::WrapObject(JSContext* aCx) +File::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return IsFile() ? FileBinding::Wrap(aCx, this) - : BlobBinding::Wrap(aCx, this); + return IsFile() ? FileBinding::Wrap(aCx, this, aGivenProto) + : BlobBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed @@ -1235,9 +1235,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(FileList) NS_IMPL_CYCLE_COLLECTING_RELEASE(FileList) JSObject* -FileList::WrapObject(JSContext *cx) +FileList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return mozilla::dom::FileListBinding::Wrap(cx, this); + return mozilla::dom::FileListBinding::Wrap(cx, this, aGivenProto); } NS_IMETHODIMP diff --git a/dom/base/File.h b/dom/base/File.h index 3702fefebd20..cdd1466582d9 100644 --- a/dom/base/File.h +++ b/dom/base/File.h @@ -189,7 +189,7 @@ public: const ChromeFilePropertyBag& aBag, ErrorResult& aRv); - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; uint64_t GetSize(ErrorResult& aRv); @@ -828,7 +828,7 @@ public: NS_DECL_NSIDOMFILELIST - virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsISupports* GetParentObject() { diff --git a/dom/base/FragmentOrElement.cpp b/dom/base/FragmentOrElement.cpp index aaa76205194c..26cf22041092 100644 --- a/dom/base/FragmentOrElement.cpp +++ b/dom/base/FragmentOrElement.cpp @@ -401,9 +401,9 @@ NS_INTERFACE_TABLE_HEAD(nsChildContentList) NS_INTERFACE_MAP_END JSObject* -nsChildContentList::WrapObject(JSContext *cx) +nsChildContentList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return NodeListBinding::Wrap(cx, this); + return NodeListBinding::Wrap(cx, this, aGivenProto); } NS_IMETHODIMP diff --git a/dom/base/FragmentOrElement.h b/dom/base/FragmentOrElement.h index 0285576b847e..da9d43c9ce66 100644 --- a/dom/base/FragmentOrElement.h +++ b/dom/base/FragmentOrElement.h @@ -56,7 +56,7 @@ public: NS_DECL_CYCLE_COLLECTION_SKIPPABLE_SCRIPT_HOLDER_CLASS(nsChildContentList) // nsWrapperCache - virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE; // nsIDOMNodeList interface NS_DECL_NSIDOMNODELIST diff --git a/dom/base/MessageChannel.cpp b/dom/base/MessageChannel.cpp index d04edf4e9479..24f3f5d89965 100644 --- a/dom/base/MessageChannel.cpp +++ b/dom/base/MessageChannel.cpp @@ -81,9 +81,9 @@ MessageChannel::~MessageChannel() } JSObject* -MessageChannel::WrapObject(JSContext* aCx) +MessageChannel::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MessageChannelBinding::Wrap(aCx, this); + return MessageChannelBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/base/MessageChannel.h b/dom/base/MessageChannel.h index c7411eae9fe2..e6e76239574c 100644 --- a/dom/base/MessageChannel.h +++ b/dom/base/MessageChannel.h @@ -40,7 +40,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; static already_AddRefed Constructor(const GlobalObject& aGlobal, ErrorResult& aRv); diff --git a/dom/base/MessagePort.cpp b/dom/base/MessagePort.cpp index e0bc4ab991dd..65ac92d1cab2 100644 --- a/dom/base/MessagePort.cpp +++ b/dom/base/MessagePort.cpp @@ -223,7 +223,7 @@ PostMessageReadTransferStructuredClone(JSContext* aCx, port->BindToOwner(scInfo->mPort->GetOwner()); scInfo->mPorts.Put(port, nullptr); - JS::Rooted obj(aCx, port->WrapObject(aCx)); + JS::Rooted obj(aCx, port->WrapObject(aCx, JS::NullPtr())); if (!obj || !JS_WrapObject(aCx, &obj)) { return false; } @@ -414,9 +414,9 @@ MessagePort::~MessagePort() } JSObject* -MessagePort::WrapObject(JSContext* aCx) +MessagePort::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MessagePortBinding::Wrap(aCx, this); + return MessagePortBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/base/MessagePort.h b/dom/base/MessagePort.h index ca3e8dd74f4e..a003f86f194c 100644 --- a/dom/base/MessagePort.h +++ b/dom/base/MessagePort.h @@ -64,7 +64,7 @@ public: explicit MessagePort(nsPIDOMWindow* aWindow); virtual JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; virtual void PostMessageMoz(JSContext* aCx, JS::Handle aMessage, diff --git a/dom/base/MessagePortList.cpp b/dom/base/MessagePortList.cpp index dc7b3c038f33..c48e1be4c7d0 100644 --- a/dom/base/MessagePortList.cpp +++ b/dom/base/MessagePortList.cpp @@ -20,9 +20,9 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MessagePortList) NS_INTERFACE_MAP_END JSObject* -MessagePortList::WrapObject(JSContext* aCx) +MessagePortList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MessagePortListBinding::Wrap(aCx, this); + return MessagePortListBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/base/MessagePortList.h b/dom/base/MessagePortList.h index fa852f73259f..c1e711179c8f 100644 --- a/dom/base/MessagePortList.h +++ b/dom/base/MessagePortList.h @@ -41,7 +41,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; uint32_t Length() const diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp index ad008d448606..1bfd69e56159 100644 --- a/dom/base/Navigator.cpp +++ b/dom/base/Navigator.cpp @@ -2234,9 +2234,9 @@ Navigator::GetOwnPropertyNames(JSContext* aCx, nsTArray& aNames, } JSObject* -Navigator::WrapObject(JSContext* cx) +Navigator::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return NavigatorBinding::Wrap(cx, this); + return NavigatorBinding::Wrap(cx, this, aGivenProto); } /* static */ diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h index 09ba8e958a9e..59805720d19b 100644 --- a/dom/base/Navigator.h +++ b/dom/base/Navigator.h @@ -324,7 +324,7 @@ public: return GetWindow(); } - virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) MOZ_OVERRIDE; // GetWindowFromGlobal returns the inner window for this global, if // any, else null. diff --git a/dom/base/NodeIterator.cpp b/dom/base/NodeIterator.cpp index 4fc03e66d993..2d5729348c1f 100644 --- a/dom/base/NodeIterator.cpp +++ b/dom/base/NodeIterator.cpp @@ -289,9 +289,9 @@ void NodeIterator::ContentRemoved(nsIDocument *aDocument, } bool -NodeIterator::WrapObject(JSContext *cx, JS::MutableHandle aReflector) +NodeIterator::WrapObject(JSContext *cx, JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return NodeIteratorBinding::Wrap(cx, this, aReflector); + return NodeIteratorBinding::Wrap(cx, this, aGivenProto, aReflector); } } // namespace dom diff --git a/dom/base/NodeIterator.h b/dom/base/NodeIterator.h index 45af89c9d468..38f0876ae736 100644 --- a/dom/base/NodeIterator.h +++ b/dom/base/NodeIterator.h @@ -69,7 +69,7 @@ public: } // The XPCOM Detach() is fine for our purposes - bool WrapObject(JSContext *cx, JS::MutableHandle aReflector); + bool WrapObject(JSContext *cx, JS::Handle aGivenProto, JS::MutableHandle aReflector); private: virtual ~NodeIterator(); diff --git a/dom/base/PerformanceEntry.cpp b/dom/base/PerformanceEntry.cpp index 1472d59fe700..0caa7157275a 100644 --- a/dom/base/PerformanceEntry.cpp +++ b/dom/base/PerformanceEntry.cpp @@ -34,7 +34,7 @@ PerformanceEntry::~PerformanceEntry() } JSObject* -PerformanceEntry::WrapObject(JSContext* aCx) +PerformanceEntry::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return mozilla::dom::PerformanceEntryBinding::Wrap(aCx, this); + return mozilla::dom::PerformanceEntryBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/PerformanceEntry.h b/dom/base/PerformanceEntry.h index edffe8b30db8..7015a6324fa9 100644 --- a/dom/base/PerformanceEntry.h +++ b/dom/base/PerformanceEntry.h @@ -27,7 +27,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PerformanceEntry) - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsPerformance* GetParentObject() const { diff --git a/dom/base/PerformanceMark.cpp b/dom/base/PerformanceMark.cpp index 67952b256bf9..fadc6840a864 100644 --- a/dom/base/PerformanceMark.cpp +++ b/dom/base/PerformanceMark.cpp @@ -21,7 +21,7 @@ PerformanceMark::~PerformanceMark() } JSObject* -PerformanceMark::WrapObject(JSContext* aCx) +PerformanceMark::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PerformanceMarkBinding::Wrap(aCx, this); + return PerformanceMarkBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/PerformanceMark.h b/dom/base/PerformanceMark.h index e20a0338a829..5bd73208fd87 100644 --- a/dom/base/PerformanceMark.h +++ b/dom/base/PerformanceMark.h @@ -18,7 +18,7 @@ public: PerformanceMark(nsPerformance* aPerformance, const nsAString& aName); - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; virtual DOMHighResTimeStamp StartTime() const MOZ_OVERRIDE { diff --git a/dom/base/PerformanceMeasure.cpp b/dom/base/PerformanceMeasure.cpp index 90d59b89849e..4f492c8ae1c5 100644 --- a/dom/base/PerformanceMeasure.cpp +++ b/dom/base/PerformanceMeasure.cpp @@ -24,7 +24,7 @@ PerformanceMeasure::~PerformanceMeasure() } JSObject* -PerformanceMeasure::WrapObject(JSContext* aCx) +PerformanceMeasure::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PerformanceMeasureBinding::Wrap(aCx, this); + return PerformanceMeasureBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/PerformanceMeasure.h b/dom/base/PerformanceMeasure.h index 1cc447464391..60fa7e826d32 100644 --- a/dom/base/PerformanceMeasure.h +++ b/dom/base/PerformanceMeasure.h @@ -20,7 +20,7 @@ public: DOMHighResTimeStamp aStartTime, DOMHighResTimeStamp aEndTime); - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; virtual DOMHighResTimeStamp StartTime() const MOZ_OVERRIDE { diff --git a/dom/base/PerformanceResourceTiming.cpp b/dom/base/PerformanceResourceTiming.cpp index 646358e491e5..0b3bbc35187c 100644 --- a/dom/base/PerformanceResourceTiming.cpp +++ b/dom/base/PerformanceResourceTiming.cpp @@ -43,7 +43,7 @@ PerformanceResourceTiming::StartTime() const } JSObject* -PerformanceResourceTiming::WrapObject(JSContext* aCx) +PerformanceResourceTiming::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PerformanceResourceTimingBinding::Wrap(aCx, this); + return PerformanceResourceTimingBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/PerformanceResourceTiming.h b/dom/base/PerformanceResourceTiming.h index 5d682898f037..68762e5bafac 100644 --- a/dom/base/PerformanceResourceTiming.h +++ b/dom/base/PerformanceResourceTiming.h @@ -31,7 +31,7 @@ public: nsPerformance* aPerformance, const nsAString& aName); - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; virtual DOMHighResTimeStamp StartTime() const MOZ_OVERRIDE; diff --git a/dom/base/ProcessGlobal.h b/dom/base/ProcessGlobal.h index c341b466f4f6..44ed110a0e81 100644 --- a/dom/base/ProcessGlobal.h +++ b/dom/base/ProcessGlobal.h @@ -58,7 +58,7 @@ public: } virtual nsIPrincipal* GetPrincipal() MOZ_OVERRIDE { return mPrincipal; } - virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) MOZ_OVERRIDE { MOZ_CRASH("ProcessGlobal doesn't use DOM bindings!"); } diff --git a/dom/base/ShadowRoot.cpp b/dom/base/ShadowRoot.cpp index 405e6c3e3108..8a200c415f46 100644 --- a/dom/base/ShadowRoot.cpp +++ b/dom/base/ShadowRoot.cpp @@ -104,9 +104,9 @@ ShadowRoot::~ShadowRoot() } JSObject* -ShadowRoot::WrapObject(JSContext* aCx) +ShadowRoot::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return mozilla::dom::ShadowRootBinding::Wrap(aCx, this); + return mozilla::dom::ShadowRootBinding::Wrap(aCx, this, aGivenProto); } ShadowRoot* diff --git a/dom/base/ShadowRoot.h b/dom/base/ShadowRoot.h index 3aba3f776a8e..2ef16d384dbb 100644 --- a/dom/base/ShadowRoot.h +++ b/dom/base/ShadowRoot.h @@ -103,7 +103,7 @@ public: nsIContent* GetPoolHost() { return mPoolHost; } nsTArray& ShadowDescendants() { return mShadowDescendants; } - JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; static bool IsPooledNode(nsIContent* aChild, nsIContent* aContainer, nsIContent* aHost); diff --git a/dom/base/StyleSheetList.cpp b/dom/base/StyleSheetList.cpp index d1d29c7bffde..45cb92432a23 100644 --- a/dom/base/StyleSheetList.cpp +++ b/dom/base/StyleSheetList.cpp @@ -23,9 +23,9 @@ NS_IMPL_CYCLE_COLLECTING_ADDREF(StyleSheetList) NS_IMPL_CYCLE_COLLECTING_RELEASE(StyleSheetList) /* virtual */ JSObject* -StyleSheetList::WrapObject(JSContext* aCx) +StyleSheetList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return StyleSheetListBinding::Wrap(aCx, this); + return StyleSheetListBinding::Wrap(aCx, this, aGivenProto); } NS_IMETHODIMP diff --git a/dom/base/StyleSheetList.h b/dom/base/StyleSheetList.h index be0006cb54f0..534b88b27255 100644 --- a/dom/base/StyleSheetList.h +++ b/dom/base/StyleSheetList.h @@ -24,7 +24,7 @@ public: NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(StyleSheetList) NS_DECL_NSIDOMSTYLESHEETLIST - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE MOZ_FINAL; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE MOZ_FINAL; virtual nsINode* GetParentObject() const = 0; diff --git a/dom/base/SubtleCrypto.cpp b/dom/base/SubtleCrypto.cpp index 7f4751243b02..6718abce4d7e 100644 --- a/dom/base/SubtleCrypto.cpp +++ b/dom/base/SubtleCrypto.cpp @@ -29,9 +29,9 @@ SubtleCrypto::SubtleCrypto(nsIGlobalObject* aParent) } JSObject* -SubtleCrypto::WrapObject(JSContext* aCx) +SubtleCrypto::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return SubtleCryptoBinding::Wrap(aCx, this); + return SubtleCryptoBinding::Wrap(aCx, this, aGivenProto); } #define SUBTLECRYPTO_METHOD_BODY(Operation, aRv, ...) \ diff --git a/dom/base/SubtleCrypto.h b/dom/base/SubtleCrypto.h index ab3475049ac7..0828c822a2ba 100644 --- a/dom/base/SubtleCrypto.h +++ b/dom/base/SubtleCrypto.h @@ -38,7 +38,7 @@ public: return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; already_AddRefed Encrypt(JSContext* cx, const ObjectOrString& algorithm, diff --git a/dom/base/TreeWalker.cpp b/dom/base/TreeWalker.cpp index 409cca0fec6d..f62bc80d6338 100644 --- a/dom/base/TreeWalker.cpp +++ b/dom/base/TreeWalker.cpp @@ -451,9 +451,9 @@ TreeWalker::NextSiblingInternal(bool aReversed, ErrorResult& aResult) } bool -TreeWalker::WrapObject(JSContext *aCx, JS::MutableHandle aReflector) +TreeWalker::WrapObject(JSContext *aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return TreeWalkerBinding::Wrap(aCx, this, aReflector); + return TreeWalkerBinding::Wrap(aCx, this, aGivenProto, aReflector); } } // namespace dom diff --git a/dom/base/TreeWalker.h b/dom/base/TreeWalker.h index 6ead5f3abdcc..688ba23ed9a2 100644 --- a/dom/base/TreeWalker.h +++ b/dom/base/TreeWalker.h @@ -65,7 +65,7 @@ public: already_AddRefed PreviousNode(ErrorResult& aResult); already_AddRefed NextNode(ErrorResult& aResult); - bool WrapObject(JSContext *aCx, JS::MutableHandle aReflector); + bool WrapObject(JSContext *aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); private: nsCOMPtr mCurrentNode; diff --git a/dom/base/URL.cpp b/dom/base/URL.cpp index 4cd8f4604690..b1666f1c215e 100644 --- a/dom/base/URL.cpp +++ b/dom/base/URL.cpp @@ -47,9 +47,9 @@ URL::URL(nsIURI* aURI) } bool -URL::WrapObject(JSContext* aCx, JS::MutableHandle aReflector) +URL::WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector) { - return URLBinding::Wrap(aCx, this, aReflector); + return URLBinding::Wrap(aCx, this, aGivenProto, aReflector); } /* static */ already_AddRefed diff --git a/dom/base/URL.h b/dom/base/URL.h index 2c0418b4b8ee..69c19bb3ec51 100644 --- a/dom/base/URL.h +++ b/dom/base/URL.h @@ -44,7 +44,7 @@ public: // WebIDL methods bool - WrapObject(JSContext* aCx, JS::MutableHandle aReflector); + WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aUrl, diff --git a/dom/base/URLSearchParams.cpp b/dom/base/URLSearchParams.cpp index c2d5a89f54f9..11b9d4d54994 100644 --- a/dom/base/URLSearchParams.cpp +++ b/dom/base/URLSearchParams.cpp @@ -30,9 +30,9 @@ URLSearchParams::~URLSearchParams() } JSObject* -URLSearchParams::WrapObject(JSContext* aCx) +URLSearchParams::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return URLSearchParamsBinding::Wrap(aCx, this); + return URLSearchParamsBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/base/URLSearchParams.h b/dom/base/URLSearchParams.h index ec1afad5505d..af39ca02900c 100644 --- a/dom/base/URLSearchParams.h +++ b/dom/base/URLSearchParams.h @@ -44,7 +44,7 @@ public: } virtual JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; static already_AddRefed Constructor(const GlobalObject& aGlobal, const nsAString& aInit, diff --git a/dom/base/WebSocket.cpp b/dom/base/WebSocket.cpp index 0bc9d42caf5d..dc1e33617d7d 100644 --- a/dom/base/WebSocket.cpp +++ b/dom/base/WebSocket.cpp @@ -909,9 +909,9 @@ WebSocket::~WebSocket() } JSObject* -WebSocket::WrapObject(JSContext* cx) +WebSocket::WrapObject(JSContext* cx, JS::Handle aGivenProto) { - return WebSocketBinding::Wrap(cx, this); + return WebSocketBinding::Wrap(cx, this, aGivenProto); } //--------------------------------------------------------------------------- diff --git a/dom/base/WebSocket.h b/dom/base/WebSocket.h index 515f766d7c2a..fc9ccefa2201 100644 --- a/dom/base/WebSocket.h +++ b/dom/base/WebSocket.h @@ -62,7 +62,7 @@ public: // nsWrapperCache nsPIDOMWindow* GetParentObject() { return GetOwner(); } - virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) MOZ_OVERRIDE; public: // static helpers: diff --git a/dom/base/nsContentList.cpp b/dom/base/nsContentList.cpp index a8d638d18785..419ae38d7c32 100644 --- a/dom/base/nsContentList.cpp +++ b/dom/base/nsContentList.cpp @@ -147,9 +147,9 @@ NS_IMPL_ADDREF_INHERITED(nsSimpleContentList, nsBaseContentList) NS_IMPL_RELEASE_INHERITED(nsSimpleContentList, nsBaseContentList) JSObject* -nsSimpleContentList::WrapObject(JSContext *cx) +nsSimpleContentList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return NodeListBinding::Wrap(cx, this); + return NodeListBinding::Wrap(cx, this, aGivenProto); } // Hashtable for storing nsContentLists @@ -259,16 +259,16 @@ const nsCacheableFuncStringContentList::ContentListType #endif JSObject* -nsCacheableFuncStringNodeList::WrapObject(JSContext *cx) +nsCacheableFuncStringNodeList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return NodeListBinding::Wrap(cx, this); + return NodeListBinding::Wrap(cx, this, aGivenProto); } JSObject* -nsCacheableFuncStringHTMLCollection::WrapObject(JSContext *cx) +nsCacheableFuncStringHTMLCollection::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return HTMLCollectionBinding::Wrap(cx, this); + return HTMLCollectionBinding::Wrap(cx, this, aGivenProto); } // Hashtable for storing nsCacheableFuncStringContentList @@ -469,9 +469,9 @@ nsContentList::~nsContentList() } JSObject* -nsContentList::WrapObject(JSContext *cx) +nsContentList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return HTMLCollectionBinding::Wrap(cx, this); + return HTMLCollectionBinding::Wrap(cx, this, aGivenProto); } NS_IMPL_ISUPPORTS_INHERITED(nsContentList, nsBaseContentList, diff --git a/dom/base/nsContentList.h b/dom/base/nsContentList.h index 30c8aef99a56..d95c508f77da 100644 --- a/dom/base/nsContentList.h +++ b/dom/base/nsContentList.h @@ -87,7 +87,7 @@ public: virtual int32_t IndexOf(nsIContent *aContent, bool aDoFlush); - virtual JSObject* WrapObject(JSContext *cx) + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE = 0; void SetCapacity(uint32_t aCapacity) @@ -125,7 +125,7 @@ public: { return mRoot; } - virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE; protected: virtual ~nsSimpleContentList() {} @@ -251,7 +251,7 @@ public: // nsWrapperCache using nsWrapperCache::GetWrapperPreserveColor; - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; protected: virtual ~nsContentList(); @@ -536,7 +536,7 @@ public: #endif } - virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE; #ifdef DEBUG static const ContentListType sType; @@ -560,7 +560,7 @@ public: #endif } - virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE; #ifdef DEBUG static const ContentListType sType; diff --git a/dom/base/nsDOMAttributeMap.cpp b/dom/base/nsDOMAttributeMap.cpp index 54a472d2c1bc..96e8b4195ca8 100644 --- a/dom/base/nsDOMAttributeMap.cpp +++ b/dom/base/nsDOMAttributeMap.cpp @@ -587,7 +587,7 @@ nsDOMAttributeMap::SizeOfIncludingThis(MallocSizeOf aMallocSizeOf) const } /* virtual */ JSObject* -nsDOMAttributeMap::WrapObject(JSContext* aCx) +nsDOMAttributeMap::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return NamedNodeMapBinding::Wrap(aCx, this); + return NamedNodeMapBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/nsDOMAttributeMap.h b/dom/base/nsDOMAttributeMap.h index 00662638dd3d..81bda8d45c10 100644 --- a/dom/base/nsDOMAttributeMap.h +++ b/dom/base/nsDOMAttributeMap.h @@ -140,7 +140,7 @@ public: { return mContent; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // WebIDL Attr* GetNamedItem(const nsAString& aAttrName); diff --git a/dom/base/nsDOMCaretPosition.cpp b/dom/base/nsDOMCaretPosition.cpp index cbf68be7e19b..a1590f1ec4cf 100644 --- a/dom/base/nsDOMCaretPosition.cpp +++ b/dom/base/nsDOMCaretPosition.cpp @@ -56,9 +56,9 @@ nsDOMCaretPosition::GetClientRect() const } JSObject* -nsDOMCaretPosition::WrapObject(JSContext *aCx) +nsDOMCaretPosition::WrapObject(JSContext *aCx, JS::Handle aGivenProto) { - return mozilla::dom::CaretPositionBinding::Wrap(aCx, this); + return mozilla::dom::CaretPositionBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(nsDOMCaretPosition, diff --git a/dom/base/nsDOMCaretPosition.h b/dom/base/nsDOMCaretPosition.h index 92a04e126c06..12b483360f0a 100644 --- a/dom/base/nsDOMCaretPosition.h +++ b/dom/base/nsDOMCaretPosition.h @@ -85,7 +85,7 @@ public: return GetOffsetNode(); } - virtual JSObject* WrapObject(JSContext *aCx) + virtual JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) MOZ_OVERRIDE MOZ_FINAL; protected: diff --git a/dom/base/nsDOMDataChannel.cpp b/dom/base/nsDOMDataChannel.cpp index 622665c7d622..85ffac023d91 100644 --- a/dom/base/nsDOMDataChannel.cpp +++ b/dom/base/nsDOMDataChannel.cpp @@ -53,9 +53,9 @@ nsDOMDataChannel::~nsDOMDataChannel() } /* virtual */ JSObject* -nsDOMDataChannel::WrapObject(JSContext* aCx) +nsDOMDataChannel::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DataChannelBinding::Wrap(aCx, this); + return DataChannelBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_CLASS(nsDOMDataChannel) diff --git a/dom/base/nsDOMDataChannel.h b/dom/base/nsDOMDataChannel.h index 457796f3b65d..738fce8290ac 100644 --- a/dom/base/nsDOMDataChannel.h +++ b/dom/base/nsDOMDataChannel.h @@ -42,7 +42,7 @@ public: NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMDataChannel, mozilla::DOMEventTargetHelper) - virtual JSObject* WrapObject(JSContext* aCx) + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsPIDOMWindow* GetParentObject() const { diff --git a/dom/base/nsDOMFileReader.cpp b/dom/base/nsDOMFileReader.cpp index 6267e0e985db..6dda3a1edc1b 100644 --- a/dom/base/nsDOMFileReader.cpp +++ b/dom/base/nsDOMFileReader.cpp @@ -530,7 +530,7 @@ nsDOMFileReader::GetAsDataURL(nsIDOMBlob *aFile, } /* virtual */ JSObject* -nsDOMFileReader::WrapObject(JSContext* aCx) +nsDOMFileReader::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return FileReaderBinding::Wrap(aCx, this); + return FileReaderBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/base/nsDOMFileReader.h b/dom/base/nsDOMFileReader.h index 71b2e6e18070..544f7188480c 100644 --- a/dom/base/nsDOMFileReader.h +++ b/dom/base/nsDOMFileReader.h @@ -62,7 +62,7 @@ public: { return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // WebIDL static already_AddRefed diff --git a/dom/base/nsDOMMutationObserver.h b/dom/base/nsDOMMutationObserver.h index c650fc8d7a9a..a38bf5519f9a 100644 --- a/dom/base/nsDOMMutationObserver.h +++ b/dom/base/nsDOMMutationObserver.h @@ -48,9 +48,9 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE { - return mozilla::dom::MutationRecordBinding::Wrap(aCx, this); + return mozilla::dom::MutationRecordBinding::Wrap(aCx, this, aGivenProto); } NS_DECL_CYCLE_COLLECTING_ISUPPORTS @@ -461,9 +461,9 @@ public: mozilla::dom::MutationCallback& aCb, mozilla::ErrorResult& aRv); - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE { - return mozilla::dom::MutationObserverBinding::Wrap(aCx, this); + return mozilla::dom::MutationObserverBinding::Wrap(aCx, this, aGivenProto); } nsISupports* GetParentObject() const diff --git a/dom/base/nsDOMSerializer.h b/dom/base/nsDOMSerializer.h index b84595938291..91f72bc5c541 100644 --- a/dom/base/nsDOMSerializer.h +++ b/dom/base/nsDOMSerializer.h @@ -48,9 +48,9 @@ public: return mOwner; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE { - return mozilla::dom::XMLSerializerBinding::Wrap(aCx, this); + return mozilla::dom::XMLSerializerBinding::Wrap(aCx, this, aGivenProto); } private: diff --git a/dom/base/nsDOMSettableTokenList.cpp b/dom/base/nsDOMSettableTokenList.cpp index 51453fe1e6b8..1bad57ef90b2 100644 --- a/dom/base/nsDOMSettableTokenList.cpp +++ b/dom/base/nsDOMSettableTokenList.cpp @@ -21,7 +21,7 @@ nsDOMSettableTokenList::SetValue(const nsAString& aValue, mozilla::ErrorResult& } JSObject* -nsDOMSettableTokenList::WrapObject(JSContext *cx) +nsDOMSettableTokenList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return mozilla::dom::DOMSettableTokenListBinding::Wrap(cx, this); + return mozilla::dom::DOMSettableTokenListBinding::Wrap(cx, this, aGivenProto); } diff --git a/dom/base/nsDOMSettableTokenList.h b/dom/base/nsDOMSettableTokenList.h index 57efaa497952..68003fd4de67 100644 --- a/dom/base/nsDOMSettableTokenList.h +++ b/dom/base/nsDOMSettableTokenList.h @@ -22,7 +22,7 @@ public: nsDOMSettableTokenList(mozilla::dom::Element* aElement, nsIAtom* aAttrAtom) : nsDOMTokenList(aElement, aAttrAtom) {} - virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE; // WebIDL void GetValue(nsAString& aResult) { Stringify(aResult); } diff --git a/dom/base/nsDOMTokenList.cpp b/dom/base/nsDOMTokenList.cpp index ea7ed14e7b61..4d58d0b55bf3 100644 --- a/dom/base/nsDOMTokenList.cpp +++ b/dom/base/nsDOMTokenList.cpp @@ -309,8 +309,8 @@ nsDOMTokenList::Stringify(nsAString& aResult) } JSObject* -nsDOMTokenList::WrapObject(JSContext *cx) +nsDOMTokenList::WrapObject(JSContext *cx, JS::Handle aGivenProto) { - return DOMTokenListBinding::Wrap(cx, this); + return DOMTokenListBinding::Wrap(cx, this, aGivenProto); } diff --git a/dom/base/nsDOMTokenList.h b/dom/base/nsDOMTokenList.h index b3ff59a37775..f2a0181e3168 100644 --- a/dom/base/nsDOMTokenList.h +++ b/dom/base/nsDOMTokenList.h @@ -37,7 +37,7 @@ public: nsDOMTokenList(Element* aElement, nsIAtom* aAttrAtom); - virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE; Element* GetParentObject() { diff --git a/dom/base/nsDOMWindowUtils.cpp b/dom/base/nsDOMWindowUtils.cpp index dc04bf013df1..eca36f690d4f 100644 --- a/dom/base/nsDOMWindowUtils.cpp +++ b/dom/base/nsDOMWindowUtils.cpp @@ -2889,19 +2889,6 @@ nsDOMWindowUtils::LeafLayersPartitionWindow(bool* aResult) return NS_OK; } -NS_IMETHODIMP -nsDOMWindowUtils::GetMayHaveTouchEventListeners(bool* aResult) -{ - MOZ_RELEASE_ASSERT(nsContentUtils::IsCallerChrome()); - - nsCOMPtr window = do_QueryReferent(mWindow); - NS_ENSURE_TRUE(window, NS_ERROR_FAILURE); - - nsPIDOMWindow* innerWindow = window->GetCurrentInnerWindow(); - *aResult = innerWindow ? innerWindow->HasTouchEventListeners() : false; - return NS_OK; -} - NS_IMETHODIMP nsDOMWindowUtils::CheckAndClearPaintedState(nsIDOMElement* aElement, bool* aResult) { diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp index 026e4c0b3ea1..cc332c4825b4 100644 --- a/dom/base/nsDocument.cpp +++ b/dom/base/nsDocument.cpp @@ -7360,14 +7360,14 @@ nsDocument::InitializeFrameLoader(nsFrameLoader* aLoader) } nsresult -nsDocument::FinalizeFrameLoader(nsFrameLoader* aLoader) +nsDocument::FinalizeFrameLoader(nsFrameLoader* aLoader, nsIRunnable* aFinalizer) { mInitializableFrameLoaders.RemoveElement(aLoader); if (mInDestructor) { return NS_ERROR_FAILURE; } - mFinalizableFrameLoaders.AppendElement(aLoader); + mFrameLoaderFinalizers.AppendElement(aFinalizer); if (!mFrameLoaderRunner) { mFrameLoaderRunner = NS_NewRunnableMethod(this, &nsDocument::MaybeInitializeFinalizeFrameLoaders); @@ -7392,7 +7392,7 @@ nsDocument::MaybeInitializeFinalizeFrameLoaders() if (!nsContentUtils::IsSafeToRunScript()) { if (!mInDestructor && !mFrameLoaderRunner && (mInitializableFrameLoaders.Length() || - mFinalizableFrameLoaders.Length())) { + mFrameLoaderFinalizers.Length())) { mFrameLoaderRunner = NS_NewRunnableMethod(this, &nsDocument::MaybeInitializeFinalizeFrameLoaders); nsContentUtils::AddScriptRunner(mFrameLoaderRunner); @@ -7411,12 +7411,12 @@ nsDocument::MaybeInitializeFinalizeFrameLoaders() loader->ReallyStartLoading(); } - uint32_t length = mFinalizableFrameLoaders.Length(); + uint32_t length = mFrameLoaderFinalizers.Length(); if (length > 0) { - nsTArray > loaders; - mFinalizableFrameLoaders.SwapElements(loaders); + nsTArray > finalizers; + mFrameLoaderFinalizers.SwapElements(finalizers); for (uint32_t i = 0; i < length; ++i) { - loaders[i]->Finalize(); + finalizers[i]->Run(); } } } @@ -7433,20 +7433,6 @@ nsDocument::TryCancelFrameLoaderInitialization(nsIDocShell* aShell) } } -bool -nsDocument::FrameLoaderScheduledToBeFinalized(nsIDocShell* aShell) -{ - if (aShell) { - uint32_t length = mFinalizableFrameLoaders.Length(); - for (uint32_t i = 0; i < length; ++i) { - if (mFinalizableFrameLoaders[i]->GetExistingDocShell() == aShell) { - return true; - } - } - } - return false; -} - nsIDocument* nsDocument::RequestExternalResource(nsIURI* aURI, nsINode* aRequestingNode, diff --git a/dom/base/nsDocument.h b/dom/base/nsDocument.h index 7a241846d746..bcb97031a6f7 100644 --- a/dom/base/nsDocument.h +++ b/dom/base/nsDocument.h @@ -1035,9 +1035,8 @@ public: virtual void FlushSkinBindings() MOZ_OVERRIDE; virtual nsresult InitializeFrameLoader(nsFrameLoader* aLoader) MOZ_OVERRIDE; - virtual nsresult FinalizeFrameLoader(nsFrameLoader* aLoader) MOZ_OVERRIDE; + virtual nsresult FinalizeFrameLoader(nsFrameLoader* aLoader, nsIRunnable* aFinalizer) MOZ_OVERRIDE; virtual void TryCancelFrameLoaderInitialization(nsIDocShell* aShell) MOZ_OVERRIDE; - virtual bool FrameLoaderScheduledToBeFinalized(nsIDocShell* aShell) MOZ_OVERRIDE; virtual nsIDocument* RequestExternalResource(nsIURI* aURI, nsINode* aRequestingNode, @@ -1770,7 +1769,7 @@ private: nsString mLastStyleSheetSet; nsTArray > mInitializableFrameLoaders; - nsTArray > mFinalizableFrameLoaders; + nsTArray > mFrameLoaderFinalizers; nsRefPtr > mFrameLoaderRunner; nsRevocableEventPtr > diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp index f21cc474f324..e2adcb3c26b8 100644 --- a/dom/base/nsFocusManager.cpp +++ b/dom/base/nsFocusManager.cpp @@ -1810,10 +1810,6 @@ nsFocusManager::Focus(nsPIDOMWindow* aWindow, // focus can be traversed from the top level down to the newly focused // window. AdjustWindowFocus(aWindow, false); - - // Update the window touch registration to reflect the state of - // the new document that got focus - aWindow->UpdateTouchState(); } // indicate that the window has taken focus. diff --git a/dom/base/nsFormData.cpp b/dom/base/nsFormData.cpp index 2f86947b07c4..20ca773ae3c0 100644 --- a/dom/base/nsFormData.cpp +++ b/dom/base/nsFormData.cpp @@ -264,9 +264,9 @@ nsFormData::Append(const nsAString& aName, nsIVariant* aValue) } /* virtual */ JSObject* -nsFormData::WrapObject(JSContext* aCx) +nsFormData::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return FormDataBinding::Wrap(aCx, this); + return FormDataBinding::Wrap(aCx, this, aGivenProto); } /* static */ already_AddRefed diff --git a/dom/base/nsFormData.h b/dom/base/nsFormData.h index b219bb351809..4deebfc8b08c 100644 --- a/dom/base/nsFormData.h +++ b/dom/base/nsFormData.h @@ -80,7 +80,7 @@ public: NS_DECL_NSIXHRSENDABLE // nsWrapperCache - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // WebIDL nsISupports* diff --git a/dom/base/nsFrameLoader.cpp b/dom/base/nsFrameLoader.cpp index 45b788d5e9c5..a0b4408683aa 100644 --- a/dom/base/nsFrameLoader.cpp +++ b/dom/base/nsFrameLoader.cpp @@ -107,25 +107,6 @@ using namespace mozilla::layers; using namespace mozilla::layout; typedef FrameMetrics::ViewID ViewID; -class nsAsyncDocShellDestroyer : public nsRunnable -{ -public: - explicit nsAsyncDocShellDestroyer(nsIDocShell* aDocShell) - : mDocShell(aDocShell) - { - } - - NS_IMETHOD Run() - { - nsCOMPtr base_win(do_QueryInterface(mDocShell)); - if (base_win) { - base_win->Destroy(); - } - return NS_OK; - } - nsRefPtr mDocShell; -}; - // Bug 136580: Limit to the number of nested content frames that can have the // same URL. This is to stop content that is recursively loading // itself. Note that "#foo" on the end of URL doesn't affect @@ -181,7 +162,6 @@ nsFrameLoader::nsFrameLoader(Element* aOwner, bool aNetworkCreated) nsFrameLoader::~nsFrameLoader() { - mNeedsAsyncDestroy = true; if (mMessageManager) { mMessageManager->Disconnect(); } @@ -523,16 +503,6 @@ nsFrameLoader::GetDocShell(nsIDocShell **aDocShell) return rv; } -void -nsFrameLoader::Finalize() -{ - nsCOMPtr base_win(do_QueryInterface(mDocShell)); - if (base_win) { - base_win->Destroy(); - } - mDocShell = nullptr; -} - static void FirePageHideEvent(nsIDocShellTreeItem* aItem, EventTarget* aChromeEventHandler) @@ -1358,29 +1328,59 @@ nsFrameLoader::SwapWithOtherLoader(nsFrameLoader* aOther, return NS_OK; } -void -nsFrameLoader::DestroyChild() -{ - if (mRemoteBrowser) { - mRemoteBrowser->SetOwnerElement(nullptr); - mRemoteBrowser->Destroy(); - mRemoteBrowser = nullptr; - } -} - NS_IMETHODIMP nsFrameLoader::Destroy() { + StartDestroy(); + return NS_OK; +} + +class nsFrameLoaderDestroyRunnable : public nsRunnable +{ + enum DestroyPhase + { + // See the implementation of Run for an explanation of these phases. + eDestroyDocShell, + eWaitForUnloadMessage, + eDestroyComplete + }; + + nsRefPtr mFrameLoader; + DestroyPhase mPhase; + +public: + explicit nsFrameLoaderDestroyRunnable(nsFrameLoader* aFrameLoader) + : mFrameLoader(aFrameLoader), mPhase(eDestroyDocShell) {} + + NS_IMETHODIMP Run() MOZ_OVERRIDE; +}; + +void +nsFrameLoader::StartDestroy() +{ + // nsFrameLoader::StartDestroy is called just before the frameloader is + // detached from the element. Destruction continues in phases via + // the nsFrameLoaderDestroyRunnable. + if (mDestroyCalled) { - return NS_OK; + return; } mDestroyCalled = true; + // After this point, we return an error when trying to send a message using + // the message manager on the frame. if (mMessageManager) { - mMessageManager->Disconnect(); + mMessageManager->Close(); } - if (mChildMessageManager) { - static_cast(mChildMessageManager.get())->Disconnect(); + + // Retain references to the element and the frameloader in case we + // receive any messages from the message manager on the frame. These + // references are dropped in DestroyComplete. + if (mChildMessageManager || mRemoteBrowser) { + mOwnerContentStrong = mOwnerContent; + if (mRemoteBrowser) { + mRemoteBrowser->CacheFrameLoader(this); + } } nsCOMPtr doc; @@ -1392,7 +1392,6 @@ nsFrameLoader::Destroy() SetOwnerContent(nullptr); } - DestroyChild(); // Seems like this is a dynamic frame removal. if (dynamicSubframeRemoval) { @@ -1412,7 +1411,7 @@ nsFrameLoader::Destroy() } } } - + // Let our window know that we are gone if (mDocShell) { nsCOMPtr win_private(mDocShell->GetWindow()); @@ -1421,23 +1420,122 @@ nsFrameLoader::Destroy() } } - if ((mNeedsAsyncDestroy || !doc || - NS_FAILED(doc->FinalizeFrameLoader(this))) && mDocShell) { - nsCOMPtr event = new nsAsyncDocShellDestroyer(mDocShell); - NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY); - NS_DispatchToCurrentThread(event); + nsCOMPtr destroyRunnable = new nsFrameLoaderDestroyRunnable(this); + if (mNeedsAsyncDestroy || !doc || + NS_FAILED(doc->FinalizeFrameLoader(this, destroyRunnable))) { + NS_DispatchToCurrentThread(destroyRunnable); + } +} - // Let go of our docshell now that the async destroyer holds on to - // the docshell. +nsresult +nsFrameLoaderDestroyRunnable::Run() +{ + switch (mPhase) { + case eDestroyDocShell: + mFrameLoader->DestroyDocShell(); - mDocShell = nullptr; + // In the out-of-process case, TabParent will eventually call + // DestroyComplete once it receives a __delete__ message from the child. In + // the in-process case, we dispatch a series of runnables to ensure that + // DestroyComplete gets called at the right time. The frame loader is kept + // alive by mFrameLoader during this time. + if (mFrameLoader->mChildMessageManager) { + // When the docshell is destroyed, NotifyWindowIDDestroyed is called to + // asynchronously notify {outer,inner}-window-destroyed via a runnable. We + // don't want DestroyComplete to run until after those runnables have + // run. Since we're enqueueing ourselves after the window-destroyed + // runnables are enqueued, we're guaranteed to run after. + mPhase = eWaitForUnloadMessage; + NS_DispatchToCurrentThread(this); + } + break; + + case eWaitForUnloadMessage: + // The *-window-destroyed observers have finished running at this + // point. However, it's possible that a *-window-destroyed observer might + // have sent a message using the message manager. These messages might not + // have been processed yet. So we enqueue ourselves again to ensure that + // DestroyComplete runs after all messages sent by *-window-destroyed + // observers have been processed. + mPhase = eDestroyComplete; + NS_DispatchToCurrentThread(this); + break; + + case eDestroyComplete: + // Now that all messages sent by unload listeners and window destroyed + // observers have been processed, we disconnect the message manager and + // finish destruction. + mFrameLoader->DestroyComplete(); + break; } - // NOTE: 'this' may very well be gone by now. - return NS_OK; } +void +nsFrameLoader::DestroyDocShell() +{ + // This code runs after the frameloader has been detached from the + // element. We postpone this work because we may not be allowed to run + // script at that time. + + // Ask the TabChild to fire the frame script "unload" event, destroy its + // docshell, and finally destroy the PBrowser actor. This eventually leads to + // nsFrameLoader::DestroyComplete being called. + if (mRemoteBrowser) { + mRemoteBrowser->Destroy(); + } + + // Fire the "unload" event if we're in-process. + if (mChildMessageManager) { + static_cast(mChildMessageManager.get())->FireUnloadEvent(); + } + + // Destroy the docshell. + nsCOMPtr base_win(do_QueryInterface(mDocShell)); + if (base_win) { + base_win->Destroy(); + } + mDocShell = nullptr; + + if (mChildMessageManager) { + // Stop handling events in the in-process frame script. + static_cast(mChildMessageManager.get())->DisconnectEventListeners(); + } +} + +void +nsFrameLoader::DestroyComplete() +{ + // We get here, as part of StartDestroy, after the docshell has been destroyed + // and all message manager messages sent during docshell destruction have been + // dispatched. We also get here if the child process crashes. In the latter + // case, StartDestroy might not have been called. + + // Drop the strong references created in StartDestroy. + if (mChildMessageManager || mRemoteBrowser) { + mOwnerContentStrong = nullptr; + if (mRemoteBrowser) { + mRemoteBrowser->CacheFrameLoader(nullptr); + } + } + + // Call TabParent::Destroy if we haven't already (in case of a crash). + if (mRemoteBrowser) { + mRemoteBrowser->SetOwnerElement(nullptr); + mRemoteBrowser->Destroy(); + mRemoteBrowser = nullptr; + } + + if (mMessageManager) { + mMessageManager->Disconnect(); + } + + if (mChildMessageManager) { + static_cast(mChildMessageManager.get())->Disconnect(); + } +} + NS_IMETHODIMP nsFrameLoader::GetDepthTooGreat(bool* aDepthTooGreat) { diff --git a/dom/base/nsFrameLoader.h b/dom/base/nsFrameLoader.h index ca71711f93f0..7d73e8871b2b 100644 --- a/dom/base/nsFrameLoader.h +++ b/dom/base/nsFrameLoader.h @@ -78,7 +78,9 @@ public: NS_DECL_NSIMUTATIONOBSERVER_ATTRIBUTECHANGED nsresult CheckForRecursiveLoad(nsIURI* aURI); nsresult ReallyStartLoading(); - void Finalize(); + void StartDestroy(); + void DestroyDocShell(); + void DestroyComplete(); nsIDocShell* GetExistingDocShell() { return mDocShell; } mozilla::dom::EventTarget* GetTabChildGlobalAsEventTarget(); nsresult CreateStaticClone(nsIFrameLoader* aDest); @@ -319,6 +321,11 @@ private: nsCOMPtr mURIToLoad; mozilla::dom::Element* mOwnerContent; // WEAK + // After the frameloader has been removed from the DOM but before all of the + // messages from the frame have been received, we keep a strong reference to + // our element. + nsRefPtr mOwnerContentStrong; + // Note: this variable must be modified only by ResetPermissionManagerStatus() uint32_t mAppIdSentToPermissionManager; diff --git a/dom/base/nsFrameMessageManager.cpp b/dom/base/nsFrameMessageManager.cpp index 006d4a4f024b..bee88842a9dd 100644 --- a/dom/base/nsFrameMessageManager.cpp +++ b/dom/base/nsFrameMessageManager.cpp @@ -301,7 +301,8 @@ SameProcessCpowHolder::ToObject(JSContext* aCx, NS_IMETHODIMP nsFrameMessageManager::AddMessageListener(const nsAString& aMessage, - nsIMessageListener* aListener) + nsIMessageListener* aListener, + bool aListenWhenClosed) { nsAutoTObserverArray* listeners = mListeners.Get(aMessage); @@ -320,6 +321,7 @@ nsFrameMessageManager::AddMessageListener(const nsAString& aMessage, nsMessageListenerInfo* entry = listeners->AppendElement(); NS_ENSURE_TRUE(entry, NS_ERROR_OUT_OF_MEMORY); entry->mStrongListener = aListener; + entry->mListenWhenClosed = aListenWhenClosed; return NS_OK; } @@ -407,6 +409,7 @@ nsFrameMessageManager::AddWeakMessageListener(const nsAString& aMessage, nsMessageListenerInfo* entry = listeners->AppendElement(); entry->mWeakListener = weak; + entry->mListenWhenClosed = false; return NS_OK; } @@ -983,6 +986,20 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget, mozilla::jsipc::CpowHolder* aCpows, nsIPrincipal* aPrincipal, InfallibleTArray* aJSONRetVal) +{ + return ReceiveMessage(aTarget, mClosed, aMessage, aIsSync, + aCloneData, aCpows, aPrincipal, aJSONRetVal); +} + +nsresult +nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget, + bool aTargetClosed, + const nsAString& aMessage, + bool aIsSync, + const StructuredCloneData* aCloneData, + mozilla::jsipc::CpowHolder* aCpows, + nsIPrincipal* aPrincipal, + InfallibleTArray* aJSONRetVal) { nsAutoTObserverArray* listeners = mListeners.Get(aMessage); @@ -1004,6 +1021,10 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget, } } + if (!listener.mListenWhenClosed && aTargetClosed) { + continue; + } + nsCOMPtr wrappedJS; if (weakListener) { wrappedJS = do_QueryInterface(weakListener); @@ -1154,7 +1175,7 @@ nsFrameMessageManager::ReceiveMessage(nsISupports* aTarget, } } nsRefPtr kungfuDeathGrip = mParentManager; - return mParentManager ? mParentManager->ReceiveMessage(aTarget, aMessage, + return mParentManager ? mParentManager->ReceiveMessage(aTarget, aTargetClosed, aMessage, aIsSync, aCloneData, aCpows, aPrincipal, aJSONRetVal) : NS_OK; @@ -1234,9 +1255,27 @@ nsFrameMessageManager::RemoveFromParent() mOwnedCallback = nullptr; } +void +nsFrameMessageManager::Close() +{ + if (!mClosed) { + nsCOMPtr obs = mozilla::services::GetObserverService(); + if (obs) { + obs->NotifyObservers(NS_ISUPPORTS_CAST(nsIContentFrameMessageManager*, this), + "message-manager-close", nullptr); + } + } + mClosed = true; + mCallback = nullptr; + mOwnedCallback = nullptr; +} + void nsFrameMessageManager::Disconnect(bool aRemoveFromParent) { + // Notify message-manager-close if we haven't already. + Close(); + if (!mDisconnected) { nsCOMPtr obs = mozilla::services::GetObserverService(); if (obs) { @@ -1249,8 +1288,6 @@ nsFrameMessageManager::Disconnect(bool aRemoveFromParent) } mDisconnected = true; mParentManager = nullptr; - mCallback = nullptr; - mOwnedCallback = nullptr; if (!mHandlingMessage) { mListeners.Clear(); } @@ -1603,13 +1640,13 @@ nsMessageManagerScriptExecutor::TryCacheLoadAndCompileScript( JS::Rooted script(cx); if (aRunInGlobalScope) { - if (!JS::Compile(cx, JS::NullPtr(), options, srcBuf, &script)) { + if (!JS::Compile(cx, options, srcBuf, &script)) { return; } } else { // We can't clone compile-and-go scripts. options.setCompileAndGo(false); - if (!JS::Compile(cx, JS::NullPtr(), options, srcBuf, &script)) { + if (!JS::Compile(cx, options, srcBuf, &script)) { return; } } diff --git a/dom/base/nsFrameMessageManager.h b/dom/base/nsFrameMessageManager.h index 37f0ffd92a1e..46980c086245 100644 --- a/dom/base/nsFrameMessageManager.h +++ b/dom/base/nsFrameMessageManager.h @@ -133,6 +133,7 @@ struct nsMessageListenerInfo // Exactly one of mStrongListener and mWeakListener must be non-null. nsCOMPtr mStrongListener; nsWeakPtr mWeakListener; + bool mListenWhenClosed; }; @@ -169,6 +170,7 @@ public: mIsBroadcaster(!!(aFlags & mozilla::dom::ipc::MM_BROADCASTER)), mOwnsCallback(!!(aFlags & mozilla::dom::ipc::MM_OWNSCALLBACK)), mHandlingMessage(false), + mClosed(false), mDisconnected(false), mCallback(aCallback), mParentManager(aParentManager) @@ -238,6 +240,7 @@ public: mChildManagers.RemoveObject(aManager); } void Disconnect(bool aRemoveFromParent = true); + void Close(); void InitWithCallback(mozilla::dom::ipc::MessageManagerCallback* aCallback); void SetCallback(mozilla::dom::ipc::MessageManagerCallback* aCallback); @@ -290,6 +293,11 @@ private: JS::MutableHandle aRetval, bool aIsSync); + nsresult ReceiveMessage(nsISupports* aTarget, bool aTargetClosed, const nsAString& aMessage, + bool aIsSync, const StructuredCloneData* aCloneData, + mozilla::jsipc::CpowHolder* aCpows, nsIPrincipal* aPrincipal, + InfallibleTArray* aJSONRetVal); + NS_IMETHOD LoadScript(const nsAString& aURL, bool aAllowDelayedLoad, bool aRunInGlobalScope); @@ -309,6 +317,7 @@ protected: bool mIsBroadcaster; // true if the message manager is a broadcaster bool mOwnsCallback; bool mHandlingMessage; + bool mClosed; // true if we can no longer send messages bool mDisconnected; mozilla::dom::ipc::MessageManagerCallback* mCallback; nsAutoPtr mOwnedCallback; diff --git a/dom/base/nsGlobalWindow.cpp b/dom/base/nsGlobalWindow.cpp index 4c88e8fb1314..c641582fa412 100644 --- a/dom/base/nsGlobalWindow.cpp +++ b/dom/base/nsGlobalWindow.cpp @@ -574,7 +574,7 @@ nsPIDOMWindow::nsPIDOMWindow(nsPIDOMWindow *aOuterWindow) : mFrameElement(nullptr), mDocShell(nullptr), mModalStateDepth(0), mRunningTimeout(nullptr), mMutationBits(0), mIsDocumentLoaded(false), mIsHandlingResizeEvent(false), mIsInnerWindow(aOuterWindow != nullptr), - mMayHavePaintEventListener(false), mMayHaveTouchEventListener(false), + mMayHavePaintEventListener(false), mMayHaveMouseEnterLeaveEventListener(false), mMayHavePointerEnterLeaveEventListener(false), mIsModalContentWindow(false), @@ -8017,7 +8017,7 @@ PostMessageReadTransferStructuredClone(JSContext* aCx, port->BindToOwner(scInfo->window); scInfo->ports.Put(port, nullptr); - JS::Rooted obj(aCx, port->WrapObject(aCx)); + JS::Rooted obj(aCx, port->WrapObject(aCx, JS::NullPtr())); if (JS_WrapObject(aCx, &obj)) { MOZ_ASSERT(port->GetOwner() == scInfo->window); returnObject.set(obj); @@ -9844,47 +9844,6 @@ void nsGlobalWindow::SetIsBackground(bool aIsBackground) #endif } -void nsGlobalWindow::MaybeUpdateTouchState() -{ - FORWARD_TO_INNER_VOID(MaybeUpdateTouchState, ()); - - nsIFocusManager* fm = nsFocusManager::GetFocusManager(); - - nsCOMPtr focusedWindow; - fm->GetFocusedWindow(getter_AddRefs(focusedWindow)); - - if(this == focusedWindow) { - UpdateTouchState(); - } - - if (mMayHaveTouchEventListener) { - nsCOMPtr observerService = - services::GetObserverService(); - - if (observerService) { - observerService->NotifyObservers(static_cast(this), - DOM_TOUCH_LISTENER_ADDED, - nullptr); - } - } -} - -void nsGlobalWindow::UpdateTouchState() -{ - FORWARD_TO_INNER_VOID(UpdateTouchState, ()); - - nsCOMPtr mainWidget = GetMainWidget(); - if (!mainWidget) { - return; - } - - if (mMayHaveTouchEventListener) { - mainWidget->RegisterTouchWindow(); - } else { - mainWidget->UnregisterTouchWindow(); - } -} - void nsGlobalWindow::EnableGamepadUpdates() { diff --git a/dom/base/nsGlobalWindow.h b/dom/base/nsGlobalWindow.h index 76dbfb3fa7f3..4d5f4e1665bc 100644 --- a/dom/base/nsGlobalWindow.h +++ b/dom/base/nsGlobalWindow.h @@ -355,7 +355,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS // nsWrapperCache - virtual JSObject *WrapObject(JSContext *cx) MOZ_OVERRIDE + virtual JSObject *WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE { return IsInnerWindow() || EnsureInnerWindow() ? GetWrapper() : nullptr; } @@ -468,9 +468,6 @@ public: virtual bool CanClose() MOZ_OVERRIDE; virtual void ForceClose() MOZ_OVERRIDE; - virtual void MaybeUpdateTouchState() MOZ_OVERRIDE; - virtual void UpdateTouchState() MOZ_OVERRIDE; - // Outer windows only. virtual bool DispatchCustomEvent(const nsAString& aEventName) MOZ_OVERRIDE; bool DispatchResizeEvent(const mozilla::CSSIntSize& aSize); diff --git a/dom/base/nsHistory.cpp b/dom/base/nsHistory.cpp index 611fb6444654..01b34272f065 100644 --- a/dom/base/nsHistory.cpp +++ b/dom/base/nsHistory.cpp @@ -60,9 +60,9 @@ nsHistory::GetParentObject() const } JSObject* -nsHistory::WrapObject(JSContext* aCx) +nsHistory::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return HistoryBinding::Wrap(aCx, this); + return HistoryBinding::Wrap(aCx, this, aGivenProto); } uint32_t diff --git a/dom/base/nsHistory.h b/dom/base/nsHistory.h index 68c08709db3f..3fa29c130573 100644 --- a/dom/base/nsHistory.h +++ b/dom/base/nsHistory.h @@ -33,7 +33,7 @@ public: explicit nsHistory(nsPIDOMWindow* aInnerWindow); nsPIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; uint32_t GetLength(mozilla::ErrorResult& aRv) const; void GetState(JSContext* aCx, JS::MutableHandle aResult, diff --git a/dom/base/nsIDocument.h b/dom/base/nsIDocument.h index 136cd245666c..fa3ff7559d6f 100644 --- a/dom/base/nsIDocument.h +++ b/dom/base/nsIDocument.h @@ -63,6 +63,7 @@ class nsIObserver; class nsIPresShell; class nsIPrincipal; class nsIRequest; +class nsIRunnable; class nsIStreamListener; class nsIStructuredCloneContainer; class nsIStyleRule; @@ -1664,11 +1665,9 @@ public: virtual nsresult InitializeFrameLoader(nsFrameLoader* aLoader) = 0; // In case of failure, the caller must handle the error, for example by // finalizing frame loader asynchronously. - virtual nsresult FinalizeFrameLoader(nsFrameLoader* aLoader) = 0; + virtual nsresult FinalizeFrameLoader(nsFrameLoader* aLoader, nsIRunnable* aFinalizer) = 0; // Removes the frame loader of aShell from the initialization list. virtual void TryCancelFrameLoaderInitialization(nsIDocShell* aShell) = 0; - // Returns true if the frame loader of aShell is in the finalization list. - virtual bool FrameLoaderScheduledToBeFinalized(nsIDocShell* aShell) = 0; /** * Check whether this document is a root document that is not an diff --git a/dom/base/nsIMessageManager.idl b/dom/base/nsIMessageManager.idl index b220c625f48d..fdb926485eed 100644 --- a/dom/base/nsIMessageManager.idl +++ b/dom/base/nsIMessageManager.idl @@ -201,7 +201,7 @@ interface nsIMessageListener : nsISupports void receiveMessage(); }; -[scriptable, builtinclass, uuid(aae827bd-acf1-45fe-a556-ea545d4c0804)] +[scriptable, builtinclass, uuid(b949bfec-bb7d-47bc-b387-ac6a9b655072)] interface nsIMessageListenerManager : nsISupports { /** @@ -213,9 +213,16 @@ interface nsIMessageListenerManager : nsISupports * * If the same listener registers twice for the same message, the * second registration is ignored. + * + * Pass true for listenWhenClosed if you want to receive messages + * during the short period after a frame has been removed from the + * DOM and before its frame script has finished unloading. This + * parameter only has an effect for frame message managers in + * the main process. Default is false. */ void addMessageListener(in AString messageName, - in nsIMessageListener listener); + in nsIMessageListener listener, + [optional] in boolean listenWhenClosed); /** * Undo an |addMessageListener| call -- that is, calling this causes us to no @@ -252,7 +259,7 @@ interface nsIMessageListenerManager : nsISupports * messages that are only delivered to its one parent-process message * manager. */ -[scriptable, builtinclass, uuid(d6b0d851-43e6-426d-9f13-054bc0198175)] +[scriptable, builtinclass, uuid(bb5d79e4-e73c-45e7-9651-4d718f4b994c)] interface nsIMessageSender : nsIMessageListenerManager { /** @@ -284,7 +291,7 @@ interface nsIMessageSender : nsIMessageListenerManager * manager will broadcast the message to all frame message managers * within its window. */ -[scriptable, builtinclass, uuid(d36346b9-5d3b-497d-9c28-ffbc3e4f6d0d)] +[scriptable, builtinclass, uuid(4d7d62ad-4725-4f39-86cf-8fb22bf9c1d8)] interface nsIMessageBroadcaster : nsIMessageListenerManager { /** @@ -311,7 +318,7 @@ interface nsIMessageBroadcaster : nsIMessageListenerManager nsIMessageListenerManager getChildAt(in unsigned long aIndex); }; -[scriptable, builtinclass, uuid(7fda0941-9dcc-448b-bd39-16373c5b4003)] +[scriptable, builtinclass, uuid(0e602c9e-1977-422a-a8e4-fe0d4a4f78d0)] interface nsISyncMessageSender : nsIMessageSender { /** @@ -341,7 +348,7 @@ interface nsISyncMessageSender : nsIMessageSender [optional] in nsIPrincipal principal); }; -[scriptable, builtinclass, uuid(e04a7ade-c61a-46ec-9f13-efeabedd9d3d)] +[scriptable, builtinclass, uuid(13f3555f-769e-44ea-b607-5239230c3162)] interface nsIMessageManagerGlobal : nsISyncMessageSender { /** @@ -376,13 +383,13 @@ interface nsIContentFrameMessageManager : nsIMessageManagerGlobal readonly attribute nsIDocShell docShell; }; -[uuid(a2325927-9c0c-437d-9215-749c79235031)] +[uuid(a9e07e89-7125-48e3-bf73-2cbae7fc5b1c)] interface nsIInProcessContentFrameMessageManager : nsIContentFrameMessageManager { [notxpcom] nsIContent getOwnerContent(); }; -[scriptable, builtinclass, uuid(9ca95410-b253-11e4-ab27-0800200c9a66)] +[scriptable, builtinclass, uuid(d0c799a2-d5ff-4a75-acbb-b8c8347944a6)] interface nsIContentProcessMessageManager : nsIMessageManagerGlobal { }; diff --git a/dom/base/nsINode.cpp b/dom/base/nsINode.cpp index 472e34c50543..c183fd6ed699 100644 --- a/dom/base/nsINode.cpp +++ b/dom/base/nsINode.cpp @@ -2664,7 +2664,7 @@ nsINode::GetElementById(const nsAString& aId) } JSObject* -nsINode::WrapObject(JSContext *aCx) +nsINode::WrapObject(JSContext *aCx, JS::Handle aGivenProto) { // Make sure one of these is true // (1) our owner document has a script handling object, @@ -2683,7 +2683,7 @@ nsINode::WrapObject(JSContext *aCx) return nullptr; } - JS::Rooted obj(aCx, WrapNode(aCx)); + JS::Rooted obj(aCx, WrapNode(aCx, aGivenProto)); MOZ_ASSERT_IF(ChromeOnlyAccess(), xpc::IsInContentXBLScope(obj) || !xpc::UseContentXBLScope(js::GetObjectCompartment(obj))); return obj; diff --git a/dom/base/nsINode.h b/dom/base/nsINode.h index 6548c3e15406..56a503593bcd 100644 --- a/dom/base/nsINode.h +++ b/dom/base/nsINode.h @@ -367,7 +367,7 @@ public: */ virtual bool IsNodeOfType(uint32_t aFlags) const = 0; - virtual JSObject* WrapObject(JSContext *aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; /** * returns true if we are in priviliged code or @@ -380,8 +380,12 @@ 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 aGivenProto) = 0; public: mozilla::dom::ParentObject GetParentObject() const; // Implemented in nsIDocument.h diff --git a/dom/base/nsInProcessTabChildGlobal.cpp b/dom/base/nsInProcessTabChildGlobal.cpp index f5ec5d902f7d..06e7b9468eb7 100644 --- a/dom/base/nsInProcessTabChildGlobal.cpp +++ b/dom/base/nsInProcessTabChildGlobal.cpp @@ -101,6 +101,7 @@ nsInProcessTabChildGlobal::nsInProcessTabChildGlobal(nsIDocShell* aShell, nsIContent* aOwner, nsFrameMessageManager* aChrome) : mDocShell(aShell), mInitialized(false), mLoadingScript(false), + mPreventEventsEscaping(false), mOwner(aOwner), mChromeMessageManager(aChrome) { SetIsNotDOMBinding(); @@ -207,25 +208,24 @@ nsInProcessTabChildGlobal::GetDocShell(nsIDocShell** aDocShell) } void -nsInProcessTabChildGlobal::Disconnect() +nsInProcessTabChildGlobal::FireUnloadEvent() { - // Let the frame scripts know the child is being closed. We do any other - // cleanup after the event has been fired. See DelayedDisconnect - nsContentUtils::AddScriptRunner( - NS_NewRunnableMethod(this, &nsInProcessTabChildGlobal::DelayedDisconnect) - ); + // We're called from nsDocument::MaybeInitializeFinalizeFrameLoaders, so it + // should be safe to run script. + MOZ_ASSERT(nsContentUtils::IsSafeToRunScript()); + + // Don't let the unload event propagate to chrome event handlers. + mPreventEventsEscaping = true; + DOMEventTargetHelper::DispatchTrustedEvent(NS_LITERAL_STRING("unload")); + + // Allow events fired during docshell destruction (pagehide, unload) to + // propagate to the element since chrome code depends on this. + mPreventEventsEscaping = false; } void -nsInProcessTabChildGlobal::DelayedDisconnect() +nsInProcessTabChildGlobal::DisconnectEventListeners() { - // Don't let the event escape - mOwner = nullptr; - - // Fire the "unload" event - DOMEventTargetHelper::DispatchTrustedEvent(NS_LITERAL_STRING("unload")); - - // Continue with the Disconnect cleanup if (mDocShell) { nsCOMPtr win = mDocShell->GetWindow(); if (win) { @@ -233,15 +233,22 @@ nsInProcessTabChildGlobal::DelayedDisconnect() win->SetChromeEventHandler(win->GetChromeEventHandler()); } } + if (mListenerManager) { + mListenerManager->Disconnect(); + } + mDocShell = nullptr; +} + +void +nsInProcessTabChildGlobal::Disconnect() +{ mChromeMessageManager = nullptr; + mOwner = nullptr; if (mMessageManager) { static_cast(mMessageManager.get())->Disconnect(); mMessageManager = nullptr; } - if (mListenerManager) { - mListenerManager->Disconnect(); - } } NS_IMETHODIMP_(nsIContent *) @@ -255,18 +262,6 @@ nsInProcessTabChildGlobal::PreHandleEvent(EventChainPreVisitor& aVisitor) { aVisitor.mCanHandle = true; - if (mIsBrowserOrAppFrame && - (!mOwner || !nsContentUtils::IsInChromeDocshell(mOwner->OwnerDoc()))) { - if (mOwner) { - nsPIDOMWindow* innerWindow = mOwner->OwnerDoc()->GetInnerWindow(); - if (innerWindow) { - aVisitor.mParentTarget = innerWindow->GetParentTarget(); - } - } - } else { - aVisitor.mParentTarget = mOwner; - } - #ifdef DEBUG if (mOwner) { nsCOMPtr owner = do_QueryInterface(mOwner); @@ -280,6 +275,23 @@ nsInProcessTabChildGlobal::PreHandleEvent(EventChainPreVisitor& aVisitor) } #endif + if (mPreventEventsEscaping) { + aVisitor.mParentTarget = nullptr; + return NS_OK; + } + + if (mIsBrowserOrAppFrame && + (!mOwner || !nsContentUtils::IsInChromeDocshell(mOwner->OwnerDoc()))) { + if (mOwner) { + nsPIDOMWindow* innerWindow = mOwner->OwnerDoc()->GetInnerWindow(); + if (innerWindow) { + aVisitor.mParentTarget = innerWindow->GetParentTarget(); + } + } + } else { + aVisitor.mParentTarget = mOwner; + } + return NS_OK; } diff --git a/dom/base/nsInProcessTabChildGlobal.h b/dom/base/nsInProcessTabChildGlobal.h index c5a197353ab7..1430d723086f 100644 --- a/dom/base/nsInProcessTabChildGlobal.h +++ b/dom/base/nsInProcessTabChildGlobal.h @@ -1,4 +1,4 @@ -/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8; -*- */ +/* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8; -*- */ /* vim: set sw=4 ts=8 et tw=80 : */ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -118,6 +118,8 @@ public: virtual JSContext* GetJSContextForEventHandlers() MOZ_OVERRIDE { return nsContentUtils::GetSafeJSContext(); } virtual nsIPrincipal* GetPrincipal() MOZ_OVERRIDE { return mPrincipal; } void LoadFrameScript(const nsAString& aURL, bool aRunInGlobalScope); + void FireUnloadEvent(); + void DisconnectEventListeners(); void Disconnect(); void SendMessageToParent(const nsString& aMessage, bool aSync, const nsString& aJSON, @@ -137,8 +139,6 @@ public: mChromeMessageManager = aParent; } - void DelayedDisconnect(); - virtual JSObject* GetGlobalJSObject() MOZ_OVERRIDE { if (!mGlobal) { return nullptr; @@ -146,7 +146,7 @@ public: return mGlobal->GetJSObject(); } - virtual JSObject* WrapObject(JSContext* cx) MOZ_OVERRIDE + virtual JSObject* WrapObject(JSContext* cx, JS::Handle aGivenProto) MOZ_OVERRIDE { MOZ_CRASH("nsInProcessTabChildGlobal doesn't use DOM bindings!"); } @@ -164,6 +164,7 @@ protected: // + + diff --git a/dom/battery/BatteryManager.cpp b/dom/battery/BatteryManager.cpp index dbe9e68c30b4..64fdfe75c32d 100644 --- a/dom/battery/BatteryManager.cpp +++ b/dom/battery/BatteryManager.cpp @@ -50,9 +50,9 @@ BatteryManager::Shutdown() } JSObject* -BatteryManager::WrapObject(JSContext* aCx) +BatteryManager::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return BatteryManagerBinding::Wrap(aCx, this); + return BatteryManagerBinding::Wrap(aCx, this, aGivenProto); } double diff --git a/dom/battery/BatteryManager.h b/dom/battery/BatteryManager.h index 4cf9dee52bc1..596071e00729 100644 --- a/dom/battery/BatteryManager.h +++ b/dom/battery/BatteryManager.h @@ -44,7 +44,7 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; bool Charging() const { diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index a181728ab0d3..89c18e460fb5 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -752,7 +752,7 @@ NativeInterface2JSObjectAndThrowIfFailed(JSContext* aCx, if (cache && cache->IsDOMBinding()) { JS::Rooted obj(aCx, cache->GetWrapper()); if (!obj) { - obj = cache->WrapObject(aCx); + obj = cache->WrapObject(aCx, JS::NullPtr()); } if (obj && aAllowNativeWrapper && !JS_WrapObject(aCx, &obj)) { diff --git a/dom/bindings/BindingUtils.h b/dom/bindings/BindingUtils.h index a0015c668619..6597497af7fd 100644 --- a/dom/bindings/BindingUtils.h +++ b/dom/bindings/BindingUtils.h @@ -930,7 +930,7 @@ DoGetOrCreateDOMReflector(JSContext* cx, T* value, return false; } - obj = value->WrapObject(cx); + obj = value->WrapObject(cx, JS::NullPtr()); if (!obj) { // At this point, obj is null, so just return false. // Callers seem to be testing JS_IsExceptionPending(cx) to @@ -1038,7 +1038,7 @@ WrapNewBindingNonWrapperCachedObject(JSContext* cx, } MOZ_ASSERT(js::IsObjectInContextCompartment(scope, cx)); - if (!value->WrapObject(cx, &obj)) { + if (!value->WrapObject(cx, JS::NullPtr(), &obj)) { return false; } } @@ -1084,7 +1084,7 @@ WrapNewBindingNonWrapperCachedObject(JSContext* cx, } MOZ_ASSERT(js::IsObjectInContextCompartment(scope, cx)); - if (!value->WrapObject(cx, &obj)) { + if (!value->WrapObject(cx, JS::NullPtr(), &obj)) { return false; } @@ -1520,7 +1520,7 @@ struct WrapNativeParentHelper if (!CouldBeDOMBinding(parent)) { obj = WrapNativeParentFallback::Wrap(cx, parent, cache); } else { - obj = parent->WrapObject(cx); + obj = parent->WrapObject(cx, JS::NullPtr()); } return obj; diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index ec067b069c7c..5983ac6b1a4c 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -3182,11 +3182,8 @@ def CopyUnforgeablePropertiesToInstance(descriptor, wrapperCache): copyFunc = "JS_InitializePropertiesFromCompatibleNativeObject" copyCode.append(CGGeneric(fill( """ - // XXXbz Once we allow subclassing, we'll want to make sure that - // this uses the canonical proto, not whatever random passed-in - // proto we end up using for the object. JS::Rooted unforgeableHolder(aCx, - &js::GetReservedSlot(proto, DOM_INTERFACE_PROTO_SLOTS_BASE).toObject()); + &js::GetReservedSlot(canonicalProto, DOM_INTERFACE_PROTO_SLOTS_BASE).toObject()); if (!${copyFunc}(aCx, ${obj}, unforgeableHolder)) { $*{cleanup} return false; @@ -3243,6 +3240,30 @@ def InitMemberSlots(descriptor, wrapperCache): clearWrapper=clearWrapper) +def DeclareProto(): + """ + Declare the canonicalProto and proto we have for our wrapping operation. + """ + return dedent( + """ + JS::Handle canonicalProto = GetProtoObjectHandle(aCx, global); + if (!canonicalProto) { + return false; + } + JS::Rooted proto(aCx); + if (aGivenProto) { + proto = aGivenProto; + if (js::GetContextCompartment(aCx) != js::GetObjectCompartment(proto)) { + if (!JS_WrapObject(aCx, &proto)) { + return false; + } + } + } else { + proto = canonicalProto; + } + """) + + class CGWrapWithCacheMethod(CGAbstractMethod): """ Create a wrapper JSObject for a given native that implements nsWrapperCache. @@ -3254,6 +3275,7 @@ class CGWrapWithCacheMethod(CGAbstractMethod): args = [Argument('JSContext*', 'aCx'), Argument(descriptor.nativeType + '*', 'aObject'), Argument('nsWrapperCache*', 'aCache'), + Argument('JS::Handle', 'aGivenProto'), Argument('JS::MutableHandle', 'aReflector')] CGAbstractMethod.__init__(self, descriptor, 'Wrap', 'bool', args) self.properties = properties @@ -3261,7 +3283,8 @@ class CGWrapWithCacheMethod(CGAbstractMethod): def definition_body(self): return fill( """ - $*{assertion} + $*{assertInheritance} + MOZ_ASSERT_IF(aGivenProto, !aCache->GetWrapper()); MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache), "nsISupports must be on our primary inheritance chain"); @@ -3275,15 +3298,14 @@ class CGWrapWithCacheMethod(CGAbstractMethod): // of XBL. Check for that, and bail out as needed. aReflector.set(aCache->GetWrapper()); if (aReflector) { + MOZ_ASSERT(!aGivenProto, + "How are we supposed to change the proto now?"); return true; } JSAutoCompartment ac(aCx, parent); JS::Rooted global(aCx, js::GetGlobalForObjectCrossCompartment(parent)); - JS::Handle proto = GetProtoObjectHandle(aCx, global); - if (!proto) { - return false; - } + $*{declareProto} $*{createObject} @@ -3293,7 +3315,8 @@ class CGWrapWithCacheMethod(CGAbstractMethod): creator.InitializationSucceeded(); return true; """, - assertion=AssertInheritanceChain(self.descriptor), + assertInheritance=AssertInheritanceChain(self.descriptor), + declareProto=DeclareProto(), createObject=CreateBindingJSObject(self.descriptor, self.properties), unforgeable=CopyUnforgeablePropertiesToInstance(self.descriptor, True), slots=InitMemberSlots(self.descriptor, True)) @@ -3304,14 +3327,15 @@ class CGWrapMethod(CGAbstractMethod): # XXX can we wrap if we don't have an interface prototype object? assert descriptor.interface.hasInterfacePrototypeObject() args = [Argument('JSContext*', 'aCx'), - Argument('T*', 'aObject')] + Argument('T*', 'aObject'), + Argument('JS::Handle', 'aGivenProto')] CGAbstractMethod.__init__(self, descriptor, 'Wrap', 'JSObject*', args, inline=True, templateArgs=["class T"]) def definition_body(self): return dedent(""" JS::Rooted reflector(aCx); - return Wrap(aCx, aObject, aObject, &reflector) ? reflector.get() : nullptr; + return Wrap(aCx, aObject, aObject, aGivenProto, &reflector) ? reflector.get() : nullptr; """) @@ -3327,6 +3351,7 @@ class CGWrapNonWrapperCacheMethod(CGAbstractMethod): assert descriptor.interface.hasInterfacePrototypeObject() args = [Argument('JSContext*', 'aCx'), Argument(descriptor.nativeType + '*', 'aObject'), + Argument('JS::Handle', 'aGivenProto'), Argument('JS::MutableHandle', 'aReflector')] CGAbstractMethod.__init__(self, descriptor, 'Wrap', 'bool', args) self.properties = properties @@ -3337,10 +3362,7 @@ class CGWrapNonWrapperCacheMethod(CGAbstractMethod): $*{assertions} JS::Rooted global(aCx, JS::CurrentGlobalOrNull(aCx)); - JS::Handle proto = GetProtoObjectHandle(aCx, global); - if (!proto) { - return false; - } + $*{declareProto} $*{createObject} @@ -3351,6 +3373,7 @@ class CGWrapNonWrapperCacheMethod(CGAbstractMethod): return true; """, assertions=AssertInheritanceChain(self.descriptor), + declareProto=DeclareProto(), createObject=CreateBindingJSObject(self.descriptor, self.properties), unforgeable=CopyUnforgeablePropertiesToInstance(self.descriptor, False), slots=InitMemberSlots(self.descriptor, False)) @@ -3394,10 +3417,10 @@ class CGWrapGlobalMethod(CGAbstractMethod): fireOnNewGlobal = "" if self.descriptor.hasUnforgeableMembers: - declareProto = "JS::Handle proto =\n" + declareProto = "JS::Handle canonicalProto =\n" assertProto = ( - "MOZ_ASSERT(proto &&\n" - " IsDOMIfaceAndProtoClass(js::GetObjectClass(proto)));\n") + "MOZ_ASSERT(canonicalProto &&\n" + " IsDOMIfaceAndProtoClass(js::GetObjectClass(canonicalProto)));\n") else: declareProto = "" assertProto = "" @@ -13083,7 +13106,8 @@ class CGBindingImplClass(CGClass): name="aName")]), { "infallible": True })) - wrapArgs = [Argument('JSContext*', 'aCx')] + wrapArgs = [Argument('JSContext*', 'aCx'), + Argument('JS::Handle', 'aGivenProto')] self.methodDecls.insert(0, ClassMethod(wrapMethodName, "JSObject*", wrapArgs, virtual=descriptor.wrapperCache, @@ -13203,9 +13227,9 @@ class CGExampleClass(CGBindingImplClass): classImpl = ccImpl + ctordtor + "\n" + dedent(""" JSObject* - ${nativeType}::WrapObject(JSContext* aCx) + ${nativeType}::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return ${ifaceName}Binding::Wrap(aCx, this); + return ${ifaceName}Binding::Wrap(aCx, this, aGivenProto); } """) @@ -13573,7 +13597,7 @@ class CGJSImplClass(CGBindingImplClass): def getWrapObjectBody(self): return fill( """ - JS::Rooted obj(aCx, ${name}Binding::Wrap(aCx, this)); + JS::Rooted obj(aCx, ${name}Binding::Wrap(aCx, this, aGivenProto)); if (!obj) { return nullptr; } @@ -14966,7 +14990,7 @@ class CGEventClass(CGBindingImplClass): extradeclarations=baseDeclarations) def getWrapObjectBody(self): - return "return %sBinding::Wrap(aCx, this);\n" % self.descriptor.name + return "return %sBinding::Wrap(aCx, this, aGivenProto);\n" % self.descriptor.name def implTraverse(self): retVal = "" diff --git a/dom/bindings/StructuredClone.cpp b/dom/bindings/StructuredClone.cpp index e468407f1896..49ce5216b8a6 100644 --- a/dom/bindings/StructuredClone.cpp +++ b/dom/bindings/StructuredClone.cpp @@ -32,7 +32,7 @@ ReadStructuredCloneImageData(JSContext* aCx, JSStructuredCloneReader* aReader) nsRefPtr imageData = new ImageData(width, height, dataArray.toObject()); // Wrap it in a JS::Value. - if (!imageData->WrapObject(aCx, &result)) { + if (!imageData->WrapObject(aCx, JS::NullPtr(), &result)) { return nullptr; } } diff --git a/dom/bindings/test/TestBindingHeader.h b/dom/bindings/test/TestBindingHeader.h index 76f1321e2fec..cc3525e0e3fc 100644 --- a/dom/bindings/test/TestBindingHeader.h +++ b/dom/bindings/test/TestBindingHeader.h @@ -90,7 +90,7 @@ class TestNonWrapperCacheInterface : public nsISupports public: NS_DECL_ISUPPORTS - bool WrapObject(JSContext* aCx, JS::MutableHandle aReflector); + bool WrapObject(JSContext* aCx, JS::Handle aGivenProto, JS::MutableHandle aReflector); }; class OnlyForUseInConstructor : public nsISupports, diff --git a/dom/bindings/test/test_Object.prototype_props.html b/dom/bindings/test/test_Object.prototype_props.html index e5501ce65e9a..03147eb03d62 100644 --- a/dom/bindings/test/test_Object.prototype_props.html +++ b/dom/bindings/test/test_Object.prototype_props.html @@ -7,9 +7,6 @@ diff --git a/dom/fetch/Headers.cpp b/dom/fetch/Headers.cpp index 6fadd1ed3bbf..836a9857527d 100644 --- a/dom/fetch/Headers.cpp +++ b/dom/fetch/Headers.cpp @@ -75,9 +75,9 @@ Headers::Constructor(const GlobalObject& aGlobal, } JSObject* -Headers::WrapObject(JSContext* aCx) +Headers::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return mozilla::dom::HeadersBinding::Wrap(aCx, this); + return mozilla::dom::HeadersBinding::Wrap(aCx, this, aGivenProto); } Headers::~Headers() diff --git a/dom/fetch/Headers.h b/dom/fetch/Headers.h index a1b3549c996b..49822826a1de 100644 --- a/dom/fetch/Headers.h +++ b/dom/fetch/Headers.h @@ -110,7 +110,7 @@ public: mInternalHeaders->SetGuard(aGuard, aRv); } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsISupports* GetParentObject() const { return mOwner; } private: diff --git a/dom/fetch/Request.h b/dom/fetch/Request.h index d17f500dc3cf..ba4e6e7df42d 100644 --- a/dom/fetch/Request.h +++ b/dom/fetch/Request.h @@ -37,9 +37,9 @@ public: Request(nsIGlobalObject* aOwner, InternalRequest* aRequest); JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE { - return RequestBinding::Wrap(aCx, this); + return RequestBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/fetch/Response.h b/dom/fetch/Response.h index 35ccef282af5..a008ba77bc96 100644 --- a/dom/fetch/Response.h +++ b/dom/fetch/Response.h @@ -37,9 +37,9 @@ public: Response(const Response& aOther) = delete; JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE { - return ResponseBinding::Wrap(aCx, this); + return ResponseBinding::Wrap(aCx, this, aGivenProto); } ResponseType diff --git a/dom/filesystem/Directory.cpp b/dom/filesystem/Directory.cpp index 799a18cb188b..3bdacc0017e2 100644 --- a/dom/filesystem/Directory.cpp +++ b/dom/filesystem/Directory.cpp @@ -75,9 +75,9 @@ Directory::GetParentObject() const } JSObject* -Directory::WrapObject(JSContext* aCx) +Directory::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return DirectoryBinding::Wrap(aCx, this); + return DirectoryBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/filesystem/Directory.h b/dom/filesystem/Directory.h index 541ca3b2ead1..975b5dfe2b25 100644 --- a/dom/filesystem/Directory.h +++ b/dom/filesystem/Directory.h @@ -56,7 +56,7 @@ public: GetParentObject() const; virtual JSObject* - WrapObject(JSContext* aCx) MOZ_OVERRIDE; + WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; void GetName(nsString& aRetval) const; diff --git a/dom/fmradio/FMRadio.cpp b/dom/fmradio/FMRadio.cpp index 43f0b4665ffa..03466d88fcb9 100644 --- a/dom/fmradio/FMRadio.cpp +++ b/dom/fmradio/FMRadio.cpp @@ -185,9 +185,9 @@ FMRadio::Shutdown() } JSObject* -FMRadio::WrapObject(JSContext* aCx) +FMRadio::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return FMRadioBinding::Wrap(aCx, this); + return FMRadioBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/fmradio/FMRadio.h b/dom/fmradio/FMRadio.h index 140f05314400..5b34974239ea 100644 --- a/dom/fmradio/FMRadio.h +++ b/dom/fmradio/FMRadio.h @@ -51,7 +51,7 @@ public: return GetOwner(); } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; static bool Enabled(); diff --git a/dom/gamepad/Gamepad.cpp b/dom/gamepad/Gamepad.cpp index d88f20740104..c621fe130c50 100644 --- a/dom/gamepad/Gamepad.cpp +++ b/dom/gamepad/Gamepad.cpp @@ -120,9 +120,9 @@ Gamepad::Clone(nsISupports* aParent) } /* virtual */ JSObject* -Gamepad::WrapObject(JSContext* aCx) +Gamepad::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return GamepadBinding::Wrap(aCx, this); + return GamepadBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/gamepad/Gamepad.h b/dom/gamepad/Gamepad.h index 6b34251a009e..79636e0bea30 100644 --- a/dom/gamepad/Gamepad.h +++ b/dom/gamepad/Gamepad.h @@ -59,7 +59,7 @@ public: return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; void GetId(nsAString& aID) const { diff --git a/dom/gamepad/GamepadButton.cpp b/dom/gamepad/GamepadButton.cpp index a46eecd4573f..978af033bcbd 100644 --- a/dom/gamepad/GamepadButton.cpp +++ b/dom/gamepad/GamepadButton.cpp @@ -19,9 +19,9 @@ NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(GamepadButton, mParent) /* virtual */ JSObject* -GamepadButton::WrapObject(JSContext* aCx) +GamepadButton::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return GamepadButtonBinding::Wrap(aCx, this); + return GamepadButtonBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/gamepad/GamepadButton.h b/dom/gamepad/GamepadButton.h index 1ac42111295e..99bce097e3c9 100644 --- a/dom/gamepad/GamepadButton.h +++ b/dom/gamepad/GamepadButton.h @@ -30,7 +30,7 @@ public: return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; void SetPressed(bool aPressed) { diff --git a/dom/geolocation/nsGeoPosition.cpp b/dom/geolocation/nsGeoPosition.cpp index b9228078416e..1698d9378b82 100644 --- a/dom/geolocation/nsGeoPosition.cpp +++ b/dom/geolocation/nsGeoPosition.cpp @@ -171,9 +171,9 @@ Position::GetParentObject() const } JSObject* -Position::WrapObject(JSContext* aCx) +Position::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PositionBinding::Wrap(aCx, this); + return PositionBinding::Wrap(aCx, this, aGivenProto); } Coordinates* @@ -224,9 +224,9 @@ Coordinates::GetParentObject() const } JSObject* -Coordinates::WrapObject(JSContext* aCx) +Coordinates::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return CoordinatesBinding::Wrap(aCx, this); + return CoordinatesBinding::Wrap(aCx, this, aGivenProto); } #define GENERATE_COORDS_WRAPPED_GETTER(name) \ diff --git a/dom/geolocation/nsGeoPosition.h b/dom/geolocation/nsGeoPosition.h index 499e6b412ecf..2e6405e29e44 100644 --- a/dom/geolocation/nsGeoPosition.h +++ b/dom/geolocation/nsGeoPosition.h @@ -90,7 +90,7 @@ public: nsISupports* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; Coordinates* Coords(); @@ -118,7 +118,7 @@ public: Position* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; double Latitude() const; diff --git a/dom/geolocation/nsGeolocation.cpp b/dom/geolocation/nsGeolocation.cpp index c1ca51b30b5c..6176fae2fd1c 100644 --- a/dom/geolocation/nsGeolocation.cpp +++ b/dom/geolocation/nsGeolocation.cpp @@ -315,9 +315,9 @@ PositionError::GetParentObject() const } JSObject* -PositionError::WrapObject(JSContext* aCx) +PositionError::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return PositionErrorBinding::Wrap(aCx, this); + return PositionErrorBinding::Wrap(aCx, this, aGivenProto); } void @@ -1623,7 +1623,7 @@ Geolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request) } JSObject* -Geolocation::WrapObject(JSContext *aCtx) +Geolocation::WrapObject(JSContext *aCtx, JS::Handle aGivenProto) { - return GeolocationBinding::Wrap(aCtx, this); + return GeolocationBinding::Wrap(aCtx, this, aGivenProto); } diff --git a/dom/geolocation/nsGeolocation.h b/dom/geolocation/nsGeolocation.h index 683a9d01641a..619d492b5cf2 100644 --- a/dom/geolocation/nsGeolocation.h +++ b/dom/geolocation/nsGeolocation.h @@ -140,7 +140,7 @@ public: nsresult Init(nsIDOMWindow* contentDom=nullptr); nsIDOMWindow* GetParentObject() const; - virtual JSObject* WrapObject(JSContext *aCtx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *aCtx, JS::Handle aGivenProto) MOZ_OVERRIDE; int32_t WatchPosition(PositionCallback& aCallback, PositionErrorCallback* aErrorCallback, const PositionOptions& aOptions, ErrorResult& aRv); void GetCurrentPosition(PositionCallback& aCallback, PositionErrorCallback* aErrorCallback, const PositionOptions& aOptions, ErrorResult& aRv); @@ -233,7 +233,7 @@ public: Geolocation* GetParentObject() const; - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; int16_t Code() const { return mCode; diff --git a/dom/html/HTMLAllCollection.cpp b/dom/html/HTMLAllCollection.cpp index 80acfeae0ba6..18151d307bc5 100644 --- a/dom/html/HTMLAllCollection.cpp +++ b/dom/html/HTMLAllCollection.cpp @@ -210,9 +210,9 @@ HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray& aNames JSObject* -HTMLAllCollection::WrapObject(JSContext* aCx) +HTMLAllCollection::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLAllCollectionBinding::Wrap(aCx, this); + return HTMLAllCollectionBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/html/HTMLAllCollection.h b/dom/html/HTMLAllCollection.h index 1a1908faaa48..efc498a12a10 100644 --- a/dom/html/HTMLAllCollection.h +++ b/dom/html/HTMLAllCollection.h @@ -40,7 +40,7 @@ public: NS_DECL_CYCLE_COLLECTING_ISUPPORTS NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(HTMLAllCollection) - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsINode* GetParentObject() const; uint32_t Length(); diff --git a/dom/html/HTMLAnchorElement.cpp b/dom/html/HTMLAnchorElement.cpp index 609cae3caf17..442e3f8eaddf 100644 --- a/dom/html/HTMLAnchorElement.cpp +++ b/dom/html/HTMLAnchorElement.cpp @@ -69,9 +69,9 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_END NS_IMPL_ELEMENT_CLONE(HTMLAnchorElement) JSObject* -HTMLAnchorElement::WrapNode(JSContext *aCx) +HTMLAnchorElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return HTMLAnchorElementBinding::Wrap(aCx, this); + return HTMLAnchorElementBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_STRING_ATTR(HTMLAnchorElement, Charset, charset) diff --git a/dom/html/HTMLAnchorElement.h b/dom/html/HTMLAnchorElement.h index 203835849eff..8f398e27bcd0 100644 --- a/dom/html/HTMLAnchorElement.h +++ b/dom/html/HTMLAnchorElement.h @@ -229,7 +229,7 @@ protected: virtual void GetItemValueText(DOMString& text) MOZ_OVERRIDE; virtual void SetItemValueText(const nsAString& text) MOZ_OVERRIDE; - virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsRefPtr mRelList; }; diff --git a/dom/html/HTMLAreaElement.cpp b/dom/html/HTMLAreaElement.cpp index dbc704d051e0..23f38ceaa734 100644 --- a/dom/html/HTMLAreaElement.cpp +++ b/dom/html/HTMLAreaElement.cpp @@ -269,9 +269,9 @@ HTMLAreaElement::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const } JSObject* -HTMLAreaElement::WrapNode(JSContext* aCx) +HTMLAreaElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLAreaElementBinding::Wrap(aCx, this); + return HTMLAreaElementBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/html/HTMLAreaElement.h b/dom/html/HTMLAreaElement.h index 9dad695bbc62..0013388a01ac 100644 --- a/dom/html/HTMLAreaElement.h +++ b/dom/html/HTMLAreaElement.h @@ -178,7 +178,7 @@ public: protected: virtual ~HTMLAreaElement(); - virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; virtual void GetItemValueText(DOMString& text) MOZ_OVERRIDE; virtual void SetItemValueText(const nsAString& text) MOZ_OVERRIDE; diff --git a/dom/html/HTMLAudioElement.cpp b/dom/html/HTMLAudioElement.cpp index 04d8313103c2..76269cc7e94d 100644 --- a/dom/html/HTMLAudioElement.cpp +++ b/dom/html/HTMLAudioElement.cpp @@ -96,9 +96,9 @@ nsresult HTMLAudioElement::SetAcceptHeader(nsIHttpChannel* aChannel) } JSObject* -HTMLAudioElement::WrapNode(JSContext* aCx) +HTMLAudioElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLAudioElementBinding::Wrap(aCx, this); + return HTMLAudioElementBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/html/HTMLAudioElement.h b/dom/html/HTMLAudioElement.h index f1f050c00d56..5fac0204d0f7 100644 --- a/dom/html/HTMLAudioElement.h +++ b/dom/html/HTMLAudioElement.h @@ -43,7 +43,7 @@ public: protected: virtual ~HTMLAudioElement(); - virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; }; } // namespace dom diff --git a/dom/html/HTMLBRElement.cpp b/dom/html/HTMLBRElement.cpp index fa213e3c6d42..279d87c90585 100644 --- a/dom/html/HTMLBRElement.cpp +++ b/dom/html/HTMLBRElement.cpp @@ -95,9 +95,9 @@ HTMLBRElement::GetAttributeMappingFunction() const } JSObject* -HTMLBRElement::WrapNode(JSContext *aCx) +HTMLBRElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return HTMLBRElementBinding::Wrap(aCx, this); + return HTMLBRElementBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/html/HTMLBRElement.h b/dom/html/HTMLBRElement.h index 9f38e853b2b1..4c30d4078b6c 100644 --- a/dom/html/HTMLBRElement.h +++ b/dom/html/HTMLBRElement.h @@ -43,7 +43,7 @@ public: return SetHTMLAttr(nsGkAtoms::clear, aClear, aError); } - virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; private: virtual ~HTMLBRElement(); diff --git a/dom/html/HTMLBodyElement.cpp b/dom/html/HTMLBodyElement.cpp index b131eb3f8aa3..5d21e64e0bbf 100644 --- a/dom/html/HTMLBodyElement.cpp +++ b/dom/html/HTMLBodyElement.cpp @@ -189,9 +189,9 @@ HTMLBodyElement::~HTMLBodyElement() } JSObject* -HTMLBodyElement::WrapNode(JSContext *aCx) +HTMLBodyElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return HTMLBodyElementBinding::Wrap(aCx, this); + return HTMLBodyElementBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_ISUPPORTS_INHERITED(HTMLBodyElement, nsGenericHTMLElement, diff --git a/dom/html/HTMLBodyElement.h b/dom/html/HTMLBodyElement.h index 608a7a0d2050..822cb48bc3be 100644 --- a/dom/html/HTMLBodyElement.h +++ b/dom/html/HTMLBodyElement.h @@ -134,7 +134,7 @@ public: protected: virtual ~HTMLBodyElement(); - virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsRefPtr mContentStyleRule; diff --git a/dom/html/HTMLButtonElement.cpp b/dom/html/HTMLButtonElement.cpp index 1da9c4c7e84d..f86b619afbd0 100644 --- a/dom/html/HTMLButtonElement.cpp +++ b/dom/html/HTMLButtonElement.cpp @@ -579,9 +579,9 @@ HTMLButtonElement::IntrinsicState() const } JSObject* -HTMLButtonElement::WrapNode(JSContext* aCx) +HTMLButtonElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLButtonElementBinding::Wrap(aCx, this); + return HTMLButtonElementBinding::Wrap(aCx, this, aGivenProto); } } // namespace dom diff --git a/dom/html/HTMLButtonElement.h b/dom/html/HTMLButtonElement.h index a2e8cf55a8e7..fe93c2a0d353 100644 --- a/dom/html/HTMLButtonElement.h +++ b/dom/html/HTMLButtonElement.h @@ -62,7 +62,7 @@ public: // nsINode virtual nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult) const MOZ_OVERRIDE; - virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; // nsIContent virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp index f1ad3373422a..728e9f0d8f92 100644 --- a/dom/html/HTMLCanvasElement.cpp +++ b/dom/html/HTMLCanvasElement.cpp @@ -72,9 +72,9 @@ HTMLCanvasPrintState::~HTMLCanvasPrintState() } /* virtual */ JSObject* -HTMLCanvasPrintState::WrapObject(JSContext* aCx) +HTMLCanvasPrintState::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return MozCanvasPrintStateBinding::Wrap(aCx, this); + return MozCanvasPrintStateBinding::Wrap(aCx, this, aGivenProto); } nsISupports* @@ -137,9 +137,9 @@ NS_INTERFACE_TABLE_TAIL_INHERITING(nsGenericHTMLElement) NS_IMPL_ELEMENT_CLONE(HTMLCanvasElement) /* virtual */ JSObject* -HTMLCanvasElement::WrapNode(JSContext* aCx) +HTMLCanvasElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLCanvasElementBinding::Wrap(aCx, this); + return HTMLCanvasElementBinding::Wrap(aCx, this, aGivenProto); } nsIntSize diff --git a/dom/html/HTMLCanvasElement.h b/dom/html/HTMLCanvasElement.h index 8db6668098e5..97968a35b15e 100644 --- a/dom/html/HTMLCanvasElement.h +++ b/dom/html/HTMLCanvasElement.h @@ -215,7 +215,7 @@ public: protected: virtual ~HTMLCanvasElement(); - virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; nsIntSize GetWidthHeight(); @@ -279,7 +279,7 @@ public: NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(HTMLCanvasPrintState) NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_NATIVE_CLASS(HTMLCanvasPrintState) - virtual JSObject* WrapObject(JSContext *cx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext *cx, JS::Handle aGivenProto) MOZ_OVERRIDE; HTMLCanvasElement* GetParentObject() { diff --git a/dom/html/HTMLContentElement.cpp b/dom/html/HTMLContentElement.cpp index 2a134c747dd7..b310a0b5f0a9 100644 --- a/dom/html/HTMLContentElement.cpp +++ b/dom/html/HTMLContentElement.cpp @@ -43,9 +43,9 @@ NS_INTERFACE_MAP_END_INHERITING(nsGenericHTMLElement) NS_IMPL_ELEMENT_CLONE(HTMLContentElement) JSObject* -HTMLContentElement::WrapNode(JSContext *aCx) +HTMLContentElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return HTMLContentElementBinding::Wrap(aCx, this); + return HTMLContentElementBinding::Wrap(aCx, this, aGivenProto); } nsresult @@ -362,8 +362,8 @@ DistributedContentList::IndexOf(nsIContent* aContent) } JSObject* -DistributedContentList::WrapObject(JSContext* aCx) +DistributedContentList::WrapObject(JSContext* aCx, JS::Handle aGivenProto) { - return NodeListBinding::Wrap(aCx, this); + return NodeListBinding::Wrap(aCx, this, aGivenProto); } diff --git a/dom/html/HTMLContentElement.h b/dom/html/HTMLContentElement.h index 630c491154cc..a854db7befa6 100644 --- a/dom/html/HTMLContentElement.h +++ b/dom/html/HTMLContentElement.h @@ -73,7 +73,7 @@ public: protected: virtual ~HTMLContentElement(); - virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; /** * Updates the destination insertion points of the fallback @@ -110,7 +110,7 @@ public: virtual nsIContent* Item(uint32_t aIndex) MOZ_OVERRIDE; virtual int32_t IndexOf(nsIContent* aContent) MOZ_OVERRIDE; virtual nsINode* GetParentObject() MOZ_OVERRIDE { return mParent; } - virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; protected: virtual ~DistributedContentList(); nsRefPtr mParent; diff --git a/dom/html/HTMLDataElement.cpp b/dom/html/HTMLDataElement.cpp index f835ee89af0d..7b49912515c0 100644 --- a/dom/html/HTMLDataElement.cpp +++ b/dom/html/HTMLDataElement.cpp @@ -24,9 +24,9 @@ HTMLDataElement::~HTMLDataElement() NS_IMPL_ELEMENT_CLONE(HTMLDataElement) JSObject* -HTMLDataElement::WrapNode(JSContext* aCx) +HTMLDataElement::WrapNode(JSContext* aCx, JS::Handle aGivenProto) { - return HTMLDataElementBinding::Wrap(aCx, this); + return HTMLDataElementBinding::Wrap(aCx, this, aGivenProto); } void diff --git a/dom/html/HTMLDataElement.h b/dom/html/HTMLDataElement.h index c290b8d6b982..b78643d4725d 100644 --- a/dom/html/HTMLDataElement.h +++ b/dom/html/HTMLDataElement.h @@ -37,7 +37,7 @@ public: protected: virtual ~HTMLDataElement(); - virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext* aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; }; } // namespace dom diff --git a/dom/html/HTMLDataListElement.cpp b/dom/html/HTMLDataListElement.cpp index 2c8b99c7b539..bf304f9cc529 100644 --- a/dom/html/HTMLDataListElement.cpp +++ b/dom/html/HTMLDataListElement.cpp @@ -16,9 +16,9 @@ HTMLDataListElement::~HTMLDataListElement() } JSObject* -HTMLDataListElement::WrapNode(JSContext *aCx) +HTMLDataListElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) { - return HTMLDataListElementBinding::Wrap(aCx, this); + return HTMLDataListElementBinding::Wrap(aCx, this, aGivenProto); } NS_IMPL_CYCLE_COLLECTION_INHERITED(HTMLDataListElement, nsGenericHTMLElement, diff --git a/dom/html/HTMLDataListElement.h b/dom/html/HTMLDataListElement.h index 05708cc0b5d4..a3e31ce82c8e 100644 --- a/dom/html/HTMLDataListElement.h +++ b/dom/html/HTMLDataListElement.h @@ -44,7 +44,7 @@ public: protected: virtual ~HTMLDataListElement(); - virtual JSObject* WrapNode(JSContext *aCx) MOZ_OVERRIDE; + virtual JSObject* WrapNode(JSContext *aCx, JS::Handle aGivenProto) MOZ_OVERRIDE; //