electron/shell/common/api
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
..
api.mojom chore: bump chromium to 125.0.6412.0 (main) (#41610) 2024-04-15 18:10:32 -04:00
crashpad_support.cc chore: rename built-in modules to bindings to match naming update in node (#37182) 2023-02-09 10:31:38 +09:00
electron_api_asar.cc chore: bump chromium to 128.0.6558.0 (main) (#42413) 2024-07-02 09:51:33 +02:00
electron_api_clipboard.cc fix: -Wunsafe-buffer-usage warnings in Clipboard::WriteBuffer() (#43795) 2024-09-19 23:10:35 -05:00
electron_api_clipboard.h chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
electron_api_clipboard_mac.mm chore: bump chromium to 105.0.5173.0 (main) (#34770) 2022-07-13 17:26:16 -04:00
electron_api_command_line.cc chore: remove unused base/ includes (#43688) 2024-09-12 16:05:37 +02:00
electron_api_environment.cc chore: remove unused internal env.unSetVar() (#43148) 2024-08-01 18:41:41 -05:00
electron_api_native_image.cc refactor: spanify image utils (#44127) 2024-10-10 09:34:55 -04:00
electron_api_native_image.h refactor: spanify image utils (#44127) 2024-10-10 09:34:55 -04:00
electron_api_native_image_mac.mm refactor: spanify image utils (#44127) 2024-10-10 09:34:55 -04:00
electron_api_native_image_win.cc refactor: replace remaining `NULL` with `nullptr` (#40053) 2023-10-03 12:26:35 -07:00
electron_api_net.cc chore: replace absl::optional<T> with std::optional<T> (#40928) 2024-01-10 16:23:35 -06:00
electron_api_shell.cc chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
electron_api_testing.cc chore: bump chromium to 122.0.6261.6 (main) (#40949) 2024-01-25 12:46:30 -05:00
electron_api_url_loader.cc perf: use ArrayBuffer::Data() instead of GetBackingStore()->Data() (#44067) 2024-10-01 10:04:57 -07:00
electron_api_url_loader.h refactor: declare gin::Wrapper subclasses as final (#43527) 2024-09-04 18:40:02 -05:00
electron_api_v8_util.cc chore: remove unused KeyWeakMap JS bindings (#43111) 2024-07-31 16:37:04 -05:00
electron_bindings.cc build: make is_mas_build a generated header instead of config (#43737) 2024-09-17 01:38:56 -07:00
electron_bindings.h chore: more iwyu (#43063) 2024-07-29 12:42:57 -05:00
features.cc feat: replace BrowserView with WebContentsView (#35658) 2023-12-13 13:01:03 -08:00