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

Issue 357583003: Adding observable throttle logic without the signals. Defaults to current behavior. (Closed)

Created:
6 years, 6 months ago by aiolos (Not reviewing)
Modified:
6 years, 5 months ago
CC:
chromium-reviews, darin-cc_chromium.org, jam, groby-ooo-7-16, zhaoqin1
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

This is the first of four (or five) CL's. Step 1) Logic changes in ResourceScheduler::Client. Turns Clients into state machines with possible states of UNTHROTTLED, THROTTLED, COALESCED, and PAUSED. Changes Request throttling behaviors based on Client state, where UNTHROTTLED is the current behavior. Updates Client state based on visibility and audibility, and other input from the ResourceScheduler. Defaults to current behavior in all Clients. Step 2) Logic changes in ResourceScheduler Pipe needed signals between the ResourceScheduler and the Client on: visibility/audibility changes. loading completion. Observable Clients finish loading triggers background clients to load UNTHROTTLED Loading observable Clients triggers all UNTHROTTLED, unobservable clients to load THROTTLED. A request from a non-COALESCED Client, or a heartbeat will trigger Coalesced Clients to load. All requests from a COALESCED Client will coalesce, while non-coalesced clients will not wait for other requests. This will be expanded to listen for network wake ups, but first pass will only take into account the ResourceScheduler network usage. A PAUSED Client will not issue any requests until it transitions into another state. This will be used to limit the number of tabs that are allowed to load at one time. Still defaults to current behavior on all Clients. Step 3) Add the signals for visibility changes, which will turn on throttling. Step 3.5) Add the signals for audibility changes. Step 4) Turn on coalescing. BUG=128035 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=283259

Patch Set 1 #

Patch Set 2 : CL 1: Client specific changes. #

Total comments: 12

Patch Set 3 : nits and such #

Patch Set 4 : missed a nit #

Patch Set 5 : header file fix #

Patch Set 6 : Try 2 on uploading the nits #

Total comments: 20

Patch Set 7 : Testing #

Total comments: 23

Patch Set 8 : nits plus more testing #

Patch Set 9 : Active Loadinf refactor, plus updated testing #

Total comments: 19

Patch Set 10 : More tests and code changes #

Total comments: 8

Patch Set 11 : New test, requested changes. #

Total comments: 57

Patch Set 12 : Next review iteration #

Total comments: 1

Patch Set 13 : Update FullVisibleLoadedCorrectlyUnthrottle test #

Patch Set 14 : Underflow check added. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1491 lines, -61 lines) Patch
M content/browser/loader/resource_scheduler.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +53 lines, -1 line 0 comments Download
M content/browser/loader/resource_scheduler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 11 chunks +254 lines, -21 lines 0 comments Download
M content/browser/loader/resource_scheduler_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 11 chunks +1184 lines, -39 lines 0 comments Download

Messages

