Bug 1444580: Devirtualize PaymentRequest stuff. r=smaug draft
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 10 Mar 2018 05:28:33 +0100
changeset 765757 ba06f7997c35c6b853aaa89fe6fdc4bc23423613
parent 765756 8736ff572380ad718541727c860b139ca41d6e6f
child 765758 9d50115593890fd2229972046c3b3adb5cf2817e
push id102160
push userbmo:emilio@crisal.io
push dateSat, 10 Mar 2018 06:32:21 +0000
reviewerssmaug
bugs1444580
milestone60.0a1
Bug 1444580: Devirtualize PaymentRequest stuff. r=smaug This one was easy, the bit was already in the right place :) MozReview-Commit-ID: 79KJNsIXIyb
dom/base/nsDocument.cpp
dom/base/nsDocument.h
dom/base/nsIDocument.h
--- 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();