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

Issue 2565323002: Stop using callbacks in MemoryCoordinatorProxy (Closed)

Created:
4 years ago by bashi
Modified:
3 years, 9 months ago
Reviewers:
haraken, chrisha, jam, sky, dcheng
CC:
chromium-reviews, jam, darin-cc_chromium.org, gavinp+memory_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Stop using callbacks in MemoryCoordinatorProxy Before this CL, we passed callbacks to MemoryCoordinatorProxy to inject logic from content/ to base/. In this design we have to write a lot of boilerplate code to expose another logic to base/. Stop using callbacks and use an interface class to avoid such boilerplate code. We are planning to add another method to MemoryCoordinatorProxy so that we can show the state of each process in the task manager. Also, this CL changes GetCurrentMemoryState() to GetLocalMemoryState() as haraken@ suggested[1]. [1] https://codereview.chromium.org/2564623004/diff/1/content/browser/memory/memory_coordinator.cc#newcode91 BUG=673216

Patch Set 1 #

Total comments: 4

Patch Set 2 : fix #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -105 lines) Patch
M base/memory/memory_coordinator_proxy.h View 2 chunks +20 lines, -16 lines 9 comments Download
M base/memory/memory_coordinator_proxy.cc View 1 chunk +11 lines, -16 lines 0 comments Download
M chrome/browser/sessions/tab_loader.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sessions/tab_loader_unittest.cc View 1 1 chunk +1 line, -1 line 0 comments Download
M content/browser/browser_main_loop.cc View 1 chunk +2 lines, -10 lines 0 comments Download
M content/browser/memory/memory_coordinator.h View 2 chunks +2 lines, -7 lines 1 comment Download
M content/browser/memory/memory_coordinator.cc View 1 1 chunk +4 lines, -6 lines 0 comments Download
M content/browser/memory/memory_coordinator_impl.h View 1 chunk +13 lines, -7 lines 1 comment Download
M content/browser/memory/memory_coordinator_impl.cc View 3 chunks +8 lines, -3 lines 0 comments Download
M content/browser/memory/memory_coordinator_impl_unittest.cc View 5 chunks +20 lines, -29 lines 0 comments Download
M content/browser/renderer_host/renderer_frame_manager.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/public/test/memory_coordinator_test_utils.cc View 1 chunk +2 lines, -8 lines 0 comments Download

Messages

