Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 1651931

Browse files
committed
Bug 1503655 part 2 - Remove unused and outdated code from RenderFrameParent. r=kats
This commit removes a bunch of cruft from RenderFrameParent that isn't used and isn't needed. Some functions that have no reason to be in RenderFrameParent are moved to TabParent in anticipation of the PRenderFrame protocol being dropped. Differential Revision: https://phabricator.services.mozilla.com/D10411
1 parent 88205da commit 1651931

File tree

7 files changed

+171
-260
lines changed

7 files changed

+171
-260
lines changed

dom/ipc/PBrowser.ipdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,11 @@ parent:
534534
*/
535535
async RemotePaintIsReady();
536536

537+
/**
538+
* Child informs the parent that a compositor transaction has ocurred.
539+
*/
540+
async NotifyCompositorTransaction();
541+
537542
/**
538543
* Child informs the parent that the content is ready to handle input
539544
* events. This is sent when the TabChild is created.

dom/ipc/TabChild.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2923,7 +2923,7 @@ TabChild::NotifyPainted()
29232923
if (!mNotified) {
29242924
// Recording/replaying processes have a compositor but not a remote frame.
29252925
if (!recordreplay::IsRecordingOrReplaying()) {
2926-
mRemoteFrame->SendNotifyCompositorTransaction();
2926+
SendNotifyCompositorTransaction();
29272927
}
29282928
mNotified = true;
29292929
}
@@ -3302,7 +3302,7 @@ TabChild::RecvRequestNotifyAfterRemotePaint()
33023302

33033303
// Tell the CompositorBridgeChild that, when it gets a RemotePaintIsReady
33043304
// message that it should forward it us so that we can bounce it to our
3305-
// RenderFrameParent.
3305+
// TabParent.
33063306
compositor->RequestNotifyAfterRemotePaint(this);
33073307
return IPC_OK();
33083308
}

dom/ipc/TabParent.cpp

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ TabParent::InitRenderFrame()
641641
MOZ_ASSERT(frameLoader);
642642
if (frameLoader) {
643643
RenderFrameParent* renderFrame = new RenderFrameParent(frameLoader);
644-
MOZ_ASSERT(renderFrame->IsInitted());
644+
MOZ_ASSERT(renderFrame->IsInitialized());
645645
layers::LayersId layersId = renderFrame->GetLayersId();
646646
AddTabParentToTable(layersId, this);
647647
if (!SendPRenderFrameConstructor(renderFrame)) {
@@ -1654,9 +1654,19 @@ TabParent::SendHandleTap(TapType aType,
16541654
if (mIsDestroyed || !mIsReadyToHandleInputEvents) {
16551655
return false;
16561656
}
1657-
if ((aType == TapType::eSingleTap || aType == TapType::eSecondTap) &&
1658-
GetRenderFrame()) {
1659-
GetRenderFrame()->TakeFocusForClickFromTap();
1657+
if ((aType == TapType::eSingleTap || aType == TapType::eSecondTap)) {
1658+
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
1659+
if (fm) {
1660+
RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
1661+
if (frameLoader) {
1662+
RefPtr<Element> element = frameLoader->GetOwnerContent();
1663+
if (element) {
1664+
fm->SetFocus(element, nsIFocusManager::FLAG_BYMOUSE |
1665+
nsIFocusManager::FLAG_BYTOUCH |
1666+
nsIFocusManager::FLAG_NOSCROLL);
1667+
}
1668+
}
1669+
}
16601670
}
16611671
LayoutDeviceIntPoint offset = GetChildProcessOffset();
16621672
return Manager()->AsContentParent()->IsInputPriorityEventEnabled()
@@ -2604,7 +2614,7 @@ TabParent::AllocPRenderFrameParent()
26042614
RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
26052615

26062616
RenderFrameParent* rfp = new RenderFrameParent(frameLoader);
2607-
if (rfp->IsInitted()) {
2617+
if (rfp->IsInitialized()) {
26082618
layers::LayersId layersId = rfp->GetLayersId();
26092619
AddTabParentToTable(layersId, this);
26102620
}
@@ -2632,7 +2642,7 @@ TabParent::SetRenderFrame(PRenderFrameParent* aRFParent)
26322642
}
26332643

26342644
RenderFrameParent* renderFrame = static_cast<RenderFrameParent*>(aRFParent);
2635-
bool success = renderFrame->Init(frameLoader);
2645+
bool success = renderFrame->Initialize(frameLoader);
26362646
if (!success) {
26372647
return false;
26382648
}
@@ -3184,6 +3194,30 @@ TabParent::RecvRemotePaintIsReady()
31843194
return IPC_OK();
31853195
}
31863196

3197+
mozilla::ipc::IPCResult
3198+
TabParent::RecvNotifyCompositorTransaction()
3199+
{
3200+
RefPtr<nsFrameLoader> frameLoader = GetFrameLoader();
3201+
3202+
if (!frameLoader) {
3203+
return IPC_OK();
3204+
}
3205+
3206+
nsIFrame* docFrame = frameLoader->GetPrimaryFrameOfOwningContent();
3207+
3208+
if (!docFrame) {
3209+
// Bad, but nothing we can do about it (XXX/cjones: or is there?
3210+
// maybe bug 589337?). When the new frame is created, we'll
3211+
// probably still be the current render frame and will get to draw
3212+
// our content then. Or, we're shutting down and this update goes
3213+
// to /dev/null.
3214+
return IPC_OK();
3215+
}
3216+
3217+
docFrame->InvalidateLayer(DisplayItemType::TYPE_REMOTE);
3218+
return IPC_OK();
3219+
}
3220+
31873221
mozilla::ipc::IPCResult
31883222
TabParent::RecvRemoteIsReadyToHandleInputEvents()
31893223
{

dom/ipc/TabParent.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,8 @@ class TabParent final : public PBrowserParent
626626

627627
virtual mozilla::ipc::IPCResult RecvRemotePaintIsReady() override;
628628

629+
virtual mozilla::ipc::IPCResult RecvNotifyCompositorTransaction() override;
630+
629631
virtual mozilla::ipc::IPCResult RecvRemoteIsReadyToHandleInputEvents() override;
630632

631633
virtual mozilla::ipc::IPCResult RecvPaintWhileInterruptingJSNoOp(const LayersObserverEpoch& aEpoch) override;

layout/ipc/PRenderFrame.ipdl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ sync protocol PRenderFrame
2828
manager PBrowser;
2929

3030
parent:
31-
async NotifyCompositorTransaction();
3231

3332
async __delete__();
3433
};

0 commit comments

Comments
 (0)