update_engine: changes for libchrome r680000 uprev
Changes applied include:
Replace arraysize by base::size.
Replace base::MessageLoop::current()->task_runner by
base::ThreadTaskRunnerHandle::Get, and
base::MessageLoopForIO::current by base::MessageLoopCurrent::IsSet.
Remove use of base::ContainsKey.
Replace base::Int{,64}ToString by base::NumberTostring.
The changes are all compatible with current libchrome r576279.
BUG=chromium:1054279
TEST=unittest
Change-Id: Ibb6027a5070e0e2d4554a6684350168542fedf5e
Reviewed-on: https://chromium-review.googlesource.com/c/aosp/platform/system/update_engine/+/2065691
Reviewed-by: Amin Hassani <ahassani@chromium.org>
Tested-by: Qijiang Fan <fqj@google.com>
Commit-Queue: Qijiang Fan <fqj@google.com>
diff --git a/libcurl_http_fetcher.cc b/libcurl_http_fetcher.cc
index 4bea4ef..d317d48 100644
--- a/libcurl_http_fetcher.cc
+++ b/libcurl_http_fetcher.cc
@@ -80,7 +80,7 @@
#endif // __ANDROID__
LibcurlHttpFetcher* fetcher = static_cast<LibcurlHttpFetcher*>(clientp);
// Stop watching the socket before closing it.
- for (size_t t = 0; t < arraysize(fetcher->fd_controller_maps_); ++t) {
+ for (size_t t = 0; t < base::size(fetcher->fd_controller_maps_); ++t) {
fetcher->fd_controller_maps_[t].erase(item);
}
@@ -676,7 +676,7 @@
// We should iterate through all file descriptors up to libcurl's fd_max or
// the highest one we're tracking, whichever is larger.
- for (size_t t = 0; t < arraysize(fd_controller_maps_); ++t) {
+ for (size_t t = 0; t < base::size(fd_controller_maps_); ++t) {
if (!fd_controller_maps_[t].empty())
fd_max = max(fd_max, fd_controller_maps_[t].rbegin()->first);
}
@@ -694,7 +694,7 @@
is_exc || (FD_ISSET(fd, &fd_write) != 0) // track 1 -- write
};
- for (size_t t = 0; t < arraysize(fd_controller_maps_); ++t) {
+ for (size_t t = 0; t < base::size(fd_controller_maps_); ++t) {
bool tracked =
fd_controller_maps_[t].find(fd) != fd_controller_maps_[t].end();
@@ -775,7 +775,7 @@
MessageLoop::current()->CancelTask(timeout_id_);
timeout_id_ = MessageLoop::kTaskIdNull;
- for (size_t t = 0; t < arraysize(fd_controller_maps_); ++t) {
+ for (size_t t = 0; t < base::size(fd_controller_maps_); ++t) {
fd_controller_maps_[t].clear();
}