mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
perf: avoid redundant call to virtual methods GetProcess() and GetID() (34-x-y backport) (#46548)
perf: avoid redundant call to virtual methods GetProcess() and GetID() (#46409)
This commit is contained in:
@@ -1766,18 +1766,18 @@ void WebContents::FrameDeleted(content::FrameTreeNodeId frame_tree_node_id) {
|
||||
}
|
||||
|
||||
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
|
||||
const auto id = render_view_host->GetProcess()->GetID();
|
||||
// This event is necessary for tracking any states with respect to
|
||||
// intermediate render view hosts aka speculative render view hosts. Currently
|
||||
// used by object-registry.js to ref count remote objects.
|
||||
Emit("render-view-deleted", render_view_host->GetProcess()->GetID());
|
||||
Emit("render-view-deleted", id);
|
||||
|
||||
if (web_contents()->GetRenderViewHost() == render_view_host) {
|
||||
// When the RVH that has been deleted is the current RVH it means that the
|
||||
// the web contents are being closed. This is communicated by this event.
|
||||
// Currently tracked by guest-window-manager.ts to destroy the
|
||||
// BrowserWindow.
|
||||
Emit("current-render-view-deleted",
|
||||
render_view_host->GetProcess()->GetID());
|
||||
Emit("current-render-view-deleted", id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user