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

Unified Diff: content/child/memory/child_memory_coordinator_impl.h

Issue 2739363002: Implement base::MemoryCoordinator for ChildMemoryCoordinatorImpl (Closed)
Patch Set: Created 3 years, 9 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/child/memory/child_memory_coordinator_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/memory/child_memory_coordinator_impl.h
diff --git a/content/child/memory/child_memory_coordinator_impl.h b/content/child/memory/child_memory_coordinator_impl.h
index 04b7576dfc3bba4fad2697203b741f0e283f0971..96da7294c4b83609522d41a84a0fadad80933341 100644
--- a/content/child/memory/child_memory_coordinator_impl.h
+++ b/content/child/memory/child_memory_coordinator_impl.h
@@ -7,6 +7,7 @@
#include "base/compiler_specific.h"
#include "base/memory/memory_coordinator_client.h"
+#include "base/memory/memory_coordinator_proxy.h"
#include "content/common/child_memory_coordinator.mojom.h"
#include "content/common/content_export.h"
#include "content/common/memory_coordinator.mojom.h"
@@ -26,7 +27,8 @@ class CONTENT_EXPORT ChildMemoryCoordinatorDelegate {
// It lives in child processes and is responsible for dispatching memory events
// to its clients.
class CONTENT_EXPORT ChildMemoryCoordinatorImpl
- : NON_EXPORTED_BASE(public mojom::ChildMemoryCoordinator) {
+ : base::MemoryCoordinator,
+ NON_EXPORTED_BASE(public mojom::ChildMemoryCoordinator) {
public:
// Returns the instance of ChildMemoryCoordinatorImpl. Could be nullptr.
static ChildMemoryCoordinatorImpl* GetInstance();
@@ -35,6 +37,9 @@ class CONTENT_EXPORT ChildMemoryCoordinatorImpl
ChildMemoryCoordinatorDelegate* delegate);
~ChildMemoryCoordinatorImpl() override;
+ // base::MemoryCoordinator implementations:
+ base::MemoryState GetCurrentMemoryState() const override;
+
// mojom::ChildMemoryCoordinator implementations:
void OnStateChange(mojom::MemoryState state) override;
void PurgeMemory() override;
@@ -46,6 +51,7 @@ class CONTENT_EXPORT ChildMemoryCoordinatorImpl
friend class ChildMemoryCoordinatorImplTest;
mojo::Binding<mojom::ChildMemoryCoordinator> binding_;
+ base::MemoryState current_state_ = base::MemoryState::NORMAL;
mojom::MemoryCoordinatorHandlePtr parent_;
ChildMemoryCoordinatorDelegate* delegate_;
« no previous file with comments | « no previous file | content/child/memory/child_memory_coordinator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698