Bug 1398376 part 1: Remove MOZILLA_INTERNAL_API guards from nsIPresShell.h and nsPresContext.h, since these headers are only used in libxul. r=mats
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 08 Sep 2017 16:24:59 -0700
changeset 429326 207590617db755d7e395a71df2a7fc9297ccbe65
parent 429325 57a5ce8cbf6057413f3f5d20f8bef6ebb8e84eae
child 429327 ccc6362557e91d9cc5e11ef7c36a0cd4dcce5513
push id7761
push userjlund@mozilla.com
push dateFri, 15 Sep 2017 00:19:52 +0000
treeherdermozilla-beta@c38455951db4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmats
bugs1398376
milestone57.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1398376 part 1: Remove MOZILLA_INTERNAL_API guards from nsIPresShell.h and nsPresContext.h, since these headers are only used in libxul. r=mats This patch drops all MOZILLA_INTERNAL_API checks (and the bodies of any associated "#else" clauses) from these files. The basic assumption here is that MOZILLA_INTERNAL_API is #defined in all (supported) compilation units that #include these files, so the checks are superfluous and the #else clauses are dead code. (If this assumption is mistaken and there is some .cpp file in our codebase that #includes this header and yet does not have MOZILLA_INTERNAL_API, we will find out via bustage on treeherder.) MozReview-Commit-ID: 8dHJFBDVHwT
layout/base/nsIPresShell.h
layout/base/nsPresContext.h
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -270,30 +270,27 @@ public:
    * Set the document accessible for this pres shell.
    */
   void SetDocAccessible(mozilla::a11y::DocAccessible* aDocAccessible)
   {
     mDocAccessible = aDocAccessible;
   }
 #endif
 
-#ifdef MOZILLA_INTERNAL_API
   mozilla::StyleSetHandle StyleSet() const { return mStyleSet; }
 
   nsCSSFrameConstructor* FrameConstructor() const { return mFrameConstructor; }
 
   nsFrameManager* FrameManager() const {
     // reinterpret_cast is valid since nsFrameManager does not add
     // any members over nsFrameManagerBase.
     return reinterpret_cast<nsFrameManager*>
                            (const_cast<nsIPresShell*>(this)->mFrameManager);
   }
 
-#endif
-
   /* Enable/disable author style level. Disabling author style disables the entire
    * author level of the cascade, including the HTML preshint level.
    */
   // XXX these could easily be inlined, but there is a circular #include
   // problem with nsStyleSet.
   void SetAuthorStyleDisabled(bool aDisabled);
   bool GetAuthorStyleDisabled() const;
 
@@ -388,21 +385,17 @@ public:
    */
   virtual void LoadComplete() = 0;
 
   /**
    * This calls through to the frame manager to get the root frame.
    */
   virtual nsIFrame* GetRootFrameExternal() const;
   nsIFrame* GetRootFrame() const {
-#ifdef MOZILLA_INTERNAL_API
     return mFrameManager->GetRootFrame();
-#else
-    return GetRootFrameExternal();
-#endif
   }
 
   /*
    * Get root scroll frame from FrameManager()->GetRootFrame().
    */
   nsIFrame* GetRootScrollFrame() const;
 
   /*
@@ -1163,51 +1156,35 @@ public:
 
   void AddAutoWeakFrameInternal(AutoWeakFrame* aWeakFrame);
   virtual void AddAutoWeakFrameExternal(AutoWeakFrame* aWeakFrame);
   void AddWeakFrameInternal(WeakFrame* aWeakFrame);
   virtual void AddWeakFrameExternal(WeakFrame* aWeakFrame);
 
   void AddAutoWeakFrame(AutoWeakFrame* aWeakFrame)
   {
-#ifdef MOZILLA_INTERNAL_API
     AddAutoWeakFrameInternal(aWeakFrame);
-#else
-    AddAutoWeakFrameExternal(aWeakFrame);
-#endif
   }
   void AddWeakFrame(WeakFrame* aWeakFrame)
   {
-#ifdef MOZILLA_INTERNAL_API
     AddWeakFrameInternal(aWeakFrame);
-#else
-    AddWeakFrameExternal(aWeakFrame);
-#endif
   }
 
   void RemoveAutoWeakFrameInternal(AutoWeakFrame* aWeakFrame);
   virtual void RemoveAutoWeakFrameExternal(AutoWeakFrame* aWeakFrame);
   void RemoveWeakFrameInternal(WeakFrame* aWeakFrame);
   virtual void RemoveWeakFrameExternal(WeakFrame* aWeakFrame);
 
   void RemoveAutoWeakFrame(AutoWeakFrame* aWeakFrame)
   {
-#ifdef MOZILLA_INTERNAL_API
     RemoveAutoWeakFrameInternal(aWeakFrame);
-#else
-    RemoveAutoWeakFrameExternal(aWeakFrame);
-#endif
   }
   void RemoveWeakFrame(WeakFrame* aWeakFrame)
   {
-#ifdef MOZILLA_INTERNAL_API
     RemoveWeakFrameInternal(aWeakFrame);
-#else
-    RemoveWeakFrameExternal(aWeakFrame);
-#endif
   }
 
 #ifdef DEBUG
   nsIFrame* GetDrawEventTargetFrame() { return mDrawEventTargetFrame; }
 #endif
 
   /**
    * Stop or restart non synthetic test mouse event handling on *all*
@@ -1720,30 +1697,22 @@ protected:
     MOZ_ASSERT(mAllocatedPointers.Contains(aPtr));
     mAllocatedPointers.RemoveEntry(aPtr);
 #endif
   }
 
 public:
   bool AddRefreshObserver(nsARefreshObserver* aObserver,
                           mozilla::FlushType aFlushType) {
-#ifdef MOZILLA_INTERNAL_API
     return AddRefreshObserverInternal(aObserver, aFlushType);
-#else
-    return AddRefreshObserverExternal(aObserver, aFlushType);
-#endif
   }
 
   bool RemoveRefreshObserver(nsARefreshObserver* aObserver,
                              mozilla::FlushType aFlushType) {
-#ifdef MOZILLA_INTERNAL_API
     return RemoveRefreshObserverInternal(aObserver, aFlushType);
-#else
-    return RemoveRefreshObserverExternal(aObserver, aFlushType);
-#endif
   }
 
   virtual bool AddPostRefreshObserver(nsAPostRefreshObserver* aObserver);
   virtual bool RemovePostRefreshObserver(nsAPostRefreshObserver* aObserver);
 
   /**
    * Initialize and shut down static variables.
    */
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -215,17 +215,16 @@ public:
   nsIDocument* Document() const
   {
       NS_ASSERTION(!mShell || !mShell->GetDocument() ||
                    mShell->GetDocument() == mDocument,
                    "nsPresContext doesn't have the same document as nsPresShell!");
       return mDocument;
   }
 
