Bug 1548939 - Move all BrowserParent state into one contiguous block. r=nika
authorRyan Hunt <rhunt@eqrion.net>
Mon, 29 Apr 2019 16:33:21 -0500
changeset 534768 411729b65f07f47d08b0d4cffb2b2a4bad8d2ea2
parent 534767 aafed4d2be5072aa18ad41551f7677e3ca69781e
child 534769 cd87583bb3abe9d62b442ab1200f2ccfbe4aabbb
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1548939
milestone68.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 1548939 - Move all BrowserParent state into one contiguous block. r=nika Somehow all of the member variables of BrowserParent have been spread around the class. This makes it really hard to understand what state there is. This commit moves all member variables (preserving order) to the bottom of the class. Differential Revision: https://phabricator.services.mozilla.com/D30153
dom/ipc/BrowserParent.h
--- a/dom/ipc/BrowserParent.h
+++ b/dom/ipc/BrowserParent.h
@@ -672,59 +672,84 @@ class BrowserParent final : public PBrow
 
   mozilla::ipc::IPCResult RecvVisitURI(const URIParams& aURI,
                                        const Maybe<URIParams>& aLastVisitedURI,
                                        const uint32_t& aFlags);
 
   mozilla::ipc::IPCResult RecvQueryVisitedState(
       InfallibleTArray<URIParams>&& aURIs);
 
+ private:
+  void SuppressDisplayport(bool aEnabled);
+
+  void DestroyInternal();
+
+  void SetRenderLayersInternal(bool aEnabled, bool aForceRepaint);
+
+  already_AddRefed<nsFrameLoader> GetFrameLoader(
+      bool aUseCachedFrameLoaderAfterDestroy = false) const;
+
+  void TryCacheDPIAndScale();
+
+  bool AsyncPanZoomEnabled() const;
+
+  // Update state prior to routing an APZ-aware event to the child process.
+  // |aOutTargetGuid| will contain the identifier
+  // of the APZC instance that handled the event. aOutTargetGuid may be null.
+  // |aOutInputBlockId| will contain the identifier of the input block
+  // that this event was added to, if there was one. aOutInputBlockId may be
+  // null. |aOutApzResponse| will contain the response that the APZ gave when
+  // processing the input block; this is used for generating appropriate
+  // pointercancel events.
+  void ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid,
+                                   uint64_t* aOutInputBlockId,
+                                   nsEventStatus* aOutApzResponse);
+
+  // When dropping links we perform a roundtrip from
+  // Parent (SendRealDragEvent) -> Child -> Parent (RecvDropLinks)
+  // and have to ensure that the child did not modify links to be loaded.
+  bool QueryDropLinksForVerification();
+
+ private:
+  // This is used when APZ needs to find the BrowserParent associated with a
+  // layer to dispatch events.
+  typedef nsDataHashtable<nsUint64HashKey, BrowserParent*>
+      LayerToBrowserParentTable;
+  static LayerToBrowserParentTable* sLayerToBrowserParentTable;
+
+  static void AddBrowserParentToTable(layers::LayersId aLayersId,
+                                      BrowserParent* aBrowserParent);
+
+  static void RemoveBrowserParentFromTable(layers::LayersId aLayersId);
+
+  // Keeps track of which BrowserParent has keyboard focus
+  static StaticAutoPtr<nsTArray<BrowserParent*>> sFocusStack;
+
+  static void PushFocus(BrowserParent* aBrowserParent);
+
+  static void PopFocus(BrowserParent* aBrowserParent);
+
   ContentCacheInParent mContentCache;
 
   nsIntRect mRect;
   ScreenIntSize mDimensions;
   hal::ScreenOrientation mOrientation;
   float mDPI;
   int32_t mRounding;
   CSSToLayoutDeviceScale mDefaultScale;
   bool mUpdatedDimensions;
   nsSizeMode mSizeMode;
   LayoutDeviceIntPoint mClientOffset;
   LayoutDeviceIntPoint mChromeOffset;
 
- private:
-  void SuppressDisplayport(bool aEnabled);
-
-  void DestroyInternal();
-
-  void SetRenderLayersInternal(bool aEnabled, bool aForceRepaint);
-
-  already_AddRefed<nsFrameLoader> GetFrameLoader(
-      bool aUseCachedFrameLoaderAfterDestroy = false) const;
-
   RefPtr<ContentParent> mManager;
-  void TryCacheDPIAndScale();
-
-  bool AsyncPanZoomEnabled() const;
 
   // Cached value indicating the docshell active state of the remote browser.
   bool mDocShellIsActive;
 
-  // Update state prior to routing an APZ-aware event to the child process.
-  // |aOutTargetGuid| will contain the identifier
-  // of the APZC instance that handled the event. aOutTargetGuid may be null.
-  // |aOutInputBlockId| will contain the identifier of the input block
-  // that this event was added to, if there was one. aOutInputBlockId may be
-  // null. |aOutApzResponse| will contain the response that the APZ gave when
-  // processing the input block; this is used for generating appropriate
-  // pointercancel events.
-  void ApzAwareEventRoutingToChild(ScrollableLayerGuid* aOutTargetGuid,
-                                   uint64_t* aOutInputBlockId,
-                                   nsEventStatus* aOutApzResponse);
-
   // When true, we've initiated normal shutdown and notified our managing
   // PContent.
   bool mMarkedDestroying;
   // When true, the BrowserParent is invalid and we should not send IPC messages
   // anymore.
   bool mIsDestroyed;
 
   uint32_t mChromeFlags;
@@ -789,45 +814,22 @@ class BrowserParent final : public PBrow
   uint32_t mCustomCursorHotspotX, mCustomCursorHotspotY;
 
   // True if the cursor changes from the BrowserChild should change the widget
   // cursor.  This happens whenever the cursor is in the tab's region.
   bool mTabSetsCursor;
 
   bool mHasContentOpener;
 
-  // When dropping links we perform a roundtrip from
-  // Parent (SendRealDragEvent) -> Child -> Parent (RecvDropLinks)
-  // and have to ensure that the child did not modify links to be loaded.
-  bool QueryDropLinksForVerification();
   nsTArray<nsString> mVerifyDropLinks;
 
 #ifdef DEBUG
   int32_t mActiveSupressDisplayportCount;
 #endif
 
- private:
-  // This is used when APZ needs to find the BrowserParent associated with a
-  // layer to dispatch events.
-  typedef nsDataHashtable<nsUint64HashKey, BrowserParent*>
-      LayerToBrowserParentTable;
-  static LayerToBrowserParentTable* sLayerToBrowserParentTable;
-
-  static void AddBrowserParentToTable(layers::LayersId aLayersId,
-                                      BrowserParent* aBrowserParent);
-
-  static void RemoveBrowserParentFromTable(layers::LayersId aLayersId);
-
-  // Keeps track of which BrowserParent has keyboard focus
-  static StaticAutoPtr<nsTArray<BrowserParent*>> sFocusStack;
-
-  static void PushFocus(BrowserParent* aBrowserParent);
-
-  static void PopFocus(BrowserParent* aBrowserParent);
-
   layout::RenderFrame mRenderFrame;
   LayersObserverEpoch mLayerTreeEpoch;
 
   Maybe<LayoutDeviceToLayoutDeviceMatrix4x4> mChildToParentConversionMatrix;
 
   // If this flag is set, then the tab's layers will be preserved even when
   // the tab's docshell is inactive.
   bool mPreserveLayers;