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

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

Issue 2565323002: Stop using callbacks in MemoryCoordinatorProxy (Closed)
Patch Set: fix 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
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 95c2a2c2004637ecaeda20d10b66c73cc68663bf..cdb17c2cb3b1e22d9a31fbf32a88dd6ee55b740d 100644
--- a/content/browser/memory/memory_coordinator_impl.h
+++ b/content/browser/memory/memory_coordinator_impl.h
@@ -36,23 +36,29 @@ struct MemoryCoordinatorSingletonTraits;
// Once a state is changed to a limited state, larger N will be needed to go
// back to a relaxed state. (e.g. THROTTLED -> NORMAL)
// * Once a state is changed, it remains the same for a certain period of time.
-class CONTENT_EXPORT MemoryCoordinatorImpl : public MemoryCoordinator,
- public NotificationObserver,
- public base::NonThreadSafe {
+class CONTENT_EXPORT MemoryCoordinatorImpl
+ : public MemoryCoordinator,
+ public NotificationObserver,
+ public base::MemoryCoordinatorInterface,
chrisha 2016/12/13 15:42:47 I'm not sure we need multiple inheritance here. R
+ public base::NonThreadSafe {
public:
MemoryCoordinatorImpl(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
std::unique_ptr<MemoryMonitor> monitor);
~MemoryCoordinatorImpl() override;
+ MemoryMonitor* memory_monitor() { return memory_monitor_.get(); }
+
// MemoryCoordinator implementations:
void Start() override;
void OnChildAdded(int render_process_id) override;
- MemoryMonitor* memory_monitor() { return memory_monitor_.get(); }
-
base::MemoryState GetGlobalMemoryState() const override;
- base::MemoryState GetCurrentMemoryState() const override;
- void SetCurrentMemoryStateForTesting(base::MemoryState memory_state) override;
+
+ base::WeakPtr<base::MemoryCoordinatorInterface> GetWeakPtr() override;
+
+ // base::MemoryCoordinatorInterface implementations:
+ base::MemoryState GetLocalMemoryState() override;
+ void SetMemoryStateForTesting(base::MemoryState state) override;
// NotificationObserver implementation:
void Observe(int type,

Powered by Google App Engine
This is Rietveld 408576698