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

Issue 2387603003: Resume a backgrounded renderer that was purged and suspended (Closed)

Created:
4 years, 2 months ago by tasak
Modified:
4 years, 1 month ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, dglazkov+blink, darin-cc_chromium.org, blink-reviews, scheduler-bugs_chromium.org, blink-reviews-api_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Resume a backgrounded renderer that was purged and suspended - To avoid breaking web, we need to resume a backgrounded renderer that was purged and suspended. (A backgrounded renderer is suspended for 120seconds). After resumed, the renderer is running for 10 seconds and is purged and suspended again. - intent-to-implement-and-ship of background renderer's purge + suspend is https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/DK189tnM8l4 - one of the documents attached in the above intent is https://docs.google.com/document/d/1EgLimgxWK5DGhptnNVbEGSvVn6Q609ZJaBkLjEPRJvI/edit?usp=sharing - The feature is not enabled by default because purge-and-suspend-time is 0. BUG=635419

Patch Set 1 : Add Resume #

Total comments: 4

Patch Set 2 : Fixed comment. #

Total comments: 6

Patch Set 3 : 2min / 1min. #

Total comments: 5

Patch Set 4 : Updated: 120seconds (=2min) and 10seconds. #

Patch Set 5 : Use constexpr base::TimeDelta #

Total comments: 4

Patch Set 6 : Added RendererSchedulerImplTest.ResumeRenderer. #

Patch Set 7 : Fixed 120sec/10sec #

Patch Set 8 : Rebaselined #

Patch Set 9 : Rebaselined #

Total comments: 6

Patch Set 10 : Add purge-and-suspend state and last modified time to WebContentsData #

Total comments: 4

Patch Set 11 : Fixed #

Total comments: 6

Patch Set 12 : Check RendererIsHidden. #

Total comments: 7

Patch Set 13 : Renamed BACKGROUNDED => RUNNING #

Total comments: 2

