Revert "Partially Revert 2b9d241"
This reverts commit 71818c8409812c5a08124627c19aa8ea0625a72e.
This patch was created because the upstream update_engine was using
the new version of libchrome and the Chrome OS one was not. Now
that we are upreving libchrome on Chrome OS we can revert this.
BUG=b:37434548
TEST=Build
CQ-DEPEND=CL:1240033
Change-Id: I98b7d124212087292500701782de08b3d3ecc559
Reviewed-on: https://chromium-review.googlesource.com/1239818
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Amin Hassani <ahassani@chromium.org>
diff --git a/common/http_fetcher_unittest.cc b/common/http_fetcher_unittest.cc
index a0b0522..23df67a 100644
--- a/common/http_fetcher_unittest.cc
+++ b/common/http_fetcher_unittest.cc
@@ -32,7 +32,6 @@
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <base/time/time.h>
-#include <brillo/bind_lambda.h>
#include <brillo/message_loops/base_message_loop.h>
#include <brillo/message_loops/message_loop.h>
#include <brillo/message_loops/message_loop_utils.h>
diff --git a/common/subprocess_unittest.cc b/common/subprocess_unittest.cc
index 10710e8..c8996db 100644
--- a/common/subprocess_unittest.cc
+++ b/common/subprocess_unittest.cc
@@ -32,7 +32,6 @@
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <base/time/time.h>
-#include <brillo/bind_lambda.h>
#include <brillo/message_loops/base_message_loop.h>
#include <brillo/message_loops/message_loop.h>
#include <brillo/message_loops/message_loop_utils.h>
diff --git a/common/utils_unittest.cc b/common/utils_unittest.cc
index 1590eeb..bb39770 100644
--- a/common/utils_unittest.cc
+++ b/common/utils_unittest.cc
@@ -305,8 +305,9 @@
base::Time::Exploded exploded = (base::Time::Exploded) {
.year = 2001, .month = 9, .day_of_week = 0, .day_of_month = 9,
.hour = 1, .minute = 46, .second = 40, .millisecond = 42};
- EXPECT_EQ(base::Time::FromUTCExploded(exploded),
- utils::TimeFromStructTimespec(&ts));
+ base::Time time;
+ EXPECT_TRUE(base::Time::FromUTCExploded(exploded, &time));
+ EXPECT_EQ(time, utils::TimeFromStructTimespec(&ts));
}
TEST(UtilsTest, DecodeAndStoreBase64String) {
diff --git a/payload_consumer/download_action_unittest.cc b/payload_consumer/download_action_unittest.cc
index 8efcd8e..84673c8 100644
--- a/payload_consumer/download_action_unittest.cc
+++ b/payload_consumer/download_action_unittest.cc
@@ -29,7 +29,6 @@
#include <base/files/file_util.h>
#include <base/location.h>
#include <base/strings/stringprintf.h>
-#include <brillo/bind_lambda.h>
#include <brillo/message_loops/fake_message_loop.h>
#include <brillo/message_loops/message_loop.h>
diff --git a/payload_consumer/filesystem_verifier_action_unittest.cc b/payload_consumer/filesystem_verifier_action_unittest.cc
index 895d816..33f6cc7 100644
--- a/payload_consumer/filesystem_verifier_action_unittest.cc
+++ b/payload_consumer/filesystem_verifier_action_unittest.cc
@@ -28,7 +28,6 @@
#include <base/posix/eintr_wrapper.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
-#include <brillo/bind_lambda.h>
#include <brillo/message_loops/fake_message_loop.h>
#include <brillo/message_loops/message_loop_utils.h>
#include <gmock/gmock.h>
diff --git a/payload_consumer/postinstall_runner_action_unittest.cc b/payload_consumer/postinstall_runner_action_unittest.cc
index 3c606c1..17c8909 100644
--- a/payload_consumer/postinstall_runner_action_unittest.cc
+++ b/payload_consumer/postinstall_runner_action_unittest.cc
@@ -29,7 +29,6 @@
#include <base/message_loop/message_loop.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
-#include <brillo/bind_lambda.h>
#include <brillo/message_loops/base_message_loop.h>
#include <brillo/message_loops/message_loop_utils.h>
#include <gmock/gmock.h>
diff --git a/proxy_resolver_unittest.cc b/proxy_resolver_unittest.cc
index 070b361..484aae1 100644
--- a/proxy_resolver_unittest.cc
+++ b/proxy_resolver_unittest.cc
@@ -22,7 +22,6 @@
#include <gtest/gtest.h>
#include <base/bind.h>
-#include <brillo/bind_lambda.h>
#include <brillo/message_loops/fake_message_loop.h>
using std::deque;
diff --git a/test_http_server.cc b/test_http_server.cc
index 39a12ed..cf15672 100644
--- a/test_http_server.cc
+++ b/test_http_server.cc
@@ -98,9 +98,11 @@
request->raw_headers = headers;
// Break header into lines.
- vector<string> lines;
- base::SplitStringUsingSubstr(
- headers.substr(0, headers.length() - strlen(EOL EOL)), EOL, &lines);
+ vector<string> lines = base::SplitStringUsingSubstr(
+ headers.substr(0, headers.length() - strlen(EOL EOL)),
+ EOL,
+ base::TRIM_WHITESPACE,
+ base::SPLIT_WANT_ALL);
// Decode URL line.
vector<string> terms = base::SplitString(lines[0], base::kWhitespaceASCII,
diff --git a/update_attempter.cc b/update_attempter.cc
index f1ec174..6019e6d 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -32,7 +32,6 @@
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <base/time/time.h>
-#include <brillo/bind_lambda.h>
#include <brillo/data_encoding.h>
#include <brillo/errors/error_codes.h>
#include <brillo/message_loops/message_loop.h>
diff --git a/update_attempter_unittest.cc b/update_attempter_unittest.cc
index 8fe2cb9..676f13a 100644
--- a/update_attempter_unittest.cc
+++ b/update_attempter_unittest.cc
@@ -22,7 +22,6 @@
#include <base/files/file_util.h>
#include <base/message_loop/message_loop.h>
-#include <brillo/bind_lambda.h>
#include <brillo/message_loops/base_message_loop.h>
#include <brillo/message_loops/message_loop.h>
#include <brillo/message_loops/message_loop_utils.h>
diff --git a/update_manager/real_shill_provider_unittest.cc b/update_manager/real_shill_provider_unittest.cc
index af674d0..6506923 100644
--- a/update_manager/real_shill_provider_unittest.cc
+++ b/update_manager/real_shill_provider_unittest.cc
@@ -94,7 +94,9 @@
now_exp.minute = 5;
now_exp.second = 33;
now_exp.millisecond = 675;
- return Time::FromLocalExploded(now_exp);
+ Time time;
+ ignore_result(Time::FromLocalExploded(now_exp, &time));
+ return time;
}
Time ConnChangedTime() {
diff --git a/update_manager/real_time_provider.cc b/update_manager/real_time_provider.cc
index 92f985f..baa8ae3 100644
--- a/update_manager/real_time_provider.cc
+++ b/update_manager/real_time_provider.cc
@@ -43,7 +43,10 @@
Time::Exploded now_exp;
clock_->GetWallclockTime().LocalExplode(&now_exp);
now_exp.hour = now_exp.minute = now_exp.second = now_exp.millisecond = 0;
- return new Time(Time::FromLocalExploded(now_exp));
+ Time* now = new Time();
+ bool success = Time::FromLocalExploded(now_exp, now);
+ DCHECK(success);
+ return now;
}
private:
diff --git a/update_manager/real_time_provider_unittest.cc b/update_manager/real_time_provider_unittest.cc
index 093b158..ce2a718 100644
--- a/update_manager/real_time_provider_unittest.cc
+++ b/update_manager/real_time_provider_unittest.cc
@@ -51,7 +51,9 @@
now_exp.minute = 5;
now_exp.second = 33;
now_exp.millisecond = 675;
- return Time::FromLocalExploded(now_exp);
+ Time time;
+ ignore_result(Time::FromLocalExploded(now_exp, &time));
+ return time;
}
FakeClock fake_clock_;
@@ -66,7 +68,8 @@
exploded.minute = 0;
exploded.second = 0;
exploded.millisecond = 0;
- const Time expected = Time::FromLocalExploded(exploded);
+ Time expected;
+ ignore_result(Time::FromLocalExploded(exploded, &expected));
fake_clock_.SetWallclockTime(now);
UmTestUtils::ExpectVariableHasValue(expected, provider_->var_curr_date());
diff --git a/update_manager/real_updater_provider_unittest.cc b/update_manager/real_updater_provider_unittest.cc
index efe042c..b653885 100644
--- a/update_manager/real_updater_provider_unittest.cc
+++ b/update_manager/real_updater_provider_unittest.cc
@@ -57,7 +57,9 @@
now_exp.minute = 5;
now_exp.second = 33;
now_exp.millisecond = 675;
- return Time::FromLocalExploded(now_exp);
+ Time time;
+ ignore_result(Time::FromLocalExploded(now_exp, &time));
+ return time;
}
// Rounds down a timestamp to the nearest second. This is useful when faking
@@ -66,7 +68,9 @@
Time::Exploded exp;
time.LocalExplode(&exp);
exp.millisecond = 0;
- return Time::FromLocalExploded(exp);
+ Time rounded_time;
+ ignore_result(Time::FromLocalExploded(exp, &rounded_time));
+ return rounded_time;
}
ACTION_P(ActionSetUpdateEngineStatusLastCheckedTime, time) {
diff --git a/update_manager/update_manager_unittest.cc b/update_manager/update_manager_unittest.cc
index 9625b53..125a60c 100644
--- a/update_manager/update_manager_unittest.cc
+++ b/update_manager/update_manager_unittest.cc
@@ -67,7 +67,9 @@
now_exp.minute = 5;
now_exp.second = 33;
now_exp.millisecond = 675;
- return Time::FromLocalExploded(now_exp);
+ Time time;
+ ignore_result(Time::FromLocalExploded(now_exp, &time));
+ return time;
}
} // namespace
diff --git a/update_manager/update_time_restrictions_policy_impl_unittest.cc b/update_manager/update_time_restrictions_policy_impl_unittest.cc
index ac4e0e9..f7ee138 100644
--- a/update_manager/update_time_restrictions_policy_impl_unittest.cc
+++ b/update_manager/update_time_restrictions_policy_impl_unittest.cc
@@ -57,7 +57,9 @@
fake_state_.device_policy_provider()
->var_auto_launched_kiosk_app_id()
->reset(new string("myapp"));
- fake_clock_.SetWallclockTime(Time::FromLocalExploded(exploded));
+ base::Time time;
+ CHECK(Time::FromLocalExploded(exploded, &time));
+ fake_clock_.SetWallclockTime(time);
SetUpDefaultTimeProvider();
fake_state_.device_policy_provider()
->var_disallowed_time_intervals()