Implement new ranking for apps and tabs in tab manager delegate

This CL modifies the ranking of apps and tabs for OOM-killing
in tab manager delegate, such that cached apps are killed first,
and background apps/tabs are ranked together. This is to address
cached apps that are (currently) never killed and to enable
ActivityManagerService to send trim memory signals.
The design doc in progress at go/arc-oom-new-ranking explains the
changes in more detail.

Change-Id: I47e8281faacdf8e72a3dd834c5b8f4308c3bb92d
BUG: b:62353695
TEST: TabManagerDelegate unit tests, and manual memory pressure tests
Reviewed-on: https://chromium-review.googlesource.com/c/1362493
Commit-Queue: Willie Koomson <[email protected]>
Reviewed-by: Christopher Morin <[email protected]>
Reviewed-by: Cheng-Yu Lee <[email protected]>
Cr-Commit-Position: refs/heads/master@{#617578}
diff --git a/chrome/browser/chromeos/arc/process/arc_process.h b/chrome/browser/chromeos/arc/process/arc_process.h
index 2cb36ac..54dbd0e 100644
--- a/chrome/browser/chromeos/arc/process/arc_process.h
+++ b/chrome/browser/chromeos/arc/process/arc_process.h
@@ -57,6 +57,14 @@
   // IsImportant() might be good enough.
   bool IsPersistent() const;
 
+  // Returns true if the process is cached or empty and should have a higher
+  // oom_score_adj to be killed earlier.
+  bool IsCached() const;
+
+  // Returns true if process is in the background but should have a lower
+  // oom_score_adj.
+  bool IsBackgroundProtected() const;
+
  private:
   // Returns true if this is ARC protected process which we don't allow to kill.
   bool IsArcProtected() const;