| Index: chrome/browser/memory/tab_manager_delegate_chromeos.cc
|
| diff --git a/chrome/browser/memory/tab_manager_delegate_chromeos.cc b/chrome/browser/memory/tab_manager_delegate_chromeos.cc
|
| index d1c98a66f522b98be787c6cba2067a92e7067668..ef1e20431d0e2f373867afe6c91407f0cdac9aa1 100644
|
| --- a/chrome/browser/memory/tab_manager_delegate_chromeos.cc
|
| +++ b/chrome/browser/memory/tab_manager_delegate_chromeos.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include <algorithm>
|
| #include <map>
|
| +#include <string>
|
| #include <vector>
|
|
|
| #include "ash/shell.h"
|
| @@ -50,7 +51,6 @@
|
|
|
| using base::ProcessHandle;
|
| using base::TimeDelta;
|
| -using base::TimeTicks;
|
| using content::BrowserThread;
|
|
|
| namespace memory {
|
| @@ -554,15 +554,6 @@ TabManagerDelegate::GetSortedCandidates(
|
| return candidates;
|
| }
|
|
|
| -bool TabManagerDelegate::IsRecentlyKilledArcProcess(
|
| - const std::string& process_name,
|
| - const TimeTicks& now) {
|
| - const auto it = recently_killed_arc_processes_.find(process_name);
|
| - if (it == recently_killed_arc_processes_.end())
|
| - return false;
|
| - return (now - it->second) <= GetArcRespawnKillDelay();
|
| -}
|
| -
|
| bool TabManagerDelegate::KillArcProcess(const int nspid) {
|
| auto* arc_service_manager = arc::ArcServiceManager::Get();
|
| if (!arc_service_manager)
|
| @@ -599,7 +590,6 @@ void TabManagerDelegate::LowMemoryKillImpl(
|
| GetSortedCandidates(tab_list, arc_processes);
|
|
|
| int target_memory_to_free_kb = mem_stat_->TargetMemoryToFreeKB();
|
| - const TimeTicks now = TimeTicks::Now();
|
|
|
| // Kill processes until the estimated amount of freed memory is sufficient to
|
| // bring the system memory back to a normal level.
|
| @@ -620,14 +610,9 @@ void TabManagerDelegate::LowMemoryKillImpl(
|
| continue;
|
| }
|
| if (it->app()) {
|
| - if (IsRecentlyKilledArcProcess(it->app()->process_name(), now)) {
|
| - MEMORY_LOG(ERROR) << "Avoided killing " << *it << " too often";
|
| - continue;
|
| - }
|
| int estimated_memory_freed_kb =
|
| mem_stat_->EstimatedMemoryFreedKB(it->app()->pid());
|
| if (KillArcProcess(it->app()->nspid())) {
|
| - recently_killed_arc_processes_[it->app()->process_name()] = now;
|
| target_memory_to_free_kb -= estimated_memory_freed_kb;
|
| MemoryKillsMonitor::LogLowMemoryKill("APP", estimated_memory_freed_kb);
|
| MEMORY_LOG(ERROR) << "Killed " << *it << ", estimated "
|
|
|