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

Issue 2097753002: Make memory pressure notifier configurable (Closed)

Created:
4 years, 6 months ago by bashi
Modified:
4 years, 5 months ago
Reviewers:
danakj, chrisha, halliwell, alokp
CC:
chromium-reviews, alokp+watch_chromium.org, lcwu+watch_chromium.org, gavinp+memory_chromium.org, halliwell+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make memory pressure notifier configurable In memory coordinator v0 we try to replace MemoryPressureListener with MemoryCoordinatorClient as described in [1]. This CL adds SetNotifier() method which takes a callback for dispatching memory pressure notifications. This allows us to replace MemoryPressureListener::NotifyMemoryPressure() with an arbitrary function. [1] https://docs.google.com/document/d/1rGeUzhfzIKwmBzUcqUEwxEpLQQRq3PulRuHwFBlVIYI/edit# BUG=617492 Committed: https://crrev.com/456eef44d60c8cddc72f53d4e3d13ffd80158df3 Cr-Commit-Position: refs/heads/master@{#404327}

Patch Set 1 : fix #

Total comments: 19

Patch Set 2 : comment #

Patch Set 3 : comment #

Total comments: 4

Patch Set 4 : comment #

Total comments: 6

Patch Set 5 : use callback #

Patch Set 6 : fix compile errors #

Patch Set 7 : Fix another error #

Total comments: 1

Patch Set 8 : Fix win #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -8 lines) Patch
M base/memory/memory_pressure_monitor.h View 1 2 3 4 3 chunks +6 lines, -0 lines 0 comments Download
M base/memory/memory_pressure_monitor_chromeos.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M base/memory/memory_pressure_monitor_chromeos.cc View 1 2 3 4 3 chunks +8 lines, -1 line 0 comments Download
M base/memory/memory_pressure_monitor_mac.h View 1 2 3 4 1 chunk +7 lines, -1 line 0 comments Download
M base/memory/memory_pressure_monitor_mac.cc View 1 2 3 4 5 4 chunks +15 lines, -4 lines 0 comments Download
M base/memory/memory_pressure_monitor_win.h View 1 2 3 4 2 chunks +3 lines, -0 lines 0 comments Download
M base/memory/memory_pressure_monitor_win.cc View 1 2 3 4 5 6 7 4 chunks +10 lines, -1 line 0 comments Download
M chromecast/browser/cast_memory_pressure_monitor.h View 1 2 3 4 5 2 chunks +2 lines, -0 lines 0 comments Download
M chromecast/browser/cast_memory_pressure_monitor.cc View 1 2 3 4 5 6 3 chunks +8 lines, -1 line 0 comments Download

Messages

