Propagate memory pressure to child processes.

MemoryPressureMonitor (added in https://crrev.com/c/953166) polls
memory pressure when it gets CRITICAL to (1) lower memory usage by
repeatedly invoking pressure listeners and (2) sense (and notify
listeners) when pressure subsides.

However the polling only happens in the browser / WebView process,
because (1) ActivityManager.getMyMemoryState() can't be called from
isolated services, and (2) we want to poll only when Chrome is in
the foreground / there are WebView instances around.

This CL propagates pressure signals from the polling process to all
its services. That way in addition to getting pressure signals from
Android via ComponentCallbacks2, services also get signals from the
their main process.

Bug: 813909
Change-Id: Icef3b31106dcf432e6cdbdb0e1cdd84539dd690b
Reviewed-on: https://chromium-review.googlesource.com/992865
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Reviewed-by: agrieve <agrieve@chromium.org>
Commit-Queue: Dmitry Skiba <dskiba@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550850}

CrOS-Libchrome-Original-Commit: 9bd1a50ca7a132d6eb582f0fa2674b98b57f9923
5 files changed
tree: 99dccb4f0e0cb3d278aea88b1a2acb39611caee4
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/