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

--HG--
extra : rebase_source : 377f5b55e5393a9ac6f88389f0589eb6fd66848c
extra : source : 033e99403d147fd11eaf7b2037f36e156d2598ff
extra : histedit_source : c20e5d02ca67c3f3eff3c1d77abb0f871a9025d2
This commit is contained in:
Ryan Hunt 2019-04-29 16:33:21 -05:00
parent 6fb9422bfd
commit 7de79f9080

View File

@ -677,6 +677,56 @@ class BrowserParent final : public PBrowserParent,
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;
@ -690,36 +740,11 @@ class BrowserParent final : public PBrowserParent,
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;
@ -794,35 +819,12 @@ class BrowserParent final : public PBrowserParent,
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;