| Commit-Queue | +0 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Hi Mitsuru. PTAL.
With this CL and several recent related CLs, most of the UNSAFE_TODO
usages in ui/ that were practical to convert on Windows non-test code have
now been addressed.
The remaining UNSAFE_TODO cleanups are primarily in macOS- and
Linux-related codepaths and in test code, and I plan to handle those in
follow-up CLs.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
absl::Cleanup release_scoped_array(
[&scoped_array]() { (void)scoped_array.Release(); });This shouldn't be necessary - the `ScopedSafearray` destructor will handle releasing the array
for (size_t i = 1; i < tracePairs.size(); i++) {Nit: Google C++ coding guidelines recommend `++i`: https://google.github.io/styleguide/cppguide.html#Preincrement_and_Predecrement
(I realize this was already there before this change, but you might as well fix it)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
absl::Cleanup release_scoped_array(
[&scoped_array]() { (void)scoped_array.Release(); });This shouldn't be necessary - the `ScopedSafearray` destructor will handle releasing the array
`Release()` here is not an eager free. `V_ARRAY(block_content.ptr())` gives a SAFEARRAY that is still owned by `block_content`; `ScopedSafearray` is only being used as a temporary RAII wrapper so we can call `CreateLockScope()` safely.
The explicit `Release()` only drops `ScopedSafearray` ownership before its destructor runs. The actual destruction still happens later when `block_content` is cleared.
Without the manual `Release()`, `scoped_array` would call `SafeArrayDestroy()` in its destructor and leave `block_content` holding a dangling `parray`. When `block_content` is then destroyed, `VariantClear()` would try to destroy the same SAFEARRAY again. In practice that is a double-destroy.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Nit: Google C++ coding guidelines recommend `++i`: https://google.github.io/styleguide/cppguide.html#Preincrement_and_Predecrement
(I realize this was already there before this change, but you might as well fix it)
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
absl::Cleanup release_scoped_array(
[&scoped_array]() { (void)scoped_array.Release(); });Lloyd HuangThis shouldn't be necessary - the `ScopedSafearray` destructor will handle releasing the array
`Release()` here is not an eager free. `V_ARRAY(block_content.ptr())` gives a SAFEARRAY that is still owned by `block_content`; `ScopedSafearray` is only being used as a temporary RAII wrapper so we can call `CreateLockScope()` safely.
The explicit `Release()` only drops `ScopedSafearray` ownership before its destructor runs. The actual destruction still happens later when `block_content` is cleared.
Without the manual `Release()`, `scoped_array` would call `SafeArrayDestroy()` in its destructor and leave `block_content` holding a dangling `parray`. When `block_content` is then destroyed, `VariantClear()` would try to destroy the same SAFEARRAY again. In practice that is a double-destroy.
Can this `base::win::ScopedSafearray` be moved up to replace `SAFEARRAY* array` entirely, and would that remove the need for the manual release?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
absl::Cleanup release_scoped_array(
[&scoped_array]() { (void)scoped_array.Release(); });Lloyd HuangThis shouldn't be necessary - the `ScopedSafearray` destructor will handle releasing the array
Kurt Catti-Schmidt`Release()` here is not an eager free. `V_ARRAY(block_content.ptr())` gives a SAFEARRAY that is still owned by `block_content`; `ScopedSafearray` is only being used as a temporary RAII wrapper so we can call `CreateLockScope()` safely.
The explicit `Release()` only drops `ScopedSafearray` ownership before its destructor runs. The actual destruction still happens later when `block_content` is cleared.
Without the manual `Release()`, `scoped_array` would call `SafeArrayDestroy()` in its destructor and leave `block_content` holding a dangling `parray`. When `block_content` is then destroyed, `VariantClear()` would try to destroy the same SAFEARRAY again. In practice that is a double-destroy.
Can this `base::win::ScopedSafearray` be moved up to replace `SAFEARRAY* array` entirely, and would that remove the need for the manual release?
Updated to move ownership of `BlockContent`’s `SAFEARRAY` into `base::win::ScopedSafearray` via `block_content.Release().parray`.
That removes the temporary dual-ownership pattern and the manual `Release()` cleanup.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Latest version LGTM, thank you! You'll still need a review from @osh...@chromium.org for OWNERS approval.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Remove unsafe buffer patterns in display/win and gl_surface_egl
Replace raw SAFEARRAY access in audio_edid_scan.cc with
ScopedSafearray/LockScope, value-initialize MONITORINFOEX in
color_profile_reader.cc, and switch the pending trace symbol handling in
gl_surface_egl.cc to std::string_view.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |