Index: content/browser/browser_main_loop.cc |
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc |
index 1a4836241fbe8e0fbb16f948e26cad2d637359cb..a4e0e2b16baa492af82bd93992391816291a429f 100644 |
--- a/content/browser/browser_main_loop.cc |
+++ b/content/browser/browser_main_loop.cc |
@@ -1618,21 +1618,11 @@ void BrowserMainLoop::InitializeMemoryManagementComponent() { |
if (base::FeatureList::IsEnabled(features::kMemoryCoordinator)) { |
// Disable MemoryPressureListener when memory coordinator is enabled. |
base::MemoryPressureListener::SetNotificationsSuppressed(true); |
- // base::Unretained is safe because the lifetime of MemoryCoordinator is |
- // tied to the lifetime of the browser process. |
- base::MemoryCoordinatorProxy::GetInstance()-> |
- SetGetCurrentMemoryStateCallback(base::Bind( |
- &MemoryCoordinatorImpl::GetCurrentMemoryState, |
- base::Unretained(MemoryCoordinatorImpl::GetInstance()))); |
- base::MemoryCoordinatorProxy::GetInstance()-> |
- SetSetCurrentMemoryStateForTestingCallback(base::Bind( |
- &MemoryCoordinatorImpl::SetCurrentMemoryStateForTesting, |
- base::Unretained(MemoryCoordinatorImpl::GetInstance()))); |
- |
+ auto* coordinator = MemoryCoordinatorImpl::GetInstance(); |
if (memory_pressure_monitor_) { |
memory_pressure_monitor_->SetDispatchCallback( |
base::Bind(&MemoryCoordinatorImpl::RecordMemoryPressure, |
- base::Unretained(MemoryCoordinatorImpl::GetInstance()))); |
+ base::Unretained(coordinator))); |
} |
} |
} |