update_engine: update to libbase 242728

Made update_engine link with libchrome-242728 and fixed compile
issues due to changes in namespaces and include file layout.

Also removed some of suppressed compiler warnings and fixed the
issues masked by them (e.g. mismatched printf-like specifiers).

Added -Wextra compiler option to enable additional useful warnings
to ensure more strict checking... Had to disable "unused-parameter"
though since we have a lot of functions (mainly in fakes) that do
not use all of their parameters.

BUG=chromium:351593
TEST=Unit tests passed.
CQ-DEPEND=CL:191721

Change-Id: I1aa63a48d5f1f4ea75ba6b00aec7aa5f3bad15c4
Reviewed-on: https://chromium-review.googlesource.com/191510
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
diff --git a/utils.cc b/utils.cc
index 70b9c75..e67abb2 100644
--- a/utils.cc
+++ b/utils.cc
@@ -21,15 +21,15 @@
 #include <algorithm>
 #include <vector>
 
-#include <base/file_path.h>
+#include <base/files/file_path.h>
 #include <base/file_util.h>
 #include <base/logging.h>
 #include <base/posix/eintr_wrapper.h>
 #include <base/rand_util.h>
-#include <base/string_number_conversions.h>
-#include <base/string_split.h>
-#include <base/string_util.h>
-#include <base/stringprintf.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_split.h>
+#include <base/strings/string_util.h>
+#include <base/strings/stringprintf.h>
 #include <glib.h>
 #include <google/protobuf/stubs/common.h>
 
@@ -72,7 +72,7 @@
 string ParseECVersion(string input_line) {
   TrimWhitespaceASCII(input_line, TRIM_ALL, &input_line);
 
-  // At this point we want to conver the format key=value pair from mosys to
+  // At this point we want to convert the format key=value pair from mosys to
   // a vector of key value pairs.
   vector<pair<string, string> > kv_pairs;
   if (base::SplitStringIntoKeyValuePairs(input_line, '=', ' ', &kv_pairs)) {
@@ -82,7 +82,7 @@
       if (it->first == "fw_version") {
         string output;
         // Trim any quotes.
-        TrimString(it->second, "\"", &output);
+        base::TrimString(it->second, "\"", &output);
         return output;
       }
     }
@@ -448,18 +448,18 @@
 }
 
 string SysfsBlockDevice(const string& device) {
-  FilePath device_path(device);
+  base::FilePath device_path(device);
   if (device_path.DirName().value() != "/dev") {
     return "";
   }
-  return FilePath("/sys/block").Append(device_path.BaseName()).value();
+  return base::FilePath("/sys/block").Append(device_path.BaseName()).value();
 }
 
 bool IsRemovableDevice(const std::string& device) {
   string sysfs_block = SysfsBlockDevice(device);
   string removable;
   if (sysfs_block.empty() ||
-      !file_util::ReadFileToString(FilePath(sysfs_block).Append("removable"),
+      !base::ReadFileToString(base::FilePath(sysfs_block).Append("removable"),
                                    &removable)) {
     return false;
   }
@@ -870,7 +870,7 @@
 string ToString(const Time utc_time) {
   Time::Exploded exp_time;
   utc_time.UTCExplode(&exp_time);
-  return StringPrintf("%d/%d/%d %d:%02d:%02d GMT",
+  return base::StringPrintf("%d/%d/%d %d:%02d:%02d GMT",
                       exp_time.month,
                       exp_time.day_of_month,
                       exp_time.year,
@@ -1110,8 +1110,8 @@
 
 bool DeletePowerwashMarkerFile(const char* file_path) {
   const char* marker_file = file_path ? file_path : kPowerwashMarkerFile;
-  const FilePath kPowerwashMarkerPath(marker_file);
-  bool result = file_util::Delete(kPowerwashMarkerPath, false);
+  const base::FilePath kPowerwashMarkerPath(marker_file);
+  bool result = base::DeleteFile(kPowerwashMarkerPath, false);
 
   if (result)
     LOG(INFO) << "Successfully deleted the powerwash marker file : "
@@ -1180,7 +1180,7 @@
   OmahaHashCalculator::Base64Encode(payload_hash.c_str(),
                                     payload_hash.size(),
                                     &encoded_hash);
-  return StringPrintf("cros_update_size_%zu_hash_%s",
+  return base::StringPrintf("cros_update_size_%zu_hash_%s",
                       payload_size,
                       encoded_hash.c_str());
 }
@@ -1232,7 +1232,7 @@
     return false;
   }
 
-  FILE *file = file_util::CreateAndOpenTemporaryFile(out_path);
+  FILE *file = base::CreateAndOpenTemporaryFile(out_path);
   if (file == NULL) {
     LOG(ERROR) << "Error creating temporary file.";
     return false;