AU: Fall back to full updates after a number of failed delta update attempts.

Count each failed delta update attempt. Keep the count in persistent storage. If
the count exceeds a threshold (3), disable delta updates by setting delta_okay
to false in the update check request.

Once this CL is in, we have to ensure that we have a full update payload
available on the update server for each version otherwise we may orphan clients.

BUG=7221
TEST=unit tests, gmerged on device and tested with a mod'ed dev server

Change-Id: I7f7fa73f652f12f22cc8604dad6a26c802b8582d

Review URL: http://codereview.chromium.org/3617002
diff --git a/prefs.cc b/prefs.cc
index 7e98e79..585408c 100644
--- a/prefs.cc
+++ b/prefs.cc
@@ -4,16 +4,18 @@
 
 #include "update_engine/prefs.h"
 
-#include "base/file_util.h"
-#include "base/logging.h"
-#include "base/string_number_conversions.h"
-#include "base/string_util.h"
+#include <base/file_util.h>
+#include <base/logging.h>
+#include <base/string_number_conversions.h>
+#include <base/string_util.h>
+
 #include "update_engine/utils.h"
 
 using std::string;
 
 namespace chromeos_update_engine {
 
+const char kPrefsDeltaUpdateFailures[] = "delta-update-failures";
 const char kPrefsLastActivePingDay[] = "last-active-ping-day";
 const char kPrefsLastRollCallPingDay[] = "last-roll-call-ping-day";