electron/shell
Charles Kerr 3d2f68a9df
refactor: spanify image utils (#44127)
* refactor: electron::util::AddImageSkiaRepFromJPEG() takes a span arg

* refactor: electron::util::AddImageSkiaRepFromPNG() takes a span arg

* refactor: electron::util::AddImageSkiaRepFromBuffer() takes a span arg

* feat: add Node-buffer-to-base-span helper function

* refactor: electron::api::NativeImage::CreateFromPNG() now takes a span param

* refactor: electron::api::NativeImage::CreateFromJPEG() now takes a span param

* refactor: use base::as_byte_span()

* fix: -Wunsafe-buffer-usage warning in NativeImage::CreateFromNamedImage()

Warning fixed by this commit:

../../electron/shell/common/api/electron_api_native_image_mac.mm:131:11: error: function introduces unsafe buffer manipulation [-Werror,-Wunsafe-buffer-usage]
  131 |           {reinterpret_cast<const uint8_t*>((char*)[png_data bytes]),
      |           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  132 |            [png_data length]});
      |            ~~~~~~~~~~~~~~~~~~
../../electron/shell/common/api/electron_api_native_image_mac.mm:131:11: note: See //docs/unsafe_buffers.md for help.

* chore: add // SAFETY comment for Node-buffer-to-span func

* chore: add // SAFETY comment for NSData-to-span func
2024-10-10 09:34:55 -04:00
..
app chore: remove unused nogncheck includes (#43964) 2024-09-26 17:09:42 -05:00
browser fix: -Wunsafe-buffer-usage warnings in GetNextZoomLevel() (#44149) 2024-10-09 09:12:48 -05:00
common refactor: spanify image utils (#44127) 2024-10-10 09:34:55 -04:00
renderer fix: -Wunsafe-buffer-usage warning in HasWordCharacters() (#44133) 2024-10-09 13:02:00 -05:00
services/node feat: add error event for utility process (#43774) 2024-09-27 10:17:06 +09:00
utility chore: remove unused base/ includes (#43688) 2024-09-12 16:05:37 +02:00