chore: replace absl::optional<T> with std::optional<T> (#40928)

* chore: replace absl::optional<T> with std::optional<T>

* IWYU
This commit is contained in:
Milan Burda 2024-01-10 23:23:35 +01:00 committed by GitHub
parent fac964ac0d
commit 892c9d78a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
129 changed files with 419 additions and 397 deletions

View file

@ -44,16 +44,16 @@ ProxyingWebSocket::ProxyingWebSocket(
/*is_download=*/false,
/*is_async=*/true,
/*is_service_worker_script=*/false,
/*navigation_id=*/absl::nullopt)) {}
/*navigation_id=*/std::nullopt)) {}
ProxyingWebSocket::~ProxyingWebSocket() {
if (on_before_send_headers_callback_) {
std::move(on_before_send_headers_callback_)
.Run(net::ERR_ABORTED, absl::nullopt);
.Run(net::ERR_ABORTED, std::nullopt);
}
if (on_headers_received_callback_) {
std::move(on_headers_received_callback_)
.Run(net::ERR_ABORTED, absl::nullopt, GURL());
.Run(net::ERR_ABORTED, std::nullopt, GURL());
}
}
@ -229,7 +229,7 @@ void ProxyingWebSocket::StartProxying(
WebSocketFactory factory,
const GURL& url,
const net::SiteForCookies& site_for_cookies,
const absl::optional<std::string>& user_agent,
const std::optional<std::string>& user_agent,
mojo::PendingRemote<network::mojom::WebSocketHandshakeClient>
handshake_client,
bool has_extra_headers,
@ -358,11 +358,11 @@ void ProxyingWebSocket::OnHeadersReceivedComplete(int error_code) {
}
if (on_headers_received_callback_) {
absl::optional<std::string> headers;
std::optional<std::string> headers;
if (override_headers_)
headers = override_headers_->raw_headers();
std::move(on_headers_received_callback_)
.Run(net::OK, headers, absl::nullopt);
.Run(net::OK, headers, std::nullopt);
}
if (override_headers_) {
@ -384,7 +384,7 @@ void ProxyingWebSocket::OnAuthRequiredComplete(AuthRequiredResponse rv) {
switch (rv) {
case AuthRequiredResponse::kNoAction:
case AuthRequiredResponse::kCancelAuth:
std::move(auth_required_callback_).Run(absl::nullopt);
std::move(auth_required_callback_).Run(std::nullopt);
break;
case AuthRequiredResponse::kSetAuth: