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

Unified Diff: content/common/host_discardable_shared_memory_manager.h

Issue 2357603002: Make HostDiscardableSharedMemoryManager a client of memory coordinator (Closed)
Patch Set: Remove comments that indicated TODOs in a different component Created 4 years, 3 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
« no previous file with comments | « no previous file | content/common/host_discardable_shared_memory_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/host_discardable_shared_memory_manager.h
diff --git a/content/common/host_discardable_shared_memory_manager.h b/content/common/host_discardable_shared_memory_manager.h
index fcbb35ae8eecef902d3ce4224ce252e5bbd27ab0..90c90938ceed8a705141276995348cd34ac898a6 100644
--- a/content/common/host_discardable_shared_memory_manager.h
+++ b/content/common/host_discardable_shared_memory_manager.h
@@ -17,6 +17,7 @@
#include "base/macros.h"
#include "base/memory/discardable_memory_allocator.h"
#include "base/memory/discardable_shared_memory.h"
+#include "base/memory/memory_coordinator_client.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/memory/ref_counted.h"
#include "base/memory/shared_memory.h"
@@ -35,7 +36,8 @@ typedef int32_t DiscardableSharedMemoryId;
// This class is thread-safe and instances can safely be used on any thread.
class CONTENT_EXPORT HostDiscardableSharedMemoryManager
: public base::DiscardableMemoryAllocator,
- public base::trace_event::MemoryDumpProvider {
+ public base::trace_event::MemoryDumpProvider,
+ public base::MemoryCoordinatorClient {
public:
HostDiscardableSharedMemoryManager();
~HostDiscardableSharedMemoryManager() override;
@@ -103,6 +105,9 @@ class CONTENT_EXPORT HostDiscardableSharedMemoryManager
return a->memory()->last_known_usage() > b->memory()->last_known_usage();
}
+ // base::MemoryCoordinatorClient implementation:
+ void OnMemoryStateChange(base::MemoryState state) override;
+
void AllocateLockedDiscardableSharedMemory(
base::ProcessHandle process_handle,
int client_process_id,
« no previous file with comments | « no previous file | content/common/host_discardable_shared_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698