Bug 1304598 Part 1 - Move PresShell to mozilla namespace. draft
authorTing-Yu Lin <tlin@mozilla.com>
Wed, 30 Nov 2016 11:14:27 +0800
changeset 445678 75b82e3b6d73c9e8d70cd09ae5d48d59e9ae2710
parent 445599 adcc39e3cad0f32aba0efb478cc4a023a5dfc43f
child 445679 db392413d74992b655e173a6371ba9021c4db520
push id37582
push usertlin@mozilla.com
push dateWed, 30 Nov 2016 03:26:08 +0000
bugs1304598
milestone53.0a1
Bug 1304598 Part 1 - Move PresShell to mozilla namespace. MozReview-Commit-ID: 3nsP8Ukxfw9
layout/base/TouchManager.h
layout/base/nsPresShell.h
layout/generic/nsImageFrame.h
--- a/layout/base/TouchManager.h
+++ b/layout/base/TouchManager.h
@@ -12,20 +12,20 @@
 #ifndef TouchManager_h_
 #define TouchManager_h_
 
 #include "mozilla/BasicEvents.h"
 #include "mozilla/dom/Touch.h"
 #include "mozilla/TouchEvents.h"
 #include "nsRefPtrHashtable.h"
 
-class PresShell;
 class nsIDocument;
 
 namespace mozilla {
+class PresShell;
 
 class TouchManager {
 public:
   // Initialize and release static variables
   static void InitializeStatics();
   static void ReleaseStatics();
 
   void Init(PresShell* aPresShell, nsIDocument* aDocument);
--- a/layout/base/nsPresShell.h
+++ b/layout/base/nsPresShell.h
@@ -60,40 +60,30 @@ class EventDispatchingCallback;
 // PresShell. The set contains nsIFrame* pointers.
 typedef nsTHashtable<nsPtrHashKey<nsIFrame>> VisibleFrames;
 
 // A hash table type for tracking visible regions, for use by the visibility
 // code in PresShell. The mapping is from view IDs to regions in the
 // coordinate system of that view's scrolled frame.
 typedef nsClassHashtable<nsUint64HashKey, mozilla::CSSIntRegion> VisibleRegions;
 
-} // namespace mozilla
-
 // This is actually pref-controlled, but we use this value if we fail
 // to get the pref for any reason.
 #ifdef MOZ_WIDGET_ANDROID
 #define PAINTLOCK_EVENT_DELAY 250
 #else
 #define PAINTLOCK_EVENT_DELAY 5
 #endif
 
 class PresShell final : public nsIPresShell,
                         public nsStubDocumentObserver,
                         public nsISelectionController,
                         public nsIObserver,
                         public nsSupportsWeakReference
 {
-  template <typename T> using Maybe = mozilla::Maybe<T>;
-  using Nothing = mozilla::Nothing;
-  using OnNonvisible = mozilla::OnNonvisible;
-  using RawSelectionType = mozilla::RawSelectionType;
-  using SelectionType = mozilla::SelectionType;
-  using VisibleFrames = mozilla::VisibleFrames;
-  using VisibleRegions = mozilla::VisibleRegions;
-
 public:
   PresShell();
 
   NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW
 
   // nsISupports
   NS_DECL_ISUPPORTS
 
@@ -442,17 +432,17 @@ protected:
   void ScheduleBeforeFirstPaint();
   void UnsuppressAndInvalidate();
 
   void WillCauseReflow() {
     nsContentUtils::AddScriptBlocker();
     ++mChangeNestCount;
   }
   nsresult DidCauseReflow();
-  friend class nsAutoCauseReflowNotifier;
+  friend class ::nsAutoCauseReflowNotifier;
 
   nsresult DispatchEventToDOM(mozilla::WidgetEvent* aEvent,
                               nsEventStatus* aStatus,
                               nsPresShellEventCB* aEventCB);
   void DispatchTouchEventToDOM(mozilla::WidgetEvent* aEvent,
                                nsEventStatus* aStatus,
                                nsPresShellEventCB* aEventCB,
                                bool aTouchIsNew);
@@ -492,19 +482,16 @@ protected:
    * computation to determine if font inflation is enabled.
    *
    * @see nsLayoutUtils::sFontSizeInflationEmPerLine
    * @see nsLayoutUtils::sFontSizeInflationMinTwips
    * @see nsLayoutUtils::sFontSizeInflationLineThreshold
    */
   void SetupFontInflation();
 
-  friend struct AutoRenderingStateSaveRestore;
-  friend struct RenderingState;
-
   struct RenderingState {
     explicit RenderingState(PresShell* aPresShell)
       : mResolution(aPresShell->mResolution)
       , mRenderFlags(aPresShell->mRenderFlags)
     { }
     Maybe<float> mResolution;
     RenderFlags mRenderFlags;
   };
@@ -528,17 +515,17 @@ protected:
                                 eRenderFlag aFlag)
   {
     return aOnOff ? (aFlags | aFlag) : (aFlag & ~aFlag);
   }
 
 
   void SetRenderingState(const RenderingState& aState);
 
-  friend class nsPresShellEventCB;
+  friend class ::nsPresShellEventCB;
 
   bool mCaretEnabled;
 
 #ifdef DEBUG
   nsStyleSet* CloneStyleSet(nsStyleSet* aSet);
   bool VerifyIncrementalReflow();
   bool mInVerifyReflow;
   void ShowEventTargetDebug();
@@ -961,9 +948,11 @@ protected:
   bool                      mIsLastChromeOnlyEscapeKeyConsumed : 1;
 
   // Whether the widget has received a paint message yet.
   bool                      mHasReceivedPaintMessage : 1;
 
   static bool               sDisableNonTestMouseEvents;
 };
 
+} // namespace mozilla
+
 #endif /* !defined(nsPresShell_h_) */
--- a/layout/generic/nsImageFrame.h
+++ b/layout/generic/nsImageFrame.h
@@ -27,16 +27,17 @@ class nsIURI;
 class nsILoadGroup;
 class nsDisplayImage;
 class nsPresContext;
 class nsImageFrame;
 class nsTransform2D;
 class nsImageLoadingContent;
 
 namespace mozilla {
+class PresShell;
 namespace layers {
   class ImageContainer;
   class ImageLayer;
   class LayerManager;
 } // namespace layers
 } // namespace mozilla
 
 class nsImageListener : public imgINotificationObserver
@@ -234,17 +235,17 @@ protected:
    * for our image at the size we predict it will be drawn next time it's
    * painted.
    */
   void MaybeDecodeForPredictedSize();
 
 protected:
   friend class nsImageListener;
   friend class nsImageLoadingContent;
-  friend class PresShell;
+  friend class mozilla::PresShell;
 
   nsresult OnSizeAvailable(imgIRequest* aRequest, imgIContainer* aImage);
   nsresult OnFrameUpdate(imgIRequest* aRequest, const nsIntRect* aRect);
   nsresult OnLoadComplete(imgIRequest* aRequest, nsresult aStatus);
 
   /**
    * Notification that aRequest will now be the current request.
    */