chrome/browser/chromeos/memory/oom_priority_manager.cc
// TODO(jamescook): This should consider tabs with references to other tabs,
// such as tabs created with JavaScript window.open().  We might want to
// discard the entire set together, or use that in the priority computation.
This should consider tabs with references to other tabs,
such as tabs created with JavaScript window.open().  We might want to
discard the entire set together, or use that in the priority computation.
This should consider tabs with references to other tabs such as tabs created with JavaScript window . open () . We might want to discard the entire set together or use that in the priority computation .
bool OomPriorityManager::DiscardTab() {
  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
  TabStatsList stats = GetTabStatsOnUIThread();
  if (stats.empty())
    return false;
  for (TabStatsList::const_reverse_iterator stats_rit = stats.rbegin();
       stats_rit != stats.rend();
       ++stats_rit) {
    int64 least_important_tab_id = stats_rit->tab_contents_id;
    if (DiscardTabById(least_important_tab_id))
      return true;
  }
  return false;
}
bool OomPriorityManager :: DiscardTab ( ) { DCHECK ( BrowserThread :: CurrentlyOn ( BrowserThread :: UI ) ) ; TabStatsList stats = GetTabStatsOnUIThread ( ) ; if ( stats . empty ( ) ) return false ; for ( TabStatsList :: const_reverse_iterator stats_rit = stats . rbegin ( ) ; stats_rit != stats . rend ( ) ; ++ stats_rit ) { int64 least_important_tab_id = stats_rit -> tab_contents_id ; if ( DiscardTabById ( least_important_tab_id ) ) return true ; } return false ; }
TODO(jamescook): This should consider tabs with references to other tabs,
such as tabs created with JavaScript window.open().
TODO ( jamescook ) : This should consider tabs with references to other tabs such as tabs created with JavaScript window . open () .
// Loop until we find a non-discarded tab to kill.