electron/shell/browser/ui
trop[bot] 31e6d66c74
perf: avoid redundant calls to GetView() (#43231)
* perf: avoid double-calls to GetView()

There are a lot of places where we call the virtual method GetView()
twice in succession: the first to check if the view exists, and the
second to use. This PR holds the view in a temp variable instead, e.g.:

if (auto* view = foo->GetView())
  view->DoSomething();

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

* perf: avoid discarded GetView() call

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-08-06 19:24:05 -05:00
..
cocoa fix: handle failing to enter fullscreen on macOS (#43152) 2024-08-01 14:50:35 +02:00
gtk perf: use flat_set, flat_map for small, trivially-moved containers (#40817) 2024-01-05 12:18:31 +01:00
views fix: remove InspectableWebContentsViewMac (#43088) 2024-07-30 12:30:38 +02:00
webui chore: bump chromium to 128.0.6558.0 (32-x-y) (#42746) 2024-07-03 10:54:21 -04:00
win chore: bump chromium to 127.0.6521.0 (main) (#42118) 2024-06-07 17:18:35 -04:00
x chore: bump chromium to 121.0.6159.0 (main) (#40632) 2023-12-11 14:58:26 -06:00
accelerator_util.cc refactor: remove banned std::to_string() calls (#41087) 2024-01-24 16:43:31 -06:00
accelerator_util.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
accelerator_util_unittests.cc chore: bump chromium to 117.0.5913.0 (main) (#39172) 2023-07-31 10:47:32 -07:00
autofill_popup.cc perf: avoid redundant calls to GetView() (#43231) 2024-08-06 19:24:05 -05:00
autofill_popup.h refactor: prefer to inherit observer classes privately (#41360) 2024-05-21 14:21:31 -05:00
certificate_trust.h chore: add ELECTRON_ prefix to C++ include guards (#31925) 2021-11-22 16:34:31 +09:00
certificate_trust_mac.mm chore: bump chromium to 121.0.6116.0 (main) (#40490) 2023-11-14 13:21:32 -08:00
certificate_trust_win.cc refactor: replace remaining NULL with nullptr (#40053) 2023-10-03 12:26:35 -07:00
devtools_manager_delegate.cc fix: Storage.{get|set|clear}Cookies via CDP not working (#41718) 2024-03-28 16:09:27 -07:00
devtools_manager_delegate.h fix: Storage.{get|set|clear}Cookies via CDP not working (#41718) 2024-03-28 16:09:27 -07:00
devtools_ui.cc chore: bump chromium to 107.0.5274.0 (main) (#35375) 2022-09-07 09:46:37 +02:00
devtools_ui.h chore: add ELECTRON_ prefix to C++ include guards (#31925) 2021-11-22 16:34:31 +09:00
drag_util.cc chore: bump chromium to 125.0.6412.0 (main) (#41610) 2024-04-15 18:10:32 -04:00
drag_util.h chore: bump chromium to 125.0.6412.0 (main) (#41610) 2024-04-15 18:10:32 -04:00
drag_util_mac.mm chore: bump chromium to 118.0.5975.0 (main) (#39531) 2023-09-01 15:54:59 +09:00
drag_util_views.cc chore: cleanup drag_util (#36806) 2023-01-09 10:00:47 +01:00
electron_desktop_window_tree_host_linux.cc chore: bump chromium to 128.0.6558.0 (32-x-y) (#42746) 2024-07-03 10:54:21 -04:00
electron_desktop_window_tree_host_linux.h refactor: inherit Observer classes privately, pt. 2 (#42237) 2024-05-29 13:07:02 -05:00
electron_gdk_pixbuf.sigs refactor: use stubs for gdk-pixbuf dependency (#34077) 2022-06-19 17:42:30 -07:00
electron_gtk.fragment refactor: use stubs for gdk-pixbuf dependency (#34077) 2022-06-19 17:42:30 -07:00
electron_gtk.sigs refactor: use stubs for gdk-pixbuf dependency (#34077) 2022-06-19 17:42:30 -07:00
electron_menu_model.cc refactor: inline simple getters, pt . 2 (#41254) 2024-02-09 10:29:14 +01:00
electron_menu_model.h refactor: inline simple getters, pt . 2 (#41254) 2024-02-09 10:29:14 +01:00
file_dialog.h chore: enable check raw ptr fields (#38167) 2023-05-11 16:07:39 -04:00
file_dialog_linux.cc chore: bump chromium to 128.0.6611.0 (32-x-y) (#43017) 2024-07-25 11:24:11 +02:00
file_dialog_mac.mm chore: migrate base::StringPiece to std::string_view (#40915) 2024-01-10 19:00:37 -06:00
file_dialog_win.cc chore: bump chromium to 127.0.6521.0 (main) (#42118) 2024-06-07 17:18:35 -04:00
gtk_util.cc chore: update links in comments (#37197) 2023-02-11 18:52:54 -08:00
gtk_util.h chore: add ELECTRON_ prefix to C++ include guards (#31925) 2021-11-22 16:34:31 +09:00
inspectable_web_contents.cc fix: remove InspectableWebContentsViewMac (#43088) 2024-07-30 12:30:38 +02:00
inspectable_web_contents.h chore: bump chromium to 128.0.6611.0 (32-x-y) (#43017) 2024-07-25 11:24:11 +02:00
inspectable_web_contents_delegate.h chore: bump chromium to 127.0.6521.0 (main) (#42118) 2024-06-07 17:18:35 -04:00
inspectable_web_contents_view.cc fix: remove InspectableWebContentsViewMac (#43088) 2024-07-30 12:30:38 +02:00
inspectable_web_contents_view.h fix: remove InspectableWebContentsViewMac (#43088) 2024-07-30 12:30:38 +02:00
inspectable_web_contents_view_delegate.cc chore: bump chromium to 93.0.4536.0 (main) (#29586) 2021-06-08 15:22:43 -05:00
inspectable_web_contents_view_delegate.h chore: bump chromium to 100.0.4857.0 (main) (#32419) 2022-02-09 18:58:52 -08:00
inspectable_web_contents_view_mac.h fix: remove InspectableWebContentsViewMac (#43088) 2024-07-30 12:30:38 +02:00
inspectable_web_contents_view_mac.mm fix: remove InspectableWebContentsViewMac (#43088) 2024-07-30 12:30:38 +02:00
message_box.h chore: replace absl::optional<T> with std::optional<T> (#40928) 2024-01-10 16:23:35 -06:00
message_box_gtk.cc refactor: inherit Observer classes privately, pt. 2 (#42237) 2024-05-29 13:07:02 -05:00
message_box_mac.mm fix: crash when dialog.showMessageBoxSync with missing buttons (#40996) 2024-01-18 13:21:15 +01:00
message_box_win.cc chore: replace absl::optional<T> with std::optional<T> (#40928) 2024-01-10 16:23:35 -06:00
run_all_unittests.cc chore: bump chromium to 111.0.5544.3 (main) (#36820) 2023-02-03 12:43:42 +01:00
status_icon_gtk.cc chore: bump chromium to 119.0.6045.0 (main) (#40076) 2023-10-05 19:59:39 -04:00
status_icon_gtk.h chore: bump chromium to 119.0.6045.0 (main) (#40076) 2023-10-05 19:59:39 -04:00
tray_icon.cc feat: add middle click event to tray (#39926) 2023-09-27 14:21:15 -04:00
tray_icon.h chore: replace absl::optional<T> with std::optional<T> (#40928) 2024-01-10 16:23:35 -06:00
tray_icon_cocoa.h chore: bump chromium to 121.0.6159.0 (main) (#40632) 2023-12-11 14:58:26 -06:00
tray_icon_cocoa.mm chore: replace absl::optional<T> with std::optional<T> (#40928) 2024-01-10 16:23:35 -06:00
tray_icon_linux.cc chore: replace absl::optional<T> with std::optional<T> (#40928) 2024-01-10 16:23:35 -06:00
tray_icon_linux.h chore: bump chromium to 116.0.5817.0 (main) (#38465) 2023-06-09 16:08:36 -07:00
tray_icon_observer.h feat: add middle click event to tray (#39926) 2023-09-27 14:21:15 -04:00
tray_icon_win.cc chore: replace absl::optional<T> with std::optional<T> (#40928) 2024-01-10 16:23:35 -06:00