Rename {absl => std}::optional in //chrome/
#cleanup
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
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 "^chrome/" \
| 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>"
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"
git cl format
```
Bug: chromium:1500249
Change-Id: I5f8d179940c7af6a927efbf7e70b972a845a4127
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5192010
Reviewed-by: Anastasiia N <[email protected]>
Commit-Queue: Arthur Sonzogni <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Auto-Submit: Arthur Sonzogni <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1247101}
diff --git a/chrome/browser/certificate_provider/sign_requests.h b/chrome/browser/certificate_provider/sign_requests.h
index 7470b71..c765a8c6 100644
--- a/chrome/browser/certificate_provider/sign_requests.h
+++ b/chrome/browser/certificate_provider/sign_requests.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_CERTIFICATE_PROVIDER_SIGN_REQUESTS_H_
#include <map>
+#include <optional>
#include <string>
#include <utility>
#include <vector>
@@ -15,7 +16,6 @@
#include "components/account_id/account_id.h"
#include "net/cert/x509_certificate.h"
#include "net/ssl/ssl_private_key.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
namespace chromeos {
namespace certificate_provider {
@@ -29,11 +29,10 @@
// Returns the id of the new request. The returned request id is specific to
// the given extension.
- int AddRequest(
- const std::string& extension_id,
- const scoped_refptr<net::X509Certificate>& certificate,
- const absl::optional<AccountId>& authenticating_user_account_id,
- net::SSLPrivateKey::SignCallback callback);
+ int AddRequest(const std::string& extension_id,
+ const scoped_refptr<net::X509Certificate>& certificate,
+ const std::optional<AccountId>& authenticating_user_account_id,
+ net::SSLPrivateKey::SignCallback callback);
// Returns the list of requests that correspond to the authentication of the
// given user.
@@ -56,14 +55,14 @@
private:
struct Request {
Request(const scoped_refptr<net::X509Certificate>& certificate,
- const absl::optional<AccountId>& authenticating_user_account_id,
+ const std::optional<AccountId>& authenticating_user_account_id,
net::SSLPrivateKey::SignCallback callback);
Request(Request&& other);
Request& operator=(Request&&);
~Request();
scoped_refptr<net::X509Certificate> certificate;
- absl::optional<AccountId> authenticating_user_account_id;
+ std::optional<AccountId> authenticating_user_account_id;
net::SSLPrivateKey::SignCallback callback;
};