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

Issue 2094583002: Add MemoryCoordinator (Closed)

Created:
4 years, 6 months ago by bashi
Modified:
4 years, 5 months ago
Reviewers:
haraken, chrisha, jam, dcheng
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, nasko+codewatch_chromium.org, creis+watch_chromium.org, qsr+mojo_chromium.org, droger+watchlist_chromium.org, viettrungluu+watch_chromium.org, blundell+watchlist_chromium.org, sdefresne+watchlist_chromium.org, yzshen+watch_chromium.org, abarth-chromium, Aaron Boodman, dglazkov+blink, blink-reviews, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, blink-reviews-api_chromium.org, darin (slow to review), ben+mojo_chromium.org, kinuko+watch
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add MemoryCoordinator This CL adds MemoryCoordinator mojo interface and its implementation. When --enable-features=MemoryCoordinator is specified the browser and renderers create their MemoryCoordinators. MemoryCoordinatorImpl (which lives in the browser process) creates a mojo message pipe when a renderer is launched. This CL doesn't add actual handling of memory events, which will be implemented in follow-up CLs. BUG=617492 Committed: https://crrev.com/066dcbbad57a70ba5380a4a8cdd0572d89bdc279 Cr-Commit-Position: refs/heads/master@{#405402}

Patch Set 1 #

Patch Set 2 : gyp #

Total comments: 15

Patch Set 3 : comment #

Patch Set 4 : Use feature_list #

Total comments: 10

Patch Set 5 : comments #

Patch Set 6 : Changed a way to add child to memory coordinator #

Patch Set 7 : gn #

Total comments: 6

Patch Set 8 : comment #

Total comments: 10

Patch Set 9 : Create handle per child #

Total comments: 12

Patch Set 10 : comment #

Patch Set 11 : Remove state checking #

Total comments: 2

Patch Set 12 : comment #

