electron/shell
trop[bot] 6964b79e68
refactor: spanify image utils (#44178)
* refactor: electron::util::AddImageSkiaRepFromJPEG() takes a span arg

Co-authored-by: Charles Kerr <charles@charleskerr.com>

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* refactor: use base::as_byte_span()

Co-authored-by: Charles Kerr <charles@charleskerr.com>

* 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.

Co-authored-by: Charles Kerr <charles@charleskerr.com>

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

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

Co-authored-by: Charles Kerr <charles@charleskerr.com>

---------

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
2024-10-10 13:24:26 -04:00
..
app chore: remove unused nogncheck includes (#43991) 2024-09-26 21:49:42 -05:00
browser fix: -Wunsafe-buffer-usage warnings in GetNextZoomLevel() (#44163) 2024-10-09 16:30:45 -05:00
common refactor: spanify image utils (#44178) 2024-10-10 13:24:26 -04:00
renderer fix: -Wunsafe-buffer-usage warning in HasWordCharacters() (#44171) 2024-10-09 22:25:34 -05:00
services/node feat: add error event for utility process (33-x-y) (#43997) 2024-09-29 17:12:15 -05:00
utility chore: bump chromium to 129.0.6630.0 (main) (#43087) 2024-08-02 09:02:11 -05:00