Patch Set 14 : Added transition: => RUNNING #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+266 lines, -18 lines) Patch
M chrome/browser/memory/tab_manager.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +35 lines, -2 lines 1 comment Download
M chrome/browser/memory/tab_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +84 lines, -10 lines 6 comments Download
M chrome/browser/memory/tab_manager_web_contents_data.h View 1 2 3 4 5 6 7 8 9 2 chunks +22 lines, -0 lines 0 comments Download
M chrome/browser/memory/tab_manager_web_contents_data.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +21 lines, -1 line 0 comments Download
M content/browser/renderer_host/render_process_host_impl.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/renderer_host/render_process_host_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +4 lines, -0 lines 0 comments Download
M content/child/child_thread_impl.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/child/child_thread_impl.cc View 1 2 3 4 5 6 7 8 2 chunks +3 lines, -0 lines 0 comments Download
M content/common/child_process_messages.h View 1 chunk +3 lines, -0 lines 0 comments Download
M content/public/browser/render_process_host.h View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M content/public/test/mock_render_process_host.h View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/mock_render_process_host.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +10 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h View 3 4 5 6 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc View 1 2 3 4 5 6 7 8 3 chunks +15 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc View 1 2 3 4 5 1 chunk +49 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/platform/scheduler/test/fake_renderer_scheduler.cc View 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M third_party/WebKit/public/platform/scheduler/test/fake_renderer_scheduler.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/public/platform/scheduler/test/mock_renderer_scheduler.h View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 96 (62 generated)
tasak
Would you review this CL?
4 years, 2 months ago (2016-09-30 10:40:51 UTC) #12
hajimehoshi
I'm not clear about the description of this CL. Are you changing the purge+suspended tab ...
4 years, 2 months ago (2016-09-30 11:22:46 UTC) #13
Sami
It feels like we should try to unify this approach (and purge & suspend in ...
4 years, 2 months ago (2016-09-30 12:10:40 UTC) #17
haraken
On 2016/09/30 12:10:40, Sami wrote: > It feels like we should try to unify this ...
4 years, 2 months ago (2016-10-03 04:26:37 UTC) #18
tasak
https://codereview.chromium.org/2387603003/diff/40001/content/browser/renderer_host/render_process_host_impl.cc File content/browser/renderer_host/render_process_host_impl.cc (right): https://codereview.chromium.org/2387603003/diff/40001/content/browser/renderer_host/render_process_host_impl.cc#newcode997 content/browser/renderer_host/render_process_host_impl.cc:997: last_resumed_time_ = last_purged_and_suspended_time_; On 2016/09/30 11:22:46, hajimehoshi wrote: > ...
4 years, 2 months ago (2016-10-03 05:44:16 UTC) #21
tasak
4 years, 2 months ago (2016-10-04 09:18:07 UTC) #25
tasak
Would you review this CL? Currently I have no idea about how to measure user ...
4 years, 2 months ago (2016-10-06 05:18:28 UTC) #26
haraken
https://codereview.chromium.org/2387603003/diff/60001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/60001/chrome/browser/memory/tab_manager.cc#newcode89 chrome/browser/memory/tab_manager.cc:89: const int kResumeSuspendedRendererMinutes = 20; I'd say 20 seconds ...
4 years, 2 months ago (2016-10-06 07:29:05 UTC) #27
tasak
Thank you for review. https://codereview.chromium.org/2387603003/diff/60001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/60001/chrome/browser/memory/tab_manager.cc#newcode89 chrome/browser/memory/tab_manager.cc:89: const int kResumeSuspendedRendererMinutes = 20; ...
4 years, 2 months ago (2016-10-06 08:02:06 UTC) #30
haraken
LGTM on my side, but Sami should take a look. - Add a link to ...
4 years, 2 months ago (2016-10-06 08:21:20 UTC) #31
tasak
> - Add a link to the Intent-to-implement to the CL description. Done. > - ...
4 years, 2 months ago (2016-10-06 08:42:37 UTC) #37
dcheng
driveby https://codereview.chromium.org/2387603003/diff/80001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/80001/chrome/browser/memory/tab_manager.cc#newcode93 chrome/browser/memory/tab_manager.cc:93: const int kSuspendResumedRendererMinutes = 1; On 2016/10/06 08:42:36, ...
4 years, 2 months ago (2016-10-06 09:55:08 UTC) #38
tasak
https://codereview.chromium.org/2387603003/diff/80001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/80001/chrome/browser/memory/tab_manager.cc#newcode93 chrome/browser/memory/tab_manager.cc:93: const int kSuspendResumedRendererMinutes = 1; On 2016/10/06 09:55:08, dcheng ...
4 years, 2 months ago (2016-10-06 10:10:05 UTC) #41
Sami
lgtm with a test :) By the way, one possible way to improve this in ...
4 years, 2 months ago (2016-10-06 13:10:09 UTC) #44
Sami
Btw #2, a suspended renderer also means TaskQueueThrottler won't keep ticking, right altimin@?
4 years, 2 months ago (2016-10-06 13:11:53 UTC) #45
chrisha
I'm curious why we're putting this in TabManager instead of in MemoryCoordinator?
4 years, 2 months ago (2016-10-06 13:18:45 UTC) #46
tasak
Thank you for review. https://codereview.chromium.org/2387603003/diff/120001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/120001/chrome/browser/memory/tab_manager.cc#newcode87 chrome/browser/memory/tab_manager.cc:87: // If a backgrounded renderer ...
4 years, 2 months ago (2016-10-07 05:31:26 UTC) #49
tasak
On 2016/10/06 13:18:45, chrisha (slow) wrote: > I'm curious why we're putting this in TabManager ...
4 years, 2 months ago (2016-10-07 05:40:29 UTC) #50
altimin
On 2016/10/06 13:11:53, Sami wrote: > Btw #2, a suspended renderer also means TaskQueueThrottler won't ...
4 years, 2 months ago (2016-10-07 16:16:14 UTC) #53
haraken
On 2016/10/07 16:16:14, altimin wrote: > On 2016/10/06 13:11:53, Sami wrote: > > Btw #2, ...
4 years, 2 months ago (2016-10-08 02:16:48 UTC) #54
tasak
avi, would you review this CL?
4 years, 2 months ago (2016-10-18 05:17:50 UTC) #62
Avi (use Gerrit)
https://codereview.chromium.org/2387603003/diff/80001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/80001/chrome/browser/memory/tab_manager.cc#newcode93 chrome/browser/memory/tab_manager.cc:93: const int kSuspendResumedRendererMinutes = 1; On 2016/10/06 09:55:08, dcheng ...
4 years, 2 months ago (2016-10-18 06:15:37 UTC) #65
tasak
Thank you for review. https://codereview.chromium.org/2387603003/diff/200001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/200001/chrome/browser/memory/tab_manager.cc#newcode95 chrome/browser/memory/tab_manager.cc:95: base::TimeDelta::FromSeconds(120); On 2016/10/18 06:15:37, Avi ...
4 years, 2 months ago (2016-10-18 10:38:42 UTC) #68
Avi (use Gerrit)
Excellent simplification. Some nits. https://codereview.chromium.org/2387603003/diff/220001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/220001/chrome/browser/memory/tab_manager.cc#newcode711 chrome/browser/memory/tab_manager.cc:711: PurgeAndSuspendState& next_state) { Non-const reference ...
4 years, 2 months ago (2016-10-18 15:41:53 UTC) #71
tasak
Thank you for review. https://codereview.chromium.org/2387603003/diff/220001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/220001/chrome/browser/memory/tab_manager.cc#newcode747 chrome/browser/memory/tab_manager.cc:747: } On 2016/10/18 15:41:53, Avi ...
4 years, 2 months ago (2016-10-19 06:13:41 UTC) #74
haraken
LGTM, but Chris should take a look. What happens if a renderer is sent to ...
4 years, 2 months ago (2016-10-19 08:57:54 UTC) #75
tasak
> What happens if a renderer is sent to foreground before the PurgeAndSuspend signal reaches ...
4 years, 2 months ago (2016-10-19 10:17:13 UTC) #81
haraken
https://codereview.chromium.org/2387603003/diff/280001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/280001/chrome/browser/memory/tab_manager.cc#newcode723 chrome/browser/memory/tab_manager.cc:723: if (tab.last_active > last_modified_time) Instead of adding this if ...
4 years, 2 months ago (2016-10-19 10:40:30 UTC) #82
tasak
https://codereview.chromium.org/2387603003/diff/280001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/280001/chrome/browser/memory/tab_manager.cc#newcode723 chrome/browser/memory/tab_manager.cc:723: if (tab.last_active > last_modified_time) On 2016/10/19 10:40:30, haraken wrote: ...
4 years, 2 months ago (2016-10-20 11:28:47 UTC) #87
altimin
https://codereview.chromium.org/2387603003/diff/300001/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc File third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc (right): https://codereview.chromium.org/2387603003/diff/300001/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc#newcode487 third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc:487: void RendererSchedulerImpl::SuspendRenderer() { I'd like to remind you that ...
4 years, 2 months ago (2016-10-20 11:39:20 UTC) #88
tasak
https://codereview.chromium.org/2387603003/diff/280001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/280001/chrome/browser/memory/tab_manager.cc#newcode723 chrome/browser/memory/tab_manager.cc:723: if (tab.last_active > last_modified_time) On 2016/10/20 11:28:46, tasak wrote: ...
4 years, 2 months ago (2016-10-20 11:47:36 UTC) #89
tasak
https://codereview.chromium.org/2387603003/diff/280001/chrome/browser/memory/tab_manager.cc File chrome/browser/memory/tab_manager.cc (right): https://codereview.chromium.org/2387603003/diff/280001/chrome/browser/memory/tab_manager.cc#newcode723 chrome/browser/memory/tab_manager.cc:723: if (tab.last_active > last_modified_time) On 2016/10/20 11:47:36, tasak wrote: ...
4 years, 2 months ago (2016-10-20 12:35:12 UTC) #92
haraken
PS14 LGTM Chris: Would you mind double-checking if this CL is going in a right ...
4 years, 2 months ago (2016-10-20 16:52:16 UTC) #95
chrisha
4 years, 2 months ago (2016-10-20 21:09:15 UTC) #96
Looks like this is going in the right direction. I'd prefer to see this broken
into several smaller CLs:

- create Resume() functionality inside renderer components.
- expose Resume() on RenderProcessHost.
- Add new fields to WebContentsData.
- Add logic to TabDiscarding.

Would make for shorter, self-contained reviews.

A hearty +1 to haraken's comments.

Powered by Google App Engine
This is Rietveld 408576698