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

Issue 2370753002: Make TabLoader a client of memory coordinator (Closed)

Created:
4 years, 2 months ago by hajimehoshi
Modified:
4 years, 1 month ago
Reviewers:
haraken, chrisha, sky, bashi
CC:
chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make TabLoader a client of memory coordinator When the memory coordinator is enabled, TabLoader becomes a client of the memory coordinator instead of installing MemoryPressureListener. Design Doc: https://docs.google.com/document/d/1a69mMr7jI7qK0OfKNlrZ350xiXizVMCCe8orGX7K8Uo/edit?ts=57d7968b# BUG=639700 Committed: https://crrev.com/30b8b607a1d2ac63038383685d8eedf44acb0447 Cr-Commit-Position: refs/heads/master@{#427603}

Patch Set 1 #

Total comments: 8

Patch Set 2 : Address on reviews #

Patch Set 3 : Add comments #

Total comments: 3

Patch Set 4 : Use MemoryCoordinatorProxy #

Unified diffs Side-by-side diffs Delta from patch set Stats (+51 lines, -21 lines) Patch
M chrome/browser/sessions/tab_loader.h View 1 2 3 3 chunks +12 lines, -4 lines 0 comments Download
M chrome/browser/sessions/tab_loader.cc View 1 2 3 6 chunks +39 lines, -17 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 45 (15 generated)
hajimehoshi
PTAL
4 years, 2 months ago (2016-09-26 11:39:44 UTC) #2
chrisha
https://codereview.chromium.org/2370753002/diff/1/chrome/browser/sessions/tab_loader.cc File chrome/browser/sessions/tab_loader.cc (right): https://codereview.chromium.org/2370753002/diff/1/chrome/browser/sessions/tab_loader.cc#newcode276 chrome/browser/sessions/tab_loader.cc:276: void TabLoader::PurgeMemory() { PurgeMemory isn't the best name here, ...
4 years, 2 months ago (2016-09-26 14:18:54 UTC) #3
sky
https://codereview.chromium.org/2370753002/diff/1/chrome/browser/sessions/tab_loader.cc File chrome/browser/sessions/tab_loader.cc (right): https://codereview.chromium.org/2370753002/diff/1/chrome/browser/sessions/tab_loader.cc#newcode84 chrome/browser/sessions/tab_loader.cc:84: memory_state_(base::MemoryState::NORMAL), Should this be initialized to the real value? ...
4 years, 2 months ago (2016-09-26 16:41:57 UTC) #4
hajimehoshi
Thank you! https://codereview.chromium.org/2370753002/diff/1/chrome/browser/sessions/tab_loader.cc File chrome/browser/sessions/tab_loader.cc (right): https://codereview.chromium.org/2370753002/diff/1/chrome/browser/sessions/tab_loader.cc#newcode84 chrome/browser/sessions/tab_loader.cc:84: memory_state_(base::MemoryState::NORMAL), On 2016/09/26 16:41:57, sky wrote: > ...
4 years, 2 months ago (2016-09-27 05:59:16 UTC) #5
bashi
https://codereview.chromium.org/2370753002/diff/1/chrome/browser/sessions/tab_loader.cc File chrome/browser/sessions/tab_loader.cc (right): https://codereview.chromium.org/2370753002/diff/1/chrome/browser/sessions/tab_loader.cc#newcode84 chrome/browser/sessions/tab_loader.cc:84: memory_state_(base::MemoryState::NORMAL), On 2016/09/27 05:59:16, hajimehoshi wrote: > On 2016/09/26 ...
4 years, 2 months ago (2016-09-29 06:30:52 UTC) #6
chrisha
On 2016/09/29 06:30:52, bashi1 wrote: > https://codereview.chromium.org/2370753002/diff/1/chrome/browser/sessions/tab_loader.cc > File chrome/browser/sessions/tab_loader.cc (right): > > https://codereview.chromium.org/2370753002/diff/1/chrome/browser/sessions/tab_loader.cc#newcode84 > ...
4 years, 2 months ago (2016-09-29 15:09:21 UTC) #7
bashi
On 2016/09/29 15:09:21, chrisha (slow) wrote: > On 2016/09/29 06:30:52, bashi1 wrote: > > > ...
4 years, 2 months ago (2016-09-29 22:58:38 UTC) #8
hajimehoshi
On 2016/09/29 22:58:38, bashi1 wrote: > On 2016/09/29 15:09:21, chrisha (slow) wrote: > > On ...
4 years, 2 months ago (2016-09-30 04:40:10 UTC) #9
hajimehoshi
+haraken
4 years, 2 months ago (2016-09-30 04:40:42 UTC) #12
haraken
On 2016/09/30 04:40:10, hajimehoshi wrote: > On 2016/09/29 22:58:38, bashi1 wrote: > > On 2016/09/29 ...
4 years, 2 months ago (2016-09-30 05:27:21 UTC) #13
hajimehoshi
On 2016/09/30 05:27:21, haraken wrote: > On 2016/09/30 04:40:10, hajimehoshi wrote: > > On 2016/09/29 ...
4 years, 2 months ago (2016-09-30 05:37:51 UTC) #14
bashi
On 2016/09/30 05:37:51, hajimehoshi wrote: > On 2016/09/30 05:27:21, haraken wrote: > > On 2016/09/30 ...
4 years, 2 months ago (2016-09-30 05:48:54 UTC) #15
chrisha
lgtm with a TODO to move this to MC
4 years, 2 months ago (2016-10-07 13:04:00 UTC) #16
hajimehoshi
On 2016/10/07 13:04:00, chrisha (slow) wrote: > lgtm with a TODO to move this to ...
4 years, 2 months ago (2016-10-11 07:29:53 UTC) #17
haraken
https://codereview.chromium.org/2370753002/diff/40001/chrome/browser/sessions/tab_loader.h File chrome/browser/sessions/tab_loader.h (right): https://codereview.chromium.org/2370753002/diff/40001/chrome/browser/sessions/tab_loader.h#newcode130 chrome/browser/sessions/tab_loader.h:130: base::MemoryState memory_state_; Is it hard to implement the API ...
4 years, 2 months ago (2016-10-11 08:36:23 UTC) #22
hajimehoshi
On 2016/10/11 08:36:23, haraken wrote: > https://codereview.chromium.org/2370753002/diff/40001/chrome/browser/sessions/tab_loader.h > File chrome/browser/sessions/tab_loader.h (right): > > https://codereview.chromium.org/2370753002/diff/40001/chrome/browser/sessions/tab_loader.h#newcode130 > ...
4 years, 2 months ago (2016-10-11 11:07:24 UTC) #23
sky
https://codereview.chromium.org/2370753002/diff/40001/chrome/browser/sessions/tab_loader.h File chrome/browser/sessions/tab_loader.h (right): https://codereview.chromium.org/2370753002/diff/40001/chrome/browser/sessions/tab_loader.h#newcode130 chrome/browser/sessions/tab_loader.h:130: base::MemoryState memory_state_; On 2016/10/11 08:36:23, haraken wrote: > > ...
4 years, 2 months ago (2016-10-11 17:47:42 UTC) #24
hajimehoshi
Thank you! https://codereview.chromium.org/2370753002/diff/40001/chrome/browser/sessions/tab_loader.h File chrome/browser/sessions/tab_loader.h (right): https://codereview.chromium.org/2370753002/diff/40001/chrome/browser/sessions/tab_loader.h#newcode130 chrome/browser/sessions/tab_loader.h:130: base::MemoryState memory_state_; On 2016/10/11 17:47:42, sky wrote: ...
4 years, 1 month ago (2016-10-24 10:16:57 UTC) #25
haraken
LGTM
4 years, 1 month ago (2016-10-24 11:34:05 UTC) #28
bashi
lgtm
4 years, 1 month ago (2016-10-24 23:23:02 UTC) #31
sky
Is there test coverage of this? Can existing tests be made to trigger the new ...
4 years, 1 month ago (2016-10-25 02:57:14 UTC) #32
hajimehoshi
On 2016/10/25 02:57:14, sky wrote: > Is there test coverage of this? Can existing tests ...
4 years, 1 month ago (2016-10-25 08:32:51 UTC) #33
bashi
On 2016/10/25 08:32:51, hajimehoshi wrote: > On 2016/10/25 02:57:14, sky wrote: > > Is there ...
4 years, 1 month ago (2016-10-25 08:53:01 UTC) #34
haraken
On 2016/10/25 08:53:01, bashi1 wrote: > On 2016/10/25 08:32:51, hajimehoshi wrote: > > On 2016/10/25 ...
4 years, 1 month ago (2016-10-25 09:29:59 UTC) #35
sky
LGTM - I would prefer the test first, but I don't want to hold you ...
4 years, 1 month ago (2016-10-25 16:51:21 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2370753002/60001
4 years, 1 month ago (2016-10-26 05:02:26 UTC) #39
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 1 month ago (2016-10-26 05:54:48 UTC) #41
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/30b8b607a1d2ac63038383685d8eedf44acb0447 Cr-Commit-Position: refs/heads/master@{#427603}
4 years, 1 month ago (2016-10-26 05:57:02 UTC) #43
hajimehoshi
sky: Hmm, I have struggled with implementing tests, but am stuck with it. For unit ...
4 years, 1 month ago (2016-10-31 09:19:24 UTC) #44
sky
4 years, 1 month ago (2016-10-31 15:25:13 UTC) #45
Message was sent while issue was closed.
TabLoader was refactored out of session restore code. TabLoader is
indirectly tested by various session restore code. It seems like you
should be able to write a test uses TabLoader directly, e.g. do what
session restore does: call TabLoader::RestoreTabs. For the case you
care about, changing memory pressure, it seems as though you should be
able to call OnMemoryStateChange() and make sure the right thing
happens.

  -Scott

On Mon, Oct 31, 2016 at 2:19 AM,  <hajimehoshi@chromium.org> wrote:
> sky: Hmm, I have struggled with implementing tests, but am stuck with it.
>
> For unit tests, TabLoader is not a self-contained class and it seems very
> difficult to write this. On the other hand, for browser tests, I have no
> idea
> how to access a TabLoader and how to initialize the flag
> --memory-coordinator
> before the browser main loop starts.
>
> In the first place, there seems no tests for TabLoader in the code base.
> Would
> you give me an advice how to add a test for TabLoader?
>
> https://codereview.chromium.org/2370753002/

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698