 Chromium Code Reviews
 Chromium Code Reviews Issue 2565323002:
  Stop using callbacks in MemoryCoordinatorProxy  (Closed)
    
  
    Issue 2565323002:
  Stop using callbacks in MemoryCoordinatorProxy  (Closed) 
  | 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, |