Rename {absl => std}::optional in //content/
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&utm_source=footer
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 "^content" \
| 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>"
git cl format
```
# Skipping unrelated "check_network_annotation" errors.
NOTRY=True
Bug: chromium:1500249
Change-Id: Icfd31a71d8faf63a2e8d5401127e7ee74cc1c413
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5185537
Auto-Submit: Arthur Sonzogni <[email protected]>
Commit-Queue: Arthur Sonzogni <[email protected]>
Owners-Override: Avi Drissman <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Reviewed-by: danakj <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1245739}
diff --git a/content/browser/renderer_host/navigation_request_unittest.cc b/content/browser/renderer_host/navigation_request_unittest.cc
index 1b2a30979..54c4d4cf 100644
--- a/content/browser/renderer_host/navigation_request_unittest.cc
+++ b/content/browser/renderer_host/navigation_request_unittest.cc
@@ -4,6 +4,7 @@
#include "content/browser/renderer_host/navigation_request.h"
+#include <optional>
#include <string>
#include <vector>
@@ -29,7 +30,6 @@
#include "net/ssl/ssl_connection_status_flags.h"
#include "services/network/public/cpp/content_security_policy/content_security_policy.h"
#include "testing/gmock/include/gmock/gmock.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/navigation/navigation_params.h"
#include "third_party/blink/public/common/origin_trials/scoped_test_origin_trial_policy.h"
@@ -95,7 +95,7 @@
// throttle checks when they are finished.
void SimulateWillFailRequest(
net::Error net_error_code,
- const absl::optional<net::SSLInfo> ssl_info = absl::nullopt) {
+ const std::optional<net::SSLInfo> ssl_info = std::nullopt) {
was_callback_called_ = false;
callback_result_ = NavigationThrottle::DEFER;
GetNavigationRequest()->set_net_error(net_error_code);
@@ -196,7 +196,7 @@
std::move(commit_params), false /* was_opener_suppressed */,
std::string() /* extra_headers */, nullptr /* frame_entry */,
nullptr /* entry */, false /* is_form_submission */,
- nullptr /* navigation_ui_data */, absl::nullopt /* impression */,
+ nullptr /* navigation_ui_data */, std::nullopt /* impression */,
false /* is_pdf */);
main_test_rfh()->frame_tree_node()->TakeNavigationRequest(
std::move(request));