Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Issue 1409693009: Fix leaking of RenderFrames. (Closed)

Created:
5 years, 1 month ago by nasko
Modified:
5 years ago
Reviewers:
Charlie Reis, dcheng
CC:
chromium-reviews, creis+watch_chromium.org, darin-cc_chromium.org, jam, mkwst+moarreviews-renderer_chromium.org, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix leaking of RenderFrames. This CL adds an explicit IPC from the browser process to the renderer process to delete RenderFrame objects, when the corresponding RenderFrameHost is deleted on the browser side. It fixes two known leaks: * cancelling a navigation in a pending RenderFrameHost * parent frame deleting from DOM a child frame in a remote process BUG=548275 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/eab5c55815be54a878e9a79aa68920a3d6db4a93 Cr-Commit-Position: refs/heads/master@{#365156}

Patch Set 1 #

Total comments: 19

Patch Set 2 : Fix issues based on Charlie's review. #

Patch Set 3 : Rename the IPC and use a boolean to indicate browser initiated detach. #

Patch Set 4 : Enable previously disabled test. #

Patch Set 5 : Make the RenderFrame detachment more generic. #

Total comments: 1

Patch Set 6 : Fixing just the pending RF leak. #

Total comments: 6

Patch Set 7 : Fixes based on another review round. #

Total comments: 1

Patch Set 8 : Rebase on ToT. #

Patch Set 9 : Fixed frame checking and not detaching for main frames. #

Total comments: 5

Patch Set 10 : Check that DetachFrame is only called on subframes for now. #

Patch Set 11 : Handle main frame navigating to existing process. #

Total comments: 8

Patch Set 12 : Rebased on ToT and a small change. #

Total comments: 18

Patch Set 13 : Send Detach IPC from the RFH destructor. #

Total comments: 4

Patch Set 14 : Don't send IPC for the main frame. #

Total comments: 10

Patch Set 15 : Fixes for Charlie's and Daniel's reviews. #

Total comments: 4

Patch Set 16 : Fixing another round of nits. #

Total comments: 6

Patch Set 17 : Rebased on ToT and couple of more nits fixes. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+200 lines, -9 lines) Patch
M content/browser/frame_host/render_frame_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +12 lines, -3 lines 0 comments Download
M content/browser/site_per_process_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +137 lines, -0 lines 0 comments Download
M content/common/frame_messages.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +3 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +19 lines, -0 lines 0 comments Download
M content/renderer/render_frame_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8 chunks +29 lines, -6 lines 0 comments Download

Messages

