Bug 1722910 - Remove unused FrameLoader.requestNotifyAfterRemotePaint machinery. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D121195
This commit is contained in:
Emilio Cobos Álvarez 2021-07-30 09:37:20 +00:00
Родитель 7aa6219ad0
Коммит 82baca9319
14 изменённых файлов: 0 добавлений и 189 удалений

Просмотреть файл

@ -3189,16 +3189,6 @@ void nsFrameLoader::AttributeChanged(mozilla::dom::Element* aElement,
}
}
/**
* Send the RequestNotifyAfterRemotePaint message to the current Tab.
*/
void nsFrameLoader::RequestNotifyAfterRemotePaint() {
// If remote browsing (e10s), handle this with the BrowserParent.
if (auto* browserParent = GetBrowserParent()) {
Unused << browserParent->SendRequestNotifyAfterRemotePaint();
}
}
void nsFrameLoader::RequestUpdatePosition(ErrorResult& aRv) {
if (auto* browserParent = GetBrowserParent()) {
nsresult rv = browserParent->UpdatePosition();

Просмотреть файл

@ -218,8 +218,6 @@ class nsFrameLoader final : public nsStubMutationObserver,
void ActivateFrameEvent(const nsAString& aType, bool aCapture,
mozilla::ErrorResult& aRv);
void RequestNotifyAfterRemotePaint();
void RequestUpdatePosition(mozilla::ErrorResult& aRv);
already_AddRefed<Promise> RequestTabStateFlush(mozilla::ErrorResult& aRv);

Просмотреть файл

@ -76,13 +76,6 @@ interface FrameLoader {
// Note, when frameloaders are swapped, also messageManagers are swapped.
readonly attribute MessageSender? messageManager;
/**
* Request that the next time a remote layer transaction has been
* received by the Compositor, a MozAfterRemoteFrame event be sent
* to the window.
*/
void requestNotifyAfterRemotePaint();
/**
* Force a remote browser to recompute its dimension and screen position.
*/

Просмотреть файл

@ -930,11 +930,6 @@ void BrowserChild::ActorDestroy(ActorDestroyReason why) {
}
}
CompositorBridgeChild* compositorChild = CompositorBridgeChild::Get();
if (compositorChild) {
compositorChild->CancelNotifyAfterRemotePaint(this);
}
if (GetTabId() != 0) {
NestedBrowserChildMap().erase(GetTabId());
}
@ -3316,17 +3311,6 @@ void BrowserChild::NotifyJankedAnimations(
lm->UpdatePartialPrerenderedAnimations(aJankedAnimations);
}
mozilla::ipc::IPCResult BrowserChild::RecvRequestNotifyAfterRemotePaint() {
// Get the CompositorBridgeChild instance for this content thread.
CompositorBridgeChild* compositor = CompositorBridgeChild::Get();
// Tell the CompositorBridgeChild that, when it gets a RemotePaintIsReady
// message that it should forward it us so that we can bounce it to our
// BrowserParent.
compositor->RequestNotifyAfterRemotePaint(this);
return IPC_OK();
}
mozilla::ipc::IPCResult BrowserChild::RecvUIResolutionChanged(
const float& aDpi, const int32_t& aRounding, const double& aScale) {
nsCOMPtr<Document> document(GetTopLevelDocument());

Просмотреть файл

@ -721,8 +721,6 @@ class BrowserChild final : public nsMessageManagerScriptExecutor,
mozilla::ipc::IPCResult RecvNavigateByKey(const bool& aForward,
const bool& aForDocumentNavigation);
mozilla::ipc::IPCResult RecvRequestNotifyAfterRemotePaint();
mozilla::ipc::IPCResult RecvSuppressDisplayport(const bool& aEnabled);
mozilla::ipc::IPCResult RecvScrollbarPreferenceChanged(ScrollbarPreference);

Просмотреть файл

@ -3656,21 +3656,6 @@ mozilla::ipc::IPCResult BrowserParent::RecvPaintWhileInterruptingJSNoOp(
return IPC_OK();
}
mozilla::ipc::IPCResult BrowserParent::RecvRemotePaintIsReady() {
RefPtr<EventTarget> target = mFrameElement;
if (!target) {
NS_WARNING("Could not locate target for MozAfterRemotePaint message.");
return IPC_OK();
}
RefPtr<Event> event = NS_NewDOMEvent(mFrameElement, nullptr, nullptr);
event->InitEvent(u"MozAfterRemotePaint"_ns, false, false);
event->SetTrusted(true);
event->WidgetEventPtr()->mFlags.mOnlyChromeDispatch = true;
mFrameElement->DispatchEvent(*event);
return IPC_OK();
}
mozilla::ipc::IPCResult BrowserParent::RecvRemoteIsReadyToHandleInputEvents() {
// When enabling input event prioritization, input events may preempt other
// normal priority IPC messages. To prevent the input events preempt

Просмотреть файл

@ -722,8 +722,6 @@ class BrowserParent final : public PBrowserParent,
virtual void ActorDestroy(ActorDestroyReason why) override;
mozilla::ipc::IPCResult RecvRemotePaintIsReady();
mozilla::ipc::IPCResult RecvRemoteIsReadyToHandleInputEvents();
mozilla::ipc::IPCResult RecvPaintWhileInterruptingJSNoOp(

Просмотреть файл

@ -591,15 +591,6 @@ child:
parent:
/**
* Child informs the parent that the graphics objects are ready for
* compositing. This is sent when all pending changes have been
* sent to the compositor and are ready to be shown on the next composite.
* @see PCompositor
* @see RequestNotifyAfterRemotePaint
*/
async RemotePaintIsReady();
/**
* Child informs the parent that the content is ready to handle input
* events. This is sent when the BrowserChild is created.
@ -914,14 +905,6 @@ child:
*/
async NavigateByKey(bool aForward, bool aForDocumentNavigation);
/**
* The parent (chrome thread) requests that the child inform it when
* the graphics objects are ready to display.
* @see PCompositor
* @see RemotePaintIsReady
*/
async RequestNotifyAfterRemotePaint();
/**
* Tell the child that the UI resolution changed for the containing
* window.

Просмотреть файл

@ -485,53 +485,6 @@ uint32_t CompositorBridgeChild::SharedFrameMetricsData::GetAPZCId() {
return mAPZCId;
}
mozilla::ipc::IPCResult CompositorBridgeChild::RecvRemotePaintIsReady() {
// Used on the content thread, this bounces the message to the
// BrowserParent (via the BrowserChild) if the notification was previously
// requested. XPCOM gives a soup of compiler errors when trying to
// do_QueryReference so I'm using static_cast<>
MOZ_LAYERS_LOG(
("[RemoteGfx] CompositorBridgeChild received RemotePaintIsReady"));
RefPtr<nsIBrowserChild> iBrowserChild(do_QueryReferent(mWeakBrowserChild));
if (!iBrowserChild) {
MOZ_LAYERS_LOG(
("[RemoteGfx] Note: BrowserChild was released before "
"RemotePaintIsReady. "
"MozAfterRemotePaint will not be sent to listener."));
return IPC_OK();
}
BrowserChild* browserChild = static_cast<BrowserChild*>(iBrowserChild.get());
MOZ_ASSERT(browserChild);
Unused << browserChild->SendRemotePaintIsReady();
mWeakBrowserChild = nullptr;
return IPC_OK();
}
void CompositorBridgeChild::RequestNotifyAfterRemotePaint(
BrowserChild* aBrowserChild) {
MOZ_ASSERT(aBrowserChild,
"NULL BrowserChild not allowed in "
"CompositorBridgeChild::RequestNotifyAfterRemotePaint");
mWeakBrowserChild =
do_GetWeakReference(static_cast<dom::BrowserChild*>(aBrowserChild));
if (!mCanSend) {
return;
}
Unused << SendRequestNotifyAfterRemotePaint();
}
void CompositorBridgeChild::CancelNotifyAfterRemotePaint(
BrowserChild* aBrowserChild) {
RefPtr<nsIBrowserChild> iBrowserChild(do_QueryReferent(mWeakBrowserChild));
if (!iBrowserChild) {
return;
}
BrowserChild* browserChild = static_cast<BrowserChild*>(iBrowserChild.get());
if (browserChild == aBrowserChild) {
mWeakBrowserChild = nullptr;
}
}
bool CompositorBridgeChild::SendWillClose() {
MOZ_RELEASE_ASSERT(mCanSend);
return PCompositorBridgeChild::SendWillClose();
@ -614,13 +567,6 @@ bool CompositorBridgeChild::SendNotifyRegionInvalidated(
return PCompositorBridgeChild::SendNotifyRegionInvalidated(region);
}
bool CompositorBridgeChild::SendRequestNotifyAfterRemotePaint() {
if (!mCanSend) {
return false;
}
return PCompositorBridgeChild::SendRequestNotifyAfterRemotePaint();
}
PTextureChild* CompositorBridgeChild::AllocPTextureChild(
const SurfaceDescriptor&, const ReadLockDescriptor&, const LayersBackend&,
const TextureFlags&, const LayersId&, const uint64_t& aSerial,

Просмотреть файл

@ -127,16 +127,6 @@ class CompositorBridgeChild final : public PCompositorBridgeChild,
RefPtr<webgpu::WebGPUChild> GetWebGPUChild();
/**
* Request that the parent tell us when graphics are ready on GPU.
* When we get that message, we bounce it to the BrowserParent via
* the BrowserChild
* @param browserChild The object to bounce the note to. Non-NULL.
*/
void RequestNotifyAfterRemotePaint(BrowserChild* aBrowserChild);
void CancelNotifyAfterRemotePaint(BrowserChild* aBrowserChild);
// Beware that these methods don't override their super-class equivalent
// (which are not virtual), they just overload them. All of these Send*
// methods just add a sanity check (that it is not too late send a message)
@ -158,7 +148,6 @@ class CompositorBridgeChild final : public PCompositorBridgeChild,
bool SendStopFrameTimeRecording(const uint32_t& startIndex,
nsTArray<float>* intervals);
bool SendNotifyRegionInvalidated(const nsIntRegion& region);
bool SendRequestNotifyAfterRemotePaint();
bool IsSameProcess() const override;
bool IPCOpen() const override { return mCanSend; }
@ -286,8 +275,6 @@ class CompositorBridgeChild final : public PCompositorBridgeChild,
mozilla::ipc::IPCResult RecvReleaseSharedCompositorFrameMetrics(
const ViewID& aId, const uint32_t& aAPZCId);
mozilla::ipc::IPCResult RecvRemotePaintIsReady();
mozilla::ipc::IPCResult RecvObserveLayersUpdate(
const LayersId& aLayersId, const LayersObserverEpoch& aEpoch,
const bool& aActive);
@ -340,10 +327,6 @@ class CompositorBridgeChild final : public PCompositorBridgeChild,
// While this should be safe to use since the ViewID is unique
nsClassHashtable<nsUint64HashKey, SharedFrameMetricsData> mFrameMetricsTable;
// Weakly hold the BrowserChild that made a request to be alerted when
// the transaction has been received.
nsWeakPtr mWeakBrowserChild; // type is BrowserChild
DISALLOW_EVIL_CONSTRUCTORS(CompositorBridgeChild);
// True until the beginning of the two-step shutdown sequence of this actor.

Просмотреть файл

@ -262,7 +262,6 @@ class CompositorBridgeParentBase : public PCompositorBridgeParent,
virtual mozilla::ipc::IPCResult RecvForcePresent() = 0;
virtual mozilla::ipc::IPCResult RecvNotifyRegionInvalidated(
const nsIntRegion& region) = 0;
virtual mozilla::ipc::IPCResult RecvRequestNotifyAfterRemotePaint() = 0;
virtual mozilla::ipc::IPCResult RecvBeginRecording(
const TimeStamp& aRecordingStart, BeginRecordingResolver&& aResolve) = 0;
virtual mozilla::ipc::IPCResult RecvEndRecordingToDisk(
@ -372,12 +371,6 @@ class CompositorBridgeParent final : public CompositorBridgeParentBase,
return IPC_OK();
}
// Unused for chrome <-> compositor communication (which this class does).
// @see ContentCompositorBridgeParent::RecvRequestNotifyAfterRemotePaint
mozilla::ipc::IPCResult RecvRequestNotifyAfterRemotePaint() override {
return IPC_OK();
};
mozilla::ipc::IPCResult RecvBeginRecording(
const TimeStamp& aRecordingStart,
BeginRecordingResolver&& aResolve) override;

Просмотреть файл

@ -53,12 +53,6 @@ void UpdateIndirectTree(LayersId aId, Layer* aRoot,
const TargetConfig& aTargetConfig);
void EraseLayerState(LayersId aId);
mozilla::ipc::IPCResult
ContentCompositorBridgeParent::RecvRequestNotifyAfterRemotePaint() {
mNotifyAfterRemotePaint = true;
return IPC_OK();
}
void ContentCompositorBridgeParent::ActorDestroy(ActorDestroyReason aWhy) {
mCanSend = false;
@ -352,13 +346,6 @@ void ContentCompositorBridgeParent::ShadowLayersUpdated(
id, aInfo.isFirstPaint(), aInfo.focusTarget(), aInfo.scheduleComposite(),
aInfo.paintSequenceNumber(), aInfo.isRepeatTransaction(), aHitTestUpdate);
// Send the 'remote paint ready' message to the content thread if it has
// already asked.
if (mNotifyAfterRemotePaint) {
Unused << SendRemotePaintIsReady();
mNotifyAfterRemotePaint = false;
}
if (aLayerTree->ShouldParentObserveEpoch()) {
// Note that we send this through the window compositor, since this needs
// to reach the widget owning the tab.

Просмотреть файл

@ -34,7 +34,6 @@ class ContentCompositorBridgeParent final : public CompositorBridgeParentBase {
public:
explicit ContentCompositorBridgeParent(CompositorManagerParent* aManager)
: CompositorBridgeParentBase(aManager),
mNotifyAfterRemotePaint(false),
mDestroyCalled(false) {}
void ActorDestroy(ActorDestroyReason aWhy) override;
@ -110,12 +109,6 @@ class ContentCompositorBridgeParent final : public CompositorBridgeParentBase {
return IPC_OK();
}
/**
* Tells this CompositorBridgeParent to send a message when the compositor has
* received the transaction.
*/
mozilla::ipc::IPCResult RecvRequestNotifyAfterRemotePaint() override;
PLayerTransactionParent* AllocPLayerTransactionParent(
const nsTArray<LayersBackend>& aBackendHints,
const LayersId& aId) override;
@ -223,9 +216,6 @@ class ContentCompositorBridgeParent final : public CompositorBridgeParentBase {
// ourself. This is released (deferred) in ActorDestroy().
RefPtr<ContentCompositorBridgeParent> mSelfRef;
// If true, we should send a RemotePaintIsReady message when the layer
// transaction is received
bool mNotifyAfterRemotePaint;
bool mDestroyCalled;
RefPtr<CanvasTranslator> mCanvasTranslator;

Просмотреть файл

@ -124,15 +124,6 @@ child:
async NotifyFrameStats(FrameStats[] aFrameStats);
/**
* Parent informs the child that the graphics objects are ready for
* compositing. This usually means that the graphics objects (textures
* and the like) are available on the GPU. This is used for chrome UI.
* @see RequestNotifyAfterRemotePaint
* @see PBrowser
*/
async RemotePaintIsReady();
async ParentAsyncMessages(AsyncParentMessageData[] aMessages);
async ObserveLayersUpdate(LayersId aLayersId, LayersObserverEpoch aEpoch, bool aActive);
@ -226,14 +217,6 @@ parent:
// Notify the compositor that a region of the screen has been invalidated.
async NotifyRegionInvalidated(nsIntRegion region);
/**
* The child (content/chrome thread) requests that the parent inform it when
* the graphics objects are ready to display.
* @see PBrowser
* @see RemotePaintIsReady
*/
async RequestNotifyAfterRemotePaint();
async PTexture(SurfaceDescriptor aSharedData, ReadLockDescriptor aReadLock, LayersBackend aBackend, TextureFlags aTextureFlags, LayersId id, uint64_t aSerial, MaybeExternalImageId aExternalImageId);
async InitPCanvasParent(Endpoint<PCanvasParent> aEndpoint);