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

Unified Diff: content/browser/memory/memory_pressure_controller.h

Issue 1641813002: Provide renderers with memory pressure signals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@contentapi
Patch Set: Addressed creis' comments. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/memory/memory_pressure_controller.h
diff --git a/content/browser/memory/memory_pressure_controller.h b/content/browser/memory/memory_pressure_controller.h
deleted file mode 100644
index f81540957d7b416f1b268e7e63280b14268ceb31..0000000000000000000000000000000000000000
--- a/content/browser/memory/memory_pressure_controller.h
+++ /dev/null
@@ -1,66 +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_BROWSER_MEMORY_MEMORY_PRESSURE_CONTROLLER_H_
-#define CONTENT_BROWSER_MEMORY_MEMORY_PRESSURE_CONTROLLER_H_
-
-#include <map>
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "base/memory/memory_pressure_listener.h"
-#include "base/memory/singleton.h"
-#include "content/common/content_export.h"
-
-namespace content {
-
-class BrowserChildProcessHost;
-class MemoryMessageFilter;
-class RenderProcessHost;
-
-class CONTENT_EXPORT MemoryPressureController {
- public:
- // These methods must be called on the IO thread.
- void OnMemoryMessageFilterAdded(MemoryMessageFilter* filter);
- void OnMemoryMessageFilterRemoved(MemoryMessageFilter* filter);
-
- // These methods can be called from any thread.
- void SetPressureNotificationsSuppressedInAllProcesses(bool suppressed);
- void SimulatePressureNotificationInAllProcesses(
- base::MemoryPressureListener::MemoryPressureLevel level);
- void SendPressureNotification(
- const BrowserChildProcessHost* child_process_host,
- base::MemoryPressureListener::MemoryPressureLevel level);
- void SendPressureNotification(
- const RenderProcessHost* render_process_host,
- base::MemoryPressureListener::MemoryPressureLevel level);
-
- // This method can be called from any thread.
- static MemoryPressureController* GetInstance();
-
- protected:
- virtual ~MemoryPressureController();
-
- private:
- friend struct base::DefaultSingletonTraits<MemoryPressureController>;
-
- MemoryPressureController();
-
- // Implementation of the various SendPressureNotification methods.
- void SendPressureNotificationImpl(
- const void* child_process_host,
- base::MemoryPressureListener::MemoryPressureLevel level);
-
- // Map from untyped process host pointers to the associated memory message
- // filters in the browser process. Always accessed on the IO thread.
- typedef std::map<const void*, scoped_refptr<MemoryMessageFilter>>
- MemoryMessageFilterMap;
- MemoryMessageFilterMap memory_message_filters_;
-
- DISALLOW_COPY_AND_ASSIGN(MemoryPressureController);
-};
-
-} // namespace content
-
-#endif // CONTENT_BROWSER_MEMORY_MEMORY_PRESSURE_CONTROLLER_H_
« no previous file with comments | « content/browser/memory/memory_message_filter.cc ('k') | content/browser/memory/memory_pressure_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698