diff options
author | huangs <huangs@chromium.org> | 2015-09-22 09:59:54 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-22 17:00:31 +0000 |
commit | baa42d336b9a858a1180be0db455a6874761e418 (patch) | |
tree | 7602f13584b1f2fae89561d70f7dae3a9c4068de /content/child/memory | |
parent | 97745f79debe9ec1e8a200fe5b12091f82dcf421 (diff) | |
download | chromium_src-baa42d336b9a858a1180be0db455a6874761e418.zip chromium_src-baa42d336b9a858a1180be0db455a6874761e418.tar.gz chromium_src-baa42d336b9a858a1180be0db455a6874761e418.tar.bz2 |
Revert of Architecture for cross-process memory notification suppressing (patchset #11 id:240001 of https://codereview.chromium.org/1332583002/ )
Reason for revert:
This seems to cause failure in Cast Linux: content_browsertests: MemoryPressureControllerBrowserTest.SetPressureNotificationsSuppressedInAllProcesses
Original issue's description:
> Architecture 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}
TBR=skyostil@chromium.org,primiano@chromium.org,nasko@chromium.org,chrisha@chromium.org,petrcermak@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=516776
Review URL: https://codereview.chromium.org/1359873002
Cr-Commit-Position: refs/heads/master@{#350175}
Diffstat (limited to 'content/child/memory')
-rw-r--r-- | content/child/memory/child_memory_message_filter.cc | 32 | ||||
-rw-r--r-- | content/child/memory/child_memory_message_filter.h | 32 |
2 files changed, 0 insertions, 64 deletions
diff --git a/content/child/memory/child_memory_message_filter.cc b/content/child/memory/child_memory_message_filter.cc deleted file mode 100644 index 1f35159..0000000 --- a/content/child/memory/child_memory_message_filter.cc +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "content/child/memory/child_memory_message_filter.h" - -#include "base/memory/memory_pressure_listener.h" -#include "content/common/memory_messages.h" - -namespace content { - -ChildMemoryMessageFilter::ChildMemoryMessageFilter() {} - -ChildMemoryMessageFilter::~ChildMemoryMessageFilter() {} - -bool ChildMemoryMessageFilter::OnMessageReceived(const IPC::Message& message) { - bool handled = true; - IPC_BEGIN_MESSAGE_MAP(ChildMemoryMessageFilter, message) - IPC_MESSAGE_HANDLER(MemoryMsg_SetPressureNotificationsSuppressed, - OnSetPressureNotificationsSuppressed) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() - return handled; -} - -void ChildMemoryMessageFilter::OnSetPressureNotificationsSuppressed( - bool suppressed) { - // Enable/disable suppressing memory notifications in the child process. - base::MemoryPressureListener::SetNotificationsSuppressed(suppressed); -} - -} // namespace content diff --git a/content/child/memory/child_memory_message_filter.h b/content/child/memory/child_memory_message_filter.h deleted file mode 100644 index 32e2a2a..0000000 --- a/content/child/memory/child_memory_message_filter.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright 2015 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CONTENT_CHILD_MEMORY_CHILD_MEMORY_MESSAGE_FILTER_H_ -#define CONTENT_CHILD_MEMORY_CHILD_MEMORY_MESSAGE_FILTER_H_ - -#include "ipc/message_filter.h" - -namespace content { - -// This class receives memory messages in child processes. -// See also: memory_message_filter.h -class ChildMemoryMessageFilter : public IPC::MessageFilter { - public: - ChildMemoryMessageFilter(); - - // IPC::MessageFilter implementation. - bool OnMessageReceived(const IPC::Message& message) override; - - protected: - ~ChildMemoryMessageFilter() override; - - private: - void OnSetPressureNotificationsSuppressed(bool suppressed); - - DISALLOW_COPY_AND_ASSIGN(ChildMemoryMessageFilter); -}; - -} // namespace content - -#endif // CONTENT_CHILD_MEMORY_CHILD_MEMORY_MESSAGE_FILTER_H_ |