Replace libchrome size() with C++ standard ones
This change is for partially replacing <base/stl_util.h>'s base::size()
with std::size() in the C++ standard.
Also remove #include <base/stl_util.h>.
Test: build
Bug: 360917504
Change-Id: I09dbec56cda00c00f195875395461676bd55287a
diff --git a/common/http_fetcher_unittest.cc b/common/http_fetcher_unittest.cc
index b229660..d5b319a 100644
--- a/common/http_fetcher_unittest.cc
+++ b/common/http_fetcher_unittest.cc
@@ -1031,7 +1031,7 @@
unique_ptr<HttpServer> server(this->test_.CreateServer());
ASSERT_TRUE(server->started_);
- for (size_t c = 0; c < base::size(kRedirectCodes); ++c) {
+ for (size_t c = 0; c < std::size(kRedirectCodes); ++c) {
const string url = base::StringPrintf(
"/redirect/%d/download/%d", kRedirectCodes[c], kMediumLength);
RedirectTest(server.get(), true, url, this->test_.NewLargeFetcher());
@@ -1048,7 +1048,7 @@
string url;
for (int r = 0; r < kDownloadMaxRedirects; r++) {
url += base::StringPrintf("/redirect/%d",
- kRedirectCodes[r % base::size(kRedirectCodes)]);
+ kRedirectCodes[r % std::size(kRedirectCodes)]);
}
url += base::StringPrintf("/download/%d", kMediumLength);
RedirectTest(server.get(), true, url, this->test_.NewLargeFetcher());
@@ -1064,7 +1064,7 @@
string url;
for (int r = 0; r < kDownloadMaxRedirects + 1; r++) {
url += base::StringPrintf("/redirect/%d",
- kRedirectCodes[r % base::size(kRedirectCodes)]);
+ kRedirectCodes[r % std::size(kRedirectCodes)]);
}
url += base::StringPrintf("/download/%d", kMediumLength);
RedirectTest(server.get(), false, url, this->test_.NewLargeFetcher());
diff --git a/common/subprocess.cc b/common/subprocess.cc
index 9e53d6d..03ec22a 100644
--- a/common/subprocess.cc
+++ b/common/subprocess.cc
@@ -30,7 +30,6 @@
#include <base/bind.h>
#include <base/logging.h>
#include <base/posix/eintr_wrapper.h>
-#include <base/stl_util.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <brillo/secure_blob.h>
@@ -128,7 +127,7 @@
bytes_read = 0;
bool eof;
bool ok = utils::ReadAll(
- record->stdout_fd, buf, base::size(buf), &bytes_read, &eof);
+ record->stdout_fd, buf, std::size(buf), &bytes_read, &eof);
record->stdout_str.append(buf, bytes_read);
if (!ok || eof) {
// There was either an error or an EOF condition, so we are done watching