Total messages: 48 (18 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2097753002/1
4 years, 6 months ago (2016-06-24 08:46:06 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_chromium_compile_dbg_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_compile_dbg_ng/builds/224234)
4 years, 6 months ago (2016-06-24 09:10:02 UTC) #4
bashi
PTAL (or suggest reviewers?) Thanks! https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h#newcode42 base/memory/memory_pressure_monitor.h:42: void Notify(MemoryPressureLevel level); public ...
4 years, 5 months ago (2016-06-27 03:47:54 UTC) #9
chrisha
This allows you to intercept memory pressure notifications, and have them be dispatched the something ...
4 years, 5 months ago (2016-06-27 20:19:36 UTC) #10
bashi
On 2016/06/27 20:19:36, chrisha (slow) wrote: > This allows you to intercept memory pressure notifications, ...
4 years, 5 months ago (2016-06-27 22:03:38 UTC) #11
chrisha
After reading the design doc and discussing with haraken, lgtm!
4 years, 5 months ago (2016-06-29 21:17:10 UTC) #13
bashi
Thanks! Asking owners review. +danakj@ for base/ owners review. +alokp@ for chromecast/ owners review.
4 years, 5 months ago (2016-06-30 00:53:38 UTC) #15
halliwell
On 2016/06/30 00:53:38, bashi1 wrote: > Thanks! Asking owners review. > > +danakj@ for base/ ...
4 years, 5 months ago (2016-06-30 01:13:29 UTC) #16
danakj
https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h#newcode15 base/memory/memory_pressure_monitor.h:15: // TODO(chrisha): Make this a concrete class with per-OS ...
4 years, 5 months ago (2016-06-30 18:48:05 UTC) #17
bashi
https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h#newcode15 base/memory/memory_pressure_monitor.h:15: // TODO(chrisha): Make this a concrete class with per-OS ...
4 years, 5 months ago (2016-06-30 23:33:10 UTC) #18
danakj
https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h#newcode15 base/memory/memory_pressure_monitor.h:15: // TODO(chrisha): Make this a concrete class with per-OS ...
4 years, 5 months ago (2016-07-01 20:49:28 UTC) #19
danakj
https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h#newcode15 base/memory/memory_pressure_monitor.h:15: // TODO(chrisha): Make this a concrete class with per-OS ...
4 years, 5 months ago (2016-07-01 20:50:09 UTC) #20
bashi
Thank you for review and sorry for delay. https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h#newcode15 base/memory/memory_pressure_monitor.h:15: // ...
4 years, 5 months ago (2016-07-03 23:54:47 UTC) #21
danakj
https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h#newcode15 base/memory/memory_pressure_monitor.h:15: // TODO(chrisha): Make this a concrete class with per-OS ...
4 years, 5 months ago (2016-07-06 18:57:23 UTC) #22
danakj
https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h#newcode15 base/memory/memory_pressure_monitor.h:15: // TODO(chrisha): Make this a concrete class with per-OS ...
4 years, 5 months ago (2016-07-06 19:00:20 UTC) #23
bashi
https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/60001/base/memory/memory_pressure_monitor.h#newcode15 base/memory/memory_pressure_monitor.h:15: // TODO(chrisha): Make this a concrete class with per-OS ...
4 years, 5 months ago (2016-07-07 01:42:39 UTC) #27
chrisha
Yeah, I'm not convinced this is any cleaner. The whole class hierarchy is effectively broken, ...
4 years, 5 months ago (2016-07-07 03:09:19 UTC) #28
bashi
https://codereview.chromium.org/2097753002/diff/160001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/160001/base/memory/memory_pressure_monitor.h#newcode39 base/memory/memory_pressure_monitor.h:39: virtual void SetObserver(MemoryPressureMonitorObserver* observer) = 0; On 2016/07/07 03:09:19, ...
4 years, 5 months ago (2016-07-07 03:32:32 UTC) #29
danakj
> Yeah, I'm not convinced this is any cleaner. The whole class hierarchy is > ...
4 years, 5 months ago (2016-07-07 23:12:06 UTC) #30
bashi
Thanks for feedback. Revised the CL. PTAL. https://codereview.chromium.org/2097753002/diff/160001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/160001/base/memory/memory_pressure_monitor.h#newcode39 base/memory/memory_pressure_monitor.h:39: virtual void ...
4 years, 5 months ago (2016-07-07 23:57:19 UTC) #31
danakj
LGTM except maybe a bug in mac? https://codereview.chromium.org/2097753002/diff/180001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/180001/base/memory/memory_pressure_monitor.h#newcode26 base/memory/memory_pressure_monitor.h:26: using DispatchCallback ...
4 years, 5 months ago (2016-07-08 00:03:53 UTC) #32
bashi
https://codereview.chromium.org/2097753002/diff/180001/base/memory/memory_pressure_monitor.h File base/memory/memory_pressure_monitor.h (right): https://codereview.chromium.org/2097753002/diff/180001/base/memory/memory_pressure_monitor.h#newcode26 base/memory/memory_pressure_monitor.h:26: using DispatchCallback = void(*)(MemoryPressureLevel level); On 2016/07/08 00:03:53, danakj ...
4 years, 5 months ago (2016-07-08 00:13:05 UTC) #33
bashi
Bots seem happy. Let me land this. https://codereview.chromium.org/2097753002/diff/240001/base/memory/memory_pressure_monitor_mac.cc File base/memory/memory_pressure_monitor_mac.cc (right): https://codereview.chromium.org/2097753002/diff/240001/base/memory/memory_pressure_monitor_mac.cc#newcode56 base/memory/memory_pressure_monitor_mac.cc:56: dispatch_source_set_event_handler(memory_level_event_source_, ^{ ...
4 years, 5 months ago (2016-07-08 01:58:28 UTC) #34
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/2097753002/240001
4 years, 5 months ago (2016-07-08 01:59:09 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: win_chromium_x64_rel_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/241640)
4 years, 5 months ago (2016-07-08 03:01:03 UTC) #39
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/2097753002/260001
4 years, 5 months ago (2016-07-08 03:13:07 UTC) #42
commit-bot: I haz the power
Committed patchset #8 (id:260001)
4 years, 5 months ago (2016-07-08 09:36:52 UTC) #44
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-08 09:37:08 UTC) #45
commit-bot: I haz the power
Patchset 8 (id:??) landed as https://crrev.com/456eef44d60c8cddc72f53d4e3d13ffd80158df3 Cr-Commit-Position: refs/heads/master@{#404327}
4 years, 5 months ago (2016-07-08 09:38:28 UTC) #47
danakj
4 years, 5 months ago (2016-07-08 21:38:00 UTC) #48
Message was sent while issue was closed.
On Thu, Jul 7, 2016 at 6:58 PM, <bashi@chromium.org> wrote:

> Bots seem happy. Let me land this.
>
>
>
>
https://codereview.chromium.org/2097753002/diff/240001/base/memory/memory_pre...
> File base/memory/memory_pressure_monitor_mac.cc (right):
>
>
>
https://codereview.chromium.org/2097753002/diff/240001/base/memory/memory_pre...
> base/memory/memory_pressure_monitor_mac.cc:56:
> dispatch_source_set_event_handler(memory_level_event_source_, ^{
> I read [1] and it seems that we can use member variables here as the
> same as in a member function. I think this is OK.
>
> [1] http://clang.llvm.org/docs/BlockLanguageSpec.html
>

Thanksfor the pointer. "References to this, as well as references to
non-static members of any enclosing class, are evaluated by capturing this
just like a normal variable of C pointer type." does sound like it's okay!


>
>
> https://codereview.chromium.org/2097753002/
>

-- 
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