[go: nahoru, domu]

Rename {absl => std}::optional in //device/

#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.

Script:
```
cd device
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"
```

Cleanup: This is a cleanup.
Bug: chromium:1500249
Change-Id: Idc47626610dccfdc75c8687c5272aa665ff648de
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5272413
Auto-Submit: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1257543}
diff --git a/device/bluetooth/bluetooth_remote_gatt_descriptor_winrt.cc b/device/bluetooth/bluetooth_remote_gatt_descriptor_winrt.cc
index 3c8d780..eadc38f2 100644
--- a/device/bluetooth/bluetooth_remote_gatt_descriptor_winrt.cc
+++ b/device/bluetooth/bluetooth_remote_gatt_descriptor_winrt.cc
@@ -307,7 +307,7 @@
   }
 
   value_.assign(data, data + length);
-  std::move(pending_read_callback).Run(/*error_code=*/absl::nullopt, value_);
+  std::move(pending_read_callback).Run(/*error_code=*/std::nullopt, value_);
 }
 
 void BluetoothRemoteGattDescriptorWinrt::OnWriteValueWithResult(