Changes to make build work in Chromium.

PiperOrigin-RevId: 601861725
This commit is contained in:
Francis Tsui
2024-01-26 14:05:09 -08:00
committed by Copybara-Service
parent aaa1bea130
commit 05914245e8
3 changed files with 67 additions and 40 deletions
+10 -1
View File
@@ -27,10 +27,19 @@ void TruncateUtf8ToByteSize(const std::string& input, size_t byte_size,
std::string* output) {}
} // namespace nearby::utils
#elif defined(NEARBY_CHROMIUM)
// Forward to chromium implementations.
#include "base/strings/string_util.h"
namespace nearby::utils {
bool IsStringUtf8(std::string_view str) {
return base::IsStringUTF8(str);
}
void TruncateUtf8ToByteSize(const std::string& input, size_t byte_size,
std::string* output) {
base::TruncateUTF8ToByteSize(input, byte_size, output);
}
} // namespace nearby::utils
#else // defined(GITHUB_BUILD)
#include "sharing/internal/base/strings/utf_string_conversions.h" // IWYU pragma: export
#endif // defined(GITHUB_BUILD)
+3 -1
View File
@@ -17,7 +17,9 @@
#if defined(NEARBY_CHROMIUM)
// Chromium does not use absl log. Forward to Chromium native log macros.
// TODO(ftsui): include chromium logging header.
#include "base/check.h"
#include "base/check_op.h"
#include "glog/logging.h"
#else // defined(NEARBY_CHROMIUM)
#include "absl/log/check.h"
#include "absl/log/log.h"