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

@ -7,6 +7,7 @@
#include <cstdint>
#include <memory>
#include <optional>
#include <set>
#include <string>
#include <vector>
@ -33,7 +34,6 @@
#include "services/network/url_loader_factory.h"
#include "shell/browser/net/electron_url_loader_factory.h"
#include "shell/browser/net/web_request_api_interface.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
namespace electron {
@ -83,7 +83,7 @@ class ProxyingURLLoaderFactory
const std::vector<std::string>& removed_headers,
const net::HttpRequestHeaders& modified_headers,
const net::HttpRequestHeaders& modified_cors_exempt_headers,
const absl::optional<GURL>& new_url) override;
const std::optional<GURL>& new_url) override;
void SetPriority(net::RequestPriority priority,
int32_t intra_priority_value) override;
void PauseReadingBodyFromNet() override;
@ -95,7 +95,7 @@ class ProxyingURLLoaderFactory
void OnReceiveResponse(
network::mojom::URLResponseHeadPtr head,
mojo::ScopedDataPipeConsumerHandle body,
absl::optional<mojo_base::BigBuffer> cached_metadata) override;
std::optional<mojo_base::BigBuffer> cached_metadata) override;
void OnReceiveRedirect(const net::RedirectInfo& redirect_info,
network::mojom::URLResponseHeadPtr head) override;
void OnUploadProgress(int64_t current_position,
@ -135,7 +135,7 @@ class ProxyingURLLoaderFactory
raw_ptr<ProxyingURLLoaderFactory> const factory_;
network::ResourceRequest request_;
const absl::optional<url::Origin> original_initiator_;
const std::optional<url::Origin> original_initiator_;
const uint64_t request_id_ = 0;
const int32_t network_service_request_id_ = 0;
const int32_t frame_routing_id_ = MSG_ROUTING_NONE;
@ -144,7 +144,7 @@ class ProxyingURLLoaderFactory
mojo::Receiver<network::mojom::URLLoader> proxied_loader_receiver_;
mojo::Remote<network::mojom::URLLoaderClient> target_client_;
absl::optional<extensions::WebRequestInfo> info_;
std::optional<extensions::WebRequestInfo> info_;
mojo::Receiver<network::mojom::URLLoaderClient> proxied_client_receiver_{
this};
@ -180,7 +180,7 @@ class ProxyingURLLoaderFactory
std::vector<std::string> removed_headers;
net::HttpRequestHeaders modified_headers;
net::HttpRequestHeaders modified_cors_exempt_headers;
absl::optional<GURL> new_url;
std::optional<GURL> new_url;
// disable copy
FollowRedirectParams(const FollowRedirectParams&) = delete;
@ -188,7 +188,7 @@ class ProxyingURLLoaderFactory
};
std::unique_ptr<FollowRedirectParams> pending_follow_redirect_params_;
absl::optional<mojo_base::BigBuffer> current_cached_metadata_;
std::optional<mojo_base::BigBuffer> current_cached_metadata_;
base::WeakPtrFactory<InProgressRequest> weak_factory_{this};
};
@ -200,7 +200,7 @@ class ProxyingURLLoaderFactory
int frame_routing_id,
uint64_t* request_id_generator,
std::unique_ptr<extensions::ExtensionNavigationUIData> navigation_ui_data,
absl::optional<int64_t> navigation_id,
std::optional<int64_t> navigation_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> loader_request,
mojo::PendingRemote<network::mojom::URLLoaderFactory>
target_factory_remote,
@ -264,7 +264,7 @@ class ProxyingURLLoaderFactory
const int frame_routing_id_;
raw_ptr<uint64_t> request_id_generator_; // managed by ElectronBrowserClient
std::unique_ptr<extensions::ExtensionNavigationUIData> navigation_ui_data_;
absl::optional<int64_t> navigation_id_;
std::optional<int64_t> navigation_id_;
mojo::ReceiverSet<network::mojom::URLLoaderFactory> proxy_receivers_;
mojo::Remote<network::mojom::URLLoaderFactory> target_factory_;
mojo::Receiver<network::mojom::TrustedURLLoaderHeaderClient>