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 <[email protected]>
Commit-Queue: Alex Vakulenko <[email protected]>
Tested-by: Alex Vakulenko <[email protected]>
diff --git a/prefs.cc b/prefs.cc
index dda1919..c1e249c 100644
--- a/prefs.cc
+++ b/prefs.cc
@@ -6,8 +6,8 @@
 
 #include <base/file_util.h>
 #include <base/logging.h>
-#include <base/string_number_conversions.h>
-#include <base/string_util.h>
+#include <base/strings/string_number_conversions.h>
+#include <base/strings/string_util.h>
 
 #include "update_engine/utils.h"
 
@@ -15,15 +15,15 @@
 
 namespace chromeos_update_engine {
 
-bool Prefs::Init(const FilePath& prefs_dir) {
+bool Prefs::Init(const base::FilePath& prefs_dir) {
   prefs_dir_ = prefs_dir;
   return true;
 }
 
 bool Prefs::GetString(const string& key, string* value) {
-  FilePath filename;
+  base::FilePath filename;
   TEST_AND_RETURN_FALSE(GetFileNameForKey(key, &filename));
-  if (!file_util::ReadFileToString(filename, value)) {
+  if (!base::ReadFileToString(filename, value)) {
     LOG(INFO) << key << " not present in " << prefs_dir_.value();
     return false;
   }
@@ -31,9 +31,9 @@
 }
 
 bool Prefs::SetString(const std::string& key, const std::string& value) {
-  FilePath filename;
+  base::FilePath filename;
   TEST_AND_RETURN_FALSE(GetFileNameForKey(key, &filename));
-  TEST_AND_RETURN_FALSE(file_util::CreateDirectory(filename.DirName()));
+  TEST_AND_RETURN_FALSE(base::CreateDirectory(filename.DirName()));
   TEST_AND_RETURN_FALSE(
       file_util::WriteFile(filename, value.data(), value.size()) ==
       static_cast<int>(value.size()));
@@ -74,18 +74,19 @@
 }
 
 bool Prefs::Exists(const string& key) {
-  FilePath filename;
+  base::FilePath filename;
   TEST_AND_RETURN_FALSE(GetFileNameForKey(key, &filename));
-  return file_util::PathExists(filename);
+  return base::PathExists(filename);
 }
 
 bool Prefs::Delete(const string& key) {
-  FilePath filename;
+  base::FilePath filename;
   TEST_AND_RETURN_FALSE(GetFileNameForKey(key, &filename));
-  return file_util::Delete(filename, false);
+  return base::DeleteFile(filename, false);
 }
 
-bool Prefs::GetFileNameForKey(const std::string& key, FilePath* filename) {
+bool Prefs::GetFileNameForKey(const std::string& key,
+                              base::FilePath* filename) {
   // Allows only non-empty keys containing [A-Za-z0-9_-].
   TEST_AND_RETURN_FALSE(!key.empty());
   for (size_t i = 0; i < key.size(); ++i) {