perf: avoid redundant call to virtual methods GetProcess() and GetID() (#46409)
This commit is contained in:
parent
6f24dbaab4
commit
a21c805ece
1 changed files with 3 additions and 4 deletions
|
@ -1788,19 +1788,18 @@ void WebContents::FrameDeleted(content::FrameTreeNodeId frame_tree_node_id) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
|
void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
|
||||||
|
const auto id = render_view_host->GetProcess()->GetID().GetUnsafeValue();
|
||||||
// This event is necessary for tracking any states with respect to
|
// This event is necessary for tracking any states with respect to
|
||||||
// intermediate render view hosts aka speculative render view hosts. Currently
|
// intermediate render view hosts aka speculative render view hosts. Currently
|
||||||
// used by object-registry.js to ref count remote objects.
|
// used by object-registry.js to ref count remote objects.
|
||||||
Emit("render-view-deleted",
|
Emit("render-view-deleted", id);
|
||||||
render_view_host->GetProcess()->GetID().GetUnsafeValue());
|
|
||||||
|
|
||||||
if (web_contents()->GetRenderViewHost() == render_view_host) {
|
if (web_contents()->GetRenderViewHost() == render_view_host) {
|
||||||
// When the RVH that has been deleted is the current RVH it means that the
|
// 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.
|
// the web contents are being closed. This is communicated by this event.
|
||||||
// Currently tracked by guest-window-manager.ts to destroy the
|
// Currently tracked by guest-window-manager.ts to destroy the
|
||||||
// BrowserWindow.
|
// BrowserWindow.
|
||||||
Emit("current-render-view-deleted",
|
Emit("current-render-view-deleted", id);
|
||||||
render_view_host->GetProcess()->GetID().GetUnsafeValue());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue