diff --git a/ash/test/pixel/README.md b/ash/test/pixel/README.md index 3b55d9355b1d6..4a627ccd96cce 100644 --- a/ash/test/pixel/README.md +++ b/ash/test/pixel/README.md @@ -24,7 +24,7 @@ with Chrome testing, read this [doc][3] first. class DemoAshPixelDiffTest : public AshTestBase { public: // AshTestBase: - absl::optional<pixel_test::InitParams> CreatePixelTestInitParams() + std::optional<pixel_test::InitParams> CreatePixelTestInitParams() const override { return pixel_test::InitParams(); } @@ -190,7 +190,7 @@ create a pixel test to verify the right-to-left UI layout in the code below: class DemoRTLTest : public AshTestBase { public: // AshTestBase: - absl::optional<pixel_test::InitParams> CreatePixelTestInitParams() + std::optional<pixel_test::InitParams> CreatePixelTestInitParams() const override { pixel_test::InitParams init_params; init_params.under_rtl = true; diff --git a/base/json/json_reader.h b/base/json/json_reader.h index 12701ffedbf3b..b0b6f1949471a 100644 --- a/base/json/json_reader.h +++ b/base/json/json_reader.h @@ -110,14 +110,14 @@ class BASE_EXPORT JSONReader { JSONReader& operator=(const JSONReader&) = delete; // Reads and parses |json|, returning a Value. - // If |json| is not a properly formed JSON string, returns absl::nullopt. + // If |json| is not a properly formed JSON string, returns std::nullopt. static std::optional<Value> Read( std::string_view json, int options = JSON_PARSE_CHROMIUM_EXTENSIONS, size_t max_depth = internal::kAbsoluteMaxDepth); // Reads and parses |json|, returning a Value::Dict. - // If |json| is not a properly formed JSON dict string, returns absl::nullopt. + // If |json| is not a properly formed JSON dict string, returns std::nullopt. static std::optional<Value::Dict> ReadDict( std::string_view json, int options = JSON_PARSE_CHROMIUM_EXTENSIONS, diff --git a/base/memory/README.md b/base/memory/README.md index d1561827954a0..68e826e9ee70e 100644 --- a/base/memory/README.md +++ b/base/memory/README.md @@ -6,7 +6,7 @@ This is a brief overview of what they are and how they should be used. Refer to individual header files for details. C++ is not memory safe, so use these types to help guard against potential memory bugs. There are other pointer-like object types implemented elsewhere that may be -right for a given use case, such as `absl::optional<T>` and +right for a given use case, such as `std::optional<T>` and `std::unique_ptr<T>`. More on all types in video form [here](https://youtu.be/MpwbWSEDfjM?t=582s) and in a doc [here](https://docs.google.com/document/d/1VRevv8JhlP4I8fIlvf87IrW2IRjE0PbkSfIcI6-UbJo/edit?usp=sharing). diff --git a/chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.h b/chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.h index a1cab4141033d..55f65b9528a0e 100644 --- a/chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.h +++ b/chrome/browser/web_applications/isolated_web_apps/update_manifest/update_manifest.h @@ -137,7 +137,7 @@ class UpdateManifest { // Parses the `channels` field value of a version entry and either returns a // set of channels on success or an error on failure. If `channels` is not - // set (i.e., `channels_value` is `absl::nullopt`), then a set containing + // set (i.e., `channels_value` is `std::nullopt`), then a set containing // just the "default" channel is returned. static base::expected<base::flat_set<UpdateChannelId>, absl::monostate> ParseAndValidateChannels( @@ -167,7 +167,7 @@ class UpdateManifest { const std::vector<VersionEntry>& versions() const { return version_entries_; } // Returns the most up to date version contained in the `UpdateManifest` for a - // given `channel_id`. May return `absl::nullopt` if no applicable version is + // given `channel_id`. May return `std::nullopt` if no applicable version is // found. std::optional<VersionEntry> GetLatestVersion( const UpdateChannelId& channel_id) const; diff --git a/chrome/services/sharing/nearby/platform/wifi_direct_medium.cc b/chrome/services/sharing/nearby/platform/wifi_direct_medium.cc index 4d34da6cb21f7..9a2da29f9a1c5 100644 --- a/chrome/services/sharing/nearby/platform/wifi_direct_medium.cc +++ b/chrome/services/sharing/nearby/platform/wifi_direct_medium.cc @@ -84,7 +84,7 @@ bool WifiDirectMedium::DisconnectWifiDirect() { } std::unique_ptr<api::WifiDirectSocket> WifiDirectMedium::ConnectToService( - absl::string_view ip_address, + std::string_view ip_address, int port, CancellationFlag* cancellation_flag) { // Ensure that there is a valid WiFi Direct connection. @@ -224,10 +224,10 @@ std::unique_ptr<api::WifiDirectServerSocket> WifiDirectMedium::ListenForService( std::move(socket)); } -absl::optional<std::pair<std::int32_t, std::int32_t>> +std::optional<std::pair<std::int32_t, std::int32_t>> WifiDirectMedium::GetDynamicPortRange() { NOTIMPLEMENTED(); - return absl::nullopt; + return std::nullopt; } void WifiDirectMedium::GetCapabilities( diff --git a/chrome/services/sharing/nearby/platform/wifi_direct_medium.h b/chrome/services/sharing/nearby/platform/wifi_direct_medium.h index 6af2a5e2ef304..b485c9e53adb4 100644 --- a/chrome/services/sharing/nearby/platform/wifi_direct_medium.h +++ b/chrome/services/sharing/nearby/platform/wifi_direct_medium.h @@ -34,12 +34,12 @@ class WifiDirectMedium : public api::WifiDirectMedium { bool ConnectWifiDirect(WifiDirectCredentials* credentials) override; bool DisconnectWifiDirect() override; std::unique_ptr<api::WifiDirectSocket> ConnectToService( - absl::string_view ip_address, + std::string_view ip_address, int port, CancellationFlag* cancellation_flag) override; std::unique_ptr<api::WifiDirectServerSocket> ListenForService( int port) override; - absl::optional<std::pair<std::int32_t, std::int32_t>> GetDynamicPortRange() + std::optional<std::pair<std::int32_t, std::int32_t>> GetDynamicPortRange() override; private: diff --git a/chromeos/ash/components/feature_usage/README.md b/chromeos/ash/components/feature_usage/README.md index 82481c196ebad..d40c088fd277c 100644 --- a/chromeos/ash/components/feature_usage/README.md +++ b/chromeos/ash/components/feature_usage/README.md @@ -71,9 +71,9 @@ class MyDelegate : public FeatureUsageMetrics::Delegate { bool IsEligible() const final { ... } - // Optional. Default implementation returns `absl::nullopt` which do not emit + // Optional. Default implementation returns `std::nullopt` which do not emit // any UMA events. - absl::optional<bool> IsAccessible() const final { + std::optional<bool> IsAccessible() const final { ... } // If `IsEnabled` returns true `IsEligible` must return true too. diff --git a/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom b/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom index 138e526d32ead..2f1725859fa7d 100644 --- a/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom +++ b/chromeos/ash/services/multidevice_setup/public/mojom/multidevice_setup.mojom @@ -284,7 +284,7 @@ interface MultiDeviceSetup { // Informs whether the user already connected their phone using OOBE Quick // Start. If so, it returns the string of the phone instance ID. If not, it - // returns absl::nullopt. MultideviceSetup in OOBE uses this value to prefer + // returns std::nullopt. MultideviceSetup in OOBE uses this value to prefer // the device and update UI strings if the matching phone is present. GetQuickStartPhoneInstanceID() => (string? qs_phone_instance_id); diff --git a/chromeos/components/sensors/mojom/sensor.mojom b/chromeos/components/sensors/mojom/sensor.mojom index 24a9f2f85a9e3..30480094b4f6a 100644 --- a/chromeos/components/sensors/mojom/sensor.mojom +++ b/chromeos/components/sensors/mojom/sensor.mojom @@ -193,7 +193,7 @@ interface SensorDevice { // Gets the |attr_name| attribute of channels as a group into |values| in // string. - // Returns absl::nullopt if the attribute in the channel cannot be read. + // Returns std::nullopt if the attribute in the channel cannot be read. GetChannelsAttributes@8(array<int32> iio_chn_indices, string attr_name) => (array<string?> values); }; diff --git a/codelabs/cpp101/README.md b/codelabs/cpp101/README.md index ad8aa780c8af8..cb49e852c01bc 100644 --- a/codelabs/cpp101/README.md +++ b/codelabs/cpp101/README.md @@ -269,14 +269,14 @@ exiting prematurely. Take the given (slow) function to find a non-trivial factor of a given integer: ```cpp -absl::optional<int> FindNonTrivialFactor(int n) { +std::optional<int> FindNonTrivialFactor(int n) { // Really naive algorithm. for (int i = 2; i < n; ++i) { if (n % i == 0) { return i; } } - return absl::nullopt; + return std::nullopt; } ``` Write a command-line utility `factor` that takes a number, posts a task to the diff --git a/components/permissions/add_new_permission.md b/components/permissions/add_new_permission.md index 7bad23e785342..2ae43a1bda42b 100644 --- a/components/permissions/add_new_permission.md +++ b/components/permissions/add_new_permission.md @@ -83,7 +83,7 @@ update * [PermissionDescriptorInfoToPermissionType()](https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/common/permissions/permission_utils.cc;l=126;drc=caa1747121ee9f14ba7d4e346ea2dc5e7a2e05c0) 6. In [permission_controller_impl.cc](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/permissions/permission_controller_impl.cc) update [PermissionToSchedulingFeature()](https://source.chromium.org/chromium/chromium/src/+/main:content/browser/permissions/permission_controller_impl.cc;l=31;drc=a989b8968ead0d1a80b285eef0a2acf9feb71c82) -. By default the new feature should return `absl::nullopt`. That means it will +. By default the new feature should return `std::nullopt`. That means it will not block back-forward cache. If your feature needs to block it, make sure it is explicitly mentioned in a design doc as that needs to be reviewed. 7. In [aw_permission_manager.cc](https://source.chromium.org/chromium/chromium/src/+/main:android_webview/browser/aw_permission_manager.cc) diff --git a/components/segmentation_platform/internal/tools/create_class.py b/components/segmentation_platform/internal/tools/create_class.py index edd0e03d310a9..8cff3e5610542 100644 --- a/components/segmentation_platform/internal/tools/create_class.py +++ b/components/segmentation_platform/internal/tools/create_class.py @@ -247,7 +247,7 @@ void {clas}::ExecuteModelWithInput( // Invalid inputs. if (inputs.size() != kUMAFeatures.size()) {{ base::SequencedTaskRunner::GetCurrentDefault()->PostTask( - FROM_HERE, base::BindOnce(std::move(callback), absl::nullopt)); + FROM_HERE, base::BindOnce(std::move(callback), std::nullopt)); return; }} diff --git a/components/services/app_service/README.md b/components/services/app_service/README.md index 9b2f29cc8212f..5c50e30b5aaf9 100644 --- a/components/services/app_service/README.md +++ b/components/services/app_service/README.md @@ -119,9 +119,9 @@ The `App`, `Readiness` and `OptionalBool` types are: // The fields above are mandatory. Everything else below is optional. Readiness readiness; - absl::optional<std::string> name; - absl::optional<IconKey> icon_key; - absl::optional<bool> show_in_launcher; + std::optional<std::string> name; + std::optional<IconKey> icon_key; + std::optional<bool> show_in_launcher; // etc. }; @@ -141,8 +141,8 @@ which have the same type: `App`). Specifically, last known value wins. Any known field in the delta overwrites the corresponding field in the old state, any unknown field in the delta is ignored. For example, if an app's name changed but its icon didn't, the delta's `App.name` field (a -`absl::optional<std::string>`) would be known (not `absl::nullopt`) and copied -over but its `App.icon` field would be unknown (`absl::nullopt`) and not copied +`std::optional<std::string>`) would be known (not `std::nullopt`) and copied +over but its `App.icon` field would be unknown (`std::nullopt`) and not copied over. The current state is thus the merger or sum of all previous deltas, including diff --git a/content/browser/loader/keep_alive_url_loader_service_unittest.cc b/content/browser/loader/keep_alive_url_loader_service_unittest.cc index 4a647bfc59e68..b6a9719927e5a 100644 --- a/content/browser/loader/keep_alive_url_loader_service_unittest.cc +++ b/content/browser/loader/keep_alive_url_loader_service_unittest.cc @@ -1435,7 +1435,7 @@ TEST_F(FetchLaterKeepAliveURLLoaderServiceTest, GetLastPendingRequest()->client->OnReceiveResponse( CreateResponseHead( {{kAttributionReportingRegisterSourceHeader, kRegisterSourceJson}}), - /*body=*/{}, /*cached_metadata=*/absl::nullopt); + /*body=*/{}, /*cached_metadata=*/std::nullopt); base::RunLoop().RunUntilIdle(); } diff --git a/content/common/frame.mojom b/content/common/frame.mojom index 6df9186bcee6a..37a00f8d520e6 100644 --- a/content/common/frame.mojom +++ b/content/common/frame.mojom @@ -98,7 +98,7 @@ struct CreateViewParams { // The session storage namespace ID this view should use. string session_storage_namespace_id; - // The frame token of the opener frame if one exists, or absl::nullopt + // The frame token of the opener frame if one exists, or std::nullopt // otherwise. blink.mojom.FrameToken? opener_frame_token; @@ -274,7 +274,7 @@ struct CreateFrameParams { blink.mojom.FrameToken? previous_frame_token; // Specifies the new frame's opener. The opener will be null if this is - // absl::nullopt. + // std::nullopt. blink.mojom.FrameToken? opener_frame_token; // The new frame should be created as a child of the object identified by diff --git a/device/bluetooth/floss/floss_dbus_client.h b/device/bluetooth/floss/floss_dbus_client.h index 2e745bad1df0c..850b90f9c6ccb 100644 --- a/device/bluetooth/floss/floss_dbus_client.h +++ b/device/bluetooth/floss/floss_dbus_client.h @@ -548,7 +548,7 @@ class DEVICE_BLUETOOTH_EXPORT FlossDBusClient { // Error: Invalid return. static const char kErrorInvalidReturn[]; - // Property key for absl::Optional dbus serialization. + // Property key for std::optional dbus serialization. static const char kOptionalValueKey[]; // Error: does not exist. diff --git a/docs/ui/learn/bestpractices/colors.md b/docs/ui/learn/bestpractices/colors.md index 58b5ad9ec050a..02146a8c816a0 100644 --- a/docs/ui/learn/bestpractices/colors.md +++ b/docs/ui/learn/bestpractices/colors.md @@ -476,7 +476,7 @@ SkColor GetAuraColor( NativeTheme::kColorId_ButtonColor, color_scheme); return color_utils::BlendForMinContrast( - bg, bg, absl::nullopt, 1.2f).color; + bg, bg, std::nullopt, 1.2f).color; } ... } diff --git a/docs/ui/learn/bestpractices/layout.md b/docs/ui/learn/bestpractices/layout.md index 2a334084a507c..7be1b30153700 100644 --- a/docs/ui/learn/bestpractices/layout.md +++ b/docs/ui/learn/bestpractices/layout.md @@ -279,7 +279,7 @@ TabGroupEditorBubbleView::TabGroupEditorBubbleView( const Browser* browser, const tab_groups::TabGroupId& group, TabGroupHeader* anchor_view, - absl::optional<gfx::Rect> anchor_rect, + std::optional<gfx::Rect> anchor_rect, bool stop_context_menu_propagation) : ... { @@ -374,7 +374,7 @@ TabGroupEditorBubbleView::TabGroupEditorBubbleView( const Browser* browser, const tab_groups::TabGroupId& group, views::View* anchor_view, - absl::optional<gfx::Rect> anchor_rect, + std::optional<gfx::Rect> anchor_rect, TabGroupHeader* header_view, bool stop_context_menu_propagation) : ... { @@ -1348,4 +1348,3 @@ void TimeView::UpdateClockLayout( ``` |||---||| - diff --git a/docs/ui/views/metadata_properties.md b/docs/ui/views/metadata_properties.md index ea749fa9b8ad5..6890ee9c08045 100644 --- a/docs/ui/views/metadata_properties.md +++ b/docs/ui/views/metadata_properties.md @@ -180,7 +180,7 @@ at run-time, getting or setting the value directly via the getter and setter is perfectly valid. The type converter for a non-serializable type may return something from the -ToString() method, but it will typically return absl::nullopt from the +ToString() method, but it will typically return std::nullopt from the FromString() method. For a non-serializable type, the ui-devtools front-end won’t call the setter since whatever “value” it has is presumed to be unconvertable to a valid value. @@ -195,4 +195,3 @@ converter specialization. This is done the same as other type converter specializations, except for the ancestor specialization. The ancestor `BaseTypeConverter` template takes a few `bool` parameters. The first of which indicates whether a property type is serializable. - diff --git a/extensions/docs/api_functions.md b/extensions/docs/api_functions.md index a58f87f9f7a59..2284744aca937 100644 --- a/extensions/docs/api_functions.md +++ b/extensions/docs/api_functions.md @@ -117,7 +117,7 @@ GizmoFrobulateFunction::~ GizmoFrobulateFunction() = default; ExtensionFunction::ResponseAction GizmoFrobulateFunction::Run() { // We can create a typed struct of the arguments from the generated code. - absl::optional<api::gizmo::Frobulate::Params> params( + std::optional<api::gizmo::Frobulate::Params> params( api::gizmo::Frobulate::Params::Create(args())); // EXTENSION_FUNCTION_VALIDATE() is used to assert things that should only @@ -156,7 +156,7 @@ implement. ``` ExtensionFunction::ResponseAction GizmoFrobulateFunction::Run() { - absl::optional<api::gizmo::Frobulate::Params> params( + std::optional<api::gizmo::Frobulate::Params> params( api::gizmo::Frobulate::Params::Create(args())); EXTENSION_FUNCTION_VALIDATE(params); diff --git a/extensions/docs/extension_tests.md b/extensions/docs/extension_tests.md index 8555cf2e82b47..2af043a2bd81f 100644 --- a/extensions/docs/extension_tests.md +++ b/extensions/docs/extension_tests.md @@ -332,7 +332,7 @@ TEST_F(FrobulationApiUnitTest, CallingFrobulateKicksOffFrobulation) { Browser* browser = CreateTestBrowser(); auto frobulate_function = base::MakeRefCounted<FrobulationFrobulateFunction>(); - absl::optional<base::Value> result( + std::optional<base::Value> result( api_test_utils::RunFunctionAndReturnSingleResult( frobulate_function.get(), R"([{"speed": 10, "target": "foo"}])", browser)); diff --git a/media/learning/mojo/public/mojom/learning_task_controller.mojom b/media/learning/mojo/public/mojom/learning_task_controller.mojom index 85232e8b8b492..e5e7447b3668a 100644 --- a/media/learning/mojo/public/mojom/learning_task_controller.mojom +++ b/media/learning/mojo/public/mojom/learning_task_controller.mojom @@ -43,7 +43,7 @@ interface LearningTaskController { TargetValue? default_target); // Asynchronously predicts distribution for given |features|. |callback| will - // receive a absl::nullopt prediction when model is not available. + // receive a std::nullopt prediction when model is not available. PredictDistribution(array<FeatureValue> features) => (TargetHistogram? predicted); }; diff --git a/services/metrics/ukm_api.md b/services/metrics/ukm_api.md index cf67a0bf92b49..169856b756a6b 100644 --- a/services/metrics/ukm_api.md +++ b/services/metrics/ukm_api.md @@ -233,7 +233,7 @@ auto* ukm_background_service = ukm::UkmBackgroundRecorderFactory::GetForProfile( ukm_background_service->GetBackgroundSourceIdIfAllowed(origin, base::BindOnce(&DidGetBackgroundSourceId)); // A callback will run with an optional source ID. -void DidGetBackgroundSourceId(absl::optional<ukm::SourceId> source_id) { +void DidGetBackgroundSourceId(std::optional<ukm::SourceId> source_id) { if (!source_id) return; // Can't record as it wasn't found in the history. // Use the newly generated source ID. diff --git a/services/network/public/mojom/first_party_sets.mojom b/services/network/public/mojom/first_party_sets.mojom index 19c4bee3ade8d..d72f9641aecbb 100644 --- a/services/network/public/mojom/first_party_sets.mojom +++ b/services/network/public/mojom/first_party_sets.mojom @@ -30,10 +30,10 @@ struct FirstPartySetEntry { // This struct must match the class fields defined in // //net/first_party_sets/first_party_set_metadata.h. struct FirstPartySetMetadata { - // absl::nullopt indicates that the frame's site is not associated with any + // std::nullopt indicates that the frame's site is not associated with any // First-Party Set. FirstPartySetEntry? frame_entry; - // absl::nullopt indicates that the top frame's site is not associated with + // std::nullopt indicates that the top frame's site is not associated with // any First-Party Set. FirstPartySetEntry? top_frame_entry; }; @@ -90,4 +90,3 @@ struct GlobalFirstPartySets { // The aliases contained in the manually-supplied set. map<SchemefulSite, SchemefulSite> manual_aliases; }; - diff --git a/services/network/public/mojom/url_request.mojom b/services/network/public/mojom/url_request.mojom index 1d510b64f480b..6898c4d351e51 100644 --- a/services/network/public/mojom/url_request.mojom +++ b/services/network/public/mojom/url_request.mojom @@ -176,7 +176,7 @@ struct URLRequest { // // [1]: https://fetch.spec.whatwg.org/#concept-request-origin // - // |request_initiator| should be omitted (i.e. set to absl::nullopt) for + // |request_initiator| should be omitted (i.e. set to std::nullopt) for // browser-initiated requests (e.g. navigations initiated via omnibox or // bookmarks, internal subresource requests like fetching the SafeBrowsing // data, etc.). Various security features may treat browser-initiated @@ -190,7 +190,7 @@ struct URLRequest { // provided. Failure to provide a correct, verified |request_initiator| may // lead to bypasses of CORS, ORB, SameSite cookies and other HTTP security // features. An untrustworthy process (e.g. a renderer or a utility process) - // should not be able to trigger or influence requests with a absl::nullopt + // should not be able to trigger or influence requests with a std::nullopt // |request_initiator|). // // See also: diff --git a/services/network/url_loader_unittest.cc b/services/network/url_loader_unittest.cc index 98d0014490afe..7c8e73b24f252 100644 --- a/services/network/url_loader_unittest.cc +++ b/services/network/url_loader_unittest.cc @@ -4872,7 +4872,7 @@ TEST_F(URLLoaderTest, BlockAllCookies) { GURL cookie_url = test_server()->GetURL("/"); auto cc = net::CanonicalCookie::CreateForTesting( - cookie_url, "a=b", base::Time::Now(), absl::nullopt /* server_time */, + cookie_url, "a=b", base::Time::Now(), std::nullopt /* server_time */, net::CookiePartitionKey::FromURLForTesting( GURL("https://toplevelsite.com"))); @@ -4901,7 +4901,7 @@ TEST_F(URLLoaderTest, BlockOnlyThirdPartyCookies) { GURL cookie_url = test_server()->GetURL("/"); auto cc = net::CanonicalCookie::CreateForTesting( - cookie_url, "a=b", base::Time::Now(), absl::nullopt /* server_time */, + cookie_url, "a=b", base::Time::Now(), std::nullopt /* server_time */, net::CookiePartitionKey::FromURLForTesting( GURL("https://toplevelsite.com"))); @@ -4928,7 +4928,7 @@ TEST_F(URLLoaderTest, AllowAllCookies) { GURL cookie_url = test_server()->GetURL("/"); auto cc = net::CanonicalCookie::CreateForTesting( - cookie_url, "a=b", base::Time::Now(), absl::nullopt /* server_time */, + cookie_url, "a=b", base::Time::Now(), std::nullopt /* server_time */, net::CookiePartitionKey::FromURLForTesting( GURL("https://toplevelsite.com"))); diff --git a/services/viz/public/mojom/compositing/compositor_frame_metadata.mojom b/services/viz/public/mojom/compositing/compositor_frame_metadata.mojom index f3c839ae26042..7010107a843a6 100644 --- a/services/viz/public/mojom/compositing/compositor_frame_metadata.mojom +++ b/services/viz/public/mojom/compositing/compositor_frame_metadata.mojom @@ -41,7 +41,7 @@ struct CompositorFrameMetadata { BeginFrameAck begin_frame_ack; uint32 frame_token; bool send_frame_token_to_embedder; - // TODO(crbug.com/40489779): This should be a absl::optional<float>. + // TODO(crbug.com/40489779): This should be a `float?`. bool top_controls_visible_height_set; float top_controls_visible_height; diff --git a/storage/browser/file_system/file_system_url_unittest.cc b/storage/browser/file_system/file_system_url_unittest.cc index 17bdfea33c32e..9c552d4cdf18b 100644 --- a/storage/browser/file_system/file_system_url_unittest.cc +++ b/storage/browser/file_system/file_system_url_unittest.cc @@ -79,7 +79,7 @@ TEST(FileSystemURLTest, CreateSibling) { // Another CreateSibling precondition is that the sibling_name is non-empty. // We don't test for that here because a base::SafeBaseName is designed to be // non-empty by construction: the base::SafeBaseName::Create factory function - // returns absl::Optional<base::SafeBaseName> not base::SafeBaseName. + // returns std::optional<base::SafeBaseName> not base::SafeBaseName. // // See also TODO(crbug.com/40205226) const base::SafeBaseName sibling_name = diff --git a/third_party/blink/public/mojom/back_forward_cache_not_restored_reasons.mojom b/third_party/blink/public/mojom/back_forward_cache_not_restored_reasons.mojom index 5608a0125735c..9bba720784144 100644 --- a/third_party/blink/public/mojom/back_forward_cache_not_restored_reasons.mojom +++ b/third_party/blink/public/mojom/back_forward_cache_not_restored_reasons.mojom @@ -43,7 +43,7 @@ struct BackForwardCacheNotRestoredReasons { string? name; // List of reasons that blocked back/forward cache if any. array<BFCacheBlockingDetailedReason> reasons; - // This will be absl::nullopt when this document is cross-origin from the main + // This will be std::nullopt when this document is cross-origin from the main // document. SameOriginBfcacheNotRestoredDetails? same_origin_details; }; diff --git a/third_party/blink/public/mojom/context_menu/context_menu.mojom b/third_party/blink/public/mojom/context_menu/context_menu.mojom index 2bd059c4eff44..8ded2c749c314 100644 --- a/third_party/blink/public/mojom/context_menu/context_menu.mojom +++ b/third_party/blink/public/mojom/context_menu/context_menu.mojom @@ -95,7 +95,7 @@ struct UntrustworthyContextMenuParams { // Will be empty if |link_url| is empty. mojo_base.mojom.String16 link_text; - // The impression declared by the link. May be absl::nullopt even if + // The impression declared by the link. May be std::nullopt even if // |link_url| is non-empty. Impression? impression; diff --git a/third_party/blink/public/mojom/frame/remote_frame.mojom b/third_party/blink/public/mojom/frame/remote_frame.mojom index 3e4d91832571f..b9c6b08b3db12 100644 --- a/third_party/blink/public/mojom/frame/remote_frame.mojom +++ b/third_party/blink/public/mojom/frame/remote_frame.mojom @@ -433,7 +433,7 @@ interface RemoteFrame { // `token`: The frame token. Used to map between RemoteFrame and // RenderFrameProxyHost. // `opener_frame_token`: Frame token that identifies the opener frame if one - // exists, or absl::nullopt otherwise. + // exists, or std::nullopt otherwise. // `tree_scope_type`: Whether the owner element (e.g. <iframe>, <object>, et // cetera) for this frame is in the document tree or the shadow tree. // `owner_properties`: This frame's FrameOwner properties, such as scrolling, diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom index ed73a6fe6d146..c980f3f76a37a 100644 --- a/third_party/blink/public/mojom/page/page.mojom +++ b/third_party/blink/public/mojom/page/page.mojom @@ -136,7 +136,7 @@ interface PageBroadcast { // `token`: The frame token. Used to map between RemoteFrame and // RenderFrameProxyHost. // `opener_frame_token`: Frame token that identifies the opener frame if one - // exists, or absl::nullopt otherwise. + // exists, or std::nullopt otherwise. // `is_loading`: Whether to call DidStartLoading() on the new main frame. // `devtools_frame_token`: Used for devtools instrumentation and // trace-ability. The token is shared across all frames (local or remotes) diff --git a/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler_unittest.cc b/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler_unittest.cc index 4d4fb78eda840..f96386f026df8 100644 --- a/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler_unittest.cc +++ b/third_party/blink/renderer/modules/mediarecorder/media_recorder_handler_unittest.cc @@ -261,7 +261,7 @@ class MediaRecorderHandlerFixture : public ScopedMockOverlayScrollbars { std::string encoded_data, base::TimeTicks timestamp) { media_recorder_handler_->OnEncodedAudio(params, std::move(encoded_data), - absl::nullopt, timestamp); + std::nullopt, timestamp); } void OnAudioBusForTesting(const media::AudioBus& audio_bus) { diff --git a/third_party/blink/renderer/modules/xr/xr_object_space.h b/third_party/blink/renderer/modules/xr/xr_object_space.h index 26c9ded228ce5..b13c823688799 100644 --- a/third_party/blink/renderer/modules/xr/xr_object_space.h +++ b/third_party/blink/renderer/modules/xr/xr_object_space.h @@ -19,7 +19,7 @@ class XRSession; // type T (for example XRPlane, XRAnchor). The type T has to have a // NativeOrigin() method, returning a // device::mojom::blink::XRNativeOriginInformationPtr, a MojoFromObject() -// method, returning a absl::Optional<gfx::Transform>, and IsStationary() +// method, returning a std::optional<gfx::Transform>, and IsStationary() // method returning true if the object is supposed to be treated as stationary // for the purposes of anchor creation. // diff --git a/tools/clang/blink_gc_plugin/BadPatternFinder.cpp b/tools/clang/blink_gc_plugin/BadPatternFinder.cpp index 508b0272e1b83..d20f31f175c8a 100644 --- a/tools/clang/blink_gc_plugin/BadPatternFinder.cpp +++ b/tools/clang/blink_gc_plugin/BadPatternFinder.cpp @@ -106,8 +106,9 @@ class OptionalOrRawPtrToGCedMatcher : public MatchFinder::MatchCallback { : diagnostics_(diagnostics), record_cache_(record_cache) {} void Register(MatchFinder& match_finder) { - // Matches fields and new-expressions of type absl::optional where the - // template argument is known to refer to a garbage-collected type. + // Matches fields and new-expressions of type std::optional or + // absl::optional where the template argument is known to refer to a + // garbage-collected type. auto optional_gced_type = hasType( classTemplateSpecializationDecl( hasAnyName("::absl::optional", "::std::optional", "::base::raw_ptr",