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

Issue 14137016: Lower the priority of shared workers (Closed)

Created:
7 years, 8 months ago by shatch
Modified:
7 years, 6 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org, sail+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Lower the priority of shared workers that aren't associated with the foreground tab. This should help out less powerful devices in the case where there's a shared worker in another tab and a cpu intensive page in the foreground. BUG= TEST=Open a doc, see webworker running, switch tabs and check webworker's priority by outputting contents of /sys/fs/cgroup/cpu/chrome_renderers/background/cgroup.proc on ChromeOS. With an open doc in a background tab, run 720p video (ie. youtube) at fullscreen, should stay fairly smooth. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=199840 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=200932 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=203272

Patch Set 1 #

Patch Set 2 : Added foreground/background check. #

Patch Set 3 : Moved visible check into worker_service_impl. #

Total comments: 16

Patch Set 4 : Changes from review. #

Total comments: 9

Patch Set 5 : Changes from review. #

Patch Set 6 : Move register out of constructor. #

Total comments: 2

Patch Set 7 : Changes from review. #

Patch Set 8 : Fix valgrind. #

Total comments: 4

Patch Set 9 : Changes from review. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+241 lines, -3 lines) Patch
M content/browser/browser_child_process_host_impl.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M content/browser/browser_child_process_host_impl.cc View 1 1 chunk +4 lines, -0 lines 0 comments Download
M content/browser/loader/resource_dispatcher_host_unittest.cc View 1 2 3 4 5 6 7 8 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/worker_host/worker_process_host.h View 1 2 3 4 5 6 7 8 3 chunks +6 lines, -0 lines 0 comments Download
M content/browser/worker_host/worker_process_host.cc View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -1 line 0 comments Download
M content/browser/worker_host/worker_service_impl.h View 1 2 3 4 5 6 7 8 5 chunks +9 lines, -1 line 0 comments Download
M content/browser/worker_host/worker_service_impl.cc View 1 2 3 4 5 6 7 8 5 chunks +206 lines, -1 line 0 comments Download

Messages

