Chromium Code Reviews| Index: content/browser/memory/memory_coordinator.h |
| diff --git a/content/browser/memory/memory_coordinator.h b/content/browser/memory/memory_coordinator.h |
| index f674ef5b48ce950e5c442c24e73aef850940251d..2ebfb0850d1b5a8ec9343b82429598020d7944e7 100644 |
| --- a/content/browser/memory/memory_coordinator.h |
| +++ b/content/browser/memory/memory_coordinator.h |
| @@ -10,6 +10,7 @@ |
| #include "base/process/process_handle.h" |
| #include "content/common/content_export.h" |
| #include "content/common/memory_coordinator.mojom.h" |
| +#include "content/public/browser/memory_coordinator_delegate.h" |
| #include "mojo/public/cpp/bindings/binding.h" |
| namespace content { |
| @@ -29,6 +30,10 @@ class CONTENT_EXPORT MemoryCoordinator { |
| // Singleton factory/accessor. |
| static MemoryCoordinator* GetInstance(); |
| + void SetDelegate(const base::WeakPtr<MemoryCoordinatorDelegate>& delegate) { |
| + delegate_ = delegate; |
| + } |
| + |
| // Creates a handle to the provided child process. |
| void CreateHandle(int render_process_id, |
| mojom::MemoryCoordinatorHandleRequest request); |
| @@ -59,6 +64,9 @@ class CONTENT_EXPORT MemoryCoordinator { |
| // for testing. |
| void OnConnectionError(int render_process_id); |
| + // Returns true when a given renderer can be suspended. |
| + bool CanSuspendRenderer(int render_process_id); |
| + |
| private: |
| friend struct base::DefaultSingletonTraits<MemoryCoordinator>; |
| @@ -86,6 +94,8 @@ class CONTENT_EXPORT MemoryCoordinator { |
| // disconnected. |
| ChildInfoMap children_; |
| + base::WeakPtr<MemoryCoordinatorDelegate> delegate_; |
|
haraken
2016/10/07 06:38:19
Why does this need to be a WeakPtr?
bashi
2016/10/07 07:13:37
TabManager (which is effectively the only implemen
haraken
2016/10/07 07:31:07
I'll defer the decision to Chris -- how the lifeti
bashi
2016/10/07 07:34:01
Just to clarify: This is a tentative workaround. W
|
| + |
| DISALLOW_COPY_AND_ASSIGN(MemoryCoordinator); |
| }; |