Modify priority tweaking to use CGroups.

This modifies the behavior of setpriority and getpriority
to use CGroups rather than niceness levels.

I've removed the unittest comparing priorities as its not
really valid any more as we are just writing numbers to files.

I've also refactored references to priority to reference cpu
shares etc.

BUG=chromium-os:36229
TEST=Unittest + doing end to end test in bgnd
CQ-DEPEND=I6a0e56073e7281268e0550919c9ec9202b18db26

Change-Id: I48c8270c2065f1e0677e5e53df3557131577b97c
Reviewed-on: https://gerrit.chromium.org/gerrit/39147
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
Commit-Ready: Chris Sosa <sosa@chromium.org>
diff --git a/update_attempter.h b/update_attempter.h
index c873aa9..dd47f4d 100644
--- a/update_attempter.h
+++ b/update_attempter.h
@@ -193,22 +193,22 @@
   // otherwise.
   bool ScheduleErrorEventAction();
 
-  // Sets the process priority to |priority| and updates |priority_| if the new
-  // |priority| is different than the current |priority_|, otherwise simply
+  // Sets the cpu shares to |shares| and updates |shares_| if the new
+  // |shares| is different than the current |shares_|, otherwise simply
   // returns.
-  void SetPriority(utils::ProcessPriority priority);
+  void SetCpuShares(utils::CpuShares shares);
 
-  // Sets the process priority to low and sets up timeout events to increase it.
-  void SetupPriorityManagement();
+  // Sets the cpu shares to low and sets up timeout events to increase it.
+  void SetupCpuSharesManagement();
 
-  // Resets the process priority to normal and destroys any scheduled timeout
+  // Resets the cpu shares to normal and destroys any scheduled timeout
   // sources.
-  void CleanupPriorityManagement();
+  void CleanupCpuSharesManagement();
 
-  // The process priority timeout source callback sets the current priority to
+  // The cpu shares timeout source callback sets the current cpu shares to
   // normal. Returns false so that GLib destroys the timeout source.
-  static gboolean StaticManagePriorityCallback(gpointer data);
-  bool ManagePriorityCallback();
+  static gboolean StaticManageCpuSharesCallback(gpointer data);
+  bool ManageCpuSharesCallback();
 
   // Callback to start the action processor.
   static gboolean StaticStartProcessing(gpointer data);
@@ -300,11 +300,11 @@
   // HTTP server response code from the last HTTP request action.
   int http_response_code_;
 
-  // Current process priority.
-  utils::ProcessPriority priority_;
+  // Current cpu shares.
+  utils::CpuShares shares_;
 
-  // The process priority management timeout source.
-  GSource* manage_priority_source_;
+  // The cpu shares management timeout source.
+  GSource* manage_shares_source_;
 
   // Set to true if an update download is active (and BytesReceived
   // will be called), set to false otherwise.