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/cookie_browsertest.cc b/content/browser/renderer_host/cookie_browsertest.cc
index ee45542..95958aa6 100644
--- a/content/browser/renderer_host/cookie_browsertest.cc
+++ b/content/browser/renderer_host/cookie_browsertest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <optional>
#include <string>
#include "base/command_line.h"
@@ -43,7 +44,6 @@
#include "services/service_manager/public/cpp/interface_provider.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
namespace content {
@@ -68,8 +68,8 @@
net::CookieOptions::SameSiteCookieContext::MakeInclusive());
auto cookie_obj = net::CanonicalCookie::Create(
- url, cookie_line, base::Time::Now(), absl::nullopt /* server_time */,
- absl::nullopt /* cookie_partition_key */);
+ url, cookie_line, base::Time::Now(), std::nullopt /* server_time */,
+ std::nullopt /* cookie_partition_key */);
base::RunLoop run_loop;
tab->GetBrowserContext()
@@ -434,7 +434,7 @@
mojo::PendingRemote<network::mojom::RestrictedCookieManager> real_rcm)
: receiver_(this, std::move(receiver)), real_rcm_(std::move(real_rcm)) {}
- void set_override_url(absl::optional<std::string> maybe_url) {
+ void set_override_url(std::optional<std::string> maybe_url) {
override_url_ = std::move(maybe_url);
}
@@ -470,7 +470,7 @@
return override_url_ ? GURL(override_url_.value()) : url_in;
}
- absl::optional<std::string> override_url_;
+ std::optional<std::string> override_url_;
mojo::Receiver<network::mojom::RestrictedCookieManager> receiver_;
mojo::Remote<network::mojom::RestrictedCookieManager> real_rcm_;
@@ -504,14 +504,14 @@
return false; // only made a proxy, still need the actual impl to be made.
}
- void set_override_url(absl::optional<std::string> maybe_url) {
+ void set_override_url(std::optional<std::string> maybe_url) {
override_url_ = maybe_url;
if (rcm_interceptor_)
rcm_interceptor_->set_override_url(override_url_);
}
private:
- absl::optional<std::string> override_url_;
+ std::optional<std::string> override_url_;
std::unique_ptr<RestrictedCookieManagerInterceptor> rcm_interceptor_;
};