Rename {absl => std}::optional in //chrome/
#cleanup
Automated patch, intended to be effectively a no-op.
Context:
https://groups.google.com/a/chromium.org/g/cxx/c/nBD_1LaanTc/m/ghh-ZZhWAwAJ?utm_medium=email
As of https://crrev.com/1204351, absl::optional is now a type alias for
std::optional. We should migrate toward it.
Script:
```
function replace {
echo "Replacing $1 by $2"
git grep -l "$1" \
| cut -f1 -d: \
| grep \
-e "^chrome/" \
| sort \
| uniq \
| grep \
-e "\.h" \
-e "\.cc" \
-e "\.mm" \
-e "\.py" \
| xargs sed -i "s/$1/$2/g"
}
replace "absl::make_optional" "std::make_optional"
replace "absl::optional" "std::optional"
replace "absl::nullopt" "std::nullopt"
replace "absl::in_place" "std::in_place"
replace "absl::in_place_t" "std::in_place_t"
replace "\"third_party\/abseil-cpp\/absl\/types\/optional.h\"" "<optional>"
echo "IncludeBlocks: Regroup" >> ".clang-format"
echo "IncludeIsMainRegex: \"(_(android|apple|chromeos|freebsd|fuchsia|fuzzer|ios|linux|mac|nacl|openbsd|posix|stubs?|win))?(_(unit|browser|perf)?tests?)?$\"" >> ".clang-format"
git cl format
git restore ".clang-format"
git cl format
```
Bug: chromium:1500249
Change-Id: I5f8d179940c7af6a927efbf7e70b972a845a4127
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5192010
Reviewed-by: Anastasiia N <[email protected]>
Commit-Queue: Arthur Sonzogni <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Auto-Submit: Arthur Sonzogni <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1247101}
diff --git a/chrome/browser/sharing/sharing_utils_unittest.cc b/chrome/browser/sharing/sharing_utils_unittest.cc
index d8d5c825..09a97130 100644
--- a/chrome/browser/sharing/sharing_utils_unittest.cc
+++ b/chrome/browser/sharing/sharing_utils_unittest.cc
@@ -126,28 +126,28 @@
TEST_F(SharingUtilsTest, GetDevicePlatform) {
EXPECT_EQ(GetDevicePlatform(*CreateFakeDeviceInfo(
- kDeviceGuid, kDeviceName, /*sharing_info=*/absl::nullopt,
+ kDeviceGuid, kDeviceName, /*sharing_info=*/std::nullopt,
sync_pb::SyncEnums_DeviceType_TYPE_CROS,
syncer::DeviceInfo::OsType::kChromeOsAsh,
syncer::DeviceInfo::FormFactor::kDesktop)),
SharingDevicePlatform::kChromeOS);
EXPECT_EQ(GetDevicePlatform(*CreateFakeDeviceInfo(
- kDeviceGuid, kDeviceName, /*sharing_info=*/absl::nullopt,
+ kDeviceGuid, kDeviceName, /*sharing_info=*/std::nullopt,
sync_pb::SyncEnums_DeviceType_TYPE_LINUX,
syncer::DeviceInfo::OsType::kLinux,
syncer::DeviceInfo::FormFactor::kDesktop)),
SharingDevicePlatform::kLinux);
EXPECT_EQ(GetDevicePlatform(*CreateFakeDeviceInfo(
- kDeviceGuid, kDeviceName, /*sharing_info=*/absl::nullopt,
+ kDeviceGuid, kDeviceName, /*sharing_info=*/std::nullopt,
sync_pb::SyncEnums_DeviceType_TYPE_MAC,
syncer::DeviceInfo::OsType::kMac,
syncer::DeviceInfo::FormFactor::kDesktop)),
SharingDevicePlatform::kMac);
EXPECT_EQ(GetDevicePlatform(*CreateFakeDeviceInfo(
- kDeviceGuid, kDeviceName, /*sharing_info=*/absl::nullopt,
+ kDeviceGuid, kDeviceName, /*sharing_info=*/std::nullopt,
sync_pb::SyncEnums_DeviceType_TYPE_WIN,
syncer::DeviceInfo::OsType::kWindows,
syncer::DeviceInfo::FormFactor::kDesktop)),
@@ -155,40 +155,40 @@
EXPECT_EQ(
GetDevicePlatform(*CreateFakeDeviceInfo(
- kDeviceGuid, kDeviceName, /*sharing_info=*/absl::nullopt,
+ kDeviceGuid, kDeviceName, /*sharing_info=*/std::nullopt,
sync_pb::SyncEnums_DeviceType_TYPE_PHONE,
syncer::DeviceInfo::OsType::kIOS,
syncer::DeviceInfo::FormFactor::kPhone, "Apple Inc.", "iPhone 50")),
SharingDevicePlatform::kIOS);
EXPECT_EQ(
GetDevicePlatform(*CreateFakeDeviceInfo(
- kDeviceGuid, kDeviceName, /*sharing_info=*/absl::nullopt,
+ kDeviceGuid, kDeviceName, /*sharing_info=*/std::nullopt,
sync_pb::SyncEnums_DeviceType_TYPE_TABLET,
syncer::DeviceInfo::OsType::kIOS,
syncer::DeviceInfo::FormFactor::kTablet, "Apple Inc.", "iPad 99")),
SharingDevicePlatform::kIOS);
EXPECT_EQ(GetDevicePlatform(*CreateFakeDeviceInfo(
- kDeviceGuid, kDeviceName, /*sharing_info=*/absl::nullopt,
+ kDeviceGuid, kDeviceName, /*sharing_info=*/std::nullopt,
sync_pb::SyncEnums_DeviceType_TYPE_PHONE,
syncer::DeviceInfo::OsType::kAndroid,
syncer::DeviceInfo::FormFactor::kPhone, "Google", "Pixel 777")),
SharingDevicePlatform::kAndroid);
EXPECT_EQ(GetDevicePlatform(*CreateFakeDeviceInfo(
- kDeviceGuid, kDeviceName, /*sharing_info=*/absl::nullopt,
+ kDeviceGuid, kDeviceName, /*sharing_info=*/std::nullopt,
sync_pb::SyncEnums_DeviceType_TYPE_TABLET,
syncer::DeviceInfo::OsType::kAndroid,
syncer::DeviceInfo::FormFactor::kTablet, "Google", "Pixel Z")),
SharingDevicePlatform::kAndroid);
EXPECT_EQ(GetDevicePlatform(*CreateFakeDeviceInfo(
- kDeviceGuid, kDeviceName, /*sharing_info=*/absl::nullopt,
+ kDeviceGuid, kDeviceName, /*sharing_info=*/std::nullopt,
sync_pb::SyncEnums_DeviceType_TYPE_UNSET,
syncer::DeviceInfo::OsType::kUnknown,
syncer::DeviceInfo::FormFactor::kUnknown)),
SharingDevicePlatform::kUnknown);
EXPECT_EQ(GetDevicePlatform(*CreateFakeDeviceInfo(
- kDeviceGuid, kDeviceName, /*sharing_info=*/absl::nullopt,
+ kDeviceGuid, kDeviceName, /*sharing_info=*/std::nullopt,
sync_pb::SyncEnums_DeviceType_TYPE_OTHER,
syncer::DeviceInfo::OsType::kUnknown,
syncer::DeviceInfo::FormFactor::kUnknown)),