diff --git a/accessible/generic/ARIAGridAccessible.cpp b/accessible/generic/ARIAGridAccessible.cpp index 3bd6d6a3cb9c..74cc947c3e5c 100644 --- a/accessible/generic/ARIAGridAccessible.cpp +++ b/accessible/generic/ARIAGridAccessible.cpp @@ -32,8 +32,6 @@ ARIAGridAccessible:: { } -NS_IMPL_ISUPPORTS_INHERITED0(ARIAGridAccessible, Accessible) - //////////////////////////////////////////////////////////////////////////////// // Table @@ -543,8 +541,6 @@ ARIARowAccessible:: mGenericTypes |= eTableRow; } -NS_IMPL_ISUPPORTS_INHERITED0(ARIARowAccessible, Accessible) - GroupPos ARIARowAccessible::GroupPosition() { @@ -575,8 +571,6 @@ ARIAGridCellAccessible:: mGenericTypes |= eTableCell; } -NS_IMPL_ISUPPORTS_INHERITED0(ARIAGridCellAccessible, HyperTextAccessible) - //////////////////////////////////////////////////////////////////////////////// // TableCell diff --git a/accessible/generic/ARIAGridAccessible.h b/accessible/generic/ARIAGridAccessible.h index c9a36cc6ef1e..4de2cb7b43f3 100644 --- a/accessible/generic/ARIAGridAccessible.h +++ b/accessible/generic/ARIAGridAccessible.h @@ -22,7 +22,7 @@ class ARIAGridAccessible : public AccessibleWrap, public: ARIAGridAccessible(nsIContent* aContent, DocAccessible* aDoc); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ARIAGridAccessible, AccessibleWrap) // Accessible virtual TableAccessible* AsTable() override { return this; } @@ -81,7 +81,7 @@ class ARIARowAccessible : public AccessibleWrap public: ARIARowAccessible(nsIContent* aContent, DocAccessible* aDoc); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ARIARowAccessible, AccessibleWrap) // Accessible virtual mozilla::a11y::GroupPos GroupPosition() override; @@ -100,7 +100,8 @@ class ARIAGridCellAccessible : public HyperTextAccessibleWrap, public: ARIAGridCellAccessible(nsIContent* aContent, DocAccessible* aDoc); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ARIAGridCellAccessible, + HyperTextAccessibleWrap) // Accessible virtual TableCellAccessible* AsTableCell() override { return this; } diff --git a/accessible/generic/ApplicationAccessible.cpp b/accessible/generic/ApplicationAccessible.cpp index c81e1e3aeaee..d7489875ab75 100644 --- a/accessible/generic/ApplicationAccessible.cpp +++ b/accessible/generic/ApplicationAccessible.cpp @@ -31,8 +31,6 @@ ApplicationAccessible::ApplicationAccessible() : MOZ_ASSERT(mAppInfo, "no application info"); } -NS_IMPL_ISUPPORTS_INHERITED0(ApplicationAccessible, Accessible) - //////////////////////////////////////////////////////////////////////////////// // nsIAccessible diff --git a/accessible/generic/ApplicationAccessible.h b/accessible/generic/ApplicationAccessible.h index 7609a86e2511..ca02d10417bf 100644 --- a/accessible/generic/ApplicationAccessible.h +++ b/accessible/generic/ApplicationAccessible.h @@ -32,7 +32,7 @@ public: ApplicationAccessible(); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ApplicationAccessible, AccessibleWrap) // Accessible virtual void Shutdown() override; diff --git a/accessible/generic/BaseAccessibles.cpp b/accessible/generic/BaseAccessibles.cpp index bcb262a97d17..39b29bd5a72e 100644 --- a/accessible/generic/BaseAccessibles.cpp +++ b/accessible/generic/BaseAccessibles.cpp @@ -27,8 +27,6 @@ LeafAccessible:: mStateFlags |= eNoKidsFromDOM; } -NS_IMPL_ISUPPORTS_INHERITED0(LeafAccessible, Accessible) - //////////////////////////////////////////////////////////////////////////////// // LeafAccessible: Accessible public @@ -66,8 +64,6 @@ LeafAccessible::IsAcceptableChild(nsIContent* aEl) const // LinkableAccessible //////////////////////////////////////////////////////////////////////////////// -NS_IMPL_ISUPPORTS_INHERITED0(LinkableAccessible, AccessibleWrap) - //////////////////////////////////////////////////////////////////////////////// // LinkableAccessible. nsIAccessible diff --git a/accessible/generic/BaseAccessibles.h b/accessible/generic/BaseAccessibles.h index e4c71c423c71..56a702b49c24 100644 --- a/accessible/generic/BaseAccessibles.h +++ b/accessible/generic/BaseAccessibles.h @@ -30,7 +30,7 @@ public: LeafAccessible(nsIContent* aContent, DocAccessible* aDoc); // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(LeafAccessible, AccessibleWrap) // Accessible virtual Accessible* ChildAtPoint(int32_t aX, int32_t aY, @@ -60,7 +60,7 @@ public: { } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(LinkableAccessible, AccessibleWrap) // Accessible virtual void Value(nsString& aValue) override; diff --git a/accessible/generic/HyperTextAccessible.cpp b/accessible/generic/HyperTextAccessible.cpp index a5c91d66ab5b..0473b11dff10 100644 --- a/accessible/generic/HyperTextAccessible.cpp +++ b/accessible/generic/HyperTextAccessible.cpp @@ -56,8 +56,6 @@ HyperTextAccessible:: mGenericTypes |= eHyperText; } -NS_IMPL_ISUPPORTS_INHERITED0(HyperTextAccessible, Accessible) - role HyperTextAccessible::NativeRole() { diff --git a/accessible/generic/HyperTextAccessible.h b/accessible/generic/HyperTextAccessible.h index 6b0e66060f60..6acaad5c7a70 100644 --- a/accessible/generic/HyperTextAccessible.h +++ b/accessible/generic/HyperTextAccessible.h @@ -51,7 +51,7 @@ class HyperTextAccessible : public AccessibleWrap public: HyperTextAccessible(nsIContent* aContent, DocAccessible* aDoc); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HyperTextAccessible, AccessibleWrap) // Accessible virtual nsAtom* LandmarkRole() const override; diff --git a/accessible/generic/OuterDocAccessible.cpp b/accessible/generic/OuterDocAccessible.cpp index a638b3bfae19..9e3df36c4462 100644 --- a/accessible/generic/OuterDocAccessible.cpp +++ b/accessible/generic/OuterDocAccessible.cpp @@ -50,12 +50,6 @@ OuterDocAccessible::~OuterDocAccessible() { } -//////////////////////////////////////////////////////////////////////////////// -// nsISupports - -NS_IMPL_ISUPPORTS_INHERITED0(OuterDocAccessible, - Accessible) - //////////////////////////////////////////////////////////////////////////////// // Accessible public (DON'T add methods here) diff --git a/accessible/generic/OuterDocAccessible.h b/accessible/generic/OuterDocAccessible.h index 833ebaf84e43..d38c45e54d7c 100644 --- a/accessible/generic/OuterDocAccessible.h +++ b/accessible/generic/OuterDocAccessible.h @@ -26,7 +26,7 @@ class OuterDocAccessible final : public AccessibleWrap public: OuterDocAccessible(nsIContent* aContent, DocAccessible* aDoc); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(OuterDocAccessible, AccessibleWrap) DocAccessibleParent* RemoteChildDoc() const; diff --git a/accessible/generic/RootAccessible.cpp b/accessible/generic/RootAccessible.cpp index 3eb3c5c5ec6e..5c77c4ea8e31 100644 --- a/accessible/generic/RootAccessible.cpp +++ b/accessible/generic/RootAccessible.cpp @@ -52,7 +52,7 @@ using namespace mozilla::dom; //////////////////////////////////////////////////////////////////////////////// // nsISupports -NS_IMPL_ISUPPORTS_INHERITED0(RootAccessible, DocAccessible) +NS_IMPL_ISUPPORTS_INHERITED(RootAccessible, DocAccessible, nsIDOMEventListener) //////////////////////////////////////////////////////////////////////////////// // Constructor/destructor diff --git a/accessible/html/HTMLCanvasAccessible.cpp b/accessible/html/HTMLCanvasAccessible.cpp index 4cc748728265..85748478e23f 100644 --- a/accessible/html/HTMLCanvasAccessible.cpp +++ b/accessible/html/HTMLCanvasAccessible.cpp @@ -15,8 +15,6 @@ HTMLCanvasAccessible:: { } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLCanvasAccessible, HyperTextAccessible) - role HTMLCanvasAccessible::NativeRole() { diff --git a/accessible/html/HTMLCanvasAccessible.h b/accessible/html/HTMLCanvasAccessible.h index f07b84435de7..d2ceb89fa9b7 100644 --- a/accessible/html/HTMLCanvasAccessible.h +++ b/accessible/html/HTMLCanvasAccessible.h @@ -20,7 +20,8 @@ public: HTMLCanvasAccessible(nsIContent* aContent, DocAccessible* aDoc); // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLCanvasAccessible, + HyperTextAccessibleWrap) // Accessible virtual a11y::role NativeRole() override; diff --git a/accessible/html/HTMLElementAccessibles.cpp b/accessible/html/HTMLElementAccessibles.cpp index 4acd272765a3..8d20084f29dd 100644 --- a/accessible/html/HTMLElementAccessibles.cpp +++ b/accessible/html/HTMLElementAccessibles.cpp @@ -56,8 +56,6 @@ HTMLBRAccessible::NativeName(nsString& aName) // HTMLLabelAccessible //////////////////////////////////////////////////////////////////////////////// -NS_IMPL_ISUPPORTS_INHERITED0(HTMLLabelAccessible, HyperTextAccessible) - ENameValueFlag HTMLLabelAccessible::NativeName(nsString& aName) { @@ -107,8 +105,6 @@ HTMLLabelAccessible::DoAction(uint8_t aIndex) // nsHTMLOuputAccessible //////////////////////////////////////////////////////////////////////////////// -NS_IMPL_ISUPPORTS_INHERITED0(HTMLOutputAccessible, HyperTextAccessible) - Relation HTMLOutputAccessible::RelationByType(RelationType aType) { @@ -208,8 +204,6 @@ HTMLSummaryAccessible::IsWidget() const // HTMLHeaderOrFooterAccessible //////////////////////////////////////////////////////////////////////////////// -NS_IMPL_ISUPPORTS_INHERITED0(HTMLHeaderOrFooterAccessible, HyperTextAccessible) - role HTMLHeaderOrFooterAccessible::NativeRole() { diff --git a/accessible/html/HTMLElementAccessibles.h b/accessible/html/HTMLElementAccessibles.h index 56d711046711..6aaa3280ea6d 100644 --- a/accessible/html/HTMLElementAccessibles.h +++ b/accessible/html/HTMLElementAccessibles.h @@ -57,7 +57,8 @@ public: HTMLLabelAccessible(nsIContent* aContent, DocAccessible* aDoc) : HyperTextAccessibleWrap(aContent, aDoc) {} - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLabelAccessible, + HyperTextAccessibleWrap) // Accessible virtual Relation RelationByType(RelationType aType) override; @@ -82,7 +83,8 @@ public: HTMLOutputAccessible(nsIContent* aContent, DocAccessible* aDoc) : HyperTextAccessibleWrap(aContent, aDoc) {} - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLOutputAccessible, + HyperTextAccessibleWrap) // Accessible virtual Relation RelationByType(RelationType aType) override; @@ -124,7 +126,8 @@ public: HTMLHeaderOrFooterAccessible(nsIContent* aContent, DocAccessible* aDoc) : HyperTextAccessibleWrap(aContent, aDoc) {} - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLHeaderOrFooterAccessible, + HyperTextAccessibleWrap) // Accessible virtual nsAtom* LandmarkRole() const override; diff --git a/accessible/html/HTMLFormControlAccessible.cpp b/accessible/html/HTMLFormControlAccessible.cpp index c732cc12dbef..ad57436c8590 100644 --- a/accessible/html/HTMLFormControlAccessible.cpp +++ b/accessible/html/HTMLFormControlAccessible.cpp @@ -285,9 +285,6 @@ HTMLTextFieldAccessible:: mType = eHTMLTextFieldType; } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLTextFieldAccessible, - HyperTextAccessible) - role HTMLTextFieldAccessible::NativeRole() { diff --git a/accessible/html/HTMLFormControlAccessible.h b/accessible/html/HTMLFormControlAccessible.h index d4b3da3c329d..d2f11ed97a3a 100644 --- a/accessible/html/HTMLFormControlAccessible.h +++ b/accessible/html/HTMLFormControlAccessible.h @@ -114,7 +114,8 @@ public: HTMLTextFieldAccessible(nsIContent* aContent, DocAccessible* aDoc); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTextFieldAccessible, + HyperTextAccessibleWrap) // HyperTextAccessible virtual already_AddRefed GetEditor() const override; diff --git a/accessible/html/HTMLImageMapAccessible.cpp b/accessible/html/HTMLImageMapAccessible.cpp index b3e5706793f1..f225b5d9f175 100644 --- a/accessible/html/HTMLImageMapAccessible.cpp +++ b/accessible/html/HTMLImageMapAccessible.cpp @@ -33,11 +33,6 @@ HTMLImageMapAccessible:: UpdateChildAreas(false); } -//////////////////////////////////////////////////////////////////////////////// -// HTMLImageMapAccessible: nsISupports - -NS_IMPL_ISUPPORTS_INHERITED0(HTMLImageMapAccessible, ImageAccessible) - //////////////////////////////////////////////////////////////////////////////// // HTMLImageMapAccessible: Accessible public diff --git a/accessible/html/HTMLImageMapAccessible.h b/accessible/html/HTMLImageMapAccessible.h index 4960e3cee7b8..13db210d937f 100644 --- a/accessible/html/HTMLImageMapAccessible.h +++ b/accessible/html/HTMLImageMapAccessible.h @@ -21,7 +21,8 @@ public: HTMLImageMapAccessible(nsIContent* aContent, DocAccessible* aDoc); // nsISupports and cycle collector - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLImageMapAccessible, + ImageAccessibleWrap) // Accessible virtual a11y::role NativeRole() override; diff --git a/accessible/html/HTMLLinkAccessible.cpp b/accessible/html/HTMLLinkAccessible.cpp index 864729cfe477..508849359884 100644 --- a/accessible/html/HTMLLinkAccessible.cpp +++ b/accessible/html/HTMLLinkAccessible.cpp @@ -27,8 +27,6 @@ HTMLLinkAccessible:: { } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLLinkAccessible, HyperTextAccessible) - //////////////////////////////////////////////////////////////////////////////// // nsIAccessible diff --git a/accessible/html/HTMLLinkAccessible.h b/accessible/html/HTMLLinkAccessible.h index aa4da22be58d..2d1ad369b6f2 100644 --- a/accessible/html/HTMLLinkAccessible.h +++ b/accessible/html/HTMLLinkAccessible.h @@ -16,7 +16,8 @@ class HTMLLinkAccessible : public HyperTextAccessibleWrap public: HTMLLinkAccessible(nsIContent* aContent, DocAccessible* aDoc); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLinkAccessible, + HyperTextAccessibleWrap) // Accessible virtual void Value(nsString& aValue) override; diff --git a/accessible/html/HTMLListAccessible.cpp b/accessible/html/HTMLListAccessible.cpp index d497d5d43a65..465246d55fd2 100644 --- a/accessible/html/HTMLListAccessible.cpp +++ b/accessible/html/HTMLListAccessible.cpp @@ -21,8 +21,6 @@ using namespace mozilla::a11y; // HTMLListAccessible //////////////////////////////////////////////////////////////////////////////// -NS_IMPL_ISUPPORTS_INHERITED0(HTMLListAccessible, HyperTextAccessible) - role HTMLListAccessible::NativeRole() { @@ -55,8 +53,6 @@ HTMLLIAccessible:: } } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLLIAccessible, HyperTextAccessible) - void HTMLLIAccessible::Shutdown() { diff --git a/accessible/html/HTMLListAccessible.h b/accessible/html/HTMLListAccessible.h index 1e6a13f5efaf..ec763fd64ed4 100644 --- a/accessible/html/HTMLListAccessible.h +++ b/accessible/html/HTMLListAccessible.h @@ -25,7 +25,8 @@ public: HyperTextAccessibleWrap(aContent, aDoc) { mGenericTypes |= eList; } // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLListAccessible, + HyperTextAccessibleWrap) // Accessible virtual a11y::role NativeRole() override; @@ -45,7 +46,8 @@ public: HTMLLIAccessible(nsIContent* aContent, DocAccessible* aDoc); // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLIAccessible, + HyperTextAccessibleWrap) // Accessible virtual void Shutdown() override; diff --git a/accessible/html/HTMLTableAccessible.cpp b/accessible/html/HTMLTableAccessible.cpp index 9f803ecab09d..18c7c71a0ae2 100644 --- a/accessible/html/HTMLTableAccessible.cpp +++ b/accessible/html/HTMLTableAccessible.cpp @@ -52,8 +52,6 @@ HTMLTableCellAccessible:: mGenericTypes |= eTableCell; } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableCellAccessible, HyperTextAccessible) - //////////////////////////////////////////////////////////////////////////////// // HTMLTableCellAccessible: Accessible implementation @@ -357,8 +355,6 @@ HTMLTableHeaderCellAccessible::NativeRole() // HTMLTableRowAccessible //////////////////////////////////////////////////////////////////////////////// -NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableRowAccessible, Accessible) - role HTMLTableRowAccessible::NativeRole() { @@ -388,8 +384,6 @@ HTMLTableRowAccessible::GroupPosition() // HTMLTableAccessible //////////////////////////////////////////////////////////////////////////////// -NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableAccessible, Accessible) - //////////////////////////////////////////////////////////////////////////////// // HTMLTableAccessible: Accessible diff --git a/accessible/html/HTMLTableAccessible.h b/accessible/html/HTMLTableAccessible.h index c7cfc9ddf3a7..14a5dd304df6 100644 --- a/accessible/html/HTMLTableAccessible.h +++ b/accessible/html/HTMLTableAccessible.h @@ -26,7 +26,8 @@ public: HTMLTableCellAccessible(nsIContent* aContent, DocAccessible* aDoc); // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableCellAccessible, + HyperTextAccessibleWrap) // Accessible virtual TableCellAccessible* AsTableCell() override { return this; } @@ -92,7 +93,7 @@ public: mGenericTypes |= eTableRow; } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableRowAccessible, AccessibleWrap) // Accessible virtual a11y::role NativeRole() override; @@ -123,7 +124,7 @@ public: mGenericTypes |= eTable; } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableAccessible, AccessibleWrap) // TableAccessible virtual Accessible* Caption() const override; diff --git a/accessible/windows/msaa/ARIAGridAccessibleWrap.h b/accessible/windows/msaa/ARIAGridAccessibleWrap.h index b03cc349f48b..2402cea96240 100644 --- a/accessible/windows/msaa/ARIAGridAccessibleWrap.h +++ b/accessible/windows/msaa/ARIAGridAccessibleWrap.h @@ -32,6 +32,8 @@ public: DECL_IUNKNOWN_INHERITED // nsISupports + // Need to declare addref/release here unconditionally, because + // ia2AccessibleTable has pure-virtual refcounting. NS_DECL_ISUPPORTS_INHERITED virtual void Shutdown() override; @@ -54,6 +56,8 @@ public: DECL_IUNKNOWN_INHERITED // nsISupports + // Need to declare addref/release here unconditionally, because + // ia2AccessibleTable has pure-virtual refcounting. NS_DECL_ISUPPORTS_INHERITED virtual void Shutdown() override; diff --git a/accessible/xul/XULAlertAccessible.cpp b/accessible/xul/XULAlertAccessible.cpp index 4b1b5bd8d832..af0b5c77508a 100644 --- a/accessible/xul/XULAlertAccessible.cpp +++ b/accessible/xul/XULAlertAccessible.cpp @@ -26,8 +26,6 @@ XULAlertAccessible::~XULAlertAccessible() { } -NS_IMPL_ISUPPORTS_INHERITED0(XULAlertAccessible, Accessible) - role XULAlertAccessible::NativeRole() { diff --git a/accessible/xul/XULAlertAccessible.h b/accessible/xul/XULAlertAccessible.h index 62bf4cb46400..f01bba06ab5f 100644 --- a/accessible/xul/XULAlertAccessible.h +++ b/accessible/xul/XULAlertAccessible.h @@ -20,7 +20,7 @@ class XULAlertAccessible : public AccessibleWrap public: XULAlertAccessible(nsIContent* aContent, DocAccessible* aDoc); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(XULAlertAccessible, AccessibleWrap) // Accessible virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) override; diff --git a/accessible/xul/XULFormControlAccessible.cpp b/accessible/xul/XULFormControlAccessible.cpp index 6dadb6679fbf..e7fbc3eb37e9 100644 --- a/accessible/xul/XULFormControlAccessible.cpp +++ b/accessible/xul/XULFormControlAccessible.cpp @@ -54,8 +54,6 @@ XULButtonAccessible::~XULButtonAccessible() //////////////////////////////////////////////////////////////////////////////// // XULButtonAccessible: nsISupports -NS_IMPL_ISUPPORTS_INHERITED0(XULButtonAccessible, Accessible) - //////////////////////////////////////////////////////////////////////////////// // XULButtonAccessible: nsIAccessible diff --git a/accessible/xul/XULFormControlAccessible.h b/accessible/xul/XULFormControlAccessible.h index 4f11668c9a77..f95b5cc25cd7 100644 --- a/accessible/xul/XULFormControlAccessible.h +++ b/accessible/xul/XULFormControlAccessible.h @@ -33,7 +33,7 @@ public: XULButtonAccessible(nsIContent* aContent, DocAccessible* aDoc); // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(XULButtonAccessible, AccessibleWrap) // Accessible virtual mozilla::a11y::role NativeRole() override; diff --git a/accessible/xul/XULListboxAccessible.cpp b/accessible/xul/XULListboxAccessible.cpp index 2ef47d3c2f59..412243da074b 100644 --- a/accessible/xul/XULListboxAccessible.cpp +++ b/accessible/xul/XULListboxAccessible.cpp @@ -551,8 +551,6 @@ XULListitemAccessible::~XULListitemAccessible() { } -NS_IMPL_ISUPPORTS_INHERITED0(XULListitemAccessible, Accessible) - Accessible* XULListitemAccessible::GetListAccessible() const { @@ -693,9 +691,6 @@ XULListCellAccessible:: //////////////////////////////////////////////////////////////////////////////// // nsISupports -NS_IMPL_ISUPPORTS_INHERITED0(XULListCellAccessible, - HyperTextAccessible) - //////////////////////////////////////////////////////////////////////////////// // XULListCellAccessible: TableCell diff --git a/accessible/xul/XULListboxAccessible.h b/accessible/xul/XULListboxAccessible.h index 057838035076..4b1626ac0e18 100644 --- a/accessible/xul/XULListboxAccessible.h +++ b/accessible/xul/XULListboxAccessible.h @@ -106,7 +106,8 @@ class XULListitemAccessible : public XULMenuitemAccessible public: enum { eAction_Click = 0 }; - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(XULListitemAccessible, + XULMenuitemAccessible) XULListitemAccessible(nsIContent* aContent, DocAccessible* aDoc); @@ -149,7 +150,8 @@ public: XULListCellAccessible(nsIContent* aContent, DocAccessible* aDoc); // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(XULListCellAccessible, + HyperTextAccessibleWrap) // Accessible virtual TableCellAccessible* AsTableCell() override { return this; } diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index 462c8ae110f2..491223c00eac 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1746,3 +1746,20 @@ pref("extensions.screenshots.disabled", false); // Preference that allows individual users to leave Screenshots enabled, but // disable uploading to the server. pref("extensions.screenshots.upload-disabled", false); + +// Preferences for BrowserErrorReporter.jsm +// Only collect errors on Nightly, and specifically not local builds +#if defined(NIGHTLY_BUILD) && MOZ_UPDATE_CHANNEL != default +pref("browser.chrome.errorReporter.enabled", true); +#else +pref("browser.chrome.errorReporter.enabled", false); +#endif +pref("browser.chrome.errorReporter.sampleRate", "0.001"); +pref("browser.chrome.errorReporter.publicKey", "c709cb7a2c0b4f0882fcc84a5af161ec"); +pref("browser.chrome.errorReporter.projectId", "339"); +pref("browser.chrome.errorReporter.submitUrl", "https://sentry.prod.mozaws.net/api/339/store/"); +pref("browser.chrome.errorReporter.logLevel", "Error"); + +// URL for Learn More link for browser error logging in preferences +pref("browser.chrome.errorReporter.infoURL", + "https://support.mozilla.org/1/firefox/%VERSION%/%OS%/%LOCALE%/nightly-error-collection"); diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 36ba40f8aeca..d1e0992f726b 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -88,6 +88,7 @@ XPCOMUtils.defineLazyModuleGetters(this, { AutoCompletePopup: "resource://gre/modules/AutoCompletePopup.jsm", BookmarkHTMLUtils: "resource://gre/modules/BookmarkHTMLUtils.jsm", BookmarkJSONUtils: "resource://gre/modules/BookmarkJSONUtils.jsm", + BrowserErrorReporter: "resource:///modules/BrowserErrorReporter.jsm", BrowserUITelemetry: "resource:///modules/BrowserUITelemetry.jsm", BrowserUsageTelemetry: "resource:///modules/BrowserUsageTelemetry.jsm", ContentClick: "resource:///modules/ContentClick.jsm", @@ -355,6 +356,16 @@ BrowserGlue.prototype = { return this.pingCentre; }, + /** + * Lazily initialize BrowserErrorReporter + */ + get browserErrorReporter() { + Object.defineProperty(this, "browserErrorReporter", { + value: new BrowserErrorReporter(), + }); + return this.browserErrorReporter; + }, + _sendMainPingCentrePing() { const ACTIVITY_STREAM_ENABLED_PREF = "browser.newtabpage.activity-stream.enabled"; const ACTIVITY_STREAM_ID = "activity-stream"; @@ -1055,6 +1066,11 @@ BrowserGlue.prototype = { NewTabUtils.uninit(); AutoCompletePopup.uninit(); DateTimePickerHelper.uninit(); + + // Browser errors are only collected on Nightly + if (AppConstants.NIGHTLY_BUILD && AppConstants.MOZ_DATA_REPORTING) { + this.browserErrorReporter.uninit(); + } }, // All initial windows have opened. @@ -1064,6 +1080,11 @@ BrowserGlue.prototype = { } this._windowsWereRestored = true; + // Browser errors are only collected on Nightly + if (AppConstants.NIGHTLY_BUILD && AppConstants.MOZ_DATA_REPORTING) { + this.browserErrorReporter.init(); + } + BrowserUsageTelemetry.init(); BrowserUITelemetry.init(); diff --git a/browser/components/preferences/in-content/privacy.js b/browser/components/preferences/in-content/privacy.js index 130473faa107..7dedcb90edf5 100644 --- a/browser/components/preferences/in-content/privacy.js +++ b/browser/components/preferences/in-content/privacy.js @@ -119,6 +119,9 @@ Preferences.addAll([ ]); // Data Choices tab +if (AppConstants.NIGHTLY_BUILD) { + Preferences.add({ id: "browser.chrome.errorCollection.enabled", type: "bool" }); +} if (AppConstants.MOZ_CRASHREPORTER) { Preferences.add({ id: "browser.crashReports.unsubmittedCheck.autoSubmit2", type: "bool" }); } @@ -410,6 +413,9 @@ var gPrivacyPane = { if (AppConstants.MOZ_DATA_REPORTING) { this.initDataCollection(); + if (AppConstants.NIGHTLY_BUILD) { + this.initCollectBrowserErrors(); + } if (AppConstants.MOZ_CRASHREPORTER) { this.initSubmitCrashes(); } @@ -1528,6 +1534,11 @@ var gPrivacyPane = { "dataCollectionPrivacyNotice"); }, + initCollectBrowserErrors() { + this._setupLearnMoreLink("browser.chrome.errorCollection.infoURL", + "collectBrowserErrorsLearnMore"); + }, + initSubmitCrashes() { this._setupLearnMoreLink("toolkit.crashreporter.infoURL", "crashReporterLearnMore"); @@ -1538,7 +1549,7 @@ var gPrivacyPane = { */ _setupLearnMoreLink(pref, element) { // set up the Learn More link with the correct URL - let url = Services.prefs.getCharPref(pref); + let url = Services.urlFormatter.formatURLPref(pref); let el = document.getElementById(element); if (url) { diff --git a/browser/components/preferences/in-content/privacy.xul b/browser/components/preferences/in-content/privacy.xul index 774f48b88518..58d73c813547 100644 --- a/browser/components/preferences/in-content/privacy.xul +++ b/browser/components/preferences/in-content/privacy.xul @@ -586,6 +586,18 @@ &healthReportingDisabled.label; #endif +#ifdef NIGHTLY_BUILD + + + + +#endif + #ifdef MOZ_CRASHREPORTER + + + + diff --git a/browser/modules/BrowserErrorReporter.jsm b/browser/modules/BrowserErrorReporter.jsm new file mode 100644 index 000000000000..a157e105b493 --- /dev/null +++ b/browser/modules/BrowserErrorReporter.jsm @@ -0,0 +1,214 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +ChromeUtils.import("resource://gre/modules/AppConstants.jsm"); +ChromeUtils.import("resource://gre/modules/Services.jsm"); +ChromeUtils.import("resource://gre/modules/Timer.jsm"); +ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm"); + +ChromeUtils.defineModuleGetter(this, "Log", "resource://gre/modules/Log.jsm"); +ChromeUtils.defineModuleGetter(this, "UpdateUtils", "resource://gre/modules/UpdateUtils.jsm"); + +Cu.importGlobalProperties(["fetch", "URL"]); + +this.EXPORTED_SYMBOLS = ["BrowserErrorReporter"]; + +const ERROR_PREFIX_RE = /^[^\W]+:/m; +const PREF_ENABLED = "browser.chrome.errorReporter.enabled"; +const PREF_LOG_LEVEL = "browser.chrome.errorReporter.logLevel"; +const PREF_PROJECT_ID = "browser.chrome.errorReporter.projectId"; +const PREF_PUBLIC_KEY = "browser.chrome.errorReporter.publicKey"; +const PREF_SAMPLE_RATE = "browser.chrome.errorReporter.sampleRate"; +const PREF_SUBMIT_URL = "browser.chrome.errorReporter.submitUrl"; + +// https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIScriptError#Categories +const REPORTED_CATEGORIES = new Set([ + "XPConnect JavaScript", + "component javascript", + "chrome javascript", + "chrome registration", + "XBL", + "XBL Prototype Handler", + "XBL Content Sink", + "xbl javascript", + "FrameConstructor", +]); + +/** + * Collects nsIScriptError messages logged to the browser console and reports + * them to a remotely-hosted error collection service. + * + * This is a PROTOTYPE; it will be removed in the future and potentially + * replaced with a more robust implementation. It is meant to only collect + * errors from Nightly (and local builds if enabled for development purposes) + * and has not been reviewed for use outside of Nightly. + * + * The outgoing requests are designed to be compatible with version 7 of Sentry. + */ +class BrowserErrorReporter { + constructor(fetchMethod = this._defaultFetch) { + // A fake fetch is passed by the tests to avoid network connections + this.fetch = fetchMethod; + + // Values that don't change between error reports. + this.requestBodyTemplate = { + request: { + headers: { + "User-Agent": Services.appShell.hiddenDOMWindow.navigator.userAgent, + }, + }, + logger: "javascript", + platform: "javascript", + release: Services.appinfo.version, + environment: UpdateUtils.getUpdateChannel(false), + tags: { + appBuildID: Services.appinfo.appBuildID, + changeset: AppConstants.SOURCE_REVISION_URL, + }, + }; + + XPCOMUtils.defineLazyPreferenceGetter( + this, + "collectionEnabled", + PREF_ENABLED, + false, + this.handleEnabledPrefChanged.bind(this), + ); + } + + /** + * Lazily-created logger + */ + get logger() { + const logger = Log.repository.getLogger("BrowserErrorReporter"); + logger.addAppender(new Log.ConsoleAppender(new Log.BasicFormatter())); + logger.manageLevelFromPref(PREF_LOG_LEVEL); + + Object.defineProperty(this, "logger", {value: logger}); + return this.logger; + } + + init() { + if (this.collectionEnabled) { + Services.console.registerListener(this); + + // Processing already-logged messages in case any errors occurred before + // startup. + for (const message of Services.console.getMessageArray()) { + this.observe(message); + } + } + } + + uninit() { + try { + Services.console.unregisterListener(this); + } catch (err) {} // It probably wasn't registered. + } + + handleEnabledPrefChanged(prefName, previousValue, newValue) { + if (newValue) { + Services.console.registerListener(this); + } else { + try { + Services.console.unregisterListener(this); + } catch (err) {} // It probably wasn't registered. + } + } + + async observe(message) { + try { + message.QueryInterface(Ci.nsIScriptError); + } catch (err) { + return; // Not an error + } + + const isWarning = message.flags & message.warningFlag; + const isFromChrome = REPORTED_CATEGORIES.has(message.category); + if (!isFromChrome || isWarning) { + return; + } + + // Sample the amount of errors we send out + const sampleRate = Number.parseFloat(Services.prefs.getCharPref(PREF_SAMPLE_RATE)); + if (!Number.isFinite(sampleRate) || (Math.random() >= sampleRate)) { + return; + } + + // Parse the error type from the message if present (e.g. "TypeError: Whoops"). + let errorMessage = message.errorMessage; + let errorName = "Error"; + if (message.errorMessage.match(ERROR_PREFIX_RE)) { + const parts = message.errorMessage.split(":"); + errorName = parts[0]; + errorMessage = parts.slice(1).join(":").trim(); + } + + // Pull and normalize stacktrace frames from the message + const frames = []; + let frame = message.stack; + + // Avoid an infinite loop by limiting traces to 100 frames. + while (frame && frames.length < 100) { + frames.push({ + function: frame.functionDisplayName, + filename: frame.source, + lineno: frame.line, + colno: frame.column, + in_app: true, + }); + frame = frame.parent; + } + + // Sentry-compatible request body copied from an example generated by Raven.js 3.22.1. + const requestBody = Object.assign({}, this.requestBodyTemplate, { + project: Services.prefs.getCharPref(PREF_PROJECT_ID), + exception: { + values: [ + { + type: errorName, + // Error messages may contain PII; see bug 1426482 for privacy + // review and server-side mitigation. + value: errorMessage, + stacktrace: { + frames, + } + }, + ], + }, + culprit: message.sourceName, + }); + requestBody.request.url = message.sourceName; + + const url = new URL(Services.prefs.getCharPref(PREF_SUBMIT_URL)); + url.searchParams.set("sentry_client", "firefox-error-reporter/1.0.0"); + url.searchParams.set("sentry_version", "7"); + url.searchParams.set("sentry_key", Services.prefs.getCharPref(PREF_PUBLIC_KEY)); + + try { + await this.fetch(url, { + method: "POST", + headers: { + "Content-Type": "application/json", + "Accept": "application/json", + }, + // Sentry throws an auth error without a referrer specified. + referrer: "https://fake.mozilla.org", + body: JSON.stringify(requestBody) + }); + this.logger.debug("Sent error successfully."); + } catch (error) { + this.logger.warn(`Failed to send error: ${error}`); + } + } + + async _defaultFetch(...args) { + // Do not make network requests while running in automation + if (Cu.isInAutomation) { + return null; + } + + return fetch(...args); + } +} diff --git a/browser/modules/moz.build b/browser/modules/moz.build index 56a176fe7265..9e487ed75967 100644 --- a/browser/modules/moz.build +++ b/browser/modules/moz.build @@ -123,6 +123,7 @@ EXTRA_JS_MODULES += [ 'AboutHome.jsm', 'AboutNewTab.jsm', 'AttributionCode.jsm', + 'BrowserErrorReporter.jsm', 'BrowserUITelemetry.jsm', 'BrowserUsageTelemetry.jsm', 'ContentClick.jsm', diff --git a/browser/modules/test/browser/browser.ini b/browser/modules/test/browser/browser.ini index a647fed35e4e..4f68ce7e234a 100644 --- a/browser/modules/test/browser/browser.ini +++ b/browser/modules/test/browser/browser.ini @@ -2,6 +2,9 @@ support-files = head.js +[browser_BrowserErrorReporter.js] +support-files = + browser_BrowserErrorReporter.html [browser_BrowserUITelemetry_buckets.js] skip-if = !e10s # Bug 1373549 [browser_BrowserUITelemetry_defaults.js] diff --git a/browser/modules/test/browser/browser_BrowserErrorReporter.html b/browser/modules/test/browser/browser_BrowserErrorReporter.html new file mode 100644 index 000000000000..6202bbae2abb --- /dev/null +++ b/browser/modules/test/browser/browser_BrowserErrorReporter.html @@ -0,0 +1,20 @@ + + + + + Test page + + + + + diff --git a/browser/modules/test/browser/browser_BrowserErrorReporter.js b/browser/modules/test/browser/browser_BrowserErrorReporter.js new file mode 100644 index 000000000000..3c7174fcfa53 --- /dev/null +++ b/browser/modules/test/browser/browser_BrowserErrorReporter.js @@ -0,0 +1,387 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +ChromeUtils.import("resource:///modules/BrowserErrorReporter.jsm", this); + +/* global sinon */ +Services.scriptloader.loadSubScript("resource://testing-common/sinon-2.3.2.js"); +registerCleanupFunction(function() { + delete window.sinon; +}); + +const PREF_ENABLED = "browser.chrome.errorReporter.enabled"; +const PREF_PROJECT_ID = "browser.chrome.errorReporter.projectId"; +const PREF_PUBLIC_KEY = "browser.chrome.errorReporter.publicKey"; +const PREF_SAMPLE_RATE = "browser.chrome.errorReporter.sampleRate"; +const PREF_SUBMIT_URL = "browser.chrome.errorReporter.submitUrl"; + +function createScriptError(options = {}) { + const scriptError = Cc["@mozilla.org/scripterror;1"].createInstance(Ci.nsIScriptError); + scriptError.init( + options.message || "", + options.sourceName || null, + options.sourceLine || null, + options.lineNumber || null, + options.columnNumber || null, + options.flags || Ci.nsIScriptError.errorFlag, + options.category || "chrome javascript", + ); + return scriptError; +} + +// Wrapper around Services.console.logMessage that waits for the message to be +// logged before resolving, since messages are logged asynchronously. +function logMessage(message) { + return new Promise(resolve => { + Services.console.registerListener({ + observe(loggedMessage) { + if (loggedMessage.message === message.message) { + Services.console.unregisterListener(this); + resolve(); + } + }, + }); + Services.console.logMessage(message); + }); +} + +// Wrapper similar to logMessage, but for logStringMessage. +function logStringMessage(message) { + return new Promise(resolve => { + Services.console.registerListener({ + observe(loggedMessage) { + if (loggedMessage.message === message) { + Services.console.unregisterListener(this); + resolve(); + } + }, + }); + Services.console.logStringMessage(message); + }); +} + +// Finds the fetch spy call for an error with a matching message. +function fetchCallForMessage(fetchSpy, message) { + for (const call of fetchSpy.getCalls()) { + const body = JSON.parse(call.args[1].body); + if (body.exception.values[0].value.includes(message)) { + return call; + } + } + + return null; +} + +// Helper to test if a fetch spy was called with the given error message. +// Used in tests where unrelated JS errors from other code are logged. +function fetchPassedError(fetchSpy, message) { + return fetchCallForMessage(fetchSpy, message) !== null; +} + +add_task(async function testInitPrefDisabled() { + const fetch = sinon.spy(); + const reporter = new BrowserErrorReporter(fetch); + await SpecialPowers.pushPrefEnv({set: [ + [PREF_ENABLED, false], + [PREF_SAMPLE_RATE, "1.0"], + ]}); + + reporter.init(); + await logMessage(createScriptError({message: "Logged while disabled"})); + ok( + !fetchPassedError(fetch, "Logged while disabled"), + "Reporter does not listen for errors if the enabled pref is false.", + ); + reporter.uninit(); +}); + +add_task(async function testInitUninitPrefEnabled() { + const fetch = sinon.spy(); + const reporter = new BrowserErrorReporter(fetch); + await SpecialPowers.pushPrefEnv({set: [ + [PREF_ENABLED, true], + [PREF_SAMPLE_RATE, "1.0"], + ]}); + + reporter.init(); + await logMessage(createScriptError({message: "Logged after init"})); + ok( + fetchPassedError(fetch, "Logged after init"), + "Reporter listens for errors if the enabled pref is true.", + ); + + fetch.reset(); + ok(!fetch.called, "Fetch spy was reset."); + reporter.uninit(); + await logMessage(createScriptError({message: "Logged after uninit"})); + ok( + !fetchPassedError(fetch, "Logged after uninit"), + "Reporter does not listen for errors after uninit.", + ); +}); + +add_task(async function testInitPastMessages() { + const fetch = sinon.spy(); + const reporter = new BrowserErrorReporter(fetch); + await SpecialPowers.pushPrefEnv({set: [ + [PREF_ENABLED, true], + [PREF_SAMPLE_RATE, "1.0"], + ]}); + + await logMessage(createScriptError({message: "Logged before init"})); + reporter.init(); + ok( + fetchPassedError(fetch, "Logged before init"), + "Reporter collects errors logged before initialization.", + ); + reporter.uninit(); +}); + +add_task(async function testEnabledPrefWatcher() { + const fetch = sinon.spy(); + const reporter = new BrowserErrorReporter(fetch); + await SpecialPowers.pushPrefEnv({set: [ + [PREF_ENABLED, false], + [PREF_SAMPLE_RATE, "1.0"], + ]}); + + reporter.init(); + await logMessage(createScriptError({message: "Shouldn't report"})); + ok( + !fetchPassedError(fetch, "Shouldn't report"), + "Reporter does not collect errors if the enable pref is false.", + ); + + await SpecialPowers.pushPrefEnv({set: [ + [PREF_ENABLED, true], + ]}); + ok( + !fetchPassedError(fetch, "Shouldn't report"), + "Reporter does not collect past-logged errors if it is enabled mid-run.", + ); + await logMessage(createScriptError({message: "Should report"})); + ok( + fetchPassedError(fetch, "Should report"), + "Reporter collects errors logged after the enabled pref is turned on mid-run", + ); + + reporter.uninit(); +}); + +add_task(async function testNonErrorLogs() { + const fetch = sinon.spy(); + const reporter = new BrowserErrorReporter(fetch); + await SpecialPowers.pushPrefEnv({set: [ + [PREF_ENABLED, true], + [PREF_SAMPLE_RATE, "1.0"], + ]}); + + reporter.init(); + + await logStringMessage("Not a scripterror instance."); + ok( + !fetchPassedError(fetch, "Not a scripterror instance."), + "Reporter does not collect normal log messages or warnings.", + ); + + await logMessage(createScriptError({ + message: "Warning message", + flags: Ci.nsIScriptError.warningFlag, + })); + ok( + !fetchPassedError(fetch, "Warning message"), + "Reporter does not collect normal log messages or warnings.", + ); + + await logMessage(createScriptError({ + message: "Non-chrome category", + category: "totally from a website", + })); + ok( + !fetchPassedError(fetch, "Non-chrome category"), + "Reporter does not collect normal log messages or warnings.", + ); + + await logMessage(createScriptError({message: "Is error"})); + ok( + fetchPassedError(fetch, "Is error"), + "Reporter collects error messages.", + ); + + reporter.uninit(); +}); + +add_task(async function testSampling() { + const fetch = sinon.spy(); + const reporter = new BrowserErrorReporter(fetch); + await SpecialPowers.pushPrefEnv({set: [ + [PREF_ENABLED, true], + [PREF_SAMPLE_RATE, "1.0"], + ]}); + + reporter.init(); + await logMessage(createScriptError({message: "Should log"})); + ok( + fetchPassedError(fetch, "Should log"), + "A 1.0 sample rate will cause the reporter to always collect errors.", + ); + + await SpecialPowers.pushPrefEnv({set: [ + [PREF_SAMPLE_RATE, "0.0"], + ]}); + await logMessage(createScriptError({message: "Shouldn't log"})); + ok( + !fetchPassedError(fetch, "Shouldn't log"), + "A 0.0 sample rate will cause the reporter to never collect errors.", + ); + + await SpecialPowers.pushPrefEnv({set: [ + [PREF_SAMPLE_RATE, ")fasdf"], + ]}); + await logMessage(createScriptError({message: "Also shouldn't log"})); + ok( + !fetchPassedError(fetch, "Also shouldn't log"), + "An invalid sample rate will cause the reporter to never collect errors.", + ); +}); + +add_task(async function testNameMessage() { + const fetch = sinon.spy(); + const reporter = new BrowserErrorReporter(fetch); + await SpecialPowers.pushPrefEnv({set: [ + [PREF_ENABLED, true], + [PREF_SAMPLE_RATE, "1.0"], + ]}); + + reporter.init(); + await logMessage(createScriptError({message: "No name"})); + let call = fetchCallForMessage(fetch, "No name"); + let body = JSON.parse(call.args[1].body); + is( + body.exception.values[0].type, + "Error", + "Reporter uses a generic type when no name is in the message.", + ); + is( + body.exception.values[0].value, + "No name", + "Reporter uses error message as the exception value.", + ); + + await logMessage(createScriptError({message: "FooError: Has name"})); + call = fetchCallForMessage(fetch, "Has name"); + body = JSON.parse(call.args[1].body); + is( + body.exception.values[0].type, + "FooError", + "Reporter uses the error type from the message.", + ); + is( + body.exception.values[0].value, + "Has name", + "Reporter uses error message as the value parameter.", + ); + + await logMessage(createScriptError({message: "FooError: Has :extra: colons"})); + call = fetchCallForMessage(fetch, "Has :extra: colons"); + body = JSON.parse(call.args[1].body); + is( + body.exception.values[0].type, + "FooError", + "Reporter uses the error type from the message.", + ); + is( + body.exception.values[0].value, + "Has :extra: colons", + "Reporter uses error message as the value parameter.", + ); + reporter.uninit(); +}); + +add_task(async function testFetchArguments() { + const fetch = sinon.spy(); + const reporter = new BrowserErrorReporter(fetch); + await SpecialPowers.pushPrefEnv({set: [ + [PREF_ENABLED, true], + [PREF_SAMPLE_RATE, "1.0"], + [PREF_PROJECT_ID, "123"], + [PREF_PUBLIC_KEY, "foobar"], + [PREF_SUBMIT_URL, "https://errors.example.com/api/123/store/"], + ]}); + + reporter.init(); + const testPageUrl = ( + "chrome://mochitests/content/browser/browser/modules/test/browser/" + + "browser_BrowserErrorReporter.html" + ); + const errorRaisedPromise = new Promise(resolve => { + Services.console.registerListener({ + observe(loggedMessage) { + if (loggedMessage.message.toString().includes("testFetchArguments error")) { + Services.console.unregisterListener(this); + resolve(); + } + }, + }); + }); + + SimpleTest.expectUncaughtException(); + await BrowserTestUtils.withNewTab(testPageUrl, async () => { + await errorRaisedPromise; + + const call = fetchCallForMessage(fetch, "testFetchArguments error"); + const body = JSON.parse(call.args[1].body); + const url = new URL(call.args[0]); + + is(url.origin, "https://errors.example.com", "Reporter builds API url from DSN pref."); + is(url.pathname, "/api/123/store/", "Reporter builds API url from DSN pref."); + is( + url.searchParams.get("sentry_client"), + "firefox-error-reporter/1.0.0", + "Reporter identifies itself in the outgoing request", + ); + is(url.searchParams.get("sentry_version"), "7", "Reporter is compatible with Sentry 7."); + is(url.searchParams.get("sentry_key"), "foobar", "Reporter pulls API key from DSN pref."); + is(body.project, "123", "Reporter pulls project ID from DSN pref."); + is(call.args[1].referrer, "https://fake.mozilla.org", "Reporter uses a fake referer."); + + Assert.deepEqual( + body.exception, + { + values: [ + { + type: "Error", + value: "testFetchArguments error", + stacktrace: { + frames: [ + { + function: "madeToFail2", + filename: testPageUrl, + lineno: 15, + colno: 15, + in_app: true, + }, + { + function: "madeToFail", + filename: testPageUrl, + lineno: 12, + colno: 9, + in_app: true, + }, + { + function: null, + filename: testPageUrl, + lineno: 17, + colno: 7, + in_app: true, + } + ] + } + } + ] + }, + "Reporter builds stack trace from scriptError correctly.", + ); + }); +}); diff --git a/devtools/client/debugger/debugger-controller.js b/devtools/client/debugger/debugger-controller.js index dab342181539..85c315ed36af 100644 --- a/devtools/client/debugger/debugger-controller.js +++ b/devtools/client/debugger/debugger-controller.js @@ -1171,7 +1171,28 @@ StackFrames.prototype = { Parser.reflectionAPI.parse(aString); return aString; // Watch expression can be executed safely. } catch (e) { - return "\"" + e.name + ": " + e.message + "\""; // Syntax error. + function safelyEscape(aString) { + // Convert `str`, a string, to JSON -- that is, to a string beginning + // and ending with double-quotes, followed by string contents escaped + // such that the overall string contents are a JSON string literal. + let str = JSON.stringify(aString); + + // Remove the leading and trailing double-quotes. + str = str.substring(1, str.length - 1); + + // JSON string literals are not a subset of JS string literals in this + // one weird case: JSON string literals can directly contain U+2028 + // LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR. Replace these code + // points with escaped forms. + str = str.replace(/\u2028/g, "\\u2028"); + str = str.replace(/\u2029/g, "\\u2029"); + + return str; + } + return "\"" + + safelyEscape(e.name) + ": " + + safelyEscape(e.message) + + "\""; // Syntax error. } }); diff --git a/devtools/client/debugger/test/mochitest/browser_dbg_watch-expressions-02.js b/devtools/client/debugger/test/mochitest/browser_dbg_watch-expressions-02.js index b07b0df638d7..5a8103335de4 100644 --- a/devtools/client/debugger/test/mochitest/browser_dbg_watch-expressions-02.js +++ b/devtools/client/debugger/test/mochitest/browser_dbg_watch-expressions-02.js @@ -38,38 +38,77 @@ function test() { }); }); + let totalExpressionsAdded = 0; + function addExpressions() { + function addExpression(aExpression) { + gWatch.addExpression(aExpression); + ++totalExpressionsAdded; + } + + is(totalExpressionsAdded, 0, "addExpressions must only be called once"); + + // The order in which expressions are added here almost doesn't matter for + // this test's purposes. (Excepting only the position of the final test.) + // Use the same order as in `checkWatchExpressions` for simplicity. + addExpression("'a'"); + addExpression("\"a\""); + addExpression("'a\"\"'"); + addExpression("\"a''\""); + addExpression("?"); + addExpression("a"); + addExpression("this"); + addExpression("this.canada"); + addExpression("[1, 2, 3]"); + addExpression("x = [1, 2, 3]"); + addExpression("y = [1, 2, 3]; y.test = 4"); + addExpression("z = [1, 2, 3]; z.test = 4; z"); + addExpression("t = [1, 2, 3]; t.test = 4; !t"); + addExpression("arguments[0]"); + addExpression("encodeURI(\"\\\")"); + addExpression("decodeURI(\"\\\")"); + addExpression("decodeURIComponent(\"%\")"); + addExpression("//"); + addExpression("// 42"); + addExpression("{}.foo"); + addExpression("{}.foo()"); + addExpression("({}).foo()"); + addExpression("new Array(-1)"); + addExpression("4.2.toExponential(-4.2)"); + addExpression("throw new Error(\"bazinga\")"); + addExpression("({ get error() { throw new Error(\"bazinga\") } }).error"); + // https://bugzilla.mozilla.org/show_bug.cgi?id=1205353 // BZ#1205353 - wrong result for string replace with backslash-dollar. - gWatch.addExpression("'$$$'.replace(/\\$/, 'foo')"); - gWatch.addExpression("'a'"); - gWatch.addExpression("\"a\""); - gWatch.addExpression("'a\"\"'"); - gWatch.addExpression("\"a''\""); - gWatch.addExpression("?"); - gWatch.addExpression("a"); - gWatch.addExpression("this"); - gWatch.addExpression("this.canada"); - gWatch.addExpression("[1, 2, 3]"); - gWatch.addExpression("x = [1, 2, 3]"); - gWatch.addExpression("y = [1, 2, 3]; y.test = 4"); - gWatch.addExpression("z = [1, 2, 3]; z.test = 4; z"); - gWatch.addExpression("t = [1, 2, 3]; t.test = 4; !t"); - gWatch.addExpression("arguments[0]"); - gWatch.addExpression("encodeURI(\"\\\")"); - gWatch.addExpression("decodeURI(\"\\\")"); - gWatch.addExpression("decodeURIComponent(\"%\")"); - gWatch.addExpression("//"); - gWatch.addExpression("// 42"); - gWatch.addExpression("{}.foo"); - gWatch.addExpression("{}.foo()"); - gWatch.addExpression("({}).foo()"); - gWatch.addExpression("new Array(-1)"); - gWatch.addExpression("4.2.toExponential(-4.2)"); - gWatch.addExpression("throw new Error(\"bazinga\")"); - gWatch.addExpression("({ get error() { throw new Error(\"bazinga\") } }).error"); - gWatch.addExpression("throw { get name() { throw \"bazinga\" } }"); + addExpression("'$$$'.replace(/\\$/, 'foo')"); + // Functions with parameters that aren't just a simple series of names can't + // be made strict mode code by adding 'use strict'. The resulting syntax + // error message currently contains U+022 QUOTATION MARK characters that + // DebuggerController.StackFrames.syncWatchExpressions at one time + // mishandled: test that handling here. + addExpression("function x(a = 3) { 'use strict'; } 'NOT EVALUATED'"); + addExpression("function y(...b) { 'use strict'; } 'NOT EVALUATED'"); + addExpression("function z([]) { 'use strict'; } 'NOT EVALUATED'"); + addExpression("function w({}) { 'use strict'; } 'NOT EVALUATED'"); + + // Add a working expression to verify that earlier failing expressions don't + // halt stuff. + addExpression("42"); + + // For the moment, this watch-expression must be last: by throwing an object + // with a .name that throws, it (intentionally?) mucks with the mini-script + // consed up in DebuggerController.StackFrames.syncWatchExpressions for + // eventual evaluation, and subsequent `addExpression` calls will have no + // effect. + // + // This watch-expression appears initially to be added as a hidden + // expression -- but at first breakpoint it appears to be silently removed, + // hence the `totalExpressionsAdded - 1` in test1 (with lingering effects on + // the rest of this test). + addExpression("throw { get name() { throw \"bazinga\" } }"); + + is(totalExpressionsAdded, 33, "handy-dandy count-verifying assertion"); } function performTest() { @@ -77,8 +116,8 @@ function test() { is(gDebugger.document.querySelectorAll(".dbg-expression[hidden=true]").length, 0, "There should be 0 hidden nodes in the watch expressions container"); - is(gDebugger.document.querySelectorAll(".dbg-expression:not([hidden=true])").length, 28, - "There should be 28 visible nodes in the watch expressions container"); + is(gDebugger.document.querySelectorAll(".dbg-expression:not([hidden=true])").length, totalExpressionsAdded, + "There should be " + totalExpressionsAdded + " visible nodes in the watch expressions container"); test1(function () { test2(function () { @@ -106,13 +145,13 @@ function test() { function finishTest() { is(gDebugger.document.querySelectorAll(".dbg-expression[hidden=true]").length, 0, "There should be 0 hidden nodes in the watch expressions container"); - is(gDebugger.document.querySelectorAll(".dbg-expression:not([hidden=true])").length, 28, - "There should be 28 visible nodes in the watch expressions container"); + is(gDebugger.document.querySelectorAll(".dbg-expression:not([hidden=true])").length, totalExpressionsAdded, + "There should be " + totalExpressionsAdded + " visible nodes in the watch expressions container"); } function test1(aCallback) { gDebugger.once(gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS, () => { - checkWatchExpressions(27, { + checkWatchExpressions(totalExpressionsAdded - 1, { a: "ReferenceError: a is not defined", this: { type: "object", class: "Object" }, prop: { type: "object", class: "String" }, @@ -126,7 +165,7 @@ function test() { function test2(aCallback) { gDebugger.once(gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS, () => { - checkWatchExpressions(27, { + checkWatchExpressions(totalExpressionsAdded - 1, { a: { type: "undefined" }, this: { type: "object", class: "Window" }, prop: { type: "undefined" }, @@ -142,7 +181,7 @@ function test() { function test3(aCallback) { gDebugger.once(gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS, () => { - checkWatchExpressions(27, { + checkWatchExpressions(totalExpressionsAdded - 1, { a: { type: "object", class: "Object" }, this: { type: "object", class: "Window" }, prop: { type: "undefined" }, @@ -158,7 +197,7 @@ function test() { function test4(aCallback) { gDebugger.once(gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS, () => { - checkWatchExpressions(28, { + checkWatchExpressions(totalExpressionsAdded, { a: 5, this: { type: "object", class: "Window" }, prop: { type: "undefined" }, @@ -173,7 +212,7 @@ function test() { function test5(aCallback) { gDebugger.once(gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS, () => { - checkWatchExpressions(28, { + checkWatchExpressions(totalExpressionsAdded, { a: 5, this: { type: "object", class: "Window" }, prop: { type: "undefined" }, @@ -188,7 +227,7 @@ function test() { function test6(aCallback) { gDebugger.once(gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS, () => { - checkWatchExpressions(28, { + checkWatchExpressions(totalExpressionsAdded, { a: 5, this: { type: "object", class: "Window" }, prop: { type: "undefined" }, @@ -203,7 +242,7 @@ function test() { function test7(aCallback) { gDebugger.once(gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS, () => { - checkWatchExpressions(28, { + checkWatchExpressions(totalExpressionsAdded, { a: 5, this: { type: "object", class: "Window" }, prop: { type: "undefined" }, @@ -218,7 +257,7 @@ function test() { function test8(aCallback) { gDebugger.once(gDebugger.EVENTS.FETCHED_WATCH_EXPRESSIONS, () => { - checkWatchExpressions(28, { + checkWatchExpressions(totalExpressionsAdded, { a: 5, this: { type: "object", class: "Window" }, prop: { type: "undefined" }, @@ -257,8 +296,8 @@ function test() { let label = gDebugger.L10N.getStr("watchExpressionsScopeLabel"); let scope = gVariables._currHierarchy.get(label); - ok(scope, "There should be a wach expressions scope in the variables view."); - is(scope._store.size, aTotal, "There should be " + aTotal + " evaluations availalble."); + ok(scope, "There should be a watch expressions scope in the variables view."); + is(scope._store.size, aTotal, "There should be " + aTotal + " evaluations available."); let w1 = scope.get("'a'"); let w2 = scope.get("\"a\""); @@ -286,8 +325,16 @@ function test() { let w24 = scope.get("4.2.toExponential(-4.2)"); let w25 = scope.get("throw new Error(\"bazinga\")"); let w26 = scope.get("({ get error() { throw new Error(\"bazinga\") } }).error"); - let w27 = scope.get("throw { get name() { throw \"bazinga\" } }"); - let w28 = scope.get("'$$$'.replace(/\\$/, 'foo')"); + let w27 = scope.get("'$$$'.replace(/\\$/, 'foo')"); + let w28 = scope.get("function x(a = 3) { 'use strict'; } 'NOT EVALUATED'"); + let w29 = scope.get("function y(...b) { 'use strict'; } 'NOT EVALUATED'"); + let w30 = scope.get("function z([]) { 'use strict'; } 'NOT EVALUATED'"); + let w31 = scope.get("function w({}) { 'use strict'; } 'NOT EVALUATED'"); + let w32 = scope.get("42"); + + // This doesn't *have* to be last -- these could be in any order -- but keep + // it last for consistency with `addExpressions`. + let w33 = scope.get("throw { get name() { throw \"bazinga\" } }"); ok(w1, "The first watch expression should be present in the scope."); ok(w2, "The second watch expression should be present in the scope."); @@ -315,8 +362,15 @@ function test() { ok(w24, "The 24th watch expression should be present in the scope."); ok(w25, "The 25th watch expression should be present in the scope."); ok(w26, "The 26th watch expression should be present in the scope."); - ok(!w27, "The 27th watch expression should not be present in the scope."); + ok(w27, "The 27th watch expression should be present in the scope."); ok(w28, "The 28th watch expression should be present in the scope."); + ok(w29, "The 29th watch expression should be present in the scope."); + ok(w30, "The 30th watch expression should be present in the scope."); + ok(w31, "The 31st watch expression should be present in the scope."); + ok(w32, "The 32nd watch expression should be present in the scope."); + + // Keep this last for consistency with `addExpressions`. + ok(!w33, "The 33rd watch expression should not be present in the scope."); is(w1.value, "a", "The first value is correct."); is(w2.value, "a", "The second value is correct."); @@ -361,8 +415,8 @@ function test() { is(w14.value, expected_args, "The 14th value is correct."); } - is(w15.value, "SyntaxError: unterminated string literal", "The 15th value is correct."); - is(w16.value, "SyntaxError: unterminated string literal", "The 16th value is correct."); + is(w15.value, "SyntaxError: \"\" literal not terminated before end of script", "The 15th value is correct."); + is(w16.value, "SyntaxError: \"\" literal not terminated before end of script", "The 16th value is correct."); is(w17.value, "URIError: malformed URI sequence", "The 17th value is correct."); is(w18.value.type, "undefined", "The 18th value type is correct."); @@ -378,6 +432,17 @@ function test() { is(w24.value, "RangeError: precision -4 out of range", "The 24th value is correct."); is(w25.value, "Error: bazinga", "The 25th value is correct."); is(w26.value, "Error: bazinga", "The 26th value is correct."); - is(w28.value, "foo$$", "The 28th value is correct."); + is(w27.value, "foo$$", "The 27th value is correct."); + + is(w28.value, "SyntaxError: \"use strict\" not allowed in function with default parameter", + "The 29th value is correct."); + is(w29.value, "SyntaxError: \"use strict\" not allowed in function with rest parameter", + "The 29th value is correct."); + is(w30.value, "SyntaxError: \"use strict\" not allowed in function with destructuring parameter", + "The 30th value is correct."); + is(w31.value, "SyntaxError: \"use strict\" not allowed in function with destructuring parameter", + "The 31st value is correct."); + + is(w32.value, 42, "The 32nd value is correct."); } } diff --git a/docshell/base/nsRefreshTimer.cpp b/docshell/base/nsRefreshTimer.cpp index f355aa7f6361..7ee39ac8db2e 100644 --- a/docshell/base/nsRefreshTimer.cpp +++ b/docshell/base/nsRefreshTimer.cpp @@ -18,7 +18,7 @@ NS_INTERFACE_MAP_BEGIN(nsRefreshTimer) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsITimerCallback) NS_INTERFACE_MAP_ENTRY(nsITimerCallback) NS_INTERFACE_MAP_ENTRY(nsINamed) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END nsRefreshTimer::nsRefreshTimer(nsDocShell* aDocShell, nsIURI* aURI, diff --git a/dom/asmjscache/AsmJSCache.cpp b/dom/asmjscache/AsmJSCache.cpp index a7e2fe2332fe..2ce6326aa3f9 100644 --- a/dom/asmjscache/AsmJSCache.cpp +++ b/dom/asmjscache/AsmJSCache.cpp @@ -433,6 +433,8 @@ class ParentRunnable final , public PAsmJSCacheEntryParent { public: + // We need to always declare refcounting because + // OpenDirectoryListener has pure-virtual refcounting. NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIRUNNABLE diff --git a/dom/base/DOMPrefsInternal.h b/dom/base/DOMPrefsInternal.h index 463babfc2ef6..94d6a1073141 100644 --- a/dom/base/DOMPrefsInternal.h +++ b/dom/base/DOMPrefsInternal.h @@ -39,6 +39,7 @@ DOM_PREF(NetworkInformationEnabled, "dom.netinfo.enabled") DOM_PREF(FetchObserverEnabled, "dom.fetchObserver.enabled") DOM_PREF(ResistFingerprintingEnabled, "privacy.resistFingerprinting") DOM_PREF(DevToolsEnabled, "devtools.enabled") +DOM_PREF(PerformanceObserverEnabled, "dom.enable_performance_observer") DOM_WEBIDL_PREF(ImageBitmapExtensionsEnabled) DOM_WEBIDL_PREF(DOMCachesEnabled) @@ -54,3 +55,4 @@ DOM_WEBIDL_PREF(OffscreenCanvasEnabled) DOM_WEBIDL_PREF(WebkitBlinkDirectoryPickerEnabled) DOM_WEBIDL_PREF(NetworkInformationEnabled) DOM_WEBIDL_PREF(FetchObserverEnabled) +DOM_WEBIDL_PREF(PerformanceObserverEnabled) diff --git a/dom/base/IDTracker.h b/dom/base/IDTracker.h index 512993410508..c431c9d2686b 100644 --- a/dom/base/IDTracker.h +++ b/dom/base/IDTracker.h @@ -140,6 +140,8 @@ private: , mTo(aTo) {} + // We need to actually declare all of nsISupports, because + // Notification inherits from it but doesn't declare it. NS_DECL_ISUPPORTS_INHERITED NS_IMETHOD Run() override { if (mTarget) { diff --git a/dom/base/ImageEncoder.cpp b/dom/base/ImageEncoder.cpp index 90db0c55cb01..bd7948e12844 100644 --- a/dom/base/ImageEncoder.cpp +++ b/dom/base/ImageEncoder.cpp @@ -145,7 +145,7 @@ class EncodingRunnable : public Runnable virtual ~EncodingRunnable() {} public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(EncodingRunnable, Runnable) EncodingRunnable(const nsAString& aType, const nsAString& aOptions, @@ -243,8 +243,6 @@ private: bool mUsingCustomOptions; }; -NS_IMPL_ISUPPORTS_INHERITED0(EncodingRunnable, Runnable); - StaticRefPtr ImageEncoder::sThreadPool; /* static */ diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index 143669eea97c..93069ac4a8b8 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -871,7 +871,8 @@ CreateInterfacePrototypeObject(JSContext* cx, JS::Handle global, } if (unscopableNames) { - JS::Rooted unscopableObj(cx, JS_NewPlainObject(cx)); + JS::Rooted unscopableObj(cx, + JS_NewObjectWithGivenProto(cx, nullptr, nullptr)); if (!unscopableObj) { return nullptr; } diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py index 0fdc1f715b0f..fbf173ddcecd 100644 --- a/dom/bindings/Codegen.py +++ b/dom/bindings/Codegen.py @@ -17851,9 +17851,17 @@ class CGEventClass(CGBindingImplClass): CGBindingImplClass.__init__(self, descriptor, CGEventMethod, CGEventGetter, CGEventSetter, False, "WrapObjectInternal") members = [] extraMethods = [] + self.membersNeedingCC = [] + self.membersNeedingTrace = [] + for m in descriptor.interface.members: + if getattr(m, "originatingInterface", + descriptor.interface) != descriptor.interface: + continue + if m.isAttr(): if m.type.isAny(): + self.membersNeedingTrace.append(m) # Add a getter that doesn't need a JSContext. Note that we # don't need to do this if our originating interface is not # the descriptor's interface, because in that case we @@ -17872,9 +17880,16 @@ class CGEventClass(CGBindingImplClass): aRetVal.set(${memberName}); """, memberName=CGDictionary.makeMemberName(m.identifier.name)))) - if getattr(m, "originatingInterface", - descriptor.interface) != descriptor.interface: - continue + elif (m.type.isObject() or + m.type.isSpiderMonkeyInterface()): + self.membersNeedingTrace.append(m) + elif typeNeedsRooting(m.type): + raise TypeError( + "Need to implement tracing for event member of type %s" % + m.type) + elif idlTypeNeedsCycleCollection(m.type): + self.membersNeedingCC.append(m) + nativeType = self.getNativeTypeForIDLType(m.type).define() members.append(ClassMember(CGDictionary.makeMemberName(m.identifier.name), nativeType, @@ -17883,20 +17898,39 @@ class CGEventClass(CGBindingImplClass): parent = self.descriptor.interface.parent self.parentType = self.descriptor.getDescriptor(parent.identifier.name).nativeType.split('::')[-1] + self.nativeType = self.descriptor.nativeType.split('::')[-1] + + if self.needCC(): + isupportsDecl = fill( + """ + NS_DECL_ISUPPORTS_INHERITED + NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(${nativeType}, ${parentType}) + """, + nativeType=self.nativeType, + parentType=self.parentType) + else: + isupportsDecl = fill( + """ + NS_INLINE_DECL_REFCOUNTING_INHERITED(${nativeType}, ${parentType}) + """, + nativeType=self.nativeType, + parentType=self.parentType) + baseDeclarations = fill( """ public: - NS_DECL_ISUPPORTS_INHERITED - NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(${nativeType}, ${parentType}) + $*{isupportsDecl} + protected: virtual ~${nativeType}(); explicit ${nativeType}(mozilla::dom::EventTarget* aOwner); """, - nativeType=self.descriptor.nativeType.split('::')[-1], + isupportsDecl=isupportsDecl, + nativeType=self.nativeType, parentType=self.parentType) - className = descriptor.nativeType.split('::')[-1] + className = self.nativeType asConcreteTypeMethod = ClassMethod("As%s" % className, "%s*" % className, [], @@ -17915,81 +17949,91 @@ class CGEventClass(CGBindingImplClass): def getWrapObjectBody(self): return "return %sBinding::Wrap(aCx, this, aGivenProto);\n" % self.descriptor.name + def needCC(self): + return (len(self.membersNeedingCC) != 0 or + len(self.membersNeedingTrace) != 0) + def implTraverse(self): retVal = "" - for m in self.descriptor.interface.members: - # Unroll the type so we pick up sequences of interfaces too. - if m.isAttr() and idlTypeNeedsCycleCollection(m.type): - retVal += (" NS_IMPL_CYCLE_COLLECTION_TRAVERSE(" + - CGDictionary.makeMemberName(m.identifier.name) + - ")\n") + for m in self.membersNeedingCC: + retVal += (" NS_IMPL_CYCLE_COLLECTION_TRAVERSE(%s)\n" % + CGDictionary.makeMemberName(m.identifier.name)) return retVal def implUnlink(self): retVal = "" - for m in self.descriptor.interface.members: - if m.isAttr(): - name = CGDictionary.makeMemberName(m.identifier.name) - # Unroll the type so we pick up sequences of interfaces too. - if idlTypeNeedsCycleCollection(m.type): - retVal += " NS_IMPL_CYCLE_COLLECTION_UNLINK(" + name + ")\n" - elif m.type.isAny(): - retVal += " tmp->" + name + ".setUndefined();\n" - elif m.type.isObject() or m.type.isSpiderMonkeyInterface(): - retVal += " tmp->" + name + " = nullptr;\n" + for m in self.membersNeedingCC: + retVal += (" NS_IMPL_CYCLE_COLLECTION_UNLINK(%s)\n" % + CGDictionary.makeMemberName(m.identifier.name)) + for m in self.membersNeedingTrace: + name = CGDictionary.makeMemberName(m.identifier.name) + if m.type.isAny(): + retVal += " tmp->" + name + ".setUndefined();\n" + elif m.type.isObject() or m.type.isSpiderMonkeyInterface(): + retVal += " tmp->" + name + " = nullptr;\n" + else: + raise TypeError("Unknown traceable member type %s" % m.type) return retVal def implTrace(self): retVal = "" - for m in self.descriptor.interface.members: - if m.isAttr(): - name = CGDictionary.makeMemberName(m.identifier.name) - if m.type.isAny() or m.type.isObject() or m.type.isSpiderMonkeyInterface(): - retVal += " NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(" + name + ")\n" - elif typeNeedsRooting(m.type): - raise TypeError("Need to implement tracing for event " - "member of type %s" % m.type) + for m in self.membersNeedingTrace: + retVal += (" NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(%s)\n" % + CGDictionary.makeMemberName(m.identifier.name)) return retVal def define(self): dropJS = "" - for m in self.descriptor.interface.members: - if m.isAttr(): - member = CGDictionary.makeMemberName(m.identifier.name) - if m.type.isAny(): - dropJS += member + " = JS::UndefinedValue();\n" - elif m.type.isObject() or m.type.isSpiderMonkeyInterface(): - dropJS += member + " = nullptr;\n" + for m in self.membersNeedingTrace: + member = CGDictionary.makeMemberName(m.identifier.name) + if m.type.isAny(): + dropJS += member + " = JS::UndefinedValue();\n" + elif m.type.isObject() or m.type.isSpiderMonkeyInterface(): + dropJS += member + " = nullptr;\n" + else: + raise TypeError("Unknown traceable member type %s" % m.type) + if dropJS != "": dropJS += "mozilla::DropJSObjects(this);\n" # Just override CGClass and do our own thing - nativeType = self.descriptor.nativeType.split('::')[-1] ctorParams = ("aOwner, nullptr, nullptr" if self.parentType == "Event" else "aOwner") - classImpl = fill( + if self.needCC(): + classImpl = fill( + """ + + NS_IMPL_CYCLE_COLLECTION_CLASS(${nativeType}) + + NS_IMPL_ADDREF_INHERITED(${nativeType}, ${parentType}) + NS_IMPL_RELEASE_INHERITED(${nativeType}, ${parentType}) + + NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(${nativeType}, ${parentType}) + $*{traverse} + NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END + + NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(${nativeType}, ${parentType}) + $*{trace} + NS_IMPL_CYCLE_COLLECTION_TRACE_END + + NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(${nativeType}, ${parentType}) + $*{unlink} + NS_IMPL_CYCLE_COLLECTION_UNLINK_END + + NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(${nativeType}) + NS_INTERFACE_MAP_END_INHERITING(${parentType}) + """, + nativeType=self.nativeType, + parentType=self.parentType, + traverse=self.implTraverse(), + unlink=self.implUnlink(), + trace=self.implTrace()) + else: + classImpl = "" + + classImpl += fill( """ - NS_IMPL_CYCLE_COLLECTION_CLASS(${nativeType}) - - NS_IMPL_ADDREF_INHERITED(${nativeType}, ${parentType}) - NS_IMPL_RELEASE_INHERITED(${nativeType}, ${parentType}) - - NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(${nativeType}, ${parentType}) - $*{traverse} - NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END - - NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(${nativeType}, ${parentType}) - $*{trace} - NS_IMPL_CYCLE_COLLECTION_TRACE_END - - NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(${nativeType}, ${parentType}) - $*{unlink} - NS_IMPL_CYCLE_COLLECTION_UNLINK_END - - NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(${nativeType}) - NS_INTERFACE_MAP_END_INHERITING(${parentType}) - ${nativeType}::${nativeType}(mozilla::dom::EventTarget* aOwner) : ${parentType}(${ctorParams}) { @@ -18001,14 +18045,11 @@ class CGEventClass(CGBindingImplClass): } """, - ifaceName=self.descriptor.name, - nativeType=nativeType, + nativeType=self.nativeType, ctorParams=ctorParams, parentType=self.parentType, - traverse=self.implTraverse(), - unlink=self.implUnlink(), - trace=self.implTrace(), dropJS=dropJS) + return classImpl + CGBindingImplClass.define(self) def getNativeTypeForIDLType(self, type): diff --git a/dom/events/AnimationEvent.cpp b/dom/events/AnimationEvent.cpp index 74e5d8221ef1..3e71dffecffa 100644 --- a/dom/events/AnimationEvent.cpp +++ b/dom/events/AnimationEvent.cpp @@ -26,12 +26,6 @@ AnimationEvent::AnimationEvent(EventTarget* aOwner, } } -NS_INTERFACE_MAP_BEGIN(AnimationEvent) -NS_INTERFACE_MAP_END_INHERITING(Event) - -NS_IMPL_ADDREF_INHERITED(AnimationEvent, Event) -NS_IMPL_RELEASE_INHERITED(AnimationEvent, Event) - //static already_AddRefed AnimationEvent::Constructor(const GlobalObject& aGlobal, diff --git a/dom/events/AnimationEvent.h b/dom/events/AnimationEvent.h index 194dbf264711..3dd58403a4de 100644 --- a/dom/events/AnimationEvent.h +++ b/dom/events/AnimationEvent.h @@ -21,7 +21,7 @@ public: nsPresContext* aPresContext, InternalAnimationEvent* aEvent); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(AnimationEvent, Event) static already_AddRefed Constructor(const GlobalObject& aGlobal, diff --git a/dom/events/BeforeUnloadEvent.cpp b/dom/events/BeforeUnloadEvent.cpp index 3a8ac91126da..02b4026eca6e 100644 --- a/dom/events/BeforeUnloadEvent.cpp +++ b/dom/events/BeforeUnloadEvent.cpp @@ -9,12 +9,6 @@ namespace mozilla { namespace dom { -NS_IMPL_ADDREF_INHERITED(BeforeUnloadEvent, Event) -NS_IMPL_RELEASE_INHERITED(BeforeUnloadEvent, Event) - -NS_INTERFACE_MAP_BEGIN(BeforeUnloadEvent) -NS_INTERFACE_MAP_END_INHERITING(Event) - void BeforeUnloadEvent::SetReturnValue(const nsAString& aReturnValue) { diff --git a/dom/events/BeforeUnloadEvent.h b/dom/events/BeforeUnloadEvent.h index 5a4922bcf8f4..3fd9bcce278b 100644 --- a/dom/events/BeforeUnloadEvent.h +++ b/dom/events/BeforeUnloadEvent.h @@ -33,7 +33,7 @@ public: return BeforeUnloadEventBinding::Wrap(aCx, this, aGivenProto); } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(BeforeUnloadEvent, Event) void GetReturnValue(nsAString& aReturnValue); void SetReturnValue(const nsAString& aReturnValue); diff --git a/dom/events/CommandEvent.cpp b/dom/events/CommandEvent.cpp index 47b45c733df4..ddad7ed9a3b0 100644 --- a/dom/events/CommandEvent.cpp +++ b/dom/events/CommandEvent.cpp @@ -26,12 +26,6 @@ CommandEvent::CommandEvent(EventTarget* aOwner, } } -NS_INTERFACE_MAP_BEGIN(CommandEvent) -NS_INTERFACE_MAP_END_INHERITING(Event) - -NS_IMPL_ADDREF_INHERITED(CommandEvent, Event) -NS_IMPL_RELEASE_INHERITED(CommandEvent, Event) - void CommandEvent::GetCommand(nsAString& aCommand) { diff --git a/dom/events/CommandEvent.h b/dom/events/CommandEvent.h index 6c655c32687b..1a98afc807e3 100644 --- a/dom/events/CommandEvent.h +++ b/dom/events/CommandEvent.h @@ -21,7 +21,7 @@ public: nsPresContext* aPresContext, WidgetCommandEvent* aEvent); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(CommandEvent, Event) virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { diff --git a/dom/events/InputEvent.cpp b/dom/events/InputEvent.cpp index d230ace39ec8..c532f21bb5be 100644 --- a/dom/events/InputEvent.cpp +++ b/dom/events/InputEvent.cpp @@ -29,12 +29,6 @@ InputEvent::InputEvent(EventTarget* aOwner, } } -NS_IMPL_ADDREF_INHERITED(InputEvent, UIEvent) -NS_IMPL_RELEASE_INHERITED(InputEvent, UIEvent) - -NS_INTERFACE_MAP_BEGIN(InputEvent) -NS_INTERFACE_MAP_END_INHERITING(UIEvent) - bool InputEvent::IsComposing() { diff --git a/dom/events/InputEvent.h b/dom/events/InputEvent.h index 3e0e9361df49..1d7df65eff65 100644 --- a/dom/events/InputEvent.h +++ b/dom/events/InputEvent.h @@ -21,7 +21,7 @@ public: nsPresContext* aPresContext, InternalEditorInputEvent* aEvent); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(InputEvent, UIEvent) // Forward to base class NS_FORWARD_TO_UIEVENT diff --git a/dom/events/KeyboardEvent.cpp b/dom/events/KeyboardEvent.cpp index c1eae9ff6866..2e0aace936d5 100644 --- a/dom/events/KeyboardEvent.cpp +++ b/dom/events/KeyboardEvent.cpp @@ -31,12 +31,6 @@ KeyboardEvent::KeyboardEvent(EventTarget* aOwner, } } -NS_IMPL_ADDREF_INHERITED(KeyboardEvent, UIEvent) -NS_IMPL_RELEASE_INHERITED(KeyboardEvent, UIEvent) - -NS_INTERFACE_MAP_BEGIN(KeyboardEvent) -NS_INTERFACE_MAP_END_INHERITING(UIEvent) - bool KeyboardEvent::AltKey(CallerType aCallerType) { diff --git a/dom/events/KeyboardEvent.h b/dom/events/KeyboardEvent.h index 347c4d57b108..cd4338978519 100644 --- a/dom/events/KeyboardEvent.h +++ b/dom/events/KeyboardEvent.h @@ -22,7 +22,7 @@ public: nsPresContext* aPresContext, WidgetKeyboardEvent* aEvent); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(KeyboardEvent, UIEvent) virtual KeyboardEvent* AsKeyboardEvent() override { diff --git a/dom/events/MouseScrollEvent.cpp b/dom/events/MouseScrollEvent.cpp index 5e1264466508..5db33589f868 100644 --- a/dom/events/MouseScrollEvent.cpp +++ b/dom/events/MouseScrollEvent.cpp @@ -32,12 +32,6 @@ MouseScrollEvent::MouseScrollEvent(EventTarget* aOwner, mDetail = mEvent->AsMouseScrollEvent()->mDelta; } -NS_IMPL_ADDREF_INHERITED(MouseScrollEvent, MouseEvent) -NS_IMPL_RELEASE_INHERITED(MouseScrollEvent, MouseEvent) - -NS_INTERFACE_MAP_BEGIN(MouseScrollEvent) -NS_INTERFACE_MAP_END_INHERITING(MouseEvent) - void MouseScrollEvent::InitMouseScrollEvent(const nsAString& aType, bool aCanBubble, diff --git a/dom/events/MouseScrollEvent.h b/dom/events/MouseScrollEvent.h index 9453cd1a7717..fdb557be5646 100644 --- a/dom/events/MouseScrollEvent.h +++ b/dom/events/MouseScrollEvent.h @@ -20,7 +20,7 @@ public: nsPresContext* aPresContext, WidgetMouseScrollEvent* aEvent); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(MouseScrollEvent, MouseEvent) // Forward to base class NS_FORWARD_TO_MOUSEEVENT diff --git a/dom/events/MutationEvent.cpp b/dom/events/MutationEvent.cpp index ff484c06bf88..f72ce49579c7 100644 --- a/dom/events/MutationEvent.cpp +++ b/dom/events/MutationEvent.cpp @@ -22,12 +22,6 @@ MutationEvent::MutationEvent(EventTarget* aOwner, mEventIsInternal = (aEvent == nullptr); } -NS_INTERFACE_MAP_BEGIN(MutationEvent) -NS_INTERFACE_MAP_END_INHERITING(Event) - -NS_IMPL_ADDREF_INHERITED(MutationEvent, Event) -NS_IMPL_RELEASE_INHERITED(MutationEvent, Event) - already_AddRefed MutationEvent::GetRelatedNode() { diff --git a/dom/events/MutationEvent.h b/dom/events/MutationEvent.h index c6d2881e3ef4..40403d51c1b9 100644 --- a/dom/events/MutationEvent.h +++ b/dom/events/MutationEvent.h @@ -22,7 +22,7 @@ public: nsPresContext* aPresContext, InternalMutationEvent* aEvent); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(MutationEvent, Event) virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { diff --git a/dom/events/SimpleGestureEvent.cpp b/dom/events/SimpleGestureEvent.cpp index 44dfbee6ed16..eeca508cd2fa 100644 --- a/dom/events/SimpleGestureEvent.cpp +++ b/dom/events/SimpleGestureEvent.cpp @@ -33,12 +33,6 @@ SimpleGestureEvent::SimpleGestureEvent(EventTarget* aOwner, } } -NS_IMPL_ADDREF_INHERITED(SimpleGestureEvent, MouseEvent) -NS_IMPL_RELEASE_INHERITED(SimpleGestureEvent, MouseEvent) - -NS_INTERFACE_MAP_BEGIN(SimpleGestureEvent) -NS_INTERFACE_MAP_END_INHERITING(MouseEvent) - uint32_t SimpleGestureEvent::AllowedDirections() const { diff --git a/dom/events/SimpleGestureEvent.h b/dom/events/SimpleGestureEvent.h index 7b26846976f3..62895e04d60b 100644 --- a/dom/events/SimpleGestureEvent.h +++ b/dom/events/SimpleGestureEvent.h @@ -23,7 +23,7 @@ public: nsPresContext* aPresContext, WidgetSimpleGestureEvent* aEvent); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(SimpleGestureEvent, MouseEvent) virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle aGivenProto) override { diff --git a/dom/events/TransitionEvent.cpp b/dom/events/TransitionEvent.cpp index 5510eddcd8a0..5b2a3969738a 100644 --- a/dom/events/TransitionEvent.cpp +++ b/dom/events/TransitionEvent.cpp @@ -26,12 +26,6 @@ TransitionEvent::TransitionEvent(EventTarget* aOwner, } } -NS_INTERFACE_MAP_BEGIN(TransitionEvent) -NS_INTERFACE_MAP_END_INHERITING(Event) - -NS_IMPL_ADDREF_INHERITED(TransitionEvent, Event) -NS_IMPL_RELEASE_INHERITED(TransitionEvent, Event) - // static already_AddRefed TransitionEvent::Constructor(const GlobalObject& aGlobal, diff --git a/dom/events/TransitionEvent.h b/dom/events/TransitionEvent.h index d6f8c06d19f4..1817cdbdd804 100644 --- a/dom/events/TransitionEvent.h +++ b/dom/events/TransitionEvent.h @@ -21,7 +21,7 @@ public: nsPresContext* aPresContext, InternalTransitionEvent* aEvent); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(TransitionEvent, Event) static already_AddRefed Constructor(const GlobalObject& aGlobal, diff --git a/dom/events/WheelEvent.cpp b/dom/events/WheelEvent.cpp index 0c74b3e7054c..9e9df232dbb5 100644 --- a/dom/events/WheelEvent.cpp +++ b/dom/events/WheelEvent.cpp @@ -36,12 +36,6 @@ WheelEvent::WheelEvent(EventTarget* aOwner, } } -NS_IMPL_ADDREF_INHERITED(WheelEvent, MouseEvent) -NS_IMPL_RELEASE_INHERITED(WheelEvent, MouseEvent) - -NS_INTERFACE_MAP_BEGIN(WheelEvent) -NS_INTERFACE_MAP_END_INHERITING(MouseEvent) - void WheelEvent::InitWheelEvent(const nsAString& aType, bool aCanBubble, diff --git a/dom/events/WheelEvent.h b/dom/events/WheelEvent.h index da05485bb304..c29c34cfbcce 100644 --- a/dom/events/WheelEvent.h +++ b/dom/events/WheelEvent.h @@ -21,7 +21,7 @@ public: nsPresContext* aPresContext, WidgetWheelEvent* aWheelEvent); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(WheelEvent, MouseEvent) // Forward to base class NS_FORWARD_TO_MOUSEEVENT diff --git a/dom/fetch/Fetch.cpp b/dom/fetch/Fetch.cpp index bd86e1c592ec..23e01ec813af 100644 --- a/dom/fetch/Fetch.cpp +++ b/dom/fetch/Fetch.cpp @@ -473,7 +473,7 @@ FetchRequest(nsIGlobalObject* aGlobal, const RequestOrUSVString& aInput, GlobalObject global(cx, jsGlobal); RefPtr request = Request::Constructor(global, aInput, aInit, aRv); - if (NS_WARN_IF(aRv.Failed())) { + if (aRv.Failed()) { return nullptr; } diff --git a/dom/fetch/FetchConsumer.cpp b/dom/fetch/FetchConsumer.cpp index 6219425a263e..0473d03d50f3 100644 --- a/dom/fetch/FetchConsumer.cpp +++ b/dom/fetch/FetchConsumer.cpp @@ -584,10 +584,12 @@ FetchBodyConsumer::BeginConsumeBodyMainThread() // Try to retarget, otherwise fall back to main thread. nsCOMPtr rr = do_QueryInterface(pump); - if (rr) { + nsCOMPtr rl = + do_QueryInterface(listener); + if (rr && rl) { nsCOMPtr sts = do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID); rv = rr->RetargetDeliveryTo(sts); - if (NS_WARN_IF(NS_FAILED(rv))) { + if (NS_FAILED(rv)) { NS_WARNING("Retargeting failed"); } } diff --git a/dom/fetch/FetchDriver.cpp b/dom/fetch/FetchDriver.cpp index 2132f13a9e7f..2d4ada3b349a 100644 --- a/dom/fetch/FetchDriver.cpp +++ b/dom/fetch/FetchDriver.cpp @@ -718,7 +718,9 @@ FetchDriver::HttpFetch(const nsACString& aPreferredAlternativeDataType) } else { rv = chan->AsyncOpen2(this); } - NS_ENSURE_SUCCESS(rv, rv); + if (NS_FAILED(rv)) { + return rv; + } // Step 4 onwards of "HTTP Fetch" is handled internally by Necko. diff --git a/dom/fetch/Request.cpp b/dom/fetch/Request.cpp index 6b8bb0d02b14..820d6afef812 100644 --- a/dom/fetch/Request.cpp +++ b/dom/fetch/Request.cpp @@ -142,7 +142,7 @@ ParseURLFromChrome(const nsAString& aInput, ErrorResult& aRv) MOZ_ASSERT(NS_IsMainThread()); nsCOMPtr uri; aRv = NS_NewURI(getter_AddRefs(uri), aInput, nullptr, nullptr); - if (NS_WARN_IF(aRv.Failed())) { + if (aRv.Failed()) { aRv.ThrowTypeError(aInput); } return uri.forget(); @@ -328,7 +328,7 @@ Request::Constructor(const GlobalObject& aGlobal, } else { GetRequestURLFromWorker(aGlobal, input, requestURL, fragment, aRv); } - if (NS_WARN_IF(aRv.Failed())) { + if (aRv.Failed()) { return nullptr; } request = new InternalRequest(NS_ConvertUTF16toUTF8(requestURL), fragment); diff --git a/dom/file/EmptyBlobImpl.cpp b/dom/file/EmptyBlobImpl.cpp index 6c8d95c6e636..6f95ab37b2d9 100644 --- a/dom/file/EmptyBlobImpl.cpp +++ b/dom/file/EmptyBlobImpl.cpp @@ -10,8 +10,6 @@ namespace mozilla { namespace dom { -NS_IMPL_ISUPPORTS_INHERITED0(EmptyBlobImpl, BlobImpl) - already_AddRefed EmptyBlobImpl::CreateSlice(uint64_t aStart, uint64_t aLength, const nsAString& aContentType, diff --git a/dom/file/EmptyBlobImpl.h b/dom/file/EmptyBlobImpl.h index 4e6f63b8e1a2..c47dabaaecb9 100644 --- a/dom/file/EmptyBlobImpl.h +++ b/dom/file/EmptyBlobImpl.h @@ -15,7 +15,7 @@ namespace dom { class EmptyBlobImpl final : public BaseBlobImpl { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(EmptyBlobImpl, BaseBlobImpl) explicit EmptyBlobImpl(const nsAString& aContentType) : BaseBlobImpl(aContentType, 0 /* aLength */) diff --git a/dom/file/FileBlobImpl.cpp b/dom/file/FileBlobImpl.cpp index b063cdbe7c0e..a84a7d70e64d 100644 --- a/dom/file/FileBlobImpl.cpp +++ b/dom/file/FileBlobImpl.cpp @@ -18,8 +18,6 @@ namespace mozilla { namespace dom { -NS_IMPL_ISUPPORTS_INHERITED0(FileBlobImpl, BlobImpl) - FileBlobImpl::FileBlobImpl(nsIFile* aFile) : BaseBlobImpl(EmptyString(), EmptyString(), UINT64_MAX, INT64_MAX) , mFile(aFile) diff --git a/dom/file/FileBlobImpl.h b/dom/file/FileBlobImpl.h index 8490965c4046..91e63c5ece57 100644 --- a/dom/file/FileBlobImpl.h +++ b/dom/file/FileBlobImpl.h @@ -17,7 +17,7 @@ namespace dom { class FileBlobImpl : public BaseBlobImpl { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(FileBlobImpl, BaseBlobImpl) // Create as a file explicit FileBlobImpl(nsIFile* aFile); diff --git a/dom/file/MemoryBlobImpl.cpp b/dom/file/MemoryBlobImpl.cpp index c1e78c256036..93fbc90f3b70 100644 --- a/dom/file/MemoryBlobImpl.cpp +++ b/dom/file/MemoryBlobImpl.cpp @@ -47,8 +47,6 @@ nsresult MemoryBlobImpl::DataOwnerAdapter::Create(DataOwner* aDataOwner, return NS_OK; } -NS_IMPL_ISUPPORTS_INHERITED0(MemoryBlobImpl, BlobImpl) - already_AddRefed MemoryBlobImpl::CreateSlice(uint64_t aStart, uint64_t aLength, const nsAString& aContentType, diff --git a/dom/file/MemoryBlobImpl.h b/dom/file/MemoryBlobImpl.h index 3a295fad2f6f..5eba19481ac0 100644 --- a/dom/file/MemoryBlobImpl.h +++ b/dom/file/MemoryBlobImpl.h @@ -23,7 +23,7 @@ namespace dom { class MemoryBlobImpl final : public BaseBlobImpl { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(MemoryBlobImpl, BaseBlobImpl) MemoryBlobImpl(void* aMemoryBuffer, uint64_t aLength, const nsAString& aName, const nsAString& aContentType, int64_t aLastModifiedDate) diff --git a/dom/file/MultipartBlobImpl.cpp b/dom/file/MultipartBlobImpl.cpp index ee4f987918f8..33cfe6fe2b1f 100644 --- a/dom/file/MultipartBlobImpl.cpp +++ b/dom/file/MultipartBlobImpl.cpp @@ -23,8 +23,6 @@ using namespace mozilla; using namespace mozilla::dom; -NS_IMPL_ISUPPORTS_INHERITED0(MultipartBlobImpl, BlobImpl) - /* static */ already_AddRefed MultipartBlobImpl::Create(nsTArray>&& aBlobImpls, const nsAString& aName, diff --git a/dom/file/MultipartBlobImpl.h b/dom/file/MultipartBlobImpl.h index e39a52f5ed79..ed8b48676ef2 100644 --- a/dom/file/MultipartBlobImpl.h +++ b/dom/file/MultipartBlobImpl.h @@ -18,7 +18,7 @@ namespace dom { class MultipartBlobImpl final : public BaseBlobImpl { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(MultipartBlobImpl, BaseBlobImpl) // Create as a file static already_AddRefed diff --git a/dom/file/MutableBlobStorage.cpp b/dom/file/MutableBlobStorage.cpp index f722a209c5d3..78580e5db773 100644 --- a/dom/file/MutableBlobStorage.cpp +++ b/dom/file/MutableBlobStorage.cpp @@ -213,6 +213,8 @@ class CreateBlobRunnable final : public Runnable , public TemporaryIPCBlobChildCallback { public: + // We need to always declare refcounting because + // TemporaryIPCBlobChildCallback has pure-virtual refcounting. NS_DECL_ISUPPORTS_INHERITED CreateBlobRunnable(MutableBlobStorage* aBlobStorage, diff --git a/dom/html/HTMLBodyElement.cpp b/dom/html/HTMLBodyElement.cpp index c6c60895c91d..f059d44f14ed 100644 --- a/dom/html/HTMLBodyElement.cpp +++ b/dom/html/HTMLBodyElement.cpp @@ -41,8 +41,6 @@ HTMLBodyElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) return HTMLBodyElementBinding::Wrap(aCx, this, aGivenProto); } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLBodyElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLBodyElement) bool diff --git a/dom/html/HTMLBodyElement.h b/dom/html/HTMLBodyElement.h index 7b61f67ac9c0..fc5d2393e716 100644 --- a/dom/html/HTMLBodyElement.h +++ b/dom/html/HTMLBodyElement.h @@ -32,7 +32,7 @@ public: } // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLBodyElement, nsGenericHTMLElement) NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLBodyElement, body); diff --git a/dom/html/HTMLFrameElement.cpp b/dom/html/HTMLFrameElement.cpp index d28e6cde9ffe..24e4526bfbe5 100644 --- a/dom/html/HTMLFrameElement.cpp +++ b/dom/html/HTMLFrameElement.cpp @@ -25,8 +25,6 @@ HTMLFrameElement::~HTMLFrameElement() } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLFrameElement, nsGenericHTMLFrameElement) - NS_IMPL_ELEMENT_CLONE(HTMLFrameElement) bool diff --git a/dom/html/HTMLFrameElement.h b/dom/html/HTMLFrameElement.h index 8d155e5076be..2c7e21fd5a22 100644 --- a/dom/html/HTMLFrameElement.h +++ b/dom/html/HTMLFrameElement.h @@ -23,7 +23,8 @@ public: FromParser aFromParser = NOT_FROM_PARSER); // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLFrameElement, + nsGenericHTMLFrameElement) NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLFrameElement, frame) diff --git a/dom/html/HTMLFrameSetElement.cpp b/dom/html/HTMLFrameSetElement.cpp index f514eb77f436..5b7d675c980e 100644 --- a/dom/html/HTMLFrameSetElement.cpp +++ b/dom/html/HTMLFrameSetElement.cpp @@ -26,8 +26,6 @@ HTMLFrameSetElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) return HTMLFrameSetElementBinding::Wrap(aCx, this, aGivenProto); } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLFrameSetElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLFrameSetElement) nsresult diff --git a/dom/html/HTMLFrameSetElement.h b/dom/html/HTMLFrameSetElement.h index 318aa9d0a31a..4f989a2f93a5 100644 --- a/dom/html/HTMLFrameSetElement.h +++ b/dom/html/HTMLFrameSetElement.h @@ -58,7 +58,8 @@ public: NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLFrameSetElement, frameset) // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLFrameSetElement, + nsGenericHTMLElement) void GetCols(DOMString& aCols) { diff --git a/dom/html/HTMLHRElement.cpp b/dom/html/HTMLHRElement.cpp index e42ef6f62f8d..5ec48175a2bc 100644 --- a/dom/html/HTMLHRElement.cpp +++ b/dom/html/HTMLHRElement.cpp @@ -21,8 +21,6 @@ HTMLHRElement::~HTMLHRElement() { } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLHRElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLHRElement) diff --git a/dom/html/HTMLHRElement.h b/dom/html/HTMLHRElement.h index 0f261c4006b3..3e9f550ee166 100644 --- a/dom/html/HTMLHRElement.h +++ b/dom/html/HTMLHRElement.h @@ -24,7 +24,7 @@ public: explicit HTMLHRElement(already_AddRefed& aNodeInfo); // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLHRElement, nsGenericHTMLElement) virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, diff --git a/dom/html/HTMLIFrameElement.cpp b/dom/html/HTMLIFrameElement.cpp index 6969e0efb835..10b9d208911d 100644 --- a/dom/html/HTMLIFrameElement.cpp +++ b/dom/html/HTMLIFrameElement.cpp @@ -37,8 +37,6 @@ HTMLIFrameElement::~HTMLIFrameElement() { } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLIFrameElement, nsGenericHTMLFrameElement) - NS_IMPL_ELEMENT_CLONE(HTMLIFrameElement) bool diff --git a/dom/html/HTMLIFrameElement.h b/dom/html/HTMLIFrameElement.h index 4cba50ce93dd..986f116184db 100644 --- a/dom/html/HTMLIFrameElement.h +++ b/dom/html/HTMLIFrameElement.h @@ -23,7 +23,8 @@ public: NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLIFrameElement, iframe) // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLIFrameElement, + nsGenericHTMLFrameElement) // Element virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const override diff --git a/dom/html/HTMLLIElement.cpp b/dom/html/HTMLLIElement.cpp index a3eac53d8394..0dc6c76e1295 100644 --- a/dom/html/HTMLLIElement.cpp +++ b/dom/html/HTMLLIElement.cpp @@ -22,8 +22,6 @@ HTMLLIElement::~HTMLLIElement() { } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLLIElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLLIElement) // values that are handled case-insensitively diff --git a/dom/html/HTMLLIElement.h b/dom/html/HTMLLIElement.h index 118f87c22c19..f7dc14dee235 100644 --- a/dom/html/HTMLLIElement.h +++ b/dom/html/HTMLLIElement.h @@ -23,7 +23,7 @@ public: } // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLIElement, nsGenericHTMLElement) virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, diff --git a/dom/html/HTMLLabelElement.cpp b/dom/html/HTMLLabelElement.cpp index f15f6750de9c..5b09650e2a7e 100644 --- a/dom/html/HTMLLabelElement.cpp +++ b/dom/html/HTMLLabelElement.cpp @@ -34,10 +34,6 @@ HTMLLabelElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto) return HTMLLabelElementBinding::Wrap(aCx, this, aGivenProto); } -// nsISupports - -NS_IMPL_ISUPPORTS_INHERITED0(HTMLLabelElement, nsGenericHTMLElement) - // nsIDOMHTMLLabelElement NS_IMPL_ELEMENT_CLONE(HTMLLabelElement) diff --git a/dom/html/HTMLLabelElement.h b/dom/html/HTMLLabelElement.h index 16c60c5d44ab..1277d3c619fa 100644 --- a/dom/html/HTMLLabelElement.h +++ b/dom/html/HTMLLabelElement.h @@ -29,7 +29,7 @@ public: NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLLabelElement, label) // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLLabelElement, nsGenericHTMLElement) // Element virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const override diff --git a/dom/html/HTMLMenuElement.cpp b/dom/html/HTMLMenuElement.cpp index 94ffd1ab8b40..ce868cf1b40f 100644 --- a/dom/html/HTMLMenuElement.cpp +++ b/dom/html/HTMLMenuElement.cpp @@ -55,8 +55,6 @@ HTMLMenuElement::~HTMLMenuElement() { } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLMenuElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLMenuElement) diff --git a/dom/html/HTMLMenuElement.h b/dom/html/HTMLMenuElement.h index 6449966e9c3f..d8a0c3bab0bc 100644 --- a/dom/html/HTMLMenuElement.h +++ b/dom/html/HTMLMenuElement.h @@ -23,7 +23,7 @@ public: NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLMenuElement, menu) // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLMenuElement, nsGenericHTMLElement) virtual nsresult AfterSetAttr(int32_t aNamespaceID, nsAtom* aName, const nsAttrValue* aValue, diff --git a/dom/html/HTMLMenuItemElement.cpp b/dom/html/HTMLMenuItemElement.cpp index 2c5238c395de..1028031434ae 100644 --- a/dom/html/HTMLMenuItemElement.cpp +++ b/dom/html/HTMLMenuItemElement.cpp @@ -173,8 +173,6 @@ HTMLMenuItemElement::~HTMLMenuItemElement() } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLMenuItemElement, nsGenericHTMLElement) - //NS_IMPL_ELEMENT_CLONE(HTMLMenuItemElement) nsresult diff --git a/dom/html/HTMLMenuItemElement.h b/dom/html/HTMLMenuItemElement.h index 096137ae7ef7..db5bccccc1dc 100644 --- a/dom/html/HTMLMenuItemElement.h +++ b/dom/html/HTMLMenuItemElement.h @@ -29,7 +29,8 @@ public: NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLMenuItemElement, menuitem) // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLMenuItemElement, + nsGenericHTMLElement) virtual nsresult GetEventTargetParent( EventChainPreVisitor& aVisitor) override; diff --git a/dom/html/HTMLMetaElement.cpp b/dom/html/HTMLMetaElement.cpp index 7420e32d34f8..364f59f52a6a 100644 --- a/dom/html/HTMLMetaElement.cpp +++ b/dom/html/HTMLMetaElement.cpp @@ -32,8 +32,6 @@ HTMLMetaElement::~HTMLMetaElement() } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLMetaElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLMetaElement) diff --git a/dom/html/HTMLMetaElement.h b/dom/html/HTMLMetaElement.h index 793bb363df3e..d51a83d07593 100644 --- a/dom/html/HTMLMetaElement.h +++ b/dom/html/HTMLMetaElement.h @@ -19,7 +19,7 @@ public: explicit HTMLMetaElement(already_AddRefed& aNodeInfo); // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLMetaElement, nsGenericHTMLElement) virtual nsresult BindToTree(nsIDocument* aDocument, nsIContent* aParent, nsIContent* aBindingParent, diff --git a/dom/html/HTMLOptGroupElement.cpp b/dom/html/HTMLOptGroupElement.cpp index e3ef46ea31af..79283061c294 100644 --- a/dom/html/HTMLOptGroupElement.cpp +++ b/dom/html/HTMLOptGroupElement.cpp @@ -37,8 +37,6 @@ HTMLOptGroupElement::~HTMLOptGroupElement() } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLOptGroupElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLOptGroupElement) diff --git a/dom/html/HTMLOptGroupElement.h b/dom/html/HTMLOptGroupElement.h index af964841afb1..16f8d012a6c1 100644 --- a/dom/html/HTMLOptGroupElement.h +++ b/dom/html/HTMLOptGroupElement.h @@ -22,7 +22,8 @@ public: NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLOptGroupElement, optgroup) // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLOptGroupElement, + nsGenericHTMLElement) // nsINode virtual nsresult InsertChildBefore(nsIContent* aKid, nsIContent* aBeforeThis, diff --git a/dom/html/HTMLOptionElement.cpp b/dom/html/HTMLOptionElement.cpp index d6badbfcf42c..25585d4a4312 100644 --- a/dom/html/HTMLOptionElement.cpp +++ b/dom/html/HTMLOptionElement.cpp @@ -48,8 +48,6 @@ HTMLOptionElement::~HTMLOptionElement() { } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLOptionElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLOptionElement) mozilla::dom::HTMLFormElement* diff --git a/dom/html/HTMLOptionElement.h b/dom/html/HTMLOptionElement.h index 0328fcbc7215..0e8a3d8aee4a 100644 --- a/dom/html/HTMLOptionElement.h +++ b/dom/html/HTMLOptionElement.h @@ -32,7 +32,7 @@ public: NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLOptionElement, option) // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLOptionElement, nsGenericHTMLElement) using mozilla::dom::Element::SetText; using mozilla::dom::Element::GetText; diff --git a/dom/html/HTMLParagraphElement.cpp b/dom/html/HTMLParagraphElement.cpp index 31d8992759f4..c0fc5fc5e798 100644 --- a/dom/html/HTMLParagraphElement.cpp +++ b/dom/html/HTMLParagraphElement.cpp @@ -21,8 +21,6 @@ HTMLParagraphElement::~HTMLParagraphElement() { } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLParagraphElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLParagraphElement) bool diff --git a/dom/html/HTMLParagraphElement.h b/dom/html/HTMLParagraphElement.h index d330cbaa448c..f8a09aad43f3 100644 --- a/dom/html/HTMLParagraphElement.h +++ b/dom/html/HTMLParagraphElement.h @@ -23,7 +23,8 @@ public: } // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLParagraphElement, + nsGenericHTMLElement) virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, diff --git a/dom/html/HTMLPictureElement.cpp b/dom/html/HTMLPictureElement.cpp index 8e92c453d2fb..a020c5508a80 100644 --- a/dom/html/HTMLPictureElement.cpp +++ b/dom/html/HTMLPictureElement.cpp @@ -28,8 +28,6 @@ HTMLPictureElement::~HTMLPictureElement() { } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLPictureElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLPictureElement) void diff --git a/dom/html/HTMLPictureElement.h b/dom/html/HTMLPictureElement.h index d1aed1a94112..2b6ec48702dc 100644 --- a/dom/html/HTMLPictureElement.h +++ b/dom/html/HTMLPictureElement.h @@ -19,7 +19,7 @@ public: explicit HTMLPictureElement(already_AddRefed& aNodeInfo); // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLPictureElement, nsGenericHTMLElement) virtual nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult, bool aPreallocateChildren) const override; diff --git a/dom/html/HTMLPreElement.cpp b/dom/html/HTMLPreElement.cpp index 96f30146536a..08650ef3e077 100644 --- a/dom/html/HTMLPreElement.cpp +++ b/dom/html/HTMLPreElement.cpp @@ -22,8 +22,6 @@ HTMLPreElement::~HTMLPreElement() { } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLPreElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLPreElement) bool diff --git a/dom/html/HTMLPreElement.h b/dom/html/HTMLPreElement.h index c832e42db220..3ad2a735a796 100644 --- a/dom/html/HTMLPreElement.h +++ b/dom/html/HTMLPreElement.h @@ -23,7 +23,7 @@ public: } // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLPreElement, nsGenericHTMLElement) virtual bool ParseAttribute(int32_t aNamespaceID, nsAtom* aAttribute, diff --git a/dom/html/HTMLTableCellElement.cpp b/dom/html/HTMLTableCellElement.cpp index 0423a777636f..234f15c50cdd 100644 --- a/dom/html/HTMLTableCellElement.cpp +++ b/dom/html/HTMLTableCellElement.cpp @@ -31,8 +31,6 @@ HTMLTableCellElement::WrapNode(JSContext *aCx, JS::Handle aGivenProto return HTMLTableCellElementBinding::Wrap(aCx, this, aGivenProto); } -NS_IMPL_ISUPPORTS_INHERITED0(HTMLTableCellElement, nsGenericHTMLElement) - NS_IMPL_ELEMENT_CLONE(HTMLTableCellElement) diff --git a/dom/html/HTMLTableCellElement.h b/dom/html/HTMLTableCellElement.h index 03cb6134e335..11d5b7d8e0fd 100644 --- a/dom/html/HTMLTableCellElement.h +++ b/dom/html/HTMLTableCellElement.h @@ -24,7 +24,8 @@ public: } // nsISupports - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HTMLTableCellElement, + nsGenericHTMLElement) uint32_t ColSpan() const { diff --git a/dom/indexedDB/ActorsParent.cpp b/dom/indexedDB/ActorsParent.cpp index aef19c8379be..243b9bf9f846 100644 --- a/dom/indexedDB/ActorsParent.cpp +++ b/dom/indexedDB/ActorsParent.cpp @@ -5516,7 +5516,7 @@ public: , mNeedsCheckpoint(aNeedsCheckpoint) { } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(IdleConnectionRunnable, ConnectionRunnable) private: ~IdleConnectionRunnable() override = default; @@ -5533,7 +5533,7 @@ public: : ConnectionRunnable(aDatabaseInfo) { } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(CloseConnectionRunnable, ConnectionRunnable) private: ~CloseConnectionRunnable() override = default; @@ -5649,7 +5649,7 @@ public: uint64_t aTransactionId, FinishCallback* aCallback); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(FinishCallbackWrapper, Runnable) private: ~FinishCallbackWrapper() override; @@ -5744,7 +5744,7 @@ class ConnectionPool::ThreadRunnable final public: ThreadRunnable(); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ThreadRunnable, Runnable) uint32_t SerialNumber() const @@ -6291,7 +6291,7 @@ public: void WaitForTransactions(); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(WaitForTransactionsHelper, Runnable) private: ~WaitForTransactionsHelper() override @@ -7134,6 +7134,8 @@ private: TransactionFinishedAfterUnblock() override; public: + // We need to declare all of nsISupports, because FinishCallback has + // a pure-virtual nsISupports declaration. NS_DECL_ISUPPORTS_INHERITED }; @@ -7546,6 +7548,8 @@ protected: virtual void SendResults() = 0; + // We need to declare refcounting unconditionally, because + // OpenDirectoryListener has pure-virtual refcounting. NS_DECL_ISUPPORTS_INHERITED // Common nsIRunnable implementation that subclasses may not override. @@ -9303,6 +9307,8 @@ private: void Finish(); + // We need to declare refcounting unconditionally, because + // OpenDirectoryListener has pure-virtual refcounting. NS_DECL_ISUPPORTS_INHERITED NS_DECL_NSIRUNNABLE @@ -12934,9 +12940,6 @@ ConnectionRunnable::ConnectionRunnable(DatabaseInfo* aDatabaseInfo) MOZ_ASSERT(mOwningEventTarget); } -NS_IMPL_ISUPPORTS_INHERITED0(ConnectionPool::IdleConnectionRunnable, - ConnectionPool::ConnectionRunnable) - NS_IMETHODIMP ConnectionPool:: IdleConnectionRunnable::Run() @@ -12978,9 +12981,6 @@ IdleConnectionRunnable::Run() return NS_OK; } -NS_IMPL_ISUPPORTS_INHERITED0(ConnectionPool::CloseConnectionRunnable, - ConnectionPool::ConnectionRunnable) - NS_IMETHODIMP ConnectionPool:: CloseConnectionRunnable::Run() @@ -13108,8 +13108,6 @@ FinishCallbackWrapper::~FinishCallbackWrapper() MOZ_ASSERT(!mCallback); } -NS_IMPL_ISUPPORTS_INHERITED0(ConnectionPool::FinishCallbackWrapper, Runnable) - nsresult ConnectionPool:: FinishCallbackWrapper::Run() @@ -13166,8 +13164,6 @@ ThreadRunnable::~ThreadRunnable() MOZ_ASSERT(!mContinueRunning); } -NS_IMPL_ISUPPORTS_INHERITED0(ConnectionPool::ThreadRunnable, Runnable) - nsresult ConnectionPool:: ThreadRunnable::Run() @@ -13807,8 +13803,6 @@ WaitForTransactionsHelper::CallCallback() mState = State::Complete; } -NS_IMPL_ISUPPORTS_INHERITED0(WaitForTransactionsHelper, Runnable) - NS_IMETHODIMP WaitForTransactionsHelper::Run() { diff --git a/dom/indexedDB/FileInfo.cpp b/dom/indexedDB/FileInfo.cpp index 0e28f6be0803..3a0e2c1d39f8 100644 --- a/dom/indexedDB/FileInfo.cpp +++ b/dom/indexedDB/FileInfo.cpp @@ -68,7 +68,7 @@ public: MOZ_ASSERT(aFileId > 0); } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(CleanupFileRunnable, Runnable); private: ~CleanupFileRunnable() @@ -244,8 +244,6 @@ CleanupFileRunnable::DoCleanup(FileManager* aFileManager, int64_t aFileId) } } -NS_IMPL_ISUPPORTS_INHERITED0(CleanupFileRunnable, Runnable) - NS_IMETHODIMP CleanupFileRunnable::Run() { diff --git a/dom/indexedDB/FileSnapshot.cpp b/dom/indexedDB/FileSnapshot.cpp index 267d9bc330f6..55611b44dd99 100644 --- a/dom/indexedDB/FileSnapshot.cpp +++ b/dom/indexedDB/FileSnapshot.cpp @@ -143,7 +143,7 @@ class StreamWrapper::CloseRunnable final RefPtr mStreamWrapper; public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(CloseRunnable, Runnable) private: explicit @@ -414,9 +414,6 @@ StreamWrapper::Clone(nsIInputStream** aResult) return stream->Clone(aResult); } -NS_IMPL_ISUPPORTS_INHERITED0(StreamWrapper::CloseRunnable, - Runnable) - NS_IMETHODIMP StreamWrapper:: CloseRunnable::Run() diff --git a/dom/indexedDB/IDBKeyRange.cpp b/dom/indexedDB/IDBKeyRange.cpp index c495bba8dab6..14a786c278c5 100644 --- a/dom/indexedDB/IDBKeyRange.cpp +++ b/dom/indexedDB/IDBKeyRange.cpp @@ -231,8 +231,6 @@ NS_INTERFACE_MAP_END NS_IMPL_CYCLE_COLLECTING_ADDREF(IDBKeyRange) NS_IMPL_CYCLE_COLLECTING_RELEASE(IDBKeyRange) -NS_IMPL_ISUPPORTS_INHERITED0(IDBLocaleAwareKeyRange, IDBKeyRange) - void IDBKeyRange::DropJSObjects() { diff --git a/dom/indexedDB/IDBKeyRange.h b/dom/indexedDB/IDBKeyRange.h index d79484e28180..3e8190d91e43 100644 --- a/dom/indexedDB/IDBKeyRange.h +++ b/dom/indexedDB/IDBKeyRange.h @@ -198,7 +198,7 @@ public: bool aUpperOpen, ErrorResult& aRv); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(IDBLocaleAwareKeyRange, IDBKeyRange) // WebIDL bool diff --git a/dom/media/MediaRecorder.cpp b/dom/media/MediaRecorder.cpp index cd7eef11cb8b..60fe1ea0dae2 100644 --- a/dom/media/MediaRecorder.cpp +++ b/dom/media/MediaRecorder.cpp @@ -220,6 +220,8 @@ class MediaRecorder::Session: public PrincipalChangeObserver, , public MutableBlobStorageCallback { public: + // We need to always declare refcounting because + // MutableBlobStorageCallback has pure-virtual refcounting. NS_DECL_ISUPPORTS_INHERITED // aDestroyRunnable can be null. If it's not, it will be dispatched after diff --git a/dom/media/webaudio/AnalyserNode.cpp b/dom/media/webaudio/AnalyserNode.cpp index 0bfd4138198f..d8424423b8f8 100644 --- a/dom/media/webaudio/AnalyserNode.cpp +++ b/dom/media/webaudio/AnalyserNode.cpp @@ -22,8 +22,6 @@ static_assert((CHUNK_COUNT & (CHUNK_COUNT - 1)) == 0, namespace dom { -NS_IMPL_ISUPPORTS_INHERITED0(AnalyserNode, AudioNode) - class AnalyserNodeEngine final : public AudioNodeEngine { class TransferBuffer final : public Runnable diff --git a/dom/media/webaudio/AnalyserNode.h b/dom/media/webaudio/AnalyserNode.h index 8ca85441b1e0..97adf64e8a27 100644 --- a/dom/media/webaudio/AnalyserNode.h +++ b/dom/media/webaudio/AnalyserNode.h @@ -24,7 +24,7 @@ public: Create(AudioContext& aAudioContext, const AnalyserOptions& aOptions, ErrorResult& aRv); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(AnalyserNode, AudioNode) virtual JSObject* WrapObject(JSContext* aCx, JS::Handle aGivenProto) override; diff --git a/dom/media/webaudio/ChannelMergerNode.cpp b/dom/media/webaudio/ChannelMergerNode.cpp index 5c14e6915124..4b712c64b6af 100644 --- a/dom/media/webaudio/ChannelMergerNode.cpp +++ b/dom/media/webaudio/ChannelMergerNode.cpp @@ -12,8 +12,6 @@ namespace mozilla { namespace dom { -NS_IMPL_ISUPPORTS_INHERITED0(ChannelMergerNode, AudioNode) - class ChannelMergerNodeEngine final : public AudioNodeEngine { public: diff --git a/dom/media/webaudio/ChannelMergerNode.h b/dom/media/webaudio/ChannelMergerNode.h index 5acf831919ec..5b8a0da219ce 100644 --- a/dom/media/webaudio/ChannelMergerNode.h +++ b/dom/media/webaudio/ChannelMergerNode.h @@ -22,7 +22,7 @@ public: Create(AudioContext& aAudioContext, const ChannelMergerOptions& aOptions, ErrorResult& aRv); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ChannelMergerNode, AudioNode) static already_AddRefed Constructor(const GlobalObject& aGlobal, AudioContext& aAudioContext, diff --git a/dom/media/webaudio/ChannelSplitterNode.cpp b/dom/media/webaudio/ChannelSplitterNode.cpp index 988a9eccd91f..23c714a5bf4a 100644 --- a/dom/media/webaudio/ChannelSplitterNode.cpp +++ b/dom/media/webaudio/ChannelSplitterNode.cpp @@ -12,8 +12,6 @@ namespace mozilla { namespace dom { -NS_IMPL_ISUPPORTS_INHERITED0(ChannelSplitterNode, AudioNode) - class ChannelSplitterNodeEngine final : public AudioNodeEngine { public: diff --git a/dom/media/webaudio/ChannelSplitterNode.h b/dom/media/webaudio/ChannelSplitterNode.h index da2be388ca24..361df4b9a35b 100644 --- a/dom/media/webaudio/ChannelSplitterNode.h +++ b/dom/media/webaudio/ChannelSplitterNode.h @@ -22,7 +22,7 @@ public: Create(AudioContext& aAudioContext, const ChannelSplitterOptions& aOptions, ErrorResult& aRv); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ChannelSplitterNode, AudioNode) static already_AddRefed Constructor(const GlobalObject& aGlobal, AudioContext& aAudioContext, diff --git a/dom/media/webaudio/IIRFilterNode.cpp b/dom/media/webaudio/IIRFilterNode.cpp index ccea70f70f99..5716d3025774 100644 --- a/dom/media/webaudio/IIRFilterNode.cpp +++ b/dom/media/webaudio/IIRFilterNode.cpp @@ -16,8 +16,6 @@ namespace mozilla { namespace dom { -NS_IMPL_ISUPPORTS_INHERITED0(IIRFilterNode, AudioNode) - class IIRFilterNodeEngine final : public AudioNodeEngine { public: diff --git a/dom/media/webaudio/IIRFilterNode.h b/dom/media/webaudio/IIRFilterNode.h index a0d08d9854ed..2c6e33ca0cef 100644 --- a/dom/media/webaudio/IIRFilterNode.h +++ b/dom/media/webaudio/IIRFilterNode.h @@ -24,7 +24,7 @@ public: Create(AudioContext& aAudioContext, const IIRFilterOptions& aOptions, ErrorResult& aRv); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(IIRFilterNode, AudioNode) static already_AddRefed Constructor(const GlobalObject& aGlobal, AudioContext& aAudioContext, diff --git a/dom/media/webaudio/ScriptProcessorNode.cpp b/dom/media/webaudio/ScriptProcessorNode.cpp index 130472255b5f..3f71ca25022c 100644 --- a/dom/media/webaudio/ScriptProcessorNode.cpp +++ b/dom/media/webaudio/ScriptProcessorNode.cpp @@ -25,8 +25,6 @@ namespace dom { // buffers. static const float MAX_LATENCY_S = 0.5; -NS_IMPL_ISUPPORTS_INHERITED0(ScriptProcessorNode, AudioNode) - // This class manages a queue of output buffers shared between // the main thread and the Media Stream Graph thread. class SharedBuffers final diff --git a/dom/media/webaudio/ScriptProcessorNode.h b/dom/media/webaudio/ScriptProcessorNode.h index 9e8aecfb4d86..4d9fa9120570 100644 --- a/dom/media/webaudio/ScriptProcessorNode.h +++ b/dom/media/webaudio/ScriptProcessorNode.h @@ -23,7 +23,7 @@ public: uint32_t aNumberOfInputChannels, uint32_t aNumberOfOutputChannels); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ScriptProcessorNode, AudioNode) IMPL_EVENT_HANDLER(audioprocess) diff --git a/dom/notification/Notification.cpp b/dom/notification/Notification.cpp index a22bc0c03157..623cc6244476 100644 --- a/dom/notification/Notification.cpp +++ b/dom/notification/Notification.cpp @@ -1202,7 +1202,8 @@ Notification::GetPrincipal() class WorkerNotificationObserver final : public MainThreadNotificationObserver { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(WorkerNotificationObserver, + MainThreadNotificationObserver) NS_DECL_NSIOBSERVER explicit WorkerNotificationObserver(UniquePtr aRef) @@ -1232,8 +1233,6 @@ protected: } }; -NS_IMPL_ISUPPORTS_INHERITED0(WorkerNotificationObserver, MainThreadNotificationObserver) - class ServiceWorkerNotificationObserver final : public nsIObserver { public: diff --git a/dom/performance/Performance.cpp b/dom/performance/Performance.cpp index 3b35967ce62f..c241123adbcf 100644 --- a/dom/performance/Performance.cpp +++ b/dom/performance/Performance.cpp @@ -36,38 +36,6 @@ namespace mozilla { namespace dom { -namespace { - -class PrefEnabledRunnable final - : public WorkerCheckAPIExposureOnMainThreadRunnable -{ -public: - PrefEnabledRunnable(WorkerPrivate* aWorkerPrivate, - const nsCString& aPrefName) - : WorkerCheckAPIExposureOnMainThreadRunnable(aWorkerPrivate) - , mEnabled(false) - , mPrefName(aPrefName) - { } - - bool MainThreadRun() override - { - MOZ_ASSERT(NS_IsMainThread()); - mEnabled = Preferences::GetBool(mPrefName.get(), false); - return true; - } - - bool IsEnabled() const - { - return mEnabled; - } - -private: - bool mEnabled; - nsCString mPrefName; -}; - -} // anonymous namespace - NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Performance) NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper) @@ -539,24 +507,6 @@ Performance::QueueEntry(PerformanceEntry* aEntry) } } -/* static */ bool -Performance::IsObserverEnabled(JSContext* aCx, JSObject* aGlobal) -{ - if (NS_IsMainThread()) { - return Preferences::GetBool("dom.enable_performance_observer", false); - } - - WorkerPrivate* workerPrivate = GetCurrentThreadWorkerPrivate(); - MOZ_ASSERT(workerPrivate); - workerPrivate->AssertIsOnWorkerThread(); - - RefPtr runnable = - new PrefEnabledRunnable(workerPrivate, - NS_LITERAL_CSTRING("dom.enable_performance_observer")); - - return runnable->Dispatch() && runnable->IsEnabled(); -} - void Performance::MemoryPressure() { diff --git a/dom/performance/Performance.h b/dom/performance/Performance.h index 0bfe0d434195..2a529bd4a85e 100644 --- a/dom/performance/Performance.h +++ b/dom/performance/Performance.h @@ -9,6 +9,7 @@ #include "mozilla/Attributes.h" #include "mozilla/DOMEventTargetHelper.h" +#include "mozilla/dom/DOMPrefs.h" #include "nsCOMPtr.h" #include "nsDOMNavigationTiming.h" diff --git a/dom/performance/PerformanceObserverEntryList.h b/dom/performance/PerformanceObserverEntryList.h index e78ce7dfb326..e693b5522802 100644 --- a/dom/performance/PerformanceObserverEntryList.h +++ b/dom/performance/PerformanceObserverEntryList.h @@ -11,6 +11,7 @@ #include "nsISupports.h" #include "nsTArray.h" #include "nsWrapperCache.h" +#include "mozilla/dom/DOMPrefs.h" #include "mozilla/dom/PerformanceEntryBinding.h" namespace mozilla { diff --git a/dom/presentation/PresentationCallbacks.cpp b/dom/presentation/PresentationCallbacks.cpp index e41170a03efb..55ac50409a49 100644 --- a/dom/presentation/PresentationCallbacks.cpp +++ b/dom/presentation/PresentationCallbacks.cpp @@ -78,9 +78,6 @@ PresentationRequesterCallback::NotifyError(nsresult aError) * Implementation of PresentationRequesterCallback */ -NS_IMPL_ISUPPORTS_INHERITED0(PresentationReconnectCallback, - PresentationRequesterCallback) - PresentationReconnectCallback::PresentationReconnectCallback( PresentationRequest* aRequest, const nsAString& aSessionId, diff --git a/dom/presentation/PresentationCallbacks.h b/dom/presentation/PresentationCallbacks.h index c73fd970193a..3848a133cdfe 100644 --- a/dom/presentation/PresentationCallbacks.h +++ b/dom/presentation/PresentationCallbacks.h @@ -45,7 +45,8 @@ protected: class PresentationReconnectCallback final : public PresentationRequesterCallback { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(PresentationReconnectCallback, + PresentationRequesterCallback) NS_DECL_NSIPRESENTATIONSERVICECALLBACK PresentationReconnectCallback(PresentationRequest* aRequest, diff --git a/dom/presentation/PresentationTransportBuilderConstructor.cpp b/dom/presentation/PresentationTransportBuilderConstructor.cpp index 98177958d128..ba79f242bf1e 100644 --- a/dom/presentation/PresentationTransportBuilderConstructor.cpp +++ b/dom/presentation/PresentationTransportBuilderConstructor.cpp @@ -26,9 +26,6 @@ DummyPresentationTransportBuilderConstructor::CreateTransportBuilder( return NS_OK; } -NS_IMPL_ISUPPORTS_INHERITED0(PresentationTransportBuilderConstructor, - DummyPresentationTransportBuilderConstructor) - /* static */ already_AddRefed PresentationTransportBuilderConstructor::Create() { diff --git a/dom/presentation/PresentationTransportBuilderConstructor.h b/dom/presentation/PresentationTransportBuilderConstructor.h index 4250d61baa28..751d02ea6df1 100644 --- a/dom/presentation/PresentationTransportBuilderConstructor.h +++ b/dom/presentation/PresentationTransportBuilderConstructor.h @@ -31,7 +31,8 @@ class PresentationTransportBuilderConstructor final : public DummyPresentationTransportBuilderConstructor { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(PresentationTransportBuilderConstructor, + DummyPresentationTransportBuilderConstructor) NS_DECL_NSIPRESENTATIONTRANSPORTBUILDERCONSTRUCTOR static already_AddRefed diff --git a/dom/quota/ActorsParent.cpp b/dom/quota/ActorsParent.cpp index 231865b91e26..d03cc6a24780 100644 --- a/dom/quota/ActorsParent.cpp +++ b/dom/quota/ActorsParent.cpp @@ -970,6 +970,8 @@ protected: { } private: + // Need to declare refcounting unconditionally, because + // OpenDirectoryListener has pure-virtual refcounting. NS_DECL_ISUPPORTS_INHERITED virtual void diff --git a/dom/quota/FileStreams.cpp b/dom/quota/FileStreams.cpp index 785a7db2ee48..c455f6b59348 100644 --- a/dom/quota/FileStreams.cpp +++ b/dom/quota/FileStreams.cpp @@ -90,8 +90,6 @@ FileQuotaStreamWithWrite::Write(const char* aBuf, return NS_OK; } -NS_IMPL_ISUPPORTS_INHERITED0(FileInputStream, nsFileInputStream) - already_AddRefed FileInputStream::Create(PersistenceType aPersistenceType, const nsACString& aGroup, const nsACString& aOrigin, @@ -105,8 +103,6 @@ FileInputStream::Create(PersistenceType aPersistenceType, return stream.forget(); } -NS_IMPL_ISUPPORTS_INHERITED0(FileOutputStream, nsFileOutputStream) - already_AddRefed FileOutputStream::Create(PersistenceType aPersistenceType, const nsACString& aGroup, const nsACString& aOrigin, @@ -120,8 +116,6 @@ FileOutputStream::Create(PersistenceType aPersistenceType, return stream.forget(); } -NS_IMPL_ISUPPORTS_INHERITED0(FileStream, nsFileStream) - already_AddRefed FileStream::Create(PersistenceType aPersistenceType, const nsACString& aGroup, const nsACString& aOrigin, nsIFile* aFile, int32_t aIOFlags, diff --git a/dom/quota/FileStreams.h b/dom/quota/FileStreams.h index 67b09fa7d66a..db2683a58b96 100644 --- a/dom/quota/FileStreams.h +++ b/dom/quota/FileStreams.h @@ -61,7 +61,8 @@ protected: class FileInputStream : public FileQuotaStream { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(FileInputStream, + FileQuotaStream) static already_AddRefed Create(PersistenceType aPersistenceType, const nsACString& aGroup, @@ -82,7 +83,8 @@ private: class FileOutputStream : public FileQuotaStreamWithWrite { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(FileOutputStream, + FileQuotaStreamWithWrite); static already_AddRefed Create(PersistenceType aPersistenceType, const nsACString& aGroup, @@ -104,7 +106,8 @@ private: class FileStream : public FileQuotaStreamWithWrite { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(FileStream, + FileQuotaStreamWithWrite) static already_AddRefed Create(PersistenceType aPersistenceType, const nsACString& aGroup, diff --git a/dom/svg/SVGPolyElement.cpp b/dom/svg/SVGPolyElement.cpp index cc442801fecc..4f90a4cfc859 100644 --- a/dom/svg/SVGPolyElement.cpp +++ b/dom/svg/SVGPolyElement.cpp @@ -12,15 +12,6 @@ using namespace mozilla; using namespace mozilla::gfx; -//---------------------------------------------------------------------- -// nsISupports methods - -NS_IMPL_ADDREF_INHERITED(SVGPolyElement,SVGPolyElementBase) -NS_IMPL_RELEASE_INHERITED(SVGPolyElement,SVGPolyElementBase) - -NS_INTERFACE_MAP_BEGIN(SVGPolyElement) -NS_INTERFACE_MAP_END_INHERITING(SVGPolyElementBase) - //---------------------------------------------------------------------- // Implementation diff --git a/dom/svg/SVGPolyElement.h b/dom/svg/SVGPolyElement.h index b76e504be77a..4b707f4aebbc 100644 --- a/dom/svg/SVGPolyElement.h +++ b/dom/svg/SVGPolyElement.h @@ -28,7 +28,7 @@ protected: public: //interfaces - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(SVGPolyElement, SVGPolyElementBase) // nsIContent interface NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override; diff --git a/dom/svg/nsSVGFilters.cpp b/dom/svg/nsSVGFilters.cpp index 58ec57255154..fb1324f14d32 100644 --- a/dom/svg/nsSVGFilters.cpp +++ b/dom/svg/nsSVGFilters.cpp @@ -454,15 +454,6 @@ nsSVGElement::StringInfo nsSVGFELightingElement::sStringInfo[2] = { &nsGkAtoms::in, kNameSpaceID_None, true } }; -//---------------------------------------------------------------------- -// nsISupports methods - -NS_IMPL_ADDREF_INHERITED(nsSVGFELightingElement,nsSVGFELightingElementBase) -NS_IMPL_RELEASE_INHERITED(nsSVGFELightingElement,nsSVGFELightingElementBase) - -NS_INTERFACE_MAP_BEGIN(nsSVGFELightingElement) -NS_INTERFACE_MAP_END_INHERITING(nsSVGFELightingElementBase) - //---------------------------------------------------------------------- // Implementation diff --git a/dom/svg/nsSVGFilters.h b/dom/svg/nsSVGFilters.h index 8c5b3b4cf293..452f8c8fbaf8 100644 --- a/dom/svg/nsSVGFilters.h +++ b/dom/svg/nsSVGFilters.h @@ -183,7 +183,8 @@ protected: public: // interfaces: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsSVGFELightingElement, + nsSVGFELightingElementBase) virtual bool AttributeAffectsRendering( int32_t aNameSpaceID, nsAtom* aAttribute) const override; diff --git a/dom/u2f/U2F.cpp b/dom/u2f/U2F.cpp index af6ca81c7831..9758b7cf5efb 100644 --- a/dom/u2f/U2F.cpp +++ b/dom/u2f/U2F.cpp @@ -462,7 +462,7 @@ U2F::Register(const nsAString& aAppId, void U2F::FinishMakeCredential(const uint64_t& aTransactionId, - nsTArray& aRegBuffer) + const WebAuthnMakeCredentialResult& aResult) { MOZ_ASSERT(NS_IsMainThread()); @@ -483,7 +483,7 @@ U2F::FinishMakeCredential(const uint64_t& aTransactionId, } CryptoBuffer regBuf; - if (NS_WARN_IF(!regBuf.Assign(aRegBuffer))) { + if (NS_WARN_IF(!regBuf.Assign(aResult.RegBuffer()))) { RejectTransaction(NS_ERROR_ABORT); return; } @@ -606,8 +606,7 @@ U2F::Sign(const nsAString& aAppId, void U2F::FinishGetAssertion(const uint64_t& aTransactionId, - nsTArray& aCredentialId, - nsTArray& aSigBuffer) + const WebAuthnGetAssertionResult& aResult) { MOZ_ASSERT(NS_IsMainThread()); @@ -628,13 +627,13 @@ U2F::FinishGetAssertion(const uint64_t& aTransactionId, } CryptoBuffer credBuf; - if (NS_WARN_IF(!credBuf.Assign(aCredentialId))) { + if (NS_WARN_IF(!credBuf.Assign(aResult.CredentialID()))) { RejectTransaction(NS_ERROR_ABORT); return; } CryptoBuffer sigBuf; - if (NS_WARN_IF(!sigBuf.Assign(aSigBuffer))) { + if (NS_WARN_IF(!sigBuf.Assign(aResult.SigBuffer()))) { RejectTransaction(NS_ERROR_ABORT); return; } diff --git a/dom/u2f/U2F.h b/dom/u2f/U2F.h index f554c9a24ff3..69da9fbfdae9 100644 --- a/dom/u2f/U2F.h +++ b/dom/u2f/U2F.h @@ -22,6 +22,9 @@ namespace mozilla { namespace dom { +class WebAuthnMakeCredentialResult; +class WebAuthnGetAssertionResult; + class U2FRegisterCallback; class U2FSignCallback; @@ -122,12 +125,11 @@ public: void FinishMakeCredential(const uint64_t& aTransactionId, - nsTArray& aRegBuffer) override; + const WebAuthnMakeCredentialResult& aResult) override; void FinishGetAssertion(const uint64_t& aTransactionId, - nsTArray& aCredentialId, - nsTArray& aSigBuffer) override; + const WebAuthnGetAssertionResult& aResult) override; void RequestAborted(const uint64_t& aTransactionId, diff --git a/dom/webauthn/PWebAuthnTransaction.ipdl b/dom/webauthn/PWebAuthnTransaction.ipdl index d4d03f0746b0..e18336169749 100644 --- a/dom/webauthn/PWebAuthnTransaction.ipdl +++ b/dom/webauthn/PWebAuthnTransaction.ipdl @@ -43,6 +43,10 @@ struct WebAuthnMakeCredentialInfo { WebAuthnAuthenticatorSelection AuthenticatorSelection; }; +struct WebAuthnMakeCredentialResult { + uint8_t[] RegBuffer; +}; + struct WebAuthnGetAssertionInfo { uint8_t[] RpIdHash; uint8_t[] ClientDataHash; @@ -52,6 +56,11 @@ struct WebAuthnGetAssertionInfo { WebAuthnExtension[] Extensions; }; +struct WebAuthnGetAssertionResult { + uint8_t[] CredentialID; + uint8_t[] SigBuffer; +}; + async protocol PWebAuthnTransaction { manager PBackground; @@ -63,8 +72,8 @@ async protocol PWebAuthnTransaction { child: async __delete__(); - async ConfirmRegister(uint64_t aTransactionId, uint8_t[] RegBuffer); - async ConfirmSign(uint64_t aTransactionId, uint8_t[] CredentialID, uint8_t[] ReplyBuffer); + async ConfirmRegister(uint64_t aTransactionId, WebAuthnMakeCredentialResult aResult); + async ConfirmSign(uint64_t aTransactionId, WebAuthnGetAssertionResult aResult); async Abort(uint64_t aTransactionId, nsresult Error); }; diff --git a/dom/webauthn/U2FHIDTokenManager.cpp b/dom/webauthn/U2FHIDTokenManager.cpp index 26700f001dd0..f0b5febdf661 100644 --- a/dom/webauthn/U2FHIDTokenManager.cpp +++ b/dom/webauthn/U2FHIDTokenManager.cpp @@ -214,7 +214,7 @@ U2FHIDTokenManager::HandleRegisterResult(UniquePtr&& aResult) return; } - U2FRegisterResult result(Move(registration)); + WebAuthnMakeCredentialResult result(registration); mRegisterPromise.Resolve(Move(result), __func__); } @@ -241,7 +241,7 @@ U2FHIDTokenManager::HandleSignResult(UniquePtr&& aResult) return; } - U2FSignResult result(Move(keyHandle), Move(signature)); + WebAuthnGetAssertionResult result(keyHandle, signature); mSignPromise.Resolve(Move(result), __func__); } diff --git a/dom/webauthn/U2FSoftTokenManager.cpp b/dom/webauthn/U2FSoftTokenManager.cpp index dfc8e781973f..c9d0e2abaa4b 100644 --- a/dom/webauthn/U2FSoftTokenManager.cpp +++ b/dom/webauthn/U2FSoftTokenManager.cpp @@ -689,7 +689,7 @@ U2FSoftTokenManager::Register(const nsTArray& aCredent registrationBuf.AppendSECItem(attestCert.get()->derCert); registrationBuf.AppendSECItem(signatureItem); - U2FRegisterResult result((nsTArray(registrationBuf))); + WebAuthnMakeCredentialResult result((nsTArray(registrationBuf))); return U2FRegisterPromise::CreateAndResolve(Move(result), __func__); } @@ -832,7 +832,7 @@ U2FSoftTokenManager::Sign(const nsTArray& aCredentials signatureBuf.AppendSECItem(counterItem); signatureBuf.AppendSECItem(signatureItem); - U2FSignResult result(Move(keyHandle), nsTArray(signatureBuf)); + WebAuthnGetAssertionResult result(keyHandle, nsTArray(signatureBuf)); return U2FSignPromise::CreateAndResolve(Move(result), __func__); } diff --git a/dom/webauthn/U2FTokenManager.cpp b/dom/webauthn/U2FTokenManager.cpp index 8bc858469555..c33f98167ef7 100644 --- a/dom/webauthn/U2FTokenManager.cpp +++ b/dom/webauthn/U2FTokenManager.cpp @@ -251,7 +251,7 @@ U2FTokenManager::Register(PWebAuthnTransactionParent* aTransactionParent, aTransactionInfo.ClientDataHash(), aTransactionInfo.TimeoutMS()) ->Then(GetCurrentThreadSerialEventTarget(), __func__, - [tid, startTime](U2FRegisterResult&& aResult) { + [tid, startTime](WebAuthnMakeCredentialResult&& aResult) { U2FTokenManager* mgr = U2FTokenManager::Get(); mgr->MaybeConfirmRegister(tid, aResult); Telemetry::ScalarAdd( @@ -274,15 +274,12 @@ U2FTokenManager::Register(PWebAuthnTransactionParent* aTransactionParent, void U2FTokenManager::MaybeConfirmRegister(const uint64_t& aTransactionId, - U2FRegisterResult& aResult) + const WebAuthnMakeCredentialResult& aResult) { MOZ_ASSERT(mLastTransactionId == aTransactionId); mRegisterPromise.Complete(); - nsTArray registration; - aResult.ConsumeRegistration(registration); - - Unused << mTransactionParent->SendConfirmRegister(aTransactionId, registration); + Unused << mTransactionParent->SendConfirmRegister(aTransactionId, aResult); ClearTransaction(); } @@ -325,7 +322,7 @@ U2FTokenManager::Sign(PWebAuthnTransactionParent* aTransactionParent, aTransactionInfo.RequireUserVerification(), aTransactionInfo.TimeoutMS()) ->Then(GetCurrentThreadSerialEventTarget(), __func__, - [tid, startTime](U2FSignResult&& aResult) { + [tid, startTime](WebAuthnGetAssertionResult&& aResult) { U2FTokenManager* mgr = U2FTokenManager::Get(); mgr->MaybeConfirmSign(tid, aResult); Telemetry::ScalarAdd( @@ -348,17 +345,12 @@ U2FTokenManager::Sign(PWebAuthnTransactionParent* aTransactionParent, void U2FTokenManager::MaybeConfirmSign(const uint64_t& aTransactionId, - U2FSignResult& aResult) + const WebAuthnGetAssertionResult& aResult) { MOZ_ASSERT(mLastTransactionId == aTransactionId); mSignPromise.Complete(); - nsTArray keyHandle; - aResult.ConsumeKeyHandle(keyHandle); - nsTArray signature; - aResult.ConsumeSignature(signature); - - Unused << mTransactionParent->SendConfirmSign(aTransactionId, keyHandle, signature); + Unused << mTransactionParent->SendConfirmSign(aTransactionId, aResult); ClearTransaction(); } diff --git a/dom/webauthn/U2FTokenManager.h b/dom/webauthn/U2FTokenManager.h index 715041b78382..7eea0f9d67ab 100644 --- a/dom/webauthn/U2FTokenManager.h +++ b/dom/webauthn/U2FTokenManager.h @@ -8,6 +8,7 @@ #define mozilla_dom_U2FTokenManager_h #include "mozilla/dom/U2FTokenTransport.h" +#include "mozilla/dom/PWebAuthnTransaction.h" /* * Parent process manager for U2F and WebAuthn API transactions. Handles process @@ -46,9 +47,11 @@ private: RefPtr GetTokenManagerImpl(); void AbortTransaction(const uint64_t& aTransactionId, const nsresult& aError); void ClearTransaction(); - void MaybeConfirmRegister(const uint64_t& aTransactionId, U2FRegisterResult& aResult); + void MaybeConfirmRegister(const uint64_t& aTransactionId, + const WebAuthnMakeCredentialResult& aResult); void MaybeAbortRegister(const uint64_t& aTransactionId, const nsresult& aError); - void MaybeConfirmSign(const uint64_t& aTransactionId, U2FSignResult& aResult); + void MaybeConfirmSign(const uint64_t& aTransactionId, + const WebAuthnGetAssertionResult& aResult); void MaybeAbortSign(const uint64_t& aTransactionId, const nsresult& aError); // Using a raw pointer here, as the lifetime of the IPC object is managed by // the PBackground protocol code. This means we cannot be left holding an diff --git a/dom/webauthn/U2FTokenTransport.h b/dom/webauthn/U2FTokenTransport.h index 2f7fbbd8428e..d9f63e01499f 100644 --- a/dom/webauthn/U2FTokenTransport.h +++ b/dom/webauthn/U2FTokenTransport.h @@ -18,43 +18,8 @@ namespace mozilla { namespace dom { -class U2FRegisterResult { -public: - explicit U2FRegisterResult(nsTArray&& aRegistration) - : mRegistration(aRegistration) - { } - - void ConsumeRegistration(nsTArray& aBuffer) { - aBuffer = Move(mRegistration); - } - -private: - nsTArray mRegistration; -}; - -class U2FSignResult { -public: - explicit U2FSignResult(nsTArray&& aKeyHandle, - nsTArray&& aSignature) - : mKeyHandle(aKeyHandle) - , mSignature(aSignature) - { } - - void ConsumeKeyHandle(nsTArray& aBuffer) { - aBuffer = Move(mKeyHandle); - } - - void ConsumeSignature(nsTArray& aBuffer) { - aBuffer = Move(mSignature); - } - -private: - nsTArray mKeyHandle; - nsTArray mSignature; -}; - -typedef MozPromise U2FRegisterPromise; -typedef MozPromise U2FSignPromise; +typedef MozPromise U2FRegisterPromise; +typedef MozPromise U2FSignPromise; class U2FTokenTransport { diff --git a/dom/webauthn/WebAuthnManager.cpp b/dom/webauthn/WebAuthnManager.cpp index 8d314d5c23d3..6e601b672c30 100644 --- a/dom/webauthn/WebAuthnManager.cpp +++ b/dom/webauthn/WebAuthnManager.cpp @@ -650,7 +650,7 @@ WebAuthnManager::Store(const Credential& aCredential) void WebAuthnManager::FinishMakeCredential(const uint64_t& aTransactionId, - nsTArray& aRegBuffer) + const WebAuthnMakeCredentialResult& aResult) { MOZ_ASSERT(NS_IsMainThread()); @@ -660,7 +660,8 @@ WebAuthnManager::FinishMakeCredential(const uint64_t& aTransactionId, } CryptoBuffer regData; - if (NS_WARN_IF(!regData.Assign(aRegBuffer.Elements(), aRegBuffer.Length()))) { + if (NS_WARN_IF(!regData.Assign(aResult.RegBuffer().Elements(), + aResult.RegBuffer().Length()))) { RejectTransaction(NS_ERROR_OUT_OF_MEMORY); return; } @@ -783,8 +784,7 @@ WebAuthnManager::FinishMakeCredential(const uint64_t& aTransactionId, void WebAuthnManager::FinishGetAssertion(const uint64_t& aTransactionId, - nsTArray& aCredentialId, - nsTArray& aSigBuffer) + const WebAuthnGetAssertionResult& aResult) { MOZ_ASSERT(NS_IsMainThread()); @@ -794,8 +794,8 @@ WebAuthnManager::FinishGetAssertion(const uint64_t& aTransactionId, } CryptoBuffer tokenSignatureData; - if (NS_WARN_IF(!tokenSignatureData.Assign(aSigBuffer.Elements(), - aSigBuffer.Length()))) { + if (NS_WARN_IF(!tokenSignatureData.Assign(aResult.SigBuffer().Elements(), + aResult.SigBuffer().Length()))) { RejectTransaction(NS_ERROR_OUT_OF_MEMORY); return; } @@ -833,7 +833,7 @@ WebAuthnManager::FinishGetAssertion(const uint64_t& aTransactionId, } CryptoBuffer credentialBuf; - if (!credentialBuf.Assign(aCredentialId)) { + if (!credentialBuf.Assign(aResult.CredentialID())) { RejectTransaction(NS_ERROR_OUT_OF_MEMORY); return; } diff --git a/dom/webauthn/WebAuthnManager.h b/dom/webauthn/WebAuthnManager.h index f15906239891..23bf7b76e21a 100644 --- a/dom/webauthn/WebAuthnManager.h +++ b/dom/webauthn/WebAuthnManager.h @@ -123,12 +123,11 @@ public: void FinishMakeCredential(const uint64_t& aTransactionId, - nsTArray& aRegBuffer) override; + const WebAuthnMakeCredentialResult& aResult) override; void FinishGetAssertion(const uint64_t& aTransactionId, - nsTArray& aCredentialId, - nsTArray& aSigBuffer) override; + const WebAuthnGetAssertionResult& aResult) override; void RequestAborted(const uint64_t& aTransactionId, diff --git a/dom/webauthn/WebAuthnManagerBase.h b/dom/webauthn/WebAuthnManagerBase.h index 1c65fa851e02..0ac512e5c714 100644 --- a/dom/webauthn/WebAuthnManagerBase.h +++ b/dom/webauthn/WebAuthnManagerBase.h @@ -18,6 +18,8 @@ namespace mozilla { namespace dom { class WebAuthnTransactionChild; +class WebAuthnMakeCredentialResult; +class WebAuthnGetAssertionResult; class WebAuthnManagerBase : public nsIDOMEventListener { @@ -28,12 +30,11 @@ public: virtual void FinishMakeCredential(const uint64_t& aTransactionId, - nsTArray& aRegBuffer) = 0; + const WebAuthnMakeCredentialResult& aResult) = 0; virtual void FinishGetAssertion(const uint64_t& aTransactionId, - nsTArray& aCredentialId, - nsTArray& aSigBuffer) = 0; + const WebAuthnGetAssertionResult& aResult) = 0; virtual void RequestAborted(const uint64_t& aTransactionId, diff --git a/dom/webauthn/WebAuthnTransactionChild.cpp b/dom/webauthn/WebAuthnTransactionChild.cpp index 6ac7683d86c6..3f1f6d889df3 100644 --- a/dom/webauthn/WebAuthnTransactionChild.cpp +++ b/dom/webauthn/WebAuthnTransactionChild.cpp @@ -22,26 +22,25 @@ WebAuthnTransactionChild::WebAuthnTransactionChild(WebAuthnManagerBase* aManager mozilla::ipc::IPCResult WebAuthnTransactionChild::RecvConfirmRegister(const uint64_t& aTransactionId, - nsTArray&& aRegBuffer) + const WebAuthnMakeCredentialResult& aResult) { if (NS_WARN_IF(!mManager)) { return IPC_FAIL_NO_REASON(this); } - mManager->FinishMakeCredential(aTransactionId, aRegBuffer); + mManager->FinishMakeCredential(aTransactionId, aResult); return IPC_OK(); } mozilla::ipc::IPCResult WebAuthnTransactionChild::RecvConfirmSign(const uint64_t& aTransactionId, - nsTArray&& aCredentialId, - nsTArray&& aBuffer) + const WebAuthnGetAssertionResult& aResult) { if (NS_WARN_IF(!mManager)) { return IPC_FAIL_NO_REASON(this); } - mManager->FinishGetAssertion(aTransactionId, aCredentialId, aBuffer); + mManager->FinishGetAssertion(aTransactionId, aResult); return IPC_OK(); } diff --git a/dom/webauthn/WebAuthnTransactionChild.h b/dom/webauthn/WebAuthnTransactionChild.h index d8641f807f4d..c5231a77ed94 100644 --- a/dom/webauthn/WebAuthnTransactionChild.h +++ b/dom/webauthn/WebAuthnTransactionChild.h @@ -28,12 +28,11 @@ public: mozilla::ipc::IPCResult RecvConfirmRegister(const uint64_t& aTransactionId, - nsTArray&& aRegBuffer) override; + const WebAuthnMakeCredentialResult& aResult) override; mozilla::ipc::IPCResult RecvConfirmSign(const uint64_t& aTransactionId, - nsTArray&& aCredentialId, - nsTArray&& aBuffer) override; + const WebAuthnGetAssertionResult& aResult) override; mozilla::ipc::IPCResult RecvAbort(const uint64_t& aTransactionId, const nsresult& aError) override; diff --git a/dom/webidl/PerformanceObserver.webidl b/dom/webidl/PerformanceObserver.webidl index e275904e8693..7e6f370de017 100644 --- a/dom/webidl/PerformanceObserver.webidl +++ b/dom/webidl/PerformanceObserver.webidl @@ -15,7 +15,7 @@ dictionary PerformanceObserverInit { callback PerformanceObserverCallback = void (PerformanceObserverEntryList entries, PerformanceObserver observer); -[Func="Performance::IsObserverEnabled", +[Func="mozilla::dom::DOMPrefs::PerformanceObserverEnabled", Constructor(PerformanceObserverCallback callback), Exposed=(Window,Worker)] interface PerformanceObserver { diff --git a/dom/webidl/PerformanceObserverEntryList.webidl b/dom/webidl/PerformanceObserverEntryList.webidl index cff4ee1b034a..e944535d233a 100644 --- a/dom/webidl/PerformanceObserverEntryList.webidl +++ b/dom/webidl/PerformanceObserverEntryList.webidl @@ -14,7 +14,8 @@ dictionary PerformanceEntryFilterOptions { DOMString initiatorType; }; -[Func="Performance::IsObserverEnabled", Exposed=(Window,Worker)] +[Func="mozilla::dom::DOMPrefs::PerformanceObserverEnabled", + Exposed=(Window,Worker)] interface PerformanceObserverEntryList { PerformanceEntryList getEntries(optional PerformanceEntryFilterOptions filter); PerformanceEntryList getEntriesByType(DOMString entryType); diff --git a/dom/workers/RuntimeService.cpp b/dom/workers/RuntimeService.cpp index 4bdc67d6bb0e..abab0cbcaaf4 100644 --- a/dom/workers/RuntimeService.cpp +++ b/dom/workers/RuntimeService.cpp @@ -1170,7 +1170,7 @@ class WorkerThreadPrimaryRunnable final : public Runnable MOZ_ASSERT(mThread); } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(FinishedRunnable, Runnable) private: ~FinishedRunnable() @@ -1192,7 +1192,7 @@ public: MOZ_ASSERT(aThread); } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(WorkerThreadPrimaryRunnable, Runnable) private: ~WorkerThreadPrimaryRunnable() @@ -2662,8 +2662,6 @@ LogViolationDetailsRunnable::MainThreadRun() return true; } -NS_IMPL_ISUPPORTS_INHERITED0(WorkerThreadPrimaryRunnable, Runnable) - NS_IMETHODIMP WorkerThreadPrimaryRunnable::Run() { @@ -2792,9 +2790,6 @@ WorkerThreadPrimaryRunnable::Run() return NS_OK; } -NS_IMPL_ISUPPORTS_INHERITED0(WorkerThreadPrimaryRunnable::FinishedRunnable, - Runnable) - NS_IMETHODIMP WorkerThreadPrimaryRunnable::FinishedRunnable::Run() { diff --git a/dom/workers/WorkerLoadInfo.cpp b/dom/workers/WorkerLoadInfo.cpp index 5603abc3034b..f9fe6b5ce778 100644 --- a/dom/workers/WorkerLoadInfo.cpp +++ b/dom/workers/WorkerLoadInfo.cpp @@ -40,7 +40,7 @@ public: mLoadGroupToCancel.swap(aLoadGroupToCancel); } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(MainThreadReleaseRunnable, Runnable) NS_IMETHOD Run() override @@ -83,8 +83,6 @@ SwapToISupportsArray(SmartPtr& aSrc, } // anonymous -NS_IMPL_ISUPPORTS_INHERITED0(MainThreadReleaseRunnable, Runnable) - WorkerLoadInfo::WorkerLoadInfo() : mLoadFlags(nsIRequest::LOAD_NORMAL) , mWindowID(UINT64_MAX) diff --git a/dom/workers/WorkerPrivate.cpp b/dom/workers/WorkerPrivate.cpp index decb33a23d7f..171370368501 100644 --- a/dom/workers/WorkerPrivate.cpp +++ b/dom/workers/WorkerPrivate.cpp @@ -149,7 +149,7 @@ public: MOZ_ASSERT(aWrappedRunnable); } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ExternalRunnableWrapper, WorkerRunnable) private: ~ExternalRunnableWrapper() @@ -266,7 +266,7 @@ public: aFinishedWorker->AssertIsOnWorkerThread(); } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(TopLevelWorkerFinishedRunnable, Runnable) private: ~TopLevelWorkerFinishedRunnable() {} @@ -961,9 +961,6 @@ public: } /* anonymous namespace */ -NS_IMPL_ISUPPORTS_INHERITED0(TopLevelWorkerFinishedRunnable, Runnable) - - class WorkerPrivate::EventTarget final : public nsISerialEventTarget { // This mutex protects mWorkerPrivate and must be acquired *before* the @@ -5249,8 +5246,6 @@ WorkerPrivate::GetPerformanceStorage() return mPerformanceStorage; } -NS_IMPL_ISUPPORTS_INHERITED0(ExternalRunnableWrapper, WorkerRunnable) - NS_IMPL_ADDREF(WorkerPrivate::EventTarget) NS_IMPL_RELEASE(WorkerPrivate::EventTarget) diff --git a/dom/workers/WorkerRunnable.cpp b/dom/workers/WorkerRunnable.cpp index e14222e52e5b..352dfb150dee 100644 --- a/dom/workers/WorkerRunnable.cpp +++ b/dom/workers/WorkerRunnable.cpp @@ -563,8 +563,6 @@ WorkerControlRunnable::DispatchInternal() return NS_SUCCEEDED(mWorkerPrivate->DispatchToMainThread(runnable.forget())); } -NS_IMPL_ISUPPORTS_INHERITED0(WorkerControlRunnable, WorkerRunnable) - WorkerMainThreadRunnable::WorkerMainThreadRunnable( WorkerPrivate* aWorkerPrivate, const nsACString& aTelemetryKey) @@ -626,24 +624,6 @@ WorkerMainThreadRunnable::Run() return NS_OK; } -WorkerCheckAPIExposureOnMainThreadRunnable::WorkerCheckAPIExposureOnMainThreadRunnable(WorkerPrivate* aWorkerPrivate): - WorkerMainThreadRunnable(aWorkerPrivate, - NS_LITERAL_CSTRING("WorkerCheckAPIExposureOnMainThread")) -{} - -WorkerCheckAPIExposureOnMainThreadRunnable::~WorkerCheckAPIExposureOnMainThreadRunnable() -{} - -bool -WorkerCheckAPIExposureOnMainThreadRunnable::Dispatch() -{ - ErrorResult rv; - WorkerMainThreadRunnable::Dispatch(Terminating, rv); - bool ok = !rv.Failed(); - rv.SuppressException(); - return ok; -} - bool WorkerSameThreadRunnable::PreDispatch(WorkerPrivate* aWorkerPrivate) { diff --git a/dom/workers/WorkerRunnable.h b/dom/workers/WorkerRunnable.h index 29b570e29683..3da6b939c9a0 100644 --- a/dom/workers/WorkerRunnable.h +++ b/dom/workers/WorkerRunnable.h @@ -296,7 +296,7 @@ protected: Cancel() override; public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(WorkerControlRunnable, WorkerRunnable) private: virtual bool @@ -457,27 +457,6 @@ protected: UniquePtr mWorkerHolder; }; -// Class for checking API exposure. This totally violates the "MUST" in the -// comments on WorkerMainThreadRunnable::Dispatch, because API exposure checks -// can't throw. Maybe we should change it so they _could_ throw. But for now -// we are bad people and should be ashamed of ourselves. Let's hope none of -// them happen while a worker is shutting down. -// -// Do NOT copy what this class is doing elsewhere. Just don't. -class WorkerCheckAPIExposureOnMainThreadRunnable - : public WorkerMainThreadRunnable -{ -public: - explicit - WorkerCheckAPIExposureOnMainThreadRunnable(WorkerPrivate* aWorkerPrivate); - virtual - ~WorkerCheckAPIExposureOnMainThreadRunnable(); - - // Returns whether the dispatch succeeded. If this returns false, the API - // should not be exposed. - bool Dispatch(); -}; - // This runnable is used to stop a sync loop and it's meant to be used on the // main-thread only. As sync loops keep the busy count incremented as long as // they run this runnable does not modify the busy count diff --git a/dom/workers/WorkerThread.cpp b/dom/workers/WorkerThread.cpp index 7cb4e6d1d4b5..c0610dcd99ae 100644 --- a/dom/workers/WorkerThread.cpp +++ b/dom/workers/WorkerThread.cpp @@ -207,8 +207,6 @@ WorkerThread::DispatchAnyThread(const WorkerThreadFriendKey& /* aKey */, return NS_OK; } -NS_IMPL_ISUPPORTS_INHERITED0(WorkerThread, nsThread) - NS_IMETHODIMP WorkerThread::DispatchFromScript(nsIRunnable* aRunnable, uint32_t aFlags) { diff --git a/dom/workers/WorkerThread.h b/dom/workers/WorkerThread.h index 978f6ccd7610..cb824b57c5a7 100644 --- a/dom/workers/WorkerThread.h +++ b/dom/workers/WorkerThread.h @@ -81,7 +81,7 @@ public: uint32_t RecursionDepth(const WorkerThreadFriendKey& aKey) const; - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(WorkerThread, nsThread) private: WorkerThread(); diff --git a/editor/composer/nsComposerCommands.cpp b/editor/composer/nsComposerCommands.cpp index c6ecd9444439..b286ac1d035d 100644 --- a/editor/composer/nsComposerCommands.cpp +++ b/editor/composer/nsComposerCommands.cpp @@ -75,8 +75,6 @@ nsBaseStateUpdatingCommand::~nsBaseStateUpdatingCommand() { } -NS_IMPL_ISUPPORTS_INHERITED0(nsBaseStateUpdatingCommand, nsBaseComposerCommand) - NS_IMETHODIMP nsBaseStateUpdatingCommand::IsCommandEnabled(const char *aCommandName, nsISupports *refCon, @@ -585,8 +583,6 @@ nsMultiStateCommand::~nsMultiStateCommand() { } -NS_IMPL_ISUPPORTS_INHERITED0(nsMultiStateCommand, nsBaseComposerCommand) - NS_IMETHODIMP nsMultiStateCommand::IsCommandEnabled(const char * aCommandName, nsISupports *refCon, @@ -1416,8 +1412,6 @@ nsInsertHTMLCommand::GetCommandStateParams(const char *aCommandName, return aParams->SetBooleanValue(STATE_ENABLED, outCmdEnabled); } -NS_IMPL_ISUPPORTS_INHERITED0(nsInsertTagCommand, nsBaseComposerCommand) - nsInsertTagCommand::nsInsertTagCommand(nsAtom* aTagName) : nsBaseComposerCommand() , mTagName(aTagName) diff --git a/editor/composer/nsComposerCommands.h b/editor/composer/nsComposerCommands.h index a007a333c78a..ade2361e194f 100644 --- a/editor/composer/nsComposerCommands.h +++ b/editor/composer/nsComposerCommands.h @@ -60,7 +60,8 @@ class nsBaseStateUpdatingCommand : public nsBaseComposerCommand public: explicit nsBaseStateUpdatingCommand(nsAtom* aTagName); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsBaseStateUpdatingCommand, + nsBaseComposerCommand) NS_DECL_NSICONTROLLERCOMMAND @@ -102,7 +103,7 @@ class nsInsertTagCommand : public nsBaseComposerCommand public: explicit nsInsertTagCommand(nsAtom* aTagName); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsInsertTagCommand, nsBaseComposerCommand) NS_DECL_NSICONTROLLERCOMMAND @@ -150,7 +151,7 @@ public: nsMultiStateCommand(); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsMultiStateCommand, nsBaseComposerCommand) NS_DECL_NSICONTROLLERCOMMAND protected: diff --git a/gfx/thebes/gfxFontInfoLoader.cpp b/gfx/thebes/gfxFontInfoLoader.cpp index 3faaee3a7e10..0957bee70200 100644 --- a/gfx/thebes/gfxFontInfoLoader.cpp +++ b/gfx/thebes/gfxFontInfoLoader.cpp @@ -42,7 +42,8 @@ FontInfoData::Load() class FontInfoLoadCompleteEvent : public Runnable { virtual ~FontInfoLoadCompleteEvent() {} - NS_DECL_ISUPPORTS_INHERITED +public: + NS_INLINE_DECL_REFCOUNTING_INHERITED(FontInfoLoadCompleteEvent, Runnable) explicit FontInfoLoadCompleteEvent(FontInfoData* aFontInfo) : mozilla::Runnable("FontInfoLoadCompleteEvent") @@ -51,13 +52,15 @@ class FontInfoLoadCompleteEvent : public Runnable { NS_IMETHOD Run() override; +private: RefPtr mFontInfo; }; class AsyncFontInfoLoader : public Runnable { virtual ~AsyncFontInfoLoader() {} - NS_DECL_ISUPPORTS_INHERITED +public: + NS_INLINE_DECL_REFCOUNTING_INHERITED(AsyncFontInfoLoader, Runnable) explicit AsyncFontInfoLoader(FontInfoData* aFontInfo) : mozilla::Runnable("AsyncFontInfoLoader") @@ -68,6 +71,7 @@ class AsyncFontInfoLoader : public Runnable { NS_IMETHOD Run() override; +private: RefPtr mFontInfo; RefPtr mCompleteEvent; }; @@ -75,7 +79,8 @@ class AsyncFontInfoLoader : public Runnable { class ShutdownThreadEvent : public Runnable { virtual ~ShutdownThreadEvent() {} - NS_DECL_ISUPPORTS_INHERITED +public: + NS_INLINE_DECL_REFCOUNTING_INHERITED(ShutdownThreadEvent, Runnable) explicit ShutdownThreadEvent(nsIThread* aThread) : mozilla::Runnable("ShutdownThreadEvent") @@ -86,11 +91,11 @@ class ShutdownThreadEvent : public Runnable { mThread->Shutdown(); return NS_OK; } + +private: nsCOMPtr mThread; }; -NS_IMPL_ISUPPORTS_INHERITED0(ShutdownThreadEvent, Runnable); - // runs on main thread after async font info loading is done nsresult FontInfoLoadCompleteEvent::Run() @@ -103,8 +108,6 @@ FontInfoLoadCompleteEvent::Run() return NS_OK; } -NS_IMPL_ISUPPORTS_INHERITED0(FontInfoLoadCompleteEvent, Runnable); - // runs on separate thread nsresult AsyncFontInfoLoader::Run() @@ -118,8 +121,6 @@ AsyncFontInfoLoader::Run() return NS_OK; } -NS_IMPL_ISUPPORTS_INHERITED0(AsyncFontInfoLoader, Runnable); - NS_IMPL_ISUPPORTS(gfxFontInfoLoader::ShutdownObserver, nsIObserver) NS_IMETHODIMP diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp index 7d5257b50af9..1f3ee4c4674b 100644 --- a/gfx/thebes/gfxPlatform.cpp +++ b/gfx/thebes/gfxPlatform.cpp @@ -305,7 +305,8 @@ class LogForwarderEvent : public Runnable { ~LogForwarderEvent() override = default; - NS_DECL_ISUPPORTS_INHERITED +public: + NS_INLINE_DECL_REFCOUNTING_INHERITED(LogForwarderEvent, Runnable) explicit LogForwarderEvent(const nsCString& aMessage) : mozilla::Runnable("LogForwarderEvent") @@ -331,8 +332,6 @@ protected: nsCString mMessage; }; -NS_IMPL_ISUPPORTS_INHERITED0(LogForwarderEvent, Runnable); - void CrashStatsLogForwarder::Log(const std::string& aString) { MutexAutoLock lock(mMutex); @@ -363,7 +362,8 @@ class CrashTelemetryEvent : public Runnable { ~CrashTelemetryEvent() override = default; - NS_DECL_ISUPPORTS_INHERITED +public: + NS_INLINE_DECL_REFCOUNTING_INHERITED(CrashTelemetryEvent, Runnable) explicit CrashTelemetryEvent(uint32_t aReason) : mozilla::Runnable("CrashTelemetryEvent") @@ -381,8 +381,6 @@ protected: uint32_t mReason; }; -NS_IMPL_ISUPPORTS_INHERITED0(CrashTelemetryEvent, Runnable); - void CrashStatsLogForwarder::CrashAction(LogReason aReason) { diff --git a/image/ClippedImage.cpp b/image/ClippedImage.cpp index 86509b79cef3..9b41e2fcdce9 100644 --- a/image/ClippedImage.cpp +++ b/image/ClippedImage.cpp @@ -210,8 +210,6 @@ ClippedImage::ShouldClip() return *mShouldClip; } -NS_IMPL_ISUPPORTS_INHERITED0(ClippedImage, ImageWrapper) - NS_IMETHODIMP ClippedImage::GetWidth(int32_t* aWidth) { diff --git a/image/ClippedImage.h b/image/ClippedImage.h index 8e763d5128c4..53d2dbfd58d6 100644 --- a/image/ClippedImage.h +++ b/image/ClippedImage.h @@ -30,7 +30,7 @@ class ClippedImage : public ImageWrapper typedef gfx::SourceSurface SourceSurface; public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ClippedImage, ImageWrapper) NS_IMETHOD GetWidth(int32_t* aWidth) override; NS_IMETHOD GetHeight(int32_t* aHeight) override; diff --git a/image/FrozenImage.cpp b/image/FrozenImage.cpp index f144c68cd32e..5352424f59bc 100644 --- a/image/FrozenImage.cpp +++ b/image/FrozenImage.cpp @@ -13,8 +13,6 @@ using layers::LayerManager; namespace image { -NS_IMPL_ISUPPORTS_INHERITED0(FrozenImage, ImageWrapper) - void FrozenImage::IncrementAnimationConsumers() { diff --git a/image/FrozenImage.h b/image/FrozenImage.h index e026b330ad3d..c6dd39ab3170 100644 --- a/image/FrozenImage.h +++ b/image/FrozenImage.h @@ -29,7 +29,7 @@ class FrozenImage : public ImageWrapper typedef gfx::SourceSurface SourceSurface; public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(FrozenImage, ImageWrapper) virtual void IncrementAnimationConsumers() override; virtual void DecrementAnimationConsumers() override; diff --git a/image/MultipartImage.h b/image/MultipartImage.h index d3d0647a46b0..c2209c66aae4 100644 --- a/image/MultipartImage.h +++ b/image/MultipartImage.h @@ -25,6 +25,8 @@ class MultipartImage { public: MOZ_DECLARE_REFCOUNTED_TYPENAME(MultipartImage) + // We need to always declare refcounting here, because + // IProgressObserver has pure-virtual refcounting. NS_DECL_ISUPPORTS_INHERITED void BeginTransitionToPart(Image* aNextPart); diff --git a/image/OrientedImage.cpp b/image/OrientedImage.cpp index f7d06974b716..387171f93ff5 100644 --- a/image/OrientedImage.cpp +++ b/image/OrientedImage.cpp @@ -24,8 +24,6 @@ using layers::ImageContainer; namespace image { -NS_IMPL_ISUPPORTS_INHERITED0(OrientedImage, ImageWrapper) - NS_IMETHODIMP OrientedImage::GetWidth(int32_t* aWidth) { diff --git a/image/OrientedImage.h b/image/OrientedImage.h index fdae18751e98..30d8db90fd9c 100644 --- a/image/OrientedImage.h +++ b/image/OrientedImage.h @@ -26,7 +26,7 @@ class OrientedImage : public ImageWrapper typedef gfx::SourceSurface SourceSurface; public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(OrientedImage, ImageWrapper) NS_IMETHOD GetWidth(int32_t* aWidth) override; NS_IMETHOD GetHeight(int32_t* aHeight) override; diff --git a/image/test/mochitest/test_animSVGImage.html b/image/test/mochitest/test_animSVGImage.html index d73790503a2d..d5097e5efb3f 100644 --- a/image/test/mochitest/test_animSVGImage.html +++ b/image/test/mochitest/test_animSVGImage.html @@ -23,6 +23,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=610419 /** Test for Bug 610419**/ SimpleTest.requestFlakyTimeout("Pre-existing timeouts when converting from mochitest-chrome"); +SimpleTest.requestCompleteLog(); SimpleTest.waitForExplicitFinish(); const FAILURE_TIMEOUT = 120000; // Fail early after 120 seconds (2 minutes) @@ -80,7 +81,7 @@ function myPoll() { } } else - setTimeout(myPoll, 1); + setTimeout(myPoll, 20); } function failTest() { diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp index 5e7bb2425d17..57157ff065c0 100644 --- a/js/src/frontend/TokenStream.cpp +++ b/js/src/frontend/TokenStream.cpp @@ -985,11 +985,12 @@ TokenStreamSpecific::error(unsigned errorNumber, ...) va_list args; va_start(args, errorNumber); - TokenStreamAnyChars& anyChars = anyCharsAccess(); ErrorMetadata metadata; - if (computeErrorMetadata(&metadata, anyChars.currentToken().pos.begin)) + if (computeErrorMetadata(&metadata, userbuf.offset())) { + TokenStreamAnyChars& anyChars = anyCharsAccess(); ReportCompileError(anyChars.cx, Move(metadata), nullptr, JSREPORT_ERROR, errorNumber, args); + } va_end(args); } @@ -1001,11 +1002,12 @@ TokenStreamSpecific::errorAt(uint32_t offset, unsigned er va_list args; va_start(args, errorNumber); - TokenStreamAnyChars& anyChars = anyCharsAccess(); ErrorMetadata metadata; - if (computeErrorMetadata(&metadata, offset)) + if (computeErrorMetadata(&metadata, offset)) { + TokenStreamAnyChars& anyChars = anyCharsAccess(); ReportCompileError(anyChars.cx, Move(metadata), nullptr, JSREPORT_ERROR, errorNumber, args); + } va_end(args); } @@ -1292,12 +1294,22 @@ IsTokenSane(Token* tp) template<> MOZ_MUST_USE bool -TokenStreamCharsBase::appendMultiUnitCodepointToTokenbuf(uint32_t codepoint) +TokenStreamCharsBase::appendCodePointToTokenbuf(uint32_t codePoint) { - char16_t lead, trail; - unicode::UTF16Encode(codepoint, &lead, &trail); + char16_t units[2]; + unsigned numUnits = 0; + unicode::UTF16Encode(codePoint, units, &numUnits); - return tokenbuf.append(lead) && tokenbuf.append(trail); + MOZ_ASSERT(numUnits == 1 || numUnits == 2, + "UTF-16 code points are only encoded in one or two units"); + + if (!tokenbuf.append(units[0])) + return false; + + if (numUnits == 1) + return true; + + return tokenbuf.append(units[1]); } template @@ -1340,31 +1352,16 @@ TokenStreamSpecific::putIdentInTokenbuf(const CharT* iden if (codePoint) { if (!unicode::IsIdentifierPart(codePoint)) break; - - if (!appendMultiUnitCodepointToTokenbuf(codePoint)) - return false; - - continue; - } - - if (!unicode::IsIdentifierPart(char16_t(c))) { - uint32_t qc; - if (c != '\\' || !matchUnicodeEscapeIdent(&qc)) - break; - - if (MOZ_UNLIKELY(unicode::IsSupplementary(qc))) { - char16_t lead, trail; - unicode::UTF16Encode(qc, &lead, &trail); - if (!tokenbuf.append(lead) || !tokenbuf.append(trail)) - return false; - - continue; + } else { + if (unicode::IsIdentifierPart(char16_t(c))) { + codePoint = c; + } else { + if (c != '\\' || !matchUnicodeEscapeIdent(&codePoint)) + break; } - - c = qc; } - if (!tokenbuf.append(c)) + if (!appendCodePointToTokenbuf(codePoint)) return false; } @@ -1708,7 +1705,7 @@ TokenStreamSpecific::getTokenInternal(TokenKind* ttp, Mod // Look for a string or a template string. // if (c1kind == String) { - if (!getStringOrTemplateToken(c, &tp)) + if (!getStringOrTemplateToken(static_cast(c), &tp)) goto error; goto out; } @@ -2132,8 +2129,11 @@ TokenStreamSpecific::getTokenInternal(TokenKind* ttp, Mod template bool -TokenStreamSpecific::getStringOrTemplateToken(int untilChar, Token** tp) +TokenStreamSpecific::getStringOrTemplateToken(char untilChar, Token** tp) { + MOZ_ASSERT(untilChar == '\'' || untilChar == '"' || untilChar == '`', + "unexpected string/template literal delimiter"); + int c; int nc = -1; @@ -2148,7 +2148,8 @@ TokenStreamSpecific::getStringOrTemplateToken(int untilCh while ((c = getCharIgnoreEOL()) != untilChar) { if (c == EOF) { ungetCharIgnoreEOL(c); - error(JSMSG_UNTERMINATED_STRING); + const char delimiters[] = { untilChar, untilChar, '\0' }; + error(JSMSG_EOF_BEFORE_END_OF_LITERAL, delimiters); return false; } @@ -2160,7 +2161,13 @@ TokenStreamSpecific::getStringOrTemplateToken(int untilCh if (!getChar(&c)) return false; - switch (c) { + if (c == EOF) { + const char delimiters[] = { untilChar, untilChar, '\0' }; + error(JSMSG_EOF_IN_ESCAPE_IN_LITERAL, delimiters); + return false; + } + + switch (static_cast(c)) { case 'b': c = '\b'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; @@ -2346,7 +2353,8 @@ TokenStreamSpecific::getStringOrTemplateToken(int untilCh } else if (TokenBuf::isRawEOLChar(c)) { if (!parsingTemplate) { ungetCharIgnoreEOL(c); - error(JSMSG_UNTERMINATED_STRING); + const char delimiters[] = { untilChar, untilChar, '\0' }; + error(JSMSG_EOL_BEFORE_END_OF_STRING, delimiters); return false; } if (c == '\r') { diff --git a/js/src/frontend/TokenStream.h b/js/src/frontend/TokenStream.h index 9e1aa19cd425..e991d0c1324e 100644 --- a/js/src/frontend/TokenStream.h +++ b/js/src/frontend/TokenStream.h @@ -948,7 +948,7 @@ class TokenStreamCharsBase const CharT* ptr; }; - MOZ_MUST_USE bool appendMultiUnitCodepointToTokenbuf(uint32_t codepoint); + MOZ_MUST_USE bool appendCodePointToTokenbuf(uint32_t codePoint); class MOZ_STACK_CLASS Position { @@ -1158,7 +1158,7 @@ class MOZ_STACK_CLASS TokenStreamSpecific using typename CharsSharedBase::TokenBuf; private: - using CharsSharedBase::appendMultiUnitCodepointToTokenbuf; + using CharsSharedBase::appendCodePointToTokenbuf; using CharsSharedBase::atomizeChars; using CharsSharedBase::copyTokenbufTo; using GeneralCharsBase::getCharIgnoreEOL; @@ -1437,7 +1437,7 @@ class MOZ_STACK_CLASS TokenStreamSpecific MOZ_MUST_USE bool getTokenInternal(TokenKind* ttp, Modifier modifier); - MOZ_MUST_USE bool getStringOrTemplateToken(int untilChar, Token** tp); + MOZ_MUST_USE bool getStringOrTemplateToken(char untilChar, Token** tp); // Try to get the next character, normalizing '\r', '\r\n', and '\n' into // '\n'. Also updates internal line-counter state. Return true on success diff --git a/js/src/jit-test/lib/wasm-binary.js b/js/src/jit-test/lib/wasm-binary.js index b245c007ec34..2c3cb2a5cae4 100644 --- a/js/src/jit-test/lib/wasm-binary.js +++ b/js/src/jit-test/lib/wasm-binary.js @@ -89,6 +89,10 @@ const I64TruncSF32Code = 0xae; const I64TruncUF32Code = 0xaf; const I64TruncSF64Code = 0xb0; const I64TruncUF64Code = 0xb1; +const I64DivSCode = 0x7f; +const I64DivUCode = 0x80; +const I64RemSCode = 0x81; +const I64RemUCode = 0x82; const FirstInvalidOpcode = wasmThreadsSupported() ? 0xc5 : 0xc0; const LastInvalidOpcode = 0xfd; diff --git a/js/src/jit-test/tests/wasm/errors.js b/js/src/jit-test/tests/wasm/errors.js index 40e6720caa9e..616314585450 100644 --- a/js/src/jit-test/tests/wasm/errors.js +++ b/js/src/jit-test/tests/wasm/errors.js @@ -79,10 +79,15 @@ function testStore(opcode, optext, consttext, width, type, msg) { test(UnreachableCode, '(module (func unreachable) (start 0))', RuntimeError, /unreachable executed/); test(I32DivSCode, '(module (func (drop (i32.div_s (i32.const 1) (i32.const 0)))) (start 0))', RuntimeError, /integer divide by zero/); +test(I32DivSCode, '(module (func (drop (i32.div_s (i32.const -2147483648) (i32.const -1)))) (start 0))', RuntimeError, /integer overflow/); test(I32DivUCode, '(module (func (drop (i32.div_u (i32.const 1) (i32.const 0)))) (start 0))', RuntimeError, /integer divide by zero/); test(I32RemSCode, '(module (func (drop (i32.rem_s (i32.const 1) (i32.const 0)))) (start 0))', RuntimeError, /integer divide by zero/); test(I32RemUCode, '(module (func (drop (i32.rem_u (i32.const 1) (i32.const 0)))) (start 0))', RuntimeError, /integer divide by zero/); -test(I32RemUCode, '(module (func (drop (i32.rem_u (i32.const 1) (i32.const 0)))) (start 0))', RuntimeError, /integer divide by zero/); +test(I64DivSCode, '(module (func (drop (i64.div_s (i64.const 1) (i64.const 0)))) (start 0))', RuntimeError, /integer divide by zero/); +test(I64DivSCode, '(module (func (drop (i64.div_s (i64.const -9223372036854775808) (i64.const -1)))) (start 0))', RuntimeError, /integer overflow/); +test(I64DivUCode, '(module (func (drop (i64.div_u (i64.const 1) (i64.const 0)))) (start 0))', RuntimeError, /integer divide by zero/); +test(I64RemSCode, '(module (func (drop (i64.rem_s (i64.const 1) (i64.const 0)))) (start 0))', RuntimeError, /integer divide by zero/); +test(I64RemUCode, '(module (func (drop (i64.rem_u (i64.const 1) (i64.const 0)))) (start 0))', RuntimeError, /integer divide by zero/); test(I32TruncSF32Code, '(module (func (drop (i32.trunc_s/f32 (f32.const 1e30)))) (start 0))', RuntimeError, /integer overflow/); test(I32TruncSF64Code, '(module (func (drop (i32.trunc_s/f64 (f64.const 1e30)))) (start 0))', RuntimeError, /integer overflow/); test(I32TruncUF32Code, '(module (func (drop (i32.trunc_u/f32 (f32.const 1e30)))) (start 0))', RuntimeError, /integer overflow/); diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp index 6677d6cee443..8e954ce1a920 100644 --- a/js/src/jit/CodeGenerator.cpp +++ b/js/src/jit/CodeGenerator.cpp @@ -9631,14 +9631,9 @@ CodeGenerator::generateWasm(wasm::SigIdDesc sigId, wasm::BytecodeOffset trapOffs { JitSpew(JitSpew_Codegen, "# Emitting wasm code"); - wasm::GenerateFunctionPrologue(masm, frameSize(), sigId, offsets); + wasm::IsLeaf isLeaf = !gen->needsOverrecursedCheck(); - // Overflow checks are omitted by CodeGenerator in some cases (leaf - // functions with small framePushed). Perform overflow-checking after - // pushing framePushed to catch cases with really large frames. - Label onOverflow; - if (!omitOverRecursedCheck()) - masm.wasmEmitStackCheck(masm.getStackPointer(), ABINonArgReg0, &onOverflow); + wasm::GenerateFunctionPrologue(masm, frameSize(), isLeaf, sigId, trapOffset, offsets); if (!generateBody()) return false; @@ -9646,20 +9641,6 @@ CodeGenerator::generateWasm(wasm::SigIdDesc sigId, wasm::BytecodeOffset trapOffs masm.bind(&returnLabel_); wasm::GenerateFunctionEpilogue(masm, frameSize(), offsets); - if (!omitOverRecursedCheck()) { - // Since we just overflowed the stack, to be on the safe side, pop the - // stack so that, when the trap exit stub executes, it is a safe - // distance away from the end of the native stack. - wasm::OldTrapDesc trap(trapOffset, wasm::Trap::StackOverflow, /* framePushed = */ 0); - if (frameSize() > 0) { - masm.bind(&onOverflow); - masm.addToStackPtr(Imm32(frameSize())); - masm.jump(trap); - } else { - masm.bindLater(&onOverflow, trap); - } - } - #if defined(JS_ION_PERF) // Note the end of the inline code and start of the OOL code. gen->perfSpewer().noteEndInlineCode(masm); diff --git a/js/src/jit/IonTypes.h b/js/src/jit/IonTypes.h index d24e2f6f4679..cb419fddc4e1 100644 --- a/js/src/jit/IonTypes.h +++ b/js/src/jit/IonTypes.h @@ -922,6 +922,11 @@ enum class RoundingMode { TowardsZero }; +// If a function contains no calls, we can assume the caller has checked the +// stack limit up to this maximum frame size. This works because the jit stack +// limit has a generous buffer before the real end of the native stack. +static const uint32_t MAX_UNCHECKED_LEAF_FRAME_SIZE = 64; + } // namespace jit } // namespace js diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp index 380adb4d54db..2c2c203e1670 100644 --- a/js/src/jit/MacroAssembler.cpp +++ b/js/src/jit/MacroAssembler.cpp @@ -3266,21 +3266,6 @@ MacroAssembler::wasmEmitOldTrapOutOfLineCode() oldTrapSites().clear(); } -void -MacroAssembler::wasmEmitStackCheck(RegisterOrSP sp, Register scratch, Label* onOverflow) -{ - if (IsHiddenSP(sp)) { - branchStackPtrRhs(Assembler::AboveOrEqual, - Address(WasmTlsReg, offsetof(wasm::TlsData, stackLimit)), - onOverflow); - } else { - branchPtr(Assembler::AboveOrEqual, - Address(WasmTlsReg, offsetof(wasm::TlsData, stackLimit)), - AsRegister(sp), - onOverflow); - } -} - void MacroAssembler::emitPreBarrierFastPath(JSRuntime* rt, MIRType type, Register temp1, Register temp2, Register temp3, Label* noBarrier) diff --git a/js/src/jit/MacroAssembler.h b/js/src/jit/MacroAssembler.h index d0d086289f0f..309f3ab563eb 100644 --- a/js/src/jit/MacroAssembler.h +++ b/js/src/jit/MacroAssembler.h @@ -1603,8 +1603,9 @@ class MacroAssembler : public MacroAssemblerSpecific // including "normal" OutOfLineCode. void wasmEmitOldTrapOutOfLineCode(); - // Perform a stack-overflow test, branching to the given Label on overflow. - void wasmEmitStackCheck(RegisterOrSP sp, Register scratch, Label* onOverflow); + public: + // ======================================================================== + // Barrier functions. void emitPreBarrierFastPath(JSRuntime* rt, MIRType type, Register temp1, Register temp2, Register temp3, Label* noBarrier); diff --git a/js/src/jit/arm/CodeGenerator-arm.cpp b/js/src/jit/arm/CodeGenerator-arm.cpp index 78b1edbd835f..8c63b6550ca7 100644 --- a/js/src/jit/arm/CodeGenerator-arm.cpp +++ b/js/src/jit/arm/CodeGenerator-arm.cpp @@ -531,7 +531,10 @@ CodeGeneratorARM::divICommon(MDiv* mir, Register lhs, Register rhs, Register out masm.ma_cmp(rhs, Imm32(-1), scratch, Assembler::Equal); if (mir->canTruncateOverflow()) { if (mir->trapOnError()) { - masm.ma_b(oldTrap(mir, wasm::Trap::IntegerOverflow), Assembler::Equal); + Label ok; + masm.ma_b(&ok, Assembler::NotEqual); + masm.wasmTrap(wasm::Trap::IntegerOverflow, mir->bytecodeOffset()); + masm.bind(&ok); } else { // (-INT32_MIN)|0 = INT32_MIN Label skip; @@ -551,7 +554,10 @@ CodeGeneratorARM::divICommon(MDiv* mir, Register lhs, Register rhs, Register out masm.as_cmp(rhs, Imm8(0)); if (mir->canTruncateInfinities()) { if (mir->trapOnError()) { - masm.ma_b(oldTrap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Equal); + Label nonZero; + masm.ma_b(&nonZero, Assembler::NotEqual); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, mir->bytecodeOffset()); + masm.bind(&nonZero); } else { // Infinity|0 == 0 Label skip; @@ -714,7 +720,10 @@ CodeGeneratorARM::modICommon(MMod* mir, Register lhs, Register rhs, Register out // wasm allows negative lhs and return 0 in this case. MOZ_ASSERT(mir->isTruncated()); masm.as_cmp(rhs, Imm8(0)); - masm.ma_b(oldTrap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Equal); + Label nonZero; + masm.ma_b(&nonZero, Assembler::NotEqual); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, mir->bytecodeOffset()); + masm.bind(&nonZero); return; } @@ -2417,7 +2426,10 @@ CodeGeneratorARM::generateUDivModZeroCheck(Register rhs, Register output, Label* masm.as_cmp(rhs, Imm8(0)); if (mir->isTruncated()) { if (mir->trapOnError()) { - masm.ma_b(oldTrap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Equal); + Label nonZero; + masm.ma_b(&nonZero, Assembler::NotEqual); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, mir->bytecodeOffset()); + masm.bind(&nonZero); } else { Label skip; masm.ma_b(&skip, Assembler::NotEqual); @@ -2767,8 +2779,10 @@ CodeGeneratorARM::visitDivOrModI64(LDivOrModI64* lir) // Handle divide by zero. if (lir->canBeDivideByZero()) { Register temp = WasmGetTemporaryForDivOrMod(lhs, rhs); - masm.branchTest64(Assembler::Zero, rhs, rhs, temp, - oldTrap(lir, wasm::Trap::IntegerDivideByZero)); + Label nonZero; + masm.branchTest64(Assembler::NonZero, rhs, rhs, temp, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, lir->bytecodeOffset()); + masm.bind(&nonZero); } auto* mir = lir->mir(); @@ -2781,7 +2795,7 @@ CodeGeneratorARM::visitDivOrModI64(LDivOrModI64* lir) if (mir->isMod()) masm.xor64(output, output); else - masm.jump(oldTrap(lir, wasm::Trap::IntegerOverflow)); + masm.wasmTrap(wasm::Trap::IntegerOverflow, lir->bytecodeOffset()); masm.jump(&done); masm.bind(¬min); } @@ -2813,8 +2827,10 @@ CodeGeneratorARM::visitUDivOrModI64(LUDivOrModI64* lir) // Prevent divide by zero. if (lir->canBeDivideByZero()) { Register temp = WasmGetTemporaryForDivOrMod(lhs, rhs); - masm.branchTest64(Assembler::Zero, rhs, rhs, temp, - oldTrap(lir, wasm::Trap::IntegerDivideByZero)); + Label nonZero; + masm.branchTest64(Assembler::NonZero, rhs, rhs, temp, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, lir->bytecodeOffset()); + masm.bind(&nonZero); } masm.setupWasmABICall(); diff --git a/js/src/jit/arm/MacroAssembler-arm-inl.h b/js/src/jit/arm/MacroAssembler-arm-inl.h index c8304cdfbdb2..038ae5eb9bee 100644 --- a/js/src/jit/arm/MacroAssembler-arm-inl.h +++ b/js/src/jit/arm/MacroAssembler-arm-inl.h @@ -1725,7 +1725,7 @@ MacroAssembler::branchTest64(Condition cond, Register64 lhs, Register64 rhs, Reg { ScratchRegisterScope scratch(*this); - if (cond == Assembler::Zero) { + if (cond == Assembler::Zero || cond == Assembler::NonZero) { MOZ_ASSERT(lhs.low == rhs.low); MOZ_ASSERT(lhs.high == rhs.high); ma_orr(lhs.low, lhs.high, scratch); diff --git a/js/src/jit/arm/MacroAssembler-arm.cpp b/js/src/jit/arm/MacroAssembler-arm.cpp index 2b2871fa1f89..4ec11316b8ae 100644 --- a/js/src/jit/arm/MacroAssembler-arm.cpp +++ b/js/src/jit/arm/MacroAssembler-arm.cpp @@ -5895,12 +5895,10 @@ MacroAssemblerARM::outOfLineWasmTruncateToIntCheck(FloatRegister input, MIRType // Handle errors. bind(&fail); - asMasm().jump(wasm::OldTrapDesc(trapOffset, wasm::Trap::IntegerOverflow, - asMasm().framePushed())); + asMasm().wasmTrap(wasm::Trap::IntegerOverflow, trapOffset); bind(&inputIsNaN); - asMasm().jump(wasm::OldTrapDesc(trapOffset, wasm::Trap::InvalidConversionToInteger, - asMasm().framePushed())); + asMasm().wasmTrap(wasm::Trap::InvalidConversionToInteger, trapOffset); } void diff --git a/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp b/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp index 870035975791..f589c9c8e7b1 100644 --- a/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp +++ b/js/src/jit/mips-shared/CodeGenerator-mips-shared.cpp @@ -568,7 +568,10 @@ CodeGeneratorMIPSShared::visitDivI(LDivI* ins) // Handle divide by zero. if (mir->canBeDivideByZero()) { if (mir->trapOnError()) { - masm.ma_b(rhs, rhs, oldTrap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Zero); + Label nonZero; + masm.ma_b(rhs, rhs, &nonZero, Assembler::NonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, mir->bytecodeOffset()); + masm.bind(&nonZero); } else if (mir->canTruncateInfinities()) { // Truncated division by zero is zero (Infinity|0 == 0) Label notzero; @@ -590,7 +593,10 @@ CodeGeneratorMIPSShared::visitDivI(LDivI* ins) masm.move32(Imm32(-1), temp); if (mir->trapOnError()) { - masm.ma_b(rhs, temp, oldTrap(mir, wasm::Trap::IntegerOverflow), Assembler::Equal); + Label ok; + masm.ma_b(rhs, temp, &ok, Assembler::NoEqual); + masm.wasmTrap(wasm::Trap::IntegerOverflow, mir->bytecodeOffset()); + masm.bind(&ok); } else if (mir->canTruncateOverflow()) { // (-INT32_MIN)|0 == INT32_MIN Label skip; @@ -718,7 +724,10 @@ CodeGeneratorMIPSShared::visitModI(LModI* ins) if (mir->canBeDivideByZero()) { if (mir->isTruncated()) { if (mir->trapOnError()) { - masm.ma_b(rhs, rhs, oldTrap(mir, wasm::Trap::IntegerDivideByZero), Assembler::Zero); + Label nonZero; + masm.ma_b(rhs, rhs, &nonZero, Assembler::NonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, mir->bytecodeOffset()); + masm.bind(&nonZero); } else { Label skip; masm.ma_b(rhs, Imm32(0), &skip, Assembler::NotEqual, ShortJump); @@ -1559,10 +1568,10 @@ CodeGeneratorMIPSShared::visitOutOfLineWasmTruncateCheck(OutOfLineWasmTruncateCh // Handle errors. masm.bind(&fail); - masm.jump(oldTrap(ool, wasm::Trap::IntegerOverflow)); + masm.wasmTrap(wasm::Trap::IntegerOverflow, ool->bytecodeOffset()); masm.bind(&inputIsNaN); - masm.jump(oldTrap(ool, wasm::Trap::InvalidConversionToInteger)); + masm.wasmTrap(wasm::Trap::InvalidConversionToInteger, ool->bytecodeOffset()); } void @@ -2392,7 +2401,10 @@ CodeGeneratorMIPSShared::visitUDivOrMod(LUDivOrMod* ins) if (ins->canBeDivideByZero()) { if (ins->mir()->isTruncated()) { if (ins->trapOnError()) { - masm.ma_b(rhs, rhs, oldTrap(ins, wasm::Trap::IntegerDivideByZero), Assembler::Zero); + Label nonZero; + masm.ma_b(rhs, rhs, &nonZero, Assembler::NonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, ins->bytecodeOffset()); + masm.bind(&nonZero) } else { // Infinity|0 == 0 Label notzero; diff --git a/js/src/jit/mips32/CodeGenerator-mips32.cpp b/js/src/jit/mips32/CodeGenerator-mips32.cpp index 5c9ab7bfbeec..02abf35b04c4 100644 --- a/js/src/jit/mips32/CodeGenerator-mips32.cpp +++ b/js/src/jit/mips32/CodeGenerator-mips32.cpp @@ -379,21 +379,24 @@ CodeGeneratorMIPS::visitDivOrModI64(LDivOrModI64* lir) Label done; // Handle divide by zero. - if (lir->canBeDivideByZero()) - masm.branchTest64(Assembler::Zero, rhs, rhs, temp, oldTrap(lir, wasm::Trap::IntegerDivideByZero)); + if (lir->canBeDivideByZero()) { + Label nonZero; + masm.branchTest64(Assembler::NonZero, rhs, rhs, temp, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, lir->bytecodeOffset()); + masm.bind(&nonZero); + } // Handle an integer overflow exception from INT64_MIN / -1. if (lir->canBeNegativeOverflow()) { - Label notmin; - masm.branch64(Assembler::NotEqual, lhs, Imm64(INT64_MIN), ¬min); - masm.branch64(Assembler::NotEqual, rhs, Imm64(-1), ¬min); - if (lir->mir()->isMod()) { + Label notOverflow; + masm.branch64(Assembler::NotEqual, lhs, Imm64(INT64_MIN), ¬Overflow); + masm.branch64(Assembler::NotEqual, rhs, Imm64(-1), ¬Overflow); + if (lir->mir()->isMod()) masm.xor64(output, output); - } else { - masm.jump(oldTrap(lir, wasm::Trap::IntegerOverflow)); - } + else + masm.wasmTrap(wasm::Trap::IntegerOverflow, lir->bytecodeOffset()); masm.jump(&done); - masm.bind(¬min); + masm.bind(¬Overflow); } masm.setupWasmABICall(); @@ -432,8 +435,12 @@ CodeGeneratorMIPS::visitUDivOrModI64(LUDivOrModI64* lir) Register temp = regs.takeAny(); // Prevent divide by zero. - if (lir->canBeDivideByZero()) - masm.branchTest64(Assembler::Zero, rhs, rhs, temp, oldTrap(lir, wasm::Trap::IntegerDivideByZero)); + if (lir->canBeDivideByZero()) { + Label nonZero; + masm.branchTest64(Assembler::NonZero, rhs, rhs, temp, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, lir->bytecodeOffset()); + masm.bind(&nonZero); + } masm.setupWasmABICall(); masm.passABIArg(lhs.high); diff --git a/js/src/jit/mips64/CodeGenerator-mips64.cpp b/js/src/jit/mips64/CodeGenerator-mips64.cpp index 266ed7ce7770..afe53ea34d91 100644 --- a/js/src/jit/mips64/CodeGenerator-mips64.cpp +++ b/js/src/jit/mips64/CodeGenerator-mips64.cpp @@ -361,21 +361,24 @@ CodeGeneratorMIPS64::visitDivOrModI64(LDivOrModI64* lir) Label done; // Handle divide by zero. - if (lir->canBeDivideByZero()) - masm.ma_b(rhs, rhs, oldTrap(lir, wasm::Trap::IntegerDivideByZero), Assembler::Zero); + if (lir->canBeDivideByZero()) { + Label nonZero; + masm.ma_b(rhs, rhs, &nonZero, Assembler::NonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, lir->bytecodeOffset()); + masm.bind(&nonZero); + } // Handle an integer overflow exception from INT64_MIN / -1. if (lir->canBeNegativeOverflow()) { - Label notmin; - masm.branchPtr(Assembler::NotEqual, lhs, ImmWord(INT64_MIN), ¬min); - masm.branchPtr(Assembler::NotEqual, rhs, ImmWord(-1), ¬min); - if (lir->mir()->isMod()) { + Label notOverflow; + masm.branchPtr(Assembler::NotEqual, lhs, ImmWord(INT64_MIN), ¬Overflow); + masm.branchPtr(Assembler::NotEqual, rhs, ImmWord(-1), ¬Overflow); + if (lir->mir()->isMod()) masm.ma_xor(output, output); - } else { - masm.jump(oldTrap(lir, wasm::Trap::IntegerOverflow)); - } + else + masm.wasmTrap(wasm::Trap::IntegerOverflow, lir->bytecodeOffset()); masm.jump(&done); - masm.bind(¬min); + masm.bind(¬Overflow); } masm.as_ddiv(lhs, rhs); @@ -398,8 +401,12 @@ CodeGeneratorMIPS64::visitUDivOrModI64(LUDivOrModI64* lir) Label done; // Prevent divide by zero. - if (lir->canBeDivideByZero()) - masm.ma_b(rhs, rhs, oldTrap(lir, wasm::Trap::IntegerDivideByZero), Assembler::Zero); + if (lir->canBeDivideByZero()) { + Label nonZero; + masm.ma_b(rhs, rhs, &nonZero, Assembler::NonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, lir->bytecodeOffset()); + masm.bind(&nonZero); + } masm.as_ddivu(lhs, rhs); diff --git a/js/src/jit/shared/CodeGenerator-shared.cpp b/js/src/jit/shared/CodeGenerator-shared.cpp index 350dc5970508..c6322374f6a5 100644 --- a/js/src/jit/shared/CodeGenerator-shared.cpp +++ b/js/src/jit/shared/CodeGenerator-shared.cpp @@ -1488,7 +1488,7 @@ CodeGeneratorShared::omitOverRecursedCheck() const // stack overflow check. Note that the actual number here is somewhat // arbitrary, and codegen actually uses small bounded amounts of // additional stack space in some cases too. - return frameSize() < 64 && !gen->needsOverrecursedCheck(); + return frameSize() < MAX_UNCHECKED_LEAF_FRAME_SIZE && !gen->needsOverrecursedCheck(); } void diff --git a/js/src/jit/x64/CodeGenerator-x64.cpp b/js/src/jit/x64/CodeGenerator-x64.cpp index 94cd3108942d..6df2a48d7258 100644 --- a/js/src/jit/x64/CodeGenerator-x64.cpp +++ b/js/src/jit/x64/CodeGenerator-x64.cpp @@ -285,20 +285,23 @@ CodeGeneratorX64::visitDivOrModI64(LDivOrModI64* lir) // Handle divide by zero. if (lir->canBeDivideByZero()) { - masm.branchTestPtr(Assembler::Zero, rhs, rhs, oldTrap(lir, wasm::Trap::IntegerDivideByZero)); + Label nonZero; + masm.branchTestPtr(Assembler::NonZero, rhs, rhs, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, lir->bytecodeOffset()); + masm.bind(&nonZero); } // Handle an integer overflow exception from INT64_MIN / -1. if (lir->canBeNegativeOverflow()) { - Label notmin; - masm.branchPtr(Assembler::NotEqual, lhs, ImmWord(INT64_MIN), ¬min); - masm.branchPtr(Assembler::NotEqual, rhs, ImmWord(-1), ¬min); + Label notOverflow; + masm.branchPtr(Assembler::NotEqual, lhs, ImmWord(INT64_MIN), ¬Overflow); + masm.branchPtr(Assembler::NotEqual, rhs, ImmWord(-1), ¬Overflow); if (lir->mir()->isMod()) masm.xorl(output, output); else - masm.jump(oldTrap(lir, wasm::Trap::IntegerOverflow)); + masm.wasmTrap(wasm::Trap::IntegerOverflow, lir->bytecodeOffset()); masm.jump(&done); - masm.bind(¬min); + masm.bind(¬Overflow); } // Sign extend the lhs into rdx to make rdx:rax. @@ -327,8 +330,12 @@ CodeGeneratorX64::visitUDivOrModI64(LUDivOrModI64* lir) Label done; // Prevent divide by zero. - if (lir->canBeDivideByZero()) - masm.branchTestPtr(Assembler::Zero, rhs, rhs, oldTrap(lir, wasm::Trap::IntegerDivideByZero)); + if (lir->canBeDivideByZero()) { + Label nonZero; + masm.branchTestPtr(Assembler::NonZero, rhs, rhs, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, lir->bytecodeOffset()); + masm.bind(&nonZero); + } // Zero extend the lhs into rdx to make (rdx:rax). masm.xorl(rdx, rdx); diff --git a/js/src/jit/x86-shared/Assembler-x86-shared.h b/js/src/jit/x86-shared/Assembler-x86-shared.h index 4b890ef0de77..a6b269414495 100644 --- a/js/src/jit/x86-shared/Assembler-x86-shared.h +++ b/js/src/jit/x86-shared/Assembler-x86-shared.h @@ -301,6 +301,7 @@ class AssemblerX86Shared : public AssemblerShared LessThan = X86Encoding::ConditionL, LessThanOrEqual = X86Encoding::ConditionLE, Overflow = X86Encoding::ConditionO, + NoOverflow = X86Encoding::ConditionNO, CarrySet = X86Encoding::ConditionC, CarryClear = X86Encoding::ConditionNC, Signed = X86Encoding::ConditionS, diff --git a/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp b/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp index b22a5926de3f..bf15e503e315 100644 --- a/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp +++ b/js/src/jit/x86-shared/CodeGenerator-x86-shared.cpp @@ -1026,7 +1026,10 @@ CodeGeneratorX86Shared::visitUDivOrMod(LUDivOrMod* ins) masm.test32(rhs, rhs); if (ins->mir()->isTruncated()) { if (ins->trapOnError()) { - masm.j(Assembler::Zero, oldTrap(ins, wasm::Trap::IntegerDivideByZero)); + Label nonZero; + masm.j(Assembler::NonZero, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, ins->bytecodeOffset()); + masm.bind(&nonZero); } else { ool = new(alloc()) ReturnZero(output); masm.j(Assembler::Zero, ool->entry()); @@ -1074,7 +1077,7 @@ CodeGeneratorX86Shared::visitUDivOrModConstant(LUDivOrModConstant *ins) { if (d == 0) { if (ins->mir()->isTruncated()) { if (ins->trapOnError()) - masm.jump(oldTrap(ins, wasm::Trap::IntegerDivideByZero)); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, ins->bytecodeOffset()); else masm.xorl(output, output); } else { @@ -1210,10 +1213,14 @@ CodeGeneratorX86Shared::visitDivPowTwoI(LDivPowTwoI* ins) if (negativeDivisor) { // INT32_MIN / -1 overflows. masm.negl(lhs); - if (!mir->isTruncated()) + if (!mir->isTruncated()) { bailoutIf(Assembler::Overflow, ins->snapshot()); - else if (mir->trapOnError()) - masm.j(Assembler::Overflow, oldTrap(mir, wasm::Trap::IntegerOverflow)); + } else if (mir->trapOnError()) { + Label ok; + masm.j(Assembler::NoOverflow, &ok); + masm.wasmTrap(wasm::Trap::IntegerOverflow, mir->bytecodeOffset()); + masm.bind(&ok); + } } else if (mir->isUnsigned() && !mir->isTruncated()) { // Unsigned division by 1 can overflow if output is not // truncated. @@ -1332,7 +1339,10 @@ CodeGeneratorX86Shared::visitDivI(LDivI* ins) if (mir->canBeDivideByZero()) { masm.test32(rhs, rhs); if (mir->trapOnError()) { - masm.j(Assembler::Zero, oldTrap(mir, wasm::Trap::IntegerDivideByZero)); + Label nonZero; + masm.j(Assembler::NonZero, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, mir->bytecodeOffset()); + masm.bind(&nonZero); } else if (mir->canTruncateInfinities()) { // Truncated division by zero is zero (Infinity|0 == 0) if (!ool) @@ -1346,12 +1356,13 @@ CodeGeneratorX86Shared::visitDivI(LDivI* ins) // Handle an integer overflow exception from -2147483648 / -1. if (mir->canBeNegativeOverflow()) { - Label notmin; + Label notOverflow; masm.cmp32(lhs, Imm32(INT32_MIN)); - masm.j(Assembler::NotEqual, ¬min); + masm.j(Assembler::NotEqual, ¬Overflow); masm.cmp32(rhs, Imm32(-1)); if (mir->trapOnError()) { - masm.j(Assembler::Equal, oldTrap(mir, wasm::Trap::IntegerOverflow)); + masm.j(Assembler::NotEqual, ¬Overflow); + masm.wasmTrap(wasm::Trap::IntegerOverflow, mir->bytecodeOffset()); } else if (mir->canTruncateOverflow()) { // (-INT32_MIN)|0 == INT32_MIN and INT32_MIN is already in the // output register (lhs == eax). @@ -1360,7 +1371,7 @@ CodeGeneratorX86Shared::visitDivI(LDivI* ins) MOZ_ASSERT(mir->fallible()); bailoutIf(Assembler::Equal, ins->snapshot()); } - masm.bind(¬min); + masm.bind(¬Overflow); } // Handle negative 0. @@ -1501,7 +1512,10 @@ CodeGeneratorX86Shared::visitModI(LModI* ins) masm.test32(rhs, rhs); if (mir->isTruncated()) { if (mir->trapOnError()) { - masm.j(Assembler::Zero, oldTrap(mir, wasm::Trap::IntegerDivideByZero)); + Label nonZero; + masm.j(Assembler::NonZero, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, mir->bytecodeOffset()); + masm.bind(&nonZero); } else { if (!ool) ool = new(alloc()) ReturnZero(edx); diff --git a/js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp b/js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp index 637edeaa10f2..6d415a2e6e4b 100644 --- a/js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp +++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared.cpp @@ -694,10 +694,10 @@ struct MOZ_RAII AutoHandleWasmTruncateToIntErrors // Handle errors. These cases are not in arbitrary order: code will // fall through to intOverflow. masm.bind(&intOverflow); - masm.jump(wasm::OldTrapDesc(off, wasm::Trap::IntegerOverflow, masm.framePushed())); + masm.wasmTrap(wasm::Trap::IntegerOverflow, off); masm.bind(&inputIsNaN); - masm.jump(wasm::OldTrapDesc(off, wasm::Trap::InvalidConversionToInteger, masm.framePushed())); + masm.wasmTrap(wasm::Trap::InvalidConversionToInteger, off); } }; diff --git a/js/src/jit/x86/CodeGenerator-x86.cpp b/js/src/jit/x86/CodeGenerator-x86.cpp index 5145b05b20af..c1ef9b373cd2 100644 --- a/js/src/jit/x86/CodeGenerator-x86.cpp +++ b/js/src/jit/x86/CodeGenerator-x86.cpp @@ -1038,22 +1038,26 @@ CodeGeneratorX86::visitDivOrModI64(LDivOrModI64* lir) Label done; // Handle divide by zero. - if (lir->canBeDivideByZero()) - masm.branchTest64(Assembler::Zero, rhs, rhs, temp, oldTrap(lir, wasm::Trap::IntegerDivideByZero)); + if (lir->canBeDivideByZero()) { + Label nonZero; + masm.branchTest64(Assembler::NonZero, rhs, rhs, temp, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, lir->bytecodeOffset()); + masm.bind(&nonZero); + } MDefinition* mir = lir->mir(); // Handle an integer overflow exception from INT64_MIN / -1. if (lir->canBeNegativeOverflow()) { - Label notmin; - masm.branch64(Assembler::NotEqual, lhs, Imm64(INT64_MIN), ¬min); - masm.branch64(Assembler::NotEqual, rhs, Imm64(-1), ¬min); + Label notOverflow; + masm.branch64(Assembler::NotEqual, lhs, Imm64(INT64_MIN), ¬Overflow); + masm.branch64(Assembler::NotEqual, rhs, Imm64(-1), ¬Overflow); if (mir->isMod()) masm.xor64(output, output); else - masm.jump(oldTrap(lir, wasm::Trap::IntegerOverflow)); + masm.wasmTrap(wasm::Trap::IntegerOverflow, lir->bytecodeOffset()); masm.jump(&done); - masm.bind(¬min); + masm.bind(¬Overflow); } masm.setupWasmABICall(); @@ -1086,8 +1090,12 @@ CodeGeneratorX86::visitUDivOrModI64(LUDivOrModI64* lir) MOZ_ASSERT(output == ReturnReg64); // Prevent divide by zero. - if (lir->canBeDivideByZero()) - masm.branchTest64(Assembler::Zero, rhs, rhs, temp, oldTrap(lir, wasm::Trap::IntegerDivideByZero)); + if (lir->canBeDivideByZero()) { + Label nonZero; + masm.branchTest64(Assembler::NonZero, rhs, rhs, temp, &nonZero); + masm.wasmTrap(wasm::Trap::IntegerDivideByZero, lir->bytecodeOffset()); + masm.bind(&nonZero); + } masm.setupWasmABICall(); masm.passABIArg(lhs.high); diff --git a/js/src/jit/x86/MacroAssembler-x86-inl.h b/js/src/jit/x86/MacroAssembler-x86-inl.h index 64639e331848..d0a6d0322964 100644 --- a/js/src/jit/x86/MacroAssembler-x86-inl.h +++ b/js/src/jit/x86/MacroAssembler-x86-inl.h @@ -970,7 +970,7 @@ void MacroAssembler::branchTest64(Condition cond, Register64 lhs, Register64 rhs, Register temp, L label) { - if (cond == Assembler::Zero) { + if (cond == Assembler::Zero || cond == Assembler::NonZero) { MOZ_ASSERT(lhs.low == rhs.low); MOZ_ASSERT(lhs.high == rhs.high); movl(lhs.low, temp); diff --git a/js/src/js.msg b/js/src/js.msg index 7d498c97382e..43d10d372a44 100644 --- a/js/src/js.msg +++ b/js/src/js.msg @@ -338,7 +338,9 @@ MSG_DEF(JSMSG_UNNAMED_CLASS_STMT, 0, JSEXN_SYNTAXERR, "class statement requ MSG_DEF(JSMSG_UNNAMED_FUNCTION_STMT, 0, JSEXN_SYNTAXERR, "function statement requires a name") MSG_DEF(JSMSG_UNTERMINATED_COMMENT, 0, JSEXN_SYNTAXERR, "unterminated comment") MSG_DEF(JSMSG_UNTERMINATED_REGEXP, 0, JSEXN_SYNTAXERR, "unterminated regular expression literal") -MSG_DEF(JSMSG_UNTERMINATED_STRING, 0, JSEXN_SYNTAXERR, "unterminated string literal") +MSG_DEF(JSMSG_EOF_BEFORE_END_OF_LITERAL,1,JSEXN_SYNTAXERR, "{0} literal not terminated before end of script") +MSG_DEF(JSMSG_EOL_BEFORE_END_OF_STRING,1, JSEXN_SYNTAXERR, "{0} string literal contains an unescaped line break") +MSG_DEF(JSMSG_EOF_IN_ESCAPE_IN_LITERAL,1, JSEXN_SYNTAXERR, "reached end of script in the middle of an escape sequence in a {0} literal") MSG_DEF(JSMSG_USELESS_EXPR, 0, JSEXN_TYPEERR, "useless expression") MSG_DEF(JSMSG_USE_ASM_DIRECTIVE_FAIL, 0, JSEXN_SYNTAXERR, "\"use asm\" is only meaningful in the Directive Prologue of a function body") MSG_DEF(JSMSG_VAR_HIDES_ARG, 1, JSEXN_TYPEERR, "variable {0} redeclares argument") diff --git a/js/src/tests/non262/extensions/unterminated-literal-error-location.js b/js/src/tests/non262/extensions/unterminated-literal-error-location.js new file mode 100644 index 000000000000..de9767a1c2bb --- /dev/null +++ b/js/src/tests/non262/extensions/unterminated-literal-error-location.js @@ -0,0 +1,119 @@ +/* + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ + */ + +var BUGNUMBER = 1434429; +var summary = + "Report unterminated string/template literal errors with the line/column " + + "number of the point of non-termination"; + +function test(f, quotes, [line, col]) +{ + var caught = false; + try + { + f(); + } + catch (e) + { + caught = true; + assertEq(e.lineNumber, line, "line number"); + assertEq(e.columnNumber, col, "column number"); + assertEq(e.message.includes(quotes), true, + "message must contain delimiter"); + } + + assertEq(caught, true); +} + +test(function() { + //0123 + eval("'hi"); +}, "''", [1, 3]); + +test(function() { + //0123 4 + eval("'hi\\"); +}, "''", [1, 4]); + +test(function() { + //0123456 + eval(" 'hi"); +}, "''", [1, 6]); + +test(function() { + //0123456 7 + eval(" 'hi\\"); +}, "''", [1, 7]); + +test(function() { + //01234567 01234567 + eval('var x =\n "hi'); +}, '""', [2, 7]); + +test(function() { + //0123456 01234567 8 + eval('var x =\n "hi\\'); +}, '""', [2, 8]); + +test(function() { + // 1 + //0123456 01234567 012345678 01234567890123 + eval('var x =\n "hi\\\n bye\\\n no really'); +}, '""', [4, 13]); + +test(function() { + // 1 + //0123456 01234567 012345678 01234567890123 4 + eval('var x =\n "hi\\\n bye\\\n no really\\'); +}, '""', [4, 14]); + +test(function() { + //0123456 01234567 012345678 + eval('var x =\n "hi\\\n bye\n'); +}, '""', [3, 8]); + +test(function() { + //0123456 01234567 012345678 9 + eval('var x =\n "hi\\\n bye\\'); +}, '""', [3, 9]); + +test(function() { + //0123456 01234567 + eval('var x =\n `'); +}, '``', [2, 7]); + +test(function() { + //0123456 01234567 8 + eval('var x =\n `\\'); +}, '``', [2, 8]); + +test(function() { + // 1 + //0123456 0123456789012345 + eval('var x =\n htmlEscape`'); +}, '``', [2, 15]); + +test(function() { + // 1 + //0123456 0123456789012345 6 + eval('var x =\n htmlEscape`\\'); +}, '``', [2, 16]); + +test(function() { + // 1 + //0123456 01234567890123 01234 + eval('var x =\n htmlEscape\n `'); +}, '``', [3, 4]); + +test(function() { + // 1 + //0123456 01234567890123 01234 5 + eval('var x =\n htmlEscape\n `\\'); +}, '``', [3, 5]); + +if (typeof reportCompare === "function") + reportCompare(0, 0, "ok"); + +print("Tests complete"); diff --git a/js/src/tests/non262/regress/regress-352208.js b/js/src/tests/non262/regress/regress-352208.js index 6dfd6eeac926..667c48f07817 100644 --- a/js/src/tests/non262/regress/regress-352208.js +++ b/js/src/tests/non262/regress/regress-352208.js @@ -19,14 +19,14 @@ function test() printBugNumber(BUGNUMBER); printStatus (summary); - expect = 'SyntaxError: unterminated string literal'; + expect = 'SyntaxError'; try { eval('new Function("setter/*\n");'); } catch(ex) { - actual = ex + ''; + actual = ex.constructor.name; } reportCompare(expect, actual, 'new Function("setter/*\n");'); @@ -36,7 +36,7 @@ function test() } catch(ex) { - actual = ex + ''; + actual = ex.constructor.name; } reportCompare(expect, actual, 'new Function("setter/*\n*/");'); } diff --git a/js/src/wasm/WasmBaselineCompile.cpp b/js/src/wasm/WasmBaselineCompile.cpp index 2f98dde9227a..4fbfb519398e 100644 --- a/js/src/wasm/WasmBaselineCompile.cpp +++ b/js/src/wasm/WasmBaselineCompile.cpp @@ -1174,11 +1174,16 @@ class BaseStackFrame // patchable add that is patched in endFunction(). // // Note the platform scratch register may be used by branchPtr(), so - // generally tmp0 and tmp1 must be something else. + // generally tmp must be something else. - void allocStack(Register tmp0, Register tmp1, Label* stackOverflowLabel) { - stackAddOffset_ = masm.sub32FromStackPtrWithPatch(tmp0); - masm.wasmEmitStackCheck(RegisterOrSP(tmp0), tmp1, stackOverflowLabel); + void allocStack(Register tmp, BytecodeOffset trapOffset) { + stackAddOffset_ = masm.sub32FromStackPtrWithPatch(tmp); + Label ok; + masm.branchPtr(Assembler::Below, + Address(WasmTlsReg, offsetof(wasm::TlsData, stackLimit)), + tmp, &ok); + masm.wasmTrap(Trap::StackOverflow, trapOffset); + masm.bind(&ok); } void patchAllocStack() { @@ -1581,7 +1586,6 @@ class BaseCompiler final : public BaseCompilerInterface MIRTypeVector SigPIIL_; MIRTypeVector SigPILL_; NonAssertingLabel returnLabel_; - NonAssertingLabel stackOverflowLabel_; CompileMode mode_; LatentOp latentOp_; // Latent operation for branch (seen next) @@ -2888,11 +2892,13 @@ class BaseCompiler final : public BaseCompilerInterface void beginFunction() { JitSpew(JitSpew_Codegen, "# Emitting wasm baseline code"); + // We are unconditionally checking for overflow in fr.allocStack(), so + // pass IsLeaf = true to avoid a second check in the prologue. + IsLeaf isLeaf = true; SigIdDesc sigId = env_.funcSigs[func_.index]->id; - if (mode_ == CompileMode::Tier1) - GenerateFunctionPrologue(masm, fr.initialSize(), sigId, &offsets_, mode_, func_.index); - else - GenerateFunctionPrologue(masm, fr.initialSize(), sigId, &offsets_); + BytecodeOffset trapOffset(func_.lineOrBytecode); + GenerateFunctionPrologue(masm, fr.initialSize(), isLeaf, sigId, trapOffset, &offsets_, + mode_ == CompileMode::Tier1 ? Some(func_.index) : Nothing()); fr.endFunctionPrologue(); @@ -2905,7 +2911,7 @@ class BaseCompiler final : public BaseCompilerInterface Address(masm.getStackPointer(), debugFrame + DebugFrame::offsetOfFlagsWord())); } - fr.allocStack(ABINonArgReg0, ABINonArgReg1, &stackOverflowLabel_); + fr.allocStack(ABINonArgReg0, trapOffset); // Copy arguments from registers to stack. @@ -2990,7 +2996,7 @@ class BaseCompiler final : public BaseCompilerInterface } bool endFunction() { - // Always branch to stackOverflowLabel_ or returnLabel_. + // Always branch to returnLabel_. masm.breakpoint(); // Patch the add in the prologue so that it checks against the correct @@ -3003,20 +3009,6 @@ class BaseCompiler final : public BaseCompilerInterface fr.patchAllocStack(); - // Since we just overflowed the stack, to be on the safe side, pop the - // stack so that, when the trap exit stub executes, it is a safe - // distance away from the end of the native stack. If debugEnabled_ is - // set, we pop all locals space except allocated for DebugFrame to - // maintain the invariant that, when debugEnabled_, all wasm::Frames - // are valid wasm::DebugFrames which is observable by WasmHandleThrow. - masm.bind(&stackOverflowLabel_); - uint32_t debugFrameReserved = debugEnabled_ ? DebugFrame::offsetOfFrame() : 0; - MOZ_ASSERT(fr.initialSize() >= debugFrameReserved); - if (fr.initialSize() > debugFrameReserved) - masm.addToStackPtr(Imm32(fr.initialSize() - debugFrameReserved)); - BytecodeOffset prologueTrapOffset(func_.lineOrBytecode); - masm.jump(OldTrapDesc(prologueTrapOffset, Trap::StackOverflow, debugFrameReserved)); - masm.bind(&returnLabel_); if (debugEnabled_) { @@ -3448,12 +3440,18 @@ class BaseCompiler final : public BaseCompilerInterface } void checkDivideByZeroI32(RegI32 rhs, RegI32 srcDest, Label* done) { - masm.branchTest32(Assembler::Zero, rhs, rhs, oldTrap(Trap::IntegerDivideByZero)); + Label nonZero; + masm.branchTest32(Assembler::NonZero, rhs, rhs, &nonZero); + trap(Trap::IntegerDivideByZero); + masm.bind(&nonZero); } void checkDivideByZeroI64(RegI64 r) { + Label nonZero; ScratchI32 scratch(*this); - masm.branchTest64(Assembler::Zero, r, r, scratch, oldTrap(Trap::IntegerDivideByZero)); + masm.branchTest64(Assembler::NonZero, r, r, scratch, &nonZero); + trap(Trap::IntegerDivideByZero); + masm.bind(&nonZero); } void checkDivideSignedOverflowI32(RegI32 rhs, RegI32 srcDest, Label* done, bool zeroOnOverflow) { @@ -3464,7 +3462,8 @@ class BaseCompiler final : public BaseCompilerInterface moveImm32(0, srcDest); masm.jump(done); } else { - masm.branch32(Assembler::Equal, rhs, Imm32(-1), oldTrap(Trap::IntegerOverflow)); + masm.branch32(Assembler::NotEqual, rhs, Imm32(-1), ¬Min); + trap(Trap::IntegerOverflow); } masm.bind(¬Min); } @@ -3477,7 +3476,7 @@ class BaseCompiler final : public BaseCompilerInterface masm.xor64(srcDest, srcDest); masm.jump(done); } else { - masm.jump(oldTrap(Trap::IntegerOverflow)); + trap(Trap::IntegerOverflow); } masm.bind(¬min); } diff --git a/js/src/wasm/WasmFrameIter.cpp b/js/src/wasm/WasmFrameIter.cpp index 0a628100e9fa..fc2954f25ed7 100644 --- a/js/src/wasm/WasmFrameIter.cpp +++ b/js/src/wasm/WasmFrameIter.cpp @@ -28,6 +28,7 @@ using namespace js::jit; using namespace js::wasm; using mozilla::DebugOnly; +using mozilla::Maybe; using mozilla::Swap; /*****************************************************************************/ @@ -349,9 +350,10 @@ wasm::ClearExitFP(MacroAssembler& masm, Register scratch) } static void -GenerateCallablePrologue(MacroAssembler& masm, unsigned framePushed, ExitReason reason, - uint32_t* entry, uint32_t* tierEntry, CompileMode mode, uint32_t funcIndex) +GenerateCallablePrologue(MacroAssembler& masm, uint32_t* entry) { + masm.setFramePushed(0); + // ProfilingFrameIterator needs to know the offsets of several key // instructions from entry. To save space, we make these offsets static // constants and assert that they match the actual codegen below. On ARM, @@ -392,37 +394,6 @@ GenerateCallablePrologue(MacroAssembler& masm, unsigned framePushed, ExitReason MOZ_ASSERT_IF(!masm.oom(), SetFP == masm.currentOffset() - *entry); } #endif - // Tiering works as follows. The Code owns a jumpTable, which has one - // pointer-sized element for each function up to the largest funcIndex in - // the module. Each table element is an address into the Tier-1 or the - // Tier-2 function at that index; the elements are updated when Tier-2 code - // becomes available. The Tier-1 function will unconditionally jump to this - // address. The table elements are written racily but without tearing when - // Tier-2 compilation is finished. - // - // The address in the table is either to the instruction following the jump - // in Tier-1 code, or into the function prologue after the standard setup in - // Tier-2 code. Effectively, Tier-1 code performs standard frame setup on - // behalf of whatever code it jumps to, and the target code allocates its - // own frame in whatever way it wants. - - if (reason.isNone()) { - if (mode == CompileMode::Tier1) { - Register scratch = ABINonArgReg0; - masm.loadPtr(Address(WasmTlsReg, offsetof(TlsData, jumpTable)), scratch); - masm.jump(Address(scratch, funcIndex*sizeof(uintptr_t))); - } - if (tierEntry) - *tierEntry = masm.currentOffset(); - } - - // If this frame will be exiting compiled code to C++, record the fp and - // reason in the JitActivation so the frame iterators can unwind. - if (!reason.isNone()) - SetExitFP(masm, reason, ABINonArgReturnVolatileReg); - - if (framePushed) - masm.subFromStackPtr(Imm32(framePushed)); } static void @@ -430,7 +401,7 @@ GenerateCallableEpilogue(MacroAssembler& masm, unsigned framePushed, ExitReason uint32_t* ret) { if (framePushed) - masm.addToStackPtr(Imm32(framePushed)); + masm.freeStack(framePushed); if (!reason.isNone()) ClearExitFP(masm, ABINonArgReturnVolatileReg); @@ -479,8 +450,9 @@ GenerateCallableEpilogue(MacroAssembler& masm, unsigned framePushed, ExitReason } void -wasm::GenerateFunctionPrologue(MacroAssembler& masm, unsigned framePushed, const SigIdDesc& sigId, - FuncOffsets* offsets, CompileMode mode, uint32_t funcIndex) +wasm::GenerateFunctionPrologue(MacroAssembler& masm, uint32_t framePushed, IsLeaf isLeaf, + const SigIdDesc& sigId, BytecodeOffset trapOffset, + FuncOffsets* offsets, const Maybe& tier1FuncIndex) { // Flush pending pools so they do not get dumped between the 'begin' and // 'normalEntry' offsets since the difference must be less than UINT8_MAX @@ -490,8 +462,7 @@ wasm::GenerateFunctionPrologue(MacroAssembler& masm, unsigned framePushed, const // Generate table entry: offsets->begin = masm.currentOffset(); - BytecodeOffset trapOffset(0); // ignored by masm.wasmEmitTrapOutOfLineCode - OldTrapDesc trap(trapOffset, Trap::IndirectCallBadSig, masm.framePushed()); + OldTrapDesc trap(trapOffset, Trap::IndirectCallBadSig, 0); switch (sigId.kind()) { case SigIdDesc::Kind::Global: { Register scratch = WasmTableCallScratchReg; @@ -513,18 +484,66 @@ wasm::GenerateFunctionPrologue(MacroAssembler& masm, unsigned framePushed, const // Generate normal entry: masm.nopAlign(CodeAlignment); - GenerateCallablePrologue(masm, framePushed, ExitReason::None(), &offsets->normalEntry, - &offsets->tierEntry, mode, funcIndex); + GenerateCallablePrologue(masm, &offsets->normalEntry); - masm.setFramePushed(framePushed); + // Tiering works as follows. The Code owns a jumpTable, which has one + // pointer-sized element for each function up to the largest funcIndex in + // the module. Each table element is an address into the Tier-1 or the + // Tier-2 function at that index; the elements are updated when Tier-2 code + // becomes available. The Tier-1 function will unconditionally jump to this + // address. The table elements are written racily but without tearing when + // Tier-2 compilation is finished. + // + // The address in the table is either to the instruction following the jump + // in Tier-1 code, or into the function prologue after the standard setup in + // Tier-2 code. Effectively, Tier-1 code performs standard frame setup on + // behalf of whatever code it jumps to, and the target code allocates its + // own frame in whatever way it wants. + if (tier1FuncIndex) { + Register scratch = ABINonArgReg0; + masm.loadPtr(Address(WasmTlsReg, offsetof(TlsData, jumpTable)), scratch); + masm.jump(Address(scratch, *tier1FuncIndex * sizeof(uintptr_t))); + } + + offsets->tierEntry = masm.currentOffset(); + + // The framePushed value is tier-variant and thus the stack increment must + // go after the tiering jump/entry. + if (framePushed > 0) { + // If the frame is large, don't bump sp until after the stack limit check so + // that the trap handler isn't called with a wild sp. + if (framePushed > MAX_UNCHECKED_LEAF_FRAME_SIZE) { + Label ok; + Register scratch = ABINonArgReg0; + masm.moveStackPtrTo(scratch); + masm.subPtr(Address(WasmTlsReg, offsetof(wasm::TlsData, stackLimit)), scratch); + masm.branchPtr(Assembler::GreaterThan, scratch, Imm32(framePushed), &ok); + masm.wasmTrap(wasm::Trap::StackOverflow, trapOffset); + masm.bind(&ok); + } + + masm.reserveStack(framePushed); + + if (framePushed <= MAX_UNCHECKED_LEAF_FRAME_SIZE && !isLeaf) { + Label ok; + masm.branchStackPtrRhs(Assembler::Below, + Address(WasmTlsReg, offsetof(wasm::TlsData, stackLimit)), + &ok); + masm.wasmTrap(wasm::Trap::StackOverflow, trapOffset); + masm.bind(&ok); + } + } + + MOZ_ASSERT(masm.framePushed() == framePushed); } void wasm::GenerateFunctionEpilogue(MacroAssembler& masm, unsigned framePushed, FuncOffsets* offsets) { + // Inverse of GenerateFunctionPrologue: MOZ_ASSERT(masm.framePushed() == framePushed); GenerateCallableEpilogue(masm, framePushed, ExitReason::None(), &offsets->ret); - masm.setFramePushed(0); + MOZ_ASSERT(masm.framePushed() == 0); } void @@ -532,9 +551,15 @@ wasm::GenerateExitPrologue(MacroAssembler& masm, unsigned framePushed, ExitReaso CallableOffsets* offsets) { masm.haltingAlign(CodeAlignment); - GenerateCallablePrologue(masm, framePushed, reason, &offsets->begin, nullptr, - CompileMode::Once, 0); - masm.setFramePushed(framePushed); + + GenerateCallablePrologue(masm, &offsets->begin); + + // This frame will be exiting compiled code to C++ so record the fp and + // reason in the JitActivation so the frame iterators can unwind. + SetExitFP(masm, reason, ABINonArgReturnVolatileReg); + + MOZ_ASSERT(masm.framePushed() == 0); + masm.reserveStack(framePushed); } void @@ -544,7 +569,7 @@ wasm::GenerateExitEpilogue(MacroAssembler& masm, unsigned framePushed, ExitReaso // Inverse of GenerateExitPrologue: MOZ_ASSERT(masm.framePushed() == framePushed); GenerateCallableEpilogue(masm, framePushed, reason, &offsets->ret); - masm.setFramePushed(0); + MOZ_ASSERT(masm.framePushed() == 0); } static void @@ -572,10 +597,12 @@ void wasm::GenerateJitExitPrologue(MacroAssembler& masm, unsigned framePushed, CallableOffsets* offsets) { masm.haltingAlign(CodeAlignment); - GenerateCallablePrologue(masm, framePushed, ExitReason::None(), &offsets->begin, nullptr, - CompileMode::Once, 0); + + GenerateCallablePrologue(masm, &offsets->begin); AssertNoWasmExitFPInJitExit(masm); - masm.setFramePushed(framePushed); + + MOZ_ASSERT(masm.framePushed() == 0); + masm.reserveStack(framePushed); } void @@ -585,7 +612,7 @@ wasm::GenerateJitExitEpilogue(MacroAssembler& masm, unsigned framePushed, Callab MOZ_ASSERT(masm.framePushed() == framePushed); AssertNoWasmExitFPInJitExit(masm); GenerateCallableEpilogue(masm, framePushed, ExitReason::None(), &offsets->ret); - masm.setFramePushed(0); + MOZ_ASSERT(masm.framePushed() == 0); } void @@ -1228,11 +1255,19 @@ wasm::LookupFaultingInstance(const ModuleSegment& codeSegment, void* pc, void* f size_t offsetInModule = ((uint8_t*)pc) - codeSegment.base(); if (offsetInModule < codeRange->funcNormalEntry() + SetFP) return nullptr; - if (offsetInModule >= codeRange->ret() - PoppedFP) + if (offsetInModule >= codeRange->ret() - PoppedFP && offsetInModule <= codeRange->ret()) return nullptr; Instance* instance = reinterpret_cast(fp)->tls->instance; - MOZ_RELEASE_ASSERT(&instance->code() == &codeSegment.code()); + + // TODO: when Trap::IndirectCallBadSig is converted away from being an + // OldTrap, this could become a release assert again. The reason for the + // check is the out-of-line trap stub for the table entry's signature check, + // which executes before fp has been updated. + //MOZ_RELEASE_ASSERT(&instance->code() == &codeSegment.code()); + if (&instance->code() != &codeSegment.code()) + return nullptr; + return instance; } diff --git a/js/src/wasm/WasmFrameIter.h b/js/src/wasm/WasmFrameIter.h index d993027b8dc4..e4878ee9f1b1 100644 --- a/js/src/wasm/WasmFrameIter.h +++ b/js/src/wasm/WasmFrameIter.h @@ -216,10 +216,12 @@ GenerateJitExitEpilogue(jit::MacroAssembler& masm, unsigned framePushed, Callabl void GenerateJitEntryPrologue(jit::MacroAssembler& masm, Offsets* offsets); +typedef bool IsLeaf; + void -GenerateFunctionPrologue(jit::MacroAssembler& masm, unsigned framePushed, const SigIdDesc& sigId, - FuncOffsets* offsets, CompileMode mode = CompileMode::Once, - uint32_t funcIndex = 0); +GenerateFunctionPrologue(jit::MacroAssembler& masm, uint32_t framePushed, IsLeaf isLeaf, + const SigIdDesc& sigId, BytecodeOffset trapOffset, FuncOffsets* offsets, + const mozilla::Maybe& tier1FuncIndex = mozilla::Nothing()); void GenerateFunctionEpilogue(jit::MacroAssembler& masm, unsigned framePushed, FuncOffsets* offsets); diff --git a/js/src/wasm/WasmStubs.cpp b/js/src/wasm/WasmStubs.cpp index e7c375e1724d..bf8bf7110e1b 100644 --- a/js/src/wasm/WasmStubs.cpp +++ b/js/src/wasm/WasmStubs.cpp @@ -824,7 +824,7 @@ GenerateImportFunction(jit::MacroAssembler& masm, const FuncImport& fi, SigIdDes unsigned framePushed = StackDecrementForCall(masm, WasmStackAlignment, fi.sig().args()); - GenerateFunctionPrologue(masm, framePushed, sigId, offsets); + GenerateFunctionPrologue(masm, framePushed, IsLeaf(false), sigId, BytecodeOffset(0), offsets); // The argument register state is already setup by our caller. We just need // to be sure not to clobber it before the call. @@ -1726,17 +1726,17 @@ wasm::GenerateStubs(const ModuleEnvironment& env, const FuncImportVector& import for (Trap trap : MakeEnumeratedRange(Trap::Limit)) { switch (trap) { case Trap::Unreachable: - break; - // The TODO list of "old" traps to convert to new traps: case Trap::IntegerOverflow: case Trap::InvalidConversionToInteger: case Trap::IntegerDivideByZero: + case Trap::StackOverflow: + break; + // The TODO list of "old" traps to convert to new traps: case Trap::OutOfBounds: case Trap::UnalignedAccess: case Trap::IndirectCallToNull: case Trap::IndirectCallBadSig: case Trap::ImpreciseSimdConversion: - case Trap::StackOverflow: case Trap::ThrowReported: { CallableOffsets offsets; if (!GenerateOldTrapExit(masm, trap, &throwLabel, &offsets)) diff --git a/layout/style/ServoNamespaceRule.cpp b/layout/style/ServoNamespaceRule.cpp index f7a065aad4a6..9f2a10017cd5 100644 --- a/layout/style/ServoNamespaceRule.cpp +++ b/layout/style/ServoNamespaceRule.cpp @@ -16,12 +16,6 @@ ServoNamespaceRule::~ServoNamespaceRule() { } -NS_IMPL_ADDREF_INHERITED(ServoNamespaceRule, CSSNamespaceRule) -NS_IMPL_RELEASE_INHERITED(ServoNamespaceRule, CSSNamespaceRule) - -NS_INTERFACE_MAP_BEGIN(ServoNamespaceRule) -NS_INTERFACE_MAP_END_INHERITING(CSSNamespaceRule) - #ifdef DEBUG void ServoNamespaceRule::List(FILE* out, int32_t aIndent) const diff --git a/layout/style/ServoNamespaceRule.h b/layout/style/ServoNamespaceRule.h index cf97ee536aa7..a6617d3a5919 100644 --- a/layout/style/ServoNamespaceRule.h +++ b/layout/style/ServoNamespaceRule.h @@ -22,7 +22,8 @@ public: { } - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ServoNamespaceRule, + dom::CSSNamespaceRule) #ifdef DEBUG void List(FILE* out = stdout, int32_t aIndent = 0) const final override; diff --git a/layout/style/nsCSSRules.cpp b/layout/style/nsCSSRules.cpp index f532355c69e6..9da3304b8a25 100644 --- a/layout/style/nsCSSRules.cpp +++ b/layout/style/nsCSSRules.cpp @@ -390,13 +390,6 @@ DocumentRule::~DocumentRule() { } -NS_IMPL_ADDREF_INHERITED(DocumentRule, ConditionRule) -NS_IMPL_RELEASE_INHERITED(DocumentRule, ConditionRule) - -// QueryInterface implementation for DocumentRule -NS_INTERFACE_MAP_BEGIN(DocumentRule) -NS_INTERFACE_MAP_END_INHERITING(dom::CSSMozDocumentRule) - #ifdef DEBUG /* virtual */ void DocumentRule::List(FILE* out, int32_t aIndent) const @@ -1469,13 +1462,6 @@ CSSSupportsRule::UseForPresentation(nsPresContext* aPresContext, return mUseGroup; } -NS_IMPL_ADDREF_INHERITED(mozilla::CSSSupportsRule, dom::CSSSupportsRule) -NS_IMPL_RELEASE_INHERITED(mozilla::CSSSupportsRule, dom::CSSSupportsRule) - -// QueryInterface implementation for CSSSupportsRule -NS_INTERFACE_MAP_BEGIN(CSSSupportsRule) -NS_INTERFACE_MAP_END_INHERITING(dom::CSSSupportsRule) - void CSSSupportsRule::GetCssText(nsAString& aCssText) const { diff --git a/layout/style/nsCSSRules.h b/layout/style/nsCSSRules.h index f4626fa6ad72..41d1cc742a87 100644 --- a/layout/style/nsCSSRules.h +++ b/layout/style/nsCSSRules.h @@ -99,7 +99,8 @@ private: ~DocumentRule(); public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(DocumentRule, + dom::CSSMozDocumentRule) // Rule methods #ifdef DEBUG @@ -405,7 +406,8 @@ public: virtual bool UseForPresentation(nsPresContext* aPresContext, nsMediaQueryResultCacheKey& aKey) override; - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(CSSSupportsRule, + dom::CSSSupportsRule) // WebIDL interface void GetCssText(nsAString& aCssText) const final override; diff --git a/layout/xul/PopupBoxObject.cpp b/layout/xul/PopupBoxObject.cpp index 3d570351b1b4..e4570757130b 100644 --- a/layout/xul/PopupBoxObject.cpp +++ b/layout/xul/PopupBoxObject.cpp @@ -22,11 +22,6 @@ namespace mozilla { namespace dom { -NS_IMPL_ADDREF_INHERITED(PopupBoxObject, BoxObject) -NS_IMPL_RELEASE_INHERITED(PopupBoxObject, BoxObject) -NS_INTERFACE_MAP_BEGIN(PopupBoxObject) -NS_INTERFACE_MAP_END_INHERITING(BoxObject) - PopupBoxObject::PopupBoxObject() { } diff --git a/layout/xul/PopupBoxObject.h b/layout/xul/PopupBoxObject.h index dd56fb2b76ef..f8056e44c0a7 100644 --- a/layout/xul/PopupBoxObject.h +++ b/layout/xul/PopupBoxObject.h @@ -27,7 +27,7 @@ class Event; class PopupBoxObject final : public BoxObject { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(PopupBoxObject, BoxObject) // also in PopupBoxObject.webidl static const uint32_t ROLLUP_DEFAULT = 0; /* widget/platform default */ diff --git a/netwerk/base/nsBaseContentStream.cpp b/netwerk/base/nsBaseContentStream.cpp index 66ea7c51fe14..8fc2274afba8 100644 --- a/netwerk/base/nsBaseContentStream.cpp +++ b/netwerk/base/nsBaseContentStream.cpp @@ -41,7 +41,7 @@ NS_INTERFACE_MAP_BEGIN(nsBaseContentStream) NS_INTERFACE_MAP_ENTRY(nsIInputStream) NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIAsyncInputStream, mNonBlocking) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIInputStream) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END //----------------------------------------------------------------------------- // nsBaseContentStream::nsIInputStream diff --git a/netwerk/cache/nsCacheEntryDescriptor.cpp b/netwerk/cache/nsCacheEntryDescriptor.cpp index f9ede9ad9272..d2e9ac8586a5 100644 --- a/netwerk/cache/nsCacheEntryDescriptor.cpp +++ b/netwerk/cache/nsCacheEntryDescriptor.cpp @@ -698,7 +698,7 @@ nsCacheEntryDescriptor::nsInputStreamWrapper::Release() NS_INTERFACE_MAP_BEGIN(nsCacheEntryDescriptor::nsInputStreamWrapper) NS_INTERFACE_MAP_ENTRY(nsIInputStream) NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END nsresult nsCacheEntryDescriptor:: nsInputStreamWrapper::LazyInit() @@ -892,7 +892,7 @@ nsCacheEntryDescriptor::nsDecompressInputStreamWrapper::Release() NS_INTERFACE_MAP_BEGIN(nsCacheEntryDescriptor::nsDecompressInputStreamWrapper) NS_INTERFACE_MAP_ENTRY(nsIInputStream) NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END NS_IMETHODIMP nsCacheEntryDescriptor:: nsDecompressInputStreamWrapper::Read(char * buf, @@ -1078,7 +1078,7 @@ nsCacheEntryDescriptor::nsOutputStreamWrapper::Release() NS_INTERFACE_MAP_BEGIN(nsCacheEntryDescriptor::nsOutputStreamWrapper) NS_INTERFACE_MAP_ENTRY(nsIOutputStream) NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END nsresult nsCacheEntryDescriptor:: nsOutputStreamWrapper::LazyInit() @@ -1308,7 +1308,7 @@ nsCacheEntryDescriptor::nsCompressOutputStreamWrapper::Release() NS_INTERFACE_MAP_BEGIN(nsCacheEntryDescriptor::nsCompressOutputStreamWrapper) NS_INTERFACE_MAP_ENTRY(nsIOutputStream) NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END NS_IMETHODIMP nsCacheEntryDescriptor:: nsCompressOutputStreamWrapper::Write(const char * buf, diff --git a/netwerk/cache2/AppCacheStorage.cpp b/netwerk/cache2/AppCacheStorage.cpp index 71123d273cd3..ad8279c754ed 100644 --- a/netwerk/cache2/AppCacheStorage.cpp +++ b/netwerk/cache2/AppCacheStorage.cpp @@ -21,8 +21,6 @@ namespace mozilla { namespace net { -NS_IMPL_ISUPPORTS_INHERITED0(AppCacheStorage, CacheStorage) - AppCacheStorage::AppCacheStorage(nsILoadContextInfo* aInfo, nsIApplicationCache* aAppCache) : CacheStorage(aInfo, true /* disk */, false /* lookup app cache */, false /* skip size check */, false /* pin */) diff --git a/netwerk/cache2/AppCacheStorage.h b/netwerk/cache2/AppCacheStorage.h index eef70dea0808..de96f9569677 100644 --- a/netwerk/cache2/AppCacheStorage.h +++ b/netwerk/cache2/AppCacheStorage.h @@ -18,7 +18,7 @@ namespace net { class AppCacheStorage : public CacheStorage { - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(AppCacheStorage, CacheStorage) NS_DECL_NSICACHESTORAGE public: diff --git a/netwerk/cache2/CacheFile.cpp b/netwerk/cache2/CacheFile.cpp index 64c4318b1390..9b5a6d79eccd 100644 --- a/netwerk/cache2/CacheFile.cpp +++ b/netwerk/cache2/CacheFile.cpp @@ -172,7 +172,7 @@ NS_INTERFACE_MAP_BEGIN(CacheFile) NS_INTERFACE_MAP_ENTRY(mozilla::net::CacheFileMetadataListener) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, mozilla::net::CacheFileChunkListener) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END CacheFile::CacheFile() : mLock("CacheFile.mLock") diff --git a/netwerk/cache2/CacheFileChunk.cpp b/netwerk/cache2/CacheFileChunk.cpp index be02c5e11aa8..08c91ac600a3 100644 --- a/netwerk/cache2/CacheFileChunk.cpp +++ b/netwerk/cache2/CacheFileChunk.cpp @@ -330,7 +330,7 @@ CacheFileChunk::Release() NS_INTERFACE_MAP_BEGIN(CacheFileChunk) NS_INTERFACE_MAP_ENTRY(mozilla::net::CacheFileIOListener) NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END CacheFileChunk::CacheFileChunk(CacheFile *aFile, uint32_t aIndex, bool aInitByWriter) diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp index 86665bd110cc..ffacb2be54b4 100644 --- a/netwerk/cache2/CacheFileIOManager.cpp +++ b/netwerk/cache2/CacheFileIOManager.cpp @@ -108,7 +108,7 @@ CacheFileHandle::Release() NS_INTERFACE_MAP_BEGIN(CacheFileHandle) NS_INTERFACE_MAP_ENTRY(nsISupports) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END CacheFileHandle::CacheFileHandle(const SHA1Sum::Hash *aHash, bool aPriority, PinningStatus aPinning) : mHash(aHash) diff --git a/netwerk/cache2/CacheFileInputStream.cpp b/netwerk/cache2/CacheFileInputStream.cpp index 613a0b519e37..c5c5dced975f 100644 --- a/netwerk/cache2/CacheFileInputStream.cpp +++ b/netwerk/cache2/CacheFileInputStream.cpp @@ -40,7 +40,7 @@ NS_INTERFACE_MAP_BEGIN(CacheFileInputStream) NS_INTERFACE_MAP_ENTRY(nsISeekableStream) NS_INTERFACE_MAP_ENTRY(mozilla::net::CacheFileChunkListener) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIInputStream) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END CacheFileInputStream::CacheFileInputStream(CacheFile *aFile, nsISupports *aEntry, diff --git a/netwerk/cache2/CacheFileOutputStream.cpp b/netwerk/cache2/CacheFileOutputStream.cpp index 55ca2870193e..3df27276425e 100644 --- a/netwerk/cache2/CacheFileOutputStream.cpp +++ b/netwerk/cache2/CacheFileOutputStream.cpp @@ -42,7 +42,7 @@ NS_INTERFACE_MAP_BEGIN(CacheFileOutputStream) NS_INTERFACE_MAP_ENTRY(nsISeekableStream) NS_INTERFACE_MAP_ENTRY(mozilla::net::CacheFileChunkListener) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIOutputStream) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END CacheFileOutputStream::CacheFileOutputStream(CacheFile *aFile, CacheOutputCloseListener *aCloseListener, diff --git a/netwerk/cache2/CacheIndex.cpp b/netwerk/cache2/CacheIndex.cpp index 20fea137b98e..9231fb475f58 100644 --- a/netwerk/cache2/CacheIndex.cpp +++ b/netwerk/cache2/CacheIndex.cpp @@ -255,7 +255,7 @@ NS_IMPL_RELEASE(CacheIndex) NS_INTERFACE_MAP_BEGIN(CacheIndex) NS_INTERFACE_MAP_ENTRY(mozilla::net::CacheFileIOListener) NS_INTERFACE_MAP_ENTRY(nsIRunnable) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END CacheIndex::CacheIndex() diff --git a/netwerk/protocol/file/nsFileChannel.cpp b/netwerk/protocol/file/nsFileChannel.cpp index 44e5b4246bcb..d8af998e33ed 100644 --- a/netwerk/protocol/file/nsFileChannel.cpp +++ b/netwerk/protocol/file/nsFileChannel.cpp @@ -168,7 +168,8 @@ nsFileCopyEvent::Dispatch(nsIRunnable *callback, class nsFileUploadContentStream : public nsBaseContentStream { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsFileUploadContentStream, + nsBaseContentStream) nsFileUploadContentStream(bool nonBlocking, nsIOutputStream *dest, @@ -198,9 +199,6 @@ private: nsCOMPtr mSink; }; -NS_IMPL_ISUPPORTS_INHERITED0(nsFileUploadContentStream, - nsBaseContentStream) - NS_IMETHODIMP nsFileUploadContentStream::ReadSegments(nsWriteSegmentFun fun, void *closure, uint32_t count, uint32_t *result) diff --git a/parser/html/nsHtml5StreamListener.cpp b/parser/html/nsHtml5StreamListener.cpp index a585ce8dec9d..6770f3060d23 100644 --- a/parser/html/nsHtml5StreamListener.cpp +++ b/parser/html/nsHtml5StreamListener.cpp @@ -12,7 +12,7 @@ NS_INTERFACE_MAP_BEGIN(nsHtml5StreamListener) NS_INTERFACE_MAP_ENTRY(nsIRequestObserver) NS_INTERFACE_MAP_ENTRY(nsIStreamListener) NS_INTERFACE_MAP_ENTRY(nsIThreadRetargetableStreamListener) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END nsHtml5StreamListener::nsHtml5StreamListener(nsHtml5StreamParser* aDelegate) : mDelegate(aDelegate) diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 4415bcaf29ad..fd646e46475b 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -545706,7 +545706,7 @@ "testharness" ], "html/browsers/origin/cross-origin-objects/cross-origin-objects.html": [ - "8fe0ecd10bcc148d1e49668025e4515b70540f89", + "5a5a86a7f989232a78a89e07e5678a1eeb8d4d6d", "testharness" ], "html/browsers/origin/cross-origin-objects/frame-with-then.html": [ @@ -584534,7 +584534,7 @@ "support" ], "service-workers/service-worker/resources/test-helpers.sub.js": [ - "5567e4c45d07a90c4fc7fefa3475e564f0d46e5a", + "fee1648c02422cd2607b008b9a1ef0834385c69c", "support" ], "service-workers/service-worker/resources/testharness-helpers.js": [ diff --git a/testing/web-platform/meta/WebCryptoAPI/idlharness.https.worker.js.ini b/testing/web-platform/meta/WebCryptoAPI/idlharness.https.worker.js.ini index cba0ba2636ae..2ce4207fd4ae 100644 --- a/testing/web-platform/meta/WebCryptoAPI/idlharness.https.worker.js.ini +++ b/testing/web-platform/meta/WebCryptoAPI/idlharness.https.worker.js.ini @@ -17,6 +17,9 @@ [CryptoKey interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [CryptoKey interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [CryptoKey interface: attribute type] expected: FAIL diff --git a/testing/web-platform/meta/accelerometer/idlharness.https.html.ini b/testing/web-platform/meta/accelerometer/idlharness.https.html.ini index fc37f9f93d70..d7878be2d6e2 100644 --- a/testing/web-platform/meta/accelerometer/idlharness.https.html.ini +++ b/testing/web-platform/meta/accelerometer/idlharness.https.html.ini @@ -14,6 +14,9 @@ [Accelerometer interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Accelerometer interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Accelerometer interface: attribute reading] expected: FAIL @@ -68,6 +71,9 @@ [AccelerometerReading interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [AccelerometerReading interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [AccelerometerReading interface: attribute x] expected: FAIL @@ -134,6 +140,9 @@ [LinearAccelerationSensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [LinearAccelerationSensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [LinearAccelerationSensor must be primary interface of new LinearAccelerationSensor();] expected: FAIL @@ -185,6 +194,9 @@ [GravitySensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [GravitySensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [GravitySensor must be primary interface of new GravitySensor();] expected: FAIL @@ -263,6 +275,9 @@ [Sensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Sensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Sensor interface: attribute activated] expected: FAIL diff --git a/testing/web-platform/meta/ambient-light/idlharness.https.html.ini b/testing/web-platform/meta/ambient-light/idlharness.https.html.ini index 76bd2d2c98ed..0f2f0665bb2d 100644 --- a/testing/web-platform/meta/ambient-light/idlharness.https.html.ini +++ b/testing/web-platform/meta/ambient-light/idlharness.https.html.ini @@ -14,6 +14,9 @@ [AmbientLightSensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [AmbientLightSensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [AmbientLightSensor must be primary interface of new AmbientLightSensor();] expected: FAIL @@ -56,6 +59,9 @@ [AmbientLightSensorReading interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [AmbientLightSensorReading interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [AmbientLightSensorReading interface: attribute illuminance] expected: FAIL @@ -101,6 +107,9 @@ [Sensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Sensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Sensor interface: attribute activated] expected: FAIL diff --git a/testing/web-platform/meta/background-fetch/interfaces-worker.https.html.ini b/testing/web-platform/meta/background-fetch/interfaces-worker.https.html.ini index 97bb3a4dc443..c9d40164bc70 100644 --- a/testing/web-platform/meta/background-fetch/interfaces-worker.https.html.ini +++ b/testing/web-platform/meta/background-fetch/interfaces-worker.https.html.ini @@ -29,6 +29,9 @@ [BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchManager interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchManager interface: operation fetch(DOMString,[object Object\],[object Object\],BackgroundFetchOptions)] expected: FAIL @@ -53,6 +56,9 @@ [BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchRegistration interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchRegistration interface: attribute tag] expected: FAIL @@ -86,6 +92,9 @@ [BackgroundFetchFetches interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchFetches interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchFetches interface: attribute request] expected: FAIL @@ -104,6 +113,9 @@ [BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchActiveFetches interface: attribute responseReady] expected: FAIL @@ -122,6 +134,9 @@ [BackgroundFetchEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchEvent interface: attribute tag] expected: FAIL @@ -140,6 +155,9 @@ [BackgroundFetchEndEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchEndEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchEndEvent interface: attribute completeFetches] expected: FAIL @@ -161,6 +179,9 @@ [BackgroundFetchSettledFetches interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchSettledFetches interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchSettledFetches interface: attribute response] expected: FAIL @@ -179,6 +200,9 @@ [BackgroundFetchFailEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchFailEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchFailEvent interface: attribute failedFetches] expected: FAIL @@ -197,6 +221,9 @@ [BackgroundFetchClickEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchClickEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchClickEvent interface: attribute state] expected: FAIL @@ -245,6 +272,9 @@ [BackgroundFetchFetch interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchFetch interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchFetch interface: attribute request] expected: FAIL @@ -269,6 +299,9 @@ [BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchActiveFetch interface: attribute responseReady] expected: FAIL @@ -287,6 +320,9 @@ [BackgroundFetchSettledEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchSettledEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchSettledEvent interface: attribute fetches] expected: FAIL @@ -311,6 +347,9 @@ [BackgroundFetchSettledFetch interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchSettledFetch interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchSettledFetch interface: attribute response] expected: FAIL @@ -329,6 +368,9 @@ [BackgroundFetchUpdateEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchUpdateEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchUpdateEvent interface: operation updateUI(DOMString)] expected: FAIL diff --git a/testing/web-platform/meta/background-fetch/interfaces.html.ini b/testing/web-platform/meta/background-fetch/interfaces.html.ini index 05ce11590168..56eec65d6eb4 100644 --- a/testing/web-platform/meta/background-fetch/interfaces.html.ini +++ b/testing/web-platform/meta/background-fetch/interfaces.html.ini @@ -17,6 +17,9 @@ [BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchManager interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchManager interface: operation fetch(DOMString,[object Object\],[object Object\],BackgroundFetchOptions)] expected: FAIL @@ -41,6 +44,9 @@ [BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchRegistration interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchRegistration interface: attribute tag] expected: FAIL @@ -74,6 +80,9 @@ [BackgroundFetchFetches interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchFetches interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchFetches interface: attribute request] expected: FAIL @@ -92,6 +101,9 @@ [BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchActiveFetches interface: attribute responseReady] expected: FAIL @@ -137,6 +149,9 @@ [BackgroundFetchFetch interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchFetch interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchFetch interface: attribute request] expected: FAIL @@ -161,6 +176,9 @@ [BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchActiveFetch interface: attribute responseReady] expected: FAIL diff --git a/testing/web-platform/meta/background-fetch/interfaces.worker.js.ini b/testing/web-platform/meta/background-fetch/interfaces.worker.js.ini index 8eea8dfbeb24..1bbd72dde236 100644 --- a/testing/web-platform/meta/background-fetch/interfaces.worker.js.ini +++ b/testing/web-platform/meta/background-fetch/interfaces.worker.js.ini @@ -17,6 +17,9 @@ [BackgroundFetchManager interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchManager interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchManager interface: operation fetch(DOMString,[object Object\],[object Object\],BackgroundFetchOptions)] expected: FAIL @@ -41,6 +44,9 @@ [BackgroundFetchRegistration interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchRegistration interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchRegistration interface: attribute tag] expected: FAIL @@ -74,6 +80,9 @@ [BackgroundFetchFetches interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchFetches interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchFetches interface: attribute request] expected: FAIL @@ -92,6 +101,9 @@ [BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchActiveFetches interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchActiveFetches interface: attribute responseReady] expected: FAIL @@ -137,6 +149,9 @@ [BackgroundFetchFetch interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchFetch interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchFetch interface: attribute request] expected: FAIL @@ -161,6 +176,9 @@ [BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [BackgroundFetchActiveFetch interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [BackgroundFetchActiveFetch interface: attribute responseReady] expected: FAIL diff --git a/testing/web-platform/meta/clipboard-apis/async-interfaces.https.html.ini b/testing/web-platform/meta/clipboard-apis/async-interfaces.https.html.ini index 53d898a20c72..b26ef08c88ce 100644 --- a/testing/web-platform/meta/clipboard-apis/async-interfaces.https.html.ini +++ b/testing/web-platform/meta/clipboard-apis/async-interfaces.https.html.ini @@ -20,6 +20,9 @@ [Clipboard interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Clipboard interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Clipboard interface: operation read()] expected: FAIL diff --git a/testing/web-platform/meta/credential-management/idl.https.html.ini b/testing/web-platform/meta/credential-management/idl.https.html.ini index d1886d84f4ea..27e5b38bf349 100644 --- a/testing/web-platform/meta/credential-management/idl.https.html.ini +++ b/testing/web-platform/meta/credential-management/idl.https.html.ini @@ -21,6 +21,9 @@ [PasswordCredential interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [PasswordCredential interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [PasswordCredential interface: attribute idName] expected: FAIL @@ -72,6 +75,9 @@ [FederatedCredential interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [FederatedCredential interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [FederatedCredential interface: attribute provider] expected: FAIL diff --git a/testing/web-platform/meta/css/css-typed-om/stylevalue-objects/interface.html.ini b/testing/web-platform/meta/css/css-typed-om/stylevalue-objects/interface.html.ini index 304eda2e25b6..86d495d73a78 100644 --- a/testing/web-platform/meta/css/css-typed-om/stylevalue-objects/interface.html.ini +++ b/testing/web-platform/meta/css/css-typed-om/stylevalue-objects/interface.html.ini @@ -14,6 +14,9 @@ [CSSStyleValue interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [CSSStyleValue interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [CSSStyleValue interface: stringifier] expected: FAIL diff --git a/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssKeywordValue-interface.html.ini b/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssKeywordValue-interface.html.ini index db40314d03b4..66dbf023e0cf 100644 --- a/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssKeywordValue-interface.html.ini +++ b/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssKeywordValue-interface.html.ini @@ -14,6 +14,9 @@ [CSSKeywordValue interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [CSSKeywordValue interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [CSSKeywordValue interface: attribute value] expected: FAIL diff --git a/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssPositionValue-interface.html.ini b/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssPositionValue-interface.html.ini index f937e7fbcc2b..3b15f80cf89d 100644 --- a/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssPositionValue-interface.html.ini +++ b/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssPositionValue-interface.html.ini @@ -14,6 +14,9 @@ [CSSPositionValue interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [CSSPositionValue interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [CSSPositionValue interface: attribute x] expected: FAIL diff --git a/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-interface.html.ini b/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-interface.html.ini index 7269e221990c..3b3e2134dd00 100644 --- a/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-interface.html.ini +++ b/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssUnparsedValue-interface.html.ini @@ -14,6 +14,9 @@ [CSSUnparsedValue interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [CSSUnparsedValue interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Testing Symbol.iterator property of iterable interface CSSUnparsedValue] expected: FAIL diff --git a/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssUrlImageValue-interface.html.ini b/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssUrlImageValue-interface.html.ini index 1ab9c6d4b380..ced9de6ec9ad 100644 --- a/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssUrlImageValue-interface.html.ini +++ b/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssUrlImageValue-interface.html.ini @@ -14,6 +14,9 @@ [CSSURLImageValue interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [CSSURLImageValue interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [CSSURLImageValue interface: attribute url] expected: FAIL diff --git a/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-interface.html.ini b/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-interface.html.ini index 5e67206341fd..cc38e70366ff 100644 --- a/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-interface.html.ini +++ b/testing/web-platform/meta/css/css-typed-om/stylevalue-subclasses/cssVariableReferenceValue-interface.html.ini @@ -14,6 +14,9 @@ [CSSVariableReferenceValue interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [CSSVariableReferenceValue interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [CSSVariableReferenceValue interface: attribute variable] expected: FAIL diff --git a/testing/web-platform/meta/css/css-typed-om/the-stylepropertymap/interface.html.ini b/testing/web-platform/meta/css/css-typed-om/the-stylepropertymap/interface.html.ini index 2d8f1c8319ad..d9eccddcf98b 100644 --- a/testing/web-platform/meta/css/css-typed-om/the-stylepropertymap/interface.html.ini +++ b/testing/web-platform/meta/css/css-typed-om/the-stylepropertymap/interface.html.ini @@ -14,6 +14,9 @@ [StylePropertyMapReadOnly interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [StylePropertyMapReadOnly interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [StylePropertyMapReadOnly interface: operation get(DOMString)] expected: FAIL @@ -62,6 +65,9 @@ [StylePropertyMap interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [StylePropertyMap interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [StylePropertyMap interface: operation append(DOMString, [object Object\],[object Object\])] expected: FAIL diff --git a/testing/web-platform/meta/css/cssom/interfaces.html.ini b/testing/web-platform/meta/css/cssom/interfaces.html.ini index 0555fde9ac87..8e31181d70d7 100644 --- a/testing/web-platform/meta/css/cssom/interfaces.html.ini +++ b/testing/web-platform/meta/css/cssom/interfaces.html.ini @@ -68,6 +68,9 @@ [CSSMarginRule interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [CSSMarginRule interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [CSSMarginRule interface: attribute name] expected: FAIL @@ -89,6 +92,9 @@ [CSS interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [CSS interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [CSS interface: operation escape(DOMString)] expected: FAIL diff --git a/testing/web-platform/meta/css/geometry/interfaces.worker.js.ini b/testing/web-platform/meta/css/geometry/interfaces.worker.js.ini index e4416f9e37a8..565d93f303b1 100644 --- a/testing/web-platform/meta/css/geometry/interfaces.worker.js.ini +++ b/testing/web-platform/meta/css/geometry/interfaces.worker.js.ini @@ -14,6 +14,9 @@ [DOMPointReadOnly interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [DOMPointReadOnly interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [DOMPointReadOnly interface: operation fromPoint(DOMPointInit)] expected: FAIL @@ -77,6 +80,9 @@ [DOMPoint interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [DOMPoint interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [DOMPoint interface: operation fromPoint(DOMPointInit)] expected: FAIL @@ -155,6 +161,9 @@ [DOMRectReadOnly interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [DOMRectReadOnly interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [DOMRectReadOnly interface: operation fromRect(DOMRectInit)] expected: FAIL @@ -233,6 +242,9 @@ [DOMRect interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [DOMRect interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [DOMRect interface: operation fromRect(DOMRectInit)] expected: FAIL @@ -317,6 +329,9 @@ [DOMQuad interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [DOMQuad interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [DOMQuad interface: operation fromRect(DOMRectInit)] expected: FAIL @@ -386,6 +401,9 @@ [DOMMatrixReadOnly interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [DOMMatrixReadOnly interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [DOMMatrixReadOnly interface: operation fromMatrix(DOMMatrixInit)] expected: FAIL @@ -878,6 +896,9 @@ [DOMMatrix interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [DOMMatrix interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [DOMMatrix interface: operation fromMatrix(DOMMatrixInit)] expected: FAIL diff --git a/testing/web-platform/meta/fullscreen/interfaces.html.ini b/testing/web-platform/meta/fullscreen/interfaces.html.ini index 9e44734103d8..543ed41306a0 100644 --- a/testing/web-platform/meta/fullscreen/interfaces.html.ini +++ b/testing/web-platform/meta/fullscreen/interfaces.html.ini @@ -2,6 +2,9 @@ [Document interface: operation exitFullscreen()] expected: FAIL + [Unscopable handled correctly for fullscreen property on Document] + expected: FAIL + [ShadowRoot interface: attribute fullscreenElement] expected: FAIL diff --git a/testing/web-platform/meta/generic-sensor/idlharness.https.html.ini b/testing/web-platform/meta/generic-sensor/idlharness.https.html.ini index 6d20cc8bd7ed..07f2ba99f438 100644 --- a/testing/web-platform/meta/generic-sensor/idlharness.https.html.ini +++ b/testing/web-platform/meta/generic-sensor/idlharness.https.html.ini @@ -14,6 +14,9 @@ [SensorErrorEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [SensorErrorEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [SensorErrorEvent interface: attribute error] expected: FAIL @@ -41,6 +44,9 @@ [Sensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Sensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Sensor interface: attribute activated] expected: FAIL diff --git a/testing/web-platform/meta/geolocation-sensor/idlharness.https.html.ini b/testing/web-platform/meta/geolocation-sensor/idlharness.https.html.ini index eabd2f890c8a..924fff2b623a 100644 --- a/testing/web-platform/meta/geolocation-sensor/idlharness.https.html.ini +++ b/testing/web-platform/meta/geolocation-sensor/idlharness.https.html.ini @@ -14,6 +14,9 @@ [Sensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Sensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Sensor interface: attribute activated] expected: FAIL @@ -53,6 +56,9 @@ [GeolocationSensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [GeolocationSensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [GeolocationSensor interface: attribute latitude] expected: FAIL diff --git a/testing/web-platform/meta/gyroscope/idlharness.https.html.ini b/testing/web-platform/meta/gyroscope/idlharness.https.html.ini index 3347555ad0f0..8e78e2d0db70 100644 --- a/testing/web-platform/meta/gyroscope/idlharness.https.html.ini +++ b/testing/web-platform/meta/gyroscope/idlharness.https.html.ini @@ -14,6 +14,9 @@ [Gyroscope interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Gyroscope interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Gyroscope interface: attribute reading] expected: FAIL @@ -62,6 +65,9 @@ [GyroscopeReading interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [GyroscopeReading interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [GyroscopeReading interface: attribute x] expected: FAIL @@ -137,6 +143,9 @@ [Sensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Sensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Sensor interface: attribute activated] expected: FAIL diff --git a/testing/web-platform/meta/html/dom/interfaces.html.ini b/testing/web-platform/meta/html/dom/interfaces.html.ini index 827d98022b45..db3d6b58cf5b 100644 --- a/testing/web-platform/meta/html/dom/interfaces.html.ini +++ b/testing/web-platform/meta/html/dom/interfaces.html.ini @@ -582,6 +582,9 @@ [AudioTrackList interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [AudioTrackList interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [AudioTrackList interface: attribute length] expected: FAIL @@ -609,6 +612,9 @@ [AudioTrack interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [AudioTrack interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [AudioTrack interface: attribute id] expected: FAIL @@ -636,6 +642,9 @@ [VideoTrackList interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [VideoTrackList interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [VideoTrackList interface: attribute length] expected: FAIL @@ -666,6 +675,9 @@ [VideoTrack interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [VideoTrack interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [VideoTrack interface: attribute id] expected: FAIL @@ -1509,6 +1521,9 @@ [ApplicationCache interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [ApplicationCache interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [ApplicationCache interface: constant UNCACHED on interface object] expected: FAIL @@ -1671,6 +1686,9 @@ [HTMLMarqueeElement interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [HTMLMarqueeElement interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [HTMLMarqueeElement interface: attribute behavior] expected: FAIL @@ -3822,6 +3840,9 @@ [OffscreenCanvas interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [OffscreenCanvas interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [OffscreenCanvas interface: attribute width] expected: FAIL @@ -3852,6 +3873,9 @@ [OffscreenCanvasRenderingContext2D interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [OffscreenCanvasRenderingContext2D interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [OffscreenCanvasRenderingContext2D interface: operation commit()] expected: FAIL @@ -4095,6 +4119,9 @@ [PromiseRejectionEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [PromiseRejectionEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [PromiseRejectionEvent interface: attribute promise] expected: FAIL diff --git a/testing/web-platform/meta/magnetometer/idlharness.https.html.ini b/testing/web-platform/meta/magnetometer/idlharness.https.html.ini index 9c55d8b0ba63..d4386e4f69f3 100644 --- a/testing/web-platform/meta/magnetometer/idlharness.https.html.ini +++ b/testing/web-platform/meta/magnetometer/idlharness.https.html.ini @@ -14,6 +14,9 @@ [Magnetometer interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Magnetometer interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Magnetometer interface: attribute reading] expected: FAIL @@ -62,6 +65,9 @@ [MagnetometerReading interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [MagnetometerReading interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [MagnetometerReading interface: attribute x] expected: FAIL @@ -128,6 +134,9 @@ [UncalibratedMagnetometer interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [UncalibratedMagnetometer interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [UncalibratedMagnetometer interface: attribute x] expected: FAIL @@ -212,6 +221,9 @@ [Sensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Sensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Sensor interface: attribute activated] expected: FAIL diff --git a/testing/web-platform/meta/media-capabilities/idlharness.html.ini b/testing/web-platform/meta/media-capabilities/idlharness.html.ini index 83496a108504..6ba2b5d1938c 100644 --- a/testing/web-platform/meta/media-capabilities/idlharness.html.ini +++ b/testing/web-platform/meta/media-capabilities/idlharness.html.ini @@ -20,6 +20,9 @@ [MediaDecodingAbility interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [MediaDecodingAbility interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [MediaDecodingAbility interface: attribute supported] expected: FAIL @@ -44,6 +47,9 @@ [MediaCapabilities interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [MediaCapabilities interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [MediaCapabilities interface: operation query(MediaConfiguration)] expected: FAIL @@ -62,6 +68,9 @@ [MediaCapabilitiesInfo interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [MediaCapabilitiesInfo interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [MediaCapabilitiesInfo interface: attribute supported] expected: FAIL diff --git a/testing/web-platform/meta/mediacapture-streams/MediaDevices-IDL-all.html.ini b/testing/web-platform/meta/mediacapture-streams/MediaDevices-IDL-all.html.ini index 46b963c5a3ce..8fa5842b3fe4 100644 --- a/testing/web-platform/meta/mediacapture-streams/MediaDevices-IDL-all.html.ini +++ b/testing/web-platform/meta/mediacapture-streams/MediaDevices-IDL-all.html.ini @@ -35,6 +35,9 @@ [OverconstrainedErrorEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [OverconstrainedErrorEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [OverconstrainedErrorEvent interface: attribute error] expected: FAIL @@ -53,6 +56,9 @@ [InputDeviceInfo interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [InputDeviceInfo interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [InputDeviceInfo interface: operation getCapabilities()] expected: FAIL diff --git a/testing/web-platform/meta/mediacapture-streams/MediaDevices-IDL-enumerateDevices.html.ini b/testing/web-platform/meta/mediacapture-streams/MediaDevices-IDL-enumerateDevices.html.ini index 416759718f89..2aa0621c3be7 100644 --- a/testing/web-platform/meta/mediacapture-streams/MediaDevices-IDL-enumerateDevices.html.ini +++ b/testing/web-platform/meta/mediacapture-streams/MediaDevices-IDL-enumerateDevices.html.ini @@ -23,6 +23,9 @@ [OverconstrainedErrorEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [OverconstrainedErrorEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [OverconstrainedErrorEvent interface: attribute error] expected: FAIL @@ -41,6 +44,9 @@ [InputDeviceInfo interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [InputDeviceInfo interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [InputDeviceInfo interface: operation getCapabilities()] expected: FAIL diff --git a/testing/web-platform/meta/orientation-sensor/idlharness.https.html.ini b/testing/web-platform/meta/orientation-sensor/idlharness.https.html.ini index 54695596be39..454bf033f328 100644 --- a/testing/web-platform/meta/orientation-sensor/idlharness.https.html.ini +++ b/testing/web-platform/meta/orientation-sensor/idlharness.https.html.ini @@ -14,6 +14,9 @@ [OrientationSensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [OrientationSensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [OrientationSensor interface: attribute quaternion] expected: FAIL @@ -35,6 +38,9 @@ [AbsoluteOrientationSensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [AbsoluteOrientationSensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [AbsoluteOrientationSensor must be primary interface of new AbsoluteOrientationSensor();] expected: FAIL @@ -86,6 +92,9 @@ [RelativeOrientationSensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RelativeOrientationSensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RelativeOrientationSensor must be primary interface of new RelativeOrientationSensor();] expected: FAIL @@ -128,6 +137,9 @@ [Sensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Sensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Sensor interface: attribute activated] expected: FAIL diff --git a/testing/web-platform/meta/payment-handler/interfaces.https.any.js.ini b/testing/web-platform/meta/payment-handler/interfaces.https.any.js.ini index 506b343390f3..3fe98363ceec 100644 --- a/testing/web-platform/meta/payment-handler/interfaces.https.any.js.ini +++ b/testing/web-platform/meta/payment-handler/interfaces.https.any.js.ini @@ -14,6 +14,9 @@ [PaymentManager interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [PaymentManager interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [PaymentManager interface: attribute instruments] expected: FAIL @@ -35,6 +38,9 @@ [PaymentInstruments interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [PaymentInstruments interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [PaymentInstruments interface: operation delete(DOMString)] expected: FAIL @@ -70,6 +76,9 @@ [PaymentManager interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [PaymentManager interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [PaymentManager interface: attribute instruments] expected: FAIL @@ -91,6 +100,9 @@ [PaymentInstruments interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [PaymentInstruments interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [PaymentInstruments interface: operation delete(DOMString)] expected: FAIL diff --git a/testing/web-platform/meta/payment-request/interfaces.https.html.ini b/testing/web-platform/meta/payment-request/interfaces.https.html.ini index 15eb302e5092..75760dac9fc1 100644 --- a/testing/web-platform/meta/payment-request/interfaces.https.html.ini +++ b/testing/web-platform/meta/payment-request/interfaces.https.html.ini @@ -15,6 +15,9 @@ [PaymentRequest interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [PaymentRequest interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [PaymentRequest interface: operation show()] expected: FAIL @@ -72,6 +75,9 @@ [PaymentAddress interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [PaymentAddress interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [PaymentAddress interface: attribute country] expected: FAIL @@ -123,6 +129,9 @@ [PaymentResponse interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [PaymentResponse interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [PaymentResponse interface: attribute methodName] expected: FAIL @@ -159,6 +168,9 @@ [PaymentRequestUpdateEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [PaymentRequestUpdateEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [PaymentRequestUpdateEvent interface: operation updateWith([object Object\])] expected: FAIL diff --git a/testing/web-platform/meta/proximity/idlharness.https.html.ini b/testing/web-platform/meta/proximity/idlharness.https.html.ini index 4d450d4a742a..a999dd64332a 100644 --- a/testing/web-platform/meta/proximity/idlharness.https.html.ini +++ b/testing/web-platform/meta/proximity/idlharness.https.html.ini @@ -14,6 +14,9 @@ [Sensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [Sensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [Sensor interface: attribute activated] expected: FAIL @@ -53,6 +56,9 @@ [ProximitySensor interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [ProximitySensor interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [ProximitySensor interface: attribute distance] expected: FAIL diff --git a/testing/web-platform/meta/remote-playback/idlharness.html.ini b/testing/web-platform/meta/remote-playback/idlharness.html.ini index fff385c2b53c..2fea8b736ae7 100644 --- a/testing/web-platform/meta/remote-playback/idlharness.html.ini +++ b/testing/web-platform/meta/remote-playback/idlharness.html.ini @@ -20,6 +20,9 @@ [RemotePlayback interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RemotePlayback interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RemotePlayback interface: attribute state] expected: FAIL diff --git a/testing/web-platform/meta/service-workers/service-worker/interfaces-sw.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/interfaces-sw.https.html.ini index cf19a0be7bc3..7f08d92e88e4 100644 --- a/testing/web-platform/meta/service-workers/service-worker/interfaces-sw.https.html.ini +++ b/testing/web-platform/meta/service-workers/service-worker/interfaces-sw.https.html.ini @@ -59,6 +59,9 @@ [NavigationPreloadManager interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [NavigationPreloadManager interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [NavigationPreloadManager interface: operation enable()] expected: FAIL diff --git a/testing/web-platform/meta/service-workers/service-worker/interfaces-window.https.html.ini b/testing/web-platform/meta/service-workers/service-worker/interfaces-window.https.html.ini index 8ef1701276ae..52ac933386d6 100644 --- a/testing/web-platform/meta/service-workers/service-worker/interfaces-window.https.html.ini +++ b/testing/web-platform/meta/service-workers/service-worker/interfaces-window.https.html.ini @@ -41,6 +41,9 @@ [NavigationPreloadManager interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [NavigationPreloadManager interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [NavigationPreloadManager interface: operation enable()] expected: FAIL diff --git a/testing/web-platform/meta/staticrange/idlharness.html.ini b/testing/web-platform/meta/staticrange/idlharness.html.ini index 53bccee0e952..f7d6c50925e3 100644 --- a/testing/web-platform/meta/staticrange/idlharness.html.ini +++ b/testing/web-platform/meta/staticrange/idlharness.html.ini @@ -14,6 +14,9 @@ [StaticRange interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [StaticRange interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [StaticRange interface: attribute startContainer] expected: FAIL diff --git a/testing/web-platform/meta/svg/interfaces.html.ini b/testing/web-platform/meta/svg/interfaces.html.ini index 51483023e278..fd6f83cbbe61 100644 --- a/testing/web-platform/meta/svg/interfaces.html.ini +++ b/testing/web-platform/meta/svg/interfaces.html.ini @@ -137,6 +137,9 @@ [SVGUnknownElement interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [SVGUnknownElement interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [SVGElement interface: defs must inherit property "onautocomplete" with the proper type (8)] expected: FAIL @@ -779,6 +782,9 @@ [SVGSolidcolorElement interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [SVGSolidcolorElement interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [SVGElement interface: linearGradient must inherit property "onautocomplete" with the proper type (8)] expected: FAIL @@ -824,6 +830,9 @@ [SVGMeshElement interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [SVGMeshElement interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [SVGMeshrowElement interface: existence and properties of interface object] expected: FAIL @@ -839,6 +848,9 @@ [SVGMeshrowElement interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [SVGMeshrowElement interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [SVGMeshpatchElement interface: existence and properties of interface object] expected: FAIL @@ -854,6 +866,9 @@ [SVGMeshpatchElement interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [SVGMeshpatchElement interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [SVGElement interface: stop must inherit property "onautocomplete" with the proper type (8)] expected: FAIL @@ -899,6 +914,9 @@ [SVGHatchElement interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [SVGHatchElement interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [SVGHatchpathElement interface: existence and properties of interface object] expected: FAIL @@ -914,6 +932,9 @@ [SVGHatchpathElement interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [SVGHatchpathElement interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [SVGCursorElement interface: existence and properties of interface object] expected: FAIL @@ -929,6 +950,9 @@ [SVGCursorElement interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [SVGCursorElement interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [SVGCursorElement interface: attribute x] expected: FAIL @@ -1553,6 +1577,9 @@ [SVGUnitTypes interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [SVGUnitTypes interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [SVGUnitTypes interface: constant SVG_UNIT_TYPE_UNKNOWN on interface prototype object] expected: FAIL diff --git a/testing/web-platform/meta/web-nfc/idlharness.https.html.ini b/testing/web-platform/meta/web-nfc/idlharness.https.html.ini index 626b8870c9cd..a72a39712db3 100644 --- a/testing/web-platform/meta/web-nfc/idlharness.https.html.ini +++ b/testing/web-platform/meta/web-nfc/idlharness.https.html.ini @@ -17,6 +17,9 @@ [NFC interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [NFC interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [NFC interface: operation push(NFCPushMessage,NFCPushOptions)] expected: FAIL diff --git a/testing/web-platform/meta/webrtc/interfaces.https.html.ini b/testing/web-platform/meta/webrtc/interfaces.https.html.ini index 5ad0fc3300d4..411dc31ee47d 100644 --- a/testing/web-platform/meta/webrtc/interfaces.https.html.ini +++ b/testing/web-platform/meta/webrtc/interfaces.https.html.ini @@ -191,6 +191,9 @@ [RTCPeerConnectionIceErrorEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCPeerConnectionIceErrorEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCPeerConnectionIceErrorEvent interface: attribute hostCandidate] expected: FAIL @@ -278,6 +281,10 @@ disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 expected: FAIL + [RTCRtpContributingSource interface: existence and properties of interface prototype object's @@unscopables property] + disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 + expected: FAIL + [RTCRtpContributingSource interface: attribute timestamp] disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 expected: FAIL @@ -318,6 +325,9 @@ [RTCDtlsTransport interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCDtlsTransport interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCDtlsTransport interface: attribute transport] expected: FAIL @@ -345,6 +355,9 @@ [RTCIceTransport interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCIceTransport interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCIceTransport interface: attribute role] expected: FAIL @@ -402,6 +415,9 @@ [RTCSctpTransport interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCSctpTransport interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCSctpTransport interface: attribute transport] expected: FAIL @@ -423,6 +439,9 @@ [RTCDataChannel interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCDataChannel interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCDataChannel interface: attribute label] expected: FAIL @@ -528,6 +547,9 @@ [RTCIdentityAssertion interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCIdentityAssertion interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCIdentityAssertion interface: attribute idp] expected: FAIL @@ -549,6 +571,9 @@ [RTCErrorEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCErrorEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCErrorEvent interface: attribute error] expected: FAIL @@ -761,6 +786,10 @@ disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 expected: FAIL + [RTCRtpSynchronizationSource interface: existence and properties of interface prototype object's @@unscopables property] + disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 + expected: FAIL + [RTCRtpSynchronizationSource interface: attribute timestamp] disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 expected: FAIL @@ -1330,6 +1359,9 @@ [RTCPeerConnectionIceErrorEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCPeerConnectionIceErrorEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCPeerConnectionIceErrorEvent interface: attribute hostCandidate] expected: FAIL @@ -1450,6 +1482,10 @@ disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 expected: FAIL + [RTCRtpContributingSource interface: existence and properties of interface prototype object's @@unscopables property] + disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 + expected: FAIL + [RTCRtpContributingSource interface: attribute timestamp] disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 expected: FAIL @@ -1482,6 +1518,10 @@ disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 expected: FAIL + [RTCRtpSynchronizationSource interface: existence and properties of interface prototype object's @@unscopables property] + disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 + expected: FAIL + [RTCRtpSynchronizationSource interface: attribute timestamp] disabled: https://bugzilla.mozilla.org/show_bug.cgi?id=1419900 expected: FAIL @@ -1534,6 +1574,9 @@ [RTCDtlsTransport interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCDtlsTransport interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCDtlsTransport interface: attribute transport] expected: FAIL @@ -1579,6 +1622,9 @@ [RTCIceTransport interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCIceTransport interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCIceTransport interface: attribute role] expected: FAIL @@ -1681,6 +1727,9 @@ [RTCSctpTransport interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCSctpTransport interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCSctpTransport interface: attribute transport] expected: FAIL @@ -1714,6 +1763,9 @@ [RTCDataChannel interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCDataChannel interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCDataChannel interface: attribute label] expected: FAIL @@ -1840,6 +1892,9 @@ [RTCIdentityAssertion interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCIdentityAssertion interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCIdentityAssertion interface: attribute idp] expected: FAIL @@ -1861,6 +1916,9 @@ [RTCErrorEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [RTCErrorEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [RTCErrorEvent interface: attribute error] expected: FAIL diff --git a/testing/web-platform/meta/webxr/interfaces.https.html.ini b/testing/web-platform/meta/webxr/interfaces.https.html.ini index d03ff298a903..f236a46c52a2 100644 --- a/testing/web-platform/meta/webxr/interfaces.https.html.ini +++ b/testing/web-platform/meta/webxr/interfaces.https.html.ini @@ -20,6 +20,9 @@ [XR interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XR interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XR interface: operation requestDevice()] expected: FAIL @@ -41,6 +44,9 @@ [XRDevice interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRDevice interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRDevice interface: attribute external] expected: FAIL @@ -65,6 +71,9 @@ [XRSession interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRSession interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRSession interface: attribute device] expected: FAIL @@ -122,6 +131,9 @@ [XRPresentationFrame interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRPresentationFrame interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRPresentationFrame interface: attribute views] expected: FAIL @@ -143,6 +155,9 @@ [XRCoordinateSystem interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRCoordinateSystem interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRCoordinateSystem interface: operation getTransformTo(XRCoordinateSystem)] expected: FAIL @@ -161,6 +176,9 @@ [XRFrameOfReference interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRFrameOfReference interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRFrameOfReference interface: attribute bounds] expected: FAIL @@ -185,6 +203,9 @@ [XRStageBounds interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRStageBounds interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRStageBounds interface: attribute geometry] expected: FAIL @@ -203,6 +224,9 @@ [XRStageBoundsPoint interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRStageBoundsPoint interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRStageBoundsPoint interface: attribute x] expected: FAIL @@ -224,6 +248,9 @@ [XRView interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRView interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRView interface: attribute eye] expected: FAIL @@ -248,6 +275,9 @@ [XRViewport interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRViewport interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRViewport interface: attribute x] expected: FAIL @@ -275,6 +305,9 @@ [XRDevicePose interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRDevicePose interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRDevicePose interface: attribute poseModelMatrix] expected: FAIL @@ -296,6 +329,9 @@ [XRLayer interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRLayer interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRWebGLLayer interface: existence and properties of interface object] expected: FAIL @@ -311,6 +347,9 @@ [XRWebGLLayer interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRWebGLLayer interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRWebGLLayer interface: attribute context] expected: FAIL @@ -356,6 +395,9 @@ [XRPresentationContext interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRPresentationContext interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRPresentationContext interface: attribute canvas] expected: FAIL @@ -374,6 +416,9 @@ [XRSessionEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRSessionEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRSessionEvent interface: attribute session] expected: FAIL @@ -392,6 +437,9 @@ [XRCoordinateSystemEvent interface: existence and properties of interface prototype object's "constructor" property] expected: FAIL + [XRCoordinateSystemEvent interface: existence and properties of interface prototype object's @@unscopables property] + expected: FAIL + [XRCoordinateSystemEvent interface: attribute coordinateSystem] expected: FAIL diff --git a/testing/web-platform/tests/interfaces/dom.idl b/testing/web-platform/tests/interfaces/dom.idl index 25324787d719..90419f083f89 100644 --- a/testing/web-platform/tests/interfaces/dom.idl +++ b/testing/web-platform/tests/interfaces/dom.idl @@ -340,7 +340,7 @@ interface Element : Node { attribute DOMString id; attribute DOMString className; [SameObject, PutForwards=value] readonly attribute DOMTokenList classList; - attribute DOMString slot; + [Unscopable] attribute DOMString slot; boolean hasAttributes(); [SameObject] readonly attribute NamedNodeMap attributes; diff --git a/testing/web-platform/tests/resources/idlharness.js b/testing/web-platform/tests/resources/idlharness.js index 47dd9fb3dea9..af17cee66a61 100644 --- a/testing/web-platform/tests/resources/idlharness.js +++ b/testing/web-platform/tests/resources/idlharness.js @@ -1007,6 +1007,13 @@ IdlInterface.prototype.has_constants = function() }; //@} +IdlInterface.prototype.get_unscopables = function() +{ + return this.members.filter(function(member) { + return member.isUnscopable; + }); +}; + IdlInterface.prototype.is_global = function() //@{ { @@ -1552,6 +1559,69 @@ IdlInterface.prototype.test_self = function() assert_equals(self[this.name].prototype.constructor, self[this.name], this.name + '.prototype.constructor is not the same object as ' + this.name); }.bind(this), this.name + ' interface: existence and properties of interface prototype object\'s "constructor" property'); + + + test(function() + { + if (this.is_callback() && !this.has_constants()) { + return; + } + + assert_own_property(self, this.name, + "self does not have own property " + format_value(this.name)); + + if (this.is_callback()) { + assert_false("prototype" in self[this.name], + this.name + ' should not have a "prototype" property'); + return; + } + + assert_own_property(self[this.name], "prototype", + 'interface "' + this.name + '" does not have own property "prototype"'); + + // If the interface has any member declared with the [Unscopable] extended + // attribute, then there must be a property on the interface prototype object + // whose name is the @@unscopables symbol, which has the attributes + // { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }, + // and whose value is an object created as follows... + var unscopables = this.get_unscopables().map(m => m.name); + var proto = self[this.name].prototype; + if (unscopables.length != 0) { + assert_own_property( + proto, Symbol.unscopables, + this.name + '.prototype should have an @@unscopables property'); + var desc = Object.getOwnPropertyDescriptor(proto, Symbol.unscopables); + assert_false("get" in desc, + this.name + ".prototype[Symbol.unscopables] should not have a getter"); + assert_false("set" in desc, this.name + ".prototype[Symbol.unscopables] should not have a setter"); + assert_false(desc.writable, this.name + ".prototype[Symbol.unscopables] should not be writable"); + assert_false(desc.enumerable, this.name + ".prototype[Symbol.unscopables] should not be enumerable"); + assert_true(desc.configurable, this.name + ".prototype[Symbol.unscopables] should be configurable"); + assert_equals(desc.value, proto[Symbol.unscopables], + this.name + '.prototype[Symbol.unscopables] should be in the descriptor'); + assert_equals(typeof desc.value, "object", + this.name + '.prototype[Symbol.unscopables] should be an object'); + assert_equals(Object.getPrototypeOf(desc.value), null, + this.name + '.prototype[Symbol.unscopables] should have a null prototype'); + assert_equals(Object.getOwnPropertySymbols(desc.value).length, + 0, + this.name + '.prototype[Symbol.unscopables] should have the right number of symbol-named properties'); + + // Check that we do not have _extra_ unscopables. Checking that we + // have all the ones we should will happen in the per-member tests. + var observed = Object.getOwnPropertyNames(desc.value); + for (var prop of observed) { + assert_not_equals(unscopables.indexOf(prop), + -1, + this.name + '.prototype[Symbol.unscopables] has unexpected property "' + prop + '"'); + } + } else { + assert_equals(Object.getOwnPropertyDescriptor(self[this.name].prototype, Symbol.unscopables), + undefined, + this.name + '.prototype should not have @@unscopables'); + } + }.bind(this), this.name + ' interface: existence and properties of interface prototype object\'s @@unscopables property'); + }; //@} @@ -1805,6 +1875,10 @@ IdlInterface.prototype.test_member_attribute = function(member) } }.bind(this)); + + test(function () { + this.do_member_unscopable_asserts(member); + }.bind(this), 'Unscopable handled correctly for ' + member.name + ' property on ' + this.name); }; //@} @@ -1869,6 +1943,41 @@ IdlInterface.prototype.test_member_operation = function(member) } this.do_member_operation_asserts(memberHolderObject, member, a_test); }.bind(this)); + + test(function () { + this.do_member_unscopable_asserts(member); + }.bind(this), + 'Unscopable handled correctly for ' + member.name + "(" + + member.arguments.map( + function(m) {return m.idlType.idlType; } ).join(", ") + + ")" + ' on ' + this.name); +}; + +IdlInterface.prototype.do_member_unscopable_asserts = function(member) +{ + // Check that if the member is unscopable then it's in the + // @@unscopables object properly. + if (!member.isUnscopable) { + return; + } + + var unscopables = self[this.name].prototype[Symbol.unscopables]; + var prop = member.name; + var propDesc = Object.getOwnPropertyDescriptor(unscopables, prop); + assert_equals(typeof propDesc, "object", + this.name + '.prototype[Symbol.unscopables].' + prop + ' must exist') + assert_false("get" in propDesc, + this.name + '.prototype[Symbol.unscopables].' + prop + ' must have no getter'); + assert_false("set" in propDesc, + this.name + '.prototype[Symbol.unscopables].' + prop + ' must have no setter'); + assert_true(propDesc.writable, + this.name + '.prototype[Symbol.unscopables].' + prop + ' must be writable'); + assert_true(propDesc.enumerable, + this.name + '.prototype[Symbol.unscopables].' + prop + ' must be enumerable'); + assert_true(propDesc.configurable, + this.name + '.prototype[Symbol.unscopables].' + prop + ' must be configurable'); + assert_equals(propDesc.value, true, + this.name + '.prototype[Symbol.unscopables].' + prop + ' must have the value `true`'); }; //@} @@ -2552,6 +2661,7 @@ function IdlInterfaceMember(obj) } this.isUnforgeable = this.has_extended_attribute("Unforgeable"); + this.isUnscopable = this.has_extended_attribute("Unscopable"); } //@} diff --git a/testing/web-platform/tests/service-workers/service-worker/resources/test-helpers.sub.js b/testing/web-platform/tests/service-workers/service-worker/resources/test-helpers.sub.js index 0dc1d762c911..b99ed200f1a1 100644 --- a/testing/web-platform/tests/service-workers/service-worker/resources/test-helpers.sub.js +++ b/testing/web-platform/tests/service-workers/service-worker/resources/test-helpers.sub.js @@ -263,7 +263,7 @@ function with_sandboxed_iframe(url, sandbox) { // This can be used to wait for a period of time needed to register, // activate, and then unregister a service worker. When checking that // certain behavior does *NOT* happen, this is preferable to using an -// arbitrary setTimeout() delay. +// arbitrary delay. async function wait_for_activation_on_dummy_scope(t) { const script = 'resources/empty-worker.js'; const scope = 'resources/there/is/no/there/there?' + Date.now(); diff --git a/toolkit/components/places/Shutdown.cpp b/toolkit/components/places/Shutdown.cpp index d62e871e8f82..03bd655d6419 100644 --- a/toolkit/components/places/Shutdown.cpp +++ b/toolkit/components/places/Shutdown.cpp @@ -154,11 +154,6 @@ ClientsShutdownBlocker::Done() return NS_OK; } -NS_IMPL_ISUPPORTS_INHERITED0( - ClientsShutdownBlocker, - PlacesShutdownBlocker -) - //////////////////////////////////////////////////////////////////////////////// ConnectionShutdownBlocker::ConnectionShutdownBlocker(Database* aDatabase) diff --git a/toolkit/components/places/Shutdown.h b/toolkit/components/places/Shutdown.h index f1d701417dd5..11c1d9181793 100644 --- a/toolkit/components/places/Shutdown.h +++ b/toolkit/components/places/Shutdown.h @@ -128,7 +128,8 @@ protected: class ClientsShutdownBlocker final : public PlacesShutdownBlocker { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(ClientsShutdownBlocker, + PlacesShutdownBlocker) explicit ClientsShutdownBlocker(); diff --git a/toolkit/components/printingui/nsPrintProgress.cpp b/toolkit/components/printingui/nsPrintProgress.cpp index d3c7478efed7..f0c0acd858bd 100644 --- a/toolkit/components/printingui/nsPrintProgress.cpp +++ b/toolkit/components/printingui/nsPrintProgress.cpp @@ -25,7 +25,7 @@ NS_INTERFACE_MAP_BEGIN(nsPrintProgress) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPrintProgress) NS_INTERFACE_MAP_ENTRY(nsIPrintProgress) NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END nsPrintProgress::nsPrintProgress(nsIPrintSettings* aPrintSettings) diff --git a/toolkit/system/gnome/nsSystemAlertsService.cpp b/toolkit/system/gnome/nsSystemAlertsService.cpp index 801431bebe6e..146d18e2e28b 100644 --- a/toolkit/system/gnome/nsSystemAlertsService.cpp +++ b/toolkit/system/gnome/nsSystemAlertsService.cpp @@ -15,7 +15,7 @@ NS_IMPL_RELEASE(nsSystemAlertsService) NS_INTERFACE_MAP_BEGIN(nsSystemAlertsService) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIAlertsService) NS_INTERFACE_MAP_ENTRY(nsIAlertsService) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END nsSystemAlertsService::nsSystemAlertsService() = default; diff --git a/tools/lint/test-disable.yml b/tools/lint/test-disable.yml index 8facc8b2848b..b9a133705ccb 100644 --- a/tools/lint/test-disable.yml +++ b/tools/lint/test-disable.yml @@ -1,6 +1,8 @@ --- no-comment-disable: - description: "Use 'disable=' to disable a test instead of a comment" + description: > + "Use 'disabled=' to disable a test instead of a + comment" include: - "**/*.ini" exclude: diff --git a/uriloader/base/nsURILoader.cpp b/uriloader/base/nsURILoader.cpp index d3aa702a4e23..90d56dee15c0 100644 --- a/uriloader/base/nsURILoader.cpp +++ b/uriloader/base/nsURILoader.cpp @@ -167,7 +167,7 @@ NS_INTERFACE_MAP_BEGIN(nsDocumentOpenInfo) NS_INTERFACE_MAP_ENTRY(nsIRequestObserver) NS_INTERFACE_MAP_ENTRY(nsIStreamListener) NS_INTERFACE_MAP_ENTRY(nsIThreadRetargetableStreamListener) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END nsDocumentOpenInfo::nsDocumentOpenInfo() { diff --git a/uriloader/exthandler/mac/nsDecodeAppleFile.cpp b/uriloader/exthandler/mac/nsDecodeAppleFile.cpp index 4d6edb84cc55..fa248973d866 100644 --- a/uriloader/exthandler/mac/nsDecodeAppleFile.cpp +++ b/uriloader/exthandler/mac/nsDecodeAppleFile.cpp @@ -13,7 +13,7 @@ NS_IMPL_RELEASE(nsDecodeAppleFile) NS_INTERFACE_MAP_BEGIN(nsDecodeAppleFile) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIOutputStream) NS_INTERFACE_MAP_ENTRY(nsIOutputStream) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END nsDecodeAppleFile::nsDecodeAppleFile() { diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp index 9b362418710b..8a1ada5f93b8 100644 --- a/uriloader/exthandler/nsExternalHelperAppService.cpp +++ b/uriloader/exthandler/nsExternalHelperAppService.cpp @@ -1196,7 +1196,7 @@ NS_INTERFACE_MAP_BEGIN(nsExternalAppHandler) NS_INTERFACE_MAP_ENTRY(nsICancelable) NS_INTERFACE_MAP_ENTRY(nsIBackgroundFileSaverObserver) NS_INTERFACE_MAP_ENTRY(nsINamed) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END nsExternalAppHandler::nsExternalAppHandler(nsIMIMEInfo * aMIMEInfo, const nsACString& aTempFileExtension, diff --git a/uriloader/exthandler/nsExternalProtocolHandler.cpp b/uriloader/exthandler/nsExternalProtocolHandler.cpp index 5c77b33c6767..f9a825fcaf3d 100644 --- a/uriloader/exthandler/nsExternalProtocolHandler.cpp +++ b/uriloader/exthandler/nsExternalProtocolHandler.cpp @@ -86,7 +86,7 @@ NS_INTERFACE_MAP_BEGIN(nsExtProtocolChannel) NS_INTERFACE_MAP_ENTRY(nsIParentChannel) NS_INTERFACE_MAP_ENTRY(nsIStreamListener) NS_INTERFACE_MAP_ENTRY(nsIRequestObserver) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END nsExtProtocolChannel::nsExtProtocolChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo) @@ -491,7 +491,7 @@ NS_INTERFACE_MAP_BEGIN(nsExternalProtocolHandler) NS_INTERFACE_MAP_ENTRY(nsIProtocolHandler) NS_INTERFACE_MAP_ENTRY(nsIExternalProtocolHandler) NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END NS_IMETHODIMP nsExternalProtocolHandler::GetScheme(nsACString &aScheme) { diff --git a/uriloader/exthandler/nsMIMEInfoImpl.cpp b/uriloader/exthandler/nsMIMEInfoImpl.cpp index 8c26175d68bc..c8209f24f899 100644 --- a/uriloader/exthandler/nsMIMEInfoImpl.cpp +++ b/uriloader/exthandler/nsMIMEInfoImpl.cpp @@ -23,7 +23,7 @@ NS_INTERFACE_MAP_BEGIN(nsMIMEInfoBase) // This is only an nsIMIMEInfo if it's a MIME handler. NS_INTERFACE_MAP_ENTRY_CONDITIONAL(nsIMIMEInfo, mClass == eMIMEInfo) NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIHandlerInfo) -NS_INTERFACE_MAP_END_THREADSAFE +NS_INTERFACE_MAP_END // nsMIMEInfoImpl methods diff --git a/widget/android/AndroidUiThread.cpp b/widget/android/AndroidUiThread.cpp index 1e1c1035507c..a1d7affea1ff 100644 --- a/widget/android/AndroidUiThread.cpp +++ b/widget/android/AndroidUiThread.cpp @@ -52,7 +52,7 @@ void EnqueueTask(already_AddRefed aTask, int aDelayMs); class AndroidUiThread : public nsThread { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(AndroidUiThread, nsThread) AndroidUiThread() : nsThread(MakeNotNull*>( MakeUnique()), @@ -68,8 +68,6 @@ private: {} }; -NS_IMPL_ISUPPORTS_INHERITED0(AndroidUiThread, nsThread) - NS_IMETHODIMP AndroidUiThread::Dispatch(already_AddRefed aEvent, uint32_t aFlags) { diff --git a/widget/android/nsIdleServiceAndroid.cpp b/widget/android/nsIdleServiceAndroid.cpp index 1992d8043793..496eb492daff 100644 --- a/widget/android/nsIdleServiceAndroid.cpp +++ b/widget/android/nsIdleServiceAndroid.cpp @@ -8,8 +8,6 @@ #include "nsIdleServiceAndroid.h" #include "nsIServiceManager.h" -NS_IMPL_ISUPPORTS_INHERITED0(nsIdleServiceAndroid, nsIdleService) - bool nsIdleServiceAndroid::PollIdleTime(uint32_t *aIdleTime) { diff --git a/widget/android/nsIdleServiceAndroid.h b/widget/android/nsIdleServiceAndroid.h index 28bca055324b..5e8b2f9e0805 100644 --- a/widget/android/nsIdleServiceAndroid.h +++ b/widget/android/nsIdleServiceAndroid.h @@ -13,7 +13,7 @@ class nsIdleServiceAndroid : public nsIdleService { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsIdleServiceAndroid, nsIdleService) bool PollIdleTime(uint32_t* aIdleTime) override; diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp index cc8d7999ac48..b611c427f146 100644 --- a/widget/android/nsWindow.cpp +++ b/widget/android/nsWindow.cpp @@ -92,8 +92,6 @@ using namespace mozilla::java; using namespace mozilla::widget; using namespace mozilla::ipc; -NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, nsBaseWidget) - #include "mozilla/layers/CompositorBridgeChild.h" #include "mozilla/layers/CompositorSession.h" #include "mozilla/layers/LayerTransactionParent.h" diff --git a/widget/android/nsWindow.h b/widget/android/nsWindow.h index 43b9e17ff553..f108de925eb4 100644 --- a/widget/android/nsWindow.h +++ b/widget/android/nsWindow.h @@ -50,7 +50,7 @@ public: nsWindow(); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsWindow, nsBaseWidget) static void InitNatives(); void SetScreenId(uint32_t aScreenId) { mScreenId = aScreenId; } diff --git a/widget/cocoa/nsIdleServiceX.h b/widget/cocoa/nsIdleServiceX.h index f0b3d92ed52a..36d2c9410d50 100644 --- a/widget/cocoa/nsIdleServiceX.h +++ b/widget/cocoa/nsIdleServiceX.h @@ -10,7 +10,7 @@ class nsIdleServiceX : public nsIdleService { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsIdleServiceX, nsIdleService) bool PollIdleTime(uint32_t* aIdleTime) override; diff --git a/widget/cocoa/nsIdleServiceX.mm b/widget/cocoa/nsIdleServiceX.mm index 234a1541466d..072ac7f6a51d 100644 --- a/widget/cocoa/nsIdleServiceX.mm +++ b/widget/cocoa/nsIdleServiceX.mm @@ -7,8 +7,6 @@ #include "nsIServiceManager.h" #import -NS_IMPL_ISUPPORTS_INHERITED0(nsIdleServiceX, nsIdleService) - bool nsIdleServiceX::PollIdleTime(uint32_t *aIdleTime) { diff --git a/widget/gtk/nsIdleServiceGTK.cpp b/widget/gtk/nsIdleServiceGTK.cpp index 7bae70ddace3..1eee489f8337 100644 --- a/widget/gtk/nsIdleServiceGTK.cpp +++ b/widget/gtk/nsIdleServiceGTK.cpp @@ -30,8 +30,6 @@ static _XScreenSaverQueryExtension_fn _XSSQueryExtension = nullptr; static _XScreenSaverAllocInfo_fn _XSSAllocInfo = nullptr; static _XScreenSaverQueryInfo_fn _XSSQueryInfo = nullptr; -NS_IMPL_ISUPPORTS_INHERITED0(nsIdleServiceGTK, nsIdleService) - static void Initialize() { if (!GDK_IS_X11_DISPLAY(gdk_display_get_default())) diff --git a/widget/gtk/nsIdleServiceGTK.h b/widget/gtk/nsIdleServiceGTK.h index 01ae9268e54e..b271334b9e13 100644 --- a/widget/gtk/nsIdleServiceGTK.h +++ b/widget/gtk/nsIdleServiceGTK.h @@ -25,7 +25,7 @@ typedef struct { class nsIdleServiceGTK : public nsIdleService { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsIdleServiceGTK, nsIdleService) virtual bool PollIdleTime(uint32_t* aIdleTime) override; diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp index b59ac05dd3c4..3fc00d66140a 100644 --- a/widget/gtk/nsWindow.cpp +++ b/widget/gtk/nsWindow.cpp @@ -409,8 +409,6 @@ UpdateLastInputEventTime(void *aGdkEvent) sLastUserInputTime = timestamp; } -NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, nsBaseWidget) - nsWindow::nsWindow() { mIsTopLevel = false; diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h index 64a66369d868..fd68a3ad3fee 100644 --- a/widget/gtk/nsWindow.h +++ b/widget/gtk/nsWindow.h @@ -84,7 +84,7 @@ public: static void ReleaseGlobals(); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsWindow, nsBaseWidget) void CommonCreate(nsIWidget *aParent, bool aListenForResizes); diff --git a/widget/headless/HeadlessWidget.cpp b/widget/headless/HeadlessWidget.cpp index ea8b0d125821..d695ffb776ee 100644 --- a/widget/headless/HeadlessWidget.cpp +++ b/widget/headless/HeadlessWidget.cpp @@ -54,8 +54,6 @@ CreateDefaultTarget(IntSize aSize) return ctx.forget(); } -NS_IMPL_ISUPPORTS_INHERITED0(HeadlessWidget, nsBaseWidget) - StaticAutoPtr> HeadlessWidget::sActiveWindows; already_AddRefed diff --git a/widget/headless/HeadlessWidget.h b/widget/headless/HeadlessWidget.h index 795eef338fbc..eb95a116d1db 100644 --- a/widget/headless/HeadlessWidget.h +++ b/widget/headless/HeadlessWidget.h @@ -53,7 +53,7 @@ class HeadlessWidget : public nsBaseWidget public: HeadlessWidget(); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(HeadlessWidget, nsBaseWidget) void* GetNativeData(uint32_t aDataType) override { diff --git a/widget/nsDragServiceProxy.cpp b/widget/nsDragServiceProxy.cpp index ae601bdd603a..9f14ce2d690b 100644 --- a/widget/nsDragServiceProxy.cpp +++ b/widget/nsDragServiceProxy.cpp @@ -19,8 +19,6 @@ using mozilla::dom::OptionalShmem; using mozilla::LayoutDeviceIntRect; using mozilla::Maybe; -NS_IMPL_ISUPPORTS_INHERITED0(nsDragServiceProxy, nsBaseDragService) - nsDragServiceProxy::nsDragServiceProxy() { } diff --git a/widget/nsDragServiceProxy.h b/widget/nsDragServiceProxy.h index fcde3d25de75..7b4e026161ae 100644 --- a/widget/nsDragServiceProxy.h +++ b/widget/nsDragServiceProxy.h @@ -13,7 +13,7 @@ class nsDragServiceProxy : public nsBaseDragService public: nsDragServiceProxy(); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsDragServiceProxy, nsBaseDragService) // nsBaseDragService virtual nsresult InvokeDragSessionImpl(nsIArray* anArrayTransferables, diff --git a/widget/uikit/nsWindow.h b/widget/uikit/nsWindow.h index 48a20ddf699c..8a8e3984ab03 100644 --- a/widget/uikit/nsWindow.h +++ b/widget/uikit/nsWindow.h @@ -23,7 +23,7 @@ class nsWindow final : public: nsWindow(); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsWindow, Inherited) // // nsIWidget diff --git a/widget/uikit/nsWindow.mm b/widget/uikit/nsWindow.mm index 661516fa3fa1..0f96395cc04a 100644 --- a/widget/uikit/nsWindow.mm +++ b/widget/uikit/nsWindow.mm @@ -420,8 +420,6 @@ private: } @end -NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, Inherited) - nsWindow::nsWindow() : mNativeView(nullptr), mVisible(false), diff --git a/widget/windows/nsIdleServiceWin.cpp b/widget/windows/nsIdleServiceWin.cpp index 4bafe7253c88..1efe381cce79 100644 --- a/widget/windows/nsIdleServiceWin.cpp +++ b/widget/windows/nsIdleServiceWin.cpp @@ -8,8 +8,6 @@ #include "nsIdleServiceWin.h" #include -NS_IMPL_ISUPPORTS_INHERITED0(nsIdleServiceWin, nsIdleService) - bool nsIdleServiceWin::PollIdleTime(uint32_t *aIdleTime) { diff --git a/widget/windows/nsIdleServiceWin.h b/widget/windows/nsIdleServiceWin.h index c3fb1243fdc8..12299634903c 100644 --- a/widget/windows/nsIdleServiceWin.h +++ b/widget/windows/nsIdleServiceWin.h @@ -22,7 +22,7 @@ class nsIdleServiceWin : public nsIdleService { public: - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsIdleServiceWin, nsIdleService) bool PollIdleTime(uint32_t* aIdleTime) override; diff --git a/widget/windows/nsWindow.cpp b/widget/windows/nsWindow.cpp index 2e83aeac30dd..ba4c434ae433 100644 --- a/widget/windows/nsWindow.cpp +++ b/widget/windows/nsWindow.cpp @@ -716,8 +716,6 @@ nsWindow::~nsWindow() NS_IF_RELEASE(mNativeDragTarget); } -NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, nsBaseWidget) - /************************************************************** * * SECTION: nsIWidget::Create, nsIWidget::Destroy diff --git a/widget/windows/nsWindow.h b/widget/windows/nsWindow.h index 631609de09ba..253619f20a01 100644 --- a/widget/windows/nsWindow.h +++ b/widget/windows/nsWindow.h @@ -84,7 +84,7 @@ class nsWindow final : public nsWindowBase public: explicit nsWindow(bool aIsChildWindow = false); - NS_DECL_ISUPPORTS_INHERITED + NS_INLINE_DECL_REFCOUNTING_INHERITED(nsWindow, nsWindowBase) friend class nsWindowGfx; diff --git a/xpcom/base/nsISupportsImpl.h b/xpcom/base/nsISupportsImpl.h index 4fced88de02a..f95ac10208c0 100644 --- a/xpcom/base/nsISupportsImpl.h +++ b/xpcom/base/nsISupportsImpl.h @@ -1128,25 +1128,31 @@ namespace mozilla { class Runnable; } // namespace mozilla -#define NS_IMPL_ADDREF_INHERITED(Class, Super) \ -NS_IMETHODIMP_(MozExternalRefCountType) Class::AddRef(void) \ -{ \ +#define NS_IMPL_ADDREF_INHERITED_GUTS(Class, Super) \ MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(Class) \ nsrefcnt r = Super::AddRef(); \ if (!mozilla::IsConvertible::value) { \ NS_LOG_ADDREF(this, r, #Class, sizeof(*this)); \ } \ - return r; \ + return r /* Purposefully no trailing semicolon */ + +#define NS_IMPL_ADDREF_INHERITED(Class, Super) \ +NS_IMETHODIMP_(MozExternalRefCountType) Class::AddRef(void) \ +{ \ + NS_IMPL_ADDREF_INHERITED_GUTS(Class, Super); \ } -#define NS_IMPL_RELEASE_INHERITED(Class, Super) \ -NS_IMETHODIMP_(MozExternalRefCountType) Class::Release(void) \ -{ \ +#define NS_IMPL_RELEASE_INHERITED_GUTS(Class, Super) \ nsrefcnt r = Super::Release(); \ if (!mozilla::IsConvertible::value) { \ NS_LOG_RELEASE(this, r, #Class); \ } \ - return r; \ + return r /* Purposefully no trailing semicolon */ + +#define NS_IMPL_RELEASE_INHERITED(Class, Super) \ +NS_IMETHODIMP_(MozExternalRefCountType) Class::Release(void) \ +{ \ + NS_IMPL_RELEASE_INHERITED_GUTS(Class, Super); \ } /** @@ -1198,6 +1204,8 @@ NS_IMETHODIMP_(MozExternalRefCountType) Class::Release(void) \ NS_IMPL_RELEASE(aClass) \ NS_IMPL_QUERY_INTERFACE(aClass, __VA_ARGS__) +// When possible, prefer NS_INLINE_DECL_REFCOUNTING_INHERITED to +// NS_IMPL_ISUPPORTS_INHERITED0. #define NS_IMPL_ISUPPORTS_INHERITED0(aClass, aSuper) \ NS_INTERFACE_TABLE_HEAD(aClass) \ NS_INTERFACE_TABLE_TAIL_INHERITING(aSuper) \ @@ -1209,6 +1217,25 @@ NS_IMETHODIMP_(MozExternalRefCountType) Class::Release(void) \ NS_IMPL_ADDREF_INHERITED(aClass, aSuper) \ NS_IMPL_RELEASE_INHERITED(aClass, aSuper) +/** + * A macro to declare and implement addref/release for a class that does not + * need to QI to any interfaces other than the ones its parent class QIs to. + * This can be a no-op when we're not building with refcount logging, because in + * that case there's no real reason to have a separate addref/release on this + * class. + */ +#if defined(NS_BUILD_REFCNT_LOGGING) +#define NS_INLINE_DECL_REFCOUNTING_INHERITED(Class, Super) \ + NS_IMETHOD_(MozExternalRefCountType) AddRef() override { \ + NS_IMPL_ADDREF_INHERITED_GUTS(Class, Super); \ + } \ + NS_IMETHOD_(MozExternalRefCountType) Release() override { \ + NS_IMPL_RELEASE_INHERITED_GUTS(Class, Super); \ + } +#else // NS_BUILD_REFCNT_LOGGING +#define NS_INLINE_DECL_REFCOUNTING_INHERITED(Class, Super) +#endif // NS_BUILD_REFCNT_LOGGINGx + /* * Macro to glue together a QI that starts with an interface table * and segues into an interface map (e.g. it uses singleton classinfo @@ -1220,14 +1247,6 @@ NS_IMETHODIMP_(MozExternalRefCountType) Class::Release(void) \ /////////////////////////////////////////////////////////////////////////////// -/** - * - * Threadsafe implementations of the ISupports convenience macros. - * - * @note These are not available when linking against the standalone glue, - * because the implementation requires PR_ symbols. - */ -#define NS_INTERFACE_MAP_END_THREADSAFE NS_IMPL_QUERY_TAIL_GUTS /** * Macro to generate nsIClassInfo methods for classes which do not have