From e70ce89235825d19bf1bca5a054d311231925b21 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 29 Jul 2024 12:42:57 -0500 Subject: [PATCH] chore: more iwyu (#43063) * chore: iwyu shell/browser/electron_pdf_document_helper_client.h * chore: iwyu shell/browser/hid/electron_hid_delegate.h * chore: iwyu content/public/browser/web_contents.h * chore: iwyu shell/browser/usb/electron_usb_delegate.h * chore: iwyu shell/browser/browser_observer.h * chore: iwyu shell/browser/bluetooth/electron_bluetooth_delegate.h * chore: iwyu shell/browser/serial/electron_serial_delegate.h * chore: iwyu shell/browser/api/frame_subscriber.h * chore: iwyu mojo/public/cpp/bindings/ * chore: iwyu components/ * chore: iwyu extensions/ * chore: iwyu shell/common/gin_helper/ * chore: iwyu v8/ * chore: iwyu base/containers/linked_list.h * chore: iwyu shell/browser/native_window.h * chore: iwyu shell/browser/api/electron_api_base_window.h * chore: iwyu shell/common/node_includes.h * chore: iwyu gin/handle.h * chore: iwyu base/functional/callback.h * chore: iwyu ui/gfx/ * chore: iwyu content/public/browser/render_frame_host.h * fix: mac * fix: mac * fix: win * chore: iwyu base/files/file_path.h * chore: iwyu base/unguessable_token.h * chore: iwyu ui/display/screen.h * chore: iwyu chrome/browser/predictors/preconnect_manager.h * chore: iwyu base/observer_list_types.h * chore: iwyu content/public/browser/web_contents.h * chore: iwyu chrome/browser/devtools/devtools_eye_dropper.h * chore: iwyu shell/browser/ui/inspectable_web_contents.h * chore: iwyu content/public/browser/keyboard_event_processing_result.h * chore: iwyu net/cookies/canonical_cookie.h * chore: iwyu net/base/address_list.h * chore: iwyu net/cert/x509_certificate.h * chore: iwyu net/cookies/cookie_change_dispatcher.h * chore: iwyu net/dns/public/host_resolver_results.h * fix: mac * Revert "chore: iwyu net/cert/x509_certificate.h" This reverts commit 002896f71146e90f1e29e090a1d6eede48cee11e. --- shell/app/electron_content_client.h | 1 - shell/browser/api/electron_api_app.cc | 2 + shell/browser/api/electron_api_app.h | 14 +++++-- .../browser/api/electron_api_auto_updater.cc | 1 + shell/browser/api/electron_api_auto_updater.h | 6 ++- shell/browser/api/electron_api_base_window.cc | 2 + shell/browser/api/electron_api_base_window.h | 19 +++++++--- .../api/electron_api_browser_window.cc | 2 + .../browser/api/electron_api_browser_window.h | 5 ++- shell/browser/api/electron_api_cookies.cc | 3 ++ shell/browser/api/electron_api_cookies.h | 16 +++++--- .../api/electron_api_data_pipe_holder.cc | 1 + .../api/electron_api_data_pipe_holder.h | 6 ++- shell/browser/api/electron_api_debugger.cc | 2 + shell/browser/api/electron_api_debugger.h | 9 ++++- .../api/electron_api_desktop_capturer.cc | 1 + .../api/electron_api_desktop_capturer.h | 6 ++- shell/browser/api/electron_api_dialog.cc | 3 ++ .../browser/api/electron_api_download_item.cc | 1 + .../browser/api/electron_api_download_item.h | 6 ++- .../api/electron_api_global_shortcut.cc | 1 + .../api/electron_api_global_shortcut.h | 8 +++- .../api/electron_api_in_app_purchase.cc | 1 + .../api/electron_api_in_app_purchase.h | 8 +++- shell/browser/api/electron_api_menu.cc | 1 + shell/browser/api/electron_api_menu.h | 3 +- shell/browser/api/electron_api_menu_mac.h | 8 +++- shell/browser/api/electron_api_menu_mac.mm | 1 + shell/browser/api/electron_api_menu_views.cc | 1 + shell/browser/api/electron_api_menu_views.h | 1 - shell/browser/api/electron_api_native_theme.h | 6 ++- shell/browser/api/electron_api_net_log.cc | 1 + shell/browser/api/electron_api_net_log.h | 12 ++++-- .../browser/api/electron_api_notification.cc | 1 + shell/browser/api/electron_api_notification.h | 5 ++- .../api/electron_api_power_save_blocker.cc | 2 + .../api/electron_api_power_save_blocker.h | 9 ++++- shell/browser/api/electron_api_protocol.cc | 1 + shell/browser/api/electron_api_protocol.h | 3 +- .../api/electron_api_push_notifications.cc | 1 + .../api/electron_api_push_notifications.h | 6 ++- shell/browser/api/electron_api_screen.cc | 1 + shell/browser/api/electron_api_screen.h | 5 ++- .../api/electron_api_service_worker_context.h | 6 ++- shell/browser/api/electron_api_session.cc | 3 ++ shell/browser/api/electron_api_session.h | 16 ++++---- .../api/electron_api_system_preferences.cc | 2 + .../api/electron_api_system_preferences.h | 12 ++++-- .../electron_api_system_preferences_mac.mm | 1 + shell/browser/api/electron_api_tray.cc | 2 + shell/browser/api/electron_api_tray.h | 13 +++++-- .../api/electron_api_utility_process.h | 8 ++-- shell/browser/api/electron_api_view.cc | 1 + shell/browser/api/electron_api_view.h | 6 ++- .../browser/api/electron_api_web_contents.cc | 6 ++- shell/browser/api/electron_api_web_contents.h | 38 ++++++++++--------- .../api/electron_api_web_contents_view.cc | 1 + .../api/electron_api_web_frame_main.cc | 1 + .../browser/api/electron_api_web_frame_main.h | 11 ++++-- shell/browser/api/electron_api_web_request.cc | 3 ++ shell/browser/api/electron_api_web_request.h | 13 +++++-- shell/browser/api/frame_subscriber.cc | 1 + shell/browser/api/frame_subscriber.h | 11 ++++-- shell/browser/api/gpuinfo_manager.cc | 1 + shell/browser/api/gpuinfo_manager.h | 6 ++- shell/browser/api/message_port.cc | 8 ++++ shell/browser/api/message_port.h | 9 +++-- shell/browser/api/save_page_handler.h | 2 +- .../api/views/electron_api_image_view.cc | 1 + .../api/views/electron_api_image_view.h | 10 ++++- shell/browser/browser.cc | 8 ++++ shell/browser/browser.h | 8 ++-- shell/browser/browser_mac.mm | 1 + shell/browser/browser_process_impl.cc | 1 + shell/browser/browser_process_impl.h | 3 +- shell/browser/certificate_manager_model.h | 2 +- shell/browser/cookie_change_notifier.cc | 2 +- shell/browser/cookie_change_notifier.h | 6 ++- shell/browser/electron_autofill_driver.h | 6 ++- shell/browser/electron_browser_client.cc | 4 ++ shell/browser/electron_browser_client.h | 15 +++++--- shell/browser/electron_browser_context.cc | 4 ++ shell/browser/electron_browser_context.h | 5 ++- shell/browser/electron_browser_main_parts.cc | 2 +- shell/browser/electron_browser_main_parts.h | 8 +++- .../electron_crypto_module_delegate_nss.cc | 1 + .../electron_download_manager_delegate.cc | 2 + .../electron_download_manager_delegate.h | 5 ++- shell/browser/electron_permission_manager.cc | 1 + shell/browser/electron_permission_manager.h | 13 ++++++- .../browser/extended_web_contents_observer.h | 1 + .../electron_extensions_api_client.cc | 1 - .../electron_extensions_browser_client.h | 8 +++- .../file_system_access_permission_context.h | 2 +- shell/browser/hid/hid_chooser_context.h | 8 +++- shell/browser/hid/hid_chooser_controller.cc | 2 + shell/browser/hid/hid_chooser_controller.h | 3 +- shell/browser/lib/power_observer_linux.h | 2 +- shell/browser/native_window_mac.mm | 1 - shell/browser/native_window_views.cc | 2 - shell/browser/net/asar/asar_url_loader.h | 8 +++- .../net/asar/asar_url_loader_factory.h | 9 ++++- .../browser/net/electron_url_loader_factory.h | 8 +++- shell/browser/net/network_context_service.h | 1 - shell/browser/net/node_stream_loader.h | 14 +++++-- .../browser/net/proxying_url_loader_factory.h | 9 ++++- shell/browser/net/resolve_host_function.cc | 2 + shell/browser/net/resolve_host_function.h | 7 +++- shell/browser/net/url_pipe_loader.h | 5 ++- shell/browser/net/web_request_api_interface.h | 5 ++- shell/browser/osr/osr_host_display_client.h | 3 +- .../browser/osr/osr_render_widget_host_view.h | 3 +- shell/browser/osr/osr_video_consumer.h | 2 +- shell/browser/osr/osr_web_contents_view.cc | 2 + shell/browser/osr/osr_web_contents_view.h | 8 +++- shell/browser/serial/serial_chooser_context.h | 6 ++- .../serial/serial_chooser_controller.cc | 3 ++ .../serial/serial_chooser_controller.h | 6 +-- shell/browser/ui/autofill_popup.cc | 1 + shell/browser/ui/autofill_popup.h | 10 ++++- shell/browser/ui/certificate_trust.h | 7 +++- shell/browser/ui/certificate_trust_mac.mm | 1 + shell/browser/ui/certificate_trust_win.cc | 1 + .../browser/ui/cocoa/electron_bundle_mover.h | 5 ++- .../browser/ui/cocoa/electron_bundle_mover.mm | 1 + shell/browser/ui/cocoa/electron_touch_bar.h | 5 ++- shell/browser/ui/cocoa/electron_touch_bar.mm | 3 ++ shell/browser/ui/file_dialog.h | 8 +++- shell/browser/ui/file_dialog_linux.cc | 2 + shell/browser/ui/file_dialog_mac.mm | 2 + shell/browser/ui/file_dialog_win.cc | 2 + shell/browser/ui/gtk/menu_util.h | 2 +- .../ui/inspectable_web_contents_view.h | 10 ++++- .../ui/inspectable_web_contents_view_mac.mm | 1 + shell/browser/ui/views/autofill_popup_view.cc | 1 + shell/browser/ui/views/autofill_popup_view.h | 5 ++- .../inspectable_web_contents_view_views.cc | 1 + shell/browser/usb/electron_usb_delegate.cc | 1 - shell/browser/usb/electron_usb_delegate.h | 9 ++++- shell/browser/usb/usb_chooser_context.cc | 1 + shell/browser/usb/usb_chooser_context.h | 10 ++++- shell/browser/usb/usb_chooser_controller.cc | 1 + shell/browser/usb/usb_chooser_controller.h | 7 ++-- shell/browser/web_contents_zoom_controller.h | 1 - shell/browser/web_contents_zoom_observer.h | 1 + shell/browser/zoom_level_delegate.h | 2 +- shell/common/api/electron_api_clipboard.cc | 1 + shell/common/api/electron_api_clipboard.h | 7 +++- shell/common/api/electron_api_native_image.cc | 2 + shell/common/api/electron_api_native_image.h | 18 +++++---- .../api/electron_api_native_image_mac.mm | 1 + shell/common/api/electron_api_shell.cc | 1 + shell/common/api/electron_api_url_loader.cc | 1 + shell/common/api/electron_api_url_loader.h | 7 +++- shell/common/api/electron_bindings.h | 3 +- shell/common/api/object_life_monitor.h | 4 +- .../common/gin_converters/image_converter.cc | 1 + shell/common/gin_converters/net_converter.cc | 1 + shell/common/gin_helper/callback.h | 1 + shell/common/gin_helper/constructible.h | 1 + shell/common/gin_helper/destroyable.cc | 1 + shell/common/gin_helper/destroyable.h | 2 +- shell/common/gin_helper/error_thrower.h | 2 +- shell/common/gin_helper/event.cc | 1 + shell/common/gin_helper/event.h | 6 ++- shell/common/gin_helper/function_template.h | 3 ++ shell/common/gin_helper/locker.cc | 1 + shell/common/gin_helper/locker.h | 5 ++- shell/common/gin_helper/microtasks_scope.h | 3 +- .../common/gin_helper/persistent_dictionary.h | 6 ++- shell/common/gin_helper/pinnable.h | 5 ++- shell/common/gin_helper/promise.cc | 1 + shell/common/gin_helper/promise.h | 1 + shell/common/gin_helper/wrappable.cc | 1 + shell/common/gin_helper/wrappable_base.h | 2 +- shell/common/key_weak_map.h | 2 +- shell/common/node_bindings.cc | 15 ++++++++ shell/common/node_bindings.h | 22 ++++------- shell/common/node_util.h | 2 +- .../api/context_bridge/object_cache.h | 1 - .../api/electron_api_context_bridge.h | 2 +- .../api/electron_api_spell_check_client.cc | 1 + .../api/electron_api_spell_check_client.h | 4 +- shell/renderer/api/electron_api_web_utils.h | 2 +- shell/renderer/renderer_client_base.cc | 4 ++ shell/renderer/renderer_client_base.h | 4 -- shell/renderer/web_worker_observer.h | 2 +- 187 files changed, 640 insertions(+), 223 deletions(-) diff --git a/shell/app/electron_content_client.h b/shell/app/electron_content_client.h index 2f046f06b8..ffaab188bc 100644 --- a/shell/app/electron_content_client.h +++ b/shell/app/electron_content_client.h @@ -8,7 +8,6 @@ #include #include -#include "base/files/file_path.h" #include "content/public/common/content_client.h" namespace electron { diff --git a/shell/browser/api/electron_api_app.cc b/shell/browser/api/electron_api_app.cc index a93b8d672a..5ac75f5303 100644 --- a/shell/browser/api/electron_api_app.cc +++ b/shell/browser/api/electron_api_app.cc @@ -39,6 +39,7 @@ #include "content/public/browser/network_service_instance.h" #include "content/public/browser/render_frame_host.h" #include "crypto/crypto_buildflags.h" +#include "gin/handle.h" #include "media/audio/audio_manager.h" #include "net/dns/public/dns_over_https_config.h" #include "net/dns/public/dns_over_https_server_config.h" @@ -72,6 +73,7 @@ #include "shell/common/gin_converters/net_converter.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/language_util.h" #include "shell/common/node_includes.h" diff --git a/shell/browser/api/electron_api_app.h b/shell/browser/api/electron_api_app.h index d158d20a8b..9c42389242 100644 --- a/shell/browser/api/electron_api_app.h +++ b/shell/browser/api/electron_api_app.h @@ -17,7 +17,6 @@ #include "content/public/browser/gpu_data_manager_observer.h" #include "content/public/browser/render_process_host.h" #include "crypto/crypto_buildflags.h" -#include "gin/handle.h" #include "net/base/completion_once_callback.h" #include "net/base/completion_repeating_callback.h" #include "net/ssl/client_cert_identity.h" @@ -25,9 +24,6 @@ #include "shell/browser/browser_observer.h" #include "shell/browser/electron_browser_client.h" #include "shell/browser/event_emitter_mixin.h" -#include "shell/common/gin_helper/dictionary.h" -#include "shell/common/gin_helper/error_thrower.h" -#include "shell/common/gin_helper/promise.h" #if BUILDFLAG(USE_NSS_CERTS) #include "shell/browser/certificate_manager_model.h" @@ -41,6 +37,16 @@ namespace gfx { class Image; } +namespace gin { +template +class Handle; +} // namespace gin + +namespace gin_helper { +class Dictionary; +class ErrorThrower; +} // namespace gin_helper + namespace electron { struct ProcessMetric; diff --git a/shell/browser/api/electron_api_auto_updater.cc b/shell/browser/api/electron_api_auto_updater.cc index b487cdaec1..d24db3c319 100644 --- a/shell/browser/api/electron_api_auto_updater.cc +++ b/shell/browser/api/electron_api_auto_updater.cc @@ -5,6 +5,7 @@ #include "shell/browser/api/electron_api_auto_updater.h" #include "base/time/time.h" +#include "gin/handle.h" #include "shell/browser/javascript_environment.h" #include "shell/browser/native_window.h" #include "shell/browser/window_list.h" diff --git a/shell/browser/api/electron_api_auto_updater.h b/shell/browser/api/electron_api_auto_updater.h index a1a3f2b07a..00fc40fbaf 100644 --- a/shell/browser/api/electron_api_auto_updater.h +++ b/shell/browser/api/electron_api_auto_updater.h @@ -7,12 +7,16 @@ #include -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/auto_updater.h" #include "shell/browser/event_emitter_mixin.h" #include "shell/browser/window_list_observer.h" +namespace gin { +template +class Handle; +} // namespace gin + namespace electron::api { class AutoUpdater : public gin::Wrappable, diff --git a/shell/browser/api/electron_api_base_window.cc b/shell/browser/api/electron_api_base_window.cc index c47fc24af1..3d1a5c292d 100644 --- a/shell/browser/api/electron_api_base_window.cc +++ b/shell/browser/api/electron_api_base_window.cc @@ -14,10 +14,12 @@ #include "content/public/common/color_parser.h" #include "electron/buildflags/buildflags.h" #include "gin/dictionary.h" +#include "gin/handle.h" #include "shell/browser/api/electron_api_menu.h" #include "shell/browser/api/electron_api_view.h" #include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/javascript_environment.h" +#include "shell/browser/native_window.h" #include "shell/common/color_util.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/file_path_converter.h" diff --git a/shell/browser/api/electron_api_base_window.h b/shell/browser/api/electron_api_base_window.h index 26af1ce52d..c488588d9c 100644 --- a/shell/browser/api/electron_api_base_window.h +++ b/shell/browser/api/electron_api_base_window.h @@ -14,14 +14,22 @@ #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" -#include "gin/handle.h" -#include "shell/browser/native_window.h" #include "shell/browser/native_window_observer.h" #include "shell/common/api/electron_api_native_image.h" -#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/trackable_object.h" -namespace electron::api { +namespace gin_helper { +class Arguments; +class PersistentDictionary; +template +class Handle; +} // namespace gin_helper + +namespace electron { + +class NativeWindow; + +namespace api { class View; @@ -279,6 +287,7 @@ class BaseWindow : public gin_helper::TrackableObject, base::WeakPtrFactory weak_factory_{this}; }; -} // namespace electron::api +} // namespace api +} // namespace electron #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_BASE_WINDOW_H_ diff --git a/shell/browser/api/electron_api_browser_window.cc b/shell/browser/api/electron_api_browser_window.cc index 12e769015e..0601449b62 100644 --- a/shell/browser/api/electron_api_browser_window.cc +++ b/shell/browser/api/electron_api_browser_window.cc @@ -10,11 +10,13 @@ #include "content/public/browser/render_view_host.h" #include "shell/browser/api/electron_api_web_contents_view.h" #include "shell/browser/browser.h" +#include "shell/browser/native_window.h" #include "shell/browser/web_contents_preferences.h" #include "shell/browser/window_list.h" #include "shell/common/color_util.h" #include "shell/common/gin_helper/constructor.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/node_includes.h" #include "shell/common/options_switches.h" diff --git a/shell/browser/api/electron_api_browser_window.h b/shell/browser/api/electron_api_browser_window.h index 2fc835cdcc..a492c3e97d 100644 --- a/shell/browser/api/electron_api_browser_window.h +++ b/shell/browser/api/electron_api_browser_window.h @@ -11,7 +11,10 @@ #include "shell/browser/api/electron_api_base_window.h" #include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/ui/drag_util.h" -#include "shell/common/gin_helper/error_thrower.h" + +namespace gin_helper { +class ErrorThrower; +} // namespace gin_helper namespace electron::api { diff --git a/shell/browser/api/electron_api_cookies.cc b/shell/browser/api/electron_api_cookies.cc index 98aa412f23..8870355084 100644 --- a/shell/browser/api/electron_api_cookies.cc +++ b/shell/browser/api/electron_api_cookies.cc @@ -15,8 +15,10 @@ #include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" #include "gin/dictionary.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "net/cookies/canonical_cookie.h" +#include "net/cookies/cookie_change_dispatcher.h" #include "net/cookies/cookie_inclusion_status.h" #include "net/cookies/cookie_store.h" #include "net/cookies/cookie_util.h" @@ -27,6 +29,7 @@ #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/object_template_builder.h" +#include "shell/common/gin_helper/promise.h" namespace gin { diff --git a/shell/browser/api/electron_api_cookies.h b/shell/browser/api/electron_api_cookies.h index 3dd16e84bc..50a9470401 100644 --- a/shell/browser/api/electron_api_cookies.h +++ b/shell/browser/api/electron_api_cookies.h @@ -10,16 +10,20 @@ #include "base/callback_list.h" #include "base/memory/raw_ptr.h" #include "base/values.h" -#include "gin/handle.h" -#include "net/cookies/canonical_cookie.h" -#include "net/cookies/cookie_change_dispatcher.h" #include "shell/browser/event_emitter_mixin.h" -#include "shell/common/gin_helper/promise.h" -#include "shell/common/gin_helper/trackable_object.h" + +namespace gin { +template +class Handle; +} // namespace gin namespace gin_helper { class Dictionary; -} +} // namespace gin_helper + +namespace net { +struct CookieChangeInfo; +} // namespace net namespace electron { diff --git a/shell/browser/api/electron_api_data_pipe_holder.cc b/shell/browser/api/electron_api_data_pipe_holder.cc index e40e7b7593..03b28431c7 100644 --- a/shell/browser/api/electron_api_data_pipe_holder.cc +++ b/shell/browser/api/electron_api_data_pipe_holder.cc @@ -11,6 +11,7 @@ #include "base/no_destructor.h" #include "base/strings/string_number_conversions.h" #include "base/task/sequenced_task_runner.h" +#include "gin/handle.h" #include "mojo/public/cpp/system/data_pipe.h" #include "mojo/public/cpp/system/simple_watcher.h" #include "net/base/net_errors.h" diff --git a/shell/browser/api/electron_api_data_pipe_holder.h b/shell/browser/api/electron_api_data_pipe_holder.h index cc3b1b32f6..f6c09cf34a 100644 --- a/shell/browser/api/electron_api_data_pipe_holder.h +++ b/shell/browser/api/electron_api_data_pipe_holder.h @@ -7,12 +7,16 @@ #include -#include "gin/handle.h" #include "gin/wrappable.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/network/public/cpp/data_element.h" #include "services/network/public/mojom/data_pipe_getter.mojom.h" +namespace gin { +template +class Handle; +} // namespace gin + namespace electron::api { // Retains reference to the data pipe. diff --git a/shell/browser/api/electron_api_debugger.cc b/shell/browser/api/electron_api_debugger.cc index c6e6bf0635..b1f2ed59fc 100755 --- a/shell/browser/api/electron_api_debugger.cc +++ b/shell/browser/api/electron_api_debugger.cc @@ -12,10 +12,12 @@ #include "base/json/json_writer.h" #include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/web_contents.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "gin/per_isolate_data.h" #include "shell/browser/javascript_environment.h" #include "shell/common/gin_converters/value_converter.h" +#include "shell/common/gin_helper/promise.h" #include "shell/common/node_includes.h" using content::DevToolsAgentHost; diff --git a/shell/browser/api/electron_api_debugger.h b/shell/browser/api/electron_api_debugger.h index 3bbc0f0423..f4329ee4fc 100644 --- a/shell/browser/api/electron_api_debugger.h +++ b/shell/browser/api/electron_api_debugger.h @@ -11,10 +11,8 @@ #include "base/values.h" #include "content/public/browser/devtools_agent_host_client.h" #include "content/public/browser/web_contents_observer.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/event_emitter_mixin.h" -#include "shell/common/gin_helper/promise.h" namespace content { class DevToolsAgentHost; @@ -25,6 +23,13 @@ namespace gin { class Arguments; } // namespace gin +namespace gin_helper { +template +class Handle; +template +class Promise; +} // namespace gin_helper + namespace electron::api { class Debugger : public gin::Wrappable, diff --git a/shell/browser/api/electron_api_desktop_capturer.cc b/shell/browser/api/electron_api_desktop_capturer.cc index ba762bb151..c0e1f4eca3 100644 --- a/shell/browser/api/electron_api_desktop_capturer.cc +++ b/shell/browser/api/electron_api_desktop_capturer.cc @@ -17,6 +17,7 @@ #include "chrome/browser/media/webrtc/thumbnail_capturer_mac.h" #include "chrome/browser/media/webrtc/window_icon_util.h" #include "content/public/browser/desktop_capture.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "shell/browser/javascript_environment.h" #include "shell/common/api/electron_api_native_image.h" diff --git a/shell/browser/api/electron_api_desktop_capturer.h b/shell/browser/api/electron_api_desktop_capturer.h index 58927aad3d..2269fa6bb7 100644 --- a/shell/browser/api/electron_api_desktop_capturer.h +++ b/shell/browser/api/electron_api_desktop_capturer.h @@ -11,10 +11,14 @@ #include "chrome/browser/media/webrtc/desktop_media_list_observer.h" #include "chrome/browser/media/webrtc/native_desktop_media_list.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/common/gin_helper/pinnable.h" +namespace gin { +template +class Handle; +} // namespace gin + namespace electron::api { class DesktopCapturer : public gin::Wrappable, diff --git a/shell/browser/api/electron_api_dialog.cc b/shell/browser/api/electron_api_dialog.cc index 4ce5edca3e..66c7bf2937 100644 --- a/shell/browser/api/electron_api_dialog.cc +++ b/shell/browser/api/electron_api_dialog.cc @@ -17,6 +17,9 @@ #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/promise.h" #include "shell/common/node_includes.h" +#include "v8/include/v8-isolate.h" +#include "v8/include/v8-local-handle.h" +#include "v8/include/v8-promise.h" namespace { diff --git a/shell/browser/api/electron_api_download_item.cc b/shell/browser/api/electron_api_download_item.cc index 1e526afe93..1e8a142e48 100644 --- a/shell/browser/api/electron_api_download_item.cc +++ b/shell/browser/api/electron_api_download_item.cc @@ -7,6 +7,7 @@ #include #include "base/strings/utf_string_conversions.h" +#include "gin/handle.h" #include "net/base/filename_util.h" #include "shell/browser/electron_browser_main_parts.h" #include "shell/common/gin_converters/file_dialog_converter.h" diff --git a/shell/browser/api/electron_api_download_item.h b/shell/browser/api/electron_api_download_item.h index b909386c2f..46e9e7b193 100644 --- a/shell/browser/api/electron_api_download_item.h +++ b/shell/browser/api/electron_api_download_item.h @@ -11,7 +11,6 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "components/download/public/common/download_item.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/event_emitter_mixin.h" #include "shell/browser/ui/file_dialog.h" @@ -19,6 +18,11 @@ class GURL; +namespace gin { +template +class Handle; +} // namespace gin + namespace electron::api { class DownloadItem : public gin::Wrappable, diff --git a/shell/browser/api/electron_api_global_shortcut.cc b/shell/browser/api/electron_api_global_shortcut.cc index 1aea6a6760..ebd59b2716 100644 --- a/shell/browser/api/electron_api_global_shortcut.cc +++ b/shell/browser/api/electron_api_global_shortcut.cc @@ -9,6 +9,7 @@ #include "base/containers/contains.h" #include "extensions/common/command.h" #include "gin/dictionary.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "shell/browser/api/electron_api_system_preferences.h" #include "shell/browser/browser.h" diff --git a/shell/browser/api/electron_api_global_shortcut.h b/shell/browser/api/electron_api_global_shortcut.h index b89b8bd4ad..8b1048680c 100644 --- a/shell/browser/api/electron_api_global_shortcut.h +++ b/shell/browser/api/electron_api_global_shortcut.h @@ -8,12 +8,16 @@ #include #include -#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" #include "chrome/browser/extensions/global_shortcut_listener.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "ui/base/accelerators/accelerator.h" +namespace gin { +template +class Handle; +} // namespace gin + namespace electron::api { class GlobalShortcut : private extensions::GlobalShortcutListener::Observer, diff --git a/shell/browser/api/electron_api_in_app_purchase.cc b/shell/browser/api/electron_api_in_app_purchase.cc index ac78a07f1a..6bc1408806 100644 --- a/shell/browser/api/electron_api_in_app_purchase.cc +++ b/shell/browser/api/electron_api_in_app_purchase.cc @@ -8,6 +8,7 @@ #include #include +#include "gin/handle.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/gin_helper/promise.h" diff --git a/shell/browser/api/electron_api_in_app_purchase.h b/shell/browser/api/electron_api_in_app_purchase.h index e89a7ca691..4e88a49556 100644 --- a/shell/browser/api/electron_api_in_app_purchase.h +++ b/shell/browser/api/electron_api_in_app_purchase.h @@ -8,13 +8,17 @@ #include #include -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/event_emitter_mixin.h" #include "shell/browser/mac/in_app_purchase.h" #include "shell/browser/mac/in_app_purchase_observer.h" #include "shell/browser/mac/in_app_purchase_product.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" + +namespace gin { +template +class Handle; +} // namespace gin namespace electron::api { diff --git a/shell/browser/api/electron_api_menu.cc b/shell/browser/api/electron_api_menu.cc index 257013e63f..9a87c9e193 100644 --- a/shell/browser/api/electron_api_menu.cc +++ b/shell/browser/api/electron_api_menu.cc @@ -6,6 +6,7 @@ #include +#include "shell/browser/api/electron_api_base_window.h" #include "shell/browser/api/ui_event.h" #include "shell/browser/javascript_environment.h" #include "shell/browser/native_window.h" diff --git a/shell/browser/api/electron_api_menu.h b/shell/browser/api/electron_api_menu.h index 2191c412aa..352d9cccbb 100644 --- a/shell/browser/api/electron_api_menu.h +++ b/shell/browser/api/electron_api_menu.h @@ -9,7 +9,6 @@ #include #include "base/memory/raw_ptr.h" -#include "shell/browser/api/electron_api_base_window.h" #include "shell/browser/event_emitter_mixin.h" #include "shell/browser/ui/electron_menu_model.h" #include "shell/common/gin_helper/constructible.h" @@ -21,6 +20,8 @@ class Arguments; namespace electron::api { +class BaseWindow; + class Menu : public gin::Wrappable, public gin_helper::EventEmitterMixin, public gin_helper::Constructible, diff --git a/shell/browser/api/electron_api_menu_mac.h b/shell/browser/api/electron_api_menu_mac.h index 0e8277e00b..2f8939c2c9 100644 --- a/shell/browser/api/electron_api_menu_mac.h +++ b/shell/browser/api/electron_api_menu_mac.h @@ -11,7 +11,10 @@ #import "shell/browser/ui/cocoa/electron_menu_controller.h" -namespace electron::api { +namespace electron { +class NativeWindow; + +namespace api { class MenuMac : public Menu { protected: @@ -48,6 +51,7 @@ class MenuMac : public Menu { base::WeakPtrFactory weak_factory_{this}; }; -} // namespace electron::api +} // namespace api +} // namespace electron #endif // ELECTRON_SHELL_BROWSER_API_ELECTRON_API_MENU_MAC_H_ diff --git a/shell/browser/api/electron_api_menu_mac.mm b/shell/browser/api/electron_api_menu_mac.mm index aac780025d..0aa2d17c62 100644 --- a/shell/browser/api/electron_api_menu_mac.mm +++ b/shell/browser/api/electron_api_menu_mac.mm @@ -12,6 +12,7 @@ #include "base/task/current_thread.h" #include "base/task/sequenced_task_runner.h" #include "content/public/browser/browser_task_traits.h" +#include "shell/browser/api/electron_api_base_window.h" #include "shell/browser/native_window.h" #include "shell/common/keyboard_util.h" #include "shell/common/node_includes.h" diff --git a/shell/browser/api/electron_api_menu_views.cc b/shell/browser/api/electron_api_menu_views.cc index c83c2215d4..51aae3c591 100644 --- a/shell/browser/api/electron_api_menu_views.cc +++ b/shell/browser/api/electron_api_menu_views.cc @@ -7,6 +7,7 @@ #include #include +#include "shell/browser/api/electron_api_base_window.h" #include "shell/browser/native_window_views.h" #include "ui/display/screen.h" diff --git a/shell/browser/api/electron_api_menu_views.h b/shell/browser/api/electron_api_menu_views.h index 57f01b5ab2..a4984bd59a 100644 --- a/shell/browser/api/electron_api_menu_views.h +++ b/shell/browser/api/electron_api_menu_views.h @@ -10,7 +10,6 @@ #include "base/containers/flat_map.h" #include "base/memory/weak_ptr.h" #include "shell/browser/api/electron_api_menu.h" -#include "ui/display/screen.h" #include "ui/views/controls/menu/menu_runner.h" namespace electron::api { diff --git a/shell/browser/api/electron_api_native_theme.h b/shell/browser/api/electron_api_native_theme.h index 51db378549..70066558b2 100644 --- a/shell/browser/api/electron_api_native_theme.h +++ b/shell/browser/api/electron_api_native_theme.h @@ -6,12 +6,16 @@ #define ELECTRON_SHELL_BROWSER_API_ELECTRON_API_NATIVE_THEME_H_ #include "base/memory/raw_ptr.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/event_emitter_mixin.h" #include "ui/native_theme/native_theme.h" #include "ui/native_theme/native_theme_observer.h" +namespace gin { +template +class handle; +} // namespace gin + namespace electron::api { class NativeTheme : public gin::Wrappable, diff --git a/shell/browser/api/electron_api_net_log.cc b/shell/browser/api/electron_api_net_log.cc index 45c21384c1..d447d55252 100644 --- a/shell/browser/api/electron_api_net_log.cc +++ b/shell/browser/api/electron_api_net_log.cc @@ -15,6 +15,7 @@ #include "components/net_log/chrome_net_log.h" #include "content/public/browser/storage_partition.h" #include "electron/electron_version.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "net/log/net_log_capture_mode.h" #include "shell/browser/electron_browser_context.h" diff --git a/shell/browser/api/electron_api_net_log.h b/shell/browser/api/electron_api_net_log.h index 0cc0c1b15c..e7aa9b733f 100644 --- a/shell/browser/api/electron_api_net_log.h +++ b/shell/browser/api/electron_api_net_log.h @@ -7,20 +7,26 @@ #include -#include "base/files/file_path.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/values.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "mojo/public/cpp/bindings/remote.h" #include "net/log/net_log_capture_mode.h" #include "services/network/public/mojom/net_log.mojom.h" #include "shell/common/gin_helper/promise.h" +namespace base { +class FilePath; +class TaskRunner; +} // namespace base + namespace gin { class Arguments; -} + +template +class Handle; +} // namespace gin namespace electron { diff --git a/shell/browser/api/electron_api_notification.cc b/shell/browser/api/electron_api_notification.cc index 99de6e9a80..e78da69df9 100644 --- a/shell/browser/api/electron_api_notification.cc +++ b/shell/browser/api/electron_api_notification.cc @@ -11,6 +11,7 @@ #include "shell/browser/electron_browser_client.h" #include "shell/common/gin_converters/image_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/node_includes.h" #include "url/gurl.h" diff --git a/shell/browser/api/electron_api_notification.h b/shell/browser/api/electron_api_notification.h index 4e0944456a..0ba10e8c79 100644 --- a/shell/browser/api/electron_api_notification.h +++ b/shell/browser/api/electron_api_notification.h @@ -16,7 +16,6 @@ #include "shell/browser/notifications/notification_presenter.h" #include "shell/common/gin_helper/cleaned_up_at_exit.h" #include "shell/common/gin_helper/constructible.h" -#include "shell/common/gin_helper/error_thrower.h" #include "ui/gfx/image/image.h" namespace gin { @@ -25,6 +24,10 @@ template class Handle; } // namespace gin +namespace gin_helper { +class ErrorThrower; +} // namespace gin_helper + namespace electron::api { class Notification : public gin::Wrappable, diff --git a/shell/browser/api/electron_api_power_save_blocker.cc b/shell/browser/api/electron_api_power_save_blocker.cc index c34ffe989f..91adc75f09 100644 --- a/shell/browser/api/electron_api_power_save_blocker.cc +++ b/shell/browser/api/electron_api_power_save_blocker.cc @@ -11,6 +11,8 @@ #include "content/public/browser/device_service.h" #include "gin/dictionary.h" #include "gin/function_template.h" +#include "gin/handle.h" +#include "gin/object_template_builder.h" #include "services/device/public/mojom/wake_lock_provider.mojom.h" #include "services/service_manager/public/cpp/connector.h" #include "shell/common/node_includes.h" diff --git a/shell/browser/api/electron_api_power_save_blocker.h b/shell/browser/api/electron_api_power_save_blocker.h index 349aaf18d7..43b2265b06 100644 --- a/shell/browser/api/electron_api_power_save_blocker.h +++ b/shell/browser/api/electron_api_power_save_blocker.h @@ -6,12 +6,17 @@ #define ELECTRON_SHELL_BROWSER_API_ELECTRON_API_POWER_SAVE_BLOCKER_H_ #include "base/containers/flat_map.h" -#include "gin/handle.h" -#include "gin/object_template_builder.h" #include "gin/wrappable.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/wake_lock.mojom.h" +namespace gin { +class ObjectTemplateBuilder; + +template +class Handle; +} // namespace gin + namespace electron::api { class PowerSaveBlocker : public gin::Wrappable { diff --git a/shell/browser/api/electron_api_protocol.cc b/shell/browser/api/electron_api_protocol.cc index ed1652fdbf..9e6cfe3998 100644 --- a/shell/browser/api/electron_api_protocol.cc +++ b/shell/browser/api/electron_api_protocol.cc @@ -10,6 +10,7 @@ #include "base/command_line.h" #include "content/common/url_schemes.h" #include "content/public/browser/child_process_security_policy.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "shell/browser/browser.h" #include "shell/browser/electron_browser_context.h" diff --git a/shell/browser/api/electron_api_protocol.h b/shell/browser/api/electron_api_protocol.h index 43143a695e..82d74013b3 100644 --- a/shell/browser/api/electron_api_protocol.h +++ b/shell/browser/api/electron_api_protocol.h @@ -10,13 +10,14 @@ #include "base/memory/raw_ptr.h" #include "content/public/browser/content_browser_client.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/net/electron_url_loader_factory.h" #include "shell/common/gin_helper/constructible.h" namespace gin { class Arguments; +template +class Handle; } // namespace gin namespace electron { diff --git a/shell/browser/api/electron_api_push_notifications.cc b/shell/browser/api/electron_api_push_notifications.cc index 797b1c8d0e..c443e24c07 100644 --- a/shell/browser/api/electron_api_push_notifications.cc +++ b/shell/browser/api/electron_api_push_notifications.cc @@ -4,6 +4,7 @@ #include "shell/browser/api/electron_api_push_notifications.h" +#include "gin/handle.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" #include "shell/common/node_includes.h" diff --git a/shell/browser/api/electron_api_push_notifications.h b/shell/browser/api/electron_api_push_notifications.h index 6f1e9f1215..5cc3277080 100644 --- a/shell/browser/api/electron_api_push_notifications.h +++ b/shell/browser/api/electron_api_push_notifications.h @@ -8,13 +8,17 @@ #include #include -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/browser_observer.h" #include "shell/browser/electron_browser_client.h" #include "shell/browser/event_emitter_mixin.h" #include "shell/common/gin_helper/promise.h" +namespace gin { +template +class Handle; +} // namespace gin + namespace electron::api { class PushNotifications diff --git a/shell/browser/api/electron_api_screen.cc b/shell/browser/api/electron_api_screen.cc index 3a4065e3e2..93a2eaa321 100644 --- a/shell/browser/api/electron_api_screen.cc +++ b/shell/browser/api/electron_api_screen.cc @@ -14,6 +14,7 @@ #include "shell/common/gin_converters/gfx_converter.h" #include "shell/common/gin_converters/native_window_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/node_includes.h" #include "ui/display/display.h" diff --git a/shell/browser/api/electron_api_screen.h b/shell/browser/api/electron_api_screen.h index c94d0f62b9..bbc7ade94d 100644 --- a/shell/browser/api/electron_api_screen.h +++ b/shell/browser/api/electron_api_screen.h @@ -10,7 +10,6 @@ #include "base/memory/raw_ptr.h" #include "gin/wrappable.h" #include "shell/browser/event_emitter_mixin.h" -#include "shell/common/gin_helper/error_thrower.h" #include "ui/display/display_observer.h" #include "ui/display/screen.h" @@ -20,6 +19,10 @@ class Rect; class Screen; } // namespace gfx +namespace gin_helper { +class ErrorThrower; +} // namespace gin_helper + namespace electron::api { class Screen : public gin::Wrappable, diff --git a/shell/browser/api/electron_api_service_worker_context.h b/shell/browser/api/electron_api_service_worker_context.h index 52f617e59e..fb6bb9fe6e 100644 --- a/shell/browser/api/electron_api_service_worker_context.h +++ b/shell/browser/api/electron_api_service_worker_context.h @@ -8,10 +8,14 @@ #include "base/memory/raw_ptr.h" #include "content/public/browser/service_worker_context.h" #include "content/public/browser/service_worker_context_observer.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/event_emitter_mixin.h" +namespace gin { +template +class Handle; +} // namespace gin + namespace electron { class ElectronBrowserContext; diff --git a/shell/browser/api/electron_api_session.cc b/shell/browser/api/electron_api_session.cc index 4266a8de14..a82329e70e 100644 --- a/shell/browser/api/electron_api_session.cc +++ b/shell/browser/api/electron_api_session.cc @@ -21,6 +21,7 @@ #include "base/strings/stringprintf.h" #include "base/uuid.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/predictors/preconnect_manager.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "components/download/public/common/download_danger_type.h" @@ -41,6 +42,7 @@ #include "content/public/browser/storage_partition.h" #include "gin/arguments.h" #include "gin/converter.h" +#include "gin/handle.h" #include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" #include "net/base/completion_repeating_callback.h" @@ -80,6 +82,7 @@ #include "shell/common/gin_converters/usb_protected_classes_converter.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/gin_helper/promise.h" #include "shell/common/node_includes.h" diff --git a/shell/browser/api/electron_api_session.h b/shell/browser/api/electron_api_session.h index 40d55c98f3..37a1c9b2fb 100644 --- a/shell/browser/api/electron_api_session.h +++ b/shell/browser/api/electron_api_session.h @@ -15,7 +15,6 @@ #include "base/values.h" #include "content/public/browser/download_manager.h" #include "electron/buildflags/buildflags.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "services/network/public/mojom/host_resolver.mojom.h" #include "services/network/public/mojom/ssl_config.mojom.h" @@ -23,9 +22,7 @@ #include "shell/browser/net/resolve_proxy_helper.h" #include "shell/common/gin_helper/cleaned_up_at_exit.h" #include "shell/common/gin_helper/constructible.h" -#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/pinnable.h" -#include "shell/common/gin_helper/promise.h" #if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER) #include "chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h" // nogncheck @@ -42,13 +39,16 @@ namespace base { class FilePath; } -namespace gin_helper { -class Dictionary; -} - namespace gin { class Arguments; -} +template +class Handle; +} // namespace gin + +namespace gin_helper { +class Dictionary; +class ErrorThrower; +} // namespace gin_helper namespace net { class ProxyConfig; diff --git a/shell/browser/api/electron_api_system_preferences.cc b/shell/browser/api/electron_api_system_preferences.cc index a9dc69d9ae..dec3d1f3ff 100644 --- a/shell/browser/api/electron_api_system_preferences.cc +++ b/shell/browser/api/electron_api_system_preferences.cc @@ -4,9 +4,11 @@ #include "shell/browser/api/electron_api_system_preferences.h" +#include "gin/handle.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/node_includes.h" #include "ui/gfx/animation/animation.h" diff --git a/shell/browser/api/electron_api_system_preferences.h b/shell/browser/api/electron_api_system_preferences.h index 03db491df6..f5021242a0 100644 --- a/shell/browser/api/electron_api_system_preferences.h +++ b/shell/browser/api/electron_api_system_preferences.h @@ -9,11 +9,8 @@ #include #include "base/values.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/event_emitter_mixin.h" -#include "shell/common/gin_helper/error_thrower.h" -#include "shell/common/gin_helper/promise.h" #if BUILDFLAG(IS_WIN) #include "shell/browser/browser.h" @@ -21,6 +18,15 @@ #include "ui/gfx/sys_color_change_listener.h" #endif +namespace gin { +template +class Handle; +} // namespace gin + +namespace gin_helper { +class ErrorThrower; +} // namespace gin_helper + namespace electron::api { #if BUILDFLAG(IS_MAC) diff --git a/shell/browser/api/electron_api_system_preferences_mac.mm b/shell/browser/api/electron_api_system_preferences_mac.mm index 424ba6b67d..31b01648c6 100644 --- a/shell/browser/api/electron_api_system_preferences_mac.mm +++ b/shell/browser/api/electron_api_system_preferences_mac.mm @@ -24,6 +24,7 @@ #include "shell/common/color_util.h" #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/value_converter.h" +#include "shell/common/gin_helper/promise.h" #include "shell/common/node_includes.h" #include "shell/common/process_util.h" #include "skia/ext/skia_utils_mac.h" diff --git a/shell/browser/api/electron_api_tray.cc b/shell/browser/api/electron_api_tray.cc index c0357be64e..2b285ed5be 100644 --- a/shell/browser/api/electron_api_tray.cc +++ b/shell/browser/api/electron_api_tray.cc @@ -9,6 +9,7 @@ #include "base/containers/fixed_flat_map.h" #include "gin/dictionary.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "shell/browser/api/electron_api_menu.h" #include "shell/browser/api/ui_event.h" @@ -20,6 +21,7 @@ #include "shell/common/gin_converters/guid_converter.h" #include "shell/common/gin_converters/image_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/node_includes.h" namespace gin { diff --git a/shell/browser/api/electron_api_tray.h b/shell/browser/api/electron_api_tray.h index 2eb7126673..8f3433d33a 100644 --- a/shell/browser/api/electron_api_tray.h +++ b/shell/browser/api/electron_api_tray.h @@ -10,7 +10,6 @@ #include #include -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/event_emitter_mixin.h" #include "shell/browser/ui/tray_icon.h" @@ -18,16 +17,22 @@ #include "shell/common/gin_converters/guid_converter.h" #include "shell/common/gin_helper/cleaned_up_at_exit.h" #include "shell/common/gin_helper/constructible.h" -#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/pinnable.h" namespace gfx { class Image; -} +class Image; +} // namespace gfx + +namespace gin { +template +class Handle; +} // namespace gin namespace gin_helper { class Dictionary; -} +class ErrorThrower; +} // namespace gin_helper namespace electron::api { diff --git a/shell/browser/api/electron_api_utility_process.h b/shell/browser/api/electron_api_utility_process.h index b57dca1677..9e5d40ea1c 100644 --- a/shell/browser/api/electron_api_utility_process.h +++ b/shell/browser/api/electron_api_utility_process.h @@ -15,14 +15,12 @@ #include "base/process/process_handle.h" #include "content/public/browser/service_process_host.h" #include "gin/wrappable.h" -#include "mojo/public/cpp/bindings/connector.h" #include "mojo/public/cpp/bindings/message.h" -#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "shell/browser/event_emitter_mixin.h" #include "shell/common/gin_helper/pinnable.h" #include "shell/services/node/public/mojom/node_service.mojom.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace gin { class Arguments; @@ -34,6 +32,10 @@ namespace base { class Process; } // namespace base +namespace mojo { +class Connector; +} // namespace mojo + namespace electron::api { class UtilityProcessWrapper diff --git a/shell/browser/api/electron_api_view.cc b/shell/browser/api/electron_api_view.cc index 4ba9c4bc7b..b01a08be88 100644 --- a/shell/browser/api/electron_api_view.cc +++ b/shell/browser/api/electron_api_view.cc @@ -12,6 +12,7 @@ #include "ash/style/rounded_rect_cutout_path_builder.h" #include "gin/data_object_builder.h" +#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/javascript_environment.h" #include "shell/common/gin_converters/callback_converter.h" diff --git a/shell/browser/api/electron_api_view.h b/shell/browser/api/electron_api_view.h index b3fd2e9cd8..6eeb165219 100644 --- a/shell/browser/api/electron_api_view.h +++ b/shell/browser/api/electron_api_view.h @@ -8,13 +8,17 @@ #include #include "base/memory/raw_ptr.h" -#include "gin/handle.h" #include "shell/common/color_util.h" #include "shell/common/gin_helper/event_emitter.h" #include "ui/views/view.h" #include "ui/views/view_observer.h" #include "v8/include/v8-value.h" +namespace gin { +template +class Handle; +} // namespace gin + namespace electron::api { class View : public gin_helper::EventEmitter, diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index fb671694de..aff36bcc4f 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -26,6 +26,7 @@ #include "base/threading/scoped_blocking_call.h" #include "base/values.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/devtools/devtools_eye_dropper.h" #include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h" #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" #include "chrome/browser/ui/views/eye_dropper/eye_dropper.h" @@ -48,6 +49,7 @@ #include "content/public/browser/download_request_utils.h" #include "content/public/browser/favicon_status.h" #include "content/public/browser/file_select_listener.h" +#include "content/public/browser/keyboard_event_processing_result.h" #include "content/public/browser/navigation_details.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/navigation_handle.h" @@ -83,6 +85,7 @@ #include "shell/browser/api/electron_api_debugger.h" #include "shell/browser/api/electron_api_session.h" #include "shell/browser/api/electron_api_web_frame_main.h" +#include "shell/browser/api/frame_subscriber.h" #include "shell/browser/api/message_port.h" #include "shell/browser/browser.h" #include "shell/browser/child_web_contents_tracker.h" @@ -121,7 +124,9 @@ #include "shell/common/gin_converters/optional_converter.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/object_template_builder.h" +#include "shell/common/gin_helper/promise.h" #include "shell/common/language_util.h" #include "shell/common/node_includes.h" #include "shell/common/options_switches.h" @@ -179,7 +184,6 @@ #if BUILDFLAG(ENABLE_PDF_VIEWER) #include "components/pdf/browser/pdf_document_helper.h" // nogncheck -#include "shell/browser/electron_pdf_document_helper_client.h" #endif #if BUILDFLAG(ENABLE_PLUGINS) diff --git a/shell/browser/api/electron_api_web_contents.h b/shell/browser/api/electron_api_web_contents.h index df5e8c31dd..a0bd0ff9ef 100644 --- a/shell/browser/api/electron_api_web_contents.h +++ b/shell/browser/api/electron_api_web_contents.h @@ -18,42 +18,33 @@ #include "base/memory/raw_ptr_exclusion.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" -#include "base/observer_list_types.h" #include "base/task/thread_pool.h" -#include "chrome/browser/devtools/devtools_eye_dropper.h" #include "chrome/browser/devtools/devtools_file_system_indexer.h" #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" // nogncheck #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" #include "content/common/frame.mojom.h" #include "content/public/browser/devtools_agent_host.h" #include "content/public/browser/javascript_dialog_manager.h" -#include "content/public/browser/keyboard_event_processing_result.h" #include "content/public/browser/render_widget_host.h" -#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_observer.h" #include "electron/buildflags/buildflags.h" #include "electron/shell/common/api/api.mojom.h" #include "gin/handle.h" #include "gin/wrappable.h" -#include "mojo/public/cpp/bindings/receiver_set.h" #include "printing/buildflags/buildflags.h" -#include "shell/browser/api/frame_subscriber.h" #include "shell/browser/api/save_page_handler.h" #include "shell/browser/background_throttling_source.h" #include "shell/browser/event_emitter_mixin.h" #include "shell/browser/extended_web_contents_observer.h" -#include "shell/browser/ui/inspectable_web_contents.h" #include "shell/browser/ui/inspectable_web_contents_delegate.h" #include "shell/browser/ui/inspectable_web_contents_view_delegate.h" #include "shell/common/gin_helper/cleaned_up_at_exit.h" #include "shell/common/gin_helper/constructible.h" -#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/pinnable.h" #include "ui/base/models/image_model.h" #if BUILDFLAG(ENABLE_PRINTING) -#include "components/printing/browser/print_to_pdf/pdf_print_result.h" #include "shell/browser/printing/print_view_manager_electron.h" #endif @@ -70,22 +61,35 @@ struct DeviceEmulationParams; // enum class PermissionType; } // namespace blink -namespace gin_helper { -class Dictionary; -} - -namespace network { -class ResourceRequestBody; -} +namespace content { +enum class KeyboardEventProcessingResult; +class WebContents; +} // namespace content namespace gin { class Arguments; } +namespace gin_helper { +class Dictionary; +class ErrorThrower; +template +class Promise; +} // namespace gin_helper + +namespace network { +class ResourceRequestBody; +} + +namespace print_to_pdf { +enum class PdfPrintResult; +} // namespace print_to_pdf + namespace ui { class Cursor; } +class DevToolsEyeDropper; class SkRegion; namespace electron { @@ -94,7 +98,6 @@ class ElectronBrowserContext; class InspectableWebContents; class WebContentsZoomController; class WebViewGuestDelegate; -class FrameSubscriber; class WebDialogHelper; class NativeWindow; class OffScreenRenderWidgetHostView; @@ -103,6 +106,7 @@ class OffScreenWebContentsView; namespace api { class BaseWindow; +class FrameSubscriber; // Wrapper around the content::WebContents. class WebContents : public ExclusiveAccessContext, diff --git a/shell/browser/api/electron_api_web_contents_view.cc b/shell/browser/api/electron_api_web_contents_view.cc index a46f97d85d..639fdecf77 100644 --- a/shell/browser/api/electron_api_web_contents_view.cc +++ b/shell/browser/api/electron_api_web_contents_view.cc @@ -9,6 +9,7 @@ #include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/browser.h" #include "shell/browser/native_window.h" +#include "shell/browser/ui/inspectable_web_contents.h" #include "shell/browser/ui/inspectable_web_contents_view.h" #include "shell/browser/web_contents_preferences.h" #include "shell/common/gin_converters/gfx_converter.h" diff --git a/shell/browser/api/electron_api_web_frame_main.cc b/shell/browser/api/electron_api_web_frame_main.cc index b6f49a68ab..e18ca3cc4c 100644 --- a/shell/browser/api/electron_api_web_frame_main.cc +++ b/shell/browser/api/electron_api_web_frame_main.cc @@ -15,6 +15,7 @@ #include "content/public/browser/render_frame_host.h" #include "content/public/common/isolated_world_ids.h" #include "electron/shell/common/api/api.mojom.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "services/service_manager/public/cpp/interface_provider.h" #include "shell/browser/api/message_port.h" diff --git a/shell/browser/api/electron_api_web_frame_main.h b/shell/browser/api/electron_api_web_frame_main.h index ddf7bdd630..c4552b03a8 100644 --- a/shell/browser/api/electron_api_web_frame_main.h +++ b/shell/browser/api/electron_api_web_frame_main.h @@ -12,8 +12,8 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/process/process.h" -#include "gin/handle.h" #include "gin/wrappable.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "shell/browser/event_emitter_mixin.h" #include "shell/common/gin_helper/constructible.h" @@ -28,7 +28,10 @@ class RenderFrameHost; namespace gin { class Arguments; -} + +template +class Handle; +} // namespace gin namespace electron::api { @@ -78,8 +81,8 @@ class WebFrameMain : public gin::Wrappable, void Destroyed(); // Mark RenderFrameHost as disposed and to no longer access it. This can - // happen when the WebFrameMain v8 handle is GC'd or when a FrameTreeNode - // is removed. + // happen when the WebFrameMain v8-forward.handle is GC'd or when a + // FrameTreeNode is removed. void MarkRenderFrameDisposed(); // Swap out the internal RFH when cross-origin navigation occurs. diff --git a/shell/browser/api/electron_api_web_request.cc b/shell/browser/api/electron_api_web_request.cc index d58a6e4d4c..8a96ddffcd 100644 --- a/shell/browser/api/electron_api_web_request.cc +++ b/shell/browser/api/electron_api_web_request.cc @@ -14,9 +14,12 @@ #include "base/memory/raw_ptr.h" #include "base/task/sequenced_task_runner.h" #include "base/values.h" +#include "extensions/browser/api/web_request/web_request_info.h" #include "extensions/browser/api/web_request/web_request_resource_type.h" +#include "extensions/common/url_pattern.h" #include "gin/converter.h" #include "gin/dictionary.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "net/http/http_content_disposition.h" #include "shell/browser/api/electron_api_session.h" diff --git a/shell/browser/api/electron_api_web_request.h b/shell/browser/api/electron_api_web_request.h index f0294cc3ff..7a0add857f 100644 --- a/shell/browser/api/electron_api_web_request.h +++ b/shell/browser/api/electron_api_web_request.h @@ -9,18 +9,25 @@ #include #include "base/memory/raw_ptr.h" -#include "extensions/common/url_pattern.h" -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/browser/net/web_request_api_interface.h" +class URLPattern; + namespace content { class BrowserContext; } +namespace extensions { +enum class WebRequestResourceType : uint8_t; +} // namespace extensions + namespace gin { class Arguments; -} + +template +class Handle; +} // namespace gin namespace electron::api { diff --git a/shell/browser/api/frame_subscriber.cc b/shell/browser/api/frame_subscriber.cc index 918fbef362..9a40810dff 100644 --- a/shell/browser/api/frame_subscriber.cc +++ b/shell/browser/api/frame_subscriber.cc @@ -9,6 +9,7 @@ #include "content/public/browser/render_view_host.h" #include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host_view.h" +#include "content/public/browser/web_contents.h" #include "media/capture/mojom/video_capture_buffer.mojom.h" #include "media/capture/mojom/video_capture_types.mojom.h" #include "mojo/public/cpp/bindings/remote.h" diff --git a/shell/browser/api/frame_subscriber.h b/shell/browser/api/frame_subscriber.h index 7fd3286ab3..73fcbec234 100644 --- a/shell/browser/api/frame_subscriber.h +++ b/shell/browser/api/frame_subscriber.h @@ -8,21 +8,24 @@ #include #include -#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "components/viz/host/client_frame_sink_video_capturer.h" -#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" #include "media/capture/mojom/video_capture_buffer.mojom-forward.h" -#include "mojo/public/cpp/bindings/pending_remote.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace gfx { class Image; class Rect; } // namespace gfx +namespace mojo { +template +class PendingRemote; +} // namespace mojo + namespace electron::api { class WebContents; diff --git a/shell/browser/api/gpuinfo_manager.cc b/shell/browser/api/gpuinfo_manager.cc index 2e64908527..4a2f4f30e4 100644 --- a/shell/browser/api/gpuinfo_manager.cc +++ b/shell/browser/api/gpuinfo_manager.cc @@ -11,6 +11,7 @@ #include "gpu/config/gpu_info_collector.h" #include "shell/browser/api/gpu_info_enumerator.h" #include "shell/common/gin_converters/value_converter.h" +#include "shell/common/gin_helper/promise.h" #include "shell/common/thread_restrictions.h" namespace electron { diff --git a/shell/browser/api/gpuinfo_manager.h b/shell/browser/api/gpuinfo_manager.h index 5c6e196e31..3ee3947510 100644 --- a/shell/browser/api/gpuinfo_manager.h +++ b/shell/browser/api/gpuinfo_manager.h @@ -11,7 +11,11 @@ #include "content/browser/gpu/gpu_data_manager_impl.h" // nogncheck #include "content/public/browser/gpu_data_manager.h" #include "content/public/browser/gpu_data_manager_observer.h" -#include "shell/common/gin_helper/promise.h" + +namespace gin_helper { +template +class Promise; +} // namespace gin_helper namespace electron { diff --git a/shell/browser/api/message_port.cc b/shell/browser/api/message_port.cc index a81360b0f1..ef313d4c30 100644 --- a/shell/browser/api/message_port.cc +++ b/shell/browser/api/message_port.cc @@ -62,6 +62,14 @@ gin::Handle MessagePort::Create(v8::Isolate* isolate) { return gin::CreateHandle(isolate, new MessagePort()); } +bool MessagePort::IsEntangled() const { + return !closed_ && !IsNeutered(); +} + +bool MessagePort::IsNeutered() const { + return !connector_ || !connector_->is_valid(); +} + void MessagePort::PostMessage(gin::Arguments* args) { if (!IsEntangled()) return; diff --git a/shell/browser/api/message_port.h b/shell/browser/api/message_port.h index 9239db2aa5..ce4bde2a64 100644 --- a/shell/browser/api/message_port.h +++ b/shell/browser/api/message_port.h @@ -9,7 +9,6 @@ #include #include "gin/wrappable.h" -#include "mojo/public/cpp/bindings/connector.h" #include "mojo/public/cpp/bindings/message.h" #include "shell/common/gin_helper/cleaned_up_at_exit.h" #include "third_party/blink/public/common/messaging/message_port_channel.h" @@ -21,6 +20,10 @@ template class Handle; } // namespace gin +namespace mojo { +class Connector; +} // namespace mojo + namespace electron { // A non-blink version of blink::MessagePort. @@ -40,8 +43,8 @@ class MessagePort : public gin::Wrappable, blink::MessagePortChannel Disentangle(); - bool IsEntangled() const { return !closed_ && !IsNeutered(); } - bool IsNeutered() const { return !connector_ || !connector_->is_valid(); } + [[nodiscard]] bool IsEntangled() const; + [[nodiscard]] bool IsNeutered() const; static std::vector> EntanglePorts( v8::Isolate* isolate, diff --git a/shell/browser/api/save_page_handler.h b/shell/browser/api/save_page_handler.h index 898bdf2d3d..ab8bf8c735 100644 --- a/shell/browser/api/save_page_handler.h +++ b/shell/browser/api/save_page_handler.h @@ -10,7 +10,7 @@ #include "content/public/browser/download_manager.h" #include "content/public/browser/save_page_type.h" #include "shell/common/gin_helper/promise.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace base { class FilePath; diff --git a/shell/browser/api/views/electron_api_image_view.cc b/shell/browser/api/views/electron_api_image_view.cc index 0455252bd8..1d60af2d0b 100644 --- a/shell/browser/api/views/electron_api_image_view.cc +++ b/shell/browser/api/views/electron_api_image_view.cc @@ -9,6 +9,7 @@ #include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/node_includes.h" +#include "ui/gfx/image/image.h" namespace electron::api { diff --git a/shell/browser/api/views/electron_api_image_view.h b/shell/browser/api/views/electron_api_image_view.h index 58c3c2f28e..f614edbd6e 100644 --- a/shell/browser/api/views/electron_api_image_view.h +++ b/shell/browser/api/views/electron_api_image_view.h @@ -7,9 +7,17 @@ #include "gin/handle.h" #include "shell/browser/api/electron_api_view.h" -#include "ui/gfx/image/image.h" #include "ui/views/controls/image_view.h" +namespace gfx { +class Image; +} + +namespace gin_helper { +class Arguments; +class WrappableBase; +} // namespace gin_helper + namespace electron::api { class ImageView : public View { diff --git a/shell/browser/browser.cc b/shell/browser/browser.cc index 928c19cdf4..c1fb07eefa 100644 --- a/shell/browser/browser.cc +++ b/shell/browser/browser.cc @@ -59,6 +59,14 @@ Browser::~Browser() { WindowList::RemoveObserver(this); } +void Browser::AddObserver(BrowserObserver* obs) { + observers_.AddObserver(obs); +} + +void Browser::RemoveObserver(BrowserObserver* obs) { + observers_.RemoveObserver(obs); +} + // static Browser* Browser::Get() { return ElectronBrowserMainParts::Get()->browser(); diff --git a/shell/browser/browser.h b/shell/browser/browser.h index 6d098812cd..d341d42efe 100644 --- a/shell/browser/browser.h +++ b/shell/browser/browser.h @@ -14,13 +14,11 @@ #include "base/observer_list.h" #include "base/task/cancelable_task_tracker.h" #include "base/values.h" -#include "shell/browser/browser_observer.h" #include "shell/browser/window_list_observer.h" #include "shell/common/gin_helper/promise.h" #if BUILDFLAG(IS_WIN) #include -#include "base/files/file_path.h" #include "shell/browser/ui/win/taskbar_host.h" #endif @@ -40,6 +38,7 @@ class Arguments; namespace electron { +class BrowserObserver; class ElectronMenuModel; #if BUILDFLAG(IS_WIN) @@ -314,9 +313,8 @@ class Browser : private WindowListObserver { // instance is destroyed. void SetMainMessageLoopQuitClosure(base::OnceClosure quit_closure); - void AddObserver(BrowserObserver* obs) { observers_.AddObserver(obs); } - - void RemoveObserver(BrowserObserver* obs) { observers_.RemoveObserver(obs); } + void AddObserver(BrowserObserver* obs); + void RemoveObserver(BrowserObserver* obs); #if BUILDFLAG(IS_MAC) // Returns whether secure input is enabled diff --git a/shell/browser/browser_mac.mm b/shell/browser/browser_mac.mm index a388fc6d3a..b1d8662300 100644 --- a/shell/browser/browser_mac.mm +++ b/shell/browser/browser_mac.mm @@ -20,6 +20,7 @@ #include "chrome/browser/browser_process.h" #include "net/base/apple/url_conversions.h" #include "shell/browser/badging/badge_manager.h" +#include "shell/browser/browser_observer.h" #include "shell/browser/javascript_environment.h" #include "shell/browser/mac/dict_util.h" #include "shell/browser/mac/electron_application.h" diff --git a/shell/browser/browser_process_impl.cc b/shell/browser/browser_process_impl.cc index 75163c184c..23569916eb 100644 --- a/shell/browser/browser_process_impl.cc +++ b/shell/browser/browser_process_impl.cc @@ -21,6 +21,7 @@ #include "components/prefs/overlay_user_pref_store.h" #include "components/prefs/pref_registry.h" #include "components/prefs/pref_registry_simple.h" +#include "components/prefs/pref_service.h" #include "components/prefs/pref_service_factory.h" #include "components/proxy_config/pref_proxy_config_tracker_impl.h" #include "components/proxy_config/proxy_config_dictionary.h" diff --git a/shell/browser/browser_process_impl.h b/shell/browser/browser_process_impl.h index 716fbf0bfe..5a67d9f1d6 100644 --- a/shell/browser/browser_process_impl.h +++ b/shell/browser/browser_process_impl.h @@ -15,7 +15,6 @@ #include "chrome/browser/browser_process.h" #include "components/embedder_support/origin_trials/origin_trials_settings_storage.h" -#include "components/prefs/pref_service.h" #include "components/prefs/value_map_pref_store.h" #include "printing/buildflags/buildflags.h" #include "services/network/public/cpp/network_quality_tracker.h" @@ -26,6 +25,8 @@ #include "components/os_crypt/sync/key_storage_util_linux.h" #endif +class PrefService; + namespace printing { class PrintJobManager; } diff --git a/shell/browser/certificate_manager_model.h b/shell/browser/certificate_manager_model.h index d4bdbbf3a2..96e9377390 100644 --- a/shell/browser/certificate_manager_model.h +++ b/shell/browser/certificate_manager_model.h @@ -8,7 +8,7 @@ #include #include -#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "net/cert/nss_cert_database.h" diff --git a/shell/browser/cookie_change_notifier.cc b/shell/browser/cookie_change_notifier.cc index 1d81cdc99d..c3ce8cb584 100644 --- a/shell/browser/cookie_change_notifier.cc +++ b/shell/browser/cookie_change_notifier.cc @@ -7,7 +7,7 @@ #include "base/functional/bind.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" -#include "net/cookies/canonical_cookie.h" +#include "net/cookies/cookie_change_dispatcher.h" #include "shell/browser/electron_browser_context.h" using content::BrowserThread; diff --git a/shell/browser/cookie_change_notifier.h b/shell/browser/cookie_change_notifier.h index d2e4004616..abae009a70 100644 --- a/shell/browser/cookie_change_notifier.h +++ b/shell/browser/cookie_change_notifier.h @@ -8,9 +8,13 @@ #include "base/callback_list.h" #include "base/memory/raw_ptr.h" #include "mojo/public/cpp/bindings/receiver.h" -#include "net/cookies/cookie_change_dispatcher.h" #include "services/network/public/mojom/cookie_manager.mojom.h" +namespace net { +class CoookieChangeInfo; +class CookieChangeNotifier; +} // namespace net + namespace electron { class ElectronBrowserContext; diff --git a/shell/browser/electron_autofill_driver.h b/shell/browser/electron_autofill_driver.h index 8c335373ea..ff9d5173f3 100644 --- a/shell/browser/electron_autofill_driver.h +++ b/shell/browser/electron_autofill_driver.h @@ -14,9 +14,13 @@ #include "base/memory/raw_ptr.h" #include "mojo/public/cpp/bindings/associated_receiver.h" -#include "mojo/public/cpp/bindings/pending_associated_receiver.h" #include "shell/common/api/api.mojom.h" +namespace mojo { +template +class PendingAssociatedReceiver; +} // namespace mojo + namespace electron { class AutofillDriver : public mojom::ElectronAutofillDriver { diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 3d3cae35d6..6312ef03bb 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -16,6 +16,7 @@ #include "base/command_line.h" #include "base/debug/crash_logging.h" #include "base/environment.h" +#include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/no_destructor.h" #include "base/path_service.h" @@ -78,6 +79,7 @@ #include "shell/browser/api/electron_api_web_contents.h" #include "shell/browser/api/electron_api_web_request.h" #include "shell/browser/badging/badge_manager.h" +#include "shell/browser/bluetooth/electron_bluetooth_delegate.h" #include "shell/browser/child_web_contents_tracker.h" #include "shell/browser/electron_api_ipc_handler_impl.h" #include "shell/browser/electron_autofill_driver_factory.h" @@ -87,6 +89,7 @@ #include "shell/browser/electron_speech_recognition_manager_delegate.h" #include "shell/browser/electron_web_contents_utility_handler_impl.h" #include "shell/browser/font_defaults.h" +#include "shell/browser/hid/electron_hid_delegate.h" #include "shell/browser/javascript_environment.h" #include "shell/browser/login_handler.h" #include "shell/browser/media/media_capture_devices_dispatcher.h" @@ -103,6 +106,7 @@ #include "shell/browser/serial/electron_serial_delegate.h" #include "shell/browser/session_preferences.h" #include "shell/browser/ui/devtools_manager_delegate.h" +#include "shell/browser/usb/electron_usb_delegate.h" #include "shell/browser/web_contents_permission_helper.h" #include "shell/browser/web_contents_preferences.h" #include "shell/browser/webauthn/electron_authenticator_request_delegate.h" diff --git a/shell/browser/electron_browser_client.h b/shell/browser/electron_browser_client.h index 4b4b077ba5..9f0c0cdc9e 100644 --- a/shell/browser/electron_browser_client.h +++ b/shell/browser/electron_browser_client.h @@ -13,7 +13,6 @@ #include "base/containers/flat_map.h" #include "base/containers/flat_set.h" -#include "base/files/file_path.h" #include "base/memory/raw_ptr.h" #include "base/synchronization/lock.h" #include "content/public/browser/content_browser_client.h" @@ -22,12 +21,12 @@ #include "electron/buildflags/buildflags.h" #include "net/ssl/client_cert_identity.h" #include "services/metrics/public/cpp/ukm_source_id.h" -#include "shell/browser/bluetooth/electron_bluetooth_delegate.h" -#include "shell/browser/hid/electron_hid_delegate.h" -#include "shell/browser/serial/electron_serial_delegate.h" -#include "shell/browser/usb/electron_usb_delegate.h" #include "third_party/blink/public/mojom/badging/badging.mojom-forward.h" +namespace base { +class FilePath; +} // namespace base + namespace content { class ClientCertificateDelegate; class PlatformNotificationService; @@ -40,10 +39,14 @@ class SSLCertRequestInfo; namespace electron { +class ElectronBluetoothDelegate; class ElectronBrowserMainParts; +class ElectronHidDelegate; +class ElectronSerialDelegate; +class ElectronUsbDelegate; +class ElectronWebAuthenticationDelegate; class NotificationPresenter; class PlatformNotificationService; -class ElectronWebAuthenticationDelegate; class ElectronBrowserClient : public content::ContentBrowserClient, private content::RenderProcessHostObserver { diff --git a/shell/browser/electron_browser_context.cc b/shell/browser/electron_browser_context.cc index 779a76573d..2aa10e917e 100644 --- a/shell/browser/electron_browser_context.cc +++ b/shell/browser/electron_browser_context.cc @@ -18,6 +18,7 @@ #include "base/strings/escape.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" +#include "chrome/browser/predictors/preconnect_manager.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" @@ -36,6 +37,7 @@ #include "content/public/browser/shared_cors_origin_access_list.h" #include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents_media_capture_id.h" +#include "gin/arguments.h" #include "media/audio/audio_device_description.h" #include "services/network/public/cpp/features.h" #include "services/network/public/cpp/url_loader_factory_builder.h" @@ -49,6 +51,7 @@ #include "shell/browser/file_system_access/file_system_access_permission_context_factory.h" #include "shell/browser/net/resolve_proxy_helper.h" #include "shell/browser/protocol_registry.h" +#include "shell/browser/serial/serial_chooser_context.h" #include "shell/browser/special_storage_policy.h" #include "shell/browser/ui/inspectable_web_contents.h" #include "shell/browser/ui/webui/accessibility_ui.h" @@ -59,6 +62,7 @@ #include "shell/common/electron_constants.h" #include "shell/common/electron_paths.h" #include "shell/common/gin_converters/frame_converter.h" +#include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/error_thrower.h" #include "shell/common/options_switches.h" #include "shell/common/thread_restrictions.h" diff --git a/shell/browser/electron_browser_context.h b/shell/browser/electron_browser_context.h index 6bb41d0e74..0a0698a23a 100644 --- a/shell/browser/electron_browser_context.h +++ b/shell/browser/electron_browser_context.h @@ -15,7 +15,6 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" -#include "chrome/browser/predictors/preconnect_manager.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/media_stream_request.h" #include "content/public/browser/resource_context.h" @@ -37,6 +36,10 @@ namespace network { class SharedURLLoaderFactory; } +namespace predictors { +class PreconnectManager; +} // namespace predictors + namespace storage { class SpecialStoragePolicy; } diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc index 218e7f5ee2..1482c6a543 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -67,10 +67,10 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/ui_base_switches.h" #include "ui/color/color_provider_manager.h" +#include "ui/display/screen.h" #include "url/url_util.h" #if defined(USE_AURA) -#include "ui/display/screen.h" #include "ui/views/widget/desktop_aura/desktop_screen.h" #include "ui/wm/core/wm_state.h" #endif diff --git a/shell/browser/electron_browser_main_parts.h b/shell/browser/electron_browser_main_parts.h index 00366dc244..9cd21819e4 100644 --- a/shell/browser/electron_browser_main_parts.h +++ b/shell/browser/electron_browser_main_parts.h @@ -9,14 +9,13 @@ #include #include -#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" #include "base/task/single_thread_task_runner.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_main_parts.h" #include "electron/buildflags/buildflags.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/geolocation_control.mojom.h" -#include "ui/display/screen.h" #include "ui/views/layout/layout_provider.h" class BrowserProcessImpl; @@ -26,6 +25,11 @@ namespace base { class FieldTrialList; } +namespace display { +class Screen; +class ScopedNativeScreen; +} // namespace display + #if defined(USE_AURA) namespace wm { class WMState; diff --git a/shell/browser/electron_crypto_module_delegate_nss.cc b/shell/browser/electron_crypto_module_delegate_nss.cc index 2b28529494..48fd9f1fc7 100644 --- a/shell/browser/electron_crypto_module_delegate_nss.cc +++ b/shell/browser/electron_crypto_module_delegate_nss.cc @@ -9,6 +9,7 @@ #include "shell/browser/javascript_environment.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_helper/callback.h" +#include "shell/common/gin_helper/dictionary.h" #include "shell/common/v8_value_serializer.h" ElectronNSSCryptoModuleDelegate::ElectronNSSCryptoModuleDelegate( diff --git a/shell/browser/electron_download_manager_delegate.cc b/shell/browser/electron_download_manager_delegate.cc index 9d65d0fe40..233d95a48e 100644 --- a/shell/browser/electron_download_manager_delegate.cc +++ b/shell/browser/electron_download_manager_delegate.cc @@ -29,6 +29,8 @@ #include "shell/browser/web_contents_preferences.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/file_path_converter.h" +#include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/promise.h" #include "shell/common/options_switches.h" #include "shell/common/thread_restrictions.h" diff --git a/shell/browser/electron_download_manager_delegate.h b/shell/browser/electron_download_manager_delegate.h index f3d7008769..27f2b478e0 100644 --- a/shell/browser/electron_download_manager_delegate.h +++ b/shell/browser/electron_download_manager_delegate.h @@ -9,12 +9,15 @@ #include "base/memory/weak_ptr.h" #include "content/public/browser/download_manager_delegate.h" #include "shell/browser/ui/file_dialog.h" -#include "shell/common/gin_helper/dictionary.h" namespace content { class DownloadManager; } +namespace gin_helper { +class Dictionary; +} + namespace electron { class ElectronDownloadManagerDelegate diff --git a/shell/browser/electron_permission_manager.cc b/shell/browser/electron_permission_manager.cc index 31089aa50e..a143a3f76b 100644 --- a/shell/browser/electron_permission_manager.cc +++ b/shell/browser/electron_permission_manager.cc @@ -27,6 +27,7 @@ #include "shell/common/gin_converters/frame_converter.h" #include "shell/common/gin_converters/usb_protected_classes_converter.h" #include "shell/common/gin_converters/value_converter.h" +#include "shell/common/gin_helper/dictionary.h" #include "shell/common/gin_helper/event_emitter_caller.h" #include "third_party/blink/public/common/permissions/permission_utils.h" diff --git a/shell/browser/electron_permission_manager.h b/shell/browser/electron_permission_manager.h index af8e85b686..4d8262a86c 100644 --- a/shell/browser/electron_permission_manager.h +++ b/shell/browser/electron_permission_manager.h @@ -9,15 +9,24 @@ #include #include "base/containers/id_map.h" -#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" #include "base/values.h" #include "content/public/browser/permission_controller_delegate.h" -#include "shell/common/gin_helper/dictionary.h" namespace content { class WebContents; } +namespace gin_helper { +class Dictionary; +} // namespace gin_helper + +namespace v8 { +class Object; +template +class Local; +} // namespace v8 + namespace electron { class ElectronBrowserContext; diff --git a/shell/browser/extended_web_contents_observer.h b/shell/browser/extended_web_contents_observer.h index 7868244cb8..9152559dd3 100644 --- a/shell/browser/extended_web_contents_observer.h +++ b/shell/browser/extended_web_contents_observer.h @@ -7,6 +7,7 @@ #include +#include "base/observer_list_types.h" #include "electron/shell/common/api/api.mojom.h" namespace gfx { diff --git a/shell/browser/extensions/electron_extensions_api_client.cc b/shell/browser/extensions/electron_extensions_api_client.cc index 1831a1e2c9..1b24519e42 100644 --- a/shell/browser/extensions/electron_extensions_api_client.cc +++ b/shell/browser/extensions/electron_extensions_api_client.cc @@ -24,7 +24,6 @@ #if BUILDFLAG(ENABLE_PDF_VIEWER) #include "components/pdf/browser/pdf_document_helper.h" // nogncheck -#include "shell/browser/electron_pdf_document_helper_client.h" #endif namespace extensions { diff --git a/shell/browser/extensions/electron_extensions_browser_client.h b/shell/browser/extensions/electron_extensions_browser_client.h index 1e0fd04f78..5a9b559dc0 100644 --- a/shell/browser/extensions/electron_extensions_browser_client.h +++ b/shell/browser/extensions/electron_extensions_browser_client.h @@ -11,7 +11,6 @@ #include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/kiosk/kiosk_delegate.h" -#include "mojo/public/cpp/bindings/pending_remote.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/mojom/fetch_api.mojom.h" #include "url/origin.h" @@ -27,6 +26,13 @@ class ProcessMap; class ElectronComponentExtensionResourceManager; } // namespace extensions +namespace mojo { +template +class PendingReceiver; +template +class PendingRemote; +} // namespace mojo + namespace electron { // An ExtensionsBrowserClient that supports a single content::BrowserContext diff --git a/shell/browser/file_system_access/file_system_access_permission_context.h b/shell/browser/file_system_access/file_system_access_permission_context.h index 4011fceedd..d3c21b00af 100644 --- a/shell/browser/file_system_access/file_system_access_permission_context.h +++ b/shell/browser/file_system_access/file_system_access_permission_context.h @@ -11,7 +11,7 @@ #include #include -#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" #include "base/memory/weak_ptr.h" #include "base/time/clock.h" #include "base/time/default_clock.h" diff --git a/shell/browser/hid/hid_chooser_context.h b/shell/browser/hid/hid_chooser_context.h index 85804c52f5..a9852961b4 100644 --- a/shell/browser/hid/hid_chooser_context.h +++ b/shell/browser/hid/hid_chooser_context.h @@ -14,11 +14,10 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" +#include "base/observer_list_types.h" #include "base/scoped_observation_traits.h" -#include "base/unguessable_token.h" #include "components/keyed_service/core/keyed_service.h" #include "mojo/public/cpp/bindings/associated_receiver.h" -#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/hid.mojom.h" #include "url/origin.h" @@ -27,6 +26,11 @@ namespace base { class Value; } +namespace mojo { +template +class PendingRemote; +} // namespace mojo + namespace electron { class ElectronBrowserContext; diff --git a/shell/browser/hid/hid_chooser_controller.cc b/shell/browser/hid/hid_chooser_controller.cc index e547720e57..deb858c114 100644 --- a/shell/browser/hid/hid_chooser_controller.cc +++ b/shell/browser/hid/hid_chooser_controller.cc @@ -10,10 +10,12 @@ #include "base/containers/contains.h" #include "base/functional/bind.h" #include "base/ranges/algorithm.h" +#include "content/public/browser/web_contents.h" #include "gin/data_object_builder.h" #include "services/device/public/cpp/hid/hid_blocklist.h" #include "services/device/public/cpp/hid/hid_switches.h" #include "shell/browser/api/electron_api_session.h" +#include "shell/browser/hid/electron_hid_delegate.h" #include "shell/browser/hid/hid_chooser_context.h" #include "shell/browser/hid/hid_chooser_context_factory.h" #include "shell/browser/javascript_environment.h" diff --git a/shell/browser/hid/hid_chooser_controller.h b/shell/browser/hid/hid_chooser_controller.h index fc5944979d..07a1f099b4 100644 --- a/shell/browser/hid/hid_chooser_controller.h +++ b/shell/browser/hid/hid_chooser_controller.h @@ -14,10 +14,8 @@ #include "content/public/browser/global_routing_id.h" #include "content/public/browser/hid_chooser.h" #include "content/public/browser/weak_document_ptr.h" -#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" #include "services/device/public/mojom/hid.mojom-forward.h" -#include "shell/browser/hid/electron_hid_delegate.h" #include "shell/browser/hid/hid_chooser_context.h" #include "shell/common/gin_converters/frame_converter.h" #include "third_party/blink/public/mojom/devtools/console_message.mojom.h" @@ -25,6 +23,7 @@ namespace content { class RenderFrameHost; +class WebContents; } // namespace content namespace gin { diff --git a/shell/browser/lib/power_observer_linux.h b/shell/browser/lib/power_observer_linux.h index 1c9c743efd..20da2a0cc5 100644 --- a/shell/browser/lib/power_observer_linux.h +++ b/shell/browser/lib/power_observer_linux.h @@ -7,7 +7,7 @@ #include -#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "base/power_monitor/power_observer.h" diff --git a/shell/browser/native_window_mac.mm b/shell/browser/native_window_mac.mm index 843f66c1ec..934623985b 100644 --- a/shell/browser/native_window_mac.mm +++ b/shell/browser/native_window_mac.mm @@ -33,7 +33,6 @@ #include "shell/browser/ui/cocoa/root_view_mac.h" #include "shell/browser/ui/cocoa/window_buttons_proxy.h" #include "shell/browser/ui/drag_util.h" -#include "shell/browser/ui/inspectable_web_contents.h" #include "shell/browser/window_list.h" #include "shell/common/gin_converters/gfx_converter.h" #include "shell/common/gin_helper/dictionary.h" diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index ae3ce05b71..6190f8d320 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -26,8 +26,6 @@ #include "content/public/browser/desktop_media_id.h" #include "content/public/common/color_parser.h" #include "shell/browser/api/electron_api_web_contents.h" -#include "shell/browser/ui/inspectable_web_contents.h" -#include "shell/browser/ui/views/inspectable_web_contents_view_views.h" #include "shell/browser/ui/views/root_view.h" #include "shell/browser/web_contents_preferences.h" #include "shell/browser/web_view_manager.h" diff --git a/shell/browser/net/asar/asar_url_loader.h b/shell/browser/net/asar/asar_url_loader.h index 4cd61df37b..3a2b3a6eba 100644 --- a/shell/browser/net/asar/asar_url_loader.h +++ b/shell/browser/net/asar/asar_url_loader.h @@ -5,10 +5,16 @@ #ifndef ELECTRON_SHELL_BROWSER_NET_ASAR_ASAR_URL_LOADER_H_ #define ELECTRON_SHELL_BROWSER_NET_ASAR_ASAR_URL_LOADER_H_ -#include "mojo/public/cpp/bindings/pending_remote.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/mojom/url_loader.mojom.h" +namespace mojo { +template +class PendingReceiver; +template +class PendingRemote; +} // namespace mojo + namespace asar { void CreateAsarURLLoader( diff --git a/shell/browser/net/asar/asar_url_loader_factory.h b/shell/browser/net/asar/asar_url_loader_factory.h index 9a7126b8ba..d23aec3b49 100644 --- a/shell/browser/net/asar/asar_url_loader_factory.h +++ b/shell/browser/net/asar/asar_url_loader_factory.h @@ -5,10 +5,15 @@ #ifndef ELECTRON_SHELL_BROWSER_NET_ASAR_ASAR_URL_LOADER_FACTORY_H_ #define ELECTRON_SHELL_BROWSER_NET_ASAR_ASAR_URL_LOADER_FACTORY_H_ -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/pending_remote.h" #include "services/network/public/cpp/self_deleting_url_loader_factory.h" +namespace mojo { +template +class PendingReciever; +template +class PendingRemote; +} // namespace mojo + namespace electron { // Provide support for accessing asar archives in file:// protocol. diff --git a/shell/browser/net/electron_url_loader_factory.h b/shell/browser/net/electron_url_loader_factory.h index 5e05bde03d..abd488cbcf 100644 --- a/shell/browser/net/electron_url_loader_factory.h +++ b/shell/browser/net/electron_url_loader_factory.h @@ -11,9 +11,8 @@ #include #include -#include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" -#include "mojo/public/cpp/bindings/receiver_set.h" +#include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "net/url_request/url_request_job_factory.h" #include "services/network/public/cpp/resource_request.h" @@ -31,6 +30,11 @@ namespace gin_helper { class Dictionary; } // namespace gin_helper +namespace mojo { +template +class PendingReceiver; +} // namespace mojo + namespace electron { // Old Protocol API can only serve one type of response for one scheme. diff --git a/shell/browser/net/network_context_service.h b/shell/browser/net/network_context_service.h index e212c97dc6..b9542360dc 100644 --- a/shell/browser/net/network_context_service.h +++ b/shell/browser/net/network_context_service.h @@ -8,7 +8,6 @@ #include "base/memory/raw_ptr.h" #include "chrome/browser/net/proxy_config_monitor.h" #include "components/keyed_service/core/keyed_service.h" -#include "mojo/public/cpp/bindings/remote.h" #include "services/cert_verifier/public/mojom/cert_verifier_service_factory.mojom.h" #include "services/network/public/mojom/network_context.mojom.h" diff --git a/shell/browser/net/node_stream_loader.h b/shell/browser/net/node_stream_loader.h index a1e5a71365..a684aad39c 100644 --- a/shell/browser/net/node_stream_loader.h +++ b/shell/browser/net/node_stream_loader.h @@ -11,13 +11,21 @@ #include #include "base/memory/raw_ptr.h" -#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" -#include "mojo/public/cpp/system/data_pipe_producer.h" #include "services/network/public/mojom/url_loader.mojom.h" #include "services/network/public/mojom/url_response_head.mojom.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" +#include "v8/include/v8-object.h" +#include "v8/include/v8-persistent-handle.h" + +namespace mojo { +class DataPipeProducer; +template +class PendingReceiver; +template +class PendingRemote; +} // namespace mojo namespace electron { diff --git a/shell/browser/net/proxying_url_loader_factory.h b/shell/browser/net/proxying_url_loader_factory.h index 3ffd1d416a..754ff5be55 100644 --- a/shell/browser/net/proxying_url_loader_factory.h +++ b/shell/browser/net/proxying_url_loader_factory.h @@ -18,8 +18,6 @@ #include "base/memory/weak_ptr.h" #include "content/public/browser/content_browser_client.h" #include "extensions/browser/api/web_request/web_request_info.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "mojo/public/cpp/bindings/remote.h" @@ -35,6 +33,13 @@ #include "shell/browser/net/web_request_api_interface.h" #include "url/gurl.h" +namespace mojo { +template +class PendingReciever; +template +class PendingRemote; +} // namespace mojo + namespace electron { const uint32_t kBypassCustomProtocolHandlers = 1 << 30; diff --git a/shell/browser/net/resolve_host_function.cc b/shell/browser/net/resolve_host_function.cc index fe17752d75..c9db7c5c93 100644 --- a/shell/browser/net/resolve_host_function.cc +++ b/shell/browser/net/resolve_host_function.cc @@ -10,9 +10,11 @@ #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/storage_partition.h" +#include "net/base/address_list.h" #include "net/base/host_port_pair.h" #include "net/base/net_errors.h" #include "net/base/network_isolation_key.h" +#include "net/dns/public/host_resolver_results.h" #include "net/dns/public/resolve_error_info.h" #include "services/network/public/mojom/network_context.mojom.h" #include "shell/browser/electron_browser_context.h" diff --git a/shell/browser/net/resolve_host_function.h b/shell/browser/net/resolve_host_function.h index 0260faaa22..37b5e5f806 100644 --- a/shell/browser/net/resolve_host_function.h +++ b/shell/browser/net/resolve_host_function.h @@ -12,12 +12,15 @@ #include "base/memory/ref_counted.h" #include "base/sequence_checker.h" #include "mojo/public/cpp/bindings/receiver.h" -#include "net/base/address_list.h" -#include "net/dns/public/host_resolver_results.h" #include "services/network/public/cpp/resolve_host_client_base.h" #include "services/network/public/mojom/host_resolver.mojom.h" #include "services/network/public/mojom/network_context.mojom.h" +namespace net { +class AddressList; +struct ResolveErrorInfo; +} // namespace net + namespace electron { class ElectronBrowserContext; diff --git a/shell/browser/net/url_pipe_loader.h b/shell/browser/net/url_pipe_loader.h index cf1577e4b2..9638a52d34 100644 --- a/shell/browser/net/url_pipe_loader.h +++ b/shell/browser/net/url_pipe_loader.h @@ -13,12 +13,15 @@ #include "base/values.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" -#include "mojo/public/cpp/system/data_pipe_producer.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/cpp/simple_url_loader_stream_consumer.h" #include "services/network/public/mojom/url_loader.mojom.h" +namespace mojo { +class DataPipeProducer; +} + namespace network { class SharedURLLoaderFactory; } diff --git a/shell/browser/net/web_request_api_interface.h b/shell/browser/net/web_request_api_interface.h index d4bfb280c2..5541761d73 100644 --- a/shell/browser/net/web_request_api_interface.h +++ b/shell/browser/net/web_request_api_interface.h @@ -8,10 +8,13 @@ #include #include -#include "extensions/browser/api/web_request/web_request_info.h" #include "net/base/completion_once_callback.h" #include "services/network/public/cpp/resource_request.h" +namespace extensions { +struct WebRequestInfo; +} // namespace extensions + namespace electron { // Defines the interface for WebRequest API, implemented by api::WebRequestNS. diff --git a/shell/browser/osr/osr_host_display_client.h b/shell/browser/osr/osr_host_display_client.h index a47aaf67f3..b0456ddb69 100644 --- a/shell/browser/osr/osr_host_display_client.h +++ b/shell/browser/osr/osr_host_display_client.h @@ -7,11 +7,10 @@ #include -#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" #include "base/memory/shared_memory_mapping.h" #include "components/viz/host/host_display_client.h" #include "services/viz/privileged/mojom/compositing/layered_window_updater.mojom.h" -#include "ui/gfx/native_widget_types.h" class SkBitmap; class SkCanvas; diff --git a/shell/browser/osr/osr_render_widget_host_view.h b/shell/browser/osr/osr_render_widget_host_view.h index 3b6971c8b1..2c3d74e738 100644 --- a/shell/browser/osr/osr_render_widget_host_view.h +++ b/shell/browser/osr/osr_render_widget_host_view.h @@ -16,9 +16,8 @@ #include #endif +#include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" -#include "base/process/kill.h" -#include "base/threading/thread.h" #include "components/viz/common/quads/compositor_frame.h" #include "components/viz/common/surfaces/parent_local_surface_id_allocator.h" #include "content/browser/renderer_host/delegated_frame_host.h" // nogncheck diff --git a/shell/browser/osr/osr_video_consumer.h b/shell/browser/osr/osr_video_consumer.h index 71bd4f60cd..4a9b65b385 100644 --- a/shell/browser/osr/osr_video_consumer.h +++ b/shell/browser/osr/osr_video_consumer.h @@ -8,7 +8,7 @@ #include #include -#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" #include "components/viz/host/client_frame_sink_video_capturer.h" diff --git a/shell/browser/osr/osr_web_contents_view.cc b/shell/browser/osr/osr_web_contents_view.cc index 3b67d52057..84acbc3cc9 100644 --- a/shell/browser/osr/osr_web_contents_view.cc +++ b/shell/browser/osr/osr_web_contents_view.cc @@ -6,6 +6,8 @@ #include "content/browser/web_contents/web_contents_impl.h" // nogncheck #include "content/public/browser/render_view_host.h" +#include "content/public/browser/web_contents.h" +#include "shell/browser/native_window.h" #include "ui/display/screen.h" #include "ui/display/screen_info.h" diff --git a/shell/browser/osr/osr_web_contents_view.h b/shell/browser/osr/osr_web_contents_view.h index 85c68892b8..6b54004c12 100644 --- a/shell/browser/osr/osr_web_contents_view.h +++ b/shell/browser/osr/osr_web_contents_view.h @@ -5,14 +5,12 @@ #ifndef ELECTRON_SHELL_BROWSER_OSR_OSR_WEB_CONTENTS_VIEW_H_ #define ELECTRON_SHELL_BROWSER_OSR_OSR_WEB_CONTENTS_VIEW_H_ -#include "shell/browser/native_window.h" #include "shell/browser/native_window_observer.h" #include "base/memory/raw_ptr.h" #include "base/memory/raw_ptr_exclusion.h" #include "content/browser/renderer_host/render_view_host_delegate_view.h" // nogncheck #include "content/browser/web_contents/web_contents_view.h" // nogncheck -#include "content/public/browser/web_contents.h" #include "shell/browser/osr/osr_render_widget_host_view.h" #include "third_party/blink/public/common/page/drag_mojom_traits.h" @@ -24,8 +22,14 @@ class OffScreenView; #endif #endif +namespace content { +class WebContents; +} + namespace electron { +class NativeWindow; + class OffScreenWebContentsView : public content::WebContentsView, public content::RenderViewHostDelegateView, private NativeWindowObserver { diff --git a/shell/browser/serial/serial_chooser_context.h b/shell/browser/serial/serial_chooser_context.h index f04f9a54ea..59eb98f4ee 100644 --- a/shell/browser/serial/serial_chooser_context.h +++ b/shell/browser/serial/serial_chooser_context.h @@ -15,7 +15,6 @@ #include "base/unguessable_token.h" #include "components/keyed_service/core/keyed_service.h" #include "content/public/browser/serial_delegate.h" -#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/receiver.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/serial.mojom-forward.h" @@ -27,6 +26,11 @@ namespace base { class Value; } +namespace mojo { +template +class PendingRemote; +} // namespace mojo + namespace electron { class ElectronBrowserContext; diff --git a/shell/browser/serial/serial_chooser_controller.cc b/shell/browser/serial/serial_chooser_controller.cc index e95be73918..ed55de5d77 100644 --- a/shell/browser/serial/serial_chooser_controller.cc +++ b/shell/browser/serial/serial_chooser_controller.cc @@ -10,15 +10,18 @@ #include "base/files/file_path.h" #include "base/functional/bind.h" #include "base/strings/stringprintf.h" +#include "content/public/browser/web_contents.h" #include "device/bluetooth/public/cpp/bluetooth_uuid.h" #include "services/device/public/cpp/bluetooth/bluetooth_utils.h" #include "services/device/public/mojom/serial.mojom.h" #include "shell/browser/api/electron_api_session.h" +#include "shell/browser/serial/electron_serial_delegate.h" #include "shell/browser/serial/serial_chooser_context.h" #include "shell/browser/serial/serial_chooser_context_factory.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/content_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/promise.h" #include "ui/base/l10n/l10n_util.h" namespace gin { diff --git a/shell/browser/serial/serial_chooser_controller.h b/shell/browser/serial/serial_chooser_controller.h index 3ea152b8dc..2726422174 100644 --- a/shell/browser/serial/serial_chooser_controller.h +++ b/shell/browser/serial/serial_chooser_controller.h @@ -9,18 +9,18 @@ #include #include "base/memory/weak_ptr.h" +#include "base/scoped_observation.h" #include "content/public/browser/global_routing_id.h" #include "content/public/browser/serial_chooser.h" -#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" #include "services/device/public/mojom/serial.mojom-forward.h" -#include "shell/browser/serial/electron_serial_delegate.h" #include "shell/browser/serial/serial_chooser_context.h" #include "third_party/blink/public/mojom/serial/serial.mojom.h" namespace content { class RenderFrameHost; -} +class WebContents; +} // namespace content namespace electron { diff --git a/shell/browser/ui/autofill_popup.cc b/shell/browser/ui/autofill_popup.cc index 341258ec0e..f9d43dc2c9 100644 --- a/shell/browser/ui/autofill_popup.cc +++ b/shell/browser/ui/autofill_popup.cc @@ -9,6 +9,7 @@ #include "base/feature_list.h" #include "base/i18n/rtl.h" #include "components/autofill/core/common/autofill_features.h" +#include "content/public/browser/render_frame_host.h" #include "electron/buildflags/buildflags.h" #include "mojo/public/cpp/bindings/associated_remote.h" #include "shell/browser/osr/osr_render_widget_host_view.h" diff --git a/shell/browser/ui/autofill_popup.h b/shell/browser/ui/autofill_popup.h index 52ea7cff0e..00c1c900ee 100644 --- a/shell/browser/ui/autofill_popup.h +++ b/shell/browser/ui/autofill_popup.h @@ -8,13 +8,19 @@ #include #include "base/memory/raw_ptr.h" -#include "content/public/browser/render_frame_host.h" #include "shell/browser/ui/views/autofill_popup_view.h" -#include "ui/color/color_id.h" #include "ui/gfx/font_list.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" +namespace content { +class RenderFrameHost; +} // namespace content + +namespace ui { +using ColorId = int; +} // namespace ui + namespace electron { class AutofillPopupView; diff --git a/shell/browser/ui/certificate_trust.h b/shell/browser/ui/certificate_trust.h index 382d02cebc..1db03db64d 100644 --- a/shell/browser/ui/certificate_trust.h +++ b/shell/browser/ui/certificate_trust.h @@ -8,12 +8,17 @@ #include #include "net/cert/x509_certificate.h" -#include "shell/common/gin_helper/promise.h" namespace electron { class NativeWindow; } +namespace v8 { +class Promise; +template +class Local; +} // namespace v8 + namespace certificate_trust { v8::Local ShowCertificateTrust( diff --git a/shell/browser/ui/certificate_trust_mac.mm b/shell/browser/ui/certificate_trust_mac.mm index 9250040503..22af2bdbef 100644 --- a/shell/browser/ui/certificate_trust_mac.mm +++ b/shell/browser/ui/certificate_trust_mac.mm @@ -16,6 +16,7 @@ #include "net/cert/x509_util_apple.h" #include "shell/browser/javascript_environment.h" #include "shell/browser/native_window.h" +#include "shell/common/gin_helper/promise.h" @interface TrustDelegate : NSObject { @private diff --git a/shell/browser/ui/certificate_trust_win.cc b/shell/browser/ui/certificate_trust_win.cc index 4536fbcf8f..b8a2709eb5 100644 --- a/shell/browser/ui/certificate_trust_win.cc +++ b/shell/browser/ui/certificate_trust_win.cc @@ -11,6 +11,7 @@ #include "net/cert/cert_database.h" #include "net/cert/x509_util_win.h" #include "shell/browser/javascript_environment.h" +#include "shell/common/gin_helper/promise.h" namespace certificate_trust { diff --git a/shell/browser/ui/cocoa/electron_bundle_mover.h b/shell/browser/ui/cocoa/electron_bundle_mover.h index fd0050179a..5c94495260 100644 --- a/shell/browser/ui/cocoa/electron_bundle_mover.h +++ b/shell/browser/ui/cocoa/electron_bundle_mover.h @@ -6,12 +6,15 @@ #define ELECTRON_SHELL_BROWSER_UI_COCOA_ELECTRON_BUNDLE_MOVER_H_ #include "base/apple/foundation_util.h" -#include "shell/common/gin_helper/error_thrower.h" namespace gin { class Arguments; } +namespace gin_helper { +class ErrorThrower; +} // namespace gin_helper + namespace electron { // Possible bundle movement conflicts diff --git a/shell/browser/ui/cocoa/electron_bundle_mover.mm b/shell/browser/ui/cocoa/electron_bundle_mover.mm index b1a9e17d5a..e299d9199a 100644 --- a/shell/browser/ui/cocoa/electron_bundle_mover.mm +++ b/shell/browser/ui/cocoa/electron_bundle_mover.mm @@ -16,6 +16,7 @@ #include "gin/dictionary.h" #include "shell/browser/browser.h" #include "shell/common/gin_converters/callback_converter.h" +#include "shell/common/gin_helper/error_thrower.h" namespace gin { diff --git a/shell/browser/ui/cocoa/electron_touch_bar.h b/shell/browser/ui/cocoa/electron_touch_bar.h index 2fae6144d0..f079d8e5c6 100644 --- a/shell/browser/ui/cocoa/electron_touch_bar.h +++ b/shell/browser/ui/cocoa/electron_touch_bar.h @@ -12,9 +12,12 @@ #include #include "base/memory/raw_ptr.h" -#include "shell/browser/native_window.h" #include "shell/common/gin_helper/persistent_dictionary.h" +namespace electron { +class NativeWindow; +} // namespace electron + @interface ElectronTouchBar : NSObject { diff --git a/shell/browser/ui/cocoa/electron_touch_bar.mm b/shell/browser/ui/cocoa/electron_touch_bar.mm index 494fc326e9..48913d74bd 100644 --- a/shell/browser/ui/cocoa/electron_touch_bar.mm +++ b/shell/browser/ui/cocoa/electron_touch_bar.mm @@ -10,8 +10,11 @@ #include "base/strings/sys_string_conversions.h" #include "shell/browser/javascript_environment.h" +#include "shell/browser/native_window.h" #include "shell/common/color_util.h" #include "shell/common/gin_converters/image_converter.h" +#include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/persistent_dictionary.h" #include "skia/ext/skia_utils_mac.h" #include "ui/gfx/image/image.h" diff --git a/shell/browser/ui/file_dialog.h b/shell/browser/ui/file_dialog.h index c410bbf4fb..5a6c4cadbb 100644 --- a/shell/browser/ui/file_dialog.h +++ b/shell/browser/ui/file_dialog.h @@ -11,13 +11,17 @@ #include "base/files/file_path.h" #include "base/memory/raw_ptr_exclusion.h" -#include "shell/common/gin_helper/dictionary.h" -#include "shell/common/gin_helper/promise.h" namespace electron { class NativeWindow; } +namespace gin_helper { +class Dictionary; +template +class Promise; +} // namespace gin_helper + namespace file_dialog { // diff --git a/shell/browser/ui/file_dialog_linux.cc b/shell/browser/ui/file_dialog_linux.cc index 7910367f4a..0b5a467d48 100644 --- a/shell/browser/ui/file_dialog_linux.cc +++ b/shell/browser/ui/file_dialog_linux.cc @@ -14,6 +14,8 @@ #include "shell/browser/ui/file_dialog.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/file_path_converter.h" +#include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/promise.h" #include "ui/gtk/select_file_dialog_linux_gtk.h" // nogncheck #include "ui/shell_dialogs/select_file_dialog.h" #include "ui/shell_dialogs/selected_file_info.h" diff --git a/shell/browser/ui/file_dialog_mac.mm b/shell/browser/ui/file_dialog_mac.mm index e769a11be0..51a6e64e38 100644 --- a/shell/browser/ui/file_dialog_mac.mm +++ b/shell/browser/ui/file_dialog_mac.mm @@ -21,6 +21,8 @@ #include "content/public/browser/browser_thread.h" #include "shell/browser/native_window.h" #include "shell/common/gin_converters/file_path_converter.h" +#include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/promise.h" #include "shell/common/thread_restrictions.h" @interface PopUpButtonHandler : NSObject diff --git a/shell/browser/ui/file_dialog_win.cc b/shell/browser/ui/file_dialog_win.cc index 2f535a67ef..cfc8c6068c 100644 --- a/shell/browser/ui/file_dialog_win.cc +++ b/shell/browser/ui/file_dialog_win.cc @@ -22,6 +22,8 @@ #include "shell/browser/native_window_views.h" #include "shell/browser/ui/win/dialog_thread.h" #include "shell/common/gin_converters/file_path_converter.h" +#include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/promise.h" namespace file_dialog { diff --git a/shell/browser/ui/gtk/menu_util.h b/shell/browser/ui/gtk/menu_util.h index 155cb8415f..1958d9aaf2 100644 --- a/shell/browser/ui/gtk/menu_util.h +++ b/shell/browser/ui/gtk/menu_util.h @@ -9,7 +9,7 @@ #include -#include "base/functional/callback.h" +#include "base/functional/callback_forward.h" #include "ui/base/glib/scoped_gsignal.h" namespace gfx { diff --git a/shell/browser/ui/inspectable_web_contents_view.h b/shell/browser/ui/inspectable_web_contents_view.h index f7bb542743..3155829377 100644 --- a/shell/browser/ui/inspectable_web_contents_view.h +++ b/shell/browser/ui/inspectable_web_contents_view.h @@ -10,11 +10,19 @@ #include "base/memory/raw_ptr.h" #include "electron/shell/common/api/api.mojom.h" -#include "ui/gfx/geometry/rounded_corners_f.h" + +#if defined(TOOLKIT_VIEWS) && !BUILDFLAG(IS_MAC) +#include "ui/views/view.h" +#else #include "ui/gfx/native_widget_types.h" +#endif class DevToolsContentsResizingStrategy; +namespace gfx { +class RoundedCornersF; +} // namespace gfx + #if defined(TOOLKIT_VIEWS) namespace views { class View; diff --git a/shell/browser/ui/inspectable_web_contents_view_mac.mm b/shell/browser/ui/inspectable_web_contents_view_mac.mm index 091dc01731..a3789e09a8 100644 --- a/shell/browser/ui/inspectable_web_contents_view_mac.mm +++ b/shell/browser/ui/inspectable_web_contents_view_mac.mm @@ -9,6 +9,7 @@ #import "shell/browser/ui/cocoa/electron_inspectable_web_contents_view.h" #include "shell/browser/ui/inspectable_web_contents.h" #include "shell/browser/ui/inspectable_web_contents_view_delegate.h" +#include "ui/gfx/geometry/rounded_corners_f.h" namespace electron { diff --git a/shell/browser/ui/views/autofill_popup_view.cc b/shell/browser/ui/views/autofill_popup_view.cc index 5919fe1e43..68e1d6dfa3 100644 --- a/shell/browser/ui/views/autofill_popup_view.cc +++ b/shell/browser/ui/views/autofill_popup_view.cc @@ -10,6 +10,7 @@ #include "base/functional/bind.h" #include "base/i18n/rtl.h" #include "cc/paint/skia_paint_canvas.h" +#include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_view_host.h" #include "ui/accessibility/ax_enums.mojom.h" #include "ui/base/dragdrop/drag_drop_types.h" diff --git a/shell/browser/ui/views/autofill_popup_view.h b/shell/browser/ui/views/autofill_popup_view.h index dfbe956cc1..de66c3b350 100644 --- a/shell/browser/ui/views/autofill_popup_view.h +++ b/shell/browser/ui/views/autofill_popup_view.h @@ -11,7 +11,6 @@ #include "shell/browser/ui/autofill_popup.h" #include "base/memory/raw_ptr.h" -#include "components/input/native_web_keyboard_event.h" #include "content/public/browser/render_widget_host.h" #include "electron/buildflags/buildflags.h" #include "shell/browser/osr/osr_view_proxy.h" @@ -22,6 +21,10 @@ #include "ui/views/widget/widget_delegate.h" #include "ui/views/widget/widget_observer.h" +namespace input { +struct NativeWebKeyboardEvent; +} // namespace input + namespace ui { struct AXNodeData; } diff --git a/shell/browser/ui/views/inspectable_web_contents_view_views.cc b/shell/browser/ui/views/inspectable_web_contents_view_views.cc index 8180401283..d8ca35f17b 100644 --- a/shell/browser/ui/views/inspectable_web_contents_view_views.cc +++ b/shell/browser/ui/views/inspectable_web_contents_view_views.cc @@ -14,6 +14,7 @@ #include "shell/browser/ui/inspectable_web_contents_delegate.h" #include "shell/browser/ui/inspectable_web_contents_view_delegate.h" #include "ui/base/models/image_model.h" +#include "ui/gfx/geometry/rounded_corners_f.h" #include "ui/views/controls/label.h" #include "ui/views/controls/webview/webview.h" #include "ui/views/widget/widget.h" diff --git a/shell/browser/usb/electron_usb_delegate.cc b/shell/browser/usb/electron_usb_delegate.cc index 22444f2b10..808b878393 100644 --- a/shell/browser/usb/electron_usb_delegate.cc +++ b/shell/browser/usb/electron_usb_delegate.cc @@ -9,7 +9,6 @@ #include "base/containers/contains.h" #include "base/observer_list.h" -#include "base/observer_list_types.h" #include "base/scoped_observation.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/web_contents.h" diff --git a/shell/browser/usb/electron_usb_delegate.h b/shell/browser/usb/electron_usb_delegate.h index 89afd16da3..556fa42554 100644 --- a/shell/browser/usb/electron_usb_delegate.h +++ b/shell/browser/usb/electron_usb_delegate.h @@ -14,8 +14,6 @@ #include "base/memory/weak_ptr.h" #include "content/public/browser/usb_chooser.h" #include "content/public/browser/usb_delegate.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/pending_remote.h" #include "services/device/public/mojom/usb_device.mojom-forward.h" #include "services/device/public/mojom/usb_enumeration_options.mojom-forward.h" #include "services/device/public/mojom/usb_manager.mojom-forward.h" @@ -27,6 +25,13 @@ class BrowserContext; class RenderFrameHost; } // namespace content +namespace mojo { +template +class PendingReciever; +template +class PendingRemote; +} // namespace mojo + namespace electron { class UsbChooserController; diff --git a/shell/browser/usb/usb_chooser_context.cc b/shell/browser/usb/usb_chooser_context.cc index 30b187ca69..fa5219e892 100644 --- a/shell/browser/usb/usb_chooser_context.cc +++ b/shell/browser/usb/usb_chooser_context.cc @@ -22,6 +22,7 @@ #include "shell/browser/web_contents_permission_helper.h" #include "shell/common/electron_constants.h" #include "shell/common/gin_converters/usb_device_info_converter.h" +#include "shell/common/gin_helper/dictionary.h" #include "shell/common/node_includes.h" #include "ui/base/l10n/l10n_util.h" diff --git a/shell/browser/usb/usb_chooser_context.h b/shell/browser/usb/usb_chooser_context.h index c4dd074f9a..77b383fe56 100644 --- a/shell/browser/usb/usb_chooser_context.h +++ b/shell/browser/usb/usb_chooser_context.h @@ -13,16 +13,22 @@ #include "base/containers/queue.h" #include "base/memory/raw_ptr.h" #include "base/observer_list.h" +#include "base/observer_list_types.h" #include "base/values.h" #include "components/keyed_service/core/keyed_service.h" #include "mojo/public/cpp/bindings/associated_receiver.h" -#include "mojo/public/cpp/bindings/pending_receiver.h" -#include "mojo/public/cpp/bindings/pending_remote.h" #include "mojo/public/cpp/bindings/remote.h" #include "services/device/public/mojom/usb_manager.mojom.h" #include "services/device/public/mojom/usb_manager_client.mojom.h" #include "url/origin.h" +namespace mojo { +template +class PendingReciever; +template +class PendingRemote; +} // namespace mojo + namespace electron { class ElectronBrowserContext; diff --git a/shell/browser/usb/usb_chooser_controller.cc b/shell/browser/usb/usb_chooser_controller.cc index 5f92eefcb7..b5355b6639 100644 --- a/shell/browser/usb/usb_chooser_controller.cc +++ b/shell/browser/usb/usb_chooser_controller.cc @@ -17,6 +17,7 @@ #include "services/device/public/mojom/usb_enumeration_options.mojom.h" #include "shell/browser/api/electron_api_session.h" #include "shell/browser/javascript_environment.h" +#include "shell/browser/usb/electron_usb_delegate.h" #include "shell/browser/usb/usb_chooser_context_factory.h" #include "shell/common/gin_converters/callback_converter.h" #include "shell/common/gin_converters/content_converter.h" diff --git a/shell/browser/usb/usb_chooser_controller.h b/shell/browser/usb/usb_chooser_controller.h index 7abbddaff0..1efc724462 100644 --- a/shell/browser/usb/usb_chooser_controller.h +++ b/shell/browser/usb/usb_chooser_controller.h @@ -9,23 +9,24 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" -#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_observer.h" #include "services/device/public/mojom/usb_device.mojom.h" -#include "shell/browser/usb/electron_usb_delegate.h" #include "shell/browser/usb/usb_chooser_context.h" #include "third_party/blink/public/mojom/usb/web_usb_service.mojom.h" #include "url/origin.h" namespace content { class RenderFrameHost; -} +class WebContents; +} // namespace content namespace gin { class Arguments; } namespace electron { +class ElectronUsbDelegate; + namespace api { class Session; } diff --git a/shell/browser/web_contents_zoom_controller.h b/shell/browser/web_contents_zoom_controller.h index 07cab5c3c5..94b7f7c67c 100644 --- a/shell/browser/web_contents_zoom_controller.h +++ b/shell/browser/web_contents_zoom_controller.h @@ -7,7 +7,6 @@ #include "base/memory/raw_ptr.h" #include "base/observer_list.h" -#include "base/observer_list_types.h" #include "content/public/browser/host_zoom_map.h" #include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_user_data.h" diff --git a/shell/browser/web_contents_zoom_observer.h b/shell/browser/web_contents_zoom_observer.h index fe95e06f1d..1c6d09926f 100644 --- a/shell/browser/web_contents_zoom_observer.h +++ b/shell/browser/web_contents_zoom_observer.h @@ -5,6 +5,7 @@ #ifndef ELECTRON_SHELL_BROWSER_WEB_CONTENTS_ZOOM_OBSERVER_H_ #define ELECTRON_SHELL_BROWSER_WEB_CONTENTS_ZOOM_OBSERVER_H_ +#include "base/observer_list_types.h" #include "shell/browser/web_contents_zoom_controller.h" namespace electron { diff --git a/shell/browser/zoom_level_delegate.h b/shell/browser/zoom_level_delegate.h index 50922c3e40..56146f78b2 100644 --- a/shell/browser/zoom_level_delegate.h +++ b/shell/browser/zoom_level_delegate.h @@ -9,7 +9,6 @@ #include "base/memory/raw_ptr.h" #include "base/values.h" -#include "components/prefs/pref_service.h" #include "content/public/browser/host_zoom_map.h" #include "content/public/browser/zoom_level_delegate.h" @@ -17,6 +16,7 @@ namespace base { class FilePath; } // namespace base +class PrefService; class PrefRegistrySimple; namespace electron { diff --git a/shell/common/api/electron_api_clipboard.cc b/shell/common/api/electron_api_clipboard.cc index 7d741cb70c..f4a20cc45e 100644 --- a/shell/common/api/electron_api_clipboard.cc +++ b/shell/common/api/electron_api_clipboard.cc @@ -18,6 +18,7 @@ #include "ui/base/clipboard/file_info.h" #include "ui/base/clipboard/scoped_clipboard_writer.h" #include "ui/gfx/codec/png_codec.h" +#include "ui/gfx/image/image.h" namespace electron::api { diff --git a/shell/common/api/electron_api_clipboard.h b/shell/common/api/electron_api_clipboard.h index 3abe0895a9..74713c9a7b 100644 --- a/shell/common/api/electron_api_clipboard.h +++ b/shell/common/api/electron_api_clipboard.h @@ -10,8 +10,11 @@ #include "shell/common/gin_converters/file_path_converter.h" #include "ui/base/clipboard/clipboard.h" -#include "ui/gfx/image/image.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" + +namespace gfx { +class Image; +} // namespace gfx namespace gin_helper { class Arguments; diff --git a/shell/common/api/electron_api_native_image.cc b/shell/common/api/electron_api_native_image.cc index a43039be9e..cd8b8643a5 100644 --- a/shell/common/api/electron_api_native_image.cc +++ b/shell/common/api/electron_api_native_image.cc @@ -15,6 +15,7 @@ #include "base/strings/pattern.h" #include "base/strings/utf_string_conversions.h" #include "gin/arguments.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "gin/per_isolate_data.h" #include "net/base/data_url.h" @@ -25,6 +26,7 @@ #include "shell/common/gin_converters/gurl_converter.h" #include "shell/common/gin_converters/value_converter.h" #include "shell/common/gin_helper/dictionary.h" +#include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/function_template_extensions.h" #include "shell/common/gin_helper/object_template_builder.h" #include "shell/common/node_includes.h" diff --git a/shell/common/api/electron_api_native_image.h b/shell/common/api/electron_api_native_image.h index 6087eb2033..94fc3cc5c0 100644 --- a/shell/common/api/electron_api_native_image.h +++ b/shell/common/api/electron_api_native_image.h @@ -11,9 +11,7 @@ #include "base/containers/flat_map.h" #include "base/memory/raw_ptr.h" #include "base/values.h" -#include "gin/handle.h" #include "gin/wrappable.h" -#include "shell/common/gin_helper/error_thrower.h" #include "ui/gfx/image/image.h" #include "ui/gfx/image/image_skia_rep.h" @@ -26,20 +24,24 @@ class GURL; namespace base { class FilePath; -} +} // namespace base namespace gfx { class Rect; class Size; } // namespace gfx -namespace gin_helper { -class Dictionary; -} - namespace gin { class Arguments; -} + +template +class Handle; +} // namespace gin + +namespace gin_helper { +class Dictionary; +class ErrorThrower; +} // namespace gin_helper namespace electron::api { diff --git a/shell/common/api/electron_api_native_image_mac.mm b/shell/common/api/electron_api_native_image_mac.mm index e45eaae9a9..b32d6818e0 100644 --- a/shell/common/api/electron_api_native_image_mac.mm +++ b/shell/common/api/electron_api_native_image_mac.mm @@ -16,6 +16,7 @@ #include "base/strings/sys_string_conversions.h" #include "base/task/bind_post_task.h" #include "gin/arguments.h" +#include "gin/handle.h" #include "shell/common/gin_converters/image_converter.h" #include "shell/common/gin_helper/promise.h" #include "ui/gfx/color_utils.h" diff --git a/shell/common/api/electron_api_shell.cc b/shell/common/api/electron_api_shell.cc index e1348bd7e1..a8031264d7 100644 --- a/shell/common/api/electron_api_shell.cc +++ b/shell/common/api/electron_api_shell.cc @@ -13,6 +13,7 @@ #include "shell/common/gin_helper/promise.h" #include "shell/common/node_includes.h" #include "shell/common/platform_util.h" +#include "v8/include/v8-microtask-queue.h" #if BUILDFLAG(IS_WIN) #include "base/win/scoped_com_initializer.h" diff --git a/shell/common/api/electron_api_url_loader.cc b/shell/common/api/electron_api_url_loader.cc index 6c02fc7803..9792282bbd 100644 --- a/shell/common/api/electron_api_url_loader.cc +++ b/shell/common/api/electron_api_url_loader.cc @@ -22,6 +22,7 @@ #include "gin/wrappable.h" #include "mojo/public/cpp/bindings/remote.h" #include "mojo/public/cpp/system/data_pipe_producer.h" +#include "net/base/auth.h" #include "net/base/load_flags.h" #include "net/http/http_util.h" #include "net/url_request/redirect_util.h" diff --git a/shell/common/api/electron_api_url_loader.h b/shell/common/api/electron_api_url_loader.h index 8c6222d1e4..3d86247bf9 100644 --- a/shell/common/api/electron_api_url_loader.h +++ b/shell/common/api/electron_api_url_loader.h @@ -15,7 +15,6 @@ #include "base/sequence_checker.h" #include "gin/wrappable.h" #include "mojo/public/cpp/bindings/receiver_set.h" -#include "net/base/auth.h" #include "services/network/public/cpp/simple_url_loader_stream_consumer.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom-forward.h" @@ -23,7 +22,7 @@ #include "services/network/public/mojom/url_response_head.mojom.h" #include "shell/browser/event_emitter_mixin.h" #include "url/gurl.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace gin { class Arguments; @@ -31,6 +30,10 @@ template class Handle; } // namespace gin +namespace net { +class AuthChallengeInfo; +} // namespace net + namespace network { class SimpleURLLoader; struct ResourceRequest; diff --git a/shell/common/api/electron_bindings.h b/shell/common/api/electron_bindings.h index 85846e7f35..851ae358f6 100644 --- a/shell/common/api/electron_bindings.h +++ b/shell/common/api/electron_bindings.h @@ -10,7 +10,6 @@ #include "base/memory/scoped_refptr.h" #include "base/process/process_metrics.h" -#include "shell/common/gin_helper/promise.h" #include "shell/common/node_bindings.h" #include "uv.h" // NOLINT(build/include_directory) @@ -21,6 +20,8 @@ class FilePath; namespace gin_helper { class Arguments; class Dictionary; +template +class Promise; } // namespace gin_helper namespace memory_instrumentation { diff --git a/shell/common/api/object_life_monitor.h b/shell/common/api/object_life_monitor.h index 8cd608f35e..9ef0dcf2b4 100644 --- a/shell/common/api/object_life_monitor.h +++ b/shell/common/api/object_life_monitor.h @@ -6,7 +6,9 @@ #define ELECTRON_SHELL_COMMON_API_OBJECT_LIFE_MONITOR_H_ #include "base/memory/weak_ptr.h" -#include "v8/include/v8.h" +#include "v8/include/v8-object.h" +#include "v8/include/v8-persistent-handle.h" +#include "v8/include/v8-weak-callback-info.h" namespace electron { diff --git a/shell/common/gin_converters/image_converter.cc b/shell/common/gin_converters/image_converter.cc index 0241d7bbf2..36bbf7b592 100644 --- a/shell/common/gin_converters/image_converter.cc +++ b/shell/common/gin_converters/image_converter.cc @@ -4,6 +4,7 @@ #include "shell/common/gin_converters/image_converter.h" +#include "gin/handle.h" #include "shell/common/api/electron_api_native_image.h" #include "shell/common/gin_converters/file_path_converter.h" #include "ui/gfx/image/image_skia.h" diff --git a/shell/common/gin_converters/net_converter.cc b/shell/common/gin_converters/net_converter.cc index 3d01c06c32..47a4ffb52f 100644 --- a/shell/common/gin_converters/net_converter.cc +++ b/shell/common/gin_converters/net_converter.cc @@ -16,6 +16,7 @@ #include "base/values.h" #include "gin/converter.h" #include "gin/dictionary.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" #include "net/cert/x509_certificate.h" #include "net/cert/x509_util.h" diff --git a/shell/common/gin_helper/callback.h b/shell/common/gin_helper/callback.h index 8402435602..a4f41b9511 100644 --- a/shell/common/gin_helper/callback.h +++ b/shell/common/gin_helper/callback.h @@ -13,6 +13,7 @@ #include "shell/common/gin_helper/function_template.h" #include "shell/common/gin_helper/locker.h" #include "shell/common/gin_helper/microtasks_scope.h" +#include "v8/include/v8-function.h" // Implements safe conversions between JS functions and base::RepeatingCallback. namespace gin_helper { diff --git a/shell/common/gin_helper/constructible.h b/shell/common/gin_helper/constructible.h index 30995cd786..4eb5a545fb 100644 --- a/shell/common/gin_helper/constructible.h +++ b/shell/common/gin_helper/constructible.h @@ -8,6 +8,7 @@ #include "gin/per_isolate_data.h" #include "shell/common/gin_helper/event_emitter_template.h" #include "shell/common/gin_helper/function_template_extensions.h" +#include "v8/include/v8-context.h" namespace gin_helper { template diff --git a/shell/common/gin_helper/destroyable.cc b/shell/common/gin_helper/destroyable.cc index dacf9bfe33..51758bf3e8 100644 --- a/shell/common/gin_helper/destroyable.cc +++ b/shell/common/gin_helper/destroyable.cc @@ -7,6 +7,7 @@ #include "base/no_destructor.h" #include "gin/converter.h" #include "shell/common/gin_helper/wrappable_base.h" +#include "v8/include/v8-function.h" namespace gin_helper { diff --git a/shell/common/gin_helper/destroyable.h b/shell/common/gin_helper/destroyable.h index 20419542d2..cd789c503a 100644 --- a/shell/common/gin_helper/destroyable.h +++ b/shell/common/gin_helper/destroyable.h @@ -5,7 +5,7 @@ #ifndef ELECTRON_SHELL_COMMON_GIN_HELPER_DESTROYABLE_H_ #define ELECTRON_SHELL_COMMON_GIN_HELPER_DESTROYABLE_H_ -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace gin_helper { diff --git a/shell/common/gin_helper/error_thrower.h b/shell/common/gin_helper/error_thrower.h index e5ace0a28f..bd5981b575 100644 --- a/shell/common/gin_helper/error_thrower.h +++ b/shell/common/gin_helper/error_thrower.h @@ -8,7 +8,7 @@ #include #include "base/memory/raw_ptr.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace gin_helper { diff --git a/shell/common/gin_helper/event.cc b/shell/common/gin_helper/event.cc index e1ea3fd781..165f758c7b 100644 --- a/shell/common/gin_helper/event.cc +++ b/shell/common/gin_helper/event.cc @@ -4,6 +4,7 @@ #include "shell/common/gin_helper/event.h" #include "gin/dictionary.h" +#include "gin/handle.h" #include "gin/object_template_builder.h" namespace gin_helper::internal { diff --git a/shell/common/gin_helper/event.h b/shell/common/gin_helper/event.h index a1565ffb7d..7f04d27edb 100644 --- a/shell/common/gin_helper/event.h +++ b/shell/common/gin_helper/event.h @@ -5,10 +5,14 @@ #ifndef ELECTRON_SHELL_COMMON_GIN_HELPER_EVENT_H_ #define ELECTRON_SHELL_COMMON_GIN_HELPER_EVENT_H_ -#include "gin/handle.h" #include "gin/wrappable.h" #include "shell/common/gin_helper/constructible.h" +namespace gin { +template +class Handle; +} // namespace gin + namespace v8 { class Isolate; template diff --git a/shell/common/gin_helper/function_template.h b/shell/common/gin_helper/function_template.h index 55f33f6eb8..3cc8bf025f 100644 --- a/shell/common/gin_helper/function_template.h +++ b/shell/common/gin_helper/function_template.h @@ -17,6 +17,9 @@ #include "shell/common/gin_helper/destroyable.h" #include "shell/common/gin_helper/error_thrower.h" #include "shell/common/gin_helper/microtasks_scope.h" +#include "v8/include/v8-context.h" +#include "v8/include/v8-external.h" +#include "v8/include/v8-template.h" // This file is forked from gin/function_template.h with 2 differences: // 1. Support for additional types of arguments. diff --git a/shell/common/gin_helper/locker.cc b/shell/common/gin_helper/locker.cc index 27b9f0306b..68d1c2e4e0 100644 --- a/shell/common/gin_helper/locker.cc +++ b/shell/common/gin_helper/locker.cc @@ -5,6 +5,7 @@ #include "shell/common/gin_helper/locker.h" #include "shell/common/process_util.h" +#include "v8/include/v8-locker.h" namespace gin_helper { diff --git a/shell/common/gin_helper/locker.h b/shell/common/gin_helper/locker.h index 2208a8b29c..e6966b13c5 100644 --- a/shell/common/gin_helper/locker.h +++ b/shell/common/gin_helper/locker.h @@ -7,7 +7,10 @@ #include -#include "v8/include/v8.h" +namespace v8 { +class Isolate; +class Locker; +} // namespace v8 namespace gin_helper { diff --git a/shell/common/gin_helper/microtasks_scope.h b/shell/common/gin_helper/microtasks_scope.h index a8d27d3ccb..aff5a3f6ea 100644 --- a/shell/common/gin_helper/microtasks_scope.h +++ b/shell/common/gin_helper/microtasks_scope.h @@ -7,7 +7,8 @@ #include -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" +#include "v8/include/v8-microtask-queue.h" namespace gin_helper { diff --git a/shell/common/gin_helper/persistent_dictionary.h b/shell/common/gin_helper/persistent_dictionary.h index a10d8802b2..87d0dc46c5 100644 --- a/shell/common/gin_helper/persistent_dictionary.h +++ b/shell/common/gin_helper/persistent_dictionary.h @@ -6,7 +6,11 @@ #define ELECTRON_SHELL_COMMON_GIN_HELPER_PERSISTENT_DICTIONARY_H_ #include "base/memory/raw_ptr.h" -#include "shell/common/gin_helper/dictionary.h" +#include "gin/converter.h" +#include "v8/include/v8-context.h" +#include "v8/include/v8-isolate.h" +#include "v8/include/v8-local-handle.h" +#include "v8/include/v8-object.h" namespace gin_helper { diff --git a/shell/common/gin_helper/pinnable.h b/shell/common/gin_helper/pinnable.h index a5e5f68cc6..498e7836f7 100644 --- a/shell/common/gin_helper/pinnable.h +++ b/shell/common/gin_helper/pinnable.h @@ -5,7 +5,10 @@ #ifndef ELECTRON_SHELL_COMMON_GIN_HELPER_PINNABLE_H_ #define ELECTRON_SHELL_COMMON_GIN_HELPER_PINNABLE_H_ -#include "v8/include/v8.h" +#include "v8/include/v8-isolate.h" +#include "v8/include/v8-local-handle.h" +#include "v8/include/v8-persistent-handle.h" +#include "v8/include/v8-value.h" namespace gin_helper { diff --git a/shell/common/gin_helper/promise.cc b/shell/common/gin_helper/promise.cc index bc659c9c2f..5282f803e1 100644 --- a/shell/common/gin_helper/promise.cc +++ b/shell/common/gin_helper/promise.cc @@ -5,6 +5,7 @@ #include #include "shell/common/gin_helper/promise.h" +#include "v8/include/v8-context.h" namespace gin_helper { diff --git a/shell/common/gin_helper/promise.h b/shell/common/gin_helper/promise.h index ee1b41b57c..ff23cc1ce8 100644 --- a/shell/common/gin_helper/promise.h +++ b/shell/common/gin_helper/promise.h @@ -18,6 +18,7 @@ #include "shell/common/gin_helper/locker.h" #include "shell/common/gin_helper/microtasks_scope.h" #include "shell/common/process_util.h" +#include "v8/include/v8-context.h" namespace gin_helper { diff --git a/shell/common/gin_helper/wrappable.cc b/shell/common/gin_helper/wrappable.cc index 82ed322b45..8f4e8a87df 100644 --- a/shell/common/gin_helper/wrappable.cc +++ b/shell/common/gin_helper/wrappable.cc @@ -6,6 +6,7 @@ #include "base/logging.h" #include "shell/common/gin_helper/dictionary.h" +#include "v8/include/v8-function.h" namespace gin_helper { diff --git a/shell/common/gin_helper/wrappable_base.h b/shell/common/gin_helper/wrappable_base.h index f65e9079b0..397fa5171e 100644 --- a/shell/common/gin_helper/wrappable_base.h +++ b/shell/common/gin_helper/wrappable_base.h @@ -6,7 +6,7 @@ #define ELECTRON_SHELL_COMMON_GIN_HELPER_WRAPPABLE_BASE_H_ #include "base/memory/raw_ptr.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace gin { class Arguments; diff --git a/shell/common/key_weak_map.h b/shell/common/key_weak_map.h index b3e4f36675..cb8b68a4f2 100644 --- a/shell/common/key_weak_map.h +++ b/shell/common/key_weak_map.h @@ -10,7 +10,7 @@ #include #include "base/memory/raw_ptr.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace electron { diff --git a/shell/common/node_bindings.cc b/shell/common/node_bindings.cc index 617702f38e..cf7f754b08 100644 --- a/shell/common/node_bindings.cc +++ b/shell/common/node_bindings.cc @@ -35,6 +35,7 @@ #include "shell/common/gin_helper/event_emitter_caller.h" #include "shell/common/gin_helper/microtasks_scope.h" #include "shell/common/mac/main_application_bundle.h" +#include "shell/common/node_includes.h" #include "shell/common/node_util.h" #include "shell/common/world_ids.h" #include "third_party/blink/public/web/web_local_frame.h" @@ -437,6 +438,20 @@ NodeBindings::~NodeBindings() { stop_and_close_uv_loop(uv_loop_); } +node::IsolateData* NodeBindings::isolate_data( + v8::Local context) const { + if (context->GetNumberOfEmbedderDataFields() <= + kElectronContextEmbedderDataIndex) { + return nullptr; + } + auto* isolate_data = static_cast( + context->GetAlignedPointerFromEmbedderData( + kElectronContextEmbedderDataIndex)); + CHECK(isolate_data); + CHECK(isolate_data->event_loop()); + return isolate_data; +} + // static uv_loop_t* NodeBindings::InitEventLoop(BrowserEnvironment browser_env, uv_loop_t* worker_loop) { diff --git a/shell/common/node_bindings.h b/shell/common/node_bindings.h index 03813e793b..bb25287dd3 100644 --- a/shell/common/node_bindings.h +++ b/shell/common/node_bindings.h @@ -17,14 +17,19 @@ #include "base/memory/weak_ptr.h" #include "gin/public/context_holder.h" #include "gin/public/gin_embedders.h" -#include "shell/common/node_includes.h" #include "uv.h" // NOLINT(build/include_directory) -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace base { class SingleThreadTaskRunner; } +namespace node { +class Environment; +class IsolateData; +class MultiIsolatePlatform; +} // namespace node + namespace electron { // A helper class to manage uv_handle_t types, e.g. uv_async_t. @@ -114,18 +119,7 @@ class NodeBindings { // Notify embed thread to start polling after environment is loaded. void StartPolling(); - node::IsolateData* isolate_data(v8::Local context) const { - if (context->GetNumberOfEmbedderDataFields() <= - kElectronContextEmbedderDataIndex) { - return nullptr; - } - auto* isolate_data = static_cast( - context->GetAlignedPointerFromEmbedderData( - kElectronContextEmbedderDataIndex)); - CHECK(isolate_data); - CHECK(isolate_data->event_loop()); - return isolate_data; - } + node::IsolateData* isolate_data(v8::Local context) const; // Gets/sets the environment to wrap uv loop. void set_uv_env(node::Environment* env) { uv_env_ = env; } diff --git a/shell/common/node_util.h b/shell/common/node_util.h index 38f9d28b2b..2e5f083ffa 100644 --- a/shell/common/node_util.h +++ b/shell/common/node_util.h @@ -7,7 +7,7 @@ #include -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace node { class Environment; diff --git a/shell/renderer/api/context_bridge/object_cache.h b/shell/renderer/api/context_bridge/object_cache.h index 2039e06137..680857f358 100644 --- a/shell/renderer/api/context_bridge/object_cache.h +++ b/shell/renderer/api/context_bridge/object_cache.h @@ -9,7 +9,6 @@ #include #include -#include "base/containers/linked_list.h" #include "content/public/renderer/render_frame.h" #include "content/public/renderer/render_frame_observer.h" #include "shell/renderer/electron_render_frame_observer.h" diff --git a/shell/renderer/api/electron_api_context_bridge.h b/shell/renderer/api/electron_api_context_bridge.h index e0cabdfab2..4f17f0b06e 100644 --- a/shell/renderer/api/electron_api_context_bridge.h +++ b/shell/renderer/api/electron_api_context_bridge.h @@ -6,7 +6,7 @@ #define ELECTRON_SHELL_RENDERER_API_ELECTRON_API_CONTEXT_BRIDGE_H_ #include "shell/renderer/api/context_bridge/object_cache.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace gin_helper { class Arguments; diff --git a/shell/renderer/api/electron_api_spell_check_client.cc b/shell/renderer/api/electron_api_spell_check_client.cc index b59d278148..07ab0115c8 100644 --- a/shell/renderer/api/electron_api_spell_check_client.cc +++ b/shell/renderer/api/electron_api_spell_check_client.cc @@ -23,6 +23,7 @@ #include "third_party/blink/public/web/web_text_checking_completion.h" #include "third_party/blink/public/web/web_text_checking_result.h" #include "third_party/icu/source/common/unicode/uscript.h" +#include "v8/include/v8-function.h" namespace electron::api { diff --git a/shell/renderer/api/electron_api_spell_check_client.h b/shell/renderer/api/electron_api_spell_check_client.h index befd74e806..e0e574fa17 100644 --- a/shell/renderer/api/electron_api_spell_check_client.h +++ b/shell/renderer/api/electron_api_spell_check_client.h @@ -16,7 +16,9 @@ #include "third_party/blink/public/platform/web_spell_check_panel_host_client.h" #include "third_party/blink/public/platform/web_vector.h" #include "third_party/blink/public/web/web_text_check_client.h" -#include "v8/include/v8.h" +#include "v8/include/v8-context.h" +#include "v8/include/v8-forward.h" +#include "v8/include/v8-local-handle.h" namespace blink { struct WebTextCheckingResult; diff --git a/shell/renderer/api/electron_api_web_utils.h b/shell/renderer/api/electron_api_web_utils.h index 288032733e..5e3f4103fb 100644 --- a/shell/renderer/api/electron_api_web_utils.h +++ b/shell/renderer/api/electron_api_web_utils.h @@ -5,7 +5,7 @@ #ifndef ELECTRON_SHELL_RENDERER_API_ELECTRON_API_WEB_UTILS_H_ #define ELECTRON_SHELL_RENDERER_API_ELECTRON_API_WEB_UTILS_H_ -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace electron::api::web_utils { diff --git a/shell/renderer/renderer_client_base.cc b/shell/renderer/renderer_client_base.cc index 4e84c276f2..2131cf2909 100644 --- a/shell/renderer/renderer_client_base.cc +++ b/shell/renderer/renderer_client_base.cc @@ -50,6 +50,10 @@ #include "third_party/blink/renderer/platform/weborigin/scheme_registry.h" // nogncheck #include "third_party/widevine/cdm/buildflags.h" +#if BUILDFLAG(ENABLE_PDF_VIEWER) +#include "components/pdf/renderer/internal_plugin_renderer_helpers.h" +#endif // BUILDFLAG(ENABLE_PDF_VIEWER) + #if BUILDFLAG(IS_MAC) #include "base/strings/sys_string_conversions.h" #endif diff --git a/shell/renderer/renderer_client_base.h b/shell/renderer/renderer_client_base.h index 1d5deeec3f..35d85a84a5 100644 --- a/shell/renderer/renderer_client_base.h +++ b/shell/renderer/renderer_client_base.h @@ -13,10 +13,6 @@ // In SHARED_INTERMEDIATE_DIR. #include "widevine_cdm_version.h" // NOLINT(build/include_directory) -#if BUILDFLAG(ENABLE_PDF_VIEWER) -#include "components/pdf/renderer/internal_plugin_renderer_helpers.h" -#endif // BUILDFLAG(ENABLE_PDF_VIEWER) - #if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER) #include "services/service_manager/public/cpp/binder_registry.h" #include "services/service_manager/public/cpp/local_interface_provider.h" diff --git a/shell/renderer/web_worker_observer.h b/shell/renderer/web_worker_observer.h index 7c47283005..2592711fd6 100644 --- a/shell/renderer/web_worker_observer.h +++ b/shell/renderer/web_worker_observer.h @@ -8,7 +8,7 @@ #include #include "base/containers/flat_set.h" -#include "v8/include/v8.h" +#include "v8/include/v8-forward.h" namespace node {