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

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

Issue 2590773002: Add a public interface for content::MemoryCoordinator (Closed)
Patch Set: rebase Created 4 years 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/browser/memory/memory_coordinator_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/memory/memory_coordinator_impl.h
diff --git a/content/browser/memory/memory_coordinator_impl.h b/content/browser/memory/memory_coordinator_impl.h
index 34cf572194833f984428ff7d74502d1895132b40..250d58672b3410f2a97e77271df16dd431bde6e8 100644
--- a/content/browser/memory/memory_coordinator_impl.h
+++ b/content/browser/memory/memory_coordinator_impl.h
@@ -14,6 +14,7 @@
#include "base/time/time.h"
#include "content/common/content_export.h"
#include "content/common/memory_coordinator.mojom.h"
+#include "content/public/browser/memory_coordinator.h"
#include "content/public/browser/memory_coordinator_delegate.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -21,8 +22,6 @@
namespace content {
// NOTE: Memory coordinator is under development and not fully working.
-// TODO(bashi): Add content::MemoryCoordinator which is a pure virtual
-// interface to expose APIs outside content/.
class MemoryCoordinatorHandleImpl;
class MemoryCoordinatorImplTest;
@@ -34,7 +33,8 @@ struct MemoryCoordinatorSingletonTraits;
// MemoryCoordinatorImpl is an implementation of MemoryCoordinator.
// The current implementation uses MemoryStateUpdater to update the global
// memory state. See comments in MemoryStateUpdater for details.
-class CONTENT_EXPORT MemoryCoordinatorImpl : public NotificationObserver,
+class CONTENT_EXPORT MemoryCoordinatorImpl : public MemoryCoordinator,
+ public NotificationObserver,
public base::NonThreadSafe {
public:
using MemoryState = base::MemoryState;
@@ -80,6 +80,9 @@ class CONTENT_EXPORT MemoryCoordinatorImpl : public NotificationObserver,
// Sets the global memory state for testing.
void SetCurrentMemoryStateForTesting(MemoryState memory_state);
+ // MemoryCoordinator implementation:
+ MemoryState GetStateForProcess(base::ProcessHandle handle) override;
+
// NotificationObserver implementation:
void Observe(int type,
const NotificationSource& source,
« no previous file with comments | « no previous file | content/browser/memory/memory_coordinator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698