DescriptionArchitecture for cross-process memory notification suppressing
This patch adds IPC architecture for suppressing memory pressure
notifications in all processes:
BROWSER PROCESS CHILD PROCESSES
MemoryPressureListener:: MemoryPressureListener::
SetNotificationsSuppressed SetNotificationsSuppressed
(existing static method*) (existing static method*)
^ ^
| |
+--------------------------+ |
| MemoryPressureController | |
+..> | (singleton) | |
: +--------------------------+ |
: | |
: V |
: +--------------------------+ +--------------------------+
: | MemoryMessageFilter | <===> | ChildMemoryMessageFilter |
: | (per child process) | IPC | (singleton) |
: +--------------------------+ +--------------------------+
:
:
+.. Memory.setPressureNotificationsSuppressed
(proposed DevTools API**)
*) The required functionality for individual processes was added in:
https://codereview.chromium.org/1312163003.
**) The new DevTools API will be added in the following 3-sided patch:
https://codereview.chromium.org/1336363002,
https://codereview.chromium.org/1311343007, and
https://codereview.chromium.org/1342833004.
This patch adds new message filters on both sides (MemoryMessageFilter
in the browser process and ChildMemoryMessageFilter in the child
process) because we anticipate more functionality to be added to
MemoryPressureController in the near future (methods for simulating
memory pressure signals and, more importantly, propagating memory
pressure signals to all processes on desktop Chrome). Encapsulating the
relevant IPC communication in dedicated message filters is arguably
better than keeping augmenting (and having duplicate code in)
BrowserChildProcessHostImpl, RenderProcessHostImpl, and
ChildThreadImpl.
This patch represents the second step towards implementing a DevTools
API for suppressing and simulating memory pressure signals in Chrome.
The main use case for this feature is to enforce consistent conditions
across memory measurements. See https://goo.gl/cZFdH3 for more details.
BUG=516776
Committed: https://crrev.com/0b119f3392d6c6169bbb792347a04f34ce649156
Cr-Commit-Position: refs/heads/master@{#350169}
Patch Set 1 #
Total comments: 8
Patch Set 2 : Update for review feedback #Patch Set 3 : Split patch #
Total comments: 10
Patch Set 4 : Address primiano's comments & add tests #Patch Set 5 : Remove unnecessary includes #
Total comments: 10
Patch Set 6 : Address nasko's comments #
Total comments: 8
Patch Set 7 : Address primiano's comments & rebase #Patch Set 8 : Final rebase #Patch Set 9 : Add CONTENT_EXPORT to be able to link tests in component builds #Patch Set 10 : Don't leak IPC::Message in browser test #Patch Set 11 : Add comment explaining the use of scoped_ptr in the browser test matcher #Messages
Total messages: 39 (13 generated)
|