Bug 1444580: Devirtualize PaymentRequest stuff. r=smaug
This one was easy, the bit was already in the right place :)
MozReview-Commit-ID: 79KJNsIXIyb
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -4072,28 +4072,16 @@ SubDocInitEntry(PLDHashEntryHdr *entry,
(static_cast<const SubDocMapEntry *>(entry));
e->mKey = const_cast<Element*>(static_cast<const Element*>(key));
NS_ADDREF(e->mKey);
e->mSubDocument = nullptr;
}
-bool
-nsDocument::AllowPaymentRequest() const
-{
- return mAllowPaymentRequest;
-}
-
-void
-nsDocument::SetAllowPaymentRequest(bool aAllowPaymentRequest)
-{
- mAllowPaymentRequest = aAllowPaymentRequest;
-}
-
nsresult
nsIDocument::SetSubDocumentFor(Element* aElement, nsIDocument* aSubDoc)
{
NS_ENSURE_TRUE(aElement, NS_ERROR_UNEXPECTED);
if (!aSubDoc) {
// aSubDoc is nullptr, remove the mapping
--- a/dom/base/nsDocument.h
+++ b/dom/base/nsDocument.h
@@ -747,19 +747,16 @@ public:
void FullScreenStackPop();
// Returns the top element from the full-screen stack.
Element* FullScreenStackTop() override;
// DOM-exposed fullscreen API
bool FullscreenEnabled(mozilla::dom::CallerType aCallerType) override;
- virtual bool AllowPaymentRequest() const override;
- virtual void SetAllowPaymentRequest(bool aIsAllowPaymentRequest) override;
-
void RequestPointerLock(Element* aElement,
mozilla::dom::CallerType aCallerType) override;
bool SetPointerLock(Element* aElement, int aCursorStyle);
static void UnlockPointer(nsIDocument* aDoc = nullptr);
void SetCurrentOrientation(mozilla::dom::OrientationType aType,
uint16_t aAngle) override;
uint16_t CurrentOrientationAngle() const override;
--- a/dom/base/nsIDocument.h
+++ b/dom/base/nsIDocument.h
@@ -3269,18 +3269,25 @@ public:
}
void DecrementIgnoreOpensDuringUnloadCounter()
{
MOZ_ASSERT(mIgnoreOpensDuringUnloadCounter);
--mIgnoreOpensDuringUnloadCounter;
}
- virtual bool AllowPaymentRequest() const = 0;
- virtual void SetAllowPaymentRequest(bool aAllowPaymentRequest) = 0;
+ bool AllowPaymentRequest() const
+ {
+ return mAllowPaymentRequest;
+ }
+
+ void SetAllowPaymentRequest(bool aAllowPaymentRequest)
+ {
+ mAllowPaymentRequest = aAllowPaymentRequest;
+ }
bool IsShadowDOMEnabled() const
{
return mIsShadowDOMEnabled;
}
bool ModuleScriptsEnabled();