-#ifdef MOZILLA_INTERNAL_API
   mozilla::StyleSetHandle StyleSet() const { return GetPresShell()->StyleSet(); }
 
   nsFrameManager* FrameManager()
     { return PresShell()->FrameManager(); }
 
   nsCSSFrameConstructor* FrameConstructor()
     { return PresShell()->FrameConstructor(); }
 
@@ -238,17 +237,16 @@ public:
   mozilla::RestyleManager* RestyleManager() {
     MOZ_ASSERT(mRestyleManager);
     return mRestyleManager;
   }
 
   mozilla::CounterStyleManager* CounterStyleManager() const {
     return mCounterStyleManager;
   }
-#endif
 
   /**
    * Rebuilds all style data by throwing out the old rule tree and
    * building a new one, and additionally applying aExtraHint (which
    * must not contain nsChangeHint_ReconstructFrame) to the root frame.
    * For aRestyleHint, see RestyleManager::RebuildAllStyleData.
    * Also rebuild the user font set and counter style manager.
    */
@@ -316,23 +314,18 @@ public:
   void CompatibilityModeChanged();
 
   /**
    * Access the image animation mode for this context
    */
   uint16_t     ImageAnimationMode() const { return mImageAnimationMode; }
   virtual void SetImageAnimationModeExternal(uint16_t aMode);
   void SetImageAnimationModeInternal(uint16_t aMode);
-#ifdef MOZILLA_INTERNAL_API
   void SetImageAnimationMode(uint16_t aMode)
   { SetImageAnimationModeInternal(aMode); }
-#else
-  void SetImageAnimationMode(uint16_t aMode)
-  { SetImageAnimationModeExternal(aMode); }
-#endif
 
   /**
    * Get medium of presentation
    */
   nsIAtom* Medium() {
     if (!mIsEmulatingMedia)
       return mMedium;
     return mMediaEmulated;
@@ -426,23 +419,18 @@ public:
   uint8_t FocusRingWidth() const { return mFocusRingWidth; }
   bool GetFocusRingOnAnything() const { return mFocusRingOnAnything; }
   uint8_t GetFocusRingStyle() const { return mFocusRingStyle; }
 
   void SetContainer(nsIDocShell* aContainer);
 
   virtual nsISupports* GetContainerWeakExternal() const;
   nsISupports* GetContainerWeakInternal() const;
-#ifdef MOZILLA_INTERNAL_API
   nsISupports* GetContainerWeak() const
   { return GetContainerWeakInternal(); }
-#else
-  nsISupports* GetContainerWeak() const
-  { return GetContainerWeakExternal(); }
-#endif
 
   nsIDocShell* GetDocShell() const;
 
   // XXX this are going to be replaced with set/get container
   void SetLinkHandler(nsILinkHandler* aHandler) { mLinkHandler = aHandler; }
   nsILinkHandler* GetLinkHandler() { return mLinkHandler; }
 
   /**
@@ -775,21 +763,17 @@ public:
 
   /**
    *  Check if bidi enabled (set depending on the presence of RTL
    *  characters or when default directionality is RTL).
    *  If enabled, we should apply the Unicode Bidi Algorithm
    *
    *  @lina 07/12/2000
    */
-#ifdef MOZILLA_INTERNAL_API
   bool BidiEnabled() const { return BidiEnabledInternal(); }
-#else
-  bool BidiEnabled() const { return BidiEnabledExternal(); }
-#endif
   virtual bool BidiEnabledExternal() const;
   bool BidiEnabledInternal() const;
 
   /**
    *  Set bidi enabled. This means we should apply the Unicode Bidi Algorithm
    *
    *  @lina 07/12/2000
    */