components: Replace base::Optional and friends with absl counterparts
This replaces:
- base::Optional -> absl::optional
- include "base/optional.h"
->
include "third_party/abseil-cpp/absl/types/optional.h"
- base::nullopt -> absl::nullopt
- base::make_optional -> absl::make_optional
Bug: 1202909
Change-Id: If697b7bf69b199c1796f873eedca3359cdb48c64
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2897151
Commit-Queue: Anton Bikineev <[email protected]>
Owners-Override: Anton Bikineev <[email protected]>
Reviewed-by: Peter Kasting <[email protected]>
Cr-Commit-Position: refs/heads/master@{#883296}
diff --git a/components/os_crypt/key_storage_libsecret.cc b/components/os_crypt/key_storage_libsecret.cc
index 3125706..0857cc1 100644
--- a/components/os_crypt/key_storage_libsecret.cc
+++ b/components/os_crypt/key_storage_libsecret.cc
@@ -64,7 +64,7 @@
} // namespace
-base::Optional<std::string>
+absl::optional<std::string>
KeyStorageLibsecret::AddRandomPasswordInLibsecret() {
std::string password;
base::Base64Encode(base::RandBytesAsString(16), &password);
@@ -75,18 +75,18 @@
if (error) {
VLOG(1) << "Libsecret lookup failed: " << error->message;
g_error_free(error);
- return base::nullopt;
+ return absl::nullopt;
}
if (!success) {
VLOG(1) << "Libsecret lookup failed.";
- return base::nullopt;
+ return absl::nullopt;
}
VLOG(1) << "OSCrypt generated a new password.";
return password;
}
-base::Optional<std::string> KeyStorageLibsecret::GetKeyImpl() {
+absl::optional<std::string> KeyStorageLibsecret::GetKeyImpl() {
LibsecretAttributesBuilder attrs;
attrs.Append("application", kApplicationName);
@@ -95,7 +95,7 @@
SECRET_SEARCH_UNLOCK | SECRET_SEARCH_LOAD_SECRETS);
if (!helper.success()) {
VLOG(1) << "Libsecret lookup failed: " << helper.error()->message;
- return base::nullopt;
+ return absl::nullopt;
}
SecretValue* password_libsecret = ToSingleSecret(helper.results());
@@ -103,7 +103,7 @@
return AddRandomPasswordInLibsecret();
}
AnalyseKeyHistory(helper.results());
- base::Optional<std::string> password(
+ absl::optional<std::string> password(
LibsecretLoader::secret_value_get_text(password_libsecret));
LibsecretLoader::secret_value_unref(password_libsecret);
return password;