Rename {absl => std}::optional in //ui/
#cleanup
Automated patch. This is a no-op. Please avoid, as much as possible,
assigning unrelated bugs to this.
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.
This patch:
----------
This applies the rename to ui/
Script:
-------
````
cd ui
function replace {
echo "Replacing $1 by $2"
git grep -l "$1" \
| cut -f1 -d: \
| grep \
-e "\.h" \
-e "\.cc" \
-e "\.mm" \
| sort \
| uniq \
| 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>"
cd ..
git status
echo "Formatting"
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"
```
# Skipping win-presubmit, due to a bug in depot_tools:
# See https://g-issues.chromium.org/issues/324293047
NOPRESUBMIT=true
CQ_INCLUDE_TRYBOTS=luci.chrome.try:chromeos-betty-pi-arc-chrome
AX-Relnotes: n/a.
Cleanup: This is a cleanup.
Bug: chromium:1500249
Change-Id: I134bbce97a0ae63ae432a5733e934828f8f49c77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5279376
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1258447}
diff --git a/ui/base/data_transfer_policy/data_transfer_endpoint.h b/ui/base/data_transfer_policy/data_transfer_endpoint.h
index 9df1ad0..7e3af20 100644
--- a/ui/base/data_transfer_policy/data_transfer_endpoint.h
+++ b/ui/base/data_transfer_policy/data_transfer_endpoint.h
@@ -5,8 +5,9 @@
#ifndef UI_BASE_DATA_TRANSFER_POLICY_DATA_TRANSFER_ENDPOINT_H_
#define UI_BASE_DATA_TRANSFER_POLICY_DATA_TRANSFER_ENDPOINT_H_
+#include <optional>
+
#include "build/build_config.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
namespace ui {
@@ -83,7 +84,7 @@
// The URL of the data endpoint. It always has a value if `type_` ==
// EndpointType::kUrl, otherwise it's empty.
- absl::optional<GURL> url_;
+ std::optional<GURL> url_;
// Whether the endpoint corresponds to an OTR browser context. This should
// only be set to true for `EndpointType::kUrl` endpoints.