| Index: content/browser/memory/memory_coordinator.cc
|
| diff --git a/content/browser/memory/memory_coordinator.cc b/content/browser/memory/memory_coordinator.cc
|
| index 517aaedc34a1a13f696d9e0532c5c4c9117458a1..2f8b906f7906c4e710b08b9c064414cdef2976dc 100644
|
| --- a/content/browser/memory/memory_coordinator.cc
|
| +++ b/content/browser/memory/memory_coordinator.cc
|
| @@ -112,6 +112,24 @@ bool MemoryCoordinator::SetMemoryState(int render_process_id,
|
| return true;
|
| }
|
|
|
| +bool MemoryCoordinator::SetRemainingGlobalBudget(
|
| + int render_process_id, int64_t remaining_global_budget_mb) {
|
| + // Can't send a message to a child that doesn't exist.
|
| + auto iter = children_.find(render_process_id);
|
| + if (iter == children_.end())
|
| + return false;
|
| +
|
| + // Can't send a message to a child that isn't bound.
|
| + if (!iter->second.handle->child().is_bound())
|
| + return false;
|
| +
|
| + // Send the new budget.
|
| + iter->second.handle->child()->SetRemainingGlobalBudget(
|
| + remaining_global_budget_mb);
|
| +
|
| + return true;
|
| +}
|
| +
|
| mojom::MemoryState MemoryCoordinator::GetMemoryState(
|
| int render_process_id) const {
|
| auto iter = children_.find(render_process_id);
|
| @@ -136,6 +154,10 @@ void MemoryCoordinator::SetCurrentMemoryStateForTesting(
|
| base::MemoryState memory_state) {
|
| }
|
|
|
| +int64_t MemoryCoordinator::GetRemainingGlobalBudget() const {
|
| + return 0;
|
| +}
|
| +
|
| void MemoryCoordinator::AddChildForTesting(
|
| int dummy_render_process_id, mojom::ChildMemoryCoordinatorPtr child) {
|
| mojom::MemoryCoordinatorHandlePtr mch;
|
|
|