Total messages: 49 (15 generated)
nasko
Hey Charlie and Daniel, I've put up a fix for the leaking of pending RenderFrames. ...
5 years, 1 month ago (2015-10-28 23:22:18 UTC) #2
Charlie Reis
Thanks! Glad to see a fix for this. It's not clear to me that the ...
5 years, 1 month ago (2015-10-29 17:28:58 UTC) #3
dcheng
https://codereview.chromium.org/1409693009/diff/1/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/1409693009/diff/1/content/common/frame_messages.h#newcode483 content/common/frame_messages.h:483: // Instructs the renderer to delete the RenderFrame object ...
5 years, 1 month ago (2015-10-29 18:50:53 UTC) #4
nasko
Yay, fun! Addressed comments, but did not add handling of cleanup of mirrored frames. I ...
5 years, 1 month ago (2015-10-29 19:09:46 UTC) #5
nasko
Another update with more generic handling of RenderFrame deletion. I did find a problem right ...
5 years, 1 month ago (2015-10-29 23:55:38 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1409693009/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1409693009/80001
5 years, 1 month ago (2015-10-30 00:16:01 UTC) #8
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/81811) linux_chromium_chromeos_rel_ng on ...
5 years, 1 month ago (2015-10-30 00:52:02 UTC) #10
nasko
As we agreed, let's fix just be pending RF leaks. PS6 should be the same ...
5 years, 1 month ago (2015-10-30 19:49:35 UTC) #11
Charlie Reis
Thanks. Makes sense to fix the first leak, and we can come back for the ...
5 years, 1 month ago (2015-10-30 20:15:44 UTC) #12
nasko
PS7 addresses fixes and PS8 rebases to allow for tryjobs. I have forgotten to remove ...
5 years, 1 month ago (2015-11-02 22:48:52 UTC) #13
Charlie Reis
Maybe the question below explains the try job failures? https://codereview.chromium.org/1409693009/diff/120001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1409693009/diff/120001/content/renderer/render_frame_impl.cc#newcode2399 content/renderer/render_frame_impl.cc:2399: ...
5 years, 1 month ago (2015-11-02 23:43:50 UTC) #15
Charlie Reis
Thanks! LGTM.
5 years, 1 month ago (2015-11-03 00:55:04 UTC) #17
dcheng
https://codereview.chromium.org/1409693009/diff/180001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1409693009/diff/180001/content/renderer/render_frame_impl.cc#newcode674 content/renderer/render_frame_impl.cc:674: void RenderFrameImpl::DetachFrame(int routing_id) { Is it worth DCHECKing our ...
5 years, 1 month ago (2015-11-03 04:22:54 UTC) #18
nasko
https://codereview.chromium.org/1409693009/diff/180001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1409693009/diff/180001/content/renderer/render_frame_impl.cc#newcode674 content/renderer/render_frame_impl.cc:674: void RenderFrameImpl::DetachFrame(int routing_id) { On 2015/11/03 04:22:54, dcheng wrote: ...
5 years, 1 month ago (2015-11-03 17:59:08 UTC) #19
nasko
One more update based on the discussion today. Fixes: * Moved RenderFrameImpl to use a ...
5 years, 1 month ago (2015-11-04 00:10:53 UTC) #21
Charlie Reis
https://codereview.chromium.org/1409693009/diff/180001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1409693009/diff/180001/content/renderer/render_frame_impl.cc#newcode674 content/renderer/render_frame_impl.cc:674: void RenderFrameImpl::DetachFrame(int routing_id) { On 2015/11/03 17:59:08, nasko (slow ...
5 years, 1 month ago (2015-11-04 21:28:30 UTC) #22
nasko
Hey Charlie, I've finally gotten back to this CL. It is rebased on ToT and ...
5 years ago (2015-12-10 21:26:52 UTC) #23
Charlie Reis
Hrm, I think I found another problem that could leave the browser process thinking the ...
5 years ago (2015-12-11 00:03:17 UTC) #24
nasko
A slight reworking of the CL. I moved the IPC sending to be done universally ...
5 years ago (2015-12-11 00:47:26 UTC) #25
Charlie Reis
https://codereview.chromium.org/1409693009/diff/260001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1409693009/diff/260001/content/renderer/render_frame_impl.cc#newcode742 content/renderer/render_frame_impl.cc:742: void RenderFrameImpl::DetachFrame(int routing_id) { On 2015/12/11 00:03:17, Charlie Reis ...
5 years ago (2015-12-11 00:47:41 UTC) #26
Charlie Reis
Thanks. Mostly looks good with nits, but one question about the race I mentioned. https://codereview.chromium.org/1409693009/diff/260001/content/renderer/render_frame_impl.cc ...
5 years ago (2015-12-11 20:10:15 UTC) #28
dcheng
https://codereview.chromium.org/1409693009/diff/280001/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/1409693009/diff/280001/content/common/frame_messages.h#newcode515 content/common/frame_messages.h:515: IPC_MESSAGE_CONTROL1(FrameMsg_Detach, int /* routing_id */) I think I would ...
5 years ago (2015-12-11 23:40:17 UTC) #29
nasko
This includes fixes for issues from both Charlie and Daniel. https://codereview.chromium.org/1409693009/diff/280001/content/common/frame_messages.h File content/common/frame_messages.h (right): https://codereview.chromium.org/1409693009/diff/280001/content/common/frame_messages.h#newcode515 ...
5 years ago (2015-12-14 21:00:02 UTC) #32
Charlie Reis
Thanks, LGTM with nits. https://codereview.chromium.org/1409693009/diff/340001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1409693009/diff/340001/content/renderer/render_frame_impl.cc#newcode1451 content/renderer/render_frame_impl.cc:1451: void RenderFrameImpl::OnDeleteFrame() { We're putting ...
5 years ago (2015-12-14 21:22:39 UTC) #33
nasko
Another round of nits fixed. https://codereview.chromium.org/1409693009/diff/340001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1409693009/diff/340001/content/renderer/render_frame_impl.cc#newcode1451 content/renderer/render_frame_impl.cc:1451: void RenderFrameImpl::OnDeleteFrame() { On ...
5 years ago (2015-12-14 22:08:30 UTC) #34
Charlie Reis
https://codereview.chromium.org/1409693009/diff/360001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1409693009/diff/360001/content/renderer/render_frame_impl.cc#newcode1453 content/renderer/render_frame_impl.cc:1453: // swapped a RenderFrameProxy with RenderFrame, the proxy need ...
5 years ago (2015-12-14 22:12:52 UTC) #35
dcheng
lgtm https://codereview.chromium.org/1409693009/diff/360001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/1409693009/diff/360001/content/browser/frame_host/render_frame_host_impl.cc#newcode272 content/browser/frame_host/render_frame_host_impl.cc:272: if (is_active && !frame_tree_node_->IsMainFrame() && render_frame_created_) Nit: I ...
5 years ago (2015-12-14 22:14:41 UTC) #36
Charlie Reis
https://codereview.chromium.org/1409693009/diff/360001/content/browser/frame_host/render_frame_host_impl.cc File content/browser/frame_host/render_frame_host_impl.cc (right): https://codereview.chromium.org/1409693009/diff/360001/content/browser/frame_host/render_frame_host_impl.cc#newcode272 content/browser/frame_host/render_frame_host_impl.cc:272: if (is_active && !frame_tree_node_->IsMainFrame() && render_frame_created_) On 2015/12/14 22:14:41, ...
5 years ago (2015-12-14 22:21:14 UTC) #37
nasko
https://codereview.chromium.org/1409693009/diff/360001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): https://codereview.chromium.org/1409693009/diff/360001/content/renderer/render_frame_impl.cc#newcode1453 content/renderer/render_frame_impl.cc:1453: // swapped a RenderFrameProxy with RenderFrame, the proxy need ...
5 years ago (2015-12-14 22:27:59 UTC) #38
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1409693009/380001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1409693009/380001
5 years ago (2015-12-14 23:08:52 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_TIMED_OUT, no build URL)
5 years ago (2015-12-15 01:16:05 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1409693009/380001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1409693009/380001
5 years ago (2015-12-15 04:57:23 UTC) #45
commit-bot: I haz the power
Committed patchset #17 (id:380001)
5 years ago (2015-12-15 05:20:10 UTC) #47
commit-bot: I haz the power
5 years ago (2015-12-15 05:21:22 UTC) #49
Message was sent while issue was closed.
Patchset 17 (id:??) landed as
https://crrev.com/eab5c55815be54a878e9a79aa68920a3d6db4a93
Cr-Commit-Position: refs/heads/master@{#365156}

Powered by Google App Engine
This is Rietveld 408576698