From 10d30914e9c5e911492e690e4fba4dedaf0b6796 Mon Sep 17 00:00:00 2001 From: Peter Varga Date: Thu, 28 Jan 2021 14:47:28 +0100 Subject: Clean up header includes and forward declarations in core Change-Id: Ia90172f47f0f6349de9a21f6567bda92a156216c Reviewed-by: Allan Sandfeld Jensen --- src/core/api/qwebengineurlschemehandler.h | 4 - src/core/content_browser_client_qt.cpp | 88 +++++++--------------- src/core/content_browser_client_qt.h | 10 --- ...in_response_interceptor_url_loader_throttle.cpp | 6 +- src/core/net/proxying_url_loader_factory_qt.cpp | 12 +-- src/core/net/proxying_url_loader_factory_qt.h | 8 -- src/core/net/system_network_context_manager.cpp | 20 ----- src/core/net/system_network_context_manager.h | 10 --- src/core/net/webui_controller_factory_qt.cpp | 5 -- src/core/net/webui_controller_factory_qt.h | 8 -- src/core/profile_io_data_qt.h | 1 - .../pepper/pepper_flash_browser_host_qt.cpp | 10 --- .../pepper/pepper_flash_browser_host_qt.h | 8 -- src/core/resource_context_qt.h | 15 ---- src/core/user_notification_controller.h | 2 +- 15 files changed, 31 insertions(+), 176 deletions(-) diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h index 09c5b08cb..4574bf8b0 100644 --- a/src/core/api/qwebengineurlschemehandler.h +++ b/src/core/api/qwebengineurlschemehandler.h @@ -44,10 +44,6 @@ #include -namespace QtWebEngineCore { -class URLRequestContextGetterQt; -} - QT_BEGIN_NAMESPACE class QWebEngineUrlRequestJob; diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index 6b4b79787..f41d612b3 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -39,69 +39,37 @@ #include "content_browser_client_qt.h" -#include "base/memory/ptr_util.h" #include "base/optional.h" -#include "base/path_service.h" -#include "base/strings/utf_string_conversions.h" #include "base/task/post_task.h" -#include "base/threading/thread_restrictions.h" #include "chrome/browser/custom_handlers/protocol_handler_registry.h" #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" -#if QT_CONFIG(webengine_spellchecker) -#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h" -#endif -#include "components/guest_view/browser/guest_view_base.h" #include "components/navigation_interception/intercept_navigation_throttle.h" #include "components/navigation_interception/navigation_params.h" #include "components/network_hints/browser/simple_network_hints_handler_impl.h" #include "components/performance_manager/embedder/performance_manager_registry.h" #include "components/performance_manager/public/performance_manager.h" -#include "components/spellcheck/spellcheck_buildflags.h" -#include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/browser/web_contents/web_contents_impl.h" -#include "content/common/url_schemes.h" #include "content/public/browser/browser_main_runner.h" -#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/child_process_security_policy.h" #include "content/public/browser/client_certificate_delegate.h" #include "content/public/browser/file_url_loader.h" #include "content/public/browser/media_observer.h" -#include "content/public/browser/network_service_instance.h" #include "content/public/browser/render_frame_host.h" #include "content/public/browser/render_process_host.h" #include "content/public/browser/render_view_host.h" #include "content/public/browser/shared_cors_origin_access_list.h" -#include "content/public/browser/storage_partition.h" #include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents_user_data.h" #include "content/public/browser/web_ui_url_loader_factory.h" #include "content/public/common/content_switches.h" #include "content/public/common/main_function_params.h" -#include "content/public/common/service_manager_connection.h" #include "content/public/common/service_names.mojom.h" -#include "content/public/common/url_constants.h" #include "content/public/common/user_agent.h" -#include "media/media_buildflags.h" #include "extensions/buildflags/buildflags.h" -#include "extensions/browser/extension_protocols.h" -#include "extensions/browser/guest_view/web_view/web_view_guest.h" -#include "extensions/browser/process_map.h" -#include "mojo/public/cpp/bindings/binding.h" -#include "mojo/public/cpp/bindings/binding_set.h" -#include "mojo/public/cpp/bindings/remote.h" -#include "printing/buildflags/buildflags.h" -#include "qtwebengine/browser/qtwebengine_content_browser_overlay_manifest.h" -#include "qtwebengine/browser/qtwebengine_content_renderer_overlay_manifest.h" #include "net/ssl/client_cert_identity.h" #include "net/ssl/client_cert_store.h" -#include "sandbox/policy/switches.h" #include "services/network/network_service.h" -#include "services/network/public/cpp/features.h" -#include "services/service_manager/switches.h" -#include "services/service_manager/public/cpp/connector.h" -#include "services/service_manager/public/cpp/service.h" -#include "storage/browser/quota/quota_settings.h" #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h" #include "third_party/blink/public/common/loader/url_loader_throttle.h" #include "third_party/blink/public/mojom/insecure_input/insecure_input_service.mojom.h" @@ -113,6 +81,8 @@ #include "ui/gl/gpu_timing.h" #include "url/url_util_qt.h" +#include "qtwebengine/browser/qtwebengine_content_browser_overlay_manifest.h" +#include "qtwebengine/browser/qtwebengine_content_renderer_overlay_manifest.h" #include "qtwebengine/common/renderer_configuration.mojom.h" #include "qtwebengine/grit/qt_webengine_resources.h" @@ -129,12 +99,8 @@ #include "net/custom_url_loader_factory.h" #include "net/proxying_restricted_cookie_manager_qt.h" #include "net/proxying_url_loader_factory_qt.h" -#include "net/qrc_url_scheme_handler.h" #include "net/system_network_context_manager.h" #include "platform_notification_service_qt.h" -#if QT_CONFIG(webengine_printing_and_pdf) -#include "printing/printing_message_filter_qt.h" -#endif #include "profile_qt.h" #include "profile_io_data_qt.h" #include "quota_permission_context_qt.h" @@ -143,16 +109,19 @@ #include "web_contents_adapter_client.h" #include "web_contents_adapter.h" #include "web_contents_delegate_qt.h" -#include "web_engine_context.h" #include "web_contents_view_qt.h" #include "web_engine_library_info.h" #include "api/qwebenginecookiestore.h" #include "api/qwebenginecookiestore_p.h" -#include "api/qwebengineurlscheme.h" -#if defined(Q_OS_LINUX) -#include "global_descriptors_qt.h" -#include "ui/base/resource/resource_bundle.h" +#if QT_CONFIG(opengl) +#include +#include +#endif + +#if QT_CONFIG(webengine_geolocation) +#include "base/memory/ptr_util.h" +#include "location_provider_qt.h" #endif #if QT_CONFIG(webengine_pepper_plugins) @@ -161,22 +130,32 @@ #include "renderer_host/pepper/pepper_host_factory_qt.h" #endif -#if QT_CONFIG(webengine_geolocation) -#include "location_provider_qt.h" +#if QT_CONFIG(webengine_printing_and_pdf) +#include "printing/printing_message_filter_qt.h" +#endif + +#if QT_CONFIG(webengine_spellchecker) +#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h" +#include "components/spellcheck/common/spellcheck.mojom.h" +#endif + +#if defined(Q_OS_LINUX) +#include "global_descriptors_qt.h" #endif #if BUILDFLAG(ENABLE_EXTENSIONS) -#include "content/public/browser/file_url_loader.h" +#include "common/extensions/extensions_client_qt.h" +#include "components/guest_view/browser/guest_view_base.h" #include "extensions/browser/api/mime_handler_private/mime_handler_private.h" #include "extensions/browser/extension_message_filter.h" -#include "extensions/browser/extension_registry.h" +#include "extensions/browser/extension_protocols.h" #include "extensions/browser/extension_registry.h" #include "extensions/browser/guest_view/extensions_guest_view_message_filter.h" #include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h" +#include "extensions/browser/guest_view/web_view/web_view_guest.h" +#include "extensions/browser/process_map.h" #include "extensions/browser/url_loader_factory_manager.h" #include "extensions/common/constants.h" - -#include "common/extensions/extensions_client_qt.h" #include "extensions/extension_web_contents_observer_qt.h" #include "extensions/extensions_browser_client_qt.h" #include "net/plugin_response_interceptor_url_loader_throttle.h" @@ -187,18 +166,8 @@ #include "media/mojo/services/media_service_factory.h" #endif -#if BUILDFLAG(ENABLE_SPELLCHECK) -#include "chrome/browser/spellchecker/spell_check_host_chrome_impl.h" -#include "components/spellcheck/common/spellcheck.mojom.h" -#endif - #include -#include #include -#if QT_CONFIG(opengl) -# include -# include -#endif #include QT_BEGIN_NAMESPACE @@ -616,12 +585,12 @@ WEB_CONTENTS_USER_DATA_KEY_IMPL(ServiceDriver) void ContentBrowserClientQt::BindHostReceiverForRenderer(content::RenderProcessHost *render_process_host, mojo::GenericPendingReceiver receiver) { -#if BUILDFLAG(ENABLE_SPELLCHECK) +#if QT_CONFIG(webengine_spellchecker) if (auto host_receiver = receiver.As()) { SpellCheckHostChromeImpl::Create(render_process_host->GetID(), std::move(host_receiver)); return; } -#endif // BUILDFLAG(ENABLE_SPELLCHECK) +#endif } static void BindNetworkHintsHandler(content::RenderFrameHost *frame_host, @@ -885,7 +854,6 @@ bool ContentBrowserClientQt::HandleExternalProtocol(const GURL &url, const base::Optional &initiating_origin, mojo::PendingRemote *out_factory) { -// Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); Q_UNUSED(child_id); Q_UNUSED(navigation_data); Q_UNUSED(initiating_origin); diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index 9e578d9d9..ffbfed430 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -41,13 +41,8 @@ #define CONTENT_BROWSER_CLIENT_QT_H #include "qtwebenginecoreglobal_p.h" -#include "base/memory/ref_counted.h" #include "content/public/browser/content_browser_client.h" -namespace net { -class URLRequestContextGetter; -} - namespace content { class BrowserContext; class BrowserMainParts; @@ -59,10 +54,7 @@ class BrowserPpapiHost; class DevToolsManagerDelegate; class RenderFrameHost; class RenderProcessHost; -class RenderViewHostDelegateView; class ResourceContext; -class ResourceDispatcherHostDelegate; -class WebContentsViewPort; class WebContents; struct MainFunctionParams; struct Referrer; @@ -74,8 +66,6 @@ class GLShareGroup; namespace QtWebEngineCore { -class BrowserMainPartsQt; -class ProfileQt; class ShareGroupQtQuick; class ContentBrowserClientQt : public content::ContentBrowserClient diff --git a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp index 4641717f7..bd03d3083 100644 --- a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp +++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp @@ -41,7 +41,7 @@ #include "base/bind.h" #include "base/task/post_task.h" -#include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/download_manager.h" #include "content/public/browser/download_request_utils.h" @@ -49,10 +49,6 @@ #include "extensions/common/constants.h" #include "extensions/common/extension.h" -#include "extensions/extension_system_qt.h" -#include "profile_adapter.h" -#include "profile_io_data_qt.h" -#include "profile_qt.h" #include "web_contents_delegate_qt.h" #include diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp index dfc17e440..6488310c4 100644 --- a/src/core/net/proxying_url_loader_factory_qt.cpp +++ b/src/core/net/proxying_url_loader_factory_qt.cpp @@ -42,26 +42,16 @@ #include #include "base/bind.h" -#include "base/strings/string_number_conversions.h" -#include "base/strings/stringprintf.h" #include "base/task/post_task.h" -#include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" -#include "content/public/browser/global_request_id.h" -#include "content/public/browser/render_process_host.h" #include "content/public/browser/web_contents.h" -#include "content/public/common/content_constants.h" -#include "content/public/common/url_utils.h" -#include "net/base/load_flags.h" #include "net/http/http_status_code.h" -#include "net/http/http_util.h" +#include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h" #include "api/qwebengineurlrequestinfo_p.h" -#include "profile_qt.h" #include "type_conversion.h" #include "web_contents_adapter_client.h" -#include "web_contents_view_qt.h" #include diff --git a/src/core/net/proxying_url_loader_factory_qt.h b/src/core/net/proxying_url_loader_factory_qt.h index e1bcc276c..50caa69e9 100644 --- a/src/core/net/proxying_url_loader_factory_qt.h +++ b/src/core/net/proxying_url_loader_factory_qt.h @@ -42,16 +42,12 @@ #include "base/callback.h" #include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/memory/ref_counted_delete_on_sequence.h" #include "base/memory/weak_ptr.h" -#include "base/optional.h" #include "mojo/public/cpp/bindings/receiver_set.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "services/network/public/cpp/resource_request.h" #include "services/network/public/mojom/url_loader.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" -#include "url/gurl.h" #include // based on aw_proxying_url_loader_factory.h: @@ -61,10 +57,6 @@ QT_FORWARD_DECLARE_CLASS(QWebEngineUrlRequestInterceptor) -namespace content { -class ResourceContext; -} - namespace QtWebEngineCore { class ProxyingURLLoaderFactoryQt : public network::mojom::URLLoaderFactory diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp index 99a207c0e..1fba115c6 100644 --- a/src/core/net/system_network_context_manager.cpp +++ b/src/core/net/system_network_context_manager.cpp @@ -44,35 +44,16 @@ #include "net/system_network_context_manager.h" -#include -#include -#include - #include "base/bind.h" #include "base/command_line.h" -#include "base/feature_list.h" -#include "base/logging.h" -#include "base/sequence_checker.h" -#include "base/strings/string_split.h" -#include "base/task/post_task.h" -#include "base/values.h" -#include "build/build_config.h" #include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h" #include "chrome/common/chrome_switches.h" #include "components/certificate_transparency/ct_known_logs.h" -#include "components/network_session_configurator/common/network_features.h" #include "components/network_session_configurator/common/network_switches.h" -#include "content/public/browser/browser_task_traits.h" -#include "content/public/browser/browser_thread.h" #include "content/public/browser/network_service_instance.h" -#include "content/public/common/content_features.h" #include "content/public/common/content_switches.h" #include "content/public/common/service_names.mojom.h" -#include "content/public/common/user_agent.h" -#include "mojo/public/cpp/bindings/associated_interface_ptr.h" -#include "net/dns/public/util.h" #include "net/net_buildflags.h" -#include "net/third_party/uri_template/uri_template.h" #include "services/network/network_service.h" #include "services/network/public/cpp/cross_thread_pending_shared_url_loader_factory.h" #include "services/network/public/cpp/features.h" @@ -80,7 +61,6 @@ #include "services/network/public/mojom/host_resolver.mojom.h" #include "services/network/public/mojom/url_loader_factory.mojom.h" #include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h" -#include "url/gurl.h" namespace { diff --git a/src/core/net/system_network_context_manager.h b/src/core/net/system_network_context_manager.h index bd12fe217..48cd99173 100644 --- a/src/core/net/system_network_context_manager.h +++ b/src/core/net/system_network_context_manager.h @@ -46,16 +46,10 @@ #define SYSTEM_NETWORK_CONTEXT_MANAGER_H_ #include -#include -#include #include "base/macros.h" -#include "base/memory/ref_counted.h" -#include "base/optional.h" -#include "services/network/public/mojom/host_resolver.mojom-forward.h" #include "services/network/public/mojom/network_context.mojom.h" #include "services/network/public/mojom/network_service.mojom-forward.h" -#include "services/network/public/mojom/ssl_config.mojom-forward.h" #include "services/network/public/mojom/url_loader_factory.mojom-forward.h" #include "net/proxy_config_monitor.h" @@ -67,10 +61,6 @@ class URLLoaderFactory; class SharedURLLoaderFactory; } // namespace network -namespace net_log { -class NetExportFileWriter; -} - // Responsible for creating and managing access to the system NetworkContext. // Lives on the UI thread. The NetworkContext this owns is intended for requests // not associated with a profile. It stores no data on disk, and has no HTTP diff --git a/src/core/net/webui_controller_factory_qt.cpp b/src/core/net/webui_controller_factory_qt.cpp index 27e58d75f..c6d50a447 100644 --- a/src/core/net/webui_controller_factory_qt.cpp +++ b/src/core/net/webui_controller_factory_qt.cpp @@ -45,23 +45,18 @@ #include "webui_controller_factory_qt.h" #include "base/bind.h" -#include "base/location.h" -#include "base/threading/thread_task_runner_handle.h" #include "build/build_config.h" #include "chrome/browser/accessibility/accessibility_ui.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/devtools_ui.h" #include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h" #include "chrome/common/url_constants.h" -#include "content/public/browser/web_contents.h" #include "content/public/browser/web_ui.h" -#include "content/public/common/content_client.h" #include "content/public/common/url_utils.h" #include "extensions/buildflags/buildflags.h" #include "media/media_buildflags.h" #include "ppapi/buildflags/buildflags.h" #include "printing/buildflags/buildflags.h" -#include "ui/web_dialogs/web_dialog_ui.h" #include "url/gurl.h" #if defined(OS_LINUX) || defined(OS_ANDROID) diff --git a/src/core/net/webui_controller_factory_qt.h b/src/core/net/webui_controller_factory_qt.h index 1cc76349b..6dfc612e1 100644 --- a/src/core/net/webui_controller_factory_qt.h +++ b/src/core/net/webui_controller_factory_qt.h @@ -42,16 +42,8 @@ #include "base/macros.h" #include "base/memory/singleton.h" -#include "components/favicon_base/favicon_callback.h" #include "content/public/browser/web_ui.h" #include "content/public/browser/web_ui_controller_factory.h" -#include "ui/base/layout.h" - -class Profile; - -namespace base { -class RefCountedMemory; -} namespace QtWebEngineCore { diff --git a/src/core/profile_io_data_qt.h b/src/core/profile_io_data_qt.h index 3f8205159..e44d838dd 100644 --- a/src/core/profile_io_data_qt.h +++ b/src/core/profile_io_data_qt.h @@ -53,7 +53,6 @@ namespace net { class ClientCertStore; -class URLRequestContext; } namespace extensions { diff --git a/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.cpp b/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.cpp index af547fcf2..8fa277e78 100644 --- a/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.cpp +++ b/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.cpp @@ -45,19 +45,14 @@ #include "pepper_flash_browser_host_qt.h" #include "base/time/time.h" -#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_ppapi_host.h" -#include "content/public/browser/browser_thread.h" -#include "content/public/browser/render_process_host.h" #include "ipc/ipc_message_macros.h" #include "ppapi/c/pp_errors.h" -#include "ppapi/c/private/ppb_flash.h" #include "ppapi/host/dispatch_host_message.h" #include "ppapi/proxy/ppapi_messages.h" #include "ppapi/proxy/resource_message_params.h" #include "ppapi/shared_impl/time_conversion.h" #include "qtwebenginecoreglobal_p.h" -#include "url/gurl.h" #if defined(OS_WIN) #include @@ -66,8 +61,6 @@ #endif using content::BrowserPpapiHost; -using content::BrowserThread; -using content::RenderProcessHost; namespace QtWebEngineCore { @@ -75,11 +68,8 @@ PepperFlashBrowserHostQt::PepperFlashBrowserHostQt(BrowserPpapiHost* host, PP_Instance instance, PP_Resource resource) : ResourceHost(host->GetPpapiHost(), instance, resource), - host_(host), weak_factory_(this) { - int unused; - host->GetRenderFrameIDsForInstance(instance, &render_process_id_, &unused); } PepperFlashBrowserHostQt::~PepperFlashBrowserHostQt() {} diff --git a/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.h b/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.h index 5d1107dfb..d6d2c8656 100644 --- a/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.h +++ b/src/core/renderer_host/pepper/pepper_flash_browser_host_qt.h @@ -40,7 +40,6 @@ #ifndef PEPPER_FLASH_BROWSER_HOST_QT_H #define PEPPER_FLASH_BROWSER_HOST_QT_H -#include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "ppapi/host/host_message_context.h" #include "ppapi/host/resource_host.h" @@ -51,7 +50,6 @@ class Time; namespace content { class BrowserPpapiHost; -class ResourceContext; } class GURL; @@ -77,12 +75,6 @@ private: const base::Time& t); int32_t OnGetLocalDataRestrictions(ppapi::host::HostMessageContext* context); - void GetLocalDataRestrictions(ppapi::host::ReplyMessageContext reply_context, - const GURL& document_url, - const GURL& plugin_url); - - content::BrowserPpapiHost* host_; - int render_process_id_; base::WeakPtrFactory weak_factory_; DISALLOW_COPY_AND_ASSIGN(PepperFlashBrowserHostQt); diff --git a/src/core/resource_context_qt.h b/src/core/resource_context_qt.h index 4107e7c24..efd3d2e7e 100644 --- a/src/core/resource_context_qt.h +++ b/src/core/resource_context_qt.h @@ -42,21 +42,6 @@ #include "content/public/browser/resource_context.h" -#include "extensions/buildflags/buildflags.h" - -namespace net { -class URLRequestContext; -class URLRequestContextGetter; -} - -#if BUILDFLAG(ENABLE_EXTENSIONS) -namespace extensions { -class ExtensionSystemQt; -} -#endif // BUILDFLAG(ENABLE_EXTENSIONS) - -class GURL; - namespace QtWebEngineCore { class ProfileIODataQt; diff --git a/src/core/user_notification_controller.h b/src/core/user_notification_controller.h index bab85c7ec..f0d7e348f 100644 --- a/src/core/user_notification_controller.h +++ b/src/core/user_notification_controller.h @@ -44,7 +44,7 @@ #include #include -#include +#include class GURL; -- cgit v1.2.3