chrome/browser/chromeos/memory/oom_priority_manager.cc
// Here we collect most of the information we need to sort the
// existing renderers in priority order, and hand out oom_score_adj
// scores based on that sort order.
//
// Things we need to collect on the browser thread (because
// TabStripModel isn't thread safe):
// 1) whether or not a tab is pinned
// 2) last time a tab was selected
// 3) is the tab currently selected
Here we collect most of the information we need to sort the
existing renderers in priority order, and hand out oom_score_adj
scores based on that sort order.

Things we need to collect on the browser thread (because
TabStripModel isn't thread safe):
1) whether or not a tab is pinned
2) last time a tab was selected
3) is the tab currently selected
Here we collect most of the information we need to sort the existing renderers in priority order and hand out oom_score_adj scores based on that sort order . Things we need to collect on the browser thread ( because TabStripModel isn ' t thread safe ) : 1 ) whether or not a tab is pinned 2 ) last time a tab was selected 3 ) is the tab currently selected
void OomPriorityManager::AdjustOomPriorities() {
  if (BrowserList::size() == 0)
    return;
  if (!last_adjust_time_.is_null()) {
    TimeDelta suspend_time = TimeTicks::Now() - last_adjust_time_;
    if (suspend_time.InSeconds() > kSuspendThresholdSeconds) {
      start_time_ += suspend_time;
      if (!last_discard_time_.is_null())
        last_discard_time_ += suspend_time;
    }
  }
  last_adjust_time_ = TimeTicks::Now();
  TabStatsList stats_list = GetTabStatsOnUIThread();
  BrowserThread::PostTask(
      BrowserThread::FILE, FROM_HERE,
      base::Bind(&OomPriorityManager::AdjustOomPrioritiesOnFileThread,
                 base::Unretained(this), stats_list));
}
void OomPriorityManager :: AdjustOomPriorities ( ) { if ( BrowserList :: size ( ) == 0 ) return ; if ( ! last_adjust_time_ . is_null ( ) ) { TimeDelta suspend_time = TimeTicks :: Now ( ) - last_adjust_time_ ; if ( suspend_time . InSeconds ( ) > kSuspendThresholdSeconds ) { start_time_ += suspend_time ; if ( ! last_discard_time_ . is_null ( ) ) last_discard_time_ += suspend_time ; } } last_adjust_time_ = TimeTicks :: Now ( ) ; TabStatsList stats_list = GetTabStatsOnUIThread ( ) ; BrowserThread :: PostTask ( BrowserThread :: FILE , FROM_HERE , base :: Bind ( & OomPriorityManager :: AdjustOomPrioritiesOnFileThread , base :: Unretained ( this ) , stats_list ) ) ; }
Here we collect most of the information we need to sort the
existing renderers in priority order, and hand out oom_score_adj
scores based on that sort order.
Here we collect most of the information we need to sort the existing renderers in priority order and hand out oom_score_adj scores based on that sort order .
// Check for a discontinuity in time caused by the machine being suspended. // We were probably suspended, move our event timers forward in time so // when we subtract them out later we are counting "uptime".