Patch Set 13 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+340 lines, -33 lines) Patch
M components/memory_coordinator.gypi View 1 2 3 4 5 6 7 8 2 chunks +19 lines, -1 line 0 comments Download
M components/memory_coordinator/DEPS View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A + components/memory_coordinator/browser/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -3 lines 0 comments Download
A components/memory_coordinator/browser/memory_coordinator.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +42 lines, -0 lines 0 comments Download
A components/memory_coordinator/browser/memory_coordinator.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +56 lines, -0 lines 0 comments Download
M components/memory_coordinator/child/BUILD.gn View 1 2 3 4 7 8 1 chunk +5 lines, -1 line 0 comments Download
M components/memory_coordinator/child/child_memory_coordinator_impl.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +14 lines, -6 lines 0 comments Download
M components/memory_coordinator/child/child_memory_coordinator_impl.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +19 lines, -5 lines 0 comments Download
M components/memory_coordinator/child/child_memory_coordinator_impl_unittest.cc View 1 2 3 4 6 7 8 5 chunks +15 lines, -17 lines 0 comments Download
M components/memory_coordinator/common/BUILD.gn View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
A components/memory_coordinator/common/memory_coordinator_features.h View 1 2 3 4 1 chunk +24 lines, -0 lines 0 comments Download
A components/memory_coordinator/common/memory_coordinator_features.cc View 1 2 3 4 1 chunk +24 lines, -0 lines 0 comments Download
M components/memory_coordinator/public/interfaces/BUILD.gn View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
A components/memory_coordinator/public/interfaces/memory_coordinator.mojom View 1 2 3 4 5 6 7 8 1 chunk +14 lines, -0 lines 0 comments Download
M content/browser/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/DEPS View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M content/browser/browser_main_loop.h View 1 2 3 4 5 6 7 8 3 chunks +9 lines, -0 lines 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +7 lines, -0 lines 0 comments Download
A content/browser/memory/memory_coordinator_browsertest.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +36 lines, -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 3 chunks +14 lines, -0 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M content/content_renderer.gypi View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M content/content_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/DEPS View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M content/renderer/render_thread_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -0 lines 0 comments Download
M content/renderer/render_thread_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +10 lines, -0 lines 0 comments Download
M content/test/BUILD.gn View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 66 (14 generated)
bashi
PTAL If this looks ok I'll ask OWNERS reviews.
4 years, 6 months ago (2016-06-23 02:57:10 UTC) #3
bashi
ping?
4 years, 5 months ago (2016-06-27 00:00:21 UTC) #4
haraken
https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/browser/memory_state_notifier.cc File components/memory_coordinator/browser/memory_state_notifier.cc (right): https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/browser/memory_state_notifier.cc#newcode29 components/memory_coordinator/browser/memory_state_notifier.cc:29: int id = GetNextId(); Would you help me understand ...
4 years, 5 months ago (2016-06-27 02:17:07 UTC) #5
bashi
https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/browser/memory_state_notifier.cc File components/memory_coordinator/browser/memory_state_notifier.cc (right): https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/browser/memory_state_notifier.cc#newcode29 components/memory_coordinator/browser/memory_state_notifier.cc:29: int id = GetNextId(); On 2016/06/27 02:17:07, haraken wrote: ...
4 years, 5 months ago (2016-06-27 03:49:29 UTC) #6
haraken
https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/child/blink_memory_coordinator_client.cc File components/memory_coordinator/child/blink_memory_coordinator_client.cc (right): https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/child/blink_memory_coordinator_client.cc#newcode24 components/memory_coordinator/child/blink_memory_coordinator_client.cc:24: blink::WebMemoryCoordinator::setAllocationMode( On 2016/06/27 03:49:29, bashi1 wrote: > On 2016/06/27 ...
4 years, 5 months ago (2016-06-27 04:48:33 UTC) #7
bashi
https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/child/blink_memory_coordinator_client.cc File components/memory_coordinator/child/blink_memory_coordinator_client.cc (right): https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/child/blink_memory_coordinator_client.cc#newcode24 components/memory_coordinator/child/blink_memory_coordinator_client.cc:24: blink::WebMemoryCoordinator::setAllocationMode( On 2016/06/27 04:48:33, haraken wrote: > On 2016/06/27 ...
4 years, 5 months ago (2016-06-27 06:36:46 UTC) #8
haraken
On 2016/06/27 06:36:46, bashi1 wrote: > https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/child/blink_memory_coordinator_client.cc > File components/memory_coordinator/child/blink_memory_coordinator_client.cc > (right): > > https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/child/blink_memory_coordinator_client.cc#newcode24 ...
4 years, 5 months ago (2016-06-27 06:43:15 UTC) #9
bashi
On 2016/06/27 06:43:15, haraken wrote: > On 2016/06/27 06:36:46, bashi1 wrote: > > > https://codereview.chromium.org/2094583002/diff/20001/components/memory_coordinator/child/blink_memory_coordinator_client.cc ...
4 years, 5 months ago (2016-06-27 06:50:55 UTC) #10
haraken
On 2016/06/27 06:50:55, bashi1 wrote: > On 2016/06/27 06:43:15, haraken wrote: > > On 2016/06/27 ...
4 years, 5 months ago (2016-06-27 07:52:11 UTC) #11
bashi
On 2016/06/27 07:52:11, haraken wrote: > On 2016/06/27 06:50:55, bashi1 wrote: > > On 2016/06/27 ...
4 years, 5 months ago (2016-06-27 08:04:22 UTC) #12
haraken
On 2016/06/27 08:04:22, bashi1 wrote: > On 2016/06/27 07:52:11, haraken wrote: > > On 2016/06/27 ...
4 years, 5 months ago (2016-06-27 08:11:21 UTC) #13
bashi
On 2016/06/27 08:11:21, haraken wrote: > On 2016/06/27 08:04:22, bashi1 wrote: > > On 2016/06/27 ...
4 years, 5 months ago (2016-06-27 08:20:02 UTC) #14
haraken
On 2016/06/27 08:20:02, bashi1 wrote: > On 2016/06/27 08:11:21, haraken wrote: > > On 2016/06/27 ...
4 years, 5 months ago (2016-06-27 08:27:15 UTC) #15
bashi
On 2016/06/27 08:27:15, haraken wrote: > On 2016/06/27 08:20:02, bashi1 wrote: > > On 2016/06/27 ...
4 years, 5 months ago (2016-06-27 09:27:42 UTC) #16
bashi
Dropped BlinkMemoryCoordinator. chrisha@: any chance to take a look? https://codereview.chromium.org/2094583002/diff/20001/content/public/common/content_switches.cc File content/public/common/content_switches.cc (right): https://codereview.chromium.org/2094583002/diff/20001/content/public/common/content_switches.cc#newcode410 content/public/common/content_switches.cc:410: ...
4 years, 5 months ago (2016-06-27 10:18:15 UTC) #17
haraken
non-owner LGTM https://codereview.chromium.org/2094583002/diff/60001/components/memory_coordinator/browser/memory_state_notifier.cc File components/memory_coordinator/browser/memory_state_notifier.cc (right): https://codereview.chromium.org/2094583002/diff/60001/components/memory_coordinator/browser/memory_state_notifier.cc#newcode31 components/memory_coordinator/browser/memory_state_notifier.cc:31: &MemoryStateNotifier::RemoveChild, base::Unretained(this), id)); I'm not sure if ...
4 years, 5 months ago (2016-06-27 11:16:01 UTC) #18
chrisha
I don't think the MemoryStateNotifier is what you want or need. It grabs memory pressure ...
4 years, 5 months ago (2016-06-27 20:35:30 UTC) #19
bashi
On 2016/06/27 20:35:30, chrisha (slow) wrote: > I don't think the MemoryStateNotifier is what you ...
4 years, 5 months ago (2016-06-27 22:40:23 UTC) #20
bashi
On 2016/06/27 22:40:23, bashi1 wrote: > The doc I sent previously partially described a roadmap ...
4 years, 5 months ago (2016-06-28 02:32:01 UTC) #22
chrisha
My problem with this CL is the dispatch unconditionally from browser to all child processes. ...
4 years, 5 months ago (2016-06-29 21:15:31 UTC) #23
bashi
On 2016/06/29 21:15:31, chrisha (slow) wrote: > My problem with this CL is the dispatch ...
4 years, 5 months ago (2016-06-30 00:09:00 UTC) #24
chrisha
It will be done by the tab manager refactor, but I'd be uncomfortable turning things ...
4 years, 5 months ago (2016-06-30 03:17:14 UTC) #25
chrisha
It will be done by the tab manager refactor, but I'd be uncomfortable turning things ...
4 years, 5 months ago (2016-06-30 03:17:15 UTC) #26
bashi
On 2016/06/30 03:17:15, chrisha (slow) wrote: > It will be done by the tab manager ...
4 years, 5 months ago (2016-07-01 02:07:44 UTC) #27
bashi
Revised. Chris, WDYT? I made some structural changes: - Added MemoryCoordinator mojo interface to align ...
4 years, 5 months ago (2016-07-01 09:48:23 UTC) #29
bashi
chrisha@: friendly ping :)
4 years, 5 months ago (2016-07-07 01:48:48 UTC) #31
chrisha
A few more questions... https://codereview.chromium.org/2094583002/diff/120001/components/memory_coordinator/child/child_memory_coordinator_impl.h File components/memory_coordinator/child/child_memory_coordinator_impl.h (right): https://codereview.chromium.org/2094583002/diff/120001/components/memory_coordinator/child/child_memory_coordinator_impl.h#newcode28 components/memory_coordinator/child/child_memory_coordinator_impl.h:28: // Reigsters/unregisters a client. Does ...
4 years, 5 months ago (2016-07-07 02:53:44 UTC) #32
bashi
https://codereview.chromium.org/2094583002/diff/120001/components/memory_coordinator/child/child_memory_coordinator_impl.h File components/memory_coordinator/child/child_memory_coordinator_impl.h (right): https://codereview.chromium.org/2094583002/diff/120001/components/memory_coordinator/child/child_memory_coordinator_impl.h#newcode28 components/memory_coordinator/child/child_memory_coordinator_impl.h:28: // Reigsters/unregisters a client. Does not take ownership of ...
4 years, 5 months ago (2016-07-07 03:25:22 UTC) #33
chrisha
Ah, forgive my lack of familiarity with Mojo IPC. lgtm!
4 years, 5 months ago (2016-07-07 15:07:26 UTC) #34
bashi
dcheng@: Could you do IPC security review? (comoponents/memory_coordinator/public/interfaces/memory_coordinator.mojom. This is an empty interface but I'll ...
4 years, 5 months ago (2016-07-07 23:22:16 UTC) #36
haraken
LGTM on my side. https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/browser/memory_coordinator_impl.cc File components/memory_coordinator/browser/memory_coordinator_impl.cc (right): https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/browser/memory_coordinator_impl.cc#newcode17 components/memory_coordinator/browser/memory_coordinator_impl.cc:17: children_.AddPtr(std::move(child)); Don't we need to ...
4 years, 5 months ago (2016-07-08 02:40:26 UTC) #37
bashi
https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/browser/memory_coordinator_impl.cc File components/memory_coordinator/browser/memory_coordinator_impl.cc (right): https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/browser/memory_coordinator_impl.cc#newcode17 components/memory_coordinator/browser/memory_coordinator_impl.cc:17: children_.AddPtr(std::move(child)); On 2016/07/08 02:40:25, haraken wrote: > > Don't ...
4 years, 5 months ago (2016-07-08 02:44:49 UTC) #38
haraken
https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/browser/memory_coordinator_impl.h File components/memory_coordinator/browser/memory_coordinator_impl.h (right): https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/browser/memory_coordinator_impl.h#newcode27 components/memory_coordinator/browser/memory_coordinator_impl.h:27: void IterateChildren(FunctionType function) { On 2016/07/08 02:44:49, bashi1 wrote: ...
4 years, 5 months ago (2016-07-08 02:48:55 UTC) #39
bashi
https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/browser/memory_coordinator_impl.h File components/memory_coordinator/browser/memory_coordinator_impl.h (right): https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/browser/memory_coordinator_impl.h#newcode27 components/memory_coordinator/browser/memory_coordinator_impl.h:27: void IterateChildren(FunctionType function) { On 2016/07/08 02:48:54, haraken wrote: ...
4 years, 5 months ago (2016-07-08 02:51:46 UTC) #40
dcheng
https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/child/child_memory_coordinator_impl.cc File components/memory_coordinator/child/child_memory_coordinator_impl.cc (right): https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/child/child_memory_coordinator_impl.cc#newcode18 components/memory_coordinator/child/child_memory_coordinator_impl.cc:18: binding_.Bind(std::move(request)); I think it is somewhat unusual that we ...
4 years, 5 months ago (2016-07-08 07:10:35 UTC) #41
bashi
https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/child/child_memory_coordinator_impl.cc File components/memory_coordinator/child/child_memory_coordinator_impl.cc (right): https://codereview.chromium.org/2094583002/diff/140001/components/memory_coordinator/child/child_memory_coordinator_impl.cc#newcode18 components/memory_coordinator/child/child_memory_coordinator_impl.cc:18: binding_.Bind(std::move(request)); On 2016/07/08 07:10:35, dcheng wrote: > I think ...
4 years, 5 months ago (2016-07-08 07:32:39 UTC) #42
jam
lgtm
4 years, 5 months ago (2016-07-09 02:35:38 UTC) #43
jam
btw do you want this to work for other process types as well, i.e. not ...
4 years, 5 months ago (2016-07-09 02:36:13 UTC) #44
bashi
On 2016/07/09 02:36:13, jam wrote: > btw do you want this to work for other ...
4 years, 5 months ago (2016-07-10 23:28:38 UTC) #45
bashi
PS#9 changed the way to bind mojo interfaces and its implements. It stops using a ...
4 years, 5 months ago (2016-07-11 04:45:51 UTC) #46
dcheng
https://codereview.chromium.org/2094583002/diff/160001/components/memory_coordinator/browser/memory_coordinator.h File components/memory_coordinator/browser/memory_coordinator.h (right): https://codereview.chromium.org/2094583002/diff/160001/components/memory_coordinator/browser/memory_coordinator.h#newcode23 components/memory_coordinator/browser/memory_coordinator.h:23: void CreateHandle(int id, mojom::MemoryCoordinatorHandleRequest request); Nit: please call this ...
4 years, 5 months ago (2016-07-12 05:20:28 UTC) #47
bashi
Thank you for review! https://codereview.chromium.org/2094583002/diff/160001/components/memory_coordinator/browser/memory_coordinator.h File components/memory_coordinator/browser/memory_coordinator.h (right): https://codereview.chromium.org/2094583002/diff/160001/components/memory_coordinator/browser/memory_coordinator.h#newcode23 components/memory_coordinator/browser/memory_coordinator.h:23: void CreateHandle(int id, mojom::MemoryCoordinatorHandleRequest request); ...
4 years, 5 months ago (2016-07-12 05:51:46 UTC) #48
dcheng
https://codereview.chromium.org/2094583002/diff/160001/components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom File components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom (right): https://codereview.chromium.org/2094583002/diff/160001/components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom#newcode24 components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom:24: GetCurrentStateForTesting() => (MemoryState state); On 2016/07/12 05:51:46, bashi1 wrote: ...
4 years, 5 months ago (2016-07-12 06:10:53 UTC) #49
bashi
https://codereview.chromium.org/2094583002/diff/160001/components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom File components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom (right): https://codereview.chromium.org/2094583002/diff/160001/components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom#newcode24 components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom:24: GetCurrentStateForTesting() => (MemoryState state); On 2016/07/12 06:10:53, dcheng wrote: ...
4 years, 5 months ago (2016-07-12 06:19:25 UTC) #50
bashi
https://codereview.chromium.org/2094583002/diff/160001/components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom File components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom (right): https://codereview.chromium.org/2094583002/diff/160001/components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom#newcode24 components/memory_coordinator/public/interfaces/child_memory_coordinator.mojom:24: GetCurrentStateForTesting() => (MemoryState state); On 2016/07/12 06:19:24, bashi1 wrote: ...
4 years, 5 months ago (2016-07-12 06:38:02 UTC) #51
dcheng
LGTM. I'm not wholly satisfied in terms of clarify of lifetimes here, but that's probably ...
4 years, 5 months ago (2016-07-12 07:44:46 UTC) #52
bashi
> I'm not wholly satisfied in terms of clarify of lifetimes here, but that's > ...
4 years, 5 months ago (2016-07-12 08:36:18 UTC) #53
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/2094583002/240001
4 years, 5 months ago (2016-07-14 01:56:12 UTC) #60
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 5 months ago (2016-07-14 02:03:51 UTC) #62
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-14 02:04:05 UTC) #63
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/066dcbbad57a70ba5380a4a8cdd0572d89bdc279 Cr-Commit-Position: refs/heads/master@{#405402}
4 years, 5 months ago (2016-07-14 02:06:16 UTC) #65
bashi
4 years, 5 months ago (2016-07-14 02:34:50 UTC) #66
Message was sent while issue was closed.
A revert of this CL (patchset #13 id:240001) has been created in
https://codereview.chromium.org/2143353004/ by bashi@chromium.org.

The reason for reverting is: Broke mac build.

Powered by Google App Engine
This is Rietveld 408576698