Total messages: 52 (0 generated)
shatch
7 years, 8 months ago (2013-04-12 18:49:56 UTC) #1
darin (slow to review)
Can you say more about the design goals? I know the problem that spawned this ...
7 years, 8 months ago (2013-04-12 21:36:03 UTC) #2
tonyg
On 2013/04/12 21:36:03, darin wrote: > Can you say more about the design goals? I ...
7 years, 8 months ago (2013-04-16 15:45:13 UTC) #3
shatch
On 2013/04/16 15:45:13, tonyg wrote: > On 2013/04/12 21:36:03, darin wrote: > > Can you ...
7 years, 8 months ago (2013-04-18 19:13:59 UTC) #4
darin (slow to review)
I was thinking the throttle could be dynamic. It could start out with a delay ...
7 years, 8 months ago (2013-04-18 23:14:29 UTC) #5
shatch
Hi Darin, I gave this implementation a trial run as well, and it suffers from ...
7 years, 8 months ago (2013-04-19 21:54:15 UTC) #6
shatch
New snapshot uploaded with Darin's request for restoring priority on workers if they're associated with ...
7 years, 7 months ago (2013-04-26 01:47:09 UTC) #7
DaveMoore
I think this approach will work on chromeos, but a few things should be noted: ...
7 years, 7 months ago (2013-04-26 17:00:33 UTC) #8
jam
drive by: why do you need to modify chrome and add public content APIs? it ...
7 years, 7 months ago (2013-04-29 06:04:54 UTC) #9
darin (slow to review)
Yeah, I agree with jam@. We should be able to implement this entirely within content/.
7 years, 7 months ago (2013-04-29 15:49:13 UTC) #10
darin (slow to review)
On 2013/04/29 15:49:13, darin wrote: > Yeah, I agree with jam@. We should be able ...
7 years, 7 months ago (2013-04-29 15:57:03 UTC) #11
shatch
On 2013/04/29 15:57:03, darin wrote: > On 2013/04/29 15:49:13, darin wrote: > > Yeah, I ...
7 years, 7 months ago (2013-04-29 16:19:38 UTC) #12
jam
On 2013/04/29 16:19:38, shatch wrote: > On 2013/04/29 15:57:03, darin wrote: > > On 2013/04/29 ...
7 years, 7 months ago (2013-04-29 19:55:17 UTC) #13
shatch
On 2013/04/29 19:55:17, jam wrote: > On 2013/04/29 16:19:38, shatch wrote: > > On 2013/04/29 ...
7 years, 7 months ago (2013-04-29 20:03:53 UTC) #14
jam
On 2013/04/29 20:03:53, shatch wrote: > On 2013/04/29 19:55:17, jam wrote: > > On 2013/04/29 ...
7 years, 7 months ago (2013-04-29 20:40:53 UTC) #15
shatch
On 2013/04/29 20:40:53, jam wrote: > On 2013/04/29 20:03:53, shatch wrote: > > On 2013/04/29 ...
7 years, 7 months ago (2013-04-30 17:34:01 UTC) #16
darin (slow to review)
I think you need to install the Google Docs App: https://chrome.google.com/webstore/detail/google-docs/aohghmighlieiainnegkcijnfilokake On Mon, Apr 29, ...
7 years, 7 months ago (2013-05-01 05:37:09 UTC) #17
jam
ah, it worked with the google drive app and the google docs app (it might ...
7 years, 7 months ago (2013-05-01 19:33:10 UTC) #18
shatch
On 2013/05/01 19:33:10, jam wrote: > ah, it worked with the google drive app and ...
7 years, 7 months ago (2013-05-02 16:44:14 UTC) #19
shatch
RenderWidgetHostView::IsShowing() seems to work fine on ChromeOS, so I moved the logic back into worker_service_impl.cc ...
7 years, 7 months ago (2013-05-03 21:18:08 UTC) #20
shatch
ping So is there anything else needed for this? Jam gave a pass on using ...
7 years, 7 months ago (2013-05-06 19:56:49 UTC) #21
sky
When you ping on a review please indicate who you are waiting on. On Mon, ...
7 years, 7 months ago (2013-05-06 21:10:28 UTC) #22
shatch
Sorry, Darin could you please take a look. Thanks. On 2013/05/06 21:10:28, sky wrote: > ...
7 years, 7 months ago (2013-05-07 22:22:56 UTC) #23
shatch
ping:darin On 2013/05/07 22:22:56, shatch wrote: > Sorry, Darin could you please take a look. ...
7 years, 7 months ago (2013-05-09 15:49:52 UTC) #24
jam
On 2013/05/03 21:18:08, shatch wrote: > RenderWidgetHostView::IsShowing() seems to work fine on ChromeOS, so I ...
7 years, 7 months ago (2013-05-09 15:53:54 UTC) #25
jam
(darin is busy, so I can review on his behalf) https://codereview.chromium.org/14137016/diff/43001/content/browser/browser_child_process_host_impl.h File content/browser/browser_child_process_host_impl.h (right): https://codereview.chromium.org/14137016/diff/43001/content/browser/browser_child_process_host_impl.h#newcode64 ...
7 years, 7 months ago (2013-05-09 18:02:57 UTC) #26
shatch
New snapshot uploaded. https://codereview.chromium.org/14137016/diff/43001/content/browser/browser_child_process_host_impl.h File content/browser/browser_child_process_host_impl.h (right): https://codereview.chromium.org/14137016/diff/43001/content/browser/browser_child_process_host_impl.h#newcode64 content/browser/browser_child_process_host_impl.h:64: void SetBackgrounded(bool backgrounded); On 2013/05/09 18:02:57, ...
7 years, 7 months ago (2013-05-09 22:42:49 UTC) #27
shatch
ping:jam On 2013/05/09 22:42:49, shatch wrote: > New snapshot uploaded. > > https://codereview.chromium.org/14137016/diff/43001/content/browser/browser_child_process_host_impl.h > File ...
7 years, 7 months ago (2013-05-10 23:08:26 UTC) #28
darin (slow to review)
https://codereview.chromium.org/14137016/diff/43001/content/browser/worker_host/worker_service_impl.cc File content/browser/worker_host/worker_service_impl.cc (right): https://codereview.chromium.org/14137016/diff/43001/content/browser/worker_host/worker_service_impl.cc#newcode609 content/browser/worker_host/worker_service_impl.cc:609: content::RenderProcessHost::AllHostsIterator(); nit: like function calls, we usually wrap the ...
7 years, 7 months ago (2013-05-10 23:42:13 UTC) #29
darin (slow to review)
I really like the WorkerPrioritySetter refactoring. LGTM.
7 years, 7 months ago (2013-05-10 23:43:07 UTC) #30
darin (slow to review)
https://codereview.chromium.org/14137016/diff/51003/content/browser/worker_host/worker_service_impl.cc File content/browser/worker_host/worker_service_impl.cc (right): https://codereview.chromium.org/14137016/diff/51003/content/browser/worker_host/worker_service_impl.cc#newcode38 content/browser/worker_host/worker_service_impl.cc:38: public base::RefCountedThreadSafe<WorkerPrioritySetter> { should you indicate a thread on ...
7 years, 7 months ago (2013-05-11 06:02:18 UTC) #31
shatch
New snapshot uploaded. darin: ptal https://codereview.chromium.org/14137016/diff/43001/content/browser/worker_host/worker_service_impl.cc File content/browser/worker_host/worker_service_impl.cc (right): https://codereview.chromium.org/14137016/diff/43001/content/browser/worker_host/worker_service_impl.cc#newcode609 content/browser/worker_host/worker_service_impl.cc:609: content::RenderProcessHost::AllHostsIterator(); On 2013/05/10 23:42:13, ...
7 years, 7 months ago (2013-05-13 17:47:47 UTC) #32
darin (slow to review)
LGTM
7 years, 7 months ago (2013-05-13 18:36:16 UTC) #33
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/simonhatch@chromium.org/14137016/88001
7 years, 7 months ago (2013-05-13 19:19:09 UTC) #34
commit-bot: I haz the power
Change committed as 199840
7 years, 7 months ago (2013-05-13 22:46:26 UTC) #35
shatch
New snapshot uploaded. PTAL This failed a DCHECK(!in_dtor_) on some dbg bots. I think what ...
7 years, 7 months ago (2013-05-14 16:01:25 UTC) #36
shatch
ping:darin On 2013/05/14 16:01:25, shatch wrote: > New snapshot uploaded. PTAL > > > This ...
7 years, 7 months ago (2013-05-15 17:55:41 UTC) #37
shatch
ping:darin On 2013/05/15 17:55:41, shatch wrote: > ping:darin > > On 2013/05/14 16:01:25, shatch wrote: ...
7 years, 7 months ago (2013-05-16 21:35:36 UTC) #38
darin (slow to review)
LGTM This is probably why the style guide recommends keeping constructors simple: http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Doing_Work_in_Constructors#Doing_Work_in_Constructors https://codereview.chromium.org/14137016/diff/127002/content/browser/worker_host/worker_service_impl.cc File ...
7 years, 7 months ago (2013-05-17 00:33:26 UTC) #39
shatch
https://codereview.chromium.org/14137016/diff/127002/content/browser/worker_host/worker_service_impl.cc File content/browser/worker_host/worker_service_impl.cc (right): https://codereview.chromium.org/14137016/diff/127002/content/browser/worker_host/worker_service_impl.cc#newcode234 content/browser/worker_host/worker_service_impl.cc:234: priority_setter_->PostRegisterObserverTask(); On 2013/05/17 00:33:26, darin wrote: > nit: You ...
7 years, 7 months ago (2013-05-17 21:00:46 UTC) #40
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/simonhatch@chromium.org/14137016/155001
7 years, 7 months ago (2013-05-17 21:01:02 UTC) #41
commit-bot: I haz the power
Change committed as 200932
7 years, 7 months ago (2013-05-18 00:14:47 UTC) #42
shatch
New snapshot uploaded. Failed valgrind, priority_setter_ is destructed on UI thread, and needs to be ...
7 years, 7 months ago (2013-05-20 21:22:41 UTC) #43
darin (slow to review)
https://codereview.chromium.org/14137016/diff/189002/content/browser/loader/resource_dispatcher_host_unittest.cc File content/browser/loader/resource_dispatcher_host_unittest.cc (right): https://codereview.chromium.org/14137016/diff/189002/content/browser/loader/resource_dispatcher_host_unittest.cc#newcode596 content/browser/loader/resource_dispatcher_host_unittest.cc:596: WorkerServiceImpl::GetInstance()->PerformUnitTestTeardown(); another approach might have been to register a ...
7 years, 7 months ago (2013-05-24 20:48:40 UTC) #44
jam
https://codereview.chromium.org/14137016/diff/51003/content/browser/worker_host/worker_process_host.h File content/browser/worker_host/worker_process_host.h (right): https://codereview.chromium.org/14137016/diff/51003/content/browser/worker_host/worker_process_host.h#newcode173 content/browser/worker_host/worker_process_host.h:173: bool process_launched() const; to be clear: this should be ...
7 years, 6 months ago (2013-05-28 14:28:29 UTC) #45
shatch
New snapshot uploaded. https://codereview.chromium.org/14137016/diff/51003/content/browser/worker_host/worker_process_host.h File content/browser/worker_host/worker_process_host.h (right): https://codereview.chromium.org/14137016/diff/51003/content/browser/worker_host/worker_process_host.h#newcode173 content/browser/worker_host/worker_process_host.h:173: bool process_launched() const; On 2013/05/28 14:28:30, ...
7 years, 6 months ago (2013-05-28 17:52:12 UTC) #46
jam
https://codereview.chromium.org/14137016/diff/51003/content/browser/worker_host/worker_service_impl.cc File content/browser/worker_host/worker_service_impl.cc (right): https://codereview.chromium.org/14137016/diff/51003/content/browser/worker_host/worker_service_impl.cc#newcode40 content/browser/worker_host/worker_service_impl.cc:40: WorkerPrioritySetter(); On 2013/05/28 17:52:13, shatch wrote: > On 2013/05/28 ...
7 years, 6 months ago (2013-05-28 17:56:17 UTC) #47
darin (slow to review)
LGTM
7 years, 6 months ago (2013-05-29 21:35:53 UTC) #48
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/simonhatch@chromium.org/14137016/220001
7 years, 6 months ago (2013-05-30 15:37:42 UTC) #49
commit-bot: I haz the power
Retried try job too often on linux_aura for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_aura&number=45299
7 years, 6 months ago (2013-05-30 17:36:08 UTC) #50
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/simonhatch@chromium.org/14137016/220001
7 years, 6 months ago (2013-05-30 18:33:29 UTC) #51
commit-bot: I haz the power
7 years, 6 months ago (2013-05-31 00:04:22 UTC) #52
Message was sent while issue was closed.
Change committed as 203272

Powered by Google App Engine
This is Rietveld 408576698