Total messages: 69 (0 generated)
aiolos (Not reviewing)
Let me know if there is specific testing you want done on this as well.
6 years, 6 months ago (2014-06-25 20:14:14 UTC) #1
mmenke
On 2014/06/25 20:14:14, aiolos wrote: > Let me know if there is specific testing you ...
6 years, 5 months ago (2014-06-27 14:50:46 UTC) #2
mmenke
Quick style nits. Only significant one (And why I'm sending these comments now, isntead of ...
6 years, 5 months ago (2014-06-27 15:07:35 UTC) #3
aiolos (Not reviewing)
On 2014/06/27 14:50:46, mmenke wrote: > On 2014/06/25 20:14:14, aiolos wrote: > > Let me ...
6 years, 5 months ago (2014-06-27 16:29:29 UTC) #4
aiolos (Not reviewing)
On 2014/06/27 15:07:35, mmenke wrote: > Quick style nits. Only significant one (And why I'm ...
6 years, 5 months ago (2014-06-27 17:04:27 UTC) #5
mmenke
Should have unit tests for this. https://codereview.chromium.org/357583003/diff/100001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/357583003/diff/100001/content/browser/loader/resource_scheduler.cc#newcode234 content/browser/loader/resource_scheduler.cc:234: Client(ResourceScheduler* scheduler) Single ...
6 years, 5 months ago (2014-06-30 19:20:27 UTC) #6
aiolos (Not reviewing)
On 2014/06/30 19:20:27, mmenke wrote: > Should have unit tests for this. All current tests ...
6 years, 5 months ago (2014-06-30 20:48:35 UTC) #7
mmenke
Quick responses. I'll respond to your other responses tomorrow (Just the comments about testing and ...
6 years, 5 months ago (2014-06-30 21:18:15 UTC) #8
aiolos (Not reviewing)
On 2014/06/30 21:18:15, mmenke wrote: > Quick responses. I'll respond to your other responses tomorrow ...
6 years, 5 months ago (2014-06-30 21:54:31 UTC) #9
mmenke
On 2014/06/30 21:54:31, aiolos wrote: > On 2014/06/30 21:18:15, mmenke wrote: > > Quick responses. ...
6 years, 5 months ago (2014-06-30 22:15:27 UTC) #10
mmenke
What are we getting from the 5-second heartbeat that we wouldn't get from just throttling ...
6 years, 5 months ago (2014-07-01 17:25:39 UTC) #11
aiolos (Not reviewing)
On 2014/07/01 17:25:39, mmenke wrote: > What are we getting from the 5-second heartbeat that ...
6 years, 5 months ago (2014-07-01 18:16:42 UTC) #12
mmenke
On 2014/07/01 18:16:42, aiolos wrote: > On 2014/07/01 17:25:39, mmenke wrote: > > What are ...
6 years, 5 months ago (2014-07-01 18:34:32 UTC) #13
aiolos (Not reviewing)
A question I had earlier that I think got lost in the mix is: are ...
6 years, 5 months ago (2014-07-01 19:01:40 UTC) #14
mmenke
On 2014/07/01 19:01:40, aiolos wrote: > A question I had earlier that I think got ...
6 years, 5 months ago (2014-07-01 19:19:06 UTC) #15
aiolos (Not reviewing)
On 2014/07/01 19:01:40, aiolos wrote: > A question I had earlier that I think got ...
6 years, 5 months ago (2014-07-01 19:22:21 UTC) #16
mmenke
On 2014/07/01 19:22:21, aiolos wrote: > On 2014/07/01 19:01:40, aiolos wrote: > > A question ...
6 years, 5 months ago (2014-07-01 19:25:45 UTC) #17
aiolos (Not reviewing)
On 2014/07/01 19:25:45, mmenke wrote: > On 2014/07/01 19:22:21, aiolos wrote: > > On 2014/07/01 ...
6 years, 5 months ago (2014-07-01 19:34:49 UTC) #18
mmenke
On 2014/07/01 19:34:49, aiolos wrote: > On 2014/07/01 19:25:45, mmenke wrote: > > On 2014/07/01 ...
6 years, 5 months ago (2014-07-01 19:36:52 UTC) #19
aiolos (Not reviewing)
For some reason, this doesn't appear to have uploaded last week, or this afternoon. I'm ...
6 years, 5 months ago (2014-07-07 20:27:29 UTC) #20
aiolos (Not reviewing)
On 2014/07/07 20:27:29, aiolos wrote: > For some reason, this doesn't appear to have uploaded ...
6 years, 5 months ago (2014-07-07 20:29:50 UTC) #21
mmenke
On 2014/07/07 20:29:50, aiolos wrote: > On 2014/07/07 20:27:29, aiolos wrote: > > For some ...
6 years, 5 months ago (2014-07-07 20:36:42 UTC) #22
mmenke
I still need to carefully go over the tests, but at a glance, they look ...
6 years, 5 months ago (2014-07-08 19:37:41 UTC) #23
aiolos (Not reviewing)
> https://codereview.chromium.org/357583003/diff/120001/content/browser/loader/resource_scheduler.cc#newcode807 > content/browser/loader/resource_scheduler.cc:807: if (was_active == > client->is_active() || client->is_loaded()) { > These extra ...
6 years, 5 months ago (2014-07-08 20:07:45 UTC) #24
mmenke
On 2014/07/08 20:07:45, aiolos wrote: > > > https://codereview.chromium.org/357583003/diff/120001/content/browser/loader/resource_scheduler.cc#newcode807 > > content/browser/loader/resource_scheduler.cc:807: if (was_active == ...
6 years, 5 months ago (2014-07-08 20:32:12 UTC) #25
aiolos (Not reviewing)
On 2014/07/08 20:32:12, mmenke wrote: > On 2014/07/08 20:07:45, aiolos wrote: > > > > ...
6 years, 5 months ago (2014-07-08 21:27:21 UTC) #26
mmenke
On 2014/07/08 21:27:21, aiolos wrote: > On 2014/07/08 20:32:12, mmenke wrote: > > On 2014/07/08 ...
6 years, 5 months ago (2014-07-08 21:36:11 UTC) #27
mmenke
On 2014/07/08 21:36:11, mmenke wrote: > On 2014/07/08 21:27:21, aiolos wrote: > > On 2014/07/08 ...
6 years, 5 months ago (2014-07-08 21:45:02 UTC) #28
mmenke
On 2014/07/08 21:45:02, mmenke wrote: > Anyhow, I did suggest a way to avoid walking ...
6 years, 5 months ago (2014-07-08 22:24:27 UTC) #29
aiolos (Not reviewing)
On 2014/07/08 22:24:27, mmenke wrote: > On 2014/07/08 21:45:02, mmenke wrote: > > Anyhow, I ...
6 years, 5 months ago (2014-07-08 23:33:39 UTC) #30
mmenke
On 2014/07/08 23:33:39, aiolos wrote: > On 2014/07/08 22:24:27, mmenke wrote: > > On 2014/07/08 ...
6 years, 5 months ago (2014-07-08 23:56:28 UTC) #31
aiolos (Not reviewing)
On 2014/07/08 23:56:28, mmenke wrote: > On 2014/07/08 23:33:39, aiolos wrote: > > On 2014/07/08 ...
6 years, 5 months ago (2014-07-09 00:08:22 UTC) #32
mmenke
On 2014/07/09 00:08:22, aiolos wrote: > On 2014/07/08 23:56:28, mmenke wrote: > > On 2014/07/08 ...
6 years, 5 months ago (2014-07-09 00:10:45 UTC) #33
aiolos (Not reviewing)
On 2014/07/09 00:10:45, mmenke wrote: > On 2014/07/09 00:08:22, aiolos wrote: > > On 2014/07/08 ...
6 years, 5 months ago (2014-07-09 18:08:23 UTC) #34
aiolos (Not reviewing)
On 2014/07/09 18:08:23, aiolos wrote: > On 2014/07/09 00:10:45, mmenke wrote: > > On 2014/07/09 ...
6 years, 5 months ago (2014-07-09 18:29:03 UTC) #35
aiolos (Not reviewing)
On 2014/07/09 18:29:03, aiolos wrote: > On 2014/07/09 18:08:23, aiolos wrote: > > On 2014/07/09 ...
6 years, 5 months ago (2014-07-09 22:25:57 UTC) #36
mmenke
I plan to carefully go over the tests this afternoon. https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.cc#newcode298 ...
6 years, 5 months ago (2014-07-10 15:28:52 UTC) #37
mmenke
Oh, and I should say, I'm pretty happy with this.
6 years, 5 months ago (2014-07-10 15:29:08 UTC) #38
mmenke
Two quick naming comments. https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.cc#newcode400 content/browser/loader/resource_scheduler.cc:400: void ClientIsLoaded(bool loaded) { On ...
6 years, 5 months ago (2014-07-10 15:35:38 UTC) #39
aiolos (Not reviewing)
> > https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.cc#newcode487 > content/browser/loader/resource_scheduler.cc:487: // * Non-HTTP[S] requests. > None of these are true ...
6 years, 5 months ago (2014-07-10 16:13:53 UTC) #40
mmenke
On 2014/07/10 16:13:53, aiolos wrote: > > > > > https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.cc#newcode487 > > content/browser/loader/resource_scheduler.cc:487: // ...
6 years, 5 months ago (2014-07-10 16:43:11 UTC) #41
mmenke
Oh, and one other important issue. https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.cc#newcode242 content/browser/loader/resource_scheduler.cc:242: ~Client() {} You ...
6 years, 5 months ago (2014-07-10 16:44:20 UTC) #42
aiolos (Not reviewing)
> https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.cc#newcode537 > content/browser/loader/resource_scheduler.cc:537: if (throttle_state_ == > THROTTLED && > Think this should be ...
6 years, 5 months ago (2014-07-10 17:10:22 UTC) #43
mmenke
On 2014/07/10 17:10:22, aiolos wrote: > > > https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.cc#newcode537 > > content/browser/loader/resource_scheduler.cc:537: if (throttle_state_ == ...
6 years, 5 months ago (2014-07-10 17:25:08 UTC) #44
aiolos (Not reviewing)
> https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.h > File content/browser/loader/resource_scheduler.h (right): > > https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.h#newcode69 > content/browser/loader/resource_scheduler.h:69: ACTIVE_LOADING, > nit: ACTIVELY_LOADING ...
6 years, 5 months ago (2014-07-10 17:35:58 UTC) #45
mmenke
On 2014/07/10 17:35:58, aiolos wrote: > > > https://codereview.chromium.org/357583003/diff/160001/content/browser/loader/resource_scheduler.h > > File content/browser/loader/resource_scheduler.h (right): > ...
6 years, 5 months ago (2014-07-10 17:46:42 UTC) #46
aiolos (Not reviewing)
On 2014/07/10 17:46:42, mmenke wrote: > On 2014/07/10 17:35:58, aiolos wrote: > > > > ...
6 years, 5 months ago (2014-07-10 17:48:04 UTC) #47
aiolos (Not reviewing)
I added the requested tests, plus the following: UNTHROTTLED and ACTIVE_AND_LOADING versions of the Sync ...
6 years, 5 months ago (2014-07-10 19:24:09 UTC) #48
mmenke
Still haven't had a chance to go through all the tests, but don't expect to ...
6 years, 5 months ago (2014-07-10 19:37:36 UTC) #49
aiolos (Not reviewing)
On 2014/07/10 19:37:36, mmenke wrote: > Still haven't had a chance to go through all ...
6 years, 5 months ago (2014-07-10 20:13:33 UTC) #50
aiolos (Not reviewing)
On 2014/07/10 20:13:33, aiolos wrote: > On 2014/07/10 19:37:36, mmenke wrote: > > Still haven't ...
6 years, 5 months ago (2014-07-11 16:12:43 UTC) #51
mmenke
Sorry for not getting to this last week. Was busier as a sheriff than I ...
6 years, 5 months ago (2014-07-14 15:47:21 UTC) #52
aiolos (Not reviewing)
https://codereview.chromium.org/357583003/diff/200001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/357583003/diff/200001/content/browser/loader/resource_scheduler.cc#newcode492 content/browser/loader/resource_scheduler.cc:492: // for scheduleing purposes in UNTHROTTLED and ACTIVE_AND_LOADING cilents. ...
6 years, 5 months ago (2014-07-14 16:48:21 UTC) #53
aiolos (Not reviewing)
https://codereview.chromium.org/357583003/diff/200001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/357583003/diff/200001/content/browser/loader/resource_scheduler.cc#newcode281 content/browser/loader/resource_scheduler.cc:281: void OnLoadingStateChanged(bool loaded) { On 2014/07/14 15:47:20, mmenke wrote: ...
6 years, 5 months ago (2014-07-14 19:22:57 UTC) #54
mmenke
https://codereview.chromium.org/357583003/diff/200001/content/browser/loader/resource_scheduler.cc File content/browser/loader/resource_scheduler.cc (right): https://codereview.chromium.org/357583003/diff/200001/content/browser/loader/resource_scheduler.cc#newcode815 content/browser/loader/resource_scheduler.cc:815: DCHECK(loading_active_clients_ >= 0); On 2014/07/14 19:22:55, aiolos wrote: > ...
6 years, 5 months ago (2014-07-14 19:38:12 UTC) #55
aiolos (Not reviewing)
On 2014/07/14 19:38:12, mmenke wrote: > https://codereview.chromium.org/357583003/diff/200001/content/browser/loader/resource_scheduler.cc > File content/browser/loader/resource_scheduler.cc (right): > > https://codereview.chromium.org/357583003/diff/200001/content/browser/loader/resource_scheduler.cc#newcode815 > ...
6 years, 5 months ago (2014-07-14 20:37:00 UTC) #56
mmenke
On 2014/07/14 20:37:00, aiolos wrote: > On 2014/07/14 19:38:12, mmenke wrote: > > > https://codereview.chromium.org/357583003/diff/200001/content/browser/loader/resource_scheduler.cc ...
6 years, 5 months ago (2014-07-14 20:41:29 UTC) #57
aiolos (Not reviewing)
On 2014/07/14 20:41:29, mmenke wrote: > On 2014/07/14 20:37:00, aiolos wrote: > > On 2014/07/14 ...
6 years, 5 months ago (2014-07-14 20:44:22 UTC) #58
aiolos (Not reviewing)
On 2014/07/14 20:44:22, aiolos wrote: > On 2014/07/14 20:41:29, mmenke wrote: > > On 2014/07/14 ...
6 years, 5 months ago (2014-07-15 01:29:22 UTC) #59
mmenke
Sorry, didn't realize you'd updated the CL after set 12. LGTM!
6 years, 5 months ago (2014-07-15 14:55:15 UTC) #60
mmenke
On 2014/07/15 14:55:15, mmenke wrote: > Sorry, didn't realize you'd updated the CL after set ...
6 years, 5 months ago (2014-07-15 14:57:05 UTC) #61
aiolos (Not reviewing)
The CQ bit was checked by aiolos@chromium.org
6 years, 5 months ago (2014-07-15 15:24:13 UTC) #62
aiolos (Not reviewing)
On 2014/07/15 14:57:05, mmenke wrote: > On 2014/07/15 14:55:15, mmenke wrote: > > Sorry, didn't ...
6 years, 5 months ago (2014-07-15 15:25:49 UTC) #63
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/aiolos@chromium.org/357583003/240001
6 years, 5 months ago (2014-07-15 15:26:23 UTC) #64
commit-bot: I haz the power
Change committed as 283259
6 years, 5 months ago (2014-07-15 22:30:59 UTC) #65
Alexander Potapenko
On 2014/07/15 22:30:59, I haz the power (commit-bot) wrote: > Change committed as 283259 This ...
6 years, 5 months ago (2014-07-16 15:10:34 UTC) #66
aiolos (Not reviewing)
On 2014/07/16 15:10:34, Alexander Potapenko wrote: > On 2014/07/15 22:30:59, I haz the power (commit-bot) ...
6 years, 5 months ago (2014-07-16 16:30:27 UTC) #67
aiolos (Not reviewing)
On 2014/07/16 16:30:27, aiolos wrote: > On 2014/07/16 15:10:34, Alexander Potapenko wrote: > > On ...
6 years, 5 months ago (2014-07-16 17:22:10 UTC) #68
mmenke
6 years, 5 months ago (2014-07-16 17:38:33 UTC) #69
Message was sent while issue was closed.
On 2014/07/16 17:22:10, aiolos wrote:
> On 2014/07/16 16:30:27, aiolos wrote:
> > On 2014/07/16 15:10:34, Alexander Potapenko wrote:
> > > On 2014/07/15 22:30:59, I haz the power (commit-bot) wrote:
> > > > Change committed as 283259
> > > 
> > > This CL has broken the whole bunch of DrMemory bots. They're reporting
> errors
> > > like the following one:
> > > 
> > > UNINITIALIZED READ: reading 0x033682f8-0x033682f9 1 byte(s)
> > > # 0 content.dll!content::ResourceScheduler::Client::UpdateThrottleState   
 
>  
> > > [content\browser\loader\resource_scheduler.cc:313]
> > > # 1 content.dll!content::ResourceScheduler::OnClientDeleted               
 
>  
> > > [content\browser\loader\resource_scheduler.cc:723]
> > > # 2
content.dll!content::ResourceDispatcherHostImpl::OnRenderViewHostDeleted
>  
> > > [content\browser\loader\resource_dispatcher_host_impl.cc:1332]
> > > # 3 content.dll!base::internal::Invoker<>::Run                            
 
>  
> > > [base\bind_internal.h:1383]
> > > # 4 base.dll!base::MessageLoop::RunTask                                   
 
>  
> > > [base\message_loop\message_loop.cc:458]
> > > # 5 base.dll!base::MessageLoop::DeferOrRunPendingTask                     
 
>  
> > > [base\message_loop\message_loop.cc:470]
> > > # 6 base.dll!base::MessageLoop::DoWork                                    
 
>  
> > > [base\message_loop\message_loop.cc:584]
> > > # 7 base.dll!base::MessagePumpForIO::DoRunLoop                            
 
>  
> > > [base\message_loop\message_pump_win.cc:498]
> > > # 8 base.dll!base::MessagePumpWin::Run                                    
 
>  
> > > [base\message_loop\message_pump_win.h:47]
> > > # 9 base.dll!base::MessageLoop::RunHandler                                
 
>  
> > > [base\message_loop\message_loop.cc:408]
> > > #10 base.dll!base::Thread::Run                                            
 
>  
> > > [base\threading\thread.cc:174]
> > > #11 content.dll!content::BrowserThreadImpl::IOThreadRun                   
 
>  
> > > [content\browser\browser_thread_impl.cc:217]
> > > #12 content.dll!content::BrowserThreadImpl::Run                           
 
>  
> > > [content\browser\browser_thread_impl.cc:252]
> > > #13 base.dll!base::Thread::ThreadMain                                     
 
>  
> > > [base\threading\thread.cc:228]
> > > #14 base.dll!base::`anonymous namespace'::ThreadFunc                      
 
>  
> > > [base\threading\platform_thread_win.cc:78]
> > > #15 KERNEL32.dll!BaseThreadInitThunk                                      
 
> 
> > > +0x11     (0x75cb338a <KERNEL32.dll+0x1338a>)
> > > Note: @0:01:39.495 in thread 3924
> > > Note: instruction: cmp    (%eax) $0x00
> > > The report came from the `PluginTest.ResizeDuringPaint` test.
> > 
> > Thanks, found the cause. It's an easy fix, I'm changing the tests so we
would
> > have caught this.
> 
> Is there a bug number for that? Change here:
> https://codereview.chromium.org/391393002/

Bug looks to be http://crbug.com/394390

Powered by Google App Engine
This is Rietveld 408576698