Total messages: 34 (11 generated)
bashi
What do you think about this change? I'm trying to expose a method which returns ...
4 years ago (2016-12-12 06:45:57 UTC) #5
haraken
LGTM https://codereview.chromium.org/2565323002/diff/1/base/memory/memory_coordinator_proxy.h File base/memory/memory_coordinator_proxy.h (right): https://codereview.chromium.org/2565323002/diff/1/base/memory/memory_coordinator_proxy.h#newcode40 base/memory/memory_coordinator_proxy.h:40: void SetMemoryStateForTesting(MemoryState memory_state); This sets the global memory ...
4 years ago (2016-12-12 06:51:57 UTC) #6
bashi
https://codereview.chromium.org/2565323002/diff/1/base/memory/memory_coordinator_proxy.h File base/memory/memory_coordinator_proxy.h (right): https://codereview.chromium.org/2565323002/diff/1/base/memory/memory_coordinator_proxy.h#newcode40 base/memory/memory_coordinator_proxy.h:40: void SetMemoryStateForTesting(MemoryState memory_state); On 2016/12/12 06:51:57, haraken wrote: > ...
4 years ago (2016-12-12 07:17:55 UTC) #11
bashi
+sky@ chrome/browser/sessions +jam@ for content/ +dcheng@ for base/
4 years ago (2016-12-12 07:23:11 UTC) #13
haraken
On 2016/12/12 07:17:55, bashi1 wrote: > https://codereview.chromium.org/2565323002/diff/1/base/memory/memory_coordinator_proxy.h > File base/memory/memory_coordinator_proxy.h (right): > > https://codereview.chromium.org/2565323002/diff/1/base/memory/memory_coordinator_proxy.h#newcode40 > ...
4 years ago (2016-12-12 07:26:19 UTC) #14
dcheng
https://codereview.chromium.org/2565323002/diff/20001/base/memory/memory_coordinator_proxy.h File base/memory/memory_coordinator_proxy.h (right): https://codereview.chromium.org/2565323002/diff/20001/base/memory/memory_coordinator_proxy.h#newcode21 base/memory/memory_coordinator_proxy.h:21: virtual MemoryState GetLocalMemoryState() = 0; Two nits: 1) I ...
4 years ago (2016-12-12 07:27:07 UTC) #15
bashi
On 2016/12/12 07:26:19, haraken wrote: > On 2016/12/12 07:17:55, bashi1 wrote: > > > https://codereview.chromium.org/2565323002/diff/1/base/memory/memory_coordinator_proxy.h ...
4 years ago (2016-12-12 07:31:36 UTC) #16
bashi
https://codereview.chromium.org/2565323002/diff/20001/base/memory/memory_coordinator_proxy.h File base/memory/memory_coordinator_proxy.h (right): https://codereview.chromium.org/2565323002/diff/20001/base/memory/memory_coordinator_proxy.h#newcode21 base/memory/memory_coordinator_proxy.h:21: virtual MemoryState GetLocalMemoryState() = 0; On 2016/12/12 07:27:07, dcheng ...
4 years ago (2016-12-12 07:38:39 UTC) #17
haraken
On 2016/12/12 07:31:36, bashi1 wrote: > On 2016/12/12 07:26:19, haraken wrote: > > On 2016/12/12 ...
4 years ago (2016-12-12 07:39:11 UTC) #18
bashi
On 2016/12/12 07:39:11, haraken wrote: > On 2016/12/12 07:31:36, bashi1 wrote: > > On 2016/12/12 ...
4 years ago (2016-12-12 07:40:43 UTC) #19
bashi
On 2016/12/12 07:40:43, bashi1 wrote: > On 2016/12/12 07:39:11, haraken wrote: > > On 2016/12/12 ...
4 years ago (2016-12-12 07:41:37 UTC) #20
haraken
On 2016/12/12 07:40:43, bashi1 wrote: > On 2016/12/12 07:39:11, haraken wrote: > > On 2016/12/12 ...
4 years ago (2016-12-12 07:42:26 UTC) #21
bashi
On 2016/12/12 07:42:26, haraken wrote: > On 2016/12/12 07:40:43, bashi1 wrote: > > On 2016/12/12 ...
4 years ago (2016-12-12 07:44:28 UTC) #22
haraken
On 2016/12/12 07:44:28, bashi1 wrote: > On 2016/12/12 07:42:26, haraken wrote: > > On 2016/12/12 ...
4 years ago (2016-12-12 07:45:47 UTC) #23
bashi
On 2016/12/12 07:45:47, haraken wrote: > On 2016/12/12 07:44:28, bashi1 wrote: > > On 2016/12/12 ...
4 years ago (2016-12-12 07:51:45 UTC) #24
haraken
On 2016/12/12 07:51:45, bashi1 wrote: > On 2016/12/12 07:45:47, haraken wrote: > > On 2016/12/12 ...
4 years ago (2016-12-12 08:03:50 UTC) #25
bashi
On 2016/12/12 08:03:50, haraken wrote: > On 2016/12/12 07:51:45, bashi1 wrote: > > On 2016/12/12 ...
4 years ago (2016-12-12 08:10:53 UTC) #26
haraken
On 2016/12/12 08:10:53, bashi1 wrote: > On 2016/12/12 08:03:50, haraken wrote: > > On 2016/12/12 ...
4 years ago (2016-12-12 08:23:52 UTC) #27
dcheng
https://codereview.chromium.org/2565323002/diff/20001/base/memory/memory_coordinator_proxy.h File base/memory/memory_coordinator_proxy.h (right): https://codereview.chromium.org/2565323002/diff/20001/base/memory/memory_coordinator_proxy.h#newcode21 base/memory/memory_coordinator_proxy.h:21: virtual MemoryState GetLocalMemoryState() = 0; On 2016/12/12 07:38:39, bashi1 ...
4 years ago (2016-12-12 08:31:13 UTC) #28
sky
LGTM
4 years ago (2016-12-12 16:07:58 UTC) #31
bashi
On 2016/12/12 08:31:13, dcheng wrote: > https://codereview.chromium.org/2565323002/diff/20001/base/memory/memory_coordinator_proxy.h > File base/memory/memory_coordinator_proxy.h (right): > > https://codereview.chromium.org/2565323002/diff/20001/base/memory/memory_coordinator_proxy.h#newcode21 > ...
4 years ago (2016-12-13 00:14:25 UTC) #32
chrisha
https://codereview.chromium.org/2565323002/diff/20001/base/memory/memory_coordinator_proxy.h File base/memory/memory_coordinator_proxy.h (right): https://codereview.chromium.org/2565323002/diff/20001/base/memory/memory_coordinator_proxy.h#newcode21 base/memory/memory_coordinator_proxy.h:21: virtual MemoryState GetLocalMemoryState() = 0; On 2016/12/12 08:31:13, dcheng ...
4 years ago (2016-12-13 15:42:47 UTC) #33
bashi
4 years ago (2016-12-14 23:58:14 UTC) #34
Thanks Chris for review! I'm renaming content::MemoryCoordinator and
content::MemoryCoordinatorImpl, and after that I'll revise this CL and address
your comments (or I may upload a different CL and close this CL).

Powered by Google App Engine
This is Rietveld 408576698