chrome/browser/chromeos/memory/oom_priority_manager.cc
// Returns true if |first| is considered less desirable to be killed
// than |second|.
Returns true if |first| is considered less desirable to be killed
than |second|.
Returns true if |first| is considered less desirable to be killed than |second| .
bool OomPriorityManager::CompareTabStats(TabStats first,
                                         TabStats second) {
  if (first.is_selected != second.is_selected)
    return first.is_selected == true;
  if (first.is_pinned != second.is_pinned)
    return first.is_pinned == true;
  if (first.is_app != second.is_app)
    return first.is_app == true;
  return first.last_selected > second.last_selected;
}
bool OomPriorityManager :: CompareTabStats ( TabStats first , TabStats second ) { if ( first . is_selected != second . is_selected ) return first . is_selected == true ; if ( first . is_pinned != second . is_pinned ) return first . is_pinned == true ; if ( first . is_app != second . is_app ) return first . is_app == true ; return first . last_selected > second . last_selected ; }
Returns true if |first| is considered less desirable to be killed
than |second|.
Returns true if |first| is considered less desirable to be killed than |second| .
// Being currently selected is most important. // Being pinned is second most important. // Being an app is important too, as you're the only visible surface in the // window and we don't want to discard that. // TODO(jamescook): Incorporate sudden_termination_allowed into the sort // order.  We don't do this now because pages with unload handlers set // sudden_termination_allowed false, and that covers too many common pages // with ad networks and statistics scripts.  Ideally we would like to check // for beforeUnload handlers, which are likely to present a dialog asking // if the user wants to discard state.  crbug.com/123049 // Being more recently selected is more important.