summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHROMIUM_VERSION4
-rw-r--r--CMakeLists.txt13
-rw-r--r--LICENSE.GPLv3686
-rw-r--r--LICENSE.LGPLv3174
-rw-r--r--cmake/Functions.cmake65
-rw-r--r--cmake/Gn.cmake8
-rw-r--r--coin/module_config.yaml1
-rw-r--r--configure.cmake87
-rw-r--r--configure.pri558
-rw-r--r--dependencies.yaml10
-rw-r--r--examples/pdf/multipage/CMakeLists.txt2
-rw-r--r--examples/pdf/pdfviewer/CMakeLists.txt2
-rw-r--r--examples/pdfwidgets/pdfviewer/CMakeLists.txt2
-rw-r--r--examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc12
-rw-r--r--examples/pdfwidgets/pdfviewer/main.cpp54
-rw-r--r--examples/pdfwidgets/pdfviewer/mainwindow.cpp50
-rw-r--r--examples/pdfwidgets/pdfviewer/mainwindow.h50
-rw-r--r--examples/pdfwidgets/pdfviewer/pageselector.cpp50
-rw-r--r--examples/pdfwidgets/pdfviewer/pageselector.h50
-rw-r--r--examples/pdfwidgets/pdfviewer/zoomselector.cpp50
-rw-r--r--examples/pdfwidgets/pdfviewer/zoomselector.h54
-rw-r--r--examples/webenginequick/customdialogs/CMakeLists.txt5
-rw-r--r--examples/webenginequick/customdialogs/WebView.qml9
-rw-r--r--examples/webenginequick/customdialogs/forms/JavaScriptForm.ui.qml2
-rw-r--r--examples/webenginequick/customdialogs/forms/TouchSelectionMenu.qml61
-rw-r--r--examples/webenginequick/customdialogs/forms/TouchSelectionMenuForm.ui.qml86
-rw-r--r--examples/webenginequick/customdialogs/forms/forms.qmlproject45
-rw-r--r--examples/webenginequick/customdialogs/index.html3
-rw-r--r--examples/webenginequick/customdialogs/main.cpp10
-rw-r--r--examples/webenginequick/customdialogs/main.qml2
-rw-r--r--examples/webenginequick/lifecycle/CMakeLists.txt2
-rw-r--r--examples/webenginequick/minimal/CMakeLists.txt2
-rw-r--r--examples/webenginequick/quicknanobrowser/CMakeLists.txt4
-rw-r--r--examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json2
-rw-r--r--examples/webenginequick/quicknanobrowser/main.cpp8
-rw-r--r--examples/webenginequick/quicknanobrowser/quicknanobrowser.pro7
-rw-r--r--examples/webenginequick/recipebrowser/CMakeLists.txt2
-rw-r--r--examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc2
-rw-r--r--examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json1
-rw-r--r--examples/webenginequick/webengineaction/CMakeLists.txt2
-rw-r--r--examples/webenginewidgets/contentmanipulation/CMakeLists.txt2
-rw-r--r--examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json2
-rw-r--r--examples/webenginewidgets/cookiebrowser/CMakeLists.txt2
-rw-r--r--examples/webenginewidgets/markdowneditor/CMakeLists.txt2
-rw-r--r--examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc2
-rw-r--r--examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json1
-rw-r--r--examples/webenginewidgets/notifications/CMakeLists.txt2
-rw-r--r--examples/webenginewidgets/printme/CMakeLists.txt2
-rw-r--r--examples/webenginewidgets/simplebrowser/CMakeLists.txt4
-rw-r--r--examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json2
-rw-r--r--examples/webenginewidgets/spellchecker/CMakeLists.txt36
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json2
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/CMakeLists.txt2
-rw-r--r--examples/webenginewidgets/videoplayer/CMakeLists.txt2
-rw-r--r--examples/webenginewidgets/webui/CMakeLists.txt2
-rw-r--r--mkspecs/features/default_pre.prf20
-rw-r--r--mkspecs/features/functions.prf138
-rw-r--r--mkspecs/features/gn_generator.prf268
m---------src/3rdparty0
-rw-r--r--src/CMakeLists.txt37
-rw-r--r--src/buildtools/buildtools.pro20
-rw-r--r--src/buildtools/config/common.pri113
-rw-r--r--src/buildtools/config/functions.pri8
-rw-r--r--src/buildtools/config/linking.pri77
-rw-r--r--src/buildtools/config/linux.pri178
-rw-r--r--src/buildtools/config/mac_osx.pri38
-rw-r--r--src/buildtools/config/support.pri257
-rw-r--r--src/buildtools/config/windows.pri91
-rw-r--r--src/buildtools/configure.json843
-rw-r--r--src/buildtools/configure_host.pro65
-rw-r--r--src/buildtools/configure_target.pro33
-rw-r--r--src/buildtools/gn.pro39
-rw-r--r--src/buildtools/ninja.pro23
-rw-r--r--src/core/CMakeLists.txt16
-rw-r--r--src/core/accessibility_tree_formatter_qt.cpp7
-rw-r--r--src/core/api/CMakeLists.txt49
-rw-r--r--src/core/api/Qt6WebEngineCoreMacros.cmake57
-rw-r--r--src/core/api/configure.cmake6
-rw-r--r--src/core/api/core_api.pro119
-rw-r--r--src/core/api/qtwebenginecoreglobal.cpp7
-rw-r--r--src/core/api/qtwebenginecoreglobal_p.h1
-rw-r--r--src/core/api/qwebengineloadinginfo.h1
-rw-r--r--src/core/api/qwebenginepage.cpp2
-rw-r--r--src/core/browser_accessibility_qt.cpp8
-rw-r--r--src/core/browser_main_parts_qt.cpp40
-rw-r--r--src/core/browser_main_parts_qt.h17
-rw-r--r--src/core/browser_message_filter_qt.cpp13
-rw-r--r--src/core/browser_message_filter_qt.h2
-rw-r--r--src/core/certificate_error_controller.cpp2
-rw-r--r--src/core/client_cert_select_controller.cpp10
-rw-r--r--src/core/clipboard_change_observer.h11
-rw-r--r--src/core/clipboard_qt.cpp148
-rw-r--r--src/core/clipboard_qt.h22
-rw-r--r--src/core/clipboard_util_win.cpp140
-rw-r--r--src/core/common/qt_messages.h1
-rw-r--r--src/core/compositor/display_gl_output_surface.cpp2
-rw-r--r--src/core/compositor/display_skia_output_device.cpp4
-rw-r--r--src/core/compositor/display_skia_output_device.h3
-rw-r--r--src/core/compositor/display_software_output_surface.cpp9
-rw-r--r--src/core/config/common.pri48
-rw-r--r--src/core/config/linux.pri44
-rw-r--r--src/core/config/mac_osx.pri8
-rw-r--r--src/core/config/windows.pri8
-rw-r--r--src/core/configure/BUILD.root.gn.in39
-rw-r--r--src/core/content_browser_client_qt.cpp151
-rw-r--r--src/core/content_browser_client_qt.h30
-rw-r--r--src/core/content_client_qt.cpp49
-rw-r--r--src/core/content_client_qt.h4
-rw-r--r--src/core/content_main_delegate_qt.cpp3
-rw-r--r--src/core/core.pro48
-rw-r--r--src/core/core_chromium.pri352
-rw-r--r--src/core/core_common.pri21
-rw-r--r--src/core/core_generator.pro7
-rw-r--r--src/core/core_gn_config.pri17
-rw-r--r--src/core/core_headers.pro6
-rw-r--r--src/core/core_module.pro120
-rw-r--r--src/core/core_project.pro28
-rw-r--r--src/core/delegated_frame_host_client_qt.cpp4
-rw-r--r--src/core/devtools_frontend_qt.cpp137
-rw-r--r--src/core/devtools_frontend_qt.h4
-rw-r--r--src/core/doc/about_credits.tmpl (renamed from tools/about_credits.tmpl)0
-rw-r--r--src/core/doc/about_credits_entry.tmpl (renamed from tools/about_credits_entry.tmpl)0
-rw-r--r--src/core/doc/qtwebengine.qdocconf11
-rw-r--r--src/core/doc/src/external-resources.qdoc16
-rw-r--r--src/core/doc/src/qt6-changes.qdoc7
-rw-r--r--src/core/doc/src/qt_webengine_add_convert_dictionary.qdoc75
-rw-r--r--src/core/doc/src/qtwebengine-features.qdoc11
-rw-r--r--src/core/doc/src/qtwebengine-platform-notes.qdoc6
-rw-r--r--src/core/doc/src/qwebenginesettings_lgpl.qdoc13
-rw-r--r--src/core/download_manager_delegate_qt.cpp20
-rw-r--r--src/core/extensions/component_extension_resource_manager_qt.cpp1
-rw-r--r--src/core/extensions/extension_system_qt.cpp32
-rw-r--r--src/core/extensions/extension_web_contents_observer_qt.cpp4
-rw-r--r--src/core/extensions/extensions_browser_client_qt.cpp23
-rw-r--r--src/core/extensions/extensions_browser_client_qt.h5
-rw-r--r--src/core/favicon_driver_qt.cpp25
-rw-r--r--src/core/favicon_driver_qt.h6
-rw-r--r--src/core/file_picker_controller.cpp4
-rw-r--r--src/core/gn_run.pro68
-rw-r--r--src/core/javascript_dialog_controller.cpp2
-rw-r--r--src/core/javascript_dialog_controller_p.h2
-rw-r--r--src/core/javascript_dialog_manager_qt.cpp8
-rw-r--r--src/core/javascript_dialog_manager_qt.h4
-rw-r--r--src/core/location_provider_qt.cpp10
-rw-r--r--src/core/login_delegate_qt.cpp2
-rw-r--r--src/core/media_capture_devices_dispatcher.cpp19
-rw-r--r--src/core/media_capture_devices_dispatcher.h18
-rw-r--r--src/core/native_web_keyboard_event_qt.cpp5
-rw-r--r--src/core/net/client_cert_override.cpp13
-rw-r--r--src/core/net/client_cert_store_data.cpp2
-rw-r--r--src/core/net/client_cert_store_data.h4
-rw-r--r--src/core/net/cookie_monster_delegate_qt.cpp2
-rw-r--r--src/core/net/custom_url_loader_factory.cpp7
-rw-r--r--src/core/net/proxying_url_loader_factory_qt.cpp82
-rw-r--r--src/core/net/proxying_url_loader_factory_qt.h6
-rw-r--r--src/core/net/ssl_host_state_delegate_qt.cpp10
-rw-r--r--src/core/net/ssl_host_state_delegate_qt.h2
-rw-r--r--src/core/net/system_network_context_manager.cpp65
-rw-r--r--src/core/net/system_network_context_manager.h3
-rw-r--r--src/core/net/url_request_custom_job_proxy.cpp4
-rw-r--r--src/core/net/url_request_custom_job_proxy.h4
-rw-r--r--src/core/ozone/BUILD.gn9
-rw-r--r--src/core/ozone/gl_context_qt.cpp8
-rw-r--r--src/core/ozone/gl_ozone_egl_qt.cpp2
-rw-r--r--src/core/ozone/gl_ozone_egl_qt.h2
-rw-r--r--src/core/ozone/gl_ozone_glx_qt.cpp3
-rw-r--r--src/core/ozone/gl_ozone_glx_qt.h2
-rw-r--r--src/core/ozone/gl_surface_egl_qt.cpp140
-rw-r--r--src/core/ozone/ozone_platform_qt.cpp30
-rw-r--r--src/core/ozone/platform_window_qt.cpp10
-rw-r--r--src/core/ozone/platform_window_qt.h6
-rw-r--r--src/core/ozone/surface_factory_qt.cpp14
-rw-r--r--src/core/ozone/surface_factory_qt.h6
-rw-r--r--src/core/permission_manager_qt.cpp25
-rw-r--r--src/core/permission_manager_qt.h4
-rw-r--r--src/core/platform_notification_service_qt.cpp3
-rw-r--r--src/core/platform_notification_service_qt.h1
-rw-r--r--src/core/pref_service_adapter.cpp6
-rw-r--r--src/core/printing/print_view_manager_base_qt.cpp43
-rw-r--r--src/core/printing/print_view_manager_base_qt.h8
-rw-r--r--src/core/printing/print_view_manager_qt.cpp52
-rw-r--r--src/core/printing/print_view_manager_qt.h15
-rw-r--r--src/core/profile_adapter.cpp29
-rw-r--r--src/core/profile_io_data_qt.cpp16
-rw-r--r--src/core/profile_qt.cpp32
-rw-r--r--src/core/profile_qt.h8
-rw-r--r--src/core/render_widget_host_view_qt.cpp55
-rw-r--r--src/core/render_widget_host_view_qt.h18
-rw-r--r--src/core/render_widget_host_view_qt_delegate_client.cpp5
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp115
-rw-r--r--src/core/renderer/extensions/extensions_renderer_client_qt.cpp1
-rw-r--r--src/core/renderer/extensions/resource_request_policy_qt.cpp2
-rw-r--r--src/core/renderer/extensions/resource_request_policy_qt.h4
-rw-r--r--src/core/renderer/plugins/loadable_plugin_placeholder_qt.cpp2
-rw-r--r--src/core/renderer/plugins/loadable_plugin_placeholder_qt.h2
-rw-r--r--src/core/renderer/render_configuration.cpp4
-rw-r--r--src/core/renderer/user_resource_controller.cpp4
-rw-r--r--src/core/renderer/web_channel_ipc_transport.cpp68
-rw-r--r--src/core/renderer/web_channel_ipc_transport.h2
-rw-r--r--src/core/renderer/web_engine_page_render_frame.cpp24
-rw-r--r--src/core/renderer/web_engine_page_render_frame.h2
-rw-r--r--src/core/renderer_host/web_channel_ipc_transport_host.cpp17
-rw-r--r--src/core/renderer_host/web_channel_ipc_transport_host.h8
-rw-r--r--src/core/select_file_dialog_factory_qt.cpp4
-rw-r--r--src/core/tools/CMakeLists.txt15
-rw-r--r--src/core/tools/main.cpp26
-rw-r--r--src/core/touch_selection_controller_client_qt.h3
-rw-r--r--src/core/touch_selection_menu_controller.cpp29
-rw-r--r--src/core/touch_selection_menu_controller.h13
-rw-r--r--src/core/type_conversion.cpp13
-rw-r--r--src/core/type_conversion.h45
-rw-r--r--src/core/user_script.cpp2
-rw-r--r--src/core/web_contents_adapter.cpp57
-rw-r--r--src/core/web_contents_adapter.h1
-rw-r--r--src/core/web_contents_delegate_qt.cpp20
-rw-r--r--src/core/web_contents_delegate_qt.h4
-rw-r--r--src/core/web_contents_view_qt.h2
-rw-r--r--src/core/web_engine_context.cpp49
-rw-r--r--src/core/web_engine_context.h3
-rw-r--r--src/core/web_engine_library_info.cpp2
-rw-r--r--src/core/web_engine_library_info.h3
-rw-r--r--src/core/web_engine_settings.cpp3
-rw-r--r--src/core/web_event_factory.cpp6
-rw-r--r--src/core/web_usb_detector_qt.cpp1
-rw-r--r--src/gn/CMakeLists.txt4
-rw-r--r--src/ninja/CMakeLists.txt4
-rw-r--r--src/pdf/CMakeLists.txt5
-rw-r--r--src/pdf/config/common.pri78
-rw-r--r--src/pdf/config/ios.pri66
-rw-r--r--src/pdf/configure.json64
-rw-r--r--src/pdf/doc/qtpdf.qdocconf15
-rw-r--r--src/pdf/doc/src/qtpdf-index.qdoc6
-rw-r--r--src/pdf/gn_run.pro69
-rw-r--r--src/pdf/pdf.pro31
-rw-r--r--src/pdf/pdfcore.pro87
-rw-r--r--src/pdf/pdfcore_generator.pro15
-rw-r--r--src/pdf/pdfcore_prl_generator.pro27
-rw-r--r--src/pdf/plugins/imageformats/pdf/main.cpp25
-rw-r--r--src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp25
-rw-r--r--src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h25
-rw-r--r--src/pdf/qpdfbookmarkmodel.cpp27
-rw-r--r--src/pdf/qpdfbookmarkmodel.h29
-rw-r--r--src/pdf/qpdfdestination.cpp25
-rw-r--r--src/pdf/qpdfdestination.h26
-rw-r--r--src/pdf/qpdfdestination_p.h27
-rw-r--r--src/pdf/qpdfdocument.cpp27
-rw-r--r--src/pdf/qpdfdocument.h28
-rw-r--r--src/pdf/qpdfdocument_p.h25
-rw-r--r--src/pdf/qpdfdocumentrenderoptions.h49
-rw-r--r--src/pdf/qpdfdocumentrenderoptions.qdoc37
-rw-r--r--src/pdf/qpdflinkmodel.cpp25
-rw-r--r--src/pdf/qpdflinkmodel_p.h25
-rw-r--r--src/pdf/qpdflinkmodel_p_p.h25
-rw-r--r--src/pdf/qpdfnamespace.h28
-rw-r--r--src/pdf/qpdfnamespace.qdoc25
-rw-r--r--src/pdf/qpdfpagenavigation.cpp25
-rw-r--r--src/pdf/qpdfpagenavigation.h28
-rw-r--r--src/pdf/qpdfpagerenderer.cpp25
-rw-r--r--src/pdf/qpdfpagerenderer.h28
-rw-r--r--src/pdf/qpdfsearchmodel.cpp27
-rw-r--r--src/pdf/qpdfsearchmodel.h30
-rw-r--r--src/pdf/qpdfsearchmodel_p.h25
-rw-r--r--src/pdf/qpdfsearchresult.cpp25
-rw-r--r--src/pdf/qpdfsearchresult.h26
-rw-r--r--src/pdf/qpdfsearchresult_p.h27
-rw-r--r--src/pdf/qpdfselection.cpp34
-rw-r--r--src/pdf/qpdfselection.h26
-rw-r--r--src/pdf/qpdfselection_p.h27
-rw-r--r--src/pdf/qtpdfglobal.h25
-rw-r--r--src/pdf/quick/quick.pro40
-rw-r--r--src/pdf/quick/resources.qrc10
-rw-r--r--src/pdfquick/plugin.cpp25
-rw-r--r--src/pdfquick/qml/+material/PdfStyle.qml25
-rw-r--r--src/pdfquick/qml/+universal/PdfStyle.qml25
-rw-r--r--src/pdfquick/qml/PdfMultiPageView.qml25
-rw-r--r--src/pdfquick/qml/PdfPageView.qml25
-rw-r--r--src/pdfquick/qml/PdfScrollablePageView.qml25
-rw-r--r--src/pdfquick/qml/PdfStyle.qml25
-rw-r--r--src/pdfquick/qquickpdfdocument.cpp36
-rw-r--r--src/pdfquick/qquickpdfdocument_p.h26
-rw-r--r--src/pdfquick/qquickpdflinkmodel.cpp34
-rw-r--r--src/pdfquick/qquickpdflinkmodel_p.h26
-rw-r--r--src/pdfquick/qquickpdfnavigationstack.cpp58
-rw-r--r--src/pdfquick/qquickpdfnavigationstack_p.h26
-rw-r--r--src/pdfquick/qquickpdfsearchmodel.cpp41
-rw-r--r--src/pdfquick/qquickpdfsearchmodel_p.h26
-rw-r--r--src/pdfquick/qquickpdfselection.cpp35
-rw-r--r--src/pdfquick/qquickpdfselection_p.h26
-rw-r--r--src/pdfquick/qquicktableviewextra.cpp32
-rw-r--r--src/pdfquick/qquicktableviewextra_p.h28
-rw-r--r--src/pdfwidgets/configure.json28
-rw-r--r--src/pdfwidgets/pdfwidgets.pro13
-rw-r--r--src/pdfwidgets/qpdfview.cpp25
-rw-r--r--src/pdfwidgets/qpdfview.h28
-rw-r--r--src/pdfwidgets/qpdfview_p.h25
-rw-r--r--src/pdfwidgets/qtpdfwidgetsglobal.h25
-rw-r--r--src/plugins/imageformats/imageformats.pro2
-rw-r--r--src/plugins/imageformats/pdf/pdf.pro13
-rw-r--r--src/plugins/plugins.pro3
-rw-r--r--src/plugins/qwebengineview/qwebengineview.pro11
-rw-r--r--src/plugins/qwebengineview/qwebengineview_plugin.qrc5
-rw-r--r--src/process/CMakeLists.txt17
-rw-r--r--src/process/main.cpp8
-rw-r--r--src/process/process.pro78
-rw-r--r--src/src.pro65
-rw-r--r--src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro55
-rw-r--r--src/webenginequick/CMakeLists.txt4
-rw-r--r--src/webenginequick/api/qquickwebenginefaviconprovider.cpp4
-rw-r--r--src/webenginequick/api/qquickwebenginetouchselectionmenurequest.cpp140
-rw-r--r--src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p.h102
-rw-r--r--src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p_p.h79
-rw-r--r--src/webenginequick/api/qquickwebengineview.cpp17
-rw-r--r--src/webenginequick/api/qquickwebengineview_p.h2
-rw-r--r--src/webenginequick/configure.cmake5
-rw-r--r--src/webenginequick/configure.json34
-rw-r--r--src/webenginequick/doc/src/touch_selection_menu_request.qdoc103
-rw-r--r--src/webenginequick/doc/src/webengineview_lgpl.qdoc4
-rw-r--r--src/webenginequick/module.pro78
-rw-r--r--src/webenginequick/ui/ui.pro20
-rw-r--r--src/webenginequick/ui_delegates_manager.h2
-rw-r--r--src/webenginequick/webenginequick.pro12
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp38
-rw-r--r--src/webenginewidgets/api/qwebengineview_p.h1
-rw-r--r--src/webenginewidgets/configure.json28
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp4
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h1
-rw-r--r--src/webenginewidgets/webenginewidgets.pro26
-rw-r--r--tests/auto/core/origins/tst_origins.cpp201
-rw-r--r--tests/auto/pdf/qpdfbookmarkmodel/tst_qpdfbookmarkmodel.cpp25
-rw-r--r--tests/auto/pdf/qpdfdocument/tst_qpdfdocument.cpp25
-rw-r--r--tests/auto/pdf/qpdfpagenavigation/tst_qpdfpagenavigation.cpp25
-rw-r--r--tests/auto/pdf/qpdfpagerenderer/tst_qpdfpagerenderer.cpp25
-rw-r--r--tests/auto/pdf/qpdfsearchmodel/tst_qpdfsearchmodel.cpp25
-rw-r--r--tests/auto/quick/certificateerror/CMakeLists.txt26
-rw-r--r--tests/auto/quick/certificateerror/resources/server.key27
-rw-r--r--tests/auto/quick/certificateerror/resources/server.pem41
-rw-r--r--tests/auto/quick/publicapi/tst_publicapi.cpp9
-rw-r--r--tests/auto/quick/qmltests/BLACKLIST3
-rw-r--r--tests/auto/quick/qmltests/data/tst_certificateError.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_desktopBehaviorLoadHtml.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_geopermission.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_getUserMedia.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_notification.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_unhandledKeyEventPropagation.qml8
-rw-r--r--tests/auto/quick/qmltests/data/tst_userScripts.qml2
-rw-r--r--tests/auto/quick/qmltests/data/tst_viewSource.qml2
-rw-r--r--tests/auto/quick/qquickwebengineviewgraphics/tst_qquickwebengineviewgraphics.cpp8
-rw-r--r--tests/auto/widgets/accessibility/tst_accessibility.cpp4
-rw-r--r--tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp4
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp3
-rw-r--r--tests/auto/widgets/qwebenginescript/tst_qwebenginescript.cpp31
-rw-r--r--tests/auto/widgets/spellchecking/CMakeLists.txt32
-rwxr-xr-xtools/buildscripts/qtwebengine_utils.py2
-rwxr-xr-xtools/buildscripts/repack_locales.py2
-rw-r--r--tools/scripts/git_submodule.py28
-rwxr-xr-xtools/scripts/init-repository.py11
-rwxr-xr-xtools/scripts/take_snapshot.py73
-rw-r--r--tools/scripts/version_resolver.py8
358 files changed, 4049 insertions, 7771 deletions
diff --git a/CHROMIUM_VERSION b/CHROMIUM_VERSION
index 2916402f..f25d9a25 100644
--- a/CHROMIUM_VERSION
+++ b/CHROMIUM_VERSION
@@ -1,3 +1,3 @@
-Based on Chromium version: 90.0.4430.228
-Patched with security patches up to Chromium version: 93.0.4577.63
+Based on Chromium version: 94.0.4606.126
+Patched with security patches up to Chromium version: 94.0.4606.126
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4202eaee..b0a0c7ff 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.19)
include(.cmake.conf)
include(ExternalProject)
include(cmake/Functions.cmake)
+include(src/core/api/Qt6WebEngineCoreMacros.cmake)
project(QtWebEngine
VERSION "${QT_REPO_MODULE_VERSION}"
@@ -16,5 +17,15 @@ find_package(Qt6 ${PROJECT_VERSION} CONFIG QUIET OPTIONAL_COMPONENTS
Gui Widgets Network OpenGL Quick Qml PrintSupport
WebChannel Positioning QuickControls2 Test QuickWidgets QuickTest WebSockets Designer
)
-set(WEBENGINE_MODULE_BUILD TRUE)
+
+if(MATRIX_BUILD AND NOT MATRIX_SUBBUILD AND NOT QT_SUPERBUILD)
+ add_build(webengine_webrtc OFF)
+ add_build(webengine_proprietary_codecs ON)
+ add_build(webengine_printing_and_pdf OFF)
+ add_build(webengine_extensions OFF)
+ add_build(webengine_spellchecker OFF)
+ add_build(qtwebengine_build OFF)
+ return()
+endif()
+
qt_build_repo()
diff --git a/LICENSE.GPLv3 b/LICENSE.GPLv3
deleted file mode 100644
index 71c4ad49..00000000
--- a/LICENSE.GPLv3
+++ /dev/null
@@ -1,686 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
-
- The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
- Contact: http://www.qt.io/licensing/
-
- You may use, distribute and copy the Qt Toolkit under the terms of
- GNU Lesser General Public License version 3. That license references
- the General Public License version 3, that is displayed below. Other
- portions of the Qt Toolkit may be licensed directly under this license.
-
--------------------------------------------------------------------------
-
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/LICENSE.LGPLv3 b/LICENSE.LGPLv3
deleted file mode 100644
index e200fb5b..00000000
--- a/LICENSE.LGPLv3
+++ /dev/null
@@ -1,174 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
-
- The Qt Toolkit is Copyright (C) 2015 The Qt Company Ltd.
- Contact: http://www.qt.io/licensing/
-
- You may use, distribute and copy the Qt Toolkit under the terms of
- GNU Lesser General Public License version 3, which is displayed below.
- This license makes reference to the version 3 of the GNU General
- Public License, which you can find in the LICENSE.GPLv3 file.
-
--------------------------------------------------------------------------
-
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
-Everyone is permitted to copy and distribute verbatim copies of this
-licensedocument, but changing it is not allowed.
-
-This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
-0. Additional Definitions.
-
- As used herein, “this License” refers to version 3 of the GNU Lesser
-General Public License, and the “GNU GPL” refers to version 3 of the
-GNU General Public License.
-
- “The Library” refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An “Application” is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A “Combined Work” is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the “Linked
-Version”.
-
- The “Minimal Corresponding Source” for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The “Corresponding Application Code” for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
-1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
-2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort
- to ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
-3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this
- license document.
-
-4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that, taken
-together, effectively do not restrict modification of the portions of
-the Library contained in the Combined Work and reverse engineering for
-debugging such modifications, if you also do each of the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this
- license document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of
- this License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with
- the Library. A suitable mechanism is one that (a) uses at run
- time a copy of the Library already present on the user's
- computer system, and (b) will operate properly with a modified
- version of the Library that is interface-compatible with the
- Linked Version.
-
- e) Provide Installation Information, but only if you would
- otherwise be required to provide such information under section 6
- of the GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the Application
- with a modified version of the Linked Version. (If you use option
- 4d0, the Installation Information must accompany the Minimal
- Corresponding Source and Corresponding Application Code. If you
- use option 4d1, you must provide the Installation Information in
- the manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.)
-
-5. Combined Libraries.
-
- You may place library facilities that are a work based on the Library
-side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work
- based on the Library, uncombined with any other library
- facilities, conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of
- it is a work based on the Library, and explaining where to find
- the accompanying uncombined form of the same work.
-
-6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number. If the Library
-as you received it specifies that a certain numbered version of the
-GNU Lesser General Public License “or any later version” applies to
-it, you have the option of following the terms and conditions either
-of that published version or of any later version published by the
-Free Software Foundation. If the Library as you received it does not
-specify a version number of the GNU Lesser General Public License,
-you may choose any version of the GNU Lesser General Public License
-ever published by the Free Software Foundation.
-
-If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the Library.
diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
index 05f83ddf..07791e0e 100644
--- a/cmake/Functions.cmake
+++ b/cmake/Functions.cmake
@@ -76,6 +76,11 @@ function(get_qt_features outList module)
endfunction()
function(create_cxx_config cmakeTarget arch configFileName)
+ if(NOT QT_SUPERBUILD AND QT_WILL_INSTALL)
+ get_target_property(mocFilePath Qt6::moc IMPORTED_LOCATION)
+ else()
+ set(mocFilePath "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/moc${CMAKE_EXECUTABLE_SUFFIX}")
+ endif()
file(GENERATE
OUTPUT $<CONFIG>/${arch}/${configFileName}
CONTENT "\
@@ -83,7 +88,7 @@ function(create_cxx_config cmakeTarget arch configFileName)
set(GN_DEFINES \"$<TARGET_PROPERTY:COMPILE_DEFINITIONS>\")\n\
set(GN_LINK_OPTIONS \"$<TARGET_PROPERTY:LINK_OPTIONS>\")\n\
set(GN_CXX_COMPILE_OPTIONS \"$<TARGET_PROPERTY:COMPILE_OPTIONS>\")\n\
- set(GN_MOC_PATH \"$<TARGET_FILE:Qt::moc>\")"
+ set(GN_MOC_PATH \"${mocFilePath}\")"
# set(GN_LIBS $<TARGET_PROPERTY:LINK_LIBRARIES>)
CONDITION $<COMPILE_LANGUAGE:CXX>
TARGET ${cmakeTarget}
@@ -424,16 +429,21 @@ function(add_rsp_command target buildDir)
add_custom_command(
OUTPUT ${buildDir}/${cmakeTarget}.a
BYPRODUCTS
- ${buildDir}/${cmakeTarget}.o
+ ${buildDir}/${cmakeTarget}_objs.o
+ ${buildDir}/${cmakeTarget}_arcs.o
COMMAND clang++ -r -nostdlib -arch ${arch}
- -o ${buildDir}/${cmakeTarget}.o
+ -o ${buildDir}/${cmakeTarget}_objs.o
-Wl,-keep_private_externs
@${buildDir}/${ninjaTarget}_objects.rsp
+ COMMAND clang++ -r -nostdlib -arch ${arch}
+ -o ${buildDir}/${cmakeTarget}_arcs.o
+ -Wl,-keep_private_externs
-Wl,-all_load
@${buildDir}/${ninjaTarget}_archives.rsp
- COMMAND ar -cr
+ COMMAND ar -crs
${buildDir}/${cmakeTarget}.a
- ${buildDir}/${cmakeTarget}.o
+ ${buildDir}/${cmakeTarget}_objs.o
+ ${buildDir}/${cmakeTarget}_arcs.o
DEPENDS
${buildDir}/${ninjaTarget}.stamp
WORKING_DIRECTORY "${buildDir}/../../.."
@@ -586,6 +596,7 @@ function(extract_cflag result cflag)
math(EXPR i "${i} + 1")
endwhile()
list(APPEND cflags ${CMAKE_C_FLAGS} ${CMAKE_CXX_FLAGS})
+ string(REPLACE ";" " " cflags "${cflags}")
message(DEBUG "Found cflags: ${cflags}")
if(cflags MATCHES "-${cflag}=([^ ]+)")
set(${result} ${CMAKE_MATCH_1} PARENT_SCOPE)
@@ -719,7 +730,7 @@ macro(append_build_type_setup)
extend_gn_list(gnArgArg
ARGS enable_precompiled_headers
- CONDITION BUILD_WITH_PCH
+ CONDITION BUILD_WITH_PCH AND NOT LINUX
)
extend_gn_list(gnArgArg
ARGS dcheck_always_on
@@ -1028,6 +1039,16 @@ function(addCopyCommand target src dst)
)
endfunction()
+function(addCopyDirCommand target src dst)
+ add_custom_command(
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${src} ${dst}
+ TARGET ${target}
+ DEPENDS ${src}
+ USES_TERMINAL
+ )
+endfunction()
+
function(check_for_ulimit)
message("-- Checking 'ulimit -n'")
execute_process(COMMAND bash -c "ulimit -n"
@@ -1048,3 +1069,35 @@ function(check_for_ulimit)
endif()
endif()
endfunction()
+
+function(add_build feature value)
+ list(APPEND cmakeArgs
+ "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}"
+ "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}"
+ "-DMATRIX_SUBBUILD=ON"
+ "-DFEATURE_${feature}=${value}"
+ )
+ if(CMAKE_C_COMPILER_LAUNCHER)
+ list(APPEND cmakeArgs "-DCMAKE_C_COMPILER_LAUNCHER=${CMAKE_C_COMPILER_LAUNCHER}")
+ endif()
+ if(CMAKE_CXX_COMPILER_LAUNCHER)
+ list(APPEND cmakeArgs "-DCMAKE_CXX_COMPILER_LAUNCHER=${CMAKE_CXX_COMPILER_LAUNCHER}")
+ endif()
+
+ externalproject_add(${feature}
+ SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
+ BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${feature}-${value}
+ PREFIX ${feature}-${value}
+ CMAKE_ARGS ${cmakeArgs}
+ USES_TERMINAL_BUILD ON
+ USES_TERMINAL_CONFIGURE ON
+ BUILD_ALWAYS TRUE
+ INSTALL_COMMAND ""
+ )
+ get_property(depTracker GLOBAL PROPERTY MATRIX_DEPENDENCY_TRACKER)
+ foreach(dep ${depTracker})
+ add_dependencies(${feature} ${dep})
+ endforeach()
+ set(depTracker "${depTracker}" ${feature})
+ set_property(GLOBAL PROPERTY MATRIX_DEPENDENCY_TRACKER "${depTracker}")
+endfunction()
diff --git a/cmake/Gn.cmake b/cmake/Gn.cmake
index e8dc956e..adeae39f 100644
--- a/cmake/Gn.cmake
+++ b/cmake/Gn.cmake
@@ -15,8 +15,10 @@ include(${WEBENGINE_ROOT_SOURCE_DIR}/cmake/Functions.cmake)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
find_package(Gn ${QT_REPO_MODULE_VERSION} EXACT)
-find_package(Python2 2.7.5 REQUIRED)
-
+find_program(Python3_EXECUTABLE NAMES python3 HINTS $ENV{PYTHON3_PATH})
+if(NOT Python3_EXECUTABLE)
+ find_package(Python3 3.6 REQUIRED)
+endif()
set(gnCmd ${Gn_EXECUTABLE})
set(buildDir ${BUILD_DIR})
set(sourceDir ${SOURCE_DIR})
@@ -39,7 +41,7 @@ configure_gn_target(
)
list(APPEND gnArg
- --script-executable=${Python2_EXECUTABLE}
+ --script-executable=${Python3_EXECUTABLE}
--root=${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/chromium)
STRING(REGEX REPLACE "\n" ";" printArgArg "${gnArgArg}")
diff --git a/coin/module_config.yaml b/coin/module_config.yaml
index 741558a5..e6041251 100644
--- a/coin/module_config.yaml
+++ b/coin/module_config.yaml
@@ -22,3 +22,4 @@ instructions:
property: target.osVersion
equals_value: QEMU
- !include "{{qt/qtbase}}/coin_module_test_template_v3.yaml"
+ - !include "{{qt/qtbase}}/coin_module_test_docs.yaml"
diff --git a/configure.cmake b/configure.cmake
index 172831c6..397f51f7 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -7,13 +7,16 @@ if(QT_CONFIGURE_RUNNING)
else()
find_package(Ninja 1.7.2)
find_package(Gn ${QT_REPO_MODULE_VERSION} EXACT)
- find_package(Python2 2.7.5)
+ find_program(Python3_EXECUTABLE NAMES python3 HINTS $ENV{PYTHON3_PATH})
+ if(NOT Python3_EXECUTABLE)
+ find_package(Python3 3.6)
+ endif()
find_package(GPerf)
find_package(BISON)
find_package(FLEX)
find_package(PkgConfig)
find_package(Snappy)
- find_package(Nodejs 10.19)
+ find_package(Nodejs 12.0)
endif()
if(PkgConfig_FOUND)
@@ -48,6 +51,14 @@ if(PkgConfig_FOUND)
pkg_check_modules(LIBPCI libpci)
endif()
+if(Python3_EXECUTABLE)
+ execute_process(
+ COMMAND ${Python3_EXECUTABLE} -c "import html5lib"
+ RESULT_VARIABLE html5lib_NOT_FOUND
+ OUTPUT_QUIET
+ )
+endif()
+
#### Tests
if(LINUX)
check_for_ulimit()
@@ -189,42 +200,46 @@ int main(void){
#### Features
-qt_feature("qtwebengine-build" PRIVATE
- LABEL "Build Qt WebEngine"
+qt_feature("qtwebengine-build" PUBLIC
+ LABEL "Build QtWebEngine Modules"
PURPOSE "Enables building the Qt WebEngine modules."
)
+qt_feature("qtwebengine-core-build" PRIVATE
+ LABEL "Build QtWebEngineCore"
+ PURPOSE "Enables building the Qt WebEngineCore module."
+ CONDITION QT_FEATURE_qtwebengine_build
+)
qt_feature("qtwebengine-widgets-build" PRIVATE
- LABEL "Build Qt WebEngineWidgets"
+ LABEL "Build QtWebEngineWidgets"
PURPOSE "Enables building the Qt WebEngineWidgets module."
- CONDITION TARGET Qt::Widgets
+ CONDITION TARGET Qt::Widgets AND QT_FEATURE_qtwebengine_build
)
qt_feature("qtwebengine-quick-build" PRIVATE
- LABEL "Build Qt WebEngineQuick"
+ LABEL "Build QtWebEngineQuick"
PURPOSE "Enables building the Qt WebEngineQuick module."
- CONDITION TARGET Qt::Quick AND TARGET Qt::Qml
+ CONDITION TARGET Qt::Quick AND TARGET Qt::Qml AND QT_FEATURE_qtwebengine_build
)
-qt_feature("qtpdf-build" PRIVATE
+qt_feature("qtpdf-build" PUBLIC
LABEL "Build Qt PDF"
PURPOSE "Enables building the Qt Pdf modules."
)
qt_feature("qtpdf-widgets-build" PRIVATE
- LABEL "Build Qt PdfWidgets"
+ LABEL "Build QtPdfWidgets"
PURPOSE "Enables building the Qt Pdf module."
- CONDITION TARGET Qt::Widgets
+ CONDITION TARGET Qt::Widgets AND QT_FEATURE_qtpdf_build
)
qt_feature("qtpdf-quick-build" PRIVATE
- LABEL "Build Qt PdfQuick"
- PURPOSE "Enables building the Qt Pdf module."
- CONDITION TARGET Qt::Quick AND TARGET Qt::Qml
+ LABEL "Build QtPdfQuick"
+ PURPOSE "Enables building the QtPdfQuick module."
+ CONDITION TARGET Qt::Quick AND TARGET Qt::Qml AND QT_FEATURE_qtpdf_build
)
qt_feature("webengine-system-ninja" PRIVATE
- LABEL "Use system ninja"
- CONDITION Ninja_FOUND
+ LABEL "Build Ninja"
+ AUTODETECT NOT Ninja_FOUND OR Ninja_EXECUTABLE MATCHES ${WEBENGINE_ROOT_BUILD_DIR}
)
qt_feature("webengine-system-gn" PRIVATE
- LABEL "Use system gn"
- AUTODETECT FALSE
- CONDITION Gn_FOUND
+ LABEL "Build Gn"
+ AUTODETECT NOT Gn_FOUND OR Gn_EXECUTABLE MATCHES ${WEBENGINE_ROOT_BUILD_DIR}
)
# default assumed merge limit (should match the one in qt_cmdline.cmake)
set(jumbo_merge_limit 8)
@@ -376,12 +391,17 @@ add_check_for_support(
add_check_for_support(
MODULES QtWebEngine QtPdf
CONDITION TARGET Nodejs::Nodejs
- MESSAGE "node.js version 10.19 or later is required."
+ MESSAGE "node.js version 12 or later is required."
)
add_check_for_support(
MODULES QtWebEngine QtPdf
- CONDITION Python2_FOUND
- MESSAGE "Python2 version 2.7.5 or later is required."
+ CONDITION Python3_EXECUTABLE
+ MESSAGE "Python version 3.6 or later is required."
+)
+add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION Python3_EXECUTABLE AND NOT html5lib_NOT_FOUND
+ MESSAGE "Python3 html5lib is missing."
)
add_check_for_support(
MODULES QtWebEngine QtPdf
@@ -460,14 +480,35 @@ add_check_for_support(
MESSAGE "${CMAKE_CXX_COMPILER_ID} compiler is not supported."
)
+if(WIN32)
+ set(windowsSdkVersion $ENV{WindowsSDKVersion})
+ string(REGEX REPLACE "([0-9.]+).*" "\\1" windowsSdkVersion "${windowsSdkVersion}")
+ string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" sdkMinor "${windowsSdkVersion}")
+ message("-- Windows 10 SDK version: ${windowsSdkVersion}")
+ add_check_for_support(
+ MODULES QtWebEngine QtPdf
+ CONDITION sdkMinor GREATER_EQUAL 19041
+ MESSAGE "Build requires Windows 10 SDK at least version 10.0.19041.0"
+ )
+endif()
+
#### Summary
# > Qt WebEngine Build Features
-qt_configure_add_summary_section(NAME "Qt WebEngine")
+qt_configure_add_summary_section(NAME "WebEngine Repository Build Options")
qt_configure_add_summary_entry(ARGS "webengine-system-ninja")
qt_configure_add_summary_entry(ARGS "webengine-system-gn")
qt_configure_add_summary_entry(ARGS "webengine-jumbo-build")
qt_configure_add_summary_entry(ARGS "webengine-developer-build")
+qt_configure_add_summary_section(NAME "Build QtWebEngine Modules")
+qt_configure_add_summary_entry(ARGS "qtwebengine-core-build")
+qt_configure_add_summary_entry(ARGS "qtwebengine-widgets-build")
+qt_configure_add_summary_entry(ARGS "qtwebengine-quick-build")
+qt_configure_end_summary_section()
+qt_configure_add_summary_section(NAME "Build QtPdf Modules")
+qt_configure_add_summary_entry(ARGS "qtpdf-widgets-build")
+qt_configure_add_summary_entry(ARGS "qtpdf-quick-build")
+qt_configure_end_summary_section()
# >> Optional system libraries
if(UNIX)
qt_configure_add_summary_section(NAME "Optional system libraries")
diff --git a/configure.pri b/configure.pri
deleted file mode 100644
index 02885ea5..00000000
--- a/configure.pri
+++ /dev/null
@@ -1,558 +0,0 @@
-include(src/buildtools/config/support.pri)
-include(src/buildtools/config/functions.pri)
-
-# this must be done outside any function
-QTWEBENGINE_SOURCE_TREE = $$PWD
-
-equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe
-
-defineTest(isPythonVersionSupported) {
- python = $$system_quote($$system_path($$1))
- python_version = $$system('$$python -c "import sys; print(sys.version_info[0:3])"')
- python_version ~= s/[()]//g
- python_version = $$split(python_version, ',')
- python_major_version = $$first(python_version)
- greaterThan(python_major_version, 2) {
- qtLog("Python version 3 is not supported by Chromium.")
- return(false)
- }
- python_minor_version = $$member(python_version, 1)
- python_patch_version = $$member(python_version, 2)
- greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true)
- qtLog("Unsupported python version: $${python_major_version}.$${python_minor_version}.$${python_patch_version}.")
- return(false)
-}
-
-defineTest(qtConfTest_detectJumboBuild) {
- mergeLimit = $$eval(config.input.merge_limit)
- mergeLimit = $$find(mergeLimit, "\\d")
- isEmpty(mergeLimit) {
- win32: mergeLimit = 0
- else: mergeLimit = 8
- }
- qtLog("Setting jumbo build merge batch limit to $${mergeLimit}.")
- $${1}.merge_limit = $$mergeLimit
- export($${1}.merge_limit)
- $${1}.cache += merge_limit
- export($${1}.cache)
-
- return(true)
-}
-
-defineTest(qtConfReport_skipBuildWarning) {
- $${1}()
- !isEmpty(skipBuildReason):qtConfAddWarning($${skipBuildReason})
-}
-
-defineTest(qtConfReport_jumboBuild) {
- mergeLimit = $$eval(cache.webengine-jumbo-build.merge_limit)
- isEmpty(mergeLimit)|!greaterThan(mergeLimit,0) {
- mergeLimit = "no"
- }
- qtConfReportPadded($${1}, $$mergeLimit)
-}
-
-defineTest(qtConfTest_detectPython2) {
- python = $$qtConfFindInPath("python2$$EXE_SUFFIX")
- isEmpty(python) {
- qtLog("'python2$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.")
- python = $$qtConfFindInPath("python$$EXE_SUFFIX")
- }
- isEmpty(python) {
- qtLog("'python$$EXE_SUFFIX' not found in PATH. Giving up.")
- return(false)
- }
- !isPythonVersionSupported($$python) {
- qtLog("A suitable Python 2 executable could not be located.")
- return(false)
- }
-
- # Make tests.python2.location available in configure.json.
- $${1}.location = $$clean_path($$python)
- export($${1}.location)
- $${1}.cache += location
- export($${1}.cache)
-
- return(true)
-}
-
-defineReplace(qtConfFindGnuTool) {
- equals(QMAKE_HOST.os, Windows) {
- gnuwin32bindir = $$absolute_path($$QTWEBENGINE_SOURCE_TREE/../gnuwin32/bin)
- gnuwin32toolpath = "$$gnuwin32bindir/$${1}"
- exists($$gnuwin32toolpath): \
- return($$gnuwin32toolpath)
- }
- return($$qtConfFindInPath($$1))
-}
-
-defineTest(qtConfTest_detectGperf) {
- gperf = $$qtConfFindGnuTool("gperf$$EXE_SUFFIX")
- isEmpty(gperf) {
- qtLog("Required gperf could not be found.")
- return(false)
- }
- qtLog("Found gperf from path: $$gperf")
- return(true)
-}
-
-defineTest(qtConfTest_detectBison) {
- bison = $$qtConfFindGnuTool("bison$$EXE_SUFFIX")
- isEmpty(bison) {
- qtLog("Required bison could not be found.")
- return(false)
- }
- qtLog("Found bison from path: $$bison")
- return(true)
-}
-
-defineTest(qtwebengine_platformError) {
- platformError = $$1
- export(platformError)
-}
-
-defineTest(qtConfTest_detectPlatform) {
- QT_FOR_CONFIG += gui-private
-
- linux:qtwebengine_isLinuxPlatformSupported() {
- $${1}.platform = "linux"
- }
- win32:qtwebengine_isWindowsPlatformSupported() {
- $${1}.platform = "windows"
- }
- macos:qtwebengine_isMacOsPlatformSupported() {
- $${1}.platform = "macos"
- }
- ios:qtwebengine_isMacOsPlatformSupported() {
- $${1}.platform = "ios"
- }
-
- !isEmpty(platformError) {
- qtLog("Platform not supported.")
- $${1}.platformSupport = $$platformError
- export($${1}.platformSupport)
- $${1}.cache += platformSupport
- export($${1}.cache)
- return(false)
- }
- export($${1}.platformSupport)
- return(true)
-}
-
-defineTest(qtConfTest_detectArch) {
- contains(QT_ARCH, "i386")|contains(QT_ARCH, "x86_64"): return(true)
- contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true)
- contains(QT_ARCH, "mips"): return(true)
- contains(QT_ARCH, "mips64"): return(true)
- qtLog("Architecture not supported.")
- return(false)
-}
-
-defineTest(qtConfTest_detectFlex) {
- flex = $$qtConfFindGnuTool("flex$$EXE_SUFFIX")
- isEmpty(flex) {
- qtLog("Required flex could not be found.")
- return(false)
- }
- qtLog("Found flex from path: $$flex")
- return(true)
-}
-
-defineTest(qtConfTest_detectNinja) {
- ninja = $$qtConfFindInPath($$(NINJA) "ninja$$EXE_SUFFIX")
- !isEmpty(ninja) {
- qtLog("Found ninja from path: $$ninja")
- qtRunLoggedCommand("$$ninja --version", version)|return(false)
- contains(version, "1\.([7-9]|1[0-9])\..*") {
- $${1}.path = $$ninja
- export($${1}.path)
- $${1}.cache += path
- export($${1}.cache)
- return(true)
- }
- qtLog("Ninja version too old")
- }
- qtLog("Building own ninja")
- return(false)
-}
-
-defineTest(qtConfTest_detectGn) {
- gn = $$qtConfFindInPath("gn$$EXE_SUFFIX")
- !isEmpty(gn) {
- qtRunLoggedCommand("$$gn --version", version)|return(false)
- #accept all for now
- contains(version, ".*"): return(true)
- qtLog("Gn version too old")
- }
- qtLog("Building own gn")
- return(false)
-}
-
-defineTest(qtConfTest_detectNodeJS) {
- nodejs = $$qtConfFindInPath("nodejs$$EXE_SUFFIX")
- isEmpty(nodejs) {
- qtLog("'nodejs$$EXE_SUFFIX' not found in PATH. Checking for 'node$$EXE_SUFFIX'.")
- nodejs = $$qtConfFindInPath("node$$EXE_SUFFIX")
- isEmpty(nodejs) {
- qtLog("'node$$EXE_SUFFIX' not found in PATH. Giving up.")
- return(false)
- }
- }
- nodejs = $$system_quote($$system_path($$nodejs))
- !qtRunLoggedCommand("$$nodejs --version", version) {
- qtLog("'$$nodejs' didn't run.")
- return(false)
- }
- # at least version 10
- version10 = false
- contains(version, "v([1-9][0-9])\..*"): version10 = true
-
- $${1}.version10 = $$version10
- export($${1}.version10)
- $${1}.cache += version10
- export($${1}.cache)
- return(true)
-}
-
-defineTest(qtConfTest_detectEmbedded) {
- lessThan(QT_MINOR_VERSION, 9) {
- cross_compile: return(true)
- return(false)
- }
- $$qtConfEvaluate("features.cross_compile"): return(true)
- return(false)
-}
-
-defineTest(qtConfTest_detectHostPkgConfig) {
- PKG_CONFIG = $$qtConfPkgConfig(true)
- isEmpty(PKG_CONFIG) {
- qtLog("Could not find host pkg-config")
- return(false)
- }
- qtLog("Found host pkg-config: $$PKG_CONFIG")
- $${1}.path = $$PKG_CONFIG
- export($${1}.path)
- $${1}.cache += path
- export($${1}.cache)
- return(true)
-}
-
-defineTest(qtConfTest_isSanitizerSupported) {
- sanitizer_combo_supported = true
-
- sanitize_address {
- asan_supported = false
- linux-clang-libc++:isSanitizerSupportedOnLinux() {
- asan_supported = true
- } else:macos:isSanitizerSupportedOnMacOS() {
- asan_supported = true
- }
- !$$asan_supported {
- sanitizer_combo_supported = false
- qtLog("An address sanitizer-enabled Qt WebEngine build can only be built on Linux or macOS using Clang and libc++.")
- }
- }
-
- sanitize_memory {
- sanitizer_combo_supported = false
- qtLog("A memory sanitizer-enabled Qt WebEngine build is not supported.")
- }
-
- sanitize_undefined {
- ubsan_supported = false
- CONFIG(release, debug|release):!debug_and_release {
- linux-clang-libc++:isSanitizerSupportedOnLinux() {
- ubsan_supported = true
- } else:macos:isSanitizerSupportedOnMacOS() {
- ubsan_supported = true
- }
- }
- !$$ubsan_supported {
- sanitizer_combo_supported = false
- qtLog("An undefined behavior sanitizer-enabled Qt WebEngine build can only be built on Linux or macOS using Clang and libc++ in release mode.")
- }
- }
-
- sanitize_thread {
- tsan_supported = false
- linux-clang-libc++:isSanitizerSupportedOnLinux() {
- tsan_supported = true
- }
- !$$tsan_supported {
- sanitizer_combo_supported = false
- qtLog("A thread sanitizer-enabled Qt WebEngine build can only be built on Linux using Clang and libc++.")
- }
- }
-
- $$sanitizer_combo_supported: return(true)
- return(false)
-}
-
-defineTest(isSanitizerSupportedOnLinux) {
- isSanitizerLinuxClangVersionSupported(): return(true)
- return(false)
-}
-
-defineTest(isSanitizerSupportedOnMacOS) {
- isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION) {
- QTWEBENGINE_CLANG_IS_APPLE = false
- } else {
- QTWEBENGINE_CLANG_IS_APPLE = true
- }
-
- $$QTWEBENGINE_CLANG_IS_APPLE:isSanitizerMacOSAppleClangVersionSupported(): return(true)
- else:isSanitizerMacOSClangVersionSupported(): return(true)
- return(false)
-}
-
-defineTest(isSanitizerMacOSAppleClangVersionSupported) {
- # Clang sanitizer suppression attributes work from Apple Clang version 7.3.0+.
- greaterThan(QMAKE_APPLE_CLANG_MAJOR_VERSION, 7): return(true)
- greaterThan(QMAKE_APPLE_CLANG_MINOR_VERSION, 2): return(true)
-
- qtLog("Using Apple Clang version $${QMAKE_APPLE_CLANG_MAJOR_VERSION}.$${QMAKE_APPLE_CLANG_MINOR_VERSION}.$${QMAKE_APPLE_CLANG_PATCH_VERSION}, but at least Apple Clang version 7.3.0 is required to build a sanitizer-enabled Qt WebEngine.")
- return(false)
-}
-
-defineTest(isSanitizerMacOSClangVersionSupported) {
- # Clang sanitizer suppression attributes work from non-apple Clang version 3.7+.
- greaterThan(QMAKE_CLANG_MAJOR_VERSION, 3): return(true)
- greaterThan(QMAKE_CLANG_MINOR_VERSION, 6): return(true)
-
- qtLog("Using Clang version $${QMAKE_CLANG_MAJOR_VERSION}.$${QMAKE_CLANG_MINOR_VERSION}, but at least Clang version 3.7 is required to build a sanitizer-enabled Qt WebEngine.")
- return(false)
-}
-
-defineTest(isSanitizerLinuxClangVersionSupported) {
- # Clang sanitizer suppression attributes work from Clang version 3.7+.
- greaterThan(QMAKE_CLANG_MAJOR_VERSION, 3): return(true)
- greaterThan(QMAKE_CLANG_MINOR_VERSION, 6): return(true)
-
- qtLog("Using Clang version $${QMAKE_CLANG_MAJOR_VERSION}.$${QMAKE_CLANG_MINOR_VERSION}, but at least Clang version 3.7 is required to build a sanitizer-enabled Qt WebEngine.")
- return(false)
-}
-
-defineReplace(qtConfFunc_isTestsInBuildParts) {
- contains(QT_BUILD_PARTS, tests): return(true)
- return(false)
-}
-
-defineReplace(webEngineGetMacOSVersion) {
- value = $$system("sw_vers -productVersion 2>/dev/null")
- return($$value)
-}
-
-defineReplace(webEngineGetMacOSSDKVersion) {
- value = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null")
- return($$value)
-}
-
-defineReplace(webEngineGetMacOSClangVerboseVersion) {
- output = $$system("$$QMAKE_CXX --version 2>/dev/null", lines)
- value = $$first(output)
- return($$value)
-}
-
-defineTest(qtConfReport_macosToolchainVersion) {
- arg = $$2
- contains(arg, "macosVersion"): report_message = $$webEngineGetMacOSVersion()
- contains(arg, "xcodeVersion"): report_message = "$$QMAKE_XCODE_VERSION"
- contains(arg, "clangVersion"): report_message = $$webEngineGetMacOSClangVerboseVersion()
- contains(arg, "sdkVersion"): report_message = $$webEngineGetMacOSSDKVersion()
- contains(arg, "deploymentTarget"): report_message = "$$QMAKE_MACOSX_DEPLOYMENT_TARGET"
- !isEmpty(report_message): qtConfReportPadded($$1, $$report_message)
-}
-
-defineTest(qtConfTest_isWindowsHostCompiler64) {
- win_host_arch = $$(VSCMD_ARG_HOST_ARCH)
- isEmpty(win_host_arch): return(true)
- contains(win_host_arch,"x64"): return(true)
- qtLog("Required 64-bit cross-building or native toolchain was not detected.")
- return(false)
-}
-
-# Fixme QTBUG-71772
-defineTest(qtConfTest_hasThumbFlag) {
- FLAG = $$qtwebengine_extractCFlag("-mthumb")
- !isEmpty(FLAG): return(true)
- FLAG = $$qtwebengine_extractCFlag("-marm")
- !isEmpty(FLAG): return(false)
-
- MARCH = $$qtwebengine_extractCFlag("-march=.*")
- MARMV = $$replace(MARCH, "armv",)
- !isEmpty(MARMV) {
- MARMV = $$split(MARMV,)
- MARMV = $$member(MARMV, 0)
- }
- if (isEmpty(MARMV) | lessThan(MARMV, 7)): return(false)
- # no flag assume mthumb
- return(true)
-}
-
-defineTest(qtConfTest_detectSubmodule) {
- isEmpty(QTWEBENGINE_ROOT) {
- # topLevel build , add poor man's workaround
- QTWEBENGINE_ROOT=$$PWD/../../../qtwebengine
- }
- !exists($$QTWEBENGINE_ROOT/src/3rdparty/chromium):return(false)
- return(true)
-}
-
-defineTest(qtConfTest_detectNoWhitespace) {
- WSPC = $$find(OUT_PWD, \\s)
- !isEmpty(WSPC):return(false)
- return(true)
-}
-
-defineTest(qtwebengine_confCheckWebEngineCoreError) {
- QT_FOR_CONFIG += buildtools-private gui-private
- return($$qtwebengine_checkWebEngineCoreError())
-}
-
-defineTest(qtwebengine_confCheckPdfError) {
- QT_FOR_CONFIG += buildtools-private gui-private
- return($$qtwebengine_checkPdfError())
-}
-
-defineTest(qtwebengine_isLinuxPlatformSupported) {
- !gcc|intel_icc {
- qtwebengine_platformError("requires clang or GCC.")
- return(false)
- }
- gcc:!clang:!qtwebengine_isGCCVersionSupported(): return(false)
- gcc:!qtConfig(c++14) {
- qtwebengine_platformError("requires c++14 support.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_isWindowsPlatformSupported) {
- winrt {
- qtwebengine_platformError("for WinRT is not supported.")
- return(false)
- }
- qtwebengine_isBuildingOnWin32() {
- qtwebengine_platformError("must be built on a 64-bit machine.")
- return(false)
- }
- !msvc|intel_icl {
- qtwebengine_platformError("requires MSVC or Clang (MSVC mode).")
- return(false)
- }
- !qtwebengine_isMinWinSDKVersion(10, 19041): {
- qtwebengine_platformError("requires a Windows SDK version 10.0.19041 or newer.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_isMacOsPlatformSupported) {
- !qtwebengine_isMinXcodeVersion(10, 0, 0) {
- qtwebengine_platformError("requires at least version 10.0.0, but using Xcode version $${QMAKE_XCODE_VERSION}.")
- return(false)
- }
- !clang|intel_icc {
- qtwebengine_platformError("requires Clang.")
- return(false)
- }
- # We require macOS 10.13 (darwin version 17.0.0) or newer.
- darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0)
- lessThan(darwin_major_version, 17) {
- qtwebengine_platformError("requires macOS version 10.13 or newer.")
- return(false)
- }
- !qtwebengine_isMinOSXSDKVersion(10, 13): {
- qtwebengine_platformError("requires a macOS SDK version of 10.13 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_isGCCVersionSupported) {
- # Keep in sync with src/webenginequick/doc/src/qtwebengine-platform-notes.qdoc
- lessThan(QMAKE_GCC_MAJOR_VERSION, 5) {
- qtwebengine_platformError("requires at least gcc version 5, but using gcc version $${QMAKE_GCC_MAJOR_VERSION}.$${QMAKE_GCC_MINOR_VERSION}.")
- return(false)
- }
-
- equals(QMAKE_GCC_MAJOR_VERSION, 5): equals(QMAKE_GCC_MINOR_VERSION, 4): equals(QMAKE_GCC_PATCH_VERSION, 0) {
- qtwebengine_platformError("gcc version 5.4.0 is blacklisted due to internal compiler errors.")
- return(false)
- }
-
- return(true)
-}
-
-defineTest(qtwebengine_isBuildingOnWin32) {
- # The check below is ugly, but necessary, as it seems to be the only reliable way to detect if the host
- # architecture is 32 bit. QMAKE_HOST.arch does not work as it returns the architecture that the toolchain
- # is building for, not the system's actual architecture.
- PROGRAM_FILES_X86 = $$(ProgramW6432)
- isEmpty(PROGRAM_FILES_X86): return(true)
- return(false)
-}
-
-defineTest(qtwebengine_isMinOSXSDKVersion) {
- requested_major = $$1
- requested_minor = $$2
- requested_patch = $$3
- isEmpty(requested_patch): requested_patch = 0
- WEBENGINE_OSX_SDK_PRODUCT_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null")
- export(WEBENGINE_OSX_SDK_PRODUCT_VERSION)
- isEmpty(WEBENGINE_OSX_SDK_PRODUCT_VERSION) {
- qtwebengine_platformError("requires SDK product version, but could not resolve it for \'$$QMAKE_MAC_SDK\'.")
- return(false)
- }
- major_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 0, 0)
- minor_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 1, 1)
- patch_version = $$section(WEBENGINE_OSX_SDK_PRODUCT_VERSION, ., 2, 2)
- isEmpty(patch_version): patch_version = 0
-
- greaterThan(major_version, $$requested_major):return(true)
- equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
- equals(major_version, $$requested_major):equals(minor_version, $$requested_minor):!lessThan(patch_version, $$requested_patch):return(true)
-
- return(false)
-}
-
-defineTest(qtwebengine_isMinXcodeVersion) {
- requested_major = $$1
- requested_minor = $$2
- requested_patch = $$3
- isEmpty(requested_minor): requested_minor = 0
- isEmpty(requested_patch): requested_patch = 0
- target_var = QMAKE_XCODE_VERSION
- major_version = $$section($$target_var, ., 0, 0)
- minor_version = $$section($$target_var, ., 1, 1)
- patch_version = $$section($$target_var, ., 2, 2)
- isEmpty(minor_version): minor_version = 0
- isEmpty(patch_version): patch_version = 0
-
- greaterThan(major_version, $$requested_major):return(true)
- equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
- equals(major_version, $$requested_major):equals(minor_version, $$requested_minor):!lessThan(patch_version, $$requested_patch):return(true)
-
- return(false)
-}
-
-defineTest(qtwebengine_isMinWinSDKVersion) {
- requested_major = $$1
- requested_minor = $$2
- WIN_SDK_VERSION = $$(WindowsSDKVersion)
-
- isEmpty(WIN_SDK_VERSION)|equals(WIN_SDK_VERSION, "\\") {
- qtwebengine_platformError("requires Windows SDK version, but could not detect it (\'WindowsSDKVersion\' environment variable is not set).")
- return(false)
- }
-
- # major.0.minor
- major_version = $$section(WIN_SDK_VERSION, ., 0, 0)
- minor_version = $$section(WIN_SDK_VERSION, ., 2, 2)
-
- greaterThan(major_version, $$requested_major):return(true)
- equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true)
- equals(major_version, $$requested_major):equals(minor_version, $$requested_minor)::return(true)
-
- return(false)
-}
diff --git a/dependencies.yaml b/dependencies.yaml
index 8b6d095a..0f40fafb 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -1,13 +1,13 @@
dependencies:
../qtdeclarative:
- ref: abd488dd3ddbe769359e3b692c6e481457e87b3b
+ ref: a00c3cd3d14865941cb21c7a0e59994d14404494
required: true
- ../qtlocation:
- ref: f8c2279fa55928dc360ec57180f5547b1bfc5c51
+ ../qtpositioning:
+ ref: c5dd6c524b464916fa8db9931024b91fc0e10b51
required: false
../qttools:
- ref: 759debec7c570a6b79254e57c1d9d16ea0cb3f25
+ ref: 4a38f3be9c06c42690cf39e3f89c44f1c279fed3
required: false
../qtwebchannel:
- ref: 1ad32d4ab381e2dc59be51d3953422ec14b89beb
+ ref: 52f12fde4cdf0ddefa2eba60849f041c6f1d1c24
required: false
diff --git a/examples/pdf/multipage/CMakeLists.txt b/examples/pdf/multipage/CMakeLists.txt
index 141da88b..e89c8d23 100644
--- a/examples/pdf/multipage/CMakeLists.txt
+++ b/examples/pdf/multipage/CMakeLists.txt
@@ -48,7 +48,7 @@ set(viewer_resource_files
"viewer.qml"
)
-qt6_add_resources(multipage "viewer"
+qt_add_resources(multipage "viewer"
PREFIX
"/pdfviewer"
FILES
diff --git a/examples/pdf/pdfviewer/CMakeLists.txt b/examples/pdf/pdfviewer/CMakeLists.txt
index 8265861d..5a382139 100644
--- a/examples/pdf/pdfviewer/CMakeLists.txt
+++ b/examples/pdf/pdfviewer/CMakeLists.txt
@@ -48,7 +48,7 @@ set(viewer_resource_files
"viewer.qml"
)
-qt6_add_resources(pdfviewerquick "viewer"
+qt_add_resources(pdfviewerquick "viewer"
PREFIX
"/pdfviewer"
FILES
diff --git a/examples/pdfwidgets/pdfviewer/CMakeLists.txt b/examples/pdfwidgets/pdfviewer/CMakeLists.txt
index a530b321..692c3337 100644
--- a/examples/pdfwidgets/pdfviewer/CMakeLists.txt
+++ b/examples/pdfwidgets/pdfviewer/CMakeLists.txt
@@ -49,7 +49,7 @@ set(resources_resource_files
"images/zoom-out-32.png"
)
-qt6_add_resources(pdfviewerwidgets "resources"
+qt_add_resources(pdfviewerwidgets "resources"
PREFIX
"/icons"
FILES
diff --git a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
index 8024c0a5..0cdd671b 100644
--- a/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
+++ b/examples/pdfwidgets/pdfviewer/doc/src/pdfviewer.qdoc
@@ -26,13 +26,15 @@
****************************************************************************/
/*!
- \example pdfwidgets/pdfviewer
+ \example pdfviewer
\ingroup qtpdf-examples
\title PDF Viewer Example
\brief Renders PDF documents.
+ \omit
//! TODO add thumbnail \image pdfviewer.png
+ \endomit
\e {PDF Viewer} demonstrates how to use the QPdfDocument class to render
PDF documents and the QPdfPageNavigation class to navigate them.
@@ -49,8 +51,8 @@
The MainWindow class inherits the QMainWindow class:
- \quotefromfile pdfwidgets/pdfviewer/mainwindow.h
- \skipto public QMainWindow
+ \quotefromfile pdfviewer/mainwindow.h
+ \skipto public
\printuntil ~MainWindow()
The class declares public and private slots that match the actions of the
@@ -73,8 +75,8 @@
The actual setup of the different objects is done in the MainWindow
constructor:
- \quotefromfile pdfwidgets/pdfviewer/mainwindow.cpp
- \skipto MainWindow::
+ \quotefromfile pdfviewer/mainwindow.cpp
+ \skipto MainWindow
\printuntil {
The constructor first calls \c setupUi() to construct the zoom and page
diff --git a/examples/pdfwidgets/pdfviewer/main.cpp b/examples/pdfwidgets/pdfviewer/main.cpp
index 20fa6f8c..fae6a5e3 100644
--- a/examples/pdfwidgets/pdfviewer/main.cpp
+++ b/examples/pdfwidgets/pdfviewer/main.cpp
@@ -1,34 +1,48 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtPDF module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL3$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
diff --git a/examples/pdfwidgets/pdfviewer/mainwindow.cpp b/examples/pdfwidgets/pdfviewer/mainwindow.cpp
index 5f9bf389..bba1125b 100644
--- a/examples/pdfwidgets/pdfviewer/mainwindow.cpp
+++ b/examples/pdfwidgets/pdfviewer/mainwindow.cpp
@@ -1,34 +1,48 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtPDF module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL3$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
diff --git a/examples/pdfwidgets/pdfviewer/mainwindow.h b/examples/pdfwidgets/pdfviewer/mainwindow.h
index afdfcade..571dbd91 100644
--- a/examples/pdfwidgets/pdfviewer/mainwindow.h
+++ b/examples/pdfwidgets/pdfviewer/mainwindow.h
@@ -1,34 +1,48 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtPDF module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL3$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
diff --git a/examples/pdfwidgets/pdfviewer/pageselector.cpp b/examples/pdfwidgets/pdfviewer/pageselector.cpp
index cd3c4ba0..28bff135 100644
--- a/examples/pdfwidgets/pdfviewer/pageselector.cpp
+++ b/examples/pdfwidgets/pdfviewer/pageselector.cpp
@@ -1,34 +1,48 @@
/****************************************************************************
**
** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtPDF module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL3$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
diff --git a/examples/pdfwidgets/pdfviewer/pageselector.h b/examples/pdfwidgets/pdfviewer/pageselector.h
index 7a7283f9..58fc6d2f 100644
--- a/examples/pdfwidgets/pdfviewer/pageselector.h
+++ b/examples/pdfwidgets/pdfviewer/pageselector.h
@@ -1,34 +1,48 @@
/****************************************************************************
**
** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtPDF module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL3$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
diff --git a/examples/pdfwidgets/pdfviewer/zoomselector.cpp b/examples/pdfwidgets/pdfviewer/zoomselector.cpp
index a4d596ab..4ccf8746 100644
--- a/examples/pdfwidgets/pdfviewer/zoomselector.cpp
+++ b/examples/pdfwidgets/pdfviewer/zoomselector.cpp
@@ -1,34 +1,48 @@
/****************************************************************************
**
** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtPDF module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL3$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
diff --git a/examples/pdfwidgets/pdfviewer/zoomselector.h b/examples/pdfwidgets/pdfviewer/zoomselector.h
index c58d0997..50a97ee8 100644
--- a/examples/pdfwidgets/pdfviewer/zoomselector.h
+++ b/examples/pdfwidgets/pdfviewer/zoomselector.h
@@ -1,34 +1,48 @@
/****************************************************************************
**
** Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt.io/licensing/
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtPDF module of the Qt Toolkit.
**
-** $QT_BEGIN_LICENSE:LGPL3$
+** $QT_BEGIN_LICENSE:BSD$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
diff --git a/examples/webenginequick/customdialogs/CMakeLists.txt b/examples/webenginequick/customdialogs/CMakeLists.txt
index ce37f372..47d773c4 100644
--- a/examples/webenginequick/customdialogs/CMakeLists.txt
+++ b/examples/webenginequick/customdialogs/CMakeLists.txt
@@ -16,7 +16,6 @@ set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/webenginequick/customdialogs")
find_package(Qt6 COMPONENTS Core)
find_package(Qt6 COMPONENTS Gui)
find_package(Qt6 COMPONENTS WebEngineQuick)
-find_package(Qt6 OPTIONAL_COMPONENTS Widgets)
qt_add_executable(customdialogs
main.cpp
@@ -49,13 +48,15 @@ set(customdialogs_resource_files
"forms/JavaScriptForm.ui.qml"
"forms/Menu.qml"
"forms/MenuForm.ui.qml"
+ "forms/TouchSelectionMenu.qml"
+ "forms/TouchSelectionMenuForm.ui.qml"
"icon.svg"
"index.html"
"main.qml"
"style.css"
)
-qt6_add_resources(customdialogs "customdialogs"
+qt_add_resources(customdialogs "customdialogs"
PREFIX
"/"
FILES
diff --git a/examples/webenginequick/customdialogs/WebView.qml b/examples/webenginequick/customdialogs/WebView.qml
index 61bbea87..fcb10b7d 100644
--- a/examples/webenginequick/customdialogs/WebView.qml
+++ b/examples/webenginequick/customdialogs/WebView.qml
@@ -152,4 +152,13 @@ WebEngineView {
properties: {"request": request}});
}
+
+ onTouchSelectionMenuRequested: function(request) {
+ if (useDefaultDialogs)
+ return;
+
+ request.accepted = true;
+ openForm({item: Qt.resolvedUrl("forms/TouchSelectionMenu.qml"),
+ properties: {"request": request}});
+ }
}
diff --git a/examples/webenginequick/customdialogs/forms/JavaScriptForm.ui.qml b/examples/webenginequick/customdialogs/forms/JavaScriptForm.ui.qml
index 14d9dc30..1d486eaa 100644
--- a/examples/webenginequick/customdialogs/forms/JavaScriptForm.ui.qml
+++ b/examples/webenginequick/customdialogs/forms/JavaScriptForm.ui.qml
@@ -53,7 +53,7 @@ import QtQuick.Layouts
import QtQuick.Controls
Item {
- id: item
+ id: root
property alias cancelButton: cancelButton
property alias okButton: okButton
property string message: "Message"
diff --git a/examples/webenginequick/customdialogs/forms/TouchSelectionMenu.qml b/examples/webenginequick/customdialogs/forms/TouchSelectionMenu.qml
new file mode 100644
index 00000000..6d3dec56
--- /dev/null
+++ b/examples/webenginequick/customdialogs/forms/TouchSelectionMenu.qml
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+
+TouchSelectionMenuForm {
+ property QtObject request
+ signal closeForm()
+
+ cut.onClicked: closeForm()
+ copy.onClicked: closeForm()
+ paste.onClicked: closeForm()
+ contextMenu.onClicked: closeForm()
+}
diff --git a/examples/webenginequick/customdialogs/forms/TouchSelectionMenuForm.ui.qml b/examples/webenginequick/customdialogs/forms/TouchSelectionMenuForm.ui.qml
new file mode 100644
index 00000000..30d9a317
--- /dev/null
+++ b/examples/webenginequick/customdialogs/forms/TouchSelectionMenuForm.ui.qml
@@ -0,0 +1,86 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick.Layouts
+
+Item {
+ property alias cut: cut
+ property alias copy: copy
+ property alias paste: paste
+ property alias contextMenu: contextMenu
+
+ ColumnLayout {
+ id: columnLayout
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ CustomButton {
+ id: cut
+ btnText: qsTr("Cut")
+ }
+
+ CustomButton {
+ id: copy
+ btnText: qsTr("Copy")
+ }
+
+ CustomButton {
+ id: paste
+ btnText: qsTr("Paste")
+ }
+
+ CustomButton {
+ id: contextMenu
+ btnText: qsTr("...")
+ }
+
+ }
+}
diff --git a/examples/webenginequick/customdialogs/forms/forms.qmlproject b/examples/webenginequick/customdialogs/forms/forms.qmlproject
new file mode 100644
index 00000000..b06afaaf
--- /dev/null
+++ b/examples/webenginequick/customdialogs/forms/forms.qmlproject
@@ -0,0 +1,45 @@
+import QmlProject
+
+Project {
+ mainFile: "MenuForm.ui.qml"
+
+ /* Include .qml, .js, and image files from current directory and subdirectories */
+ QmlFiles {
+ directory: "."
+ }
+
+ JavaScriptFiles {
+ directory: "."
+ }
+
+ ImageFiles {
+ directory: "."
+ }
+
+ Files {
+ filter: "*.conf"
+ files: ["qtquickcontrols2.conf"]
+ }
+
+ Files {
+ filter: "qmldir"
+ directory: "."
+ }
+
+ Files {
+ filter: "*.ttf;*.otf"
+ }
+
+ Environment {
+ QT_QUICK_CONTROLS_CONF: "qtquickcontrols2.conf"
+ QT_AUTO_SCREEN_SCALE_FACTOR: "1"
+ }
+
+ qt6Project: true
+
+ /* List of plugin directories passed to QML runtime */
+ importPaths: [ ".", "imports" ]
+
+ /* Required for deployment */
+ targetDirectory: "/opt/forms"
+}
diff --git a/examples/webenginequick/customdialogs/index.html b/examples/webenginequick/customdialogs/index.html
index e9fb5622..d5de2827 100644
--- a/examples/webenginequick/customdialogs/index.html
+++ b/examples/webenginequick/customdialogs/index.html
@@ -14,6 +14,9 @@
<td><div class="div"><p title="I am a tooltip.">Hover this text to display a tooltip</a></div></td>
</tr>
<tr>
+ <td><div class="div"><p>Touch devices only: long press on this text to see the touch selection menu</p></div></td>
+ </tr>
+ <tr>
<td><button class="button" onclick="window.location = 'http://localhost.:5555/OPEN_AUTH'">
Open Authentication Dialog</button></td>
</tr>
diff --git a/examples/webenginequick/customdialogs/main.cpp b/examples/webenginequick/customdialogs/main.cpp
index 463da44f..6ed5771f 100644
--- a/examples/webenginequick/customdialogs/main.cpp
+++ b/examples/webenginequick/customdialogs/main.cpp
@@ -53,22 +53,14 @@
#include <QNetworkProxy>
#include <QQmlApplicationEngine>
#include <QTimer>
-
-#ifndef QT_NO_WIDGETS
-#include <QtWidgets/QApplication>
-// QApplication is required to get native styling with QtQuickControls
-typedef QApplication Application;
-#else
#include <QtGui/QGuiApplication>
-typedef QGuiApplication Application;
-#endif
int main(int argc, char *argv[])
{
QCoreApplication::setOrganizationName("QtExamples");
QtWebEngineQuick::initialize();
- Application app(argc, argv);
+ QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
Server *server = new Server(&engine);
diff --git a/examples/webenginequick/customdialogs/main.qml b/examples/webenginequick/customdialogs/main.qml
index 529737e9..6d81c797 100644
--- a/examples/webenginequick/customdialogs/main.qml
+++ b/examples/webenginequick/customdialogs/main.qml
@@ -56,7 +56,7 @@ import QtQuick.Window
Window {
id: mainWindow
width: 800
- height: 600
+ height: 610
visible: true
StackView {
diff --git a/examples/webenginequick/lifecycle/CMakeLists.txt b/examples/webenginequick/lifecycle/CMakeLists.txt
index 2d7b3e26..8f90cbf4 100644
--- a/examples/webenginequick/lifecycle/CMakeLists.txt
+++ b/examples/webenginequick/lifecycle/CMakeLists.txt
@@ -43,7 +43,7 @@ set(resources_resource_files
"qtquickcontrols2.conf"
)
-qt6_add_resources(lifecycle "resources"
+qt_add_resources(lifecycle "resources"
PREFIX
"/"
FILES
diff --git a/examples/webenginequick/minimal/CMakeLists.txt b/examples/webenginequick/minimal/CMakeLists.txt
index 34276e8b..9155ce04 100644
--- a/examples/webenginequick/minimal/CMakeLists.txt
+++ b/examples/webenginequick/minimal/CMakeLists.txt
@@ -36,7 +36,7 @@ set(qml_resource_files
"main.qml"
)
-qt6_add_resources(webengine-minimal-qml "qml"
+qt_add_resources(webengine-minimal-qml "qml"
PREFIX
"/"
FILES
diff --git a/examples/webenginequick/quicknanobrowser/CMakeLists.txt b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
index a9e8bb4a..9a70a2c2 100644
--- a/examples/webenginequick/quicknanobrowser/CMakeLists.txt
+++ b/examples/webenginequick/quicknanobrowser/CMakeLists.txt
@@ -46,7 +46,7 @@ set(resources_resource_files
"FullScreenNotification.qml"
)
-qt6_add_resources(quicknanobrowser "resources"
+qt_add_resources(quicknanobrowser "resources"
PREFIX
"/"
FILES
@@ -59,7 +59,7 @@ set(resources1_resource_files
"icons/3rdparty/view-refresh.png"
)
-qt6_add_resources(quicknanobrowser "resources1"
+qt_add_resources(quicknanobrowser "resources1"
PREFIX
"/icons"
BASE
diff --git a/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json b/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
index 4e5a4444..681223b1 100644
--- a/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
+++ b/examples/webenginequick/quicknanobrowser/icons/3rdparty/qt_attribution.json
@@ -9,7 +9,7 @@
"Homepage": "http://tango.freedesktop.org/Tango_Icon_Library",
"Version": "0.8.90",
"DownloadLocation": "http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz",
- "LicenseId": "DocumentRef-PublicDomain",
+ "LicenseId": "urn:dje:license:public-domain",
"License": "Public Domain",
"LicenseFile": "COPYING",
"Copyright": "Ulisse Perusin <uli.peru@gmail.com>
diff --git a/examples/webenginequick/quicknanobrowser/main.cpp b/examples/webenginequick/quicknanobrowser/main.cpp
index 859856d9..f21b0362 100644
--- a/examples/webenginequick/quicknanobrowser/main.cpp
+++ b/examples/webenginequick/quicknanobrowser/main.cpp
@@ -50,13 +50,7 @@
#include "utils.h"
-#ifndef QT_NO_WIDGETS
-#include <QtWidgets/QApplication>
-typedef QApplication Application;
-#else
#include <QtGui/QGuiApplication>
-typedef QGuiApplication Application;
-#endif
#include <QtQml/QQmlApplicationEngine>
#include <QtQml/QQmlContext>
#include <QtWebEngineQuick/qtwebenginequickglobal.h>
@@ -81,7 +75,7 @@ int main(int argc, char **argv)
QCoreApplication::setOrganizationName("QtExamples");
QtWebEngineQuick::initialize();
- Application app(argc, argv);
+ QGuiApplication app(argc, argv);
QQmlApplicationEngine appEngine;
Utils utils;
diff --git a/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro b/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro
index 8208e446..3a014fe2 100644
--- a/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro
+++ b/examples/webenginequick/quicknanobrowser/quicknanobrowser.pro
@@ -6,13 +6,6 @@ TARGET = quicknanobrowser
HEADERS = utils.h
SOURCES = main.cpp
-OTHER_FILES += ApplicationRoot.qml \
- BrowserDialog.qml \
- BrowserWindow.qml \
- DownloadView.qml \
- FindBar.qml \
- FullScreenNotification.qml
-
RESOURCES += resources.qrc
QT += qml quick webenginequick
diff --git a/examples/webenginequick/recipebrowser/CMakeLists.txt b/examples/webenginequick/recipebrowser/CMakeLists.txt
index bb768a47..9643234e 100644
--- a/examples/webenginequick/recipebrowser/CMakeLists.txt
+++ b/examples/webenginequick/recipebrowser/CMakeLists.txt
@@ -121,7 +121,7 @@ set(resources_resource_files
"resources/qml/RecipeList.qml"
)
-qt6_add_resources(recipebrowser "resources"
+qt_add_resources(recipebrowser "resources"
PREFIX
"/"
BASE
diff --git a/examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc b/examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc
index 42c1ce64..a9fb5bae 100644
--- a/examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc
+++ b/examples/webenginequick/recipebrowser/doc/src/recipebrowser.qdoc
@@ -204,7 +204,7 @@
An example of a recipe page can be seen below. The page uses two stylesheets and
two JavaScript files:
\list
- \li \l{http://kevinburke.bitbucket.org/markdowncss/}{markdown.css} is
+ \li \l{https://bitbucket.org/kevinburke/markdowncss/src/master/}{markdown.css} is
a markdown-friendly stylesheet created by Kevin Burke
\li \l{https://github.com/chjj/marked}{marked.min.js} is a markdown parser and
compiler designed for speed written by Christopher Jeffrey
diff --git a/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
index a6c68f46..4dafa1ac 100644
--- a/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
+++ b/examples/webenginequick/recipebrowser/resources/pages/assets/3rdparty/qt_attribution.json
@@ -23,7 +23,6 @@
"QtParts": [ "examples" ],
"Files": "markdown.css",
"Description": "Markdown.css is better default styling for your Markdown files.",
- "Homepage": "https://kevinburke.bitbucket.io/markdowncss/",
"Version": "188530e4b5d020d7e237fc6b26be13ebf4a8def3",
"DownloadLocation": "https://bitbucket.org/kevinburke/markdowncss/src/188530e4b5d020d7e237fc6b26be13ebf4a8def3/markdown.css",
"Copyright": "Copyright 2011 Kevin Burke
diff --git a/examples/webenginequick/webengineaction/CMakeLists.txt b/examples/webenginequick/webengineaction/CMakeLists.txt
index a7bbf1ed..926825d2 100644
--- a/examples/webenginequick/webengineaction/CMakeLists.txt
+++ b/examples/webenginequick/webengineaction/CMakeLists.txt
@@ -36,7 +36,7 @@ set(qml_resource_files
"main.qml"
)
-qt6_add_resources(webengineaction "qml"
+qt_add_resources(webengineaction "qml"
PREFIX
"/"
FILES
diff --git a/examples/webenginewidgets/contentmanipulation/CMakeLists.txt b/examples/webenginewidgets/contentmanipulation/CMakeLists.txt
index 9ff58587..ae93a7a7 100644
--- a/examples/webenginewidgets/contentmanipulation/CMakeLists.txt
+++ b/examples/webenginewidgets/contentmanipulation/CMakeLists.txt
@@ -37,7 +37,7 @@ set(jquery_resource_files
"jquery.min.js"
)
-qt6_add_resources(contentmanipulation "jquery"
+qt_add_resources(contentmanipulation "jquery"
PREFIX
"/"
FILES
diff --git a/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json b/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
index 91a0899c..4cb51436 100644
--- a/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/cookiebrowser/3rdparty/qt_attribution.json
@@ -9,7 +9,7 @@
"Homepage": "http://tango.freedesktop.org/Tango_Icon_Library",
"Version": "0.8.90",
"DownloadLocation": "http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz",
- "LicenseId": "DocumentRef-PublicDomain",
+ "LicenseId": "urn:dje:license:public-domain",
"License": "Public Domain",
"LicenseFile": "COPYING",
"Copyright": "Ulisse Perusin <uli.peru@gmail.com>
diff --git a/examples/webenginewidgets/cookiebrowser/CMakeLists.txt b/examples/webenginewidgets/cookiebrowser/CMakeLists.txt
index 16d2bfab..e94ecae7 100644
--- a/examples/webenginewidgets/cookiebrowser/CMakeLists.txt
+++ b/examples/webenginewidgets/cookiebrowser/CMakeLists.txt
@@ -39,7 +39,7 @@ set(cookiebrowser_resource_files
"3rdparty/view-refresh.png"
)
-qt6_add_resources(cookiebrowser "cookiebrowser"
+qt_add_resources(cookiebrowser "cookiebrowser"
PREFIX
"/"
BASE
diff --git a/examples/webenginewidgets/markdowneditor/CMakeLists.txt b/examples/webenginewidgets/markdowneditor/CMakeLists.txt
index 29bcc2d7..3852b93d 100644
--- a/examples/webenginewidgets/markdowneditor/CMakeLists.txt
+++ b/examples/webenginewidgets/markdowneditor/CMakeLists.txt
@@ -44,7 +44,7 @@ set(markdowneditor_resource_files
"resources/index.html"
)
-qt6_add_resources(markdowneditor "markdowneditor"
+qt_add_resources(markdowneditor "markdowneditor"
PREFIX
"/"
BASE
diff --git a/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc b/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
index 9ff8f061..53464194 100644
--- a/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
+++ b/examples/webenginewidgets/markdowneditor/doc/src/markdowneditor.qdoc
@@ -152,7 +152,7 @@
\quotefile webenginewidgets/markdowneditor/resources/index.html
In the \e index.html, we load a custom stylesheet and two JavaScript
- libraries. \l{http://kevinburke.bitbucket.org/markdowncss/}{markdown.css} is
+ libraries. \l{https://bitbucket.org/kevinburke/markdowncss/src/master/}{markdown.css} is
a markdown-friendly stylesheet created by Kevin Burke.
\l{https://github.com/chjj/marked}{marked.js} is a markdown parser and
compiler designed for speed written by Christopher Jeffrey and
diff --git a/examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json b/examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json
index de5458ef..d51ac744 100644
--- a/examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json
@@ -23,7 +23,6 @@
"QtParts": [ "examples" ],
"Files": "markdown.css",
"Description": "Markdown.css is better default styling for your Markdown files.",
- "Homepage": "https://kevinburke.bitbucket.io/markdowncss/",
"Version": "188530e4b5d020d7e237fc6b26be13ebf4a8def3",
"DownloadLocation": "https://bitbucket.org/kevinburke/markdowncss/src/188530e4b5d020d7e237fc6b26be13ebf4a8def3/markdown.css",
"Copyright": "Copyright 2011 Kevin Burke
diff --git a/examples/webenginewidgets/notifications/CMakeLists.txt b/examples/webenginewidgets/notifications/CMakeLists.txt
index 0f6e504d..6e152cf6 100644
--- a/examples/webenginewidgets/notifications/CMakeLists.txt
+++ b/examples/webenginewidgets/notifications/CMakeLists.txt
@@ -38,7 +38,7 @@ set(data_resource_files
"data/index.html"
)
-qt6_add_resources(notifications "data"
+qt_add_resources(notifications "data"
PREFIX
"/"
BASE
diff --git a/examples/webenginewidgets/printme/CMakeLists.txt b/examples/webenginewidgets/printme/CMakeLists.txt
index 6b21de27..ada0bf25 100644
--- a/examples/webenginewidgets/printme/CMakeLists.txt
+++ b/examples/webenginewidgets/printme/CMakeLists.txt
@@ -41,7 +41,7 @@ set(data_resource_files
"data/style.css"
)
-qt6_add_resources(printme "data"
+qt_add_resources(printme "data"
PREFIX
"/"
BASE
diff --git a/examples/webenginewidgets/simplebrowser/CMakeLists.txt b/examples/webenginewidgets/simplebrowser/CMakeLists.txt
index 21ae993e..ee11c02d 100644
--- a/examples/webenginewidgets/simplebrowser/CMakeLists.txt
+++ b/examples/webenginewidgets/simplebrowser/CMakeLists.txt
@@ -47,7 +47,7 @@ set(simplebrowser_resource_files
"data/ninja.png"
)
-qt6_add_resources(simplebrowser "simplebrowser"
+qt_add_resources(simplebrowser "simplebrowser"
PREFIX
"/"
BASE
@@ -66,7 +66,7 @@ set(simplebrowser1_resource_files
"data/3rdparty/view-refresh.png"
)
-qt6_add_resources(simplebrowser "simplebrowser1"
+qt_add_resources(simplebrowser "simplebrowser1"
PREFIX
"/"
BASE
diff --git a/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json b/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
index 853adeb2..d81f5bf2 100644
--- a/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/simplebrowser/data/3rdparty/qt_attribution.json
@@ -9,7 +9,7 @@
"Homepage": "http://tango.freedesktop.org/Tango_Icon_Library",
"Version": "0.8.90",
"DownloadLocation": "http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz",
- "LicenseId": "DocumentRef-PublicDomain",
+ "LicenseId": "urn:dje:license:public-domain",
"License": "Public Domain",
"LicenseFile": "COPYING",
"Copyright": "Ulisse Perusin <uli.peru@gmail.com>
diff --git a/examples/webenginewidgets/spellchecker/CMakeLists.txt b/examples/webenginewidgets/spellchecker/CMakeLists.txt
index 5cec0087..1a0c76b0 100644
--- a/examples/webenginewidgets/spellchecker/CMakeLists.txt
+++ b/examples/webenginewidgets/spellchecker/CMakeLists.txt
@@ -39,7 +39,7 @@ set(spellchecker_resource_files
"data/style.css"
)
-qt6_add_resources(spellchecker "spellchecker"
+qt_add_resources(spellchecker "spellchecker"
PREFIX
"/"
BASE
@@ -55,39 +55,15 @@ install(TARGETS spellchecker
)
file(GLOB_RECURSE dicts
- RELATIVE ${CMAKE_CURRENT_LIST_DIR}/dict
+ ABSOLUTE ${CMAKE_CURRENT_LIST_DIR}/dict
*/*.dic
)
-if(QT_GENERATOR_IS_MULTI_CONFIG)
- set(spellcheckerDir ${CMAKE_CURRENT_BINARY_DIR}/dict/qtwebengine_dictionaries)
-else()
- set(spellcheckerDir ${CMAKE_CURRENT_BINARY_DIR}/qtwebengine_dictionaries)
-endif()
-
-# note setting QT_WEBENGINE_ICU_DATA below is not required if this example
-# is not compiled as part of qtwebengine module build
-
foreach(dictFile ${dicts})
- get_filename_component(dictName ${dictFile} NAME_WE)
- add_custom_command(TARGET spellchecker
- PRE_BUILD
- COMMAND ${CMAKE_COMMAND} -E make_directory ${spellcheckerDir}
- COMMAND ${CMAKE_COMMAND} -E env
- $<IF:$<BOOL:${WEBENGINE_MODULE_BUILD}>,QT_WEBENGINE_ICU_DATA_DIR=${CMAKE_CURRENT_BINARY_DIR}/../../../resources,CMAKE=AWESOME>
- $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict>
- ${CMAKE_CURRENT_SOURCE_DIR}/dict/${dictFile} ${spellcheckerDir}/${dictName}.bdic
- COMMENT "Running qwebengine_convert_dict"
+ qt_add_webengine_dictionary(
+ TARGET spellchecker
+ SOURCE "${dictFile}"
+ OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
)
endforeach()
-# copy dictionaries to $<CONFIG> build dir
-if(QT_GENERATOR_IS_MULTI_CONFIG)
- add_custom_command(TARGET spellchecker
- POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E echo Copying dictionares
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/dict
- ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>
- )
-endif()
-
diff --git a/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json b/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
index ffca1812..f779da7e 100644
--- a/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
+++ b/examples/webenginewidgets/stylesheetbrowser/3rdparty/qt_attribution.json
@@ -9,7 +9,7 @@
"Homepage": "http://tango.freedesktop.org/Tango_Icon_Library",
"Version": "0.8.90",
"DownloadLocation": "http://tango.freedesktop.org/releases/tango-icon-theme-0.8.90.tar.gz",
- "LicenseId": "DocumentRef-PublicDomain",
+ "LicenseId": "urn:dje:license:public-domain",
"License": "Public Domain",
"LicenseFile": "COPYING",
"Copyright": "Ulisse Perusin <uli.peru@gmail.com>
diff --git a/examples/webenginewidgets/stylesheetbrowser/CMakeLists.txt b/examples/webenginewidgets/stylesheetbrowser/CMakeLists.txt
index 596da796..e0a1723f 100644
--- a/examples/webenginewidgets/stylesheetbrowser/CMakeLists.txt
+++ b/examples/webenginewidgets/stylesheetbrowser/CMakeLists.txt
@@ -38,7 +38,7 @@ set(stylesheetbrowser_resource_files
"3rdparty/view-refresh.png"
)
-qt6_add_resources(stylesheetbrowser "stylesheetbrowser"
+qt_add_resources(stylesheetbrowser "stylesheetbrowser"
PREFIX
"/"
BASE
diff --git a/examples/webenginewidgets/videoplayer/CMakeLists.txt b/examples/webenginewidgets/videoplayer/CMakeLists.txt
index f6db9714..61f4e40c 100644
--- a/examples/webenginewidgets/videoplayer/CMakeLists.txt
+++ b/examples/webenginewidgets/videoplayer/CMakeLists.txt
@@ -39,7 +39,7 @@ set(videoplayer_resource_files
"data/index.html"
)
-qt6_add_resources(videoplayer "videoplayer"
+qt_add_resources(videoplayer "videoplayer"
PREFIX
"/"
BASE
diff --git a/examples/webenginewidgets/webui/CMakeLists.txt b/examples/webenginewidgets/webui/CMakeLists.txt
index b4a6683c..4d8123e1 100644
--- a/examples/webenginewidgets/webui/CMakeLists.txt
+++ b/examples/webenginewidgets/webui/CMakeLists.txt
@@ -37,7 +37,7 @@ set(webui_resource_files
"about.html"
)
-qt6_add_resources(webui "webui"
+qt_add_resources(webui "webui"
PREFIX
"/"
FILES
diff --git a/mkspecs/features/default_pre.prf b/mkspecs/features/default_pre.prf
deleted file mode 100644
index c7440fa7..00000000
--- a/mkspecs/features/default_pre.prf
+++ /dev/null
@@ -1,20 +0,0 @@
-QTWEBENGINEPROCESS_NAME_RELEASE = QtWebEngineProcess
-debug_and_release {
- QTWEBENGINEPROCESS_NAME_DEBUG = $$join(QTWEBENGINEPROCESS_NAME_RELEASE,,,d)
-} else {
- QTWEBENGINEPROCESS_NAME_DEBUG = $$QTWEBENGINEPROCESS_NAME_RELEASE
-}
-build_pass:CONFIG(debug, debug|release) {
- QTWEBENGINEPROCESS_NAME = $$QTWEBENGINEPROCESS_NAME_DEBUG
-} else {
- QTWEBENGINEPROCESS_NAME = $$QTWEBENGINEPROCESS_NAME_RELEASE
-}
-
-# Location of sync.profile
-MODULE_BASE_DIR = $$QTWEBENGINE_ROOT
-
-EOL = $$escape_expand(\\n)
-
-# Call the original default_pre.
-load(default_pre)
-load(functions)
diff --git a/mkspecs/features/functions.prf b/mkspecs/features/functions.prf
deleted file mode 100644
index 6c3ef3cb..00000000
--- a/mkspecs/features/functions.prf
+++ /dev/null
@@ -1,138 +0,0 @@
-include($$QTWEBENGINE_ROOT/src/buildtools/config/support.pri)
-
-defineReplace(getConfigDir) {
- CONFIG(release, debug|release):return("release")
- return("debug")
-}
-
-defineReplace(getChromiumSrcDir) {
- exists($$QTWEBENGINE_ROOT/.git): git_chromium_src_dir = $$system("git config qtwebengine.chromiumsrcdir")
- # Fall back to the snapshot path if git does not know about chromium sources (i.e. init-repository.py has not been used)
- isEmpty(git_chromium_src_dir): git_chromium_src_dir = "src/3rdparty/chromium"
- return($$git_chromium_src_dir)
-}
-
-defineReplace(which) {
- out = $$1
- win32 {
- command = $$split(out, " ")
- executable = $$first(command)
- # Return the first match only
- out = $$system("((for /f \"usebackq delims=\" %i in (`where $$executable 2^> NUL`) do @if not defined _endwhich (@echo %i & set _endwhich=true)) & set _endwhich=)")
- isEmpty(out) {
- message($$executable not found)
- out = $$executable
- }
- for(arg, command): !equals(arg, $$executable): out += $$arg
- } else:unix {
- command = $$split(out, " ")
- executable = $$first(command)
- out = $$system("which $$executable 2>/dev/null")
- isEmpty(out) {
- message($$executable not found)
- out = $$executable
- }
- for(arg, command): !equals(arg, $$executable): out += $$arg
- }
- return($$out)
-}
-
-# Returns the unquoted path to the python executable.
-defineReplace(pythonPath) {
- isEmpty(QMAKE_PYTHON2) {
- # Fallback for building QtWebEngine with Qt < 5.8
- QMAKE_PYTHON2 = python
- }
- return($$QMAKE_PYTHON2)
-}
-
-# Returns the python executable for use with shell / make targets.
-defineReplace(pythonPathForShell) {
- return($$shell_quote($$shell_path($$pythonPath())))
-}
-
-# Returns the python executable for use with $$system()
-defineReplace(pythonPathForSystem) {
- return($$system_quote($$system_path($$pythonPath())))
-}
-
-defineReplace(ninjaPath) {
- isEmpty(QMAKE_NINJA) {
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir))
- win32: out = $${out}.exe
- QMAKE_NINJA = $$out
- }
- return($$QMAKE_NINJA)
-}
-
-defineReplace(gnPath) {
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- out = $$shadowed($$absolute_path(gn/out/Release/gn, $$src_3rd_party_dir))
-
- win32: out = $${out}.exe
- return($$out)
-}
-
-defineReplace(gnWebEngineArgs) {
- linux {
- include($$QTWEBENGINE_ROOT/src/buildtools/config/linux.pri)
- include($$QTWEBENGINE_ROOT/src/core/config/linux.pri)
- }
- macos {
- include($$QTWEBENGINE_ROOT/src/buildtools/config/mac_osx.pri)
- include($$QTWEBENGINE_ROOT/src/core/config/mac_osx.pri)
- }
- win32 {
- include($$QTWEBENGINE_ROOT/src/buildtools/config/windows.pri)
- include($$QTWEBENGINE_ROOT/src/core/config/windows.pri)
- }
- isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.)
- return($$gn_args)
-}
-
-defineReplace(gnPdfArgs) {
- linux: include($$QTWEBENGINE_ROOT/src/buildtools/config/linux.pri)
- macos: include($$QTWEBENGINE_ROOT/src/buildtools/config/mac_osx.pri)
- ios: include($$QTWEBENGINE_ROOT/src/pdf/config/ios.pri)
- win32: include($$QTWEBENGINE_ROOT/src/buildtools/config/windows.pri)
- include($$QTWEBENGINE_ROOT/src/pdf/config/common.pri)
- isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.)
- return($$gn_args)
-}
-
-defineReplace(gnArch) {
- qtArch = $$1
- contains(qtArch, "i386"): return(x86)
- contains(qtArch, "x86_64"): return(x64)
- contains(qtArch, "arm"): return(arm)
- contains(qtArch, "arm64"): return(arm64)
- contains(qtArch, "mips"): return(mipsel)
- contains(qtArch, "mips64"): return(mips64el)
- contains(qtArch, "mips64el"): return(mips64el)
- return(unknown)
-}
-
-defineReplace(gnOS) {
- macos: return(mac)
- win32: return(win)
- linux: return(linux)
- error(Unsupported platform)
- return(unknown)
-}
-
-defineReplace(pkgConfigHostExecutable) {
- wrapper_name = $$OUT_PWD/pkg-config-host_wrapper.sh
- wrapper_cmd = $$QMAKE_PKG_CONFIG_HOST
- isEmpty(wrapper_cmd): wrapper_cmd = pkg-config
- wrapper_content = \
- "$$LITERAL_HASH!/bin/sh" \
- "unset PKG_CONFIG_LIBDIR" \
- "unset PKG_CONFIG_SYSROOT_DIR" \
- "exec $$wrapper_cmd \"$@\""
- !build_pass:!write_file($$wrapper_name, wrapper_content, exe): error()
- QMAKE_DISTCLEAN += $$wrapper_name
- export(QMAKE_DISTCLEAN)
- return($$system_quote($$system_path($$wrapper_name)))
-}
-
diff --git a/mkspecs/features/gn_generator.prf b/mkspecs/features/gn_generator.prf
deleted file mode 100644
index bbaed233..00000000
--- a/mkspecs/features/gn_generator.prf
+++ /dev/null
@@ -1,268 +0,0 @@
-load(moc)
-load(resources)
-
-defineReplace(getTargetType) {
- equals(TEMPLATE, "app"):return("executable")
- equals(TEMPLATE, "lib") {
- CONFIG(static): return("static_library")
- return("shared_library")
- }
- return("none")
-}
-
-defineReplace(filter_flag_values) {
- value_to_check = $$1
- if (macos|ios):equals(value_to_check, "$(EXPORT_ARCH_ARGS)") {
- # EXPORT_ARCH_ARGS comes from qtbase/mkspecs/features/mac/default_post.prf which is a way
- # to figure out the architectures to pass to the compiler at Makefile time. Because this
- # variable expansion is not supported by GN, we filter it out. GN takes care of assigning
- # the architecture itself.
- return("")
- }
- if (ios) {
- equals(value_to_check, "$(EXPORT_QMAKE_XARCH_LFLAGS)"): return("")
- equals(value_to_check, "$(EXPORT_QMAKE_XARCH_CFLAGS)"): return("")
- }
-
- return($$value_to_check)
-}
-
-isEmpty(GN_FILE): GN_FILE = $$system_path($$_PRO_FILE_PWD_/BUILD.gn)
-isEmpty(GN_RUN_BINARY_SCRIPT): GN_RUN_BINARY_SCRIPT = "//build/gn_run_binary.py"
-isEmpty(GN_FIND_MOCABLES_SCRIPT): GN_FIND_MOCABLES_SCRIPT = "//build/gn_find_mocables.py"
-
-# MOC SETUP
-
-GN_CONTENTS += "moc_source_h_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\","
-GN_CONTENTS += " ["
-for (headerfile, HEADERS): GN_CONTENTS += " \"$$GN_SRC_DIR/$$headerfile\","
-GN_CONTENTS += " ], \"list lines\", [\"$$system_path($$_PRO_FILE_)\"]"\
- ")"
-GN_CONTENTS += "moc_source_cpp_files = exec_script(\"$$GN_FIND_MOCABLES_SCRIPT\","
-GN_CONTENTS += " ["
-for (sourcefile, SOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\","
-GN_CONTENTS += " ], \"list lines\", [\"$$system_path($$_PRO_FILE_)\"]"\
- ")"
-
-DEFINES_LIST = $$join(DEFINES, " -D", "-D")
-INCLUDE_LIST = $$join(INCLUDEPATH, " -I", "-I")
-
-# we don't generate a moc_predef file yet.
-MOC_PREDEF_FILE =
-MOC_COMMAND = $$clean_path($$mocCmdBase())
-MOC_COMMAND = $$replace(MOC_COMMAND, $$re_escape("$(DEFINES)"), $$DEFINES_LIST)
-MOC_COMMAND = $$replace(MOC_COMMAND, $$re_escape("$(INCPATH)"), $$INCLUDE_LIST)
-MOC_COMMAND = $$eval($$list($$MOC_COMMAND))
-
-GN_CONTENTS += "if (moc_source_h_files != []) {"
-GN_CONTENTS += " action_foreach(\"generate_h_mocs\") {"\
- " script = \"$$GN_RUN_BINARY_SCRIPT\""
-GN_CONTENTS += " sources = moc_source_h_files" \
- " outputs = [ \"$target_gen_dir/.moc/moc_{{source_name_part}}.cpp\" ]"
-GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
- " args = ["
-for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\",\\\")\","
-GN_CONTENTS += " \"{{source}}\"," \
- " \"-o\"," \
- " rebase_path(\"$target_gen_dir/.moc/moc_{{source_name_part}}.cpp\")"\
- " ]"
-GN_CONTENTS += " }"
-GN_CONTENTS += "}"
-GN_CONTENTS += "if (moc_source_cpp_files != []) {"
-GN_CONTENTS += " action_foreach(\"generate_cpp_mocs\") {"\
- " script = \"$$GN_RUN_BINARY_SCRIPT\""
-GN_CONTENTS += " sources = moc_source_cpp_files" \
- " outputs = [ \"$target_gen_dir/.moc/{{source_name_part}}.moc\" ]"
-GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
- " args = ["
-for(token, MOC_COMMAND): GN_CONTENTS += " \"$$replace(token,\",\\\")\","
-GN_CONTENTS += " \"{{source}}\"," \
- " \"-o\"," \
- " rebase_path(\"$target_gen_dir/.moc/{{source_name_part}}.moc\")"\
- " ]"
-GN_CONTENTS += " }"
-GN_CONTENTS += "}"
-
-# RESOURCES SETUP
-
-CLEAN_QMAKE_RCC = $$clean_path($$QMAKE_RCC)
-
-!isEmpty(RESOURCES) {
- GN_CONTENTS += "action_foreach(\"generate_resources\") {"\
- " script = \"$$GN_RUN_BINARY_SCRIPT\""
- GN_CONTENTS += " sources = ["
- for (sourcefile, RESOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\","
- GN_CONTENTS += " ]" \
- " outputs = [ \"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\" ]"
- GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
- " args = [" \
- " \"$$replace(CLEAN_QMAKE_RCC,\",\\\")\","
- for(resource_flag, $$QMAKE_RESOURCE_FLAGS): GN_CONTENTS += " \"$$resource_flag\""
- GN_CONTENTS += " \"-name\"," \
- " \"{{source_name_part}}\"," \
- " \"{{source}}\"," \
- " \"-o\"," \
- " rebase_path(\"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\")"\
- " ]"
- GN_CONTENTS += "}"
-}
-
-# CONFIG SETUP
-
-# Chromium already enables warnings, so enabling them again will just
-# re-enable all the warnings disabled by Chromium.
-QMAKE_CFLAGS -= $$QMAKE_CFLAGS_WARN_ON
-QMAKE_CXXFLAGS -= $$QMAKE_CXXFLAGS_WARN_ON
-
-GN_CONTENTS += "config(\"$${TARGET}_config\") {"
-!isEmpty(QMAKE_CFLAGS) {
- GN_CONTENTS += " cflags = ["
- for(flag, QMAKE_CFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\","
- GN_CONTENTS += " ]"
-}
-
-!isEmpty(QMAKE_FRAMEWORKPATH) {
- GN_CONTENTS += " cflags += ["
- for(path, QMAKE_FRAMEWORKPATH): GN_CONTENTS += " \"-F$$path\","
- GN_CONTENTS += " ]"
-}
-
-# Chromium activates this, but we need it off to be able to compile QFlags
-clang_cl {
- QMAKE_CXXFLAGS += "-fno-complete-member-pointers"
-}
-
-!isEmpty(QMAKE_CXXFLAGS) {
- GN_CONTENTS += " cflags_cc = ["
- for(flag, QMAKE_CXXFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\","
- GN_CONTENTS += " ]"
-}
-
-GN_CONTENTS += " defines = ["
-# Remove single quotes around function macro defines, so that GN doesn't escape them, thus breaking
-# the macro.
-# Also add a layer of escaping for double quotes.
-for (define, DEFINES): {
- define = $$replace(define,\",\\\")
- define = $$replace(define,\',)
- GN_CONTENTS += " \"$$define\","
-}
-GN_CONTENTS += " ]"
-
-GN_CONTENTS += " include_dirs = ["
-for (path, INCLUDEPATH): GN_CONTENTS += " \"$$path\","
-GN_CONTENTS += " rebase_path(\"$target_gen_dir/.moc/\"),"
-GN_CONTENTS += " \"$$QMAKESPEC\""
-GN_CONTENTS += " ]"
-
-GN_CONTENTS += " ldflags = ["
-for (flag, QMAKE_LFLAGS): GN_CONTENTS += " \"$$filter_flag_values($$flag)\","
-for (flag, GN_FLAGS): GN_CONTENTS += " \"$$flag\","
-!isEmpty(QMAKE_RPATHDIR) {
- for (rpath, QMAKE_RPATHDIR) {
- unix:!macos: GN_CONTENTS += " \"-Wl,-rpath=$${rpath}\","
- }
-}
-!isEmpty(QMAKE_RPATHLINKDIR): GN_CONTENTS += " \"-Wl,-rpath-link=$${QMAKE_RPATHLINKDIR}\","
-GN_CONTENTS += " ]"
-
-GN_CONTENTS += " lib_dirs = ["
-lib_dirs = $$find(LIBS, ^-L.*)
-lib_dirs = $$unique(lib_dirs)
-for (lib_dir, lib_dirs): GN_CONTENTS += " \"$$replace(lib_dir, -L, )\","
-GN_CONTENTS += " ]"
-
-GN_CONTENTS += "}"
-
-# TARGET SETUP
-
-TARGET_TYPE = $$getTargetType()
-
-GN_CONTENTS += "$${TARGET_TYPE}(\"$$TARGET\") {"
-!isEmpty(GN_CREATE_PRI): GN_CONTENTS += " create_pri_file = $$GN_CREATE_PRI"
-!isEmpty(GN_IMPORTS) {
- for (imp, GN_IMPORTS): GN_CONTENTS += " import(\"$$imp\")"
-}
-
-GN_CONTENTS += " configs += [ \":$${TARGET}_config\" ]"
-!isEmpty(GN_PRECOMPILED_HEADERS): GN_CONTENTS += " configs += [ \"//build/config:precompiled_headers\" ]"
-
-# Source files to compile
-GN_CONTENTS += " sources = ["
-for (sourcefile, SOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\","
-for (headerfile, HEADERS): GN_CONTENTS += " \"$$GN_SRC_DIR/$$headerfile\","
-GN_CONTENTS += " ]"
-
-# Add Sources generated by rcc from qrc files.
-!isEmpty(RESOURCES): GN_CONTENTS += " sources += get_target_outputs(\":generate_resources\")"
-
-GN_CONTENTS += " if (!defined(libs)) {"\
- " libs = []"\
- " }"
-GN_CONTENTS += " libs += ["
-for (lib, GN_LIBS): GN_CONTENTS += " \"$$lib\","
-libs = $$find(LIBS, ^-l.*)
-libs = $$unique(libs)
-for (lib, libs): GN_CONTENTS += " \"$$replace(lib, -l, )\","
-GN_CONTENTS += " ]"
-
-GN_CONTENTS += " if (!defined(deps)) {"\
- " deps = []"\
- " }"
-
-!isEmpty(RESOURCES) {
- GN_CONTENTS += " deps += ["
- GN_CONTENTS += " \":generate_resources\","
- GN_CONTENTS += " ]"
-}
-
-# Remove the default no_rtti config for our own cpp files, thus leaving the decision
-# to the compiler's defaults. This is consistent with how qtbase does it.
-# Unless the user explicitly configured Qt with a different RTTI setting.
-# Windows only for now, because macOS (and presumably Linux) does not support
-# partial rtti info (e.g. rtti info present for derived class, but not base class), and the
-# qtbase rtti feature affects only Windows.
-win32 {
- GN_CONTENTS += " configs -= [\"//build/config/compiler:no_rtti\"]"
- CONFIG(rtti_off): GN_CONTENTS += " configs += [\"//build/config/compiler:no_rtti\"]"
- CONFIG(rtti): GN_CONTENTS += " configs += [\"//build/config/compiler:rtti\"]"
-}
-gcc:!qtConfig(reduce_exports) {
- GN_CONTENTS += " configs -= [\"//build/config/gcc:symbol_visibility_hidden\"]"
-}
-
-GN_CONTENTS += " if (moc_source_h_files != []) {"
-GN_CONTENTS += " deps += ["
-GN_CONTENTS += " \":generate_h_mocs\","
-GN_CONTENTS += " ]"
-# Add moc output files to compile
-GN_CONTENTS += " sources += get_target_outputs(\":generate_h_mocs\")"
-GN_CONTENTS += " }"
-GN_CONTENTS += " if (moc_source_cpp_files != []) {"
-GN_CONTENTS += " deps += ["
-GN_CONTENTS += " \":generate_cpp_mocs\","
-GN_CONTENTS += " ]"
-GN_CONTENTS += " }"
-GN_CONTENTS += "}"
-!isEmpty(GN_CORE_INCLUDE_DIRS) {
- GN_CONTENTS += " if (!defined(core_include_dirs)) {"\
- " core_include_dirs = []"\
- " }"
- GN_CONTENTS += "core_include_dirs += ["
- for (inc, GN_CORE_INCLUDE_DIRS): GN_CONTENTS += " \"$$inc\","
- GN_CONTENTS += "]"
-}
-
-!isEmpty(GN_INCLUDES) {
- for (inc, GN_INCLUDES): GN_CONTENTS += $$cat($$inc,lines)
-}
-
-build_pass|!debug_and_release: write_file($$GN_FILE, GN_CONTENTS)
-
-# The generated Makefile shouldn't build anything by itself, just re-run qmake if necessary
-TEMPLATE = aux
-SOURCES =
-HEADERS =
-RESOURCES =
-
-QMAKE_DISTCLEAN += $$GN_FILE
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 202e34476e934633b3c2e4679a53c4b0847364a
+Subproject 735b1a398df409a98e84ed0eb1afb0bafdd9dff
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 501a687f..5ba4cb1c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -18,6 +18,10 @@ qt_feature_module_end(ONLY_EVALUATE_FEATURES)
# SUPPORT CHECK
##
+# TODO: here we should return FATAL_ERROR and ask user to define
+# FEATURE_qtwebenignebuild=OFF if one wants to only build qtpdf,
+# however our ci setup is not flexible enough and configure step must succeed
+
if(NOT ${QtWebEngine_SUPPORT})
add_custom_target(WebEngineErrorMessage ALL
${CMAKE_COMMAND} -E cmake_echo_color --red "QtWebEngine will not be built: ${QtWebEngine_ERROR}"
@@ -25,7 +29,11 @@ if(NOT ${QtWebEngine_SUPPORT})
VERBATIM
)
message("-- Support check for QtWebEngine failed: ${QtWebEngine_ERROR}")
- set(QT_FEATURE_qtwebengine_build OFF CACHE BOOL "Build QtWebEngine" FORCE)
+ set(QT_FEATURE_qtwebengine_build OFF CACHE BOOL "Build QtWebEngine Modules" FORCE)
+ set(QT_FEATURE_qtwebengine_core_build OFF CACHE BOOL "Build QtWebEngineCore" FORCE)
+ set(QT_FEATURE_qtwebengine_widgets_build OFF CACHE BOOL "Build QtWebEngineWidgets" FORCE)
+ set(QT_FEATURE_qtwebengine_quick_build OFF CACHE BOOL "Build QtWebEngineQuick" FORCE)
+
endif()
if(NOT ${QtPdf_SUPPORT})
@@ -44,29 +52,25 @@ if(NOT QT_FEATURE_qtwebengine_build AND NOT QT_FEATURE_qtpdf_build)
return()
endif()
-if(NOT QT_FEATURE_qtwebengine_build)
- set(QT_FEATURE_qtwebengine_widgets_build OFF CACHE BOOL "Build QtWebEngineWidgets" FORCE)
- set(QT_FEATURE_qtwebengine_quick_build OFF CACHE BOOL "Build QtWebEngineQuick" FORCE)
-endif()
-
##
# MODULES
##
-if(QT_FEATURE_qtwebengine_build)
+if(QT_FEATURE_qtwebengine_core_build)
add_subdirectory(core)
add_subdirectory(process)
- if(QT_FEATURE_qtwebengine_widgets_build)
- add_subdirectory(webenginewidgets)
- endif()
- if(QT_FEATURE_qtwebengine_quick_build)
- add_subdirectory(webenginequick)
- endif()
endif()
+if(QT_FEATURE_qtwebengine_widgets_build)
+ add_subdirectory(webenginewidgets)
+endif()
+if(QT_FEATURE_qtwebengine_quick_build)
+ add_subdirectory(webenginequick)
+endif()
+
if(QT_FEATURE_qtpdf_build)
add_subdirectory(pdf)
# keep log order, pdf build after webengine
- if(QT_FEATURE_qtwebengine_build)
+ if(QT_FEATURE_qtwebengine_core_build)
add_dependencies(run_pdf_GnReady WebEngineCore)
endif()
if(QT_FEATURE_qtwebengine_widgets_build)
@@ -101,7 +105,7 @@ if(NOT Ninja_FOUND)
-DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>
)
- if(QT_FEATURE_qtwebengine_build)
+ if(QT_FEATURE_qtwebengine_core_build)
add_dependencies(run_core_NinjaReady ninja)
endif()
if(QT_FEATURE_qtpdf_build)
@@ -128,7 +132,7 @@ if(NOT Gn_FOUND)
-DCMAKE_PREFIX_PATH:PATH=<INSTALL_DIR>
-DWEBENGINE_ROOT_BUILD_DIR=${PROJECT_BINARY_DIR}
)
- if(QT_FEATURE_qtwebengine_build)
+ if(QT_FEATURE_qtwebengine_core_build)
add_dependencies(run_core_GnReady gn)
endif()
if(QT_FEATURE_qtpdf_build)
@@ -173,7 +177,6 @@ endif()
# install gn for cross build
if(LINUX AND INSTALL_GN)
get_install_config(installConfig)
- message(${installConfig})
install(
PROGRAMS ${installDir}/bin/gn
CONFIGURATIONS ${installConfig}
diff --git a/src/buildtools/buildtools.pro b/src/buildtools/buildtools.pro
deleted file mode 100644
index 1366d18d..00000000
--- a/src/buildtools/buildtools.pro
+++ /dev/null
@@ -1,20 +0,0 @@
-TEMPLATE = subdirs
-
-linux {
- # configure_host.pro and configure_target.pro are phony pro files that
- # extract things like compiler and linker from qmake.
- # Only used on Linux as it is only important for cross-building and alternative compilers.
- configure_host.file = configure_host.pro
- configure_target.file = configure_target.pro
- configure_target.depends = configure_host
- gn.depends += configure_target
-
- SUBDIRS += configure_host configure_target
-}
-
-ninja.file = ninja.pro
-SUBDIRS += ninja
-
-gn.file = gn.pro
-gn.depends = ninja
-SUBDIRS += gn
diff --git a/src/buildtools/config/common.pri b/src/buildtools/config/common.pri
deleted file mode 100644
index cf990c79..00000000
--- a/src/buildtools/config/common.pri
+++ /dev/null
@@ -1,113 +0,0 @@
-# Shared configuration for all our supported platforms
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += buildtools-private webenginecore webenginecore-private
-
-gn_args += \
- use_qt=true \
- init_stack_vars=false \
- is_component_build=false \
- is_shared=true \
- enable_debugallocation=false \
- enable_media_remoting=false \
- enable_message_center=false \
- enable_nacl=false \
- enable_remoting=false \
- enable_reporting=false \
- enable_resource_allowlist_generation=false \
- enable_swiftshader=false \
- enable_swiftshader_vulkan=false \
- angle_enable_swiftshader=false \
- enable_web_speech=false \
- enable_widevine=true \
- forbid_non_component_debug_builds=false \
- has_native_accessibility=false \
- safe_browsing_mode=0 \
- skia_use_dawn=false \
- toolkit_views=false \
- treat_warnings_as_errors=false \
- use_allocator_shim=false \
- use_allocator=\"none\" \
- use_custom_libcxx=false \
- chrome_pgo_phase=0 \
- enable_hangout_services_extension=true
-
-# Closure compile requires Java
-gn_args += \
- optimize_webui=false \
- enable_js_type_check=false
-
-# We always embed v8 startup data currently
-gn_args += \
- v8_use_external_startup_data=false
-
-# Uses special flags for clang not available on xcode, and messes up gdb debugging too.
-gn_args += \
- strip_absolute_paths_from_debug_symbols=false
-
-greaterThan(QMAKE_JUMBO_MERGE_LIMIT,0) {
- gn_args += \
- use_jumbo_build=true \
- jumbo_file_merge_limit=$$QMAKE_JUMBO_MERGE_LIMIT
-}
-
-!greaterThan(QMAKE_JUMBO_MERGE_LIMIT,8) {
- gn_args += jumbo_build_excluded="[\"browser\"]"
-}
-
-precompile_header {
- gn_args += enable_precompiled_headers=true
-} else {
- gn_args += enable_precompiled_headers=false
-}
-
-CONFIG(release, debug|release):!qtConfig(webengine-developer-build) {
- gn_args += is_official_build=true
-} else {
- gn_args += is_official_build=false
- !qtConfig(webengine-developer-build): gn_args += is_unsafe_developer_build=false
- # Just doesn't work in many configurations:
- gn_args += from_here_uses_location_builtins=false
-}
-
-CONFIG(release, debug|release) {
- gn_args += is_debug=false
- force_debug_info {
- # Level 1 is not enough to generate all Chromium debug symbols on Windows
- msvc: gn_args += symbol_level=2
- else: gn_args += symbol_level=1
- } else {
- gn_args += symbol_level=0
- }
-}
-
-CONFIG(debug, debug|release) {
- gn_args += is_debug=true
- gn_args += use_debug_fission=false
- # MSVC requires iterator debug to always match and Qt leaves it default on.
- msvc: gn_args += enable_iterator_debugging=true
-
- # We also can not have optimized V8 binaries for MSVC as iterator debugging
- # would mismatch.
- msvc|v8base_debug: gn_args += v8_optimized_debug=false
-}
-
-!webcore_debug: gn_args += blink_symbol_level=0
-!v8base_debug: gn_args += remove_v8base_debug_symbols=true
-
-# Compiling with -Os makes a huge difference in binary size
-optimize_size: gn_args += optimize_for_size=true
-
-# We don't want to apply sanitizer options to the build tools (GN, dict convert, etc).
-!host_build {
- sanitize_address: gn_args += is_asan=true
- sanitize_thread: gn_args += is_tsan=true
- sanitize_memory: gn_args += is_msan=true
- sanitize_undefined: gn_args += is_ubsan=true is_ubsan_vptr=true
-}
-
-ccache {
- gn_args += cc_wrapper=\"ccache\"
-}
-
-qtConfig(force_asserts): gn_args += dcheck_always_on=true
diff --git a/src/buildtools/config/functions.pri b/src/buildtools/config/functions.pri
deleted file mode 100644
index 8c11faa1..00000000
--- a/src/buildtools/config/functions.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-defineReplace(qtwebengine_extractCFlag) {
- CFLAGS = $$QMAKE_CC $$QMAKE_CFLAGS
- OPTION = $$find(CFLAGS, $$1)
- OPTION = $$split(OPTION, =)
- PARAM = $$member(OPTION, 1)
- !isEmpty(PARAM): return ($$PARAM)
- return ($$OPTION)
-}
diff --git a/src/buildtools/config/linking.pri b/src/buildtools/config/linking.pri
deleted file mode 100644
index f295e2c6..00000000
--- a/src/buildtools/config/linking.pri
+++ /dev/null
@@ -1,77 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-QT_FOR_CONFIG += buildtools-private
-
-linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri
-
-!include($$linking_pri) {
- error("Could not find the linking information that gn should have generated.")
-}
-
-# Do not precompile any headers. We are only interested in the linker step.
-PRECOMPILED_HEADER =
-
-isEmpty(NINJA_OBJECTS): error("Missing object files from linking pri.")
-isEmpty(NINJA_LFLAGS): error("Missing linker flags from linking pri")
-isEmpty(NINJA_ARCHIVES): error("Missing archive files from linking pri")
-isEmpty(NINJA_LIBS): error("Missing library files from linking pri")
-NINJA_OBJECTS = $$eval($$list($$NINJA_OBJECTS))
-# Do manual response file linking for macOS and Linux
-
-RSP_OBJECT_FILE = $$OUT_PWD/$$getConfigDir()/$${TARGET}_o.rsp
-for(object, NINJA_OBJECTS): RSP_O_CONTENT += $$object
-write_file($$RSP_OBJECT_FILE, RSP_O_CONTENT)
-RSP_ARCHIVE_FILE = $$OUT_PWD/$$getConfigDir()/$${TARGET}_a.rsp
-for(archive, NINJA_ARCHIVES): RSP_A_CONTENT += $$archive
-write_file($$RSP_ARCHIVE_FILE, RSP_A_CONTENT)
-
-if(macos|ios) {
- !static {
- QMAKE_LFLAGS += -Wl,-filelist,$$shell_quote($${RSP_OBJECT_FILE})
- QMAKE_LFLAGS += @$${RSP_ARCHIVE_FILE}
- } else {
- OBJECTS += $$NINJA_OBJECTS
- LIBS_PRIVATE += $${NINJA_ARCHIVES}
- }
-}
-
-linux {
- !static {
- QMAKE_LFLAGS += @$${RSP_OBJECT_FILE}
- QMAKE_LFLAGS += -Wl,--start-group @$${RSP_ARCHIVE_FILE} -Wl,--end-group
- } else {
- OBJECTS += $$NINJA_OBJECTS
- LIBS_PRIVATE += -Wl,--start-group $${NINJA_ARCHIVES} -Wl,--end-group
- }
-}
-
-win32 {
- !static {
- QMAKE_LFLAGS += @$${RSP_OBJECT_FILE}
- QMAKE_LFLAGS += @$${RSP_ARCHIVE_FILE}
- } else {
- OBJECTS += $$NINJA_OBJECTS
- LIBS_PRIVATE += $${NINJA_ARCHIVES}
- }
-}
-
-LIBS_PRIVATE += $$NINJA_LIB_DIRS $$NINJA_LIBS
-# GN's LFLAGS doesn't always work across all the Linux configurations we support.
-# The Windows and macOS ones from GN does provide a few useful flags however
-
-unix:qtConfig(webengine-noexecstack): \
- QMAKE_LFLAGS += -Wl,-z,noexecstack
-linux {
- # add chromium flags
- for(flag, NINJA_LFLAGS) {
- # filter out some flags
- !contains(flag, .*noexecstack$): \
- !contains(flag, .*as-needed$): \
- !contains(flag, ^-B.*): \
- !contains(flag, ^-fuse-ld.*): \
- QMAKE_LFLAGS += $$flag
- }
-} else {
- QMAKE_LFLAGS += $$NINJA_LFLAGS
-}
-
-POST_TARGETDEPS += $$NINJA_TARGETDEPS
diff --git a/src/buildtools/config/linux.pri b/src/buildtools/config/linux.pri
deleted file mode 100644
index 7507d51e..00000000
--- a/src/buildtools/config/linux.pri
+++ /dev/null
@@ -1,178 +0,0 @@
-include(common.pri)
-include(functions.pri)
-
-defineReplace(extractCFlag) {
- return($$qtwebengine_extractCFlag($$1))
-}
-
-QT_FOR_CONFIG += gui-private webenginecore-private pdf-private
-
-gn_args += \
- use_cups=false \
- use_gio=false \
- use_gnome_keyring=false \
- use_udev=true \
- use_bundled_fontconfig=false \
- use_sysroot=false \
- enable_session_service=false \
- is_cfi=false \
- use_ozone=true \
- use_x11=false \
- ozone_auto_platforms=false \
- ozone_platform_headless=false \
- ozone_platform_external=true \
- ozone_platform=\"qt\" \
- ozone_extra_path=\"$$QTWEBENGINE_ROOT/src/core/ozone/ozone_extra.gni\"
-
-use_gold_linker: gn_args += use_gold=true
-else: gn_args += use_gold=false
-
-use_lld_linker: gn_args += use_lld=true
-else: gn_args += use_lld=false
-
-clang {
- clang_full_path = $$which($${QMAKE_CXX})
- # Remove the "/bin/clang++" part.
- clang_prefix = $$section(clang_full_path, /, 0, -3)
- gn_args += \
- is_clang=true \
- clang_use_chrome_plugins=false \
- clang_use_default_sample_profile=false \
- clang_base_path=\"$${clang_prefix}\"
-
- linux-clang-libc++: gn_args += use_libcxx=true
-} else {
- gn_args += \
- is_clang=false
-}
-
-cross_compile:!host_build {
- TOOLCHAIN_SYSROOT = $$[QT_SYSROOT]
- !isEmpty(TOOLCHAIN_SYSROOT): gn_args += target_sysroot=\"$${TOOLCHAIN_SYSROOT}\"
-}
-
-contains(QT_ARCH, "arm") {
- # Extract ARM specific compiler options that we have to pass to gn,
- # but let gn figure out a default if an option is not present.
- MTUNE = $$extractCFlag("-mtune=.*")
- !isEmpty(MTUNE): gn_args += arm_tune=\"$$MTUNE\"
-
- MFLOAT = $$extractCFlag("-mfloat-abi=.*")
- !isEmpty(MFLOAT): gn_args += arm_float_abi=\"$$MFLOAT\"
-
- MARCH = $$extractCFlag("-march=.*")
- !isEmpty(MARCH): gn_args += arm_arch=\"$$MARCH\"
-
- MARMV = $$replace(MARCH, "armv",)
- !isEmpty(MARMV) {
- MARMV = $$split(MARMV,)
- MARMV = $$member(MARMV, 0)
- lessThan(MARMV, 6): error("$$MARCH architecture is not supported")
- gn_args += arm_version=$$MARMV
- }
-
- # TODO: use neon detection from qtbase
- !lessThan(MARMV, 8) {
- gn_args += arm_use_neon=true
- } else {
- MFPU = $$extractCFlag("-mfpu=.*")
- !isEmpty(MFPU):contains(MFPU, ".*neon.*") {
- gn_args += arm_use_neon=true
- } else {
- gn_args += arm_use_neon=false
- # If the toolchain does not explicitly specify to use NEON instructions
- # we use arm_neon_optional for ARMv7
- equals(MARMV, 7): gn_args += arm_optionally_use_neon=true
- }
- }
-
- qtConfig(webengine-arm-thumb) {
- gn_args += arm_use_thumb=true # this adds -mthumb
- } else {
- gn_args += arm_use_thumb=false
- !qtConfig(webengine-system-ffmpeg) {
- # Fixme QTBUG-71772
- gn_args += media_use_ffmpeg=false
- gn_args += use_webaudio_ffmpeg=false
- }
- }
-}
-
-contains(QT_ARCH, "mips") {
- MARCH = $$extractCFlag("-march=.*")
- !isEmpty(MARCH) {
- equals(MARCH, "mips32r6"): gn_args += mips_arch_variant=\"r6\"
- else: equals(MARCH, "mips32r2"): gn_args += mips_arch_variant=\"r2\"
- else: equals(MARCH, "mips32"): gn_args += mips_arch_variant=\"r1\"
- } else {
- contains(QMAKE_CFLAGS, "mips32r6"): gn_args += mips_arch_variant=\"r6\"
- else: contains(QMAKE_CFLAGS, "mips32r2"): gn_args += mips_arch_variant=\"r2\"
- else: contains(QMAKE_CFLAGS, "mips32"): gn_args += mips_arch_variant=\"r1\"
- }
-
- contains(QMAKE_CFLAGS, "-mmsa"): gn_args += mips_use_msa=true
-
- contains(QMAKE_CFLAGS, "-mdsp2"): gn_args += mips_dsp_rev=2
- else: contains(QMAKE_CFLAGS, "-mdsp"): gn_args += mips_dsp_rev=1
-}
-
-host_build {
- gn_args += custom_toolchain=\"$$QTWEBENGINE_OUT_ROOT/src/toolchain:host\"
- GN_HOST_CPU = $$gnArch($$QT_ARCH)
- gn_args += host_cpu=\"$$GN_HOST_CPU\"
- # Don't bother trying to use system libraries in this case
- gn_args += use_glib=false
-} else {
- gn_args += custom_toolchain=\"$$QTWEBENGINE_OUT_ROOT/src/toolchain:target\"
- gn_args += host_toolchain=\"$$QTWEBENGINE_OUT_ROOT/src/toolchain:host\"
- GN_TARGET_CPU = $$gnArch($$QT_ARCH)
- cross_compile {
- gn_args += v8_snapshot_toolchain=\"$$QTWEBENGINE_OUT_ROOT/src/toolchain:v8_snapshot\"
- # FIXME: we should set host_cpu in case host-toolchain doesn't match os arch,
- # but currently we don't it available at this point
- gn_args += target_cpu=\"$$GN_TARGET_CPU\"
- } else {
- gn_args += host_cpu=\"$$GN_TARGET_CPU\"
- }
- !contains(QT_CONFIG, no-pkg-config) {
- # Strip '>2 /dev/null' from $$pkgConfigExecutable()
- PKGCONFIG = $$first($$list($$pkgConfigExecutable()))
- gn_args += pkg_config=\"$$PKGCONFIG\"
- PKG_CONFIG_HOST = $$(GN_PKG_CONFIG_HOST)
- pkgConfigLibDir = $$(PKG_CONFIG_LIBDIR)
- pkgConfigSysrootDir = $$(PKG_CONFIG_SYSROOT_DIR)
- isEmpty(PKG_CONFIG_HOST): cross_compile {
- !isEmpty(pkgConfigLibDir)|!isEmpty(pkgConfigSysrootDir) {
- PKG_CONFIG_HOST = $$pkgConfigHostExecutable()
- }
- }
- isEmpty(PKG_CONFIG_HOST): PKG_CONFIG_HOST = $$QMAKE_PKG_CONFIG_HOST
- gn_args += host_pkg_config=\"$$PKG_CONFIG_HOST\"
- }
-
- qtConfig(webengine-system-zlib) {
- qtConfig(webengine-system-minizip): gn_args += use_system_zlib=true use_system_minizip=true
- gn_args += pdfium_use_system_zlib=true
- }
-
- qtConfig(webengine-system-png) {
- gn_args += use_system_libpng=true pdfium_use_system_libpng=true
- }
-
- qtConfig(webengine-system-jpeg) {
- gn_args += use_system_libjpeg=true
- } else {
- gn_args += use_system_libjpeg=false
- }
- qtConfig(webengine-system-freetype) {
- gn_args += use_system_freetype=true
- } else {
- gn_args += use_system_freetype=false
- }
- qtConfig(webengine-system-harfbuzz) {
- gn_args += use_system_harfbuzz=true
- } else {
- gn_args += use_system_harfbuzz=false
- }
- gn_args += use_glib=false
-}
diff --git a/src/buildtools/config/mac_osx.pri b/src/buildtools/config/mac_osx.pri
deleted file mode 100644
index b53f9170..00000000
--- a/src/buildtools/config/mac_osx.pri
+++ /dev/null
@@ -1,38 +0,0 @@
-include(common.pri)
-load(functions)
-
-# Reuse the cached sdk version value from mac/sdk.prf if available
-# otherwise query for it.
-QMAKE_MAC_SDK_VERSION = $$eval(QMAKE_MAC_SDK.$${QMAKE_MAC_SDK}.SDKVersion)
-isEmpty(QMAKE_MAC_SDK_VERSION) {
- QMAKE_MAC_SDK_VERSION = $$system("/usr/bin/xcodebuild -sdk $${QMAKE_MAC_SDK} -version SDKVersion 2>/dev/null")
- isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
-}
-
-# chromium/build/mac/find_sdk.py expects the SDK version (mac_sdk_min) in Major.Minor format.
-# If Patch version is provided it fails with "Exception: No Major.Minor.Patch+ SDK found"
-QMAKE_MAC_SDK_VERSION_MAJOR_MINOR = $$section(QMAKE_MAC_SDK_VERSION, ".", 0, 1)
-
-QMAKE_CLANG_DIR = "/usr"
-QMAKE_CLANG_PATH = $$eval(QMAKE_MAC_SDK.macx-clang.$${QMAKE_MAC_SDK}.QMAKE_CXX)
-!isEmpty(QMAKE_CLANG_PATH) {
- clang_dir = $$clean_path("$$dirname(QMAKE_CLANG_PATH)/../")
- exists($$clang_dir): QMAKE_CLANG_DIR = $$clang_dir
-}
-
-QMAKE_CLANG_PATH = "$${QMAKE_CLANG_DIR}/bin/clang++"
-message("Using clang++ from $${QMAKE_CLANG_PATH}")
-system("$${QMAKE_CLANG_PATH} --version")
-
-
-gn_args += \
- is_clang=true \
- use_sysroot=false \
- use_system_xcode=true \
- clang_base_path=\"$${QMAKE_CLANG_DIR}\" \
- clang_use_chrome_plugins=false \
- mac_deployment_target=\"$${QMAKE_MACOSX_DEPLOYMENT_TARGET}\" \
- mac_sdk_min=\"$${QMAKE_MAC_SDK_VERSION_MAJOR_MINOR}\" \
- use_external_popup_menu=false \
- angle_enable_vulkan=false
-
diff --git a/src/buildtools/config/support.pri b/src/buildtools/config/support.pri
deleted file mode 100644
index e7f869a1..00000000
--- a/src/buildtools/config/support.pri
+++ /dev/null
@@ -1,257 +0,0 @@
-defineTest(qtwebengine_skipBuild) {
- skipBuildReason = $$1
- export(skipBuildReason)
-}
-
-# this should match webengine-core-support
-defineReplace(qtwebengine_checkWebEngineCoreError) {
- !linux:!win32:!macos {
- qtwebengine_skipBuild("QtWebEngine can be built only on Linux, Windows or macOS.")
- return(false)
- }
- static {
- qtwebengine_skipBuild("Static builds of QtWebEngine are not supported.")
- return(false)
- }
- !qtwebengine_checkForGui(QtWebEngine):return(false)
- !qtwebengine_checkForSubmodule(QtWebEngine):return(false)
- !qtwebengine_checkForWhiteSpace(QtWebEngine):return(false)
- !qtwebengine_checkForPlatform(QtWebEngine):return(false)
- !qtwebengine_checkForArch(QtWebEngine):return(false)
- !qtwebengine_checkForGperf(QtWebEngine):return(false)
- !qtwebengine_checkForBison(QtWebEngine):return(false)
- !qtwebengine_checkForFlex(QtWebEngine):return(false)
- !qtwebengine_checkForPython2(QtWebEngine):return(false)
- !qtwebengine_checkForNodejs(QtWebEngine):return(false)
- !qtwebengine_checkForSanitizer(QtWebEngine):return(false)
- linux:!qtwebengine_checkForPkgCfg(QtWebEngine):return(false)
- linux:!qtwebengine_checkForHostPkgCfg(QtWebEngine):return(false)
- linux:!qtwebengine_checkForGlibc(QtWebEngine):return(false)
- linux:!qtwebengine_checkForKhronos(QtWebEngine):return(false)
- linux:!qtwebengine_checkForPackage(QtWebEngine,nss):return(false)
- linux:!qtwebengine_checkForPackage(QtWebEngine,dbus):return(false)
- linux:!qtwebengine_checkForPackage(QtWebEngine,fontconfig):return(false)
- linux:!qtwebengine_checkForQpaXcb(QtWebEngine):return(false)
- win32:!qtwebengine_checkForCompiler64(QtWebEngine):return(false)
- win32:!qtwebengine_checkForWinVersion(QtWebEngine):return(false)
- return(true)
-}
-
-# this shuold match webengine-qtpdf-support
-defineReplace(qtwebengine_checkPdfError) {
- !linux:!win32:!macos:!ios {
- qtwebengine_skipBuild("QtPdf can be built only on Linux, Windows, macOS or iOS.")
- return(false)
- }
- !qtwebengine_checkForGui(QtPdf):return(false)
- !qtwebengine_checkForSubmodule(QtPdf):return(false)
- !qtwebengine_checkForWhiteSpace(QtPdf):return(false)
- !qtwebengine_checkForPlatform(QtPdf):return(false)
- !qtwebengine_checkForArch(QtPdf):return(false)
- !qtwebengine_checkForGperf(QtPdf):return(false)
- !qtwebengine_checkForBison(QtPdf):return(false)
- !qtwebengine_checkForFlex(QtPdf):return(false)
- !qtwebengine_checkForPython2(QtPdf):return(false)
- !qtwebengine_checkForSanitizer(QtPdf):return(false)
- linux:!qtwebengine_checkForPkgCfg(QtPdf):return(false)
- linux:!qtwebengine_checkForHostPkgCfg(QtPdf):return(false)
- win32:!qtwebengine_checkForWinVersion(QtPdf):return(false)
- return(true)
-}
-
-defineTest(qtwebengine_checkForGui) {
- module = $$1
- !qtHaveModule(gui) {
- qtwebengine_skipBuild("$${module} requires QtGui.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForSubmodule) {
- module = $$1
- !qtConfig(webengine-submodule) {
- qtwebengine_skipBuild("$${module} required submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForWhiteSpace) {
- module = $$1
- !qtConfig(webengine-nowhitespace) {
- qtwebengine_skipBuild("$${module} cannot be built in a path that contains whitespace characters.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForPlatform) {
- module = $$1
- qtConfig(webengine-no-platform-support) {
- !isEmpty(platformError) {
- qtwebengine_skipBuild("$${module} $${platformError}")
- return(false)
- }
- !isEmpty(QTWEBENGINE_OUT_ROOT) {
- include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
- QT_FOR_CONFIG += buildtools-private
- !isEmpty(PLATFORM_ERROR) {
- qtwebengine_skipBuild("$${module} $${PLATFORM_ERROR}")
- return(false)
- }
- }
- qtwebengine_skipBuild("$${module} will not be built. Platform unsupported.")
- return(false):
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForArch) {
- module = $$1
- !qtConfig(webengine-arch-support) {
- qtwebengine_skipBuild("$${module} can only be built for x86, x86-64, ARM, Aarch64, and MIPSel architectures.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForGperf) {
- module = $$1
- !qtConfig(webengine-gperf) {
- qtwebengine_skipBuild("Tool gperf is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForBison) {
- module = $$1
- !qtConfig(webengine-bison) {
- qtwebengine_skipBuild("Tool bison is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForFlex) {
- module = $$1
- !qtConfig(webengine-flex) {
- qtwebengine_skipBuild("Tool flex is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForPython2) {
- module = $$1
- !qtConfig(webengine-python2) {
- qtwebengine_skipBuild("Python version 2 (2.7.5 or later) is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForNodejs) {
- module = $$1
- !qtConfig(webengine-nodejs) {
- qtwebengine_skipBuild("Nodejs is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForSanitizer) {
- module = $$1
- sanitizer:!qtConfig(webengine-sanitizer) {
- qtwebengine_skipBuild("Chosen sanitizer configuration is not supported for $${module}." \
- "Check config.log for details or use -feature-webengine-sanitizer to force build with the chosen sanitizer configuration.")
- return(false);
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForPkgCfg) {
- module = $$1
- !qtConfig(pkg-config) {
- qtwebengine_skipBuild("A pkg-config support is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForHostPkgCfg) {
- module = $$1
- !qtConfig(webengine-host-pkg-config) {
- qtwebengine_skipBuild("Host pkg-config is required to build $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForGlibc) {
- module = $$1
- !qtConfig(webengine-system-glibc) {
- qtwebengine_skipBuild("A suitable version >= 2.27 of libc required to build $${module} could not be found.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForKhronos) {
- module = $$1
- !qtConfig(webengine-system-khr) {
- qtwebengine_skipBuild("Khronos development headers required to build $${module} are missing (see mesa/libegl1-mesa-dev)")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForPackage) {
- module = $$1
- package = $$2
- !qtConfig(webengine-system-$$package) {
- qtwebengine_skipBuild("A suitable version of $$package required to build QtWebEngine could not be found.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForQpaXcb) {
- module = $$1
- qtConfig(pkg-config):qtConfig(xcb):!qtConfig(webengine-ozone-x11) {
- qtwebengine_skipBuild("Could not find all necessary libraries for qpa-xcb support in $${module}.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForCompiler64) {
- module = $$1
- !qtConfig(webengine-win-compiler64) {
- qtwebengine_skipBuild("64-bit cross-building or native toolchain required to build $${module} could not be found.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_checkForWinVersion) {
- module = $$1
- !qtConfig(webengine-winversion) {
- qtwebengine_skipBuild("$${module} requires Visual Studio 2017 or higher.")
- return(false)
- }
- return(true)
-}
-
-defineTest(qtwebengine_makeCheckWebEngineCoreError) {
- include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
- QT_FOR_CONFIG += buildtools-private gui-private
- return($$qtwebengine_checkWebEngineCoreError())
-}
-
-defineTest(qtwebengine_makeCheckPdfError) {
- include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
- QT_FOR_CONFIG += buildtools-private gui-private
- return($$qtwebengine_checkPdfError())
-}
diff --git a/src/buildtools/config/windows.pri b/src/buildtools/config/windows.pri
deleted file mode 100644
index 843d6f2b..00000000
--- a/src/buildtools/config/windows.pri
+++ /dev/null
@@ -1,91 +0,0 @@
-include(common.pri)
-
-gn_args += \
- use_sysroot=false \
- enable_session_service=false \
- ninja_use_custom_environment_files=false \
- win_linker_timing=true \
- com_init_check_hook_disabled=true \
- heterogeneous_executables=true \
- enable_vr=false
-
-clang_cl {
- clang_full_path = $$system_path($$which($${QMAKE_CXX}))
- # Remove the "\bin\clang-cl.exe" part:
- clang_dir = $$dirname(clang_full_path)
- clang_prefix = $$join(clang_dir,,,"\..")
- gn_args += \
- is_clang=true \
- use_lld=true \
- clang_use_chrome_plugins=false \
- clang_base_path=\"$$system_path($$clean_path($$clang_prefix))\"
-} else {
- gn_args += is_clang=false use_lld=false
-}
-
-qtConfig(webengine-developer-build) {
- # Incremental linking doesn't work in release developer builds due to usage of /OPT:ICF
- # by Chromium.
- CONFIG(debug, debug|release) {
- gn_args += \
- use_incremental_linking=true
- } else {
- gn_args += \
- use_incremental_linking=false
- }
-} else {
- gn_args += \
- use_incremental_linking=false
-}
-
-defineTest(usingMSVC32BitCrossCompiler) {
- CL_DIR =
- for(dir, QMAKE_PATH_ENV) {
- exists($$dir/cl.exe) {
- CL_DIR = $$dir
- break()
- }
- }
- isEmpty(CL_DIR): {
- warning(Cannot determine location of cl.exe.)
- return(false)
- }
- CL_DIR = $$system_path($$CL_DIR)
- CL_DIR = $$split(CL_DIR, \\)
- CL_PLATFORM = $$take_last(CL_DIR)
- equals(CL_PLATFORM, amd64_x86): return(true)
- equals(CL_PLATFORM, x86)|equals(CL_PLATFORM, x64) {
- CL_PLATFORM = $$take_last(CL_DIR)
- equals(CL_PLATFORM, HostX64): return(true)
- }
- return(false)
-}
-
-msvc:contains(QT_ARCH, "i386"):!usingMSVC32BitCrossCompiler() {
- warning(Full debug info is disabled for chromium due to 32bit compiler)
- # The 32 bit MSVC linker runs out of memory if we do not remove all debug information.
- force_debug_info: gn_args -= symbol_level=1
- gn_args *= symbol_level=0
-}
-
-msvc {
- equals(MSVC_VER, 15.0) {
- MSVS_VERSION = 2017
- } else: equals(MSVC_VER, 16.0) {
- MSVS_VERSION = 2019
- } else {
- error("Visual Studio compiler version \"$$MSVC_VER\" is not supported by gn.")
- }
-
- gn_args += visual_studio_version=$$MSVS_VERSION
-
- SDK_PATH = $$(WINDOWSSDKDIR)
- VS_PATH= $$(VSINSTALLDIR)
- gn_args += visual_studio_path=\"$$clean_path($$VS_PATH)\"
- gn_args += windows_sdk_path=\"$$clean_path($$SDK_PATH)\"
-
- GN_TARGET_CPU = $$gnArch($$QT_ARCH)
- gn_args += target_cpu=\"$$GN_TARGET_CPU\"
-} else {
- error("Microsoft Visual Studio C++ compatible compiler is required by gn.")
-}
diff --git a/src/buildtools/configure.json b/src/buildtools/configure.json
deleted file mode 100644
index ba42c2c3..00000000
--- a/src/buildtools/configure.json
+++ /dev/null
@@ -1,843 +0,0 @@
-{
- "module": "buildtools",
- "depends": [
- "core-private",
- "gui-private",
- "printsupport"
- ],
- "condition": "module.gui",
- "commandline": {
- "options": {
- "build-qtwebengine-core": "boolean",
- "build-qtpdf": "boolean",
- "webengine-jumbo-build": { "type": "optionalString", "name": "merge_limit"}
- }
- },
- "libraries": {
- "webengine-dbus": {
- "label": "d-bus",
- "sources": [
- { "type": "pkgConfig", "args": "dbus-1" }
- ]
- },
- "webengine-fontconfig": {
- "label": "fontconfig",
- "sources": [
- { "type": "pkgConfig", "args": "fontconfig" }
- ]
- },
- "webengine-libdrm": {
- "label": "libdrm",
- "sources": [
- { "type": "pkgConfig", "args": "libdrm" }
- ]
- },
- "webengine-xcomposite": {
- "label": "xcomposite",
- "sources": [
- { "type": "pkgConfig", "args": "xcomposite" }
- ]
- },
- "webengine-xcursor": {
- "label": "xcursor",
- "sources": [
- { "type": "pkgConfig", "args": "xcursor" }
- ]
- },
- "webengine-xi": {
- "label": "xi",
- "sources": [
- { "type": "pkgConfig", "args": "xi" }
- ]
- },
- "webengine-xtst": {
- "label": "xtst",
- "sources": [
- { "type": "pkgConfig", "args": "xtst" }
- ]
- },
- "webengine-xkbfile": {
- "label": "xkbfile",
- "sources": [
- { "type": "pkgConfig", "args": "xkbfile" }
- ]
- },
- "webengine-nss": {
- "label": "nss >= 3.26",
- "sources": [
- { "type": "pkgConfig", "args": "nss >= 3.26" }
- ]
- },
- "webengine-x11" : {
- "label" : "x11",
- "sources": [
- { "type": "pkgConfig", "args": "x11" }
- ]
- },
- "webengine-xproto-gl": {
- "label": "xproto (glproto)",
- "sources": [
- { "type": "pkgConfig", "args": "glproto" }
- ]
- },
- "webengine-glib": {
- "label": "glib-2.0 >= 2.32.0",
- "sources": [
- { "type": "pkgConfig", "args": "glib-2.0 >= 2.32.0" }
- ]
- },
- "webengine-harfbuzz": {
- "label": "harfbuzz >= 2.4.0",
- "sources": [
- { "type": "pkgConfig", "args": "harfbuzz >= 2.4.0 harfbuzz-subset >= 2.4.0" }
- ]
- },
- "webengine-jpeglib": {
- "label": "compatible jpeglib",
- "type": "compile",
- "test": {
- "head": [
- "#include <cstdio>",
- "#include <cstring>",
- "extern \"C\" {",
- " #include <jpeglib.h>",
- "}"
- ],
- "main": [
- "JDIMENSION dummy;",
- "jpeg_crop_scanline(nullptr, &dummy, &dummy);",
- "jpeg_skip_scanlines(nullptr, dummy);"
- ]
- },
- "sources": [
- { "type": "pkgConfig", "args": "libjpeg" },
- "-ljpeg"
- ]
- },
- "webengine-libevent": {
- "label": "libevent",
- "sources": [
- { "type": "pkgConfig", "args": "libevent" }
- ]
- },
- "webengine-minizip": {
- "label": "minizip",
- "sources": [
- { "type": "pkgConfig", "args": "minizip" }
- ]
- },
- "webengine-png": {
- "label": "libpng >= 1.6.0",
- "sources": [
- { "type": "pkgConfig", "args": "libpng >= 1.6.0" }
- ]
- },
- "webengine-zlib": {
- "label": "zlib",
- "sources": [
- { "type": "pkgConfig", "args": "zlib" }
- ]
- },
- "webengine-re2": {
- "label": "re2",
- "test" : {
- "main": [
- "std::string s;",
- "re2::FilteredRE2 fre2(1);",
- "int id = 0;",
- "fre2.Add(s, {}, &id);",
- "const RE2 &re2 = fre2.GetRE2(id);"
- ]
- },
- "headers": "re2/filtered_re2.h",
- "sources": [
- { "type": "pkgConfig", "args": "re2" }
- ]
- },
- "webengine-icu": {
- "label": "icu >= 65",
- "sources": [
- { "type": "pkgConfig", "args": "icu-uc >= 65 icu-i18n >= 65" }
- ]
- },
- "webengine-webp": {
- "label": "libwebp, libwebpmux and libwebpdemux",
- "sources": [
- { "type": "pkgConfig", "args": "libwebp libwebpmux libwebpdemux" }
- ]
- },
- "webengine-lcms2": {
- "label": "lcms2",
- "sources": [
- { "type": "pkgConfig", "args": "lcms2" }
- ]
- },
- "webengine-freetype": {
- "label": "freetype >= 2.4.2",
- "test": {
- "head": [
- "#include <ft2build.h>",
- "#include FT_FREETYPE_H",
- "#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20402)",
- "# error This version of freetype is too old.",
- "#endif"
- ],
- "main": [
- "FT_Face ft_face = 0;",
- "FT_Reference_Face(ft_face);"
- ]
- },
- "sources": [
- { "type": "pkgConfig", "args": "freetype2" }
- ]
- },
- "webengine-libxml2": {
- "label": "compatible libxml2 and libxslt",
- "type": "compile",
- "test": {
- "tail": [
- "#if !defined(LIBXML_ICU_ENABLED)",
- "#error libxml icu not enabled",
- "#endif"
- ]
- },
- "headers": "libxml/xmlversion.h",
- "sources": [
- { "type": "pkgConfig", "args": "libxml-2.0 libxslt" }
- ]
- },
- "webengine-ffmpeg": {
- "label": "libavcodec libavformat libavutil",
- "sources": [
- { "type": "pkgConfig", "args": "libavcodec libavformat libavutil" }
- ]
- },
- "webengine-opus": {
- "label": "opus",
- "sources": [
- { "type": "pkgConfig", "args": "opus >= 1.3.1" }
- ]
- },
- "webengine-snappy": {
- "label": "snappy",
- "test": {
- "main": [
- "snappy::Source *src = 0;",
- "snappy::Sink *sink = 0;"
- ]
- },
- "headers": "snappy.h",
- "sources": [
- "-lsnappy"
- ]
- },
- "webengine-libvpx": {
- "label": "libvpx",
- "test": {
- "main": [
- "vpx_codec_cx_pkt pkt;",
- "pkt.data.frame.width[0] = 0u;",
- "pkt.data.frame.height[0] = 0u;",
- "auto a = CONSTRAINED_FROM_ABOVE_DROP;",
- "auto b = VPX_IMG_FMT_NV12;"
- ]
- },
- "headers": [ "vpx/vpx_encoder.h", "vpx/vp8cx.h", "vpx/vpx_image.h" ],
- "sources": [
- { "type": "pkgConfig", "args": "vpx >= 1.10.0" }
- ]
- }
- },
-
- "testDir": "config.tests",
- "tests" : {
- "webengine-bison": {
- "label": "bison",
- "type": "detectBison"
- },
- "webengine-flex": {
- "label": "flex",
- "type": "detectFlex"
- },
- "webengine-gn": {
- "label": "system gn",
- "type": "detectGn"
- },
- "webengine-glibc": {
- "label": "glibc > 2.16",
- "type": "compile",
- "test": {
- "include": "features.h",
- "tail": [
- "#if __GLIBC__ < 2 || __GLIBC_MINOR__ < 17",
- "#error glibc versions below 2.17 are not supported",
- "#endif"
- ]
- }
- },
- "webengine-gperf": {
- "label": "gperf",
- "type": "detectGperf"
- },
- "webengine-khr": {
- "label": "khr",
- "type": "compile",
- "test": {
- "include": "KHR/khrplatform.h",
- "qmake" : [
- "!isEmpty(QMAKE_INCDIR_EGL): INCLUDEPATH += $$QMAKE_INCDIR_EGL",
- "!isEmpty(QMAKE_INCDIR_OPENGL): INCLUDEPATH += $$QMAKE_INCDIR_OPENGL"
- ]
- }
- },
- "webengine-ninja": {
- "label": "system ninja",
- "type": "detectNinja",
- "log": "path"
- },
- "webengine-python2": {
- "label": "python2",
- "type": "detectPython2",
- "log": "location"
- },
- "webengine-winversion": {
- "label": "winversion",
- "type": "compile",
- "test": {
- "head" : [
- "#if !defined(__clang__) && _MSC_FULL_VER < 191426428",
- "#error unsupported Visual Studio version",
- "#endif"
- ]
- }
- },
- "webengine-host-pkg-config": {
- "label": "host pkg-config",
- "type": "detectHostPkgConfig",
- "log": "path"
- },
- "webengine-jumbo-build": {
- "label": "jumbo build merge limit",
- "type": "detectJumboBuild",
- "log": "merge_limit"
- },
- "webengine-win-compiler64": {
- "label": "64bit compiler",
- "type": "isWindowsHostCompiler64"
- },
- "webengine-platform-support": {
- "label": "platform supported",
- "type": "detectPlatform",
- "log": "platformSupport"
- },
- "webengine-arch-support": {
- "label": "architecture supported",
- "type": "detectArch"
- },
- "webengine-submodule" : {
- "label": "submodule initialized",
- "type": "detectSubmodule"
- },
- "webengine-nowhitespace" : {
- "label": "build path without whitespace",
- "type": "detectNoWhitespace"
- },
- "webengine-arm-thumb" : {
- "label": "thumb instruction set",
- "type": "hasThumbFlag"
- },
- "webengine-sanitizer": {
- "label" : "sanitizer support",
- "type": "isSanitizerSupported"
- },
- "webengine-noexecstack" : {
- "label": "linker supports -z noexecstack",
- "type": "linkerSupportsFlag",
- "flag": "-z,noexecstack"
- },
- "webengine-nodejs": {
- "label": "node.js",
- "type": "detectNodeJS",
- "log": "version10"
- }
- },
- "features": {
- "webengine-core-support": {
- "label": "Support Qt WebEngine Core",
- "condition": "(config.linux || config.win32 || config.macos)
- && !config.static
- && module.gui
- && features.webengine-submodule
- && features.webengine-nowhitespace
- && !features.webengine-no-platform-support
- && features.webengine-arch-support
- && features.webengine-gperf
- && features.webengine-bison
- && features.webengine-flex
- && features.webengine-python2
- && features.webengine-nodejs
- && (!config.sanitizer || features.webengine-sanitizer)
- && (!config.linux || features.pkg-config)
- && (!config.linux || features.webengine-host-pkg-config)
- && (!config.linux || features.webengine-system-glibc)
- && (!config.linux || features.webengine-system-khr)
- && (!config.linux || features.webengine-system-nss)
- && (!config.linux || features.webengine-system-dbus)
- && (!config.linux || features.webengine-system-fontconfig)
- && (!config.linux || !features.pkg-config || !features.xcb || features.webengine-ozone-x11)
- && (!config.win32 || features.webengine-win-compiler64)
- && (!config.win32 || features.webengine-winversion)",
- "output": [ "privateFeature" ]
- },
- "webengine-qtpdf-support": {
- "label": "Support Qt Pdf",
- "condition": "(config.linux || config.win32 || config.macos || config.ios)
- && module.gui
- && features.webengine-submodule
- && features.webengine-nowhitespace
- && !features.webengine-no-platform-support
- && features.webengine-arch-support
- && features.webengine-gperf
- && features.webengine-bison
- && features.webengine-flex
- && features.webengine-python2
- && (!config.sanitizer || features.webengine-sanitizer)
- && (!config.linux || features.pkg-config)
- && (!config.linux || features.webengine-host-pkg-config)
- && (!config.win32 || features.webengine-winversion)",
- "output": [ "privateFeature" ]
- },
- "build-qtwebengine-core": {
- "label": "Build Qt WebEngine Core",
- "purpose": "Provides WebEngine Core support.",
- "output": [ "privateFeature" ]
- },
- "build-qtpdf": {
- "label": "Support Qt PDF rendering module",
- "purpose": "Enables building the Qt PDF rendering module.",
- "output": [ "privateFeature" ]
- },
- "webengine-developer-build": {
- "label": "Developer build",
- "purpose": "Enables the developer build configuration.",
- "autoDetect": "features.private_tests",
- "output": [ "privateFeature" ]
- },
- "webengine-python2": {
- "label": "python2",
- "condition": "tests.webengine-python2",
- "output": [
- "privateFeature",
- { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python2.location" }
- ]
- },
- "webengine-gperf": {
- "label": "gperf",
- "condition": "tests.webengine-gperf",
- "output": [ "privateFeature" ]
- },
- "webengine-bison": {
- "label": "bison",
- "condition": "tests.webengine-bison",
- "output": [ "privateFeature" ]
- },
- "webengine-flex": {
- "label": "flex",
- "condition": "tests.webengine-flex",
- "output": [ "privateFeature" ]
- },
- "webengine-nodejs": {
- "label": "node.js",
- "condition": "tests.webengine-nodejs",
- "output": [ "privateFeature" ]
- },
- "webengine-nodejs10": {
- "label": "node.js",
- "condition": "tests.webengine-nodejs && tests.webengine-nodejs.version10",
- "output": [ "privateFeature" ]
- },
- "webengine-system-ninja": {
- "label": "Use System Ninja",
- "condition": "tests.webengine-ninja",
- "output": [
- "privateFeature",
- { "type": "varAssign", "name": "QMAKE_NINJA", "value": "tests.webengine-ninja.path" }
- ]
- },
- "webengine-system-fontconfig": {
- "label": "fontconfig",
- "condition": "libs.webengine-fontconfig",
- "output": [ "privateFeature" ]
- },
- "webengine-system-dbus": {
- "label": "dbus",
- "condition": "libs.webengine-dbus",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libdrm": {
- "label": "libdrm",
- "condition": "libs.webengine-libdrm",
- "output": [ "privateFeature" ]
- },
- "webengine-system-xcomposite": {
- "label": "xcomposite",
- "condition": "libs.webengine-xcomposite",
- "output": [ "privateFeature" ]
- },
- "webengine-system-xcursor": {
- "label": "xcursor",
- "condition": "libs.webengine-xcursor",
- "output": [ "privateFeature" ]
- },
- "webengine-system-xi": {
- "label": "xi",
- "condition": "libs.webengine-xi",
- "output": [ "privateFeature" ]
- },
- "webengine-system-xtst": {
- "label": "xtst",
- "condition": "libs.webengine-xtst",
- "output": [ "privateFeature" ]
- },
- "webengine-system-xkbfile": {
- "label": "xkbfile",
- "condition": "libs.webengine-xkbfile",
- "output": [ "privateFeature" ]
- },
- "webengine-system-gn": {
- "label": "Use System Gn",
- "autoDetect": "false",
- "condition": "tests.webengine-gn",
- "output": [ "privateFeature" ]
- },
- "webengine-system-khr" : {
- "label": "khr",
- "condition": "config.unix && tests.webengine-khr",
- "output": [ "privateFeature" ]
- },
- "webengine-system-nss": {
- "label": "nss",
- "condition": "config.unix && !config.darwin && libs.webengine-nss",
- "output": [ "privateFeature" ]
- },
- "webengine-system-glibc": {
- "label": "glibc",
- "condition": "config.linux && tests.webengine-glibc",
- "output": [ "privateFeature" ]
- },
- "webengine-system-x11" : {
- "label": "x11",
- "condition": "config.unix && libs.webengine-x11",
- "output": [ "privateFeature" ]
- },
- "webengine-system-xproto-gl" : {
- "label": "xproto (glproto)",
- "condition": "config.unix && libs.webengine-xproto-gl",
- "output": [ "privateFeature" ]
- },
- "webengine-host-pkg-config": {
- "label": "host-pkg-config",
- "condition": "config.unix && tests.webengine-host-pkg-config",
- "output": [
- "privateFeature",
- { "type": "varAssign", "name": "QMAKE_PKG_CONFIG_HOST", "value": "tests.webengine-host-pkg-config.path" }
- ]
- },
- "webengine-ozone-x11" : {
- "condition": "config.unix
- && features.xcb
- && features.webengine-system-x11
- && features.webengine-system-libdrm
- && features.webengine-system-xcomposite
- && features.webengine-system-xcursor
- && features.webengine-system-xi
- && features.webengine-system-xproto-gl
- && features.webengine-system-xtst
- && features.webengine-system-xkbfile",
- "output": [ "privateFeature" ]
- },
- "webengine-jumbo-build": {
- "label": "jumbo build merge batch",
- "condition": "tests.webengine-jumbo-build",
- "output": [
- "privateFeature",
- { "type": "varAssign", "name": "QMAKE_JUMBO_MERGE_LIMIT", "value": "tests.webengine-jumbo-build.merge_limit" }
- ]
- },
- "webengine-system-harfbuzz": {
- "label": "harfbuzz",
- "condition": "config.unix && features.system-harfbuzz && libs.webengine-harfbuzz",
- "output": [ "privateFeature" ]
- },
- "webengine-qt-harfbuzz" : {
- "label": "qtharfbuzz",
- "condition": "config.static && !features.system-harfbuzz && features.harfbuzz",
- "output": [ "privateFeature" ]
- },
- "webengine-system-glib" : {
- "label": "glib",
- "condition": "config.unix && libs.webengine-glib",
- "output": [ "privateFeature" ]
- },
- "webengine-system-minizip" : {
- "label": "minizip",
- "condition": "config.unix && libs.webengine-minizip",
- "output": [ "privateFeature" ]
- },
- "webengine-system-zlib" : {
- "label": "zlib",
- "condition": "config.unix && features.system-zlib && libs.webengine-zlib",
- "output": [ "privateFeature" ]
- },
- "webengine-qt-zlib" : {
- "label": "QtZlib",
- "condition": "config.static && !features.system-zlib",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libevent" : {
- "label": "libevent",
- "condition": "config.unix && libs.webengine-libevent",
- "output": [ "privateFeature" ]
- },
- "webengine-system-png" : {
- "label": "png",
- "condition": "config.unix && features.system-png && libs.webengine-png",
- "output": [ "privateFeature" ]
- },
- "webengine-qt-png" : {
- "label": "qtlibpng",
- "condition" : "config.static && !features.system-png && features.png",
- "output": [ "privateFeature" ]
- },
- "webengine-system-jpeg" : {
- "label": "JPEG",
- "condition": "config.unix && features.system-jpeg && libs.webengine-jpeglib",
- "output": [ "privateFeature" ]
- },
- "webengine-qt-jpeg" : {
- "label": "qtlibjpeg",
- "condition": "config.static && !features.system-jpeg && features.jpeg",
- "output": [ "privateFeature" ]
- },
- "webengine-system-re2": {
- "label": "re2",
- "condition": "config.unix && libs.webengine-re2",
- "output": [ "privateFeature" ]
- },
- "webengine-system-icu": {
- "label": "icu",
- "autoDetect": "false",
- "condition": "libs.webengine-icu",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libwebp": {
- "label": "libwebp, libwebpmux and libwebpdemux",
- "condition": "config.unix && libs.webengine-webp",
- "output": [ "privateFeature" ]
- },
- "webengine-system-opus": {
- "label": "opus",
- "condition": "config.unix && libs.webengine-opus",
- "output": [ "privateFeature" ]
- },
- "webengine-system-ffmpeg": {
- "label": "ffmpeg",
- "autoDetect": "false",
- "condition": "libs.webengine-ffmpeg && features.webengine-system-opus && features.webengine-system-libwebp",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libxml2": {
- "label": "libxml2 and libxslt",
- "condition": "config.unix && libs.webengine-libxml2",
- "output": [ "privateFeature" ]
- },
- "webengine-system-lcms2" : {
- "label": "lcms2",
- "condition": "config.unix && libs.webengine-lcms2",
- "output": [ "privateFeature" ]
- },
- "webengine-system-freetype" : {
- "label": "freetype",
- "condition": "config.unix && features.system-freetype && libs.webengine-freetype",
- "output": [ "privateFeature" ]
- },
- "webengine-qt-freetype" : {
- "label": "qtfreetype",
- "condition": "config.static && !features.system-freetype && features.freetype",
- "output": [ "privateFeature" ]
- },
- "webengine-system-libvpx" : {
- "label": "libvpx",
- "condition": "config.unix && libs.webengine-libvpx",
- "output": [ "privateFeature" ]
- },
- "webengine-system-snappy" : {
- "label": "snappy",
- "condition": "config.unix && libs.webengine-snappy",
- "output": [ "privateFeature" ]
- },
- "webengine-winversion" : {
- "label": "winversion",
- "condition": "config.win32 && tests.webengine-winversion",
- "output": [ "privateFeature" ]
- },
- "webengine-win-compiler64": {
- "label": "64bit compiler",
- "condition": "config.win32 && tests.webengine-win-compiler64",
- "output": [ "privateFeature" ]
- },
- "webengine-submodule": {
- "label": "submodule",
- "condition": "tests.webengine-submodule",
- "output": [ "privateFeature" ]
- },
- "webengine-nowhitespace": {
- "label": "nowhitespace",
- "condition" : "tests.webengine-nowhitespace",
- "output": [ "privateFeature" ]
- },
- "webengine-arch-support": {
- "label": "architecture",
- "condition" : "tests.webengine-arch-support",
- "output": [ "privateFeature" ]
- },
- "webengine-no-platform-support": {
- "label": "platform",
- "condition" : "!tests.webengine-platform-support",
- "output": [
- "privateFeature",
- { "type": "varAssign", "name": "PLATFORM_ERROR", "value": "tests.webengine-platform-support.platformSupport" }
- ]
- },
- "webengine-arm-thumb": {
- "label": "Thumb instruction set",
- "condition": "config.linux && arch.arm && tests.webengine-arm-thumb",
- "output": [ "privateFeature" ]
- },
- "webengine-sanitizer" : {
- "label": "Sanitizer",
- "autoDetect": "config.sanitizer && tests.webengine-sanitizer",
- "condition": "config.sanitizer",
- "output": [ "privateFeature" ]
- },
- "webengine-noexecstack": {
- "label": "linker supports -z noexecstack",
- "condition": "config.unix && tests.webengine-noexecstack",
- "output": [ "privateFeature" ]
- }
- },
- "report": [
- {
- "type": "skipBuildWarning",
- "condition": "!features.webengine-core-support && features.build-qtwebengine-core",
- "message": "qtwebengine_confCheckWebEngineCoreError"
- },
- {
- "type": "skipBuildWarning",
- "condition": "!features.webengine-qtpdf-support && features.build-qtpdf",
- "message": "qtwebengine_confCheckPdfError"
- },
- {
- "type": "note",
- "condition": "features.webengine-core-support && !features.build-qtwebengine-core",
- "message": "QtWebEngine build is disabled by user."
- },
- {
- "type": "note",
- "condition": "features.webengine-qtpdf-support && !features.build-qtpdf",
- "message": "QtPdf build is disabled by user."
- },
- {
- "type": "warning",
- "condition": "!features.webengine-core-support && features.build-qtwebengine-core",
- "message": "QtWebEngine will not be built."
- },
- {
- "type": "warning",
- "condition": "!features.webengine-qtpdf-support && features.build-qtpdf",
- "message": "QtPdf will not be built."
- },
- {
- "type": "warning",
- "condition": "config.ios && config.simulator && config.device && features.build-qtpdf",
- "message": "Building fat libray with device and simulator architectures will disable NEON."
- }
- ],
- "summary": [
- {
- "section": "Qt WebEngine Build Tools",
- "entries": [
- "webengine-system-ninja",
- {
- "message": "Jumbo Build Merge Limit",
- "type": "jumboBuild"
- },
- "webengine-developer-build",
- {
- "type": "feature",
- "args": "webengine-sanitizer",
- "condition": "!config.sanitizer"
- },
- {
- "section": "QtWebEngine required system libraries",
- "condition": "config.unix && !config.macos && !config.ios",
- "entries": [
- "webengine-system-fontconfig",
- "webengine-system-dbus",
- "webengine-system-nss",
- "webengine-system-khr",
- "webengine-system-glibc"
- ]
- },
- {
- "section": "QtWebEngine required system libraries for qpa-xcb",
- "condition": "config.unix && !config.macos && features.xcb",
- "entries": [
- "webengine-system-x11",
- "webengine-system-libdrm",
- "webengine-system-xcomposite",
- "webengine-system-xcursor",
- "webengine-system-xi",
- "webengine-system-xproto-gl",
- "webengine-system-xtst",
- "webengine-system-xkbfile"
- ]
- },
- {
- "section": "Optional system libraries used",
- "condition": "config.unix",
- "entries": [
- "webengine-system-re2",
- "webengine-system-icu",
- "webengine-system-libwebp",
- "webengine-system-opus",
- "webengine-system-ffmpeg",
- "webengine-system-libvpx",
- "webengine-system-snappy",
- "webengine-system-glib",
- "webengine-system-zlib",
- "webengine-system-minizip",
- "webengine-system-libevent",
- "webengine-system-libxml2",
- "webengine-system-lcms2",
- "webengine-system-png",
- "webengine-system-jpeg",
- "webengine-system-harfbuzz",
- "webengine-system-freetype"
- ]
- },
- {
- "section": "Qt 3rdparty libs",
- "condition": "config.static",
- "entries": [
- "webengine-qt-freetype",
- "webengine-qt-harfbuzz",
- "webengine-qt-png",
- "webengine-qt-jpeg",
- "webengine-qt-zlib"
- ]
- }
- ]
- }
- ]
-}
diff --git a/src/buildtools/configure_host.pro b/src/buildtools/configure_host.pro
deleted file mode 100644
index dd0d3e32..00000000
--- a/src/buildtools/configure_host.pro
+++ /dev/null
@@ -1,65 +0,0 @@
-# Prevent generating a makefile that attempts to create a lib
-TEMPLATE = aux
-
-# Pick up the host toolchain
-option(host_build)
-
-GN_HOST_CPU = $$gnArch($$QT_ARCH)
-!isEmpty(QT_TARGET_ARCH): GN_TARGET_CPU = $$gnArch($$QT_TARGET_ARCH)
-else: GN_TARGET_CPU = $$GN_HOST_CPU
-GN_OS = $$gnOS()
-
-clang: GN_CLANG = true
-else: GN_CLANG = false
-
-use_gold_linker: GN_USE_GOLD=true
-else: GN_USE_GOLD=false
-
-GN_V8_HOST_CPU = $$GN_HOST_CPU
-contains(GN_TARGET_CPU, "arm")|contains(GN_TARGET_CPU, "mipsel")|contains(GN_TARGET_CPU, "x86") {
- # The v8 snapshot need a host that matches bitwidth, so we build makesnapshot to 32-bit variants of host.
- contains(GN_V8_HOST_CPU, x64): GN_V8_HOST_CPU = "x86"
- else: contains(GN_V8_HOST_CPU, arm64): GN_V8_HOST_CPU = "arm"
- else: contains(GN_V8_HOST_CPU, mips64el): GN_V8_HOST_CPU = "mipsel"
-}
-
-GN_HOST_EXTRA_CPPFLAGS = $$(GN_HOST_TOOLCHAIN_EXTRA_CPPFLAGS)
-
-# We always use the gcc_toolchain, because clang_toolchain is just
-# a broken wrapper around it for Google's custom clang binaries.
-GN_CONTENTS = \
-"import(\"//build/config/sysroot.gni\")" \
-"import(\"//build/toolchain/gcc_toolchain.gni\")" \
-"gcc_toolchain(\"host\") {" \
-" cc = \"$$which($$QMAKE_CC)\" " \
-" cxx = \"$$which($$QMAKE_CXX)\" " \
-" ld = \"$$which($$QMAKE_LINK)\" " \
-" ar = \"$$which(ar)\" " \
-" nm = \"$$which(nm)\" " \
-" extra_cppflags = \"$$GN_HOST_EXTRA_CPPFLAGS\" " \
-" toolchain_args = { " \
-" current_os = \"$$GN_OS\" " \
-" current_cpu = \"$$GN_HOST_CPU\" " \
-" is_clang = $$GN_CLANG " \
-" use_gold = $$GN_USE_GOLD " \
-" } " \
-"}" \
-"gcc_toolchain(\"v8_snapshot\") {" \
-" cc = \"$$which($$QMAKE_CC)\" " \
-" cxx = \"$$which($$QMAKE_CXX)\" " \
-" ld = \"$$which($$QMAKE_LINK)\" " \
-" ar = \"$$which(ar)\" " \
-" nm = \"$$which(nm)\" " \
-" toolchain_args = { " \
-" current_os = \"$$GN_OS\" " \
-" current_cpu = \"$$GN_V8_HOST_CPU\" " \
-" v8_current_cpu = \"$$GN_TARGET_CPU\" " \
-" is_clang = $$GN_CLANG " \
-" use_gold = $$GN_USE_GOLD " \
-" } " \
-" } "
-
-GN_FILE = $$OUT_PWD/../toolchain/BUILD.gn
-!build_pass {
- write_file($$GN_FILE, GN_CONTENTS)
-}
diff --git a/src/buildtools/configure_target.pro b/src/buildtools/configure_target.pro
deleted file mode 100644
index 31aa283f..00000000
--- a/src/buildtools/configure_target.pro
+++ /dev/null
@@ -1,33 +0,0 @@
-# Prevent generating a makefile that attempts to create a lib
-TEMPLATE = aux
-
-GN_CPU = $$gnArch($$QT_ARCH)
-GN_OS = $$gnOS()
-
-clang: GN_CLANG = true
-else: GN_CLANG = false
-
-use_gold_linker: GN_USE_GOLD=true
-else: GN_USE_GOLD=false
-
-GN_CONTENTS = \
-"gcc_toolchain(\"target\") {" \
-" cc = \"$$which($$QMAKE_CC)\" " \
-" cxx = \"$$which($$QMAKE_CXX)\" " \
-" ld = \"$$which($$QMAKE_LINK)\" " \
-" ar = \"$$which($${CROSS_COMPILE}ar)\" " \
-" nm = \"$$which($${CROSS_COMPILE}nm)\" " \
-" toolchain_args = { " \
-" current_os = \"$$GN_OS\" " \
-" current_cpu = \"$$GN_CPU\" " \
-" is_clang = $$GN_CLANG " \
-" use_gold = $$GN_USE_GOLD " \
-" } " \
-"}"
-
-GN_FILE = $$OUT_PWD/../toolchain/BUILD.gn
-!build_pass {
- write_file($$GN_FILE, GN_CONTENTS, append)
-}
-
-QMAKE_DISTCLEAN += $$GN_FILE
diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro
deleted file mode 100644
index 9e8cfe15..00000000
--- a/src/buildtools/gn.pro
+++ /dev/null
@@ -1,39 +0,0 @@
-TEMPLATE = aux
-option(host_build)
-
-!debug_and_release: CONFIG += release
-
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-QT_FOR_CONFIG += buildtools-private
-
-build_pass|!debug_and_release {
- !qtConfig(webengine-system-gn): CONFIG(release, debug|release) {
- buildgn.target = build_gn
- out = $$gnPath()
- out_path = $$dirname(out)
- # check if it is not already build
- !exists($$out) {
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- gn_bootstrap = $$system_path($$absolute_path(gn/build/gen.py, $$src_3rd_party_dir))
-
- gn_gen_args = --no-last-commit-position --out-path $$out_path \
- --cc \"$$which($$QMAKE_CC)\" --cxx \"$$which($$QMAKE_CXX)\" \
- --ld \"$$which($$QMAKE_LINK)\"
-
- msvc:!clang_cl: gn_gen_args += --use-lto
-
- gn_configure = $$system_quote($$gn_bootstrap) $$gn_gen_args
- macos {
- gn_configure += --isysroot \"$$QMAKE_MAC_SDK_PATH\"
- }
- message($$gn_configure)
- !system("$$pythonPathForSystem() $$gn_configure") {
- error("GN generation error!")
- }
- !system("cd $$system_quote($$system_path($$out_path)) && $$system_quote($$system_path($$ninjaPath())) $$basename(out)" ) {
- error("GN build error!")
- }
- }
- QMAKE_DISTCLEAN += $$out
- }
-}
diff --git a/src/buildtools/ninja.pro b/src/buildtools/ninja.pro
deleted file mode 100644
index 66a6d5aa..00000000
--- a/src/buildtools/ninja.pro
+++ /dev/null
@@ -1,23 +0,0 @@
-TEMPLATE = aux
-
-!debug_and_release: CONFIG += release
-
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-QT_FOR_CONFIG += buildtools-private
-
-build_pass|!debug_and_release {
- !qtConfig(webengine-system-ninja): CONFIG(release, debug|release) {
- out = $$ninjaPath()
- # check if it is not already build
- !exists($$out) {
- mkpath($$dirname(out))
- src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
- ninja_configure = $$system_quote($$system_path($$absolute_path(ninja/configure.py, $$src_3rd_party_dir)))
- !system("cd $$system_quote($$system_path($$dirname(out))) && $$pythonPathForSystem() $$ninja_configure --bootstrap") {
- error("NINJA build error!")
- }
- }
- QMAKE_DISTCLEAN += $$out
- }
-}
-
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index f26a9a9e..7c17dc1f 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -1,8 +1,7 @@
cmake_minimum_required(VERSION 3.19)
find_package(Ninja 1.7.2 REQUIRED)
-find_package(Python2 2.7.5 REQUIRED)
-find_package(Nodejs 10.19 REQUIRED)
+find_package(Nodejs 12 REQUIRED)
find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_check_modules(XSCRNSAVER xscrnsaver)
@@ -257,6 +256,11 @@ foreach(arch ${archs})
renderer/extensions/resource_request_policy_qt.cpp renderer/extensions/resource_request_policy_qt.h
)
+ extend_gn_target(${buildGn} CONDITION WIN32
+ SOURCES
+ clipboard_util_win.cpp
+ )
+
##
# GN PARAMETERS SETUP
##
@@ -271,6 +275,7 @@ foreach(arch ${archs})
list(APPEND gnArgArg
qtwebengine_target="${buildDir}/${config}/${arch}:QtWebEngineCore"
+ enable_ipc_fuzzer=false
enable_media_remoting=false
enable_message_center=false
enable_nacl=false
@@ -282,6 +287,7 @@ foreach(arch ${archs})
angle_enable_swiftshader=false
enable_web_speech=false
enable_widevine=true
+ fatal_linker_warnings=false
has_native_accessibility=false
safe_browsing_mode=0
skia_use_dawn=false
@@ -421,9 +427,13 @@ foreach(arch ${archs})
)
endif()
+ if(NOT CLANG)
+ list(APPEND gnArgArg
+ enable_location_source=false)
+ endif()
+
if(WIN32)
list(APPEND gnArgArg
- enable_location_source=false
enable_session_service=false
ninja_use_custom_environment_files=false
com_init_check_hook_disabled=true
diff --git a/src/core/accessibility_tree_formatter_qt.cpp b/src/core/accessibility_tree_formatter_qt.cpp
index 5bbaeca2..7e84dfb8 100644
--- a/src/core/accessibility_tree_formatter_qt.cpp
+++ b/src/core/accessibility_tree_formatter_qt.cpp
@@ -189,12 +189,11 @@ std::string AccessibilityTreeFormatterQt::ProcessTreeForOutput(const base::Dicti
WriteAttribute(true, base::StringPrintf("%s", role_value.c_str()), &line);
const base::ListValue *states_value = nullptr;
- node.GetList("states", &states_value);
- if (states_value) {
- for (const auto &state : *states_value) {
+ if (node.GetList("states", &states_value)) {
+ for (const auto &state : states_value->GetList()) {
std::string state_value;
if (state.GetAsString(&state_value))
- WriteAttribute(true, state_value, &line);
+ WriteAttribute(false, state_value, &line);
}
}
diff --git a/src/core/api/CMakeLists.txt b/src/core/api/CMakeLists.txt
index dd667df7..ffc45003 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -78,6 +78,19 @@ qt_internal_add_docs(WebEngineCore
../doc/qtwebengine.qdocconf
)
+add_custom_command(
+ OUTPUT chromium_attributions.qdoc
+ COMMAND ${Python3_EXECUTABLE} chromium/tools/licenses.py
+ --file-template ../core/doc/about_credits.tmpl
+ --entry-template ../core/doc/about_credits_entry.tmpl
+ credits ${CMAKE_CURRENT_BINARY_DIR}/chromium_attributions.qdoc
+ DEPENDS ../doc/about_credits.tmpl ../doc/about_credits_entry.tmpl
+ WORKING_DIRECTORY ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty
+ USES_TERMINAL
+)
+add_custom_target(generate_chromium_attributions DEPENDS chromium_attributions.qdoc)
+add_dependencies(generate_docs_WebEngineCore generate_chromium_attributions)
+
##
# WEBENGINECORE RESOURCES
##
@@ -108,6 +121,7 @@ endforeach()
if (NOT QT_FEATURE_webengine_system_icu)
get_filename_component(icuFile ${buildDir}/${config}/${arch}/icudtl.dat REALPATH)
list(APPEND resourceFiles ${icuFile})
+ set_target_properties(WebEngineCore PROPERTIES ICUDTL_FILE ${icuFile})
endif()
if(QT_FEATURE_framework)
@@ -128,27 +142,20 @@ if(QT_FEATURE_framework)
add_custom_command(OUTPUT ${allResourceFiles} DEPENDS ${buildDir}/${config}/${arch}/QtWebEngineCore.stamp)
add_custom_target(generate_resources_${config} DEPENDS ${allResourceFiles})
else()
- if(NOT QT_WILL_INSTALL)
- set(rootPath ${CMAKE_INSTALL_PREFIX})
- else()
- if(NOT QT_SUPERBUILD)
- set(rootPath ${PROJECT_BINARY_DIR})
- else()
- set(rootPath ${QT_BUILD_DIR})
- endif()
- install(FILES ${localeFiles}
- DESTINATION ${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales
- CONFIGURATIONS ${config}
- )
- install(FILES ${resourceFiles}
- DESTINATION ${INSTALL_DATADIR}/resources
- CONFIGURATIONS ${config}
- )
- endif()
- addCopyCommand(WebEngineCore "${localeFiles}"
- ${rootPath}/${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales
+ install(FILES ${localeFiles}
+ DESTINATION ${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales
+ CONFIGURATIONS ${config}
)
- addCopyCommand(WebEngineCore "${resourceFiles}"
- ${rootPath}/${INSTALL_DATADIR}/resources
+ install(FILES ${resourceFiles}
+ DESTINATION ${INSTALL_DATADIR}/resources
+ CONFIGURATIONS ${config}
)
+ if(QT_SUPERBUILD OR NOT QT_WILL_INSTALL)
+ addCopyCommand(WebEngineCore "${localeFiles}"
+ ${QT_BUILD_DIR}/${INSTALL_TRANSLATIONSDIR}/qtwebengine_locales
+ )
+ addCopyCommand(WebEngineCore "${resourceFiles}"
+ ${QT_BUILD_DIR}/${INSTALL_DATADIR}/resources
+ )
+ endif()
endif()
diff --git a/src/core/api/Qt6WebEngineCoreMacros.cmake b/src/core/api/Qt6WebEngineCoreMacros.cmake
new file mode 100644
index 00000000..ada067b3
--- /dev/null
+++ b/src/core/api/Qt6WebEngineCoreMacros.cmake
@@ -0,0 +1,57 @@
+function(qt6_add_webengine_dictionary)
+ set(options)
+ set(oneValueArgs TARGET SOURCE OUTPUT_DIRECTORY)
+ set(multiValueArgs)
+
+ cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
+
+ if (NOT ARGS_SOURCE OR NOT EXISTS "${ARGS_SOURCE}" OR NOT IS_ABSOLUTE "${ARGS_SOURCE}")
+ message(FATAL_ERROR "Function qt_add_webengine_dictionary requires an absolute path to SOURCE dictionary.")
+ endif()
+
+ if (NOT ARGS_OUTPUT_DIRECTORY)
+ set(ARGS_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
+ endif()
+
+ get_property(isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
+ if(isMultiConfig)
+ set(spellcheckerDir ${ARGS_OUTPUT_DIRECTORY}/dict/qtwebengine_dictionaries)
+ set(copyCommand COMMAND ${CMAKE_COMMAND} -E copy_directory ${ARGS_OUTPUT_DIRECTORY}/dict
+ ${ARGS_OUTPUT_DIRECTORY}/$<CONFIG>
+ )
+ else()
+ set(spellcheckerDir ${ARGS_OUTPUT_DIRECTORY}/qtwebengine_dictionaries)
+ endif()
+
+ get_filename_component(dictName ${ARGS_SOURCE} NAME_WE)
+ add_custom_command(
+ OUTPUT ${spellcheckerDir}/${dictName}.bdic
+ DEPENDS ${ARGS_SOURCE}
+ COMMENT "Running qwebengine_convert_dict for ${ARGS_SOURCE}"
+ COMMAND ${CMAKE_COMMAND} -E make_directory ${spellcheckerDir}
+ COMMAND ${CMAKE_COMMAND} -E env
+ $<TARGET_FILE:${QT_CMAKE_EXPORT_NAMESPACE}::qwebengine_convert_dict>
+ ${ARGS_SOURCE} ${spellcheckerDir}/${dictName}.bdic
+ ${copyCommand}
+ )
+ if(NOT TARGET webengine_dictionaries)
+ add_custom_target(webengine_dictionaries)
+ endif()
+
+ # in case of large project gen target should have unique name since it can collide, use TARGET
+ if (ARGS_TARGET)
+ add_custom_target(gen-${ARGS_TARGET}-${dictName} DEPENDS ${spellcheckerDir}/${dictName}.bdic)
+ add_dependencies(${ARGS_TARGET} gen-${ARGS_TARGET}-${dictName})
+ add_dependencies(webengine_dictionaries gen-${ARGS_TARGET}-${dictName})
+ else()
+ add_custom_target(gen-${dictName} DEPENDS ${spellcheckerDir}/${dictName}.bdic)
+ add_dependencies(webengine_dictionaries gen-${dictName})
+ endif()
+
+endfunction()
+
+if(NOT QT_NO_CREATE_VERSIONLESS_FUNCTIONS)
+ function(qt_add_webengine_dictionary)
+ qt6_add_webengine_dictionary(${ARGN})
+ endfunction()
+endif()
diff --git a/src/core/api/configure.cmake b/src/core/api/configure.cmake
index e79bbbae..164c48a1 100644
--- a/src/core/api/configure.cmake
+++ b/src/core/api/configure.cmake
@@ -95,9 +95,9 @@ qt_feature("webengine-native-spellchecker" PUBLIC
qt_feature("webengine-extensions" PUBLIC
SECTION "WebEngine"
LABEL "Extensions"
- PURPOSE "Enables Chromium extensions within certain limits. Currently used for enabling the pdf viewer."
- AUTODETECT QT_FEATURE_webengine_printing_and_pdf
- CONDITION QT_FEATURE_webengine_printing_and_pdf
+ PURPOSE "Enables Chromium extensions within certain limits. Currently used by the pdf viewer and hangout webrtc extension."
+ AUTODETECT ON
+ CONDITION QT_FEATURE_webengine_printing_and_pdf OR QT_FEATURE_webengine_printing_and_pdf
)
qt_feature("webengine-webrtc" PRIVATE
LABEL "WebRTC"
diff --git a/src/core/api/core_api.pro b/src/core/api/core_api.pro
deleted file mode 100644
index 2408a586..00000000
--- a/src/core/api/core_api.pro
+++ /dev/null
@@ -1,119 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += webenginecore webenginecore-private
-
-TARGET = qtwebenginecoreapi$$qtPlatformTargetSuffix()
-DESTDIR = $$OUT_PWD/$$getConfigDir()
-
-TEMPLATE = lib
-
-CONFIG += staticlib
-QT += network core-private webenginecoreheaders-private quick qml
-
-qtConfig(webengine-printing-and-pdf): QT += printsupport
-
-# Don't create .prl file for this intermediate library because
-# their contents get used when linking against them, breaking
-# "-Wl,-whole-archive -lqtwebenginecoreapi --Wl,-no-whole-archive"
-CONFIG -= create_prl
-
-# Copy this logic from qt_module.prf so that the intermediate library can be
-# created to the same rules as the final module linking in core_module.pro.
-!host_build:if(win32|mac):!macx-xcode {
- qtConfig(debug_and_release): CONFIG += debug_and_release
- qtConfig(build_all): CONFIG += build_all
-}
-
-DEFINES += \
- BUILDING_CHROMIUM \
- NOMINMAX
-
-CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir()
-CHROMIUM_GEN_DIR = $$OUT_PWD/../$$getConfigDir()/gen
-INCLUDEPATH += $$QTWEBENGINE_ROOT/src/core \
- $$CHROMIUM_GEN_DIR \
- $$CHROMIUM_GEN_DIR/third_party/perfetto \
- $$CHROMIUM_GEN_DIR/third_party/perfetto/build_config \
- $$CHROMIUM_SRC_DIR/third_party/abseil-cpp \
- $$CHROMIUM_SRC_DIR/third_party/perfetto/include \
- $$CHROMIUM_SRC_DIR
-
-gcc: QMAKE_CXXFLAGS_WARN_ON = -Wno-unused-parameter
-
-HEADERS = \
- qwebenginecallback.h \
- qwebenginecallback_p.h \
- qwebengineclientcertificatestore.h \
- qtwebenginecoreglobal.h \
- qtwebenginecoreglobal_p.h \
- qwebenginecertificateerror.h \
- qwebenginecookiestore.h \
- qwebenginecookiestore_p.h \
- qwebenginefindtextresult.h \
- qwebenginefullscreenrequest.h \
- qwebenginehttprequest.h \
- qwebenginemessagepumpscheduler_p.h \
- qwebenginenotification.h \
- qwebenginequotarequest.h \
- qwebengineregisterprotocolhandlerrequest.h \
- qwebengineurlrequestinterceptor.h \
- qwebengineurlrequestinfo.h \
- qwebengineurlrequestinfo_p.h \
- qwebengineurlrequestjob.h \
- qwebengineurlscheme.h \
- qwebengineurlschemehandler.h \
- qwebenginecontextmenurequest.h \
- qwebenginecontextmenurequest_p.h \
- qwebenginedownloadrequest.h \
- qwebenginedownloadrequest_p.h \
- qwebengineloadrequest.h \
- qwebenginesettings.h \
- qwebenginescript.h \
- qwebenginescriptcollection.h \
- qwebenginescriptcollection_p.h \
- qwebengineprofile.h \
- qwebengineprofile_p.h \
- qwebengineclientcertificateselection.h \
- qwebenginehistory.h \
- qwebenginehistory_p.h \
- qwebenginepage.h \
- qwebenginepage_p.h
-
-SOURCES = \
- qtwebenginecoreglobal.cpp \
- qwebenginecertificateerror.cpp \
- qwebengineclientcertificatestore.cpp \
- qwebenginecookiestore.cpp \
- qwebenginefindtextresult.cpp \
- qwebenginefullscreenrequest.cpp \
- qwebenginehttprequest.cpp \
- qwebenginemessagepumpscheduler.cpp \
- qwebenginenotification.cpp \
- qwebenginequotarequest.cpp \
- qwebengineregisterprotocolhandlerrequest.cpp \
- qwebengineurlrequestinfo.cpp \
- qwebengineurlrequestjob.cpp \
- qwebengineurlscheme.cpp \
- qwebengineurlschemehandler.cpp \
- qwebenginecontextmenurequest.cpp \
- qwebenginedownloadrequest.cpp \
- qwebengineloadrequest.cpp \
- qwebenginesettings.cpp \
- qwebenginescript.cpp \
- qwebenginescriptcollection.cpp \
- qwebengineprofile.cpp \
- qwebengineclientcertificateselection.cpp \
- qwebenginehistory.cpp \
- qwebenginepage.cpp
-
-# Chromium headers included are not remotely clean
-CONFIG -= warning_clean
-
-msvc {
- # Create a list of object files that can be used as response file for the linker.
- # This is done to simulate -whole-archive on MSVC.
- QMAKE_POST_LINK = \
- "if exist $(DESTDIR_TARGET).objects del $(DESTDIR_TARGET).objects$$escape_expand(\\n\\t)" \
- "for %%a in ($(OBJECTS)) do echo $$shell_quote($$shell_path($$OUT_PWD))\\%%a >> $(DESTDIR_TARGET).objects"
-}
-
-load(qt_common)
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index 5bf46f78..5215f7ce 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -51,6 +51,7 @@
#endif
#include <QThread>
#include <QQuickWindow>
+#include "web_engine_context.h"
#if QT_CONFIG(opengl)
QT_BEGIN_NAMESPACE
@@ -206,6 +207,12 @@ Q_WEBENGINECORE_PRIVATE_EXPORT void initialize()
#endif // QT_CONFIG(opengl)
}
+
+bool closingDown()
+{
+ return WebEngineContext::closingDown();
+}
+
} // namespace QtWebEngineCore
#if defined(Q_OS_WIN)
diff --git a/src/core/api/qtwebenginecoreglobal_p.h b/src/core/api/qtwebenginecoreglobal_p.h
index 8214fc19..a716f582 100644
--- a/src/core/api/qtwebenginecoreglobal_p.h
+++ b/src/core/api/qtwebenginecoreglobal_p.h
@@ -67,6 +67,7 @@
namespace QtWebEngineCore {
Q_WEBENGINECORE_PRIVATE_EXPORT int processMain(int argc, const char **argv);
+Q_WEBENGINECORE_PRIVATE_EXPORT bool closingDown();
} // namespace
#if defined(Q_OS_WIN)
namespace sandbox {
diff --git a/src/core/api/qwebengineloadinginfo.h b/src/core/api/qwebengineloadinginfo.h
index b37dea60..0ff639ce 100644
--- a/src/core/api/qwebengineloadinginfo.h
+++ b/src/core/api/qwebengineloadinginfo.h
@@ -42,6 +42,7 @@
#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QExplicitlySharedDataPointer>
#include <QtCore/qobject.h>
#include <QtCore/qurl.h>
diff --git a/src/core/api/qwebenginepage.cpp b/src/core/api/qwebenginepage.cpp
index c58ef5e7..758bf390 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -833,8 +833,6 @@ QWebEnginePage::QWebEnginePage(QObject* parent)
the audio is played or stopped.
\note The signal is also emitted when calling the setAudioMuted() method.
- Also, if the audio is paused, this signal is emitted with an approximate \b{two-second
- delay}, from the moment the audio is paused.
*/
/*!
diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index bf11646b..76e76c12 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -221,9 +221,7 @@ QAccessible::Role BrowserAccessibilityQt::role() const
// Internal roles (matching auralinux and win)
case ax::mojom::Role::kKeyboard:
- case ax::mojom::Role::kIgnored:
case ax::mojom::Role::kImeCandidate:
- case ax::mojom::Role::kPresentational:
return QAccessible::NoRole;
// Used by Chromium to distinguish between the root of the tree
@@ -239,8 +237,6 @@ QAccessible::Role BrowserAccessibilityQt::role() const
case ax::mojom::Role::kAlert:
case ax::mojom::Role::kAlertDialog:
return QAccessible::AlertMessage;
- case ax::mojom::Role::kAnchor:
- return QAccessible::Link;
case ax::mojom::Role::kApplication:
return QAccessible::Document; // returning Application here makes Qt return the top level app object
case ax::mojom::Role::kArticle:
@@ -400,8 +396,6 @@ QAccessible::Role BrowserAccessibilityQt::role() const
return QAccessible::Grouping;
case ax::mojom::Role::kImage:
return QAccessible::Graphic;
- case ax::mojom::Role::kImageMap:
- return QAccessible::Document;
case ax::mojom::Role::kInlineTextBox:
return QAccessible::StaticText;
case ax::mojom::Role::kInputTime:
@@ -839,7 +833,7 @@ QAccessibleInterface *BrowserAccessibilityQt::cellAt(int row, int column) const
if (row < 0 || row >= rows || column < 0 || column >= columns)
return 0;
- base::Optional<int> cell_id = GetCellId(row, column);
+ absl::optional<int> cell_id = GetCellId(row, column);
BrowserAccessibility* cell = cell_id ? manager()->GetFromID(*cell_id) : nullptr;
if (cell) {
QAccessibleInterface *iface = static_cast<BrowserAccessibilityQt*>(cell);
diff --git a/src/core/browser_main_parts_qt.cpp b/src/core/browser_main_parts_qt.cpp
index 51a91001..6d03f117 100644
--- a/src/core/browser_main_parts_qt.cpp
+++ b/src/core/browser_main_parts_qt.cpp
@@ -60,6 +60,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/common/content_features.h"
+#include "content/public/common/result_codes.h"
#include "extensions/buildflags/buildflags.h"
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "content/public/browser/plugin_service.h"
@@ -87,6 +88,7 @@
#if defined(OS_MAC)
#include "base/message_loop/message_pump_mac.h"
+#include "services/device/public/cpp/geolocation/geolocation_manager.h"
#include "ui/base/idle/idle.h"
#endif
@@ -225,6 +227,23 @@ private:
QWebEngineMessagePumpScheduler m_scheduler;
};
+#if defined(OS_MAC)
+class FakeGeolocationManager : public device::GeolocationManager
+{
+public:
+ FakeGeolocationManager() = default;
+ ~FakeGeolocationManager() override = default;
+
+ // GeolocationManager implementation:
+ void StartWatchingPosition(bool) override {}
+ void StopWatchingPosition() override {}
+ device::LocationSystemPermissionStatus GetSystemPermission() const override
+ {
+ return device::LocationSystemPermissionStatus::kDenied;
+ }
+};
+#endif // defined(OS_MAC)
+
std::unique_ptr<base::MessagePump> messagePumpFactory()
{
static bool madePrimaryPump = false;
@@ -244,20 +263,23 @@ int BrowserMainPartsQt::PreEarlyInitialization()
#if BUILDFLAG(ENABLE_EXTENSIONS)
content::ChildProcessSecurityPolicy::GetInstance()->RegisterWebSafeScheme(extensions::kExtensionScheme);
#endif //ENABLE_EXTENSIONS
- return 0;
+ return content::RESULT_CODE_NORMAL_EXIT;
}
-void BrowserMainPartsQt::PreMainMessageLoopStart()
+void BrowserMainPartsQt::PreCreateMainMessageLoop()
{
+#if defined(OS_MAC)
+ m_geolocationManager = std::make_unique<FakeGeolocationManager>();
+#endif
}
-void BrowserMainPartsQt::PostMainMessageLoopStart()
+void BrowserMainPartsQt::PostCreateMainMessageLoop()
{
if (!device_event_log::IsInitialized())
device_event_log::Initialize(0 /* default max entries */);
}
-void BrowserMainPartsQt::PreMainMessageLoopRun()
+int BrowserMainPartsQt::PreMainMessageLoopRun()
{
ui::SelectFileDialog::SetFactory(new SelectFileDialogFactoryQt());
@@ -277,6 +299,7 @@ void BrowserMainPartsQt::PreMainMessageLoopRun()
base::BindOnce(&WebUsbDetectorQt::Initialize,
base::Unretained(m_webUsbDetector.get())));
}
+ return content::RESULT_CODE_NORMAL_EXIT;
}
void BrowserMainPartsQt::PostMainMessageLoopRun()
@@ -306,7 +329,7 @@ int BrowserMainPartsQt::PreCreateThreads()
#else
display::Screen::SetScreenInstance(new DesktopScreenQt);
#endif
- return 0;
+ return content::RESULT_CODE_NORMAL_EXIT;
}
static void CreatePoliciesAndDecorators(performance_manager::Graph *graph)
@@ -322,4 +345,11 @@ void BrowserMainPartsQt::PostCreateThreads()
performance_manager_registry_ = performance_manager::PerformanceManagerRegistry::Create();
}
+#if defined(OS_MAC)
+device::GeolocationManager *BrowserMainPartsQt::GetGeolocationManager()
+{
+ return m_geolocationManager.get();
+}
+#endif
+
} // namespace QtWebEngineCore
diff --git a/src/core/browser_main_parts_qt.h b/src/core/browser_main_parts_qt.h
index 07e8ffe9..1ee392e7 100644
--- a/src/core/browser_main_parts_qt.h
+++ b/src/core/browser_main_parts_qt.h
@@ -52,6 +52,10 @@ namespace content {
class ServiceManagerConnection;
}
+namespace device {
+class GeolocationManager;
+}
+
namespace performance_manager {
class PerformanceManager;
class PerformanceManagerRegistry;
@@ -68,18 +72,25 @@ public:
~BrowserMainPartsQt() override = default;
int PreEarlyInitialization() override;
- void PreMainMessageLoopStart() override;
- void PostMainMessageLoopStart() override;
- void PreMainMessageLoopRun() override;
+ void PreCreateMainMessageLoop() override;
+ void PostCreateMainMessageLoop() override;
+ int PreMainMessageLoopRun() override;
void PostMainMessageLoopRun() override;
int PreCreateThreads() override;
void PostCreateThreads() override;
+#if defined(OS_MAC)
+ device::GeolocationManager *GetGeolocationManager();
+#endif
+
private:
DISALLOW_COPY_AND_ASSIGN(BrowserMainPartsQt);
std::unique_ptr<performance_manager::PerformanceManager> performance_manager_;
std::unique_ptr<performance_manager::PerformanceManagerRegistry> performance_manager_registry_;
std::unique_ptr<WebUsbDetectorQt> m_webUsbDetector;
+#if defined(OS_MAC)
+ std::unique_ptr<device::GeolocationManager> m_geolocationManager;
+#endif
};
} // namespace QtWebEngineCore
diff --git a/src/core/browser_message_filter_qt.cpp b/src/core/browser_message_filter_qt.cpp
index 50064459..118b0eeb 100644
--- a/src/core/browser_message_filter_qt.cpp
+++ b/src/core/browser_message_filter_qt.cpp
@@ -40,7 +40,6 @@
#include "browser_message_filter_qt.h"
#include "chrome/browser/profiles/profile.h"
-#include "content/public/browser/plugin_service.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h"
@@ -85,14 +84,14 @@ void BrowserMessageFilterQt::OnRequestStorageAccessSync(int render_frame_id,
IPC::Message* reply_msg)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- base::Callback<void(bool)> callback = base::Bind(
+ auto callback = base::BindOnce(
&BrowserMessageFilterQt::OnRequestStorageAccessSyncResponse,
base::WrapRefCounted(this), reply_msg);
OnRequestStorageAccess(render_frame_id,
origin_url,
top_origin_url,
storage_type,
- callback);
+ std::move(callback));
}
void BrowserMessageFilterQt::OnRequestStorageAccessSyncResponse(IPC::Message *reply_msg, bool allowed)
@@ -108,14 +107,14 @@ void BrowserMessageFilterQt::OnRequestStorageAccessAsync(int render_frame_id,
int storage_type)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
- base::Callback<void(bool)> callback = base::Bind(
+ auto callback = base::BindOnce(
&BrowserMessageFilterQt::OnRequestStorageAccessAsyncResponse,
base::WrapRefCounted(this), render_frame_id, request_id);
OnRequestStorageAccess(render_frame_id,
origin_url,
top_origin_url,
storage_type,
- callback);
+ std::move(callback));
}
void BrowserMessageFilterQt::OnRequestStorageAccessAsyncResponse(int render_frame_id,
@@ -129,12 +128,12 @@ void BrowserMessageFilterQt::OnRequestStorageAccess(int /*render_frame_id*/,
const GURL &origin_url,
const GURL &top_origin_url,
int /*storage_type*/,
- base::Callback<void(bool)> callback)
+ base::OnceCallback<void(bool)> callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
bool allowed = m_profileData->canGetCookies(toQt(top_origin_url), toQt(origin_url));
- callback.Run(allowed);
+ std::move(callback).Run(allowed);
}
} // namespace QtWebEngineCore
diff --git a/src/core/browser_message_filter_qt.h b/src/core/browser_message_filter_qt.h
index 85de0486..c6e4e8d9 100644
--- a/src/core/browser_message_filter_qt.h
+++ b/src/core/browser_message_filter_qt.h
@@ -84,7 +84,7 @@ private:
const GURL &origin_url,
const GURL &top_origin_url,
int storage_type,
- base::Callback<void(bool)> callback);
+ base::OnceCallback<void(bool)> callback);
ProfileIODataQt *m_profileData;
};
diff --git a/src/core/certificate_error_controller.cpp b/src/core/certificate_error_controller.cpp
index d9a07ae4..1151fb5c 100644
--- a/src/core/certificate_error_controller.cpp
+++ b/src/core/certificate_error_controller.cpp
@@ -182,7 +182,7 @@ void CertificateErrorController::deactivate()
}
static QString getQStringForMessageId(int message_id) {
- base::string16 string = l10n_util::GetStringUTF16(message_id);
+ std::u16string string = l10n_util::GetStringUTF16(message_id);
return toQt(string);
}
diff --git a/src/core/client_cert_select_controller.cpp b/src/core/client_cert_select_controller.cpp
index 2f2d2471..b515fd41 100644
--- a/src/core/client_cert_select_controller.cpp
+++ b/src/core/client_cert_select_controller.cpp
@@ -93,8 +93,8 @@ void ClientCertSelectController::select(int index)
scoped_refptr<net::X509Certificate> cert = certInfo->certificate();
net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
std::move(certInfo),
- base::Bind(&content::ClientCertificateDelegate::ContinueWithCertificate,
- base::Passed(std::move(m_delegate)), std::move(cert)));
+ base::BindOnce(&content::ClientCertificateDelegate::ContinueWithCertificate,
+ std::move(m_delegate), std::move(cert)));
return;
}
std::vector<std::string> pem_encoded;
@@ -112,15 +112,15 @@ void ClientCertSelectController::select(const QSslCertificate &certificate)
}
QByteArray derCertificate = certificate.toDer();
scoped_refptr<net::X509Certificate> selectedCert =
- net::X509Certificate::CreateFromBytes(derCertificate.constData(), derCertificate.length());
+ net::X509Certificate::CreateFromBytes(base::make_span((const unsigned char *)derCertificate.constData(), derCertificate.length()));
for (auto &certInfo : m_clientCerts) {
scoped_refptr<net::X509Certificate> cert = certInfo->certificate();
if (cert->EqualsExcludingChain(selectedCert.get())) {
m_selected = true;
net::ClientCertIdentity::SelfOwningAcquirePrivateKey(
std::move(certInfo),
- base::Bind(&content::ClientCertificateDelegate::ContinueWithCertificate,
- base::Passed(std::move(m_delegate)), std::move(cert)));
+ base::BindOnce(&content::ClientCertificateDelegate::ContinueWithCertificate,
+ std::move(m_delegate), std::move(cert)));
return;
}
}
diff --git a/src/core/clipboard_change_observer.h b/src/core/clipboard_change_observer.h
index f9b33fc9..2ba189c9 100644
--- a/src/core/clipboard_change_observer.h
+++ b/src/core/clipboard_change_observer.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
@@ -41,22 +41,25 @@
#define CLIPBOARD_CHANGE_OBSERVER_H
#include <QClipboard>
-#include <QMap>
#include <QObject>
+#include "ui/base/clipboard/clipboard_sequence_number_token.h"
+
namespace QtWebEngineCore {
class ClipboardChangeObserver : public QObject {
Q_OBJECT
public:
ClipboardChangeObserver();
- quint64 getSequenceNumber(QClipboard::Mode mode) { return sequenceNumber.value(mode); }
+ const ui::ClipboardSequenceNumberToken &getPrimarySequenceNumber() { return m_primarySequenceNumber; }
+ const ui::ClipboardSequenceNumberToken &getSelectionSequenceNumber() { return m_selectionSequenceNumber; }
private Q_SLOTS:
void trackChange(QClipboard::Mode mode);
private:
- QMap<QClipboard::Mode, quint64> sequenceNumber;
+ ui::ClipboardSequenceNumberToken m_primarySequenceNumber;
+ ui::ClipboardSequenceNumberToken m_selectionSequenceNumber;
};
} // namespace QtWebEngineCore
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index d5d1abcd..09c08d7f 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2016 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
@@ -46,10 +46,12 @@
#include "type_conversion.h"
#include "base/logging.h"
+#include "base/strings/utf_offset_string_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/clipboard/custom_data_helper.h"
#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_monitor.h"
#include "ui/base/clipboard/clipboard_constants.h"
#include "ui/base/clipboard/clipboard_format_type.h"
#include "ui/base/ui_base_features.h"
@@ -76,7 +78,13 @@ ClipboardChangeObserver::ClipboardChangeObserver()
void ClipboardChangeObserver::trackChange(QClipboard::Mode mode)
{
- ++sequenceNumber[mode];
+ if (mode == QClipboard::Clipboard)
+ m_primarySequenceNumber = ui::ClipboardSequenceNumberToken();
+ else if (mode == QClipboard::Selection)
+ m_selectionSequenceNumber = ui::ClipboardSequenceNumberToken();
+ else
+ return;
+ ui::ClipboardMonitor::GetInstance()->NotifyClipboardDataChanged();
}
} // namespace QtWebEngineCore
@@ -107,7 +115,16 @@ Clipboard *Clipboard::Create()
namespace QtWebEngineCore {
-void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const ObjectMap &objects, std::unique_ptr<ui::DataTransferEndpoint> data_src)
+#if defined(Q_OS_WIN)
+extern std::string HtmlToCFHtml(const std::string &html, const std::string &base_url);
+extern void CFHtmlExtractMetadata(const std::string &cf_html, std::string *base_url,
+ size_t *html_start, size_t *fragment_start, size_t *fragment_end);
+#endif // defined(Q_OS_WIN)
+
+void ClipboardQt::WritePortableAndPlatformRepresentations(ui::ClipboardBuffer type,
+ const ObjectMap &objects,
+ std::vector<ui::Clipboard::PlatformRepresentation> platform_representations,
+ std::unique_ptr<ui::DataTransferEndpoint> data_src)
{
DCHECK(CalledOnValidThread());
DCHECK(IsSupportedClipboardBuffer(type));
@@ -115,6 +132,9 @@ void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const O
for (const auto &object : objects)
DispatchPortableRepresentation(object.first, object.second);
+ if (!platform_representations.empty())
+ DispatchPlatformRepresentations(std::move(platform_representations));
+
// Commit the accumulated data.
if (uncommittedData)
QGuiApplication::clipboard()->setMimeData(uncommittedData.take(),
@@ -125,24 +145,15 @@ void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const O
ObjectMap::const_iterator text_iter = objects.find(PortableFormat::kText);
if (text_iter != objects.end()) {
// Copy text and SourceTag to the selection clipboard.
- WritePortableRepresentations(ui::ClipboardBuffer::kSelection,
- ObjectMap(text_iter, text_iter + 1),
- std::move(data_src));
+ WritePortableAndPlatformRepresentations(ui::ClipboardBuffer::kSelection,
+ ObjectMap(text_iter, text_iter + 1),
+ {},
+ nullptr);
}
}
m_dataSrc[type] = std::move(data_src);
}
-void ClipboardQt::WritePlatformRepresentations(ui::ClipboardBuffer buffer,
- std::vector<ui::Clipboard::PlatformRepresentation> platform_representations,
- std::unique_ptr<ui::DataTransferEndpoint> data_src)
-{
- DCHECK(CalledOnValidThread());
- DCHECK(IsSupportedClipboardBuffer(buffer));
- DispatchPlatformRepresentations(std::move(platform_representations));
- m_dataSrc[buffer] = std::move(data_src);
-}
-
void ClipboardQt::WriteText(const char *text_data, size_t text_len)
{
getUncommittedData()->setText(QString::fromUtf8(text_data, text_len));
@@ -157,7 +168,17 @@ void ClipboardQt::WriteHTML(const char *markup_data, size_t markup_len, const ch
// Mirrors the behavior in ui/base/clipboard/clipboard_mac.mm in Chromium.
markup_string.prepend(QLatin1String("<meta charset='utf-8'>"));
#endif
+
+#if !defined(Q_OS_WIN)
getUncommittedData()->setHtml(markup_string);
+#else
+ std::string url;
+ if (url_len > 0)
+ url.assign(url_data, url_len);
+
+ std::string cf_html = HtmlToCFHtml(markup_string.toStdString(), url);
+ getUncommittedData()->setHtml(QString::fromStdString(cf_html));
+#endif // !defined(Q_OS_WIN)
}
void ClipboardQt::WriteRTF(const char *rtf_data, size_t data_len)
@@ -212,7 +233,7 @@ void ClipboardQt::Clear(ui::ClipboardBuffer type)
void ClipboardQt::ReadAvailableTypes(ui::ClipboardBuffer type,
const ui::DataTransferEndpoint *data_dst,
- std::vector<base::string16> *types) const
+ std::vector<std::u16string> *types) const
{
if (!types) {
NOTREACHED();
@@ -227,16 +248,21 @@ void ClipboardQt::ReadAvailableTypes(ui::ClipboardBuffer type,
if (mimeData->hasImage() && !mimeData->formats().contains(QStringLiteral("image/png")))
types->push_back(toString16(QStringLiteral("image/png")));
const QStringList formats = mimeData->formats();
- for (const QString &mimeType : formats)
- types->push_back(toString16(mimeType));
-
- const QByteArray customData = mimeData->data(QString::fromLatin1(ui::kMimeTypeWebCustomData));
- ui::ReadCustomDataTypes(customData.constData(), customData.size(), types);
+ for (const QString &mimeType : formats) {
+ // Special handling for chromium/x-web-custom-data. We must read the data
+ // and deserialize it to find the list of mime types to report.
+ if (mimeType == QString::fromLatin1(ui::kMimeTypeWebCustomData)) {
+ const QByteArray customData = mimeData->data(QString::fromLatin1(ui::kMimeTypeWebCustomData));
+ ui::ReadCustomDataTypes(customData.constData(), customData.size(), types);
+ } else {
+ types->push_back(toString16(mimeType));
+ }
+ }
}
void ClipboardQt::ReadText(ui::ClipboardBuffer type,
const ui::DataTransferEndpoint *data_dst,
- base::string16 *result) const
+ std::u16string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -256,7 +282,7 @@ void ClipboardQt::ReadAsciiText(ui::ClipboardBuffer type,
void ClipboardQt::ReadHTML(ui::ClipboardBuffer type,
const ui::DataTransferEndpoint *data_dst,
- base::string16 *markup, std::string *src_url,
+ std::u16string *markup, std::string *src_url,
uint32_t *fragment_start, uint32_t *fragment_end) const
{
markup->clear();
@@ -269,8 +295,35 @@ void ClipboardQt::ReadHTML(ui::ClipboardBuffer type,
type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
+
+#if !defined(Q_OS_WIN)
*markup = toString16(mimeData->html());
*fragment_end = static_cast<uint32_t>(markup->length());
+#else
+ const std::string cf_html = mimeData->html().toStdString();
+ size_t html_start = std::string::npos;
+ size_t start_index = std::string::npos;
+ size_t end_index = std::string::npos;
+ CFHtmlExtractMetadata(cf_html, src_url, &html_start, &start_index, &end_index);
+
+ // This might happen if the contents of the clipboard changed and CF_HTML is
+ // no longer available.
+ if (start_index == std::string::npos || end_index == std::string::npos
+ || html_start == std::string::npos)
+ return;
+
+ if (start_index < html_start || end_index < start_index)
+ return;
+
+ std::vector<size_t> offsets;
+ offsets.push_back(start_index - html_start);
+ offsets.push_back(end_index - html_start);
+ markup->assign(base::UTF8ToUTF16AndAdjustOffsets(cf_html.data() + html_start, &offsets));
+ // Ensure the Fragment points within the string; see https://crbug.com/607181.
+ size_t end = std::min(offsets[1], markup->length());
+ *fragment_start = base::checked_cast<uint32_t>(std::min(offsets[0], end));
+ *fragment_end = base::checked_cast<uint32_t>(end);
+#endif // !defined(Q_OS_WIN)
}
void ClipboardQt::ReadRTF(ui::ClipboardBuffer type,
@@ -313,9 +366,15 @@ void ClipboardQt::ReadImage(ui::ClipboardBuffer type,
return std::move(callback).Run(bitmap);
}
-void ClipboardQt::ReadCustomData(ui::ClipboardBuffer clipboard_type, const base::string16 &type,
+void ClipboardQt::ReadPng(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *, ui::Clipboard::ReadPngCallback callback) const
+{
+ // TODO(crbug.com/1201018): Implement this.
+ NOTIMPLEMENTED();
+}
+
+void ClipboardQt::ReadCustomData(ui::ClipboardBuffer clipboard_type, const std::u16string &type,
const ui::DataTransferEndpoint *data_dst,
- base::string16 *result) const
+ std::u16string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
clipboard_type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -325,14 +384,14 @@ void ClipboardQt::ReadCustomData(ui::ClipboardBuffer clipboard_type, const base:
ui::ReadCustomDataForType(customData.constData(), customData.size(), type, result);
}
-void ClipboardQt::ReadBookmark(const ui::DataTransferEndpoint *data_dst, base::string16 *title, std::string *url) const
+void ClipboardQt::ReadBookmark(const ui::DataTransferEndpoint *data_dst, std::u16string *title, std::string *url) const
{
NOTIMPLEMENTED();
}
void ClipboardQt::ReadSvg(ui::ClipboardBuffer clipboard_type,
const ui::DataTransferEndpoint *,
- base::string16 *result) const
+ std::u16string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
clipboard_type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
@@ -360,10 +419,11 @@ void ClipboardQt::ReadData(const ui::ClipboardFormatType &format,
*result = std::string(byteArray.constData(), byteArray.length());
}
-uint64_t ClipboardQt::GetSequenceNumber(ui::ClipboardBuffer type) const
+const ui::ClipboardSequenceNumberToken &ClipboardQt::GetSequenceNumber(ui::ClipboardBuffer type) const
{
- return clipboardChangeObserver()->getSequenceNumber(type == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard
- : QClipboard::Selection);
+ return type == ui::ClipboardBuffer::kCopyPaste
+ ? clipboardChangeObserver()->getPrimarySequenceNumber()
+ : clipboardChangeObserver()->getSelectionSequenceNumber();
}
const ui::DataTransferEndpoint *ClipboardQt::GetSource(ui::ClipboardBuffer buffer) const
@@ -406,25 +466,17 @@ bool ClipboardQt::IsSelectionBufferAvailable() const
}
#endif
-std::vector<base::string16> ClipboardQt::ReadAvailablePlatformSpecificFormatNames(ui::ClipboardBuffer buffer, const ui::DataTransferEndpoint *data_dst) const
-{
- // based on ClipboardX11
- std::vector<base::string16> types;
- if (IsFormatAvailable(ui::ClipboardFormatType::GetPlainTextType(), buffer, data_dst))
- types.push_back(base::UTF8ToUTF16(ui::ClipboardFormatType::GetPlainTextType().GetName()));
- if (IsFormatAvailable(ui::ClipboardFormatType::GetHtmlType(), buffer, data_dst))
- types.push_back(base::UTF8ToUTF16(ui::ClipboardFormatType::GetHtmlType().GetName()));
- if (IsFormatAvailable(ui::ClipboardFormatType::GetRtfType(), buffer, data_dst))
- types.push_back(base::UTF8ToUTF16(ui::ClipboardFormatType::GetRtfType().GetName()));
- if (IsFormatAvailable(ui::ClipboardFormatType::GetBitmapType(), buffer, data_dst))
- types.push_back(base::UTF8ToUTF16(ui::kMimeTypePNG));
- if (IsFormatAvailable(ui::ClipboardFormatType::GetSvgType(), buffer, data_dst))
- types.push_back(base::UTF8ToUTF16(ui::kMimeTypeSvg));
+std::vector<std::u16string> ClipboardQt::ReadAvailablePlatformSpecificFormatNames(ui::ClipboardBuffer buffer, const ui::DataTransferEndpoint *data_dst) const
+{
+ Q_UNUSED(data_dst);
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
buffer == ui::ClipboardBuffer::kCopyPaste ? QClipboard::Clipboard : QClipboard::Selection);
- if (base::FeatureList::IsEnabled(features::kClipboardFilenames) && mimeData->hasUrls())
- types.push_back(base::UTF8ToUTF16(ui::kMimeTypeURIList));
- // ### Should we add non-standard mime-types?
+ if (!mimeData)
+ return {};
+ std::vector<std::u16string> types;
+ const QStringList formats = mimeData->formats();
+ for (const QString &mimeType : formats)
+ types.push_back(toString16(mimeType));
return types;
}
diff --git a/src/core/clipboard_qt.h b/src/core/clipboard_qt.h
index 0b77d226..a9a1ef7d 100644
--- a/src/core/clipboard_qt.h
+++ b/src/core/clipboard_qt.h
@@ -47,29 +47,30 @@ namespace QtWebEngineCore {
class ClipboardQt : public ui::Clipboard
{
public:
- uint64_t GetSequenceNumber(ui::ClipboardBuffer type) const override;
+ const ui::ClipboardSequenceNumberToken &GetSequenceNumber(ui::ClipboardBuffer type) const override;
bool IsFormatAvailable(const ui::ClipboardFormatType &format,
ui::ClipboardBuffer buffer,
const ui::DataTransferEndpoint *data_dst) const override;
void Clear(ui::ClipboardBuffer type) override;
void ReadAvailableTypes(ui::ClipboardBuffer type,
const ui::DataTransferEndpoint *data_dst,
- std::vector<base::string16> *types) const override;
- void ReadText(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *data_dst, base::string16 *result) const override;
+ std::vector<std::u16string> *types) const override;
+ void ReadText(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *data_dst, std::u16string *result) const override;
void ReadAsciiText(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *data_dst, std::string *result) const override;
- void ReadHTML(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *data_dst, base::string16 *markup, std::string *src_url, uint32_t *fragment_start,
+ void ReadHTML(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *data_dst, std::u16string *markup, std::string *src_url, uint32_t *fragment_start,
uint32_t *fragment_end) const override;
void ReadRTF(ui::ClipboardBuffer type, const ui::DataTransferEndpoint *data_dst, std::string *result) const override;
void ReadImage(ui::ClipboardBuffer buffer, const ui::DataTransferEndpoint *data_dst, ReadImageCallback callback) const override;
- void ReadCustomData(ui::ClipboardBuffer clipboard_type, const base::string16 &type, const ui::DataTransferEndpoint *data_dst, base::string16 *result) const override;
- void ReadBookmark(const ui::DataTransferEndpoint *data_dst, base::string16 *title, std::string *url) const override;
+ void ReadCustomData(ui::ClipboardBuffer clipboard_type, const std::u16string &type, const ui::DataTransferEndpoint *data_dst, std::u16string *result) const override;
+ void ReadBookmark(const ui::DataTransferEndpoint *data_dst, std::u16string *title, std::string *url) const override;
void ReadData(const ui::ClipboardFormatType &format, const ui::DataTransferEndpoint *data_dst, std::string *result) const override;
#if defined(USE_OZONE)
bool IsSelectionBufferAvailable() const override;
#endif
void OnPreShutdown() override {}
- void ReadSvg(ui::ClipboardBuffer, const ui::DataTransferEndpoint *, base::string16 *) const override;
- std::vector<base::string16> ReadAvailablePlatformSpecificFormatNames(ui::ClipboardBuffer buffer, const ui::DataTransferEndpoint *data_dst) const override;
+ void ReadSvg(ui::ClipboardBuffer, const ui::DataTransferEndpoint *, std::u16string *) const override;
+ void ReadPng(ui::ClipboardBuffer, const ui::DataTransferEndpoint *, ui::Clipboard::ReadPngCallback) const override;
+ std::vector<std::u16string> ReadAvailablePlatformSpecificFormatNames(ui::ClipboardBuffer buffer, const ui::DataTransferEndpoint *data_dst) const override;
const ui::DataTransferEndpoint *GetSource(ui::ClipboardBuffer buffer) const override;
@@ -78,12 +79,9 @@ public:
std::vector<ui::FileInfo> *result) const override;
protected:
- void WritePortableRepresentations(
+ void WritePortableAndPlatformRepresentations(
ui::ClipboardBuffer buffer,
const ObjectMap &objects,
- std::unique_ptr<ui::DataTransferEndpoint> data_src) override;
- void WritePlatformRepresentations(
- ui::ClipboardBuffer buffer,
std::vector<Clipboard::PlatformRepresentation> platform_representations,
std::unique_ptr<ui::DataTransferEndpoint> data_src) override;
void WriteText(const char *text_data, size_t text_len) override;
diff --git a/src/core/clipboard_util_win.cpp b/src/core/clipboard_util_win.cpp
new file mode 100644
index 00000000..ae615b3b
--- /dev/null
+++ b/src/core/clipboard_util_win.cpp
@@ -0,0 +1,140 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE.Chromium file.
+
+#include <string>
+
+#include "base/strings/stringprintf.h"
+#include "base/strings/string_util.h"
+
+// These functions are copied from ui/base/clipboard/clipboard_util_win.cc
+
+namespace QtWebEngineCore {
+
+// Helper method for converting from text/html to MS CF_HTML.
+// Documentation for the CF_HTML format is available at
+// http://msdn.microsoft.com/en-us/library/aa767917(VS.85).aspx
+// HtmlToCFHtml is based on similar method in
+// WebCore/platform/win/ClipboardUtilitiesWin.cpp.
+std::string HtmlToCFHtml(const std::string &html, const std::string &base_url)
+{
+ if (html.empty())
+ return std::string();
+
+#define MAX_DIGITS 10
+#define MAKE_NUMBER_FORMAT_1(digits) MAKE_NUMBER_FORMAT_2(digits)
+#define MAKE_NUMBER_FORMAT_2(digits) "%0" #digits "u"
+#define NUMBER_FORMAT MAKE_NUMBER_FORMAT_1(MAX_DIGITS)
+
+ static const char *header = "Version:0.9\r\n"
+ "StartHTML:" NUMBER_FORMAT "\r\n"
+ "EndHTML:" NUMBER_FORMAT "\r\n"
+ "StartFragment:" NUMBER_FORMAT "\r\n"
+ "EndFragment:" NUMBER_FORMAT "\r\n";
+ static const char *source_url_prefix = "SourceURL:";
+
+ static const char *start_markup = "<html>\r\n<body>\r\n<!--StartFragment-->";
+ static const char *end_markup = "<!--EndFragment-->\r\n</body>\r\n</html>";
+
+ // Calculate offsets
+ size_t start_html_offset = strlen(header) - strlen(NUMBER_FORMAT) * 4 + MAX_DIGITS * 4;
+ if (!base_url.empty()) {
+ start_html_offset += strlen(source_url_prefix) + base_url.length() + 2; // Add 2 for \r\n.
+ }
+ size_t start_fragment_offset = start_html_offset + strlen(start_markup);
+ size_t end_fragment_offset = start_fragment_offset + html.length();
+ size_t end_html_offset = end_fragment_offset + strlen(end_markup);
+
+ std::string result = base::StringPrintf(header, start_html_offset, end_html_offset,
+ start_fragment_offset, end_fragment_offset);
+ if (!base_url.empty()) {
+ result += source_url_prefix;
+ result += base_url;
+ result += "\r\n";
+ }
+ result += start_markup;
+ result += html;
+ result += end_markup;
+
+#undef MAX_DIGITS
+#undef MAKE_NUMBER_FORMAT_1
+#undef MAKE_NUMBER_FORMAT_2
+#undef NUMBER_FORMAT
+
+ return result;
+}
+
+void CFHtmlExtractMetadata(const std::string &cf_html, std::string *base_url, size_t *html_start,
+ size_t *fragment_start, size_t *fragment_end)
+{
+ // Obtain base_url if present.
+ if (base_url) {
+ static constexpr char kSrcUrlStr[] = "SourceURL:";
+ size_t line_start = cf_html.find(kSrcUrlStr);
+ if (line_start != std::string::npos) {
+ size_t src_end = cf_html.find("\n", line_start);
+ size_t src_start = line_start + strlen(kSrcUrlStr);
+ if (src_end != std::string::npos && src_start != std::string::npos) {
+ *base_url = cf_html.substr(src_start, src_end - src_start);
+ base::TrimWhitespaceASCII(*base_url, base::TRIM_ALL, base_url);
+ }
+ }
+ }
+
+ // Find the markup between "<!--StartFragment-->" and "<!--EndFragment-->".
+ // If the comments cannot be found, like copying from OpenOffice Writer,
+ // we simply fall back to using StartFragment/EndFragment bytecount values
+ // to determine the fragment indexes.
+ std::string cf_html_lower = base::ToLowerASCII(cf_html);
+ size_t markup_start = cf_html_lower.find("<html", 0);
+ if (html_start) {
+ *html_start = markup_start;
+ }
+ size_t tag_start = cf_html.find("<!--StartFragment", markup_start);
+ if (tag_start == std::string::npos) {
+ static constexpr char kStartFragmentStr[] = "StartFragment:";
+ size_t start_fragment_start = cf_html.find(kStartFragmentStr);
+ if (start_fragment_start != std::string::npos) {
+ *fragment_start = static_cast<size_t>(
+ atoi(cf_html.c_str() + start_fragment_start + strlen(kStartFragmentStr)));
+ }
+
+ static constexpr char kEndFragmentStr[] = "EndFragment:";
+ size_t end_fragment_start = cf_html.find(kEndFragmentStr);
+ if (end_fragment_start != std::string::npos) {
+ *fragment_end = static_cast<size_t>(
+ atoi(cf_html.c_str() + end_fragment_start + strlen(kEndFragmentStr)));
+ }
+ } else {
+ *fragment_start = cf_html.find('>', tag_start) + 1;
+ size_t tag_end = cf_html.rfind("<!--EndFragment", std::string::npos);
+ *fragment_end = cf_html.rfind('<', tag_end);
+ }
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/common/qt_messages.h b/src/core/common/qt_messages.h
index de025725..940019c1 100644
--- a/src/core/common/qt_messages.h
+++ b/src/core/common/qt_messages.h
@@ -6,6 +6,7 @@
#include "content/public/common/common_param_traits.h"
#include "ipc/ipc_message_macros.h"
+#include "ipc/ipc_message_start.h"
#include "url/gurl.h"
#define IPC_MESSAGE_START QtMsgStart
diff --git a/src/core/compositor/display_gl_output_surface.cpp b/src/core/compositor/display_gl_output_surface.cpp
index dfc3cb7c..68ba957b 100644
--- a/src/core/compositor/display_gl_output_surface.cpp
+++ b/src/core/compositor/display_gl_output_surface.cpp
@@ -231,7 +231,7 @@ void DisplayGLOutputSurface::swapBuffersOnVizThread()
}
const auto now = base::TimeTicks::Now();
- m_client->DidReceiveSwapBuffersAck(gfx::SwapTimings{now, now});
+ m_client->DidReceiveSwapBuffersAck(gfx::SwapTimings{now, now}, gfx::GpuFenceHandle());
m_client->DidReceivePresentationFeedback(
gfx::PresentationFeedback(now, base::TimeDelta(),
gfx::PresentationFeedback::Flags::kVSync));
diff --git a/src/core/compositor/display_skia_output_device.cpp b/src/core/compositor/display_skia_output_device.cpp
index 69cb65ee..c33a31b8 100644
--- a/src/core/compositor/display_skia_output_device.cpp
+++ b/src/core/compositor/display_skia_output_device.cpp
@@ -188,8 +188,10 @@ void DisplaySkiaOutputDevice::DiscardBackbuffer()
{
}
-SkSurface *DisplaySkiaOutputDevice::BeginPaint(std::vector<GrBackendSemaphore> *)
+SkSurface *DisplaySkiaOutputDevice::BeginPaint(bool allocate_frame_buffer,
+ std::vector<GrBackendSemaphore> *)
{
+ Q_UNUSED(allocate_frame_buffer); // FIXME?
if (!m_backBuffer || m_backBuffer->shape() != m_shape)
m_backBuffer = std::make_unique<Buffer>(this);
return m_backBuffer->surface();
diff --git a/src/core/compositor/display_skia_output_device.h b/src/core/compositor/display_skia_output_device.h
index 2993e914..b5503ee5 100644
--- a/src/core/compositor/display_skia_output_device.h
+++ b/src/core/compositor/display_skia_output_device.h
@@ -70,7 +70,8 @@ public:
viz::OutputSurfaceFrame frame) override;
void EnsureBackbuffer() override;
void DiscardBackbuffer() override;
- SkSurface *BeginPaint(std::vector<GrBackendSemaphore> *semaphores) override;
+ SkSurface *BeginPaint(bool allocate_frame_buffer,
+ std::vector<GrBackendSemaphore> *semaphores) override;
void EndPaint() override;
// Overridden from Compositor.
diff --git a/src/core/compositor/display_software_output_surface.cpp b/src/core/compositor/display_software_output_surface.cpp
index 98c104dd..b811449c 100644
--- a/src/core/compositor/display_software_output_surface.cpp
+++ b/src/core/compositor/display_software_output_surface.cpp
@@ -99,9 +99,12 @@ void DisplaySoftwareOutputSurface::Device::Resize(const gfx::Size &sizeInPixels,
void DisplaySoftwareOutputSurface::Device::OnSwapBuffers(SwapBuffersCallback swap_ack_callback)
{
- QMutexLocker locker(&m_mutex);
- m_taskRunner = base::ThreadTaskRunnerHandle::Get();
- m_swapCompletionCallback = std::move(swap_ack_callback);
+ { // MEMO don't hold a lock together with an 'observer', as the call from Qt's scene graph may come at the same time
+ QMutexLocker locker(&m_mutex);
+ m_taskRunner = base::ThreadTaskRunnerHandle::Get();
+ m_swapCompletionCallback = std::move(swap_ack_callback);
+ }
+
if (auto obs = observer())
obs->readyToSwap();
}
diff --git a/src/core/config/common.pri b/src/core/config/common.pri
deleted file mode 100644
index d9d64e76..00000000
--- a/src/core/config/common.pri
+++ /dev/null
@@ -1,48 +0,0 @@
-qtConfig(webengine-printing-and-pdf) {
- gn_args += enable_basic_printing=true enable_print_preview=true
- gn_args += enable_pdf=true
-} else {
- gn_args += enable_basic_printing=false enable_print_preview=false
- gn_args += enable_pdf=false
-}
-
-qtConfig(webengine-pepper-plugins) {
- gn_args += enable_plugins=true
-} else {
- gn_args += enable_plugins=false
-}
-
-qtConfig(webengine-spellchecker) {
- gn_args += enable_spellcheck=true
-} else {
- gn_args += enable_spellcheck=false
-}
-
-qtConfig(webengine-webrtc) {
- gn_args += enable_webrtc=true
-} else {
- gn_args += enable_webrtc=false
-}
-
-qtConfig(webengine-proprietary-codecs) {
- gn_args += proprietary_codecs=true ffmpeg_branding=\"Chrome\"
- qtConfig(webengine-webrtc) {
- gn_args += rtc_use_h264=true
- }
-} else {
- gn_args += proprietary_codecs=false
-}
-
-qtConfig(webengine-extensions) {
- gn_args += enable_extensions=true
-} else {
- gn_args += enable_extensions=false
-}
-
-qtConfig(webengine-kerberos) {
- gn_args += use_kerberos=true
-} else {
- gn_args += use_kerberos=false
-}
-
-!qtConfig(webengine-nodejs10): gn_args += use_rollup=false
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
deleted file mode 100644
index 3e490a0d..00000000
--- a/src/core/config/linux.pri
+++ /dev/null
@@ -1,44 +0,0 @@
-include(common.pri)
-
-qtConfig(webengine-embedded-build) {
- gn_args += is_desktop_linux=false
-}
-
-!host_build{
-
-
-
- qtConfig(webengine-pulseaudio) {
- gn_args += use_pulseaudio=true
- } else {
- gn_args += use_pulseaudio=false
- }
-
- qtConfig(webengine-alsa) {
- gn_args += use_alsa=true
- } else {
- gn_args += use_alsa=false
- }
-
- !packagesExist(libpci): gn_args += use_libpci=false
-
- qtConfig(webengine-ozone-x11) {
- gn_args += ozone_platform_x11=true
- gn_args += use_xkbcommon=true
- packagesExist(xscrnsaver): gn_args += use_xscrnsaver=true
- qtConfig(webengine-webrtc): gn_args += rtc_use_x11=true
- }
-
- qtConfig(webengine-webrtc): qtConfig(webengine-webrtc-pipewire): gn_args += rtc_use_pipewire=true
-
- qtConfig(webengine-system-libevent): gn_args += use_system_libevent=true
- qtConfig(webengine-system-libwebp): gn_args += use_system_libwebp=true
- qtConfig(webengine-system-libxml2): gn_args += use_system_libxml=true use_system_libxslt=true
- qtConfig(webengine-system-opus): gn_args += use_system_opus=true
- qtConfig(webengine-system-snappy): gn_args += use_system_snappy=true
- qtConfig(webengine-system-libvpx): gn_args += use_system_libvpx=true
- qtConfig(webengine-system-icu): gn_args += use_system_icu=true icu_use_data_file=false
- qtConfig(webengine-system-ffmpeg): gn_args += use_system_ffmpeg=true
- qtConfig(webengine-system-re2): gn_args += use_system_re2=true
- qtConfig(webengine-system-lcms2): gn_args += use_system_lcms2=true
-}
diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
deleted file mode 100644
index 9543daf9..00000000
--- a/src/core/config/mac_osx.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-include(common.pri)
-
-qtConfig(build-qtwebengine-core):qtConfig(webengine-spellchecker) {
- qtConfig(webengine-native-spellchecker): gn_args += use_browser_spellchecker=true
- else: gn_args += use_browser_spellchecker=false
-} else {
- gn_args += use_browser_spellchecker=false
-}
diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri
deleted file mode 100644
index 9543daf9..00000000
--- a/src/core/config/windows.pri
+++ /dev/null
@@ -1,8 +0,0 @@
-include(common.pri)
-
-qtConfig(build-qtwebengine-core):qtConfig(webengine-spellchecker) {
- qtConfig(webengine-native-spellchecker): gn_args += use_browser_spellchecker=true
- else: gn_args += use_browser_spellchecker=false
-} else {
- gn_args += use_browser_spellchecker=false
-}
diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index 2ba599e4..4af30131 100644
--- a/src/core/configure/BUILD.root.gn.in
+++ b/src/core/configure/BUILD.root.gn.in
@@ -121,6 +121,7 @@ shared_library("QtWebEngineCore") {
"//components/proxy_config",
"//components/user_prefs",
"//content/public/app",
+ "//content/public/browser",
"//content",
"//media:media_buildflags",
"//net",
@@ -131,7 +132,6 @@ shared_library("QtWebEngineCore") {
"//ui/gl",
"//qtwebengine/browser:interfaces",
"//qtwebengine/userscript",
- "//qtwebengine/browser:service_manifests",
"//qtwebengine/common:mojo_bindings",
":qtwebengine_sources",
":qtwebengine_resources",
@@ -213,6 +213,7 @@ source_set("qtwebengine_sources") {
"//chrome/browser/resources/net_internals:resources",
"//chrome/browser/resources/quota_internals:resources",
"//chrome/common:buildflags",
+ "//chromeos/components/chromebox_for_meetings/buildflags",
"//components/nacl/common:buildflags",
"//components/performance_manager",
"//components/plugins/renderer/",
@@ -334,12 +335,15 @@ source_set("qtwebengine_sources") {
]
}
if (enable_plugins) {
- sources += [
- "//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
- "//chrome/renderer/pepper/pepper_flash_font_file_host.h",
- "//chrome/renderer/pepper/pepper_shared_memory_message_filter.cc",
- "//chrome/renderer/pepper/pepper_shared_memory_message_filter.h",
- ]
+ sources += [
+ "//chrome/renderer/pepper/pepper_flash_font_file_host.cc",
+ "//chrome/renderer/pepper/pepper_flash_font_file_host.h",
+ "//chrome/renderer/pepper/pepper_shared_memory_message_filter.cc",
+ "//chrome/renderer/pepper/pepper_shared_memory_message_filter.h",
+ ]
+ if (is_linux) {
+ deps += [ "//pdf:font_table_linux" ]
+ }
}
if (enable_basic_printing || enable_print_preview) {
sources += [
@@ -357,16 +361,17 @@ source_set("qtwebengine_sources") {
]
}
if (enable_pdf) {
- deps += [
- "//pdf",
- "//pdf:buildflags",
- "//pdf:pdf_ppapi",
- "//chrome/browser/resources/pdf:resources",
- "//components/pdf/browser:browser",
- "//components/pdf/renderer:renderer",
- "//components/printing/browser",
- "//components/printing/renderer",
- ]
+ deps += [
+ "//pdf",
+ "//pdf:buildflags",
+ "//pdf:pdf_ppapi",
+ "//chrome/browser/resources/pdf:resources",
+ "//components/pdf/browser",
+ "//components/pdf/common",
+ "//components/pdf/renderer",
+ "//components/printing/browser",
+ "//components/printing/renderer",
+ ]
}
if (enable_webrtc && enable_extensions) {
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index f8d1afe1..893eca09 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -40,7 +40,6 @@
#include "content_browser_client_qt.h"
#include "base/files/file_util.h"
-#include "base/optional.h"
#include "base/task/post_task.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
@@ -73,10 +72,10 @@
#include "mojo/public/cpp/bindings/self_owned_associated_receiver.h"
#include "net/ssl/client_cert_identity.h"
#include "net/ssl/client_cert_store.h"
+#include "services/device/public/cpp/geolocation/geolocation_manager.h"
#include "services/network/network_service.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"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_switches.h"
#include "url/url_util_qt.h"
@@ -148,6 +147,7 @@
#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/event_router.h"
#include "extensions/browser/extension_message_filter.h"
#include "extensions/browser/extension_protocols.h"
#include "extensions/browser/extension_registry.h"
@@ -165,6 +165,15 @@
#include "net/plugin_response_interceptor_url_loader_throttle.h"
#endif
+#if QT_CONFIG(webengine_webchannel)
+#include "qtwebengine/browser/qtwebchannel.mojom.h"
+#include "renderer_host/web_channel_ipc_transport_host.h"
+#endif
+
+#if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#include "printing/print_view_manager_qt.h"
+#endif
+
#include <QGuiApplication>
#include <QStandardPaths>
#include <qpa/qplatformnativeinterface.h>
@@ -192,9 +201,6 @@ bool IsHandledProtocol(base::StringPiece scheme)
content::kChromeUIScheme,
url::kDataScheme,
url::kAboutScheme,
-#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
- url::kFtpScheme,
-#endif // !BUILDFLAG(DISABLE_FTP_SUPPORT)
url::kBlobScheme,
url::kFileSystemScheme,
url::kQrcScheme,
@@ -229,7 +235,10 @@ ContentBrowserClientQt::~ContentBrowserClientQt()
std::unique_ptr<content::BrowserMainParts> ContentBrowserClientQt::CreateBrowserMainParts(const content::MainFunctionParams&)
{
- return std::make_unique<BrowserMainPartsQt>();
+ Q_ASSERT(!m_browserMainParts);
+ auto browserMainParts = std::make_unique<BrowserMainPartsQt>();
+ m_browserMainParts = browserMainParts.get();
+ return browserMainParts;
}
void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost *host)
@@ -409,9 +418,9 @@ void ContentBrowserClientQt::DidCreatePpapiPlugin(content::BrowserPpapiHost* bro
}
#endif
-content::DevToolsManagerDelegate* ContentBrowserClientQt::GetDevToolsManagerDelegate()
+std::unique_ptr<content::DevToolsManagerDelegate> ContentBrowserClientQt::CreateDevToolsManagerDelegate()
{
- return new DevToolsManagerDelegateQt;
+ return std::make_unique<DevToolsManagerDelegateQt>();
}
content::PlatformNotificationService *ContentBrowserClientQt::GetPlatformNotificationService(content::BrowserContext *browser_context)
@@ -422,52 +431,6 @@ content::PlatformNotificationService *ContentBrowserClientQt::GetPlatformNotific
return profile->platformNotificationService();
}
-// This is a really complicated way of doing absolutely nothing, but Mojo demands it:
-class ServiceDriver
- : public blink::mojom::InsecureInputService
- , public content::WebContentsUserData<ServiceDriver>
-{
-public:
- static void CreateForRenderFrameHost(content::RenderFrameHost *renderFrameHost)
- {
- content::WebContents* web_contents = content::WebContents::FromRenderFrameHost(renderFrameHost);
- if (!web_contents)
- return;
- CreateForWebContents(web_contents);
- }
- static ServiceDriver* FromRenderFrameHost(content::RenderFrameHost *renderFrameHost)
- {
- content::WebContents* web_contents = content::WebContents::FromRenderFrameHost(renderFrameHost);
- if (!web_contents)
- return nullptr;
- return FromWebContents(web_contents);
- }
- static void BindInsecureInputService(content::RenderFrameHost *render_frame_host, mojo::PendingReceiver<blink::mojom::InsecureInputService> receiver)
- {
- CreateForRenderFrameHost(render_frame_host);
- ServiceDriver *driver = FromRenderFrameHost(render_frame_host);
-
- if (driver)
- driver->BindInsecureInputServiceReceiver(std::move(receiver));
- }
- void BindInsecureInputServiceReceiver(mojo::PendingReceiver<blink::mojom::InsecureInputService> receiver)
- {
- m_receivers.Add(this, std::move(receiver));
- }
-
- // blink::mojom::InsecureInputService:
- void DidEditFieldInInsecureContext() override
- { }
-
-private:
- WEB_CONTENTS_USER_DATA_KEY_DECL();
- explicit ServiceDriver(content::WebContents* /*web_contents*/) { }
- friend class content::WebContentsUserData<ServiceDriver>;
- mojo::ReceiverSet<blink::mojom::InsecureInputService> m_receivers;
-};
-
-WEB_CONTENTS_USER_DATA_KEY_IMPL(ServiceDriver)
-
void ContentBrowserClientQt::BindHostReceiverForRenderer(content::RenderProcessHost *render_process_host,
mojo::GenericPendingReceiver receiver)
{
@@ -516,7 +479,6 @@ void ContentBrowserClientQt::RegisterBrowserInterfaceBindersForFrame(
mojo::BinderMapWithContext<content::RenderFrameHost *> *map)
{
Q_UNUSED(render_frame_host);
- map->Add<blink::mojom::InsecureInputService>(base::BindRepeating(&ServiceDriver::BindInsecureInputService));
map->Add<network_hints::mojom::NetworkHintsHandler>(base::BindRepeating(&BindNetworkHintsHandler));
#if BUILDFLAG(ENABLE_EXTENSIONS)
map->Add<extensions::mime_handler::MimeHandlerService>(base::BindRepeating(&BindMimeHandlerService));
@@ -540,9 +502,45 @@ void ContentBrowserClientQt::ExposeInterfacesToRenderer(service_manager::BinderR
blink::AssociatedInterfaceRegistry *associated_registry,
content::RenderProcessHost *render_process_host)
{
- Q_UNUSED(associated_registry);
if (auto *manager = performance_manager::PerformanceManagerRegistry::GetInstance())
manager->CreateProcessNodeAndExposeInterfacesToRendererProcess(registry, render_process_host);
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ associated_registry->AddInterface(base::BindRepeating(&extensions::EventRouter::BindForRenderer,
+ render_process_host->GetID()));
+#else
+ Q_UNUSED(associated_registry);
+#endif
+}
+
+bool ContentBrowserClientQt::BindAssociatedReceiverFromFrame(content::RenderFrameHost *rfh,
+ const std::string &interface_name,
+ mojo::ScopedInterfaceEndpointHandle *handle)
+{
+#if QT_CONFIG(webengine_webchannel)
+ if (interface_name == qtwebchannel::mojom::WebChannelTransportHost::Name_) {
+ auto *web_contents = content::WebContents::FromRenderFrameHost(rfh);
+ auto *adapter = static_cast<WebContentsDelegateQt *>(web_contents->GetDelegate())->webContentsAdapter();
+ adapter->webChannelTransport()->BindReceiver(
+ mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportHost>(std::move(*handle)), rfh);
+ return true;
+ }
+#endif
+#if BUILDFLAG(ENABLE_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW)
+ if (interface_name == printing::mojom::PrintManagerHost::Name_) {
+ mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost> receiver(std::move(*handle));
+ PrintViewManagerQt::BindPrintManagerHost(std::move(receiver), rfh);
+ return true;
+ }
+#endif
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ if (interface_name == extensions::mojom::LocalFrameHost::Name_) {
+ extensions::ExtensionWebContentsObserverQt::BindLocalFrameHost(
+ mojo::PendingAssociatedReceiver<extensions::mojom::LocalFrameHost>(std::move(*handle)), rfh);
+ return true;
+ }
+#endif
+ DCHECK(!ContentBrowserClient::BindAssociatedReceiverFromFrame(rfh, interface_name, handle));
+ return false;
}
bool ContentBrowserClientQt::CanCreateWindow(
@@ -594,6 +592,15 @@ std::unique_ptr<device::LocationProvider> ContentBrowserClientQt::OverrideSystem
}
#endif
+device::GeolocationManager *ContentBrowserClientQt::GetGeolocationManager()
+{
+#if defined(OS_MAC)
+ return m_browserMainParts->GetGeolocationManager();
+#else
+ return nullptr;
+#endif
+}
+
bool ContentBrowserClientQt::ShouldEnableStrictSiteIsolation()
{
// mirroring AwContentBrowserClient, CastContentBrowserClient and
@@ -626,7 +633,7 @@ bool ContentBrowserClientQt::WillCreateRestrictedCookieManager(network::mojom::R
bool ContentBrowserClientQt::AllowAppCache(const GURL &manifest_url,
const GURL &first_party,
- const base::Optional<url::Origin> &top_frame_origin,
+ const absl::optional<url::Origin> &top_frame_origin,
content::BrowserContext *context)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -638,7 +645,7 @@ bool ContentBrowserClientQt::AllowAppCache(const GURL &manifest_url,
content::AllowServiceWorkerResult
ContentBrowserClientQt::AllowServiceWorker(const GURL &scope,
const GURL &site_for_cookies,
- const base::Optional<url::Origin> & /*top_frame_origin*/,
+ const absl::optional<url::Origin> & /*top_frame_origin*/,
const GURL & /*script_url*/,
content::BrowserContext *context)
{
@@ -655,7 +662,7 @@ ContentBrowserClientQt::AllowServiceWorker(const GURL &scope,
// We control worker access to FS and indexed-db using cookie permissions, this is mirroring Chromium's logic.
void ContentBrowserClientQt::AllowWorkerFileSystem(const GURL &url,
content::BrowserContext *context,
- const std::vector<content::GlobalFrameRoutingId> &/*render_frames*/,
+ const std::vector<content::GlobalRenderFrameHostId> &/*render_frames*/,
base::OnceCallback<void(bool)> callback)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -668,7 +675,7 @@ void ContentBrowserClientQt::AllowWorkerFileSystem(const GURL &url,
bool ContentBrowserClientQt::AllowWorkerIndexedDB(const GURL &url,
content::BrowserContext *context,
- const std::vector<content::GlobalFrameRoutingId> &/*render_frames*/)
+ const std::vector<content::GlobalRenderFrameHostId> &/*render_frames*/)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (!context || context->ShutdownStarted())
@@ -677,7 +684,7 @@ bool ContentBrowserClientQt::AllowWorkerIndexedDB(const GURL &url,
}
static void LaunchURL(const GURL& url,
- base::OnceCallback<content::WebContents*()> web_contents_getter,
+ base::RepeatingCallback<content::WebContents*()> web_contents_getter,
ui::PageTransition page_transition, bool is_main_frame, bool has_user_gesture)
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
@@ -698,16 +705,18 @@ static void LaunchURL(const GURL& url,
bool ContentBrowserClientQt::HandleExternalProtocol(const GURL &url,
- base::OnceCallback<content::WebContents*()> web_contents_getter,
+ base::RepeatingCallback<content::WebContents*()> web_contents_getter,
int child_id,
+ int frame_tree_node_id,
content::NavigationUIData *navigation_data,
bool is_main_frame,
ui::PageTransition page_transition,
bool has_user_gesture,
- const base::Optional<url::Origin> &initiating_origin,
+ const absl::optional<url::Origin> &initiating_origin,
mojo::PendingRemote<network::mojom::URLLoaderFactory> *out_factory)
{
Q_UNUSED(child_id);
+ Q_UNUSED(frame_tree_node_id);
Q_UNUSED(navigation_data);
Q_UNUSED(initiating_origin);
Q_UNUSED(out_factory);
@@ -1172,7 +1181,7 @@ bool ContentBrowserClientQt::WillCreateURLLoaderFactory(
int render_process_id,
URLLoaderFactoryType type,
const url::Origin &request_initiator,
- base::Optional<int64_t> navigation_id,
+ absl::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> *factory_receiver,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient> *header_client,
@@ -1180,13 +1189,23 @@ bool ContentBrowserClientQt::WillCreateURLLoaderFactory(
bool *disable_secure_dns,
network::mojom::URLLoaderFactoryOverridePtr *factory_override)
{
+ Q_UNUSED(render_process_id);
+ Q_UNUSED(type);
+ Q_UNUSED(request_initiator);
+ Q_UNUSED(navigation_id);
+ Q_UNUSED(ukm_source_id);
+ Q_UNUSED(header_client);
+ Q_UNUSED(bypass_redirect_checks);
+ Q_UNUSED(disable_secure_dns);
+ Q_UNUSED(factory_override);
auto adapter = static_cast<ProfileQt *>(browser_context)->profileAdapter();
- int process_id = type == URLLoaderFactoryType::kNavigation ? 0 : render_process_id;
auto proxied_receiver = std::move(*factory_receiver);
mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_url_loader_factory;
*factory_receiver = pending_url_loader_factory.InitWithNewPipeAndPassReceiver();
// Will manage its own lifetime
- new ProxyingURLLoaderFactoryQt(adapter, process_id, std::move(proxied_receiver), std::move(pending_url_loader_factory));
+ new ProxyingURLLoaderFactoryQt(adapter,
+ frame ? frame->GetFrameTreeNodeId() : content::RenderFrameHost::kNoFrameTreeNodeId,
+ std::move(proxied_receiver), std::move(pending_url_loader_factory));
return true;
}
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index 94ee69bf..3079d33d 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -58,7 +58,11 @@ class ResourceContext;
class WebContents;
struct MainFunctionParams;
struct Referrer;
-}
+} // namespace content
+
+namespace device {
+class GeolocationManager;
+} // namespace device
namespace gl {
class GLShareGroup;
@@ -66,6 +70,7 @@ class GLShareGroup;
namespace QtWebEngineCore {
+class BrowserMainPartsQt;
class ShareGroupQt;
class ContentBrowserClientQt : public content::ContentBrowserClient
@@ -92,7 +97,7 @@ public:
net::ClientCertIdentityList client_certs,
std::unique_ptr<content::ClientCertificateDelegate> delegate) override;
std::unique_ptr<net::ClientCertStore> CreateClientCertStore(content::BrowserContext *browser_context) override;
- content::DevToolsManagerDelegate *GetDevToolsManagerDelegate() override;
+ std::unique_ptr<content::DevToolsManagerDelegate> CreateDevToolsManagerDelegate() override;
content::PlatformNotificationService * GetPlatformNotificationService(content::BrowserContext *browser_context) override;
std::string GetApplicationLocale() override;
@@ -112,6 +117,9 @@ public:
void ExposeInterfacesToRenderer(service_manager::BinderRegistry *registry,
blink::AssociatedInterfaceRegistry *associated_registry,
content::RenderProcessHost *render_process_host) override;
+ bool BindAssociatedReceiverFromFrame(content::RenderFrameHost *render_frame_host,
+ const std::string &interface_name,
+ mojo::ScopedInterfaceEndpointHandle *handle) override;
bool CanCreateWindow(content::RenderFrameHost *opener,
const GURL &opener_url,
@@ -140,23 +148,23 @@ public:
bool AllowAppCache(const GURL &manifest_url,
const GURL &first_party,
- const base::Optional<url::Origin> &top_frame_origin,
+ const absl::optional<url::Origin> &top_frame_origin,
content::BrowserContext *context) override;
content::AllowServiceWorkerResult AllowServiceWorker(
const GURL &scope,
const GURL &site_for_cookies,
- const base::Optional<url::Origin> &top_frame_origin,
+ const absl::optional<url::Origin> &top_frame_origin,
const GURL &script_url,
content::BrowserContext *context) override;
void AllowWorkerFileSystem(const GURL &url,
content::BrowserContext *context,
- const std::vector<content::GlobalFrameRoutingId> &render_frames,
+ const std::vector<content::GlobalRenderFrameHostId> &render_frames,
base::OnceCallback<void(bool)> callback) override;
bool AllowWorkerIndexedDB(const GURL &url,
content::BrowserContext *context,
- const std::vector<content::GlobalFrameRoutingId> &render_frames) override;
+ const std::vector<content::GlobalRenderFrameHostId> &render_frames) override;
AllowWebBluetoothResult AllowWebBluetooth(content::BrowserContext *browser_context,
const url::Origin &requesting_origin,
const url::Origin &embedding_origin) override;
@@ -164,6 +172,8 @@ public:
#if QT_CONFIG(webengine_geolocation)
std::unique_ptr<device::LocationProvider> OverrideSystemLocationProvider() override;
#endif
+ device::GeolocationManager *GetGeolocationManager() override;
+
bool ShouldIsolateErrorPage(bool in_main_frame) override;
bool ShouldUseProcessPerSite(content::BrowserContext *browser_context, const GURL &effective_url) override;
bool DoesSiteRequireDedicatedProcess(content::BrowserContext *browser_context,
@@ -196,13 +206,14 @@ public:
bool HandleExternalProtocol(
const GURL &url,
- base::OnceCallback<content::WebContents*()> web_contents_getter,
+ base::RepeatingCallback<content::WebContents*()> web_contents_getter,
int child_id,
+ int frame_tree_node_id,
content::NavigationUIData *navigation_data,
bool is_main_frame,
ui::PageTransition page_transition,
bool has_user_gesture,
- const base::Optional<url::Origin> &initiating_origin,
+ const absl::optional<url::Origin> &initiating_origin,
mojo::PendingRemote<network::mojom::URLLoaderFactory> *out_factory) override;
std::vector<std::unique_ptr<blink::URLLoaderThrottle>> CreateURLLoaderThrottles(
@@ -223,7 +234,7 @@ public:
int render_process_id,
URLLoaderFactoryType type,
const url::Origin &request_initiator,
- base::Optional<int64_t> navigation_id,
+ absl::optional<int64_t> navigation_id,
ukm::SourceIdObj ukm_source_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> *factory_receiver,
mojo::PendingRemote<network::mojom::TrustedURLLoaderHeaderClient> *header_client,
@@ -262,6 +273,7 @@ public:
private:
scoped_refptr<ShareGroupQt> m_shareGroupQt;
+ BrowserMainPartsQt *m_browserMainParts = nullptr;
};
} // namespace QtWebEngineCore
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index e06cde63..67e2bed4 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -90,6 +90,8 @@ const char kPdfPluginMimeType[] = "application/x-google-chrome-pdf";
const char kPdfPluginPath[] = "internal-pdf-viewer";
#endif // QT_CONFIG(webengine_printing_and_pdf)
+using Robustness = content::CdmInfo::Robustness;
+
static QString webenginePluginsPath()
{
// Look for plugins in /plugins/webengine or application dir.
@@ -184,7 +186,7 @@ namespace QtWebEngineCore {
#if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT)
static bool IsWidevineAvailable(base::FilePath *cdm_path,
- content::CdmCapability *capability)
+ media::CdmCapability *capability)
{
QStringList pluginPaths;
const base::CommandLine::StringType widevine_argument = base::CommandLine::ForCurrentProcess()->GetSwitchValueNative(switches::kCdmWidevinePath);
@@ -269,10 +271,12 @@ static bool IsWidevineAvailable(base::FilePath *cdm_path,
if (base::PathExists(*cdm_path)) {
// Add the supported codecs as if they came from the component manifest.
// This list must match the CDM that is being bundled with Chrome.
- capability->video_codecs.push_back(media::VideoCodec::kCodecVP8);
- capability->video_codecs.push_back(media::VideoCodec::kCodecVP9);
+ const std::vector<media::VideoCodecProfile> kAllProfiles = {};
+ capability->video_codecs.emplace(media::VideoCodec::kCodecVP8, kAllProfiles);
+ capability->video_codecs.emplace(media::VideoCodec::kCodecVP9, kAllProfiles);
+ capability->video_codecs.emplace(media::VideoCodec::kCodecAV1, kAllProfiles);
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
- capability->video_codecs.push_back(media::VideoCodec::kCodecH264);
+ capability->video_codecs.emplace(media::VideoCodec::kCodecH264, kAllProfiles);
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
// Add the supported encryption schemes as if they came from the
@@ -298,12 +302,12 @@ void ContentClientQt::AddContentDecryptionModules(std::vector<content::CdmInfo>
if (cdms) {
#if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT)
base::FilePath cdm_path;
- content::CdmCapability capability;
+ media::CdmCapability capability;
if (IsWidevineAvailable(&cdm_path, &capability)) {
const base::Version version;
- cdms->push_back(content::CdmInfo(kWidevineCdmDisplayName, kWidevineCdmGuid, version, cdm_path,
- kWidevineCdmFileSystemId, std::move(capability),
- kWidevineKeySystem, false));
+ cdms->push_back(content::CdmInfo(kWidevineKeySystem, Robustness::kSoftwareSecure, std::move(capability),
+ /*supports_sub_key_systems=*/false, kWidevineCdmDisplayName,
+ kWidevineCdmGuid, version, cdm_path, kWidevineCdmFileSystemId));
}
#endif // defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT)
@@ -321,8 +325,8 @@ void ContentClientQt::AddContentDecryptionModules(std::vector<content::CdmInfo>
"org.chromium.externalclearkey.differentguid";
// Supported codecs are hard-coded in ExternalClearKeyProperties.
- content::CdmCapability capability(
- {}, {media::EncryptionScheme::kCenc, media::EncryptionScheme::kCbcs},
+ media::CdmCapability capability(
+ {}, {}, {media::EncryptionScheme::kCenc, media::EncryptionScheme::kCbcs},
{media::CdmSessionType::kTemporary,
media::CdmSessionType::kPersistentLicense});
@@ -330,16 +334,17 @@ void ContentClientQt::AddContentDecryptionModules(std::vector<content::CdmInfo>
// Otherwise, it'll be treated as a sub-key-system of normal
// kExternalClearKeyKeySystem. See MultipleCdmTypes test in
// ECKEncryptedMediaTest.
- cdms->push_back(content::CdmInfo(media::kClearKeyCdmDisplayName, media::kClearKeyCdmDifferentGuid,
- base::Version("0.1.0.0"), clear_key_cdm_path,
- media::kClearKeyCdmFileSystemId, capability,
- kExternalClearKeyDifferentGuidTestKeySystem, false));
-
- // Supported codecs are hard-coded in ExternalClearKeyProperties.
- cdms->push_back(content::CdmInfo(media::kClearKeyCdmDisplayName, media::kClearKeyCdmGuid,
- base::Version("0.1.0.0"), clear_key_cdm_path,
- media::kClearKeyCdmFileSystemId, capability,
- kExternalClearKeyKeySystem, true));
+ cdms->push_back(content::CdmInfo(kExternalClearKeyDifferentGuidTestKeySystem,
+ Robustness::kSoftwareSecure, capability,
+ /*supports_sub_key_systems=*/false, media::kClearKeyCdmDisplayName,
+ media::kClearKeyCdmDifferentGuid, base::Version("0.1.0.0"),
+ clear_key_cdm_path, media::kClearKeyCdmFileSystemId));
+
+ cdms->push_back(content::CdmInfo(kExternalClearKeyKeySystem,
+ Robustness::kSoftwareSecure, capability,
+ /*supports_sub_key_systems=*/true, media::kClearKeyCdmDisplayName,
+ media::kClearKeyCdmGuid, base::Version("0.1.0.0"),
+ clear_key_cdm_path, media::kClearKeyCdmFileSystemId));
}
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
}
@@ -358,7 +363,7 @@ void ContentClientQt::AddAdditionalSchemes(Schemes* schemes)
#endif
}
-base::StringPiece ContentClientQt::GetDataResource(int resource_id, ui::ScaleFactor scale_factor)
+base::StringPiece ContentClientQt::GetDataResource(int resource_id, ui::ResourceScaleFactor scale_factor)
{
return ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale(resource_id, scale_factor);
}
@@ -373,7 +378,7 @@ gfx::Image &ContentClientQt::GetNativeImageNamed(int resource_id)
return ui::ResourceBundle::GetSharedInstance().GetNativeImageNamed(resource_id);
}
-base::string16 ContentClientQt::GetLocalizedString(int message_id)
+std::u16string ContentClientQt::GetLocalizedString(int message_id)
{
return l10n_util::GetStringUTF16(message_id);
}
diff --git a/src/core/content_client_qt.h b/src/core/content_client_qt.h
index a7fc7432..d44563f4 100644
--- a/src/core/content_client_qt.h
+++ b/src/core/content_client_qt.h
@@ -56,10 +56,10 @@ public:
std::vector<media::CdmHostFilePath> *cdm_host_file_paths) override;
void AddAdditionalSchemes(Schemes* schemes) override;
- base::StringPiece GetDataResource(int, ui::ScaleFactor) override;
+ base::StringPiece GetDataResource(int, ui::ResourceScaleFactor) override;
base::RefCountedMemory* GetDataResourceBytes(int resource_id) override;
gfx::Image &GetNativeImageNamed(int resource_id) override;
- base::string16 GetLocalizedString(int message_id) override;
+ std::u16string GetLocalizedString(int message_id) override;
};
} // namespace QtWebEngineCore
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index ec0e6385..0c04fb07 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -83,6 +83,7 @@
#endif
#if defined(OS_MAC)
+#include "base/trace_event/trace_event.h"
#include "content/public/common/content_features.h"
#include "media/gpu/mac/vt_video_decode_accelerator_mac.h"
#endif
@@ -219,7 +220,7 @@ void ContentMainDelegateQt::PreSandboxStartup()
#endif
#if defined(OS_MAC)
- if (base::FeatureList::IsEnabled(features::kMacV2GPUSandbox)) {
+ {
TRACE_EVENT0("gpu", "Initialize VideoToolbox");
media::InitializeVideoToolbox();
}
diff --git a/src/core/core.pro b/src/core/core.pro
deleted file mode 100644
index f2d3fd30..00000000
--- a/src/core/core.pro
+++ /dev/null
@@ -1,48 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-QT_FOR_CONFIG += buildtools-private
-TEMPLATE = subdirs
-
-# core_headers is a dummy module to syncqt the headers so we can
-# use them by later targets
-core_headers.file = core_headers.pro
-core_api.file = api/core_api.pro
-
-# This will take the compile output of ninja, and link+deploy the final binary.
-core_module.file = core_module.pro
-core_module.depends = core_api
-
-core_generator.file = core_generator.pro
-core_generator.depends = core_headers
-
-# core_gn_generator.pro is a dummy .pro file that is used by qmake
-# to generate our main BUILD.gn file
-
-gn_run.file = gn_run.pro
-gn_run.depends = core_generator
-
-core_api.depends = gn_run
-
-# A fake project for qt creator
-core_project.file = core_project.pro
-core_project.depends = gn_run
-
-!qtConfig(webengine-core-support):qtConfig(build-qtwebengine-core):!build_pass {
- !qtwebengine_makeCheckWebEngineCoreError() {
- errorbuild.commands = @echo $$shell_quote("QtWebEngineCore module will not be built. $${skipBuildReason}")
- } else {
- errorbuild.commands = @echo $$shell_quote("QtWebEngineCore module will not be built for unknown reason, please open a bug report at https://bugreports.qt.io")
- }
- errorbuild.CONFIG = phony
- QMAKE_EXTRA_TARGETS += errorbuild
- first.depends += errorbuild
- QMAKE_EXTRA_TARGETS += first
-} else {
- SUBDIRS += \
- core_headers \
- core_generator \
- gn_run \
- core_api \
- core_module
-
- false: SUBDIRS += core_project
-}
diff --git a/src/core/core_chromium.pri b/src/core/core_chromium.pri
deleted file mode 100644
index df938232..00000000
--- a/src/core/core_chromium.pri
+++ /dev/null
@@ -1,352 +0,0 @@
-qtConfig(debug_and_release): CONFIG += debug_and_release
-
-macos {
- # This fixes namespace builds on macOS. Specifically namespace ambiguity issues between Qt and
- # Chromium forward declarations of NSString.
-
- # The single quotes are present so that qmake iteration does not interpret the space as
- # delimiting a new value, they are removed before writing to the GN file, and the final shell
- # quoting is done by GN itself.
- forward_declaration_macro = "'Q_FORWARD_DECLARE_OBJC_CLASS(name)=class name;'"
-} else {
- forward_declaration_macro = "Q_FORWARD_DECLARE_OBJC_CLASS=QT_FORWARD_DECLARE_CLASS"
-}
-
-# Defining keywords such as 'signal' clashes with the chromium code base.
-DEFINES += QT_NO_KEYWORDS \
- QT_USE_QSTRINGBUILDER \
- $$forward_declaration_macro \
- QTWEBENGINECORE_VERSION_STR=\"$$MODULE_VERSION\" \
- QTWEBENGINEPROCESS_NAME=\"$$QTWEBENGINEPROCESS_NAME\" \
- BUILDING_CHROMIUM
-
-# Ensure that response files, generated by qtbase/mkspecs/features/moc.prf, are found by moc.
-MOC_DIR = $$OUT_PWD/$$getConfigDir()/.moc
-RCC_DIR = $$OUT_PWD/$$getConfigDir()/.rcc
-
-# Assume that we want mobile touch and low-end hardware behaviors
-# whenever we are cross compiling.
-qtConfig(webengine-embedded-build): DEFINES += QTWEBENGINE_EMBEDDED_SWITCHES
-
-INCLUDEPATH += $$PWD $$PWD/api
-
-clang_cl {
- QMAKE_CFLAGS -= $$QMAKE_CFLAGS_MSVC_COMPAT
- QMAKE_CXXFLAGS -= $$QMAKE_CFLAGS_MSVC_COMPAT
-}
-
-SOURCES = \
- accessibility_activation_observer.cpp \
- accessibility_tree_formatter_qt.cpp \
- authentication_dialog_controller.cpp \
- browser_accessibility_manager_qt.cpp \
- browser_accessibility_qt.cpp \
- browsing_data_remover_delegate_qt.cpp \
- browser_main_parts_qt.cpp \
- browser_message_filter_qt.cpp \
- certificate_error_controller.cpp \
- chromium_overrides.cpp \
- client_cert_select_controller.cpp \
- clipboard_qt.cpp \
- color_chooser_qt.cpp \
- color_chooser_controller.cpp \
- common/qt_messages.cpp \
- compositor/compositor.cpp \
- compositor/content_gpu_client_qt.cpp \
- compositor/display_overrides.cpp \
- compositor/display_software_output_surface.cpp \
- content_client_qt.cpp \
- content_browser_client_qt.cpp \
- content_main_delegate_qt.cpp \
- content_utility_client_qt.cpp \
- delegated_frame_host_client_qt.cpp \
- desktop_screen_qt.cpp \
- devtools_frontend_qt.cpp \
- devtools_manager_delegate_qt.cpp \
- download_manager_delegate_qt.cpp \
- favicon_manager.cpp \
- file_picker_controller.cpp \
- find_text_helper.cpp \
- javascript_dialog_controller.cpp \
- javascript_dialog_manager_qt.cpp \
- login_delegate_qt.cpp \
- media_capture_devices_dispatcher.cpp \
- native_web_keyboard_event_qt.cpp \
- net/client_cert_override.cpp \
- net/client_cert_store_data.cpp \
- net/cookie_monster_delegate_qt.cpp \
- net/custom_url_loader_factory.cpp \
- net/proxy_config_monitor.cpp \
- net/proxy_config_service_qt.cpp \
- net/proxying_url_loader_factory_qt.cpp \
- net/proxying_restricted_cookie_manager_qt.cpp \
- net/qrc_url_scheme_handler.cpp \
- net/ssl_host_state_delegate_qt.cpp \
- net/system_network_context_manager.cpp \
- net/url_request_custom_job_delegate.cpp \
- net/url_request_custom_job_proxy.cpp \
- net/webui_controller_factory_qt.cpp \
- ozone/gl_context_qt.cpp \
- ozone/gl_share_context_qt.cpp \
- ozone/gl_ozone_egl_qt.cpp \
- ozone/gl_surface_qt.cpp \
- ozone/gl_surface_egl_qt.cpp \
- ozone/gl_surface_wgl_qt.cpp \
- ozone/platform_window_qt.cpp \
- ozone/surface_factory_qt.cpp \
- permission_manager_qt.cpp \
- platform_notification_service_qt.cpp \
- process_main.cpp \
- profile_adapter.cpp \
- profile_adapter_client.cpp \
- profile_qt.cpp \
- profile_io_data_qt.cpp \
- quota_permission_context_qt.cpp \
- quota_request_controller_impl.cpp \
- pref_service_adapter.cpp \
- register_protocol_handler_request_controller_impl.cpp \
- render_view_context_menu_qt.cpp \
- render_widget_host_view_qt.cpp \
- render_widget_host_view_qt_delegate_client.cpp \
- renderer/content_renderer_client_qt.cpp \
- renderer/content_settings_observer_qt.cpp \
- renderer/render_frame_observer_qt.cpp \
- renderer/web_engine_page_render_frame.cpp \
- renderer/render_configuration.cpp \
- renderer/user_resource_controller.cpp \
- renderer_host/web_engine_page_host.cpp \
- renderer_host/user_resource_controller_host.cpp \
- resource_bundle_qt.cpp \
- resource_context_qt.cpp \
- touch_handle_drawable_qt.cpp \
- touch_selection_controller_client_qt.cpp \
- touch_selection_menu_controller.cpp \
- type_conversion.cpp \
- user_notification_controller.cpp \
- user_script.cpp \
- visited_links_manager_qt.cpp \
- web_contents_adapter.cpp \
- web_contents_delegate_qt.cpp \
- web_contents_view_qt.cpp \
- web_engine_context.cpp \
- web_engine_context_threads.cpp \
- web_engine_error.cpp \
- web_engine_library_info.cpp \
- web_engine_settings.cpp \
- web_event_factory.cpp
-
-HEADERS = \
- accessibility_activation_observer.h \
- authentication_dialog_controller_p.h \
- authentication_dialog_controller.h \
- build_config_qt.h \
- browser_accessibility_manager_qt.h \
- browser_accessibility_qt.h \
- browsing_data_remover_delegate_qt.h \
- browser_main_parts_qt.h \
- browser_message_filter_qt.h \
- certificate_error_controller.h \
- client_cert_select_controller.h \
- clipboard_change_observer.h \
- clipboard_qt.h \
- color_chooser_qt.h \
- color_chooser_controller_p.h \
- color_chooser_controller.h \
- common/qt_messages.h \
- compositor/compositor.h \
- compositor/content_gpu_client_qt.h \
- compositor/display_software_output_surface.h \
- content_client_qt.h \
- content_browser_client_qt.h \
- content_main_delegate_qt.h \
- content_utility_client_qt.h \
- delegated_frame_host_client_qt.h \
- desktop_screen_qt.h \
- devtools_frontend_qt.h \
- devtools_manager_delegate_qt.h \
- download_manager_delegate_qt.h \
- favicon_manager.h \
- file_picker_controller.h \
- find_text_helper.h \
- global_descriptors_qt.h \
- javascript_dialog_controller_p.h \
- javascript_dialog_controller.h \
- javascript_dialog_manager_qt.h \
- login_delegate_qt.h \
- media_capture_devices_dispatcher.h \
- net/client_cert_override.h \
- net/client_cert_store_data.h \
- net/cookie_monster_delegate_qt.h \
- net/custom_url_loader_factory.h \
- net/proxying_url_loader_factory_qt.h \
- net/proxying_restricted_cookie_manager_qt.h \
- net/qrc_url_scheme_handler.h \
- net/ssl_host_state_delegate_qt.h \
- net/system_network_context_manager.h \
- net/url_request_custom_job_delegate.h \
- net/url_request_custom_job_proxy.h \
- net/webui_controller_factory_qt.h \
- ozone/gl_context_qt.h \
- ozone/gl_share_context_qt.h \
- ozone/gl_ozone_egl_qt.h \
- ozone/gl_surface_qt.h \
- ozone/gl_surface_egl_qt.h \
- ozone/gl_surface_wgl_qt.h \
- ozone/platform_window_qt.h \
- ozone/surface_factory_qt.h \
- permission_manager_qt.h \
- platform_notification_service_qt.h \
- pref_service_adapter.h \
- process_main.h \
- profile_adapter.h \
- profile_adapter_client.h \
- profile_qt.h \
- profile_io_data_qt.h \
- proxy_config_monitor.h \
- proxy_config_service_qt.h \
- quota_permission_context_qt.h \
- quota_request_controller.h \
- quota_request_controller_impl.h \
- register_protocol_handler_request_controller.h \
- register_protocol_handler_request_controller_impl.h \
- render_view_context_menu_qt.h \
- render_widget_host_view_qt.h \
- render_widget_host_view_qt_delegate.h \
- render_widget_host_view_qt_delegate_client.h \
- renderer/content_renderer_client_qt.h \
- renderer/content_settings_observer_qt.h \
- renderer/render_frame_observer_qt.h \
- renderer/web_engine_page_render_frame.h \
- renderer/render_configuration.h \
- renderer/user_resource_controller.h \
- renderer_host/web_engine_page_host.h \
- renderer_host/user_resource_controller_host.h \
- request_controller.h \
- resource_context_qt.h \
- touch_handle_drawable_client.h \
- touch_handle_drawable_qt.h \
- touch_selection_controller_client_qt.h \
- touch_selection_menu_controller.h \
- type_conversion.h \
- user_notification_controller.h \
- user_script.h \
- visited_links_manager_qt.h \
- web_contents_adapter.h \
- web_contents_adapter_client.h \
- web_contents_delegate_qt.h \
- web_contents_view_qt.h \
- web_engine_context.h \
- web_engine_error.h \
- web_engine_library_info.h \
- web_engine_settings.h \
- web_event_factory.h
-
-qtConfig(webengine-ozone-x11) {
- HEADERS += ozone/gl_ozone_glx_qt.h \
- ozone/gl_surface_glx_qt.h
- SOURCES += ozone/gl_surface_glx_qt.cpp \
- ozone/gl_ozone_glx_qt.cpp
-}
-
-qtConfig(webengine-pepper-plugins) {
-
- SOURCES += \
- renderer_host/pepper/pepper_host_factory_qt.cpp \
- renderer_host/pepper/pepper_isolated_file_system_message_filter.cpp \
- renderer/pepper/pepper_renderer_host_factory_qt.cpp \
- renderer/plugins/loadable_plugin_placeholder_qt.cpp
-
- HEADERS += \
- renderer_host/pepper/pepper_host_factory_qt.h \
- renderer_host/pepper/pepper_isolated_file_system_message_filter.h \
- renderer/pepper/pepper_renderer_host_factory_qt.h \
- renderer/plugins/loadable_plugin_placeholder_qt.h
-}
-
-qtConfig(webengine-printing-and-pdf) {
-
- SOURCES += \
- printing/print_view_manager_base_qt.cpp \
- printing/print_view_manager_qt.cpp \
- printing/printer_worker.cpp \
- renderer/print_web_view_helper_delegate_qt.cpp
-
- HEADERS += \
- printing/print_view_manager_base_qt.h \
- printing/print_view_manager_qt.h \
- printing/printer_worker.h \
- renderer/print_web_view_helper_delegate_qt.h
-
- # pdf sources
- SOURCES += printing/pdfium_document_wrapper_qt.cpp
- HEADERS += printing/pdfium_document_wrapper_qt.h
-}
-
-contains(QT_CONFIG, opengl) {
- SOURCES += \
- compositor/compositor_resource_fence.cpp \
- compositor/display_gl_output_surface.cpp
- HEADERS += \
- compositor/compositor_resource_fence.h \
- compositor/display_gl_output_surface.h
-
- macos {
- HEADERS+=macos_context_type_helper.h
- SOURCES+=macos_context_type_helper.mm
- }
-}
-
-qtConfig(webengine-geolocation) {
- SOURCES += location_provider_qt.cpp
- HEADERS += location_provider_qt.h
-}
-
-qtConfig(webengine-webchannel) {
- HEADERS += renderer/web_channel_ipc_transport.h \
- renderer_host/web_channel_ipc_transport_host.h
-
- SOURCES += renderer/web_channel_ipc_transport.cpp \
- renderer_host/web_channel_ipc_transport_host.cpp
-}
-
-qtConfig(webengine-extensions) {
- SOURCES += \
- common/extensions/extensions_api_provider_qt.cpp \
- common/extensions/extensions_client_qt.cpp \
- extensions/component_extension_resource_manager_qt.cpp \
- extensions/extension_host_delegate_qt.cpp \
- extensions/extension_system_qt.cpp \
- extensions/extension_system_factory_qt.cpp \
- extensions/extension_web_contents_observer_qt.cpp \
- extensions/extensions_api_client_qt.cpp \
- extensions/extensions_browser_client_qt.cpp \
- extensions/messaging_delegate_qt.cpp \
- extensions/mime_handler_view_guest_delegate_qt.cpp \
- extensions/pdf_iframe_navigation_throttle_qt.cpp \
- extensions/plugin_service_filter_qt.cpp \
- net/plugin_response_interceptor_url_loader_throttle.cpp \
- renderer/extensions/extensions_dispatcher_delegate_qt.cpp \
- renderer/extensions/extensions_renderer_client_qt.cpp \
- renderer/extensions/renderer_permissions_policy_delegate_qt.cpp \
- renderer/extensions/resource_request_policy_qt.cpp
-
- HEADERS += \
- common/extensions/extensions_api_provider_qt.h \
- common/extensions/extensions_client_qt.h \
- extensions/component_extension_resource_manager_qt.h \
- extensions/extension_host_delegate_qt.h \
- extensions/extension_system_qt.h \
- extensions/extension_system_factory_qt.h \
- extensions/extension_web_contents_observer_qt.h \
- extensions/extensions_api_client_qt.h \
- extensions/extensions_browser_client_qt.h \
- extensions/messaging_delegate_qt.h \
- extensions/mime_handler_view_guest_delegate_qt.h \
- extensions/pdf_iframe_navigation_throttle_qt.h \
- extensions/plugin_service_filter_qt.h \
- net/plugin_response_interceptor_url_loader_throttle.h \
- renderer/extensions/extensions_dispatcher_delegate_qt.h \
- renderer/extensions/extensions_renderer_client_qt.h \
- renderer/extensions/renderer_permissions_policy_delegate_qt.h \
- renderer/extensions/resource_request_policy_qt.h
-}
diff --git a/src/core/core_common.pri b/src/core/core_common.pri
deleted file mode 100644
index 9e06b37f..00000000
--- a/src/core/core_common.pri
+++ /dev/null
@@ -1,21 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += buildtools-private webenginecore webenginecore-private
-
-# NOTE: The TARGET, QT, QT_PRIVATE variables are used in both core_module.pro and core_gyp_generator.pro
-# gyp/ninja will take care of the compilation, qmake/make will finish with linking and install.
-
-TARGET = QtWebEngineCore
-QT += qml-private quick-private gui-private core-private
-qtConfig(webengine-printing-and-pdf): QT += printsupport
-QT_PRIVATE += webenginecoreheaders-private
-
-qtConfig(webengine-geolocation): QT += positioning
-qtConfig(webengine-webchannel): QT += webchannel
-
-# LTO does not work for Chromium at the moment, so disable it completely for core.
-CONFIG -= ltcg
-
-# QtBase requires C++17
-CONFIG += c++17
-
diff --git a/src/core/core_generator.pro b/src/core/core_generator.pro
deleted file mode 100644
index 935c653a..00000000
--- a/src/core/core_generator.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-include(core_common.pri)
-
-include(core_gn_config.pri)
-
-TEMPLATE = lib
-
-include(core_chromium.pri)
diff --git a/src/core/core_gn_config.pri b/src/core/core_gn_config.pri
deleted file mode 100644
index 2b8f2e18..00000000
--- a/src/core/core_gn_config.pri
+++ /dev/null
@@ -1,17 +0,0 @@
-CONFIG = gn_generator $$CONFIG
-GN_SRC_DIR = $$PWD
-GN_FILE = $$OUT_PWD/$$getConfigDir()/BUILD.gn
-GN_FIND_MOCABLES_SCRIPT = $$shell_path($$QTWEBENGINE_ROOT/tools/scripts/gn_find_mocables.py)
-GN_RUN_BINARY_SCRIPT = $$shell_path($$QTWEBENGINE_ROOT/tools/scripts/gn_run_binary.py)
-GN_IMPORTS = $$PWD/qtwebengine.gni
-qtConfig (webengine-extensions) {
- GN_INCLUDES += $$PWD/qtwebengine_sources.gni $$PWD/qtwebengine_resources.gni $$PWD/common/extensions/api/qtwebengine_extensions_features.gni
-} else {
- GN_INCLUDES = $$PWD/qtwebengine_sources.gni $$PWD/qtwebengine_resources.gni
-}
-GN_CORE_INCLUDE_DIRS = $$PWD/service
-GN_CREATE_PRI = true
-GN_PRECOMPILED_HEADERS = true
-QMAKE_INTERNAL_INCLUDED_FILES = $$GN_IMPORTS $$GN_INCLUDES $$GN_FILE
-
-
diff --git a/src/core/core_headers.pro b/src/core/core_headers.pro
deleted file mode 100644
index cd5352eb..00000000
--- a/src/core/core_headers.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-TARGET = QtWebEngineCore
-CONFIG += no_private_module header_module internal_module no_plist
-QT -= core gui
-MODULE = webenginecoreheaders
-MODULE_CFG_FILE = qtwebenginecore-config
-load(qt_module)
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
deleted file mode 100644
index 520b452f..00000000
--- a/src/core/core_module.pro
+++ /dev/null
@@ -1,120 +0,0 @@
-MODULE = webenginecore
-
-include(core_common.pri)
-include($${QTWEBENGINE_ROOT}/src/buildtools/config/linking.pri)
-
-api_library_name = qtwebenginecoreapi$$qtPlatformTargetSuffix()
-api_library_path = $$OUT_PWD/api/$$getConfigDir()
-LIBS_PRIVATE += -L$$api_library_path
-CONFIG *= no_smart_library_merge
-osx {
- LIBS_PRIVATE += -Wl,-force_load,$${api_library_path}$${QMAKE_DIR_SEP}lib$${api_library_name}.a
-} else: win32 {
- !qtConfig(webengine-developer-build) {
- # Remove unused functions and data in debug non-developer builds, because the binaries will
- # be smaller in the shipped packages.
- QMAKE_LFLAGS += /OPT:REF
- } else:CONFIG(debug, debug|release):!clang_cl {
- # Make sure to override qtbase's QMAKE_LFLAGS_DEBUG option in debug developer builds,
- # because qmake chooses and overrides the option when it gets appended to QMAKE_LFLAGS in
- # qtbase\mkspecs\features\default_post.prf, regardless of what Chromium passes back from GN.
- QMAKE_LFLAGS_DEBUG -= /DEBUG
- QMAKE_LFLAGS_DEBUG += /DEBUG:FASTLINK
- }
- # Simulate -whole-archive by passing the list of object files that belong to the public
- # API library as response file to the linker.
- QMAKE_LFLAGS += @$${api_library_path}$${QMAKE_DIR_SEP}$${api_library_name}.lib.objects
-} else {
- QMAKE_LFLAGS += -Wl,-whole-archive -l$$api_library_name -Wl,-no-whole-archive
-}
-
-win32 {
- POST_TARGETDEPS += $${api_library_path}$${QMAKE_DIR_SEP}$${api_library_name}.lib
-} else {
- POST_TARGETDEPS += $${api_library_path}$${QMAKE_DIR_SEP}lib$${api_library_name}.a
-}
-
-# Needed to set a CFBundleIdentifier
-QMAKE_INFO_PLIST = Info_mac.plist
-
-# Using -Wl,-Bsymbolic-functions seems to confuse the dynamic linker
-# and doesn't let Chromium get access to libc symbols through dlsym.
-CONFIG -= bsymbolic_functions
-
-linux {
- !ccache:!use_gold_linker:!use_lld_linker {
- QMAKE_LINK="ulimit -n 4096 && $$QMAKE_LINK"
- QMAKE_LINK_SHLIB="ulimit -n 4096 && $$QMAKE_LINK_SHLIB"
- }
- qtConfig(separate_debug_info): QMAKE_POST_LINK="cd $(DESTDIR) && $(STRIP) --strip-unneeded $(TARGET)"
-}
-
-REPACK_DIR = $$OUT_PWD/$$getConfigDir()
-
-# Duplicated from resources/resources.gyp
-LOCALE_LIST = am ar bg bn ca cs da de el en-GB en-US es-419 es et fa fi fil fr gu he hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv sw ta te th tr uk vi zh-CN zh-TW
-for(LOC, LOCALE_LIST) {
- locales.files += $$REPACK_DIR/qtwebengine_locales/$${LOC}.pak
-}
-resources.files = $$REPACK_DIR/qtwebengine_resources.pak \
- $$REPACK_DIR/qtwebengine_resources_100p.pak \
- $$REPACK_DIR/qtwebengine_resources_200p.pak \
- $$REPACK_DIR/qtwebengine_devtools_resources.pak
-
-icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat
-
-!qtConfig(debug_and_release)|!qtConfig(build_all)|CONFIG(release, debug|release) {
- qtConfig(framework) {
- locales.version = Versions
- locales.path = Resources/qtwebengine_locales
- resources.version = Versions
- resources.path = Resources
- icu.version = Versions
- icu.path = Resources
- # No files, this prepares the bundle Helpers symlink, process.pro will create the directories
- qtwebengineprocessplaceholder.version = Versions
- qtwebengineprocessplaceholder.path = Helpers
- QMAKE_BUNDLE_DATA += icu locales resources qtwebengineprocessplaceholder
- } else {
- locales.CONFIG += no_check_exist
- locales.path = $$[QT_INSTALL_TRANSLATIONS]/qtwebengine_locales
- resources.CONFIG += no_check_exist
- resources.path = $$[QT_INSTALL_DATA]/resources
- INSTALLS += locales resources
-
- !qtConfig(webengine-system-icu) {
- icu.CONFIG += no_check_exist
- icu.path = $$[QT_INSTALL_DATA]/resources
- INSTALLS += icu
- }
- }
-
- !qtConfig(framework):!force_independent {
- #
- # Copy essential files to the qtbase build directory for non-prefix builds
- #
-
- !qtConfig(webengine-system-icu) {
- COPIES += icu
- }
-
- COPIES += resources locales
- }
-}
-
-!build_pass:qtConfig(debug_and_release) {
- # Special GNU make target that ensures linking isn't done for both debug and release builds
- # at the same time.
- notParallel.target = .NOTPARALLEL
- QMAKE_EXTRA_TARGETS += notParallel
-}
-
-OTHER_FILES = \
- $$files(../3rdparty/chromium/*.py, true) \
- $$files(../3rdparty/chromium/*.gyp, true) \
- $$files(../3rdparty/chromium/*.gypi, true) \
- $$files(../3rdparty/chromium/*.gn, true) \
- $$files(../3rdparty/chromium/*.gni, true)
-
-load(qt_module)
-
diff --git a/src/core/core_project.pro b/src/core/core_project.pro
deleted file mode 100644
index 9c8e2080..00000000
--- a/src/core/core_project.pro
+++ /dev/null
@@ -1,28 +0,0 @@
-TEMPLATE = lib
-# Fake project to make QtCreator happy.
-
-include(core_common.pri)
-
-
-linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri
-
-!include($$linking_pri) {
- error("Could not find the linking information that gn should have generated.")
-}
-
-CHROMIUM_SRC_DIR = $$QTWEBENGINE_ROOT/$$getChromiumSrcDir()
-INCLUDEPATH += $$CHROMIUM_SRC_DIR \
- $$CHROMIUM_SRC_DIR/third_party/blink/public \
- $$OUT_PWD/$$getConfigDir()/gen
-
-SOURCES += $$NINJA_SOURCES
-HEADERS += $$NINJA_HEADERS
-DEFINES += $$NINJA_DEFINES
-
-lupdate_run {
- SOURCES += clipboard_qt.cpp \
- profile_adapter_client.cpp \
- profile_adapter.cpp \
- render_view_context_menu_qt.cpp \
- web_contents_adapter.cpp
-}
diff --git a/src/core/delegated_frame_host_client_qt.cpp b/src/core/delegated_frame_host_client_qt.cpp
index e10ff9dd..2d3966bd 100644
--- a/src/core/delegated_frame_host_client_qt.cpp
+++ b/src/core/delegated_frame_host_client_qt.cpp
@@ -65,7 +65,9 @@ void DelegatedFrameHostClientQt::OnFrameTokenChanged(uint32_t frame_token, base:
float DelegatedFrameHostClientQt::GetDeviceScaleFactor() const
{
- return p->m_screenInfo.device_scale_factor;
+ display::ScreenInfo screen_info;
+ p->GetScreenInfo(&screen_info);
+ return screen_info.device_scale_factor;
}
void DelegatedFrameHostClientQt::InvalidateLocalSurfaceIdOnEviction()
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 81701b63..968302be 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
@@ -87,6 +87,8 @@ using namespace QtWebEngineCore;
namespace {
+constexpr char kScreencastEnabled[] = "screencastEnabled";
+
std::unique_ptr<base::DictionaryValue> BuildObjectForResponse(const net::HttpResponseHeaders *rh,
bool success,
int net_error)
@@ -299,12 +301,12 @@ void DevToolsFrontendQt::ReadyToCommitNavigation(content::NavigationHandle *navi
else if (!m_frontendHost)
m_frontendHost = content::DevToolsFrontendHost::Create(
frame,
- base::Bind(&DevToolsFrontendQt::HandleMessageFromDevToolsFrontend,
- base::Unretained(this)));
+ base::BindRepeating(&DevToolsFrontendQt::HandleMessageFromDevToolsFrontend,
+ base::Unretained(this)));
}
}
-void DevToolsFrontendQt::DocumentAvailableInMainFrame()
+void DevToolsFrontendQt::DocumentAvailableInMainFrame(content::RenderFrameHost * /*render_frame_host*/)
{
if (!m_inspectedContents)
return;
@@ -372,37 +374,47 @@ void DevToolsFrontendQt::CreateJsonPreferences(bool clear)
m_prefStore = scoped_refptr<PersistentPrefStore>(jsonPrefStore);
}
-void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &message)
+void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(base::Value message)
{
- if (!m_agentHost)
- return;
- std::string method;
- base::ListValue *params = nullptr;
- base::DictionaryValue *dict = nullptr;
- std::unique_ptr<base::Value> parsed_message = base::JSONReader::ReadDeprecated(message);
- if (!parsed_message || !parsed_message->GetAsDictionary(&dict) || !dict->GetString("method", &method))
+ const std::string *method_ptr = nullptr;
+ base::Value *params_value = nullptr;
+ if (message.is_dict()) {
+ method_ptr = message.FindStringKey("method");
+ params_value = message.FindKey("params");
+ }
+ if (!method_ptr || (params_value && !params_value->is_list())) {
+ LOG(ERROR) << "Invalid message was sent to embedder: " << message;
return;
- int request_id = 0;
- dict->GetInteger("id", &request_id);
- dict->GetList("params", &params);
-
- if (method == "dispatchProtocolMessage" && params && params->GetSize() == 1) {
- std::string protocol_message;
- if (!params->GetString(0, &protocol_message))
+ }
+ base::Value empty_params(base::Value::Type::LIST);
+ if (!params_value)
+ params_value = &empty_params;
+
+ int request_id = message.FindIntKey("id").value_or(0);
+ const std::string &method = *method_ptr;
+ base::Value::ListView params;
+ if (params_value)
+ params = params_value->GetList();
+
+ if (method == "dispatchProtocolMessage" && params.size() == 1) {
+ const std::string *protocol_message = params[0].GetIfString();
+ if (!protocol_message)
return;
- m_agentHost->DispatchProtocolMessage(this, base::as_bytes(base::make_span(protocol_message)));
+ if (m_agentHost)
+ m_agentHost->DispatchProtocolMessage(this, base::as_bytes(base::make_span(*protocol_message)));
} else if (method == "loadCompleted") {
- web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.setUseSoftMenu(true);"),
+ web_contents()->GetMainFrame()->ExecuteJavaScript(u"DevToolsAPI.setUseSoftMenu(true);",
base::NullCallback());
- } else if (method == "loadNetworkResource" && params->GetSize() == 3) {
+ } else if (method == "loadNetworkResource" && params.size() == 3) {
// TODO(pfeldman): handle some of the embedder messages in content.
- std::string url;
- std::string headers;
- int stream_id;
- if (!params->GetString(0, &url) || !params->GetString(1, &headers) || !params->GetInteger(2, &stream_id))
+ const std::string *url = params[0].GetIfString();
+ const std::string *headers = params[1].GetIfString();
+ absl::optional<int> stream_id = params[2].GetIfInt();
+ if (!url || !headers || !stream_id.has_value()) {
return;
+ }
- GURL gurl(url);
+ GURL gurl(*url);
if (!gurl.is_valid()) {
base::DictionaryValue response;
response.SetInteger("statusCode", 404);
@@ -441,7 +453,7 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me
// TODO(caseq): this preserves behavior of URLFetcher-based implementation.
// We really need to pass proper first party origin from the front-end.
resource_request->site_for_cookies = net::SiteForCookies::FromUrl(gurl);
- resource_request->headers.AddHeadersFromString(headers);
+ resource_request->headers.AddHeadersFromString(*headers);
mojo::Remote<network::mojom::URLLoaderFactory> file_url_loader_factory;
scoped_refptr<network::SharedURLLoaderFactory> network_url_loader_factory;
@@ -455,64 +467,67 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me
SendMessageAck(request_id, &response);
return;
} else {
- auto *partition = content::BrowserContext::GetStoragePartitionForSite(
- web_contents()->GetBrowserContext(), gurl);
+ auto *partition = web_contents()->GetBrowserContext()->GetStoragePartitionForUrl(gurl);
network_url_loader_factory = partition->GetURLLoaderFactoryForBrowserProcess();
url_loader_factory = network_url_loader_factory.get();
}
auto simple_url_loader = network::SimpleURLLoader::Create(
std::move(resource_request), traffic_annotation);
auto resource_loader = std::make_unique<NetworkResourceLoader>(
- stream_id, request_id, this, std::move(simple_url_loader),
+ *stream_id, request_id, this, std::move(simple_url_loader),
url_loader_factory);
m_loaders.insert(std::move(resource_loader));
return;
} else if (method == "getPreferences") {
+ // Screencast is enabled by default if it's not present in the preference store.
+ if (!m_prefStore->GetValue(kScreencastEnabled, NULL))
+ SetPreference(kScreencastEnabled, "false");
+
m_preferences = std::move(*m_prefStore->GetValues());
SendMessageAck(request_id, &m_preferences);
return;
- } else if (method == "setPreference") {
- std::string name;
- std::string value;
- if (!params->GetString(0, &name) || !params->GetString(1, &value))
+ } else if (method == "setPreference" && params.size() >= 2) {
+ const std::string *name = params[0].GetIfString();
+ const std::string *value = params[1].GetIfString();
+ if (!name || !value)
return;
- SetPreference(name, value);
- } else if (method == "removePreference") {
- std::string name;
- if (!params->GetString(0, &name))
+ SetPreference(*name, *value);
+ } else if (method == "removePreference" && params.size() >= 1) {
+ const std::string *name = params[0].GetIfString();
+ if (!name)
return;
- RemovePreference(name);
+ RemovePreference(*name);
} else if (method == "clearPreferences") {
ClearPreferences();
} else if (method == "requestFileSystems") {
- web_contents()->GetMainFrame()->ExecuteJavaScript(base::ASCIIToUTF16("DevToolsAPI.fileSystemsLoaded([]);"),
+ web_contents()->GetMainFrame()->ExecuteJavaScript(u"DevToolsAPI.fileSystemsLoaded([]);",
base::NullCallback());
} else if (method == "reattach") {
if (!m_agentHost)
return;
m_agentHost->DetachClient(this);
m_agentHost->AttachClient(this);
- } else if (method == "inspectedURLChanged" && params && params->GetSize() >= 1) {
- std::string url;
- if (!params->GetString(0, &url))
+ } else if (method == "inspectedURLChanged" && params.size() >= 1) {
+ const std::string *url = params[0].GetIfString();
+ if (!url)
return;
const std::string kHttpPrefix = "http://";
const std::string kHttpsPrefix = "https://";
const std::string simplified_url =
- base::StartsWith(url, kHttpsPrefix, base::CompareCase::SENSITIVE)
- ? url.substr(kHttpsPrefix.length())
- : base::StartsWith(url, kHttpPrefix, base::CompareCase::SENSITIVE)
- ? url.substr(kHttpPrefix.length())
- : url;
+ base::StartsWith(*url, kHttpsPrefix, base::CompareCase::SENSITIVE)
+ ? url->substr(kHttpsPrefix.length())
+ : base::StartsWith(*url, kHttpPrefix, base::CompareCase::SENSITIVE)
+ ? url->substr(kHttpPrefix.length())
+ : *url;
// DevTools UI is not localized.
web_contents()->UpdateTitleForEntry(web_contents()->GetController().GetActiveEntry(),
base::UTF8ToUTF16(
base::StringPrintf("DevTools - %s", simplified_url.c_str())));
- } else if (method == "openInNewTab") {
- std::string urlString;
- if (!params->GetString(0, &urlString))
+ } else if (method == "openInNewTab" && params.size() >= 1) {
+ const std::string *urlString = params[0].GetIfString();
+ if (!urlString)
return;
- GURL url(urlString);
+ GURL url(*urlString);
if (!url.is_valid())
return;
content::OpenURLParams openParams(GURL(url),
@@ -534,11 +549,11 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me
Activate();
} else if (method == "closeWindow") {
web_contents()->Close();
- } else if (method == "setEyeDropperActive" && params->GetSize() == 1) {
- bool active;
- if (!params->GetBoolean(0, &active))
+ } else if (method == "setEyeDropperActive" && params.size() == 1) {
+ absl::optional<bool> active = params[0].GetIfBool();
+ if (!active)
return;
- SetEyeDropperActive(active);
+ SetEyeDropperActive(*active);
} else {
VLOG(1) << "Unimplemented devtools method: " << message;
return;
@@ -555,8 +570,8 @@ void DevToolsFrontendQt::SetEyeDropperActive(bool active)
if (active) {
m_eyeDropper.reset(new DevToolsEyeDropper(
m_inspectedContents,
- base::Bind(&DevToolsFrontendQt::ColorPickedInEyeDropper,
- base::Unretained(this))));
+ base::BindRepeating(&DevToolsFrontendQt::ColorPickedInEyeDropper,
+ base::Unretained(this))));
} else {
m_eyeDropper.reset();
}
@@ -580,7 +595,7 @@ void DevToolsFrontendQt::DispatchProtocolMessage(content::DevToolsAgentHost *age
std::string param;
base::EscapeJSONString(message_sp, true, &param);
std::string code = "DevToolsAPI.dispatchMessage(" + param + ");";
- base::string16 javascript = base::UTF8ToUTF16(code);
+ std::u16string javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScript(javascript, base::NullCallback());
return;
}
@@ -591,7 +606,7 @@ void DevToolsFrontendQt::DispatchProtocolMessage(content::DevToolsAgentHost *age
base::EscapeJSONString(message_sp.substr(pos, kMaxMessageChunkSize), true, &param);
std::string code = "DevToolsAPI.dispatchMessageChunk(" + param + ","
+ std::to_string(pos ? 0 : total_size) + ");";
- base::string16 javascript = base::UTF8ToUTF16(code);
+ std::u16string javascript = base::UTF8ToUTF16(code);
web_contents()->GetMainFrame()->ExecuteJavaScript(javascript, base::NullCallback());
}
}
diff --git a/src/core/devtools_frontend_qt.h b/src/core/devtools_frontend_qt.h
index aac5909d..68e6c1b4 100644
--- a/src/core/devtools_frontend_qt.h
+++ b/src/core/devtools_frontend_qt.h
@@ -101,12 +101,12 @@ protected:
void DispatchProtocolMessage(content::DevToolsAgentHost* agent_host, base::span<const uint8_t> message) override;
void SetPreferences(const std::string& json);
- virtual void HandleMessageFromDevToolsFrontend(const std::string& message);
+ void HandleMessageFromDevToolsFrontend(base::Value message);
private:
// WebContentsObserver overrides
void ReadyToCommitNavigation(content::NavigationHandle* navigation_handle) override;
- void DocumentAvailableInMainFrame() override;
+ void DocumentAvailableInMainFrame(content::RenderFrameHost *render_frame_host) override;
void WebContentsDestroyed() override;
void SendMessageAck(int request_id, const base::Value* arg1);
diff --git a/tools/about_credits.tmpl b/src/core/doc/about_credits.tmpl
index 57fae9e7..57fae9e7 100644
--- a/tools/about_credits.tmpl
+++ b/src/core/doc/about_credits.tmpl
diff --git a/tools/about_credits_entry.tmpl b/src/core/doc/about_credits_entry.tmpl
index 2bb9cff4..2bb9cff4 100644
--- a/tools/about_credits_entry.tmpl
+++ b/src/core/doc/about_credits_entry.tmpl
diff --git a/src/core/doc/qtwebengine.qdocconf b/src/core/doc/qtwebengine.qdocconf
index 6a3bd9ca..ed95ae0c 100644
--- a/src/core/doc/qtwebengine.qdocconf
+++ b/src/core/doc/qtwebengine.qdocconf
@@ -33,9 +33,6 @@ qhp.QtWebEngine.subprojects.examples.sortPages = true
manifestmeta.highlighted.names += "QtWebEngine/WebEngine Widgets Simple Browser Example" \
"QtWebEngine/WebEngine Quick Nano Browser"
-# add a generic thumbnail for an example that has no \image in its doc
-manifestmeta.thumbnail.names = "QtWebEngine/PDF Viewer Example"
-
tagfile = ../../../doc/qtwebengine/qtwebengine.tags
# Custom module header for clang that pulls in also QtWebEngineWidgets
@@ -57,6 +54,7 @@ depends += qtcore \
qtquick \
qtquickcontrols \
qtdoc \
+ qtcmake \
qtwebchannel \
qtwebview \
qtwidgets
@@ -77,6 +75,10 @@ exampledirs += ../../../examples \
../../webenginequick/doc/snippets \
../../webenginewidgets/doc/snippets
+#exclude Qt PDF example directories
+excludedirs += ../../../examples/pdfwidgets \
+ ../../../examples/pdf
+
examples.fileextensions += *.aff *.dic *.html
imagedirs += \
@@ -89,3 +91,6 @@ navigation.qmltypespage = "Qt WebEngine QML Types"
# \QWE macro expands to 'Qt WebEngine' without auto-linking anywhere.
macro.QWE = "Qt \\WebEngine"
+
+# Fail the documentation build if there are more warnings than the limit
+warninglimit = 0
diff --git a/src/core/doc/src/external-resources.qdoc b/src/core/doc/src/external-resources.qdoc
index 24648b84..df6c40c4 100644
--- a/src/core/doc/src/external-resources.qdoc
+++ b/src/core/doc/src/external-resources.qdoc
@@ -144,3 +144,19 @@
\externalpage https://developers.google.com/web/updates/2017/09/autoplay-policy-changes
\title Autoplay Policy Changes
*/
+
+// Workarounds for broken links introduced by README.chromium license files
+/*!
+ \externalpage #
+ \title This is the canonical public repository
+*/
+
+/*!
+ \externalpage #
+ \title NA
+*/
+
+/*!
+ \externalpage https://source.chromium.org/chromium/chromium/src/+/master:v8/src/base/ieee754.cc
+ \title source.chromium.org/chromium/chromium/src/+/master:v8/src/base/ieee754.cc
+*/
diff --git a/src/core/doc/src/qt6-changes.qdoc b/src/core/doc/src/qt6-changes.qdoc
index 1ab3a848..6ae6918c 100644
--- a/src/core/doc/src/qt6-changes.qdoc
+++ b/src/core/doc/src/qt6-changes.qdoc
@@ -47,6 +47,13 @@
Has been renamed to the Qt WebEngineQuick module to not collide with the name of
the super module, and to be consistent with other Quick modules.
+ If you port your Qt Quick application, please remember to use the new module
+ name in your qmake project file.
+
+ \code
+ QT += webenginequick
+ \endcode
+
\section2 Classes moved from Qt WebEngineWidgets to Qt WebEngineCore
Several classes have been moved from Qt WebEngineWidgets to Qt WebEngineCore if they
did not use the Widgets module. In most cases this change should be source compatible unless
diff --git a/src/core/doc/src/qt_webengine_add_convert_dictionary.qdoc b/src/core/doc/src/qt_webengine_add_convert_dictionary.qdoc
new file mode 100644
index 00000000..cbb4a41f
--- /dev/null
+++ b/src/core/doc/src/qt_webengine_add_convert_dictionary.qdoc
@@ -0,0 +1,75 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+\page qt_add_webengine_dictionary.html
+\ingroup cmake-commands
+
+\title qt_add_webengine_dictionary
+\target qt6_add_webengine_dictionary
+
+\brief Converts the hunspell dictionary format into \e bdict binary format.
+
+\section1 Synopsis
+
+\badcode
+qt_add_webengine_dictionary(
+ [TARGET]
+ [SOURCE]
+ [OUTPUT_DIRECTORY]
+)
+
+\endcode
+
+\versionlessCMakeCommandsNote qt6_webengine_add_dictionary()
+
+\section1 Description
+
+ A spell checker in Qt Web Engine needs dictionaries in a specific binary format.
+ This CMake command converts dictionaries from the \l{Hunspell project}. into the \c bdict
+ binary format. It creates a \c webengine_dictionaries target, which your project can
+ use as a dependency. This way your project can easily add dictionaries for the spell
+ checker. Refer to the \l{WebEngine Widgets Spellchecker Example}{spell checker example}
+ for more details.
+
+\section1 Arguments
+
+ \c TARGET is an optinal argument and specifies the name of the application target that should
+ depend on \c webengine_dictionaries target. In other words it is used to define a build
+ dependency to create the binary format of dictionaries before building \c TARGET.
+
+ \c SOURCE is the absolute path to the \l{Hunspell project} dictionary for which
+ a corresponding binary format (\c.bdict) will be created.
+
+ \c OUTPUT_DIRECTORY is an optional argument and specifies the directory where the binary format
+ of the dictionary will be created. If not specified, \c CMAKE_CURRENT_BINARY_DIR will be used
+ as \c OUTPUT_DIRECTORY.
+
+ \note The \c webengine_dictionaries directory or \c <CONFIG>/webengine_dictionaries directories
+ in the case of the multi-config generator is appended to OUTPUT_DIRECTORY. This helps to
+ utilize dictionaries, as the \c webengine_dictionaries directory is the default search location.
+*/
diff --git a/src/core/doc/src/qtwebengine-features.qdoc b/src/core/doc/src/qtwebengine-features.qdoc
index 29ec002e..3b34ffbf 100644
--- a/src/core/doc/src/qtwebengine-features.qdoc
+++ b/src/core/doc/src/qtwebengine-features.qdoc
@@ -77,12 +77,13 @@
For more information, see \l{Qt Configure Options}.
- When using qmake to build just the \QWE module, the following
- command can be used (in this example, the \QWE source code is
+ When using cmake to build just the \QWE module, the following
+ command can be used to configure and build (in this example, the \QWE source code is
located in \c {C:\qt\qtwebengine}):
\code
- qmake C:\qt\qtwebengine -- -webengine-proprietary-codecs
+ qt-configure-module C:\qt\qtwebengine -webengine-proprietary-codecs
+ cmake --build . --parallel
\endcode
\warning When distributing proprietary codec libraries, you must acquire
@@ -219,12 +220,12 @@
\section1 HTML5 Geolocation
- \QWE supports JavaScript Geolocation API with \l {Qt Location} as a
+ \QWE supports JavaScript Geolocation API with \l {Qt Positioning} as a
backend. The application has to explicitly allow the feature by using
QWebEnginePage::Geolocation or \l{WebEngineView::Feature}
{WebEngineView.Feature}.
- If Qt Location has been built before \QWE then this feature can be
+ If Qt Positioning has been built before \QWE then this feature can be
tested by using \l{WebEngine Widgets Maps Example}{Maps} and allowing it to
find the current position of the user. Note that on Windows an external GPS
receiver must be connected to the application. For more information, see
diff --git a/src/core/doc/src/qtwebengine-platform-notes.qdoc b/src/core/doc/src/qtwebengine-platform-notes.qdoc
index c9426295..e131ae1c 100644
--- a/src/core/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/core/doc/src/qtwebengine-platform-notes.qdoc
@@ -62,10 +62,10 @@
On all platforms, the following tools are required at build time:
\list
- \li \l Python 2.7.5 or later. Python 3 is not supported.
+ \li \l Python 3.
\li Bison, Flex
\li GPerf
- \li Node.js version 8 or later (version 12 or later is recommended)
+ \li Node.js version 12 or later
\endlist
\section2 Windows
@@ -73,7 +73,7 @@
On Windows, the following additional tools are required:
\list
- \li Visual Studio 2017 version 15.8 or later, or clang-cl version 8 or later
+ \li Visual Studio 2019 or later, or clang-cl version 10 or later
\li Active Template Library (ATL), usually included in the Visual Studio
installation
\li Windows 10 SDK version 10.0.19041 or later
diff --git a/src/core/doc/src/qwebenginesettings_lgpl.qdoc b/src/core/doc/src/qwebenginesettings_lgpl.qdoc
index 7c6ccd3d..bfe2713a 100644
--- a/src/core/doc/src/qwebenginesettings_lgpl.qdoc
+++ b/src/core/doc/src/qwebenginesettings_lgpl.qdoc
@@ -97,13 +97,11 @@
Enables support for the HTML 5 local storage feature. Enabled by default.
\value LocalContentCanAccessRemoteUrls
Allows locally loaded documents to ignore cross-origin rules so that they can access
- remote resources that would normally be blocked, because all remote resources are
- considered cross-origin for a local file. Remote access that would not be blocked by
+ remote resources that would normally be blocked, since remote resources are
+ considered cross-origin for a local document. Remote access that would not be blocked by
cross-origin rules is still possible when this setting is disabled (default).
- Note that disabling this setting does not stop XMLHttpRequests or media elements in
- local files from accessing remote content. Basically, it only stops some HTML
- subresources, such as scripts, and therefore disabling this setting is not a safety
- mechanism.
+ Note that disabling this setting does not prevent media elements in local files from
+ accessing remote content. Disabled by default.
\value XSSAuditingEnabled
Obsolete and has no effect.
\value SpatialNavigationEnabled
@@ -114,7 +112,8 @@
trying to reach towards the right and which element they probably want.
Disabled by default.
\value LocalContentCanAccessFileUrls
- Allows locally loaded documents to access other local URLs. Enabled by default.
+ Allows locally loaded documents to access other local URLs. Disabling this makes QtWebEngine
+ behave more like Chrome and Firefox does by default. Enabled by default.
\value HyperlinkAuditingEnabled
Enables support for the \c ping attribute for hyperlinks. Disabled by default.
\value ScrollAnimatorEnabled
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index b7b74460..2a8a964f 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -83,7 +83,7 @@ void DownloadManagerDelegateQt::GetNextId(content::DownloadIdCallback callback)
download::DownloadItem *DownloadManagerDelegateQt::findDownloadById(quint32 downloadId)
{
- content::DownloadManager* dlm = content::BrowserContext::GetDownloadManager(m_profileAdapter->profile());
+ content::DownloadManager *dlm = m_profileAdapter->profile()->GetDownloadManager();
return dlm->GetDownload(downloadId);
}
@@ -94,7 +94,7 @@ void DownloadManagerDelegateQt::cancelDownload(content::DownloadTargetCallback c
download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
download::DownloadItem::UNKNOWN,
base::FilePath(),
- base::nullopt,
+ absl::nullopt,
download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED);
}
@@ -135,7 +135,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
download::DownloadItem::VALIDATED,
item->GetForcedFilePath(),
- base::nullopt,
+ absl::nullopt,
download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE);
return true;
}
@@ -204,8 +204,16 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
QFileInfo suggestedFile(info.path);
if (info.accepted && !suggestedFile.absoluteDir().mkpath(suggestedFile.absolutePath())) {
+#if defined(OS_WIN)
+ // TODO: Remove this when https://bugreports.qt.io/browse/QTBUG-85997 is fixed.
+ QDir suggestedDir = QDir(suggestedFile.absolutePath());
+ if (!suggestedDir.isRoot() || !suggestedDir.exists()) {
+#endif
qWarning("Creating download path failed, download cancelled: %s", suggestedFile.absolutePath().toUtf8().data());
info.accepted = false;
+#if defined(OS_WIN)
+ }
+#endif
}
if (!info.accepted) {
@@ -219,7 +227,7 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem *
download::DownloadDangerType::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT,
download::DownloadItem::VALIDATED,
filePathForCallback.AddExtension(toFilePathString("download")),
- base::nullopt,
+ absl::nullopt,
download::DownloadInterruptReason::DOWNLOAD_INTERRUPT_REASON_NONE);
} else
cancelDownload(std::move(*callback));
@@ -308,8 +316,8 @@ void DownloadManagerDelegateQt::ChooseSavePath(content::WebContents *web_content
return;
std::move(callback).Run(toFilePath(info.path), static_cast<content::SavePageType>(info.savePageFormat),
- base::Bind(&DownloadManagerDelegateQt::savePackageDownloadCreated,
- m_weakPtrFactory.GetWeakPtr()));
+ base::BindOnce(&DownloadManagerDelegateQt::savePackageDownloadCreated,
+ m_weakPtrFactory.GetWeakPtr()));
}
void DownloadManagerDelegateQt::savePackageDownloadCreated(download::DownloadItem *item)
diff --git a/src/core/extensions/component_extension_resource_manager_qt.cpp b/src/core/extensions/component_extension_resource_manager_qt.cpp
index 2b6a2454..0bb6efc9 100644
--- a/src/core/extensions/component_extension_resource_manager_qt.cpp
+++ b/src/core/extensions/component_extension_resource_manager_qt.cpp
@@ -45,6 +45,7 @@
#include "component_extension_resource_manager_qt.h"
#include "base/check.h"
+#include "base/containers/contains.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "base/stl_util.h"
diff --git a/src/core/extensions/extension_system_qt.cpp b/src/core/extensions/extension_system_qt.cpp
index 99b56786..a9699f30 100644
--- a/src/core/extensions/extension_system_qt.cpp
+++ b/src/core/extensions/extension_system_qt.cpp
@@ -167,7 +167,7 @@ void ExtensionSystemQt::LoadExtension(std::string extension_id, std::unique_ptr<
std::string error;
scoped_refptr<const Extension> extension = Extension::Create(
directory,
- Manifest::COMPONENT,
+ mojom::ManifestLocation::kComponent,
*manifest,
flags,
&error);
@@ -175,12 +175,12 @@ void ExtensionSystemQt::LoadExtension(std::string extension_id, std::unique_ptr<
LOG(ERROR) << error;
base::PostTask(FROM_HERE, {content::BrowserThread::IO},
- base::Bind(&InfoMap::AddExtension,
- base::Unretained(info_map()),
- base::RetainedRef(extension),
- base::Time::Now(),
- true,
- false));
+ base::BindOnce(&InfoMap::AddExtension,
+ base::Unretained(info_map()),
+ base::RetainedRef(extension),
+ base::Time::Now(),
+ true,
+ false));
extension_registry_->AddEnabled(extension.get());
NotifyExtensionLoaded(extension.get());
@@ -204,9 +204,9 @@ void ExtensionSystemQt::NotifyExtensionLoaded(const Extension *extension)
// extension.
RegisterExtensionWithRequestContexts(
extension,
- base::Bind(&ExtensionSystemQt::OnExtensionRegisteredWithRequestContexts,
- weak_ptr_factory_.GetWeakPtr(),
- base::WrapRefCounted(extension)));
+ base::BindRepeating(&ExtensionSystemQt::OnExtensionRegisteredWithRequestContexts,
+ weak_ptr_factory_.GetWeakPtr(),
+ base::WrapRefCounted(extension)));
// Tell renderers about the loaded extension.
renderer_helper_->OnExtensionLoaded(*extension);
@@ -361,7 +361,7 @@ void ExtensionSystemQt::Init(bool extensions_enabled)
ready_.Signal();
{
- std::string pdf_manifest = ui::ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_PDF_MANIFEST).as_string();
+ std::string pdf_manifest = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_PDF_MANIFEST);
base::ReplaceFirstSubstringAfterOffset(&pdf_manifest, 0, "<NAME>", "chromium-pdf");
std::unique_ptr<base::DictionaryValue> pdfManifestDict = ParseManifest(pdf_manifest);
@@ -374,7 +374,7 @@ void ExtensionSystemQt::Init(bool extensions_enabled)
#if BUILDFLAG(ENABLE_HANGOUT_SERVICES_EXTENSION)
{
- std::string hangout_manifest = ui::ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_HANGOUT_SERVICES_MANIFEST).as_string();
+ std::string hangout_manifest = ui::ResourceBundle::GetSharedInstance().LoadDataResourceString(IDR_HANGOUT_SERVICES_MANIFEST);
std::unique_ptr<base::DictionaryValue> hangoutManifestDict = ParseManifest(hangout_manifest);
base::FilePath path;
base::PathService::Get(base::DIR_QT_LIBRARY_DATA, &path);
@@ -411,9 +411,9 @@ void ExtensionSystemQt::RegisterExtensionWithRequestContexts(const Extension *ex
base::PostTaskAndReply(
FROM_HERE, {BrowserThread::IO},
- base::Bind(&InfoMap::AddExtension, info_map(),
- base::RetainedRef(extension), install_time, incognito_enabled,
- notifications_disabled),
+ base::BindOnce(&InfoMap::AddExtension, info_map(),
+ base::RetainedRef(extension), install_time, incognito_enabled,
+ notifications_disabled),
std::move(callback));
}
@@ -422,7 +422,7 @@ void ExtensionSystemQt::UnregisterExtensionWithRequestContexts(const std::string
{
base::PostTask(
FROM_HERE, {BrowserThread::IO},
- base::Bind(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
+ base::BindOnce(&InfoMap::RemoveExtension, info_map(), extension_id, reason));
}
bool ExtensionSystemQt::is_ready() const
diff --git a/src/core/extensions/extension_web_contents_observer_qt.cpp b/src/core/extensions/extension_web_contents_observer_qt.cpp
index 0959806f..947815d7 100644
--- a/src/core/extensions/extension_web_contents_observer_qt.cpp
+++ b/src/core/extensions/extension_web_contents_observer_qt.cpp
@@ -48,9 +48,9 @@
#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/common/url_constants.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/manifest.h"
+#include "third_party/blink/public/common/chrome_debug_urls.h"
#include "render_widget_host_view_qt.h"
@@ -86,7 +86,7 @@ void ExtensionWebContentsObserverQt::RenderFrameCreated(content::RenderFrameHost
auto *policy = content::ChildProcessSecurityPolicy::GetInstance();
if (extension->is_extension() && Manifest::IsComponentLocation(extension->location()))
- policy->GrantRequestOrigin(process_id, url::Origin::Create(GURL(content::kChromeUIResourcesURL)));
+ policy->GrantRequestOrigin(process_id, url::Origin::Create(GURL(blink::kChromeUIResourcesURL)));
}
void ExtensionWebContentsObserverQt::RenderViewReady()
diff --git a/src/core/extensions/extensions_browser_client_qt.cpp b/src/core/extensions/extensions_browser_client_qt.cpp
index 406facc5..a01b074c 100644
--- a/src/core/extensions/extensions_browser_client_qt.cpp
+++ b/src/core/extensions/extensions_browser_client_qt.cpp
@@ -50,6 +50,7 @@
#include "base/memory/weak_ptr.h"
#include "base/path_service.h"
#include "base/task/post_task.h"
+#include "base/task/thread_pool.h"
#include "base/memory/ref_counted_memory.h"
#include "chrome/browser/extensions/api/generated_api_registration.h"
#include "chrome/browser/profiles/profile.h"
@@ -67,6 +68,7 @@
#include "extensions/common/file_util.h"
#include "net/base/mime_util.h"
#include "qtwebengine/browser/extensions/api/generated_api_registration.h"
+#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/zlib/google/compression_utils.h"
@@ -128,12 +130,12 @@ public:
mojo::PendingReceiver<network::mojom::URLLoader> loader,
mojo::PendingRemote<network::mojom::URLLoaderClient> client_info,
const base::FilePath &filename, int resource_id,
- const std::string &content_security_policy, bool send_cors_header)
+ scoped_refptr<net::HttpResponseHeaders> headers)
{
// Owns itself. Will live as long as its URLLoader and URLLoaderClientPtr
// bindings are alive - essentially until either the client gives up or all
// file data has been sent to it.
- auto *bundle_loader = new ResourceBundleFileLoader(content_security_policy, send_cors_header);
+ auto *bundle_loader = new ResourceBundleFileLoader(std::move(headers));
bundle_loader->Start(request, std::move(loader), std::move(client_info), filename, resource_id);
}
@@ -141,7 +143,7 @@ public:
void FollowRedirect(const std::vector<std::string> &removed_headers,
const net::HttpRequestHeaders &modified_headers,
const net::HttpRequestHeaders &modified_cors_exempt_headers,
- const base::Optional<GURL> &new_url) override
+ const absl::optional<GURL> &new_url) override
{
NOTREACHED() << "No redirects for local file loads.";
}
@@ -152,9 +154,9 @@ public:
void ResumeReadingBodyFromNet() override {}
private:
- ResourceBundleFileLoader(const std::string &content_security_policy, bool send_cors_header)
+ ResourceBundleFileLoader(scoped_refptr<net::HttpResponseHeaders> headers)
+ : response_headers_(std::move(headers))
{
- response_headers_ = extensions::BuildHttpHeaders(content_security_policy, send_cors_header, base::Time());
}
~ResourceBundleFileLoader() override = default;
@@ -172,8 +174,8 @@ private:
auto data = GetResource(resource_id, request.url.host());
std::string *read_mime_type = new std::string;
- base::PostTaskAndReplyWithResult(
- FROM_HERE, { base::ThreadPool(), base::MayBlock() },
+ base::ThreadPool::PostTaskAndReplyWithResult(
+ FROM_HERE, { base::MayBlock() },
base::BindOnce(&net::GetMimeTypeFromFile, filename, base::Unretained(read_mime_type)),
base::BindOnce(&ResourceBundleFileLoader::OnMimeTypeRead, weak_factory_.GetWeakPtr(), std::move(data),
base::Owned(read_mime_type)));
@@ -387,12 +389,11 @@ void ExtensionsBrowserClientQt::LoadResourceFromResourceBundle(const network::Re
mojo::PendingReceiver<network::mojom::URLLoader> loader,
const base::FilePath &resource_relative_path,
int resource_id,
- const std::string &content_security_policy,
- mojo::PendingRemote<network::mojom::URLLoaderClient> client,
- bool send_cors_header)
+ scoped_refptr<net::HttpResponseHeaders> headers,
+ mojo::PendingRemote<network::mojom::URLLoaderClient> client)
{
ResourceBundleFileLoader::CreateAndStart(request, std::move(loader), std::move(client), resource_relative_path,
- resource_id, content_security_policy, send_cors_header);
+ resource_id, headers);
}
diff --git a/src/core/extensions/extensions_browser_client_qt.h b/src/core/extensions/extensions_browser_client_qt.h
index 7c00adca..9b07fa3e 100644
--- a/src/core/extensions/extensions_browser_client_qt.h
+++ b/src/core/extensions/extensions_browser_client_qt.h
@@ -127,9 +127,8 @@ public:
mojo::PendingReceiver<network::mojom::URLLoader> loader,
const base::FilePath &resource_relative_path,
int resource_id,
- const std::string &content_security_policy,
- mojo::PendingRemote<network::mojom::URLLoaderClient> client,
- bool send_cors_header) override;
+ scoped_refptr<net::HttpResponseHeaders> headers,
+ mojo::PendingRemote<network::mojom::URLLoaderClient> client) override;
// Returns the locale used by the application.
std::string GetApplicationLocale() override;
diff --git a/src/core/favicon_driver_qt.cpp b/src/core/favicon_driver_qt.cpp
index a3bbd593..73c79fc1 100644
--- a/src/core/favicon_driver_qt.cpp
+++ b/src/core/favicon_driver_qt.cpp
@@ -48,17 +48,19 @@
#include "content/public/browser/favicon_status.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_handle.h"
-#include "third_party/blink/public/common/manifest/manifest.h"
+#include "content/public/browser/page.h"
+#include "content/public/browser/render_frame_host.h"
+#include "third_party/blink/public/mojom/manifest/manifest.mojom.h"
namespace QtWebEngineCore {
namespace {
void ExtractManifestIcons(FaviconDriverQt::ManifestDownloadCallback callback,
- const GURL &manifest_url, const blink::Manifest &manifest)
+ const GURL &manifest_url, blink::mojom::ManifestPtr manifest)
{
std::vector<favicon::FaviconURL> candidates;
- for (const auto &icon : manifest.icons) {
+ for (const auto &icon : manifest->icons) {
candidates.emplace_back(icon.src, favicon_base::IconType::kWebManifestIcon, icon.sizes);
}
std::move(callback).Run(candidates);
@@ -186,7 +188,7 @@ int FaviconDriverQt::DownloadImage(const GURL &url, int max_image_size,
void FaviconDriverQt::DownloadManifest(const GURL &url, ManifestDownloadCallback callback)
{
- web_contents()->GetManifest(base::BindOnce(&ExtractManifestIcons, std::move(callback)));
+ web_contents()->GetMainFrame()->GetPage().GetManifest(base::BindOnce(&ExtractManifestIcons, std::move(callback)));
}
bool FaviconDriverQt::IsOffTheRecord()
@@ -256,22 +258,21 @@ void FaviconDriverQt::DidUpdateFaviconURL(
// We update |m_faviconUrls| even if the list is believed to be partial
// (checked below), because callers of our getter favicon_urls() expect so.
- std::vector<blink::mojom::FaviconURL> faviconUrls;
+ std::vector<blink::mojom::FaviconURLPtr> faviconUrls;
for (const auto &candidate : candidates)
- faviconUrls.push_back(*candidate);
- m_faviconUrls = faviconUrls;
+ faviconUrls.push_back(candidate.Clone());
+ m_faviconUrls = std::move(faviconUrls);
if (!m_documentOnLoadCompleted)
return;
OnUpdateCandidates(entry->GetURL(),
- favicon::FaviconURLsFromContentFaviconURLs(
- m_faviconUrls.value_or(std::vector<blink::mojom::FaviconURL>())),
+ favicon::FaviconURLsFromContentFaviconURLs(candidates),
m_manifestUrl);
}
void FaviconDriverQt::DidUpdateWebManifestURL(content::RenderFrameHost *target_frame,
- const base::Optional<GURL> &manifest_url)
+ const GURL &manifest_url)
{
Q_UNUSED(target_frame);
@@ -281,7 +282,7 @@ void FaviconDriverQt::DidUpdateWebManifestURL(content::RenderFrameHost *target_f
if (!entry || !m_documentOnLoadCompleted)
return;
- m_manifestUrl = manifest_url.value_or(GURL());
+ m_manifestUrl = manifest_url;
// On regular page loads, DidUpdateManifestURL() is guaranteed to be called
// before DidUpdateFaviconURL(). However, a page can update the favicons via
@@ -340,7 +341,7 @@ void FaviconDriverQt::DidFinishNavigation(content::NavigationHandle *navigation_
FetchFavicon(url, navigation_handle->IsSameDocument());
}
-void FaviconDriverQt::DocumentOnLoadCompletedInMainFrame()
+void FaviconDriverQt::DocumentOnLoadCompletedInMainFrame(content::RenderFrameHost * /*render_frame_host*/)
{
m_documentOnLoadCompleted = true;
}
diff --git a/src/core/favicon_driver_qt.h b/src/core/favicon_driver_qt.h
index b4901794..4de85104 100644
--- a/src/core/favicon_driver_qt.h
+++ b/src/core/favicon_driver_qt.h
@@ -122,10 +122,10 @@ private:
void DidUpdateFaviconURL(content::RenderFrameHost *render_frame_host,
const std::vector<blink::mojom::FaviconURLPtr> &candidates) override;
void DidUpdateWebManifestURL(content::RenderFrameHost *target_frame,
- const base::Optional<GURL> &manifest_url) override;
+ const GURL &manifest_url) override;
void DidStartNavigation(content::NavigationHandle *navigation_handle) override;
void DidFinishNavigation(content::NavigationHandle *navigation_handle) override;
- void DocumentOnLoadCompletedInMainFrame() override;
+ void DocumentOnLoadCompletedInMainFrame(content::RenderFrameHost *render_frame_host) override;
// Informs FaviconService that the favicon for |url| is out of date. If
// |force_reload| is true, then discard information about favicon download
@@ -152,7 +152,7 @@ private:
bool m_documentOnLoadCompleted = false;
// nullopt until the actual list is reported via DidUpdateFaviconURL().
- base::Optional<std::vector<blink::mojom::FaviconURL>> m_faviconUrls;
+ absl::optional<std::vector<blink::mojom::FaviconURLPtr>> m_faviconUrls;
// Web Manifest URL or empty URL if none.
GURL m_manifestUrl;
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 051b877a..140cb7db 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -211,6 +211,7 @@ ASSERT_ENUMS_MATCH(FilePickerController::Save, blink::mojom::FileChooserParams_M
void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
{
+ m_isHandled = true;
if (d_ptr->fileDialogListener) {
QStringList files(filesList);
base::FilePath baseDir;
@@ -224,7 +225,7 @@ void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
std::vector<blink::mojom::FileChooserFileInfoPtr> chooser_files;
for (const auto &file : qAsConst(files)) {
chooser_files.push_back(blink::mojom::FileChooserFileInfo::NewNativeFile(
- blink::mojom::NativeFileInfo::New(toFilePath(file), base::string16())));
+ blink::mojom::NativeFileInfo::New(toFilePath(file), std::u16string())));
}
if (files.isEmpty())
@@ -244,7 +245,6 @@ void FilePickerController::filesSelectedInChooser(const QStringList &filesList)
else
d_ptr->fileSystemAccessDialogListener->MultiFilesSelected(files, nullptr);
}
- m_isHandled = true;
}
QStringList FilePickerController::acceptedMimeTypes() const
diff --git a/src/core/gn_run.pro b/src/core/gn_run.pro
deleted file mode 100644
index 4688ea59..00000000
--- a/src/core/gn_run.pro
+++ /dev/null
@@ -1,68 +0,0 @@
-include($$QTWEBENGINE_OUT_ROOT/src/buildtools/qtbuildtools-config.pri)
-include($$QTWEBENGINE_OUT_ROOT/src/core/qtwebenginecore-config.pri)
-QT_FOR_CONFIG += buildtools-private webenginecore-private core-private gui-private
-
-TEMPLATE = aux
-
-qtConfig(debug_and_release): CONFIG += debug_and_release
-qtConfig(build_all): CONFIG += build_all
-
-QT_TOOL.ninja.binary = $$shell_quote($$shell_path($$ninjaPath()))
-
-win32 {
- # Add the gnuwin32/bin subdir of qt5.git to PATH. Needed for calling bison and friends.
- gnuwin32path.name = PATH
- gnuwin32path.value = $$shell_path($$clean_path($$QTWEBENGINE_ROOT/../gnuwin32/bin))
- gnuwin32path.CONFIG += prepend
- exists($$gnuwin32path.value): QT_TOOL_ENV = gnuwin32path
-}
-
-qtPrepareTool(NINJA, ninja)
-QT_TOOL_ENV =
-
-build_pass|!debug_and_release {
- gn_binary = gn
-
- runninja.target = run_ninja
-
- gn_args = $$gnWebEngineArgs()
-
- gn_args += "qtwebengine_target=\"$$system_path($$OUT_PWD/$$getConfigDir()):QtWebEngineCore\""
-
- !qtConfig(webengine-system-gn) {
- gn_binary = $$system_quote($$system_path($$gnPath()))
- }
-
- gn_args = $$system_quote($$gn_args)
- gn_src_root = $$system_quote($$system_path($$QTWEBENGINE_ROOT/$$getChromiumSrcDir()))
- gn_build_root = $$system_quote($$system_path($$OUT_PWD/$$getConfigDir()))
- gn_python = "--script-executable=$$pythonPathForSystem()"
- gn_run = $$gn_binary gen $$gn_build_root $$gn_python --args=$$gn_args --root=$$gn_src_root
-
- message("Running: $$gn_run ")
- !system($$gn_run) {
- error("GN run error!")
- }
-
- ninjaflags = $$(NINJAFLAGS)
- isEmpty(ninjaflags):!silent: ninjaflags = "-v"
-
- runninja.commands = $$NINJA $$ninjaflags \$\(NINJAJOBS\) -C $$gn_build_root QtWebEngineCore
- QMAKE_EXTRA_TARGETS += runninja
-
- build_pass:build_all: default_target.target = all
- else: default_target.target = first
- default_target.depends = runninja
- QMAKE_EXTRA_TARGETS += default_target
-}
-
-!build_pass:debug_and_release {
- # Special GNU make target for the meta Makefile that ensures that our debug and release Makefiles won't both run ninja in parallel.
- notParallel.target = .NOTPARALLEL
- QMAKE_EXTRA_TARGETS += notParallel
-}
-
-build_pass:CONFIG(debug, debug|release) {
- TARGET = gn_run_debug
-}
-
diff --git a/src/core/javascript_dialog_controller.cpp b/src/core/javascript_dialog_controller.cpp
index 86f5b979..d47d5363 100644
--- a/src/core/javascript_dialog_controller.cpp
+++ b/src/core/javascript_dialog_controller.cpp
@@ -45,7 +45,7 @@
namespace QtWebEngineCore {
-void JavaScriptDialogControllerPrivate::dialogFinished(bool accepted, const base::string16 &promptValue)
+void JavaScriptDialogControllerPrivate::dialogFinished(bool accepted, const std::u16string &promptValue)
{
// Clear the queue first as this could result in the engine asking us to run another dialog,
// but hold a shared pointer so the dialog does not get deleted prematurely when running in-process.
diff --git a/src/core/javascript_dialog_controller_p.h b/src/core/javascript_dialog_controller_p.h
index ab7b0926..44c0dace 100644
--- a/src/core/javascript_dialog_controller_p.h
+++ b/src/core/javascript_dialog_controller_p.h
@@ -67,7 +67,7 @@ namespace QtWebEngineCore {
class JavaScriptDialogControllerPrivate {
public:
- void dialogFinished(bool accepted, const base::string16 &promptValue);
+ void dialogFinished(bool accepted, const std::u16string &promptValue);
JavaScriptDialogControllerPrivate(WebContentsAdapterClient::JavascriptDialogType, const QString &message, const QString &prompt
, const QString& title, const QUrl &securityOrigin
, content::JavaScriptDialogManager::DialogClosedCallback &&, content::WebContents *);
diff --git a/src/core/javascript_dialog_manager_qt.cpp b/src/core/javascript_dialog_manager_qt.cpp
index 28994723..64c08481 100644
--- a/src/core/javascript_dialog_manager_qt.cpp
+++ b/src/core/javascript_dialog_manager_qt.cpp
@@ -63,8 +63,8 @@ JavaScriptDialogManagerQt *JavaScriptDialogManagerQt::GetInstance()
void JavaScriptDialogManagerQt::RunJavaScriptDialog(content::WebContents *webContents,
content::RenderFrameHost *renderFrameHost,
content::JavaScriptDialogType dialog_type,
- const base::string16 &messageText,
- const base::string16 &defaultPromptText,
+ const std::u16string &messageText,
+ const std::u16string &defaultPromptText,
content::JavaScriptDialogManager::DialogClosedCallback callback,
bool *didSuppressMessage)
{
@@ -87,12 +87,12 @@ void JavaScriptDialogManagerQt::RunBeforeUnloadDialog(content::WebContents *webC
runDialogForContents(webContents, WebContentsAdapterClient::UnloadDialog, QString(), QString(), toQt(originUrl), std::move(callback));
}
-bool JavaScriptDialogManagerQt::HandleJavaScriptDialog(content::WebContents *contents, bool accept, const base::string16 *promptOverride)
+bool JavaScriptDialogManagerQt::HandleJavaScriptDialog(content::WebContents *contents, bool accept, const std::u16string *promptOverride)
{
QSharedPointer<JavaScriptDialogController> dialog = m_activeDialogs.value(contents);
if (!dialog)
return false;
- dialog->d->dialogFinished(accept, promptOverride ? *promptOverride : base::string16());
+ dialog->d->dialogFinished(accept, promptOverride ? *promptOverride : std::u16string());
takeDialogForContents(contents);
return true;
}
diff --git a/src/core/javascript_dialog_manager_qt.h b/src/core/javascript_dialog_manager_qt.h
index ca7432a7..4684961e 100644
--- a/src/core/javascript_dialog_manager_qt.h
+++ b/src/core/javascript_dialog_manager_qt.h
@@ -61,14 +61,14 @@ public:
static JavaScriptDialogManagerQt *GetInstance();
void RunJavaScriptDialog(content::WebContents *, content::RenderFrameHost *, content::JavaScriptDialogType dialog_type,
- const base::string16 &messageText, const base::string16 &defaultPromptText,
+ const std::u16string &messageText, const std::u16string &defaultPromptText,
DialogClosedCallback callback,
bool *didSuppressMessage) override;
void RunBeforeUnloadDialog(content::WebContents *web_contents,
content::RenderFrameHost *render_frame_host,
bool is_reload,
DialogClosedCallback callback) override;
- bool HandleJavaScriptDialog(content::WebContents *, bool accept, const base::string16 *promptOverride) override;
+ bool HandleJavaScriptDialog(content::WebContents *, bool accept, const std::u16string *promptOverride) override;
void CancelDialogs(content::WebContents *contents, bool /*reset_state*/) override
{
takeDialogForContents(contents);
diff --git a/src/core/location_provider_qt.cpp b/src/core/location_provider_qt.cpp
index b5d0f21f..09938ca4 100644
--- a/src/core/location_provider_qt.cpp
+++ b/src/core/location_provider_qt.cpp
@@ -77,7 +77,7 @@ private:
QGeoPositionInfoSource *m_positionInfoSource;
base::WeakPtrFactory<LocationProviderQt> m_locationProviderFactory;
- void postToLocationProvider(const base::Closure &task);
+ void postToLocationProvider(base::OnceClosure task);
friend class LocationProviderQt;
};
@@ -188,7 +188,7 @@ void QtPositioningHelper::updatePosition(const QGeoPositionInfo &pos)
newPos.heading = pos.hasAttribute(QGeoPositionInfo::Direction) ? pos.attribute(QGeoPositionInfo::Direction) : -1;
if (m_locationProvider)
- postToLocationProvider(base::Bind(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), newPos));
+ postToLocationProvider(base::BindOnce(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), newPos));
}
void QtPositioningHelper::error(QGeoPositionInfoSource::Error positioningError)
@@ -212,12 +212,12 @@ void QtPositioningHelper::error(QGeoPositionInfoSource::Error positioningError)
break;
}
if (m_locationProvider)
- postToLocationProvider(base::Bind(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), newPos));
+ postToLocationProvider(base::BindOnce(&LocationProviderQt::updatePosition, m_locationProviderFactory.GetWeakPtr(), newPos));
}
-inline void QtPositioningHelper::postToLocationProvider(const base::Closure &task)
+inline void QtPositioningHelper::postToLocationProvider(base::OnceClosure task)
{
- static_cast<device::GeolocationProviderImpl*>(device::GeolocationProvider::GetInstance())->task_runner()->PostTask(FROM_HERE, task);
+ static_cast<device::GeolocationProviderImpl*>(device::GeolocationProvider::GetInstance())->task_runner()->PostTask(FROM_HERE, std::move(task));
}
LocationProviderQt::LocationProviderQt()
diff --git a/src/core/login_delegate_qt.cpp b/src/core/login_delegate_qt.cpp
index 7942c827..c00866e6 100644
--- a/src/core/login_delegate_qt.cpp
+++ b/src/core/login_delegate_qt.cpp
@@ -145,7 +145,7 @@ void LoginDelegateQt::sendAuthToRequester(bool success, const QString &user, con
if (success && web_contents())
std::move(m_auth_required_callback).Run(net::AuthCredentials(toString16(user), toString16(password)));
else
- std::move(m_auth_required_callback).Run(base::nullopt);
+ std::move(m_auth_required_callback).Run(absl::nullopt);
}
}
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index 2661c2bb..c976798a 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -194,6 +194,7 @@ content::DesktopMediaID getDefaultScreenId()
int numMonitors = 0;
XRRMonitorInfo *monitors = getMonitors(display, rootWindow, true, &numMonitors);
+ auto cleanup = qScopeGuard([&] () { freeMonitors(monitors); });
if (numMonitors > 0)
return content::DesktopMediaID(content::DesktopMediaID::TYPE_SCREEN, monitors[0].name);
#endif // !defined(WEBRTC_USE_X11)
@@ -289,9 +290,9 @@ private:
} // namespace
MediaCaptureDevicesDispatcher::PendingAccessRequest::PendingAccessRequest(const content::MediaStreamRequest &request,
- const RepeatingMediaResponseCallback &callback)
+ content::MediaResponseCallback callback)
: request(request)
- , callback(callback)
+ , callback(std::move(callback))
{
}
@@ -309,7 +310,7 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
return;
RequestsQueue &queue(it->second);
- content::MediaStreamRequest &request = queue.front().request;
+ content::MediaStreamRequest &request = queue.front()->request;
const QUrl requestSecurityOrigin(toQt(request.security_origin));
bool securityOriginsMatch = (requestSecurityOrigin.host() == securityOrigin.host()
@@ -346,7 +347,7 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
}
}
- content::MediaResponseCallback callback = std::move(queue.front().callback);
+ content::MediaResponseCallback callback = std::move(queue.front()->callback);
queue.pop_front();
if (!queue.empty()) {
@@ -474,7 +475,7 @@ void MediaCaptureDevicesDispatcher::enqueueMediaAccessRequest(content::WebConten
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RequestsQueue &queue = m_pendingRequests[webContents];
- queue.push_back(PendingAccessRequest(request, base::AdaptCallbackForRepeating(std::move(callback))));
+ queue.push_back(std::make_unique<PendingAccessRequest>(request, std::move(callback)));
}
void MediaCaptureDevicesDispatcher::ProcessQueuedAccessRequest(content::WebContents *webContents)
@@ -486,7 +487,7 @@ void MediaCaptureDevicesDispatcher::ProcessQueuedAccessRequest(content::WebConte
return;
RequestsQueue &queue(it->second);
- content::MediaStreamRequest &request = queue.front().request;
+ content::MediaStreamRequest &request = queue.front()->request;
WebContentsAdapterClient *adapterClient = WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(webContents)->GetView())->client();
adapterClient->runMediaAccessPermissionRequest(toQt(request.security_origin), mediaRequestFlagsForRequest(request));
@@ -540,9 +541,9 @@ void MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread(int render
for (auto &pair : m_pendingRequests) {
RequestsQueue &queue = pair.second;
for (auto it = queue.begin(); it != queue.end(); ++it) {
- if (it->request.render_process_id == render_process_id
- && it->request.render_frame_id == render_frame_id
- && it->request.page_request_id == page_request_id) {
+ if ((*it)->request.render_process_id == render_process_id
+ && (*it)->request.render_frame_id == render_frame_id
+ && (*it)->request.page_request_id == page_request_id) {
queue.erase(it);
return;
}
diff --git a/src/core/media_capture_devices_dispatcher.h b/src/core/media_capture_devices_dispatcher.h
index d2633cb8..91ddc30a 100644
--- a/src/core/media_capture_devices_dispatcher.h
+++ b/src/core/media_capture_devices_dispatcher.h
@@ -41,14 +41,11 @@
#ifndef MEDIA_CAPTURE_DEVICES_DISPATCHER_H
#define MEDIA_CAPTURE_DEVICES_DISPATCHER_H
-#include <deque>
-#include <list>
-#include <map>
-
#include "web_contents_adapter_client.h"
#include "base/callback.h"
#include "base/containers/circular_deque.h"
+#include "base/containers/flat_map.h"
#include "base/memory/singleton.h"
#include "base/observer_list.h"
#include "chrome/browser/tab_contents/web_contents_collection.h"
@@ -92,20 +89,15 @@ private:
friend struct base::DefaultSingletonTraits<MediaCaptureDevicesDispatcher>;
- typedef base::RepeatingCallback<void(const blink::MediaStreamDevices &devices,
- blink::mojom::MediaStreamRequestResult result,
- std::unique_ptr<content::MediaStreamUI> ui)>
- RepeatingMediaResponseCallback;
-
struct PendingAccessRequest {
- PendingAccessRequest(const content::MediaStreamRequest &request, const RepeatingMediaResponseCallback &callback);
+ PendingAccessRequest(const content::MediaStreamRequest &request, content::MediaResponseCallback callback);
~PendingAccessRequest();
content::MediaStreamRequest request;
- RepeatingMediaResponseCallback callback;
+ content::MediaResponseCallback callback;
};
- typedef base::circular_deque<PendingAccessRequest> RequestsQueue;
- typedef std::map<content::WebContents *, RequestsQueue> RequestsQueues;
+ typedef base::circular_deque<std::unique_ptr<PendingAccessRequest>> RequestsQueue;
+ typedef base::flat_map<content::WebContents *, RequestsQueue> RequestsQueues;
MediaCaptureDevicesDispatcher();
virtual ~MediaCaptureDevicesDispatcher();
diff --git a/src/core/native_web_keyboard_event_qt.cpp b/src/core/native_web_keyboard_event_qt.cpp
index edd27cce..c90b3c9e 100644
--- a/src/core/native_web_keyboard_event_qt.cpp
+++ b/src/core/native_web_keyboard_event_qt.cpp
@@ -95,7 +95,10 @@ NativeWebKeyboardEvent::NativeWebKeyboardEvent(const NativeWebKeyboardEvent& oth
{
}
-NativeWebKeyboardEvent& NativeWebKeyboardEvent::operator=(const NativeWebKeyboardEvent& other) {
+NativeWebKeyboardEvent &NativeWebKeyboardEvent::operator=(const NativeWebKeyboardEvent &other)
+{
+ if (this == &other)
+ return *this;
WebKeyboardEvent::operator=(other);
DestroyEvent(os_event);
os_event = CopyEvent(other.os_event);
diff --git a/src/core/net/client_cert_override.cpp b/src/core/net/client_cert_override.cpp
index 9c2ff31d..4f7ae665 100644
--- a/src/core/net/client_cert_override.cpp
+++ b/src/core/net/client_cert_override.cpp
@@ -141,22 +141,19 @@ void ClientCertOverrideStore::GetClientCerts(const net::SSLCertRequestInfo &cert
{
#if QT_CONFIG(ssl)
// Access the user-provided data from the UI thread, but return on whatever thread this is.
- if (base::PostTaskAndReplyWithResult(
+ bool ok = base::PostTaskAndReplyWithResult(
FROM_HERE, { content::BrowserThread::UI },
base::BindOnce(&ClientCertOverrideStore::GetClientCertsOnUIThread,
base::Unretained(this), std::cref(cert_request_info)),
base::BindOnce(&ClientCertOverrideStore::GetClientCertsReturn,
- base::Unretained(this), std::cref(cert_request_info), std::move(callback)))
- ) {
- return;
- }
-#endif // QT_CONFIG(ssl)
-
- // Continue with native cert store if we failed to post task
+ base::Unretained(this), std::cref(cert_request_info), std::move(callback)));
+ DCHECK(ok); // callback is already moved and we can't really recover here.
+#else
if (m_nativeStore)
m_nativeStore->GetClientCerts(cert_request_info, std::move(callback));
else
std::move(callback).Run(net::ClientCertIdentityList());
+#endif // QT_CONFIG(ssl)
}
// static
diff --git a/src/core/net/client_cert_store_data.cpp b/src/core/net/client_cert_store_data.cpp
index 314e6414..1a957e69 100644
--- a/src/core/net/client_cert_store_data.cpp
+++ b/src/core/net/client_cert_store_data.cpp
@@ -138,7 +138,7 @@ void ClientCertificateStoreData::add(const QSslCertificate &certificate, const Q
Entry *data = new Entry;
data->keyPtr = wrapOpenSSLPrivateKey(sslKeyInBytes);
- data->certPtr = net::X509Certificate::CreateFromBytes(certInBytes.data(), certInBytes.length());
+ data->certPtr = net::X509Certificate::CreateFromBytes(base::make_span((const unsigned char *)certInBytes.data(), certInBytes.length()));
data->key = privateKey;
data->certificate = certificate;
extraCerts.append(data);
diff --git a/src/core/net/client_cert_store_data.h b/src/core/net/client_cert_store_data.h
index 4976ac93..312396d1 100644
--- a/src/core/net/client_cert_store_data.h
+++ b/src/core/net/client_cert_store_data.h
@@ -40,8 +40,8 @@
#ifndef CLIENT_CERT_STORE_DATA_H
#define CLIENT_CERT_STORE_DATA_H
-#include "qtwebenginecoreglobal.h"
-#include "qtnetworkglobal.h"
+#include <QtWebEngineCore/qtwebenginecoreglobal.h>
+#include <QtNetwork/qtnetworkglobal.h>
#if QT_CONFIG(ssl)
#include "base/memory/ref_counted.h"
diff --git a/src/core/net/cookie_monster_delegate_qt.cpp b/src/core/net/cookie_monster_delegate_qt.cpp
index 2fbacd73..27432639 100644
--- a/src/core/net/cookie_monster_delegate_qt.cpp
+++ b/src/core/net/cookie_monster_delegate_qt.cpp
@@ -139,7 +139,7 @@ void CookieMonsterDelegateQt::setCookie(const QNetworkCookie &cookie, const QUrl
std::string cookie_line = cookie.toRawForm().toStdString();
net::CookieInclusionStatus inclusion;
- auto canonCookie = net::CanonicalCookie::Create(gurl, cookie_line, base::Time::Now(), base::nullopt, &inclusion);
+ auto canonCookie = net::CanonicalCookie::Create(gurl, cookie_line, base::Time::Now(), absl::nullopt, absl::nullopt, &inclusion);
if (!inclusion.IsInclude()) {
LOG(WARNING) << "QWebEngineCookieStore::setCookie() - Tried to set invalid cookie";
return;
diff --git a/src/core/net/custom_url_loader_factory.cpp b/src/core/net/custom_url_loader_factory.cpp
index dca69c20..283576ca 100644
--- a/src/core/net/custom_url_loader_factory.cpp
+++ b/src/core/net/custom_url_loader_factory.cpp
@@ -51,6 +51,7 @@
#include "net/http/http_status_code.h"
#include "net/http/http_util.h"
#include "services/network/public/cpp/cors/cors.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 "services/network/public/mojom/url_response_head.mojom.h"
@@ -91,7 +92,7 @@ public:
void FollowRedirect(const std::vector<std::string> &removed_headers,
const net::HttpRequestHeaders &modified_headers,
const net::HttpRequestHeaders &modified_cors_exempt_headers, // FIXME: do something with this?
- const base::Optional<GURL> &new_url) override
+ const absl::optional<GURL> &new_url) override
{
// We can be asked for follow our own redirect
scoped_refptr<URLRequestCustomJobProxy> proxy = new URLRequestCustomJobProxy(this, m_proxy->m_scheme, m_proxy->m_profileAdapter);
@@ -297,7 +298,7 @@ private:
m_request.site_for_cookies,
first_party_url_policy, m_request.referrer_policy,
m_request.referrer.spec(), net::HTTP_SEE_OTHER,
- m_redirect, base::nullopt, false /*insecure_scheme_was_upgraded*/);
+ m_redirect, absl::nullopt, false /*insecure_scheme_was_upgraded*/);
m_client->OnReceiveRedirect(redirectInfo, std::move(m_head));
m_head = nullptr;
// ### should m_request be updated with RedirectInfo? (see FollowRedirect)
@@ -472,7 +473,6 @@ public:
// network::mojom::URLLoaderFactory:
void CreateLoaderAndStart(mojo::PendingReceiver<network::mojom::URLLoader> loader,
- int32_t routing_id,
int32_t request_id,
uint32_t options,
const network::ResourceRequest &request,
@@ -480,7 +480,6 @@ public:
const net::MutableNetworkTrafficAnnotationTag &traffic_annotation) override
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- Q_UNUSED(routing_id);
Q_UNUSED(request_id);
Q_UNUSED(options);
Q_UNUSED(traffic_annotation);
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index c945ee4d..be2a6814 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -47,8 +47,12 @@
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/common/content_switches.h"
#include "net/http/http_status_code.h"
+#include "services/network/public/cpp/cors/cors.h"
+#include "services/network/public/mojom/early_hints.mojom.h"
#include "third_party/blink/public/mojom/loader/resource_load_info.mojom-shared.h"
+#include "url/url_util.h"
#include "api/qwebengineurlrequestinfo_p.h"
#include "type_conversion.h"
@@ -108,7 +112,7 @@ class InterceptedRequest : public network::mojom::URLLoader
{
public:
InterceptedRequest(ProfileAdapter *profile_adapter,
- int process_id, uint64_t request_id, int32_t routing_id, uint32_t options,
+ int frame_tree_node_id, int32_t request_id, uint32_t options,
const network::ResourceRequest &request,
const net::MutableNetworkTrafficAnnotationTag &traffic_annotation,
mojo::PendingReceiver<network::mojom::URLLoader> loader,
@@ -126,12 +130,13 @@ public:
void OnTransferSizeUpdated(int32_t transfer_size_diff) override;
void OnStartLoadingResponseBody(mojo::ScopedDataPipeConsumerHandle body) override;
void OnComplete(const network::URLLoaderCompletionStatus &status) override;
+ void OnReceiveEarlyHints(network::mojom::EarlyHintsPtr) override {}
// network::mojom::URLLoader
void FollowRedirect(const std::vector<std::string> &removed_headers,
const net::HttpRequestHeaders &modified_headers,
const net::HttpRequestHeaders &modified_cors_exempt_headers,
- const base::Optional<GURL> &new_url) override;
+ const absl::optional<GURL> &new_url) override;
void SetPriority(net::RequestPriority priority, int32_t intra_priority_value) override;
void PauseReadingBodyFromNet() override;
void ResumeReadingBodyFromNet() override;
@@ -160,10 +165,10 @@ private:
QWebEngineUrlRequestInterceptor* getPageInterceptor();
QPointer<ProfileAdapter> profile_adapter_;
- const int process_id_;
- const uint64_t request_id_;
- const int32_t routing_id_;
+ const int frame_tree_node_id_;
+ const int32_t request_id_;
const uint32_t options_;
+ bool allowed_cors_ = true;
// If the |target_loader_| called OnComplete with an error this stores it.
// That way the destructor can send it to OnReceivedError if safe browsing
@@ -187,16 +192,15 @@ private:
};
InterceptedRequest::InterceptedRequest(ProfileAdapter *profile_adapter,
- int process_id, uint64_t request_id, int32_t routing_id, uint32_t options,
+ int frame_tree_node_id, int32_t request_id, uint32_t options,
const network::ResourceRequest &request,
const net::MutableNetworkTrafficAnnotationTag &traffic_annotation,
mojo::PendingReceiver<network::mojom::URLLoader> loader_receiver,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
mojo::PendingRemote<network::mojom::URLLoaderFactory> target_factory)
: profile_adapter_(profile_adapter)
- , process_id_(process_id)
+ , frame_tree_node_id_(frame_tree_node_id)
, request_id_(request_id)
- , routing_id_(routing_id)
, options_(options)
, request_(request)
, traffic_annotation_(traffic_annotation)
@@ -205,12 +209,37 @@ InterceptedRequest::InterceptedRequest(ProfileAdapter *profile_adapter,
, target_factory_(std::move(target_factory))
, weak_factory_(this)
{
+ const bool disable_web_security = base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebSecurity);
current_response_ = network::mojom::URLResponseHead::New();
+ current_response_->response_type = network::cors::CalculateResponseType(
+ request_.mode,
+ disable_web_security || (
+ request_.request_initiator && request_.request_initiator->IsSameOriginWith(url::Origin::Create(request_.url))));
// If there is a client error, clean up the request.
target_client_.set_disconnect_handler(
- base::BindOnce(&InterceptedRequest::OnURLLoaderClientError, weak_factory_.GetWeakPtr()));
+ base::BindOnce(&InterceptedRequest::OnURLLoaderClientError, base::Unretained(this)));
proxied_loader_receiver_.set_disconnect_with_reason_handler(
- base::BindOnce(&InterceptedRequest::OnURLLoaderError, weak_factory_.GetWeakPtr()));
+ base::BindOnce(&InterceptedRequest::OnURLLoaderError, base::Unretained(this)));
+ if (!disable_web_security && request_.request_initiator) {
+ const std::vector<std::string> &localSchemes = url::GetLocalSchemes();
+ std::string fromScheme = request_.request_initiator->GetTupleOrPrecursorTupleIfOpaque().scheme();
+ if (base::Contains(localSchemes, fromScheme)) {
+ content::WebContents *wc = webContents();
+ std::string toScheme = request_.url.scheme();
+ // local schemes must have universal access, or be accessing something local and have local access.
+ if (fromScheme != toScheme) {
+ // note allow_file_access_from_file_urls maps to LocalContentCanAccessFileUrls in our API
+ // and allow_universal_access_from_file_urls to LocalContentCanAccessRemoteUrls, so we are
+ // using them as proxies for our API here.
+ if (toScheme == "file")
+ allowed_cors_ = wc && wc->GetOrCreateWebPreferences().allow_file_access_from_file_urls;
+ else if (!base::Contains(localSchemes, toScheme))
+ allowed_cors_ = wc && wc->GetOrCreateWebPreferences().allow_universal_access_from_file_urls;
+ else
+ allowed_cors_ = true; // We should think about this for future patches
+ }
+ }
+ }
}
InterceptedRequest::~InterceptedRequest()
@@ -220,12 +249,9 @@ InterceptedRequest::~InterceptedRequest()
content::WebContents* InterceptedRequest::webContents()
{
- if (process_id_) {
- content::RenderFrameHost *frameHost = content::RenderFrameHost::FromID(process_id_, request_.render_frame_id);
- return content::WebContents::FromRenderFrameHost(frameHost);
- }
-
- return content::WebContents::FromFrameTreeNodeId(request_.render_frame_id);
+ if (frame_tree_node_id_ == content::RenderFrameHost::kNoFrameTreeNodeId)
+ return nullptr;
+ return content::WebContents::FromFrameTreeNodeId(frame_tree_node_id_);
}
QWebEngineUrlRequestInterceptor* InterceptedRequest::getProfileInterceptor()
@@ -247,6 +273,14 @@ void InterceptedRequest::Restart()
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+ // This is a CORS check on the from URL, the normal check on the to URL is applied later
+ if (!allowed_cors_ && current_response_->response_type == network::mojom::FetchResponseType::kCors) {
+ target_client_->OnComplete(network::URLLoaderCompletionStatus(
+ network::CorsErrorStatus(network::mojom::CorsError::kCorsDisabledScheme)));
+ delete this;
+ return;
+ }
+
// MEMO since all codepatch leading to Restart scheduled and executed as asynchronous tasks in main thread,
// interceptors may change in meantime and also during intercept call, so they should be resolved anew.
// Set here only profile's interceptor since it runs first without going to user code.
@@ -319,7 +353,7 @@ void InterceptedRequest::ContinueAfterIntercept()
net::RedirectInfo redirectInfo = net::RedirectInfo::ComputeRedirectInfo(
request_.method, request_.url, request_.site_for_cookies,
first_party_url_policy, request_.referrer_policy, request_.referrer.spec(),
- net::HTTP_TEMPORARY_REDIRECT, toGurl(info.url), base::nullopt,
+ net::HTTP_TEMPORARY_REDIRECT, toGurl(info.url), absl::nullopt,
false /*insecure_scheme_was_upgraded*/);
// FIXME: Should probably create a new header.
@@ -338,7 +372,7 @@ void InterceptedRequest::ContinueAfterIntercept()
}
if (!target_loader_ && target_factory_) {
- target_factory_->CreateLoaderAndStart(target_loader_.BindNewPipeAndPassReceiver(), routing_id_, request_id_,
+ target_factory_->CreateLoaderAndStart(target_loader_.BindNewPipeAndPassReceiver(), request_id_,
options_, request_, proxied_client_receiver_.BindNewPipeAndPassRemote(),
traffic_annotation_);
}
@@ -398,7 +432,7 @@ void InterceptedRequest::OnComplete(const network::URLLoaderCompletionStatus &st
void InterceptedRequest::FollowRedirect(const std::vector<std::string> &removed_headers,
const net::HttpRequestHeaders &modified_headers,
const net::HttpRequestHeaders &modified_cors_exempt_headers,
- const base::Optional<GURL> &new_url)
+ const absl::optional<GURL> &new_url)
{
if (target_loader_)
target_loader_->FollowRedirect(removed_headers, modified_headers, modified_cors_exempt_headers, new_url);
@@ -485,10 +519,10 @@ void InterceptedRequest::SendErrorAndCompleteImmediately(int error_code)
delete this;
}
-ProxyingURLLoaderFactoryQt::ProxyingURLLoaderFactoryQt(ProfileAdapter *adapter, int process_id,
+ProxyingURLLoaderFactoryQt::ProxyingURLLoaderFactoryQt(ProfileAdapter *adapter, int frame_tree_node_id,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> loader_receiver,
mojo::PendingRemote<network::mojom::URLLoaderFactory> target_factory_info)
- : m_profileAdapter(adapter), m_processId(process_id), m_weakFactory(this)
+ : m_profileAdapter(adapter), m_frameTreeNodeId(frame_tree_node_id), m_weakFactory(this)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
if (target_factory_info) {
@@ -506,8 +540,8 @@ ProxyingURLLoaderFactoryQt::~ProxyingURLLoaderFactoryQt()
m_weakFactory.InvalidateWeakPtrs();
}
-void ProxyingURLLoaderFactoryQt::CreateLoaderAndStart(mojo::PendingReceiver<network::mojom::URLLoader> loader, int32_t routing_id,
- int32_t request_id, uint32_t options, const network::ResourceRequest &request,
+void ProxyingURLLoaderFactoryQt::CreateLoaderAndStart(mojo::PendingReceiver<network::mojom::URLLoader> loader, int32_t request_id,
+ uint32_t options, const network::ResourceRequest &request,
mojo::PendingRemote<network::mojom::URLLoaderClient> url_loader_client,
const net::MutableNetworkTrafficAnnotationTag &traffic_annotation)
{
@@ -517,7 +551,7 @@ void ProxyingURLLoaderFactoryQt::CreateLoaderAndStart(mojo::PendingReceiver<netw
m_targetFactory->Clone(target_factory_clone.InitWithNewPipeAndPassReceiver());
// Will manage its own lifetime
- InterceptedRequest *req = new InterceptedRequest(m_profileAdapter, m_processId, request_id, routing_id, options,
+ InterceptedRequest *req = new InterceptedRequest(m_profileAdapter, m_frameTreeNodeId, request_id, options,
request, traffic_annotation, std::move(loader),
std::move(url_loader_client), std::move(target_factory_clone));
req->Restart();
diff --git a/src/core/net/proxying_url_loader_factory_qt.h b/src/core/net/proxying_url_loader_factory_qt.h
index 5345e322..ae8e41ea 100644
--- a/src/core/net/proxying_url_loader_factory_qt.h
+++ b/src/core/net/proxying_url_loader_factory_qt.h
@@ -62,14 +62,14 @@ class ProfileAdapter;
class ProxyingURLLoaderFactoryQt : public network::mojom::URLLoaderFactory
{
public:
- ProxyingURLLoaderFactoryQt(ProfileAdapter *adapter, int processId,
+ ProxyingURLLoaderFactoryQt(ProfileAdapter *adapter, int frameTreeNodeId,
mojo::PendingReceiver<network::mojom::URLLoaderFactory> loader_receiver,
mojo::PendingRemote<network::mojom::URLLoaderFactory> pending_target_factory_remote);
~ProxyingURLLoaderFactoryQt() override;
void CreateLoaderAndStart(mojo::PendingReceiver<network::mojom::URLLoader> loader,
- int32_t routing_id, int32_t request_id,
+ int32_t request_id,
uint32_t options, const network::ResourceRequest &request,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
const net::MutableNetworkTrafficAnnotationTag &traffic_annotation) override;
@@ -81,7 +81,7 @@ private:
void OnProxyBindingError();
QPointer<ProfileAdapter> m_profileAdapter;
- int m_processId;
+ int m_frameTreeNodeId;
mojo::ReceiverSet<network::mojom::URLLoaderFactory> m_proxyReceivers;
mojo::Remote<network::mojom::URLLoaderFactory> m_targetFactory;
base::WeakPtrFactory<ProxyingURLLoaderFactoryQt> m_weakFactory;
diff --git a/src/core/net/ssl_host_state_delegate_qt.cpp b/src/core/net/ssl_host_state_delegate_qt.cpp
index 3390c092..ba2f4634 100644
--- a/src/core/net/ssl_host_state_delegate_qt.cpp
+++ b/src/core/net/ssl_host_state_delegate_qt.cpp
@@ -121,6 +121,16 @@ bool SSLHostStateDelegateQt::DidHostRunInsecureContent(const std::string &host,
return false;
}
+void SSLHostStateDelegateQt::AllowHttpForHost(const std::string &host, content::WebContents *web_contents)
+{
+ // Intentional no-op see aw_ssl_host_state_delegate
+}
+
+bool SSLHostStateDelegateQt::IsHttpAllowedForHost(const std::string &host, content::WebContents *web_contents)
+{
+ return false;
+}
+
// Revokes all SSL certificate error allow exceptions made by the user for
// |host|.
void SSLHostStateDelegateQt::RevokeUserAllowExceptions(const std::string &host)
diff --git a/src/core/net/ssl_host_state_delegate_qt.h b/src/core/net/ssl_host_state_delegate_qt.h
index 6b407353..96eac63e 100644
--- a/src/core/net/ssl_host_state_delegate_qt.h
+++ b/src/core/net/ssl_host_state_delegate_qt.h
@@ -71,6 +71,8 @@ public:
CertJudgment QueryPolicy(const std::string &host, const net::X509Certificate &cert, int error, content::WebContents *web_contents) override;
void HostRanInsecureContent(const std::string &host, int child_id, InsecureContentType content_type) override;
bool DidHostRunInsecureContent(const std::string &host, int child_id, InsecureContentType content_type) override;
+ void AllowHttpForHost(const std::string &host, content::WebContents *web_contents) override;
+ bool IsHttpAllowedForHost(const std::string &host, content::WebContents *web_contents) override;
void RevokeUserAllowExceptions(const std::string &host) override;
bool HasAllowException(const std::string &host, content::WebContents *web_contents) override;
diff --git a/src/core/net/system_network_context_manager.cpp b/src/core/net/system_network_context_manager.cpp
index 46e67811..962266d7 100644
--- a/src/core/net/system_network_context_manager.cpp
+++ b/src/core/net/system_network_context_manager.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2019 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
@@ -46,20 +46,24 @@
#include "base/bind.h"
#include "base/command_line.h"
+#include "base/strings/string_split.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_switches.h"
#include "content/public/browser/network_service_instance.h"
#include "content/public/common/content_switches.h"
+#include "crypto/sha2.h"
+#include "mojo/public/cpp/bindings/pending_remote.h"
+#include "net/base/port_util.h"
#include "net/net_buildflags.h"
#include "services/cert_verifier/public/mojom/cert_verifier_service_factory.mojom.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"
#include "services/network/public/cpp/shared_url_loader_factory.h"
-#include "services/network/public/mojom/host_resolver.mojom.h"
-#include "services/network/public/mojom/url_loader_factory.mojom.h"
+#include "services/network/public/mojom/cert_verifier_service.mojom.h"
+#include "services/network/public/mojom/network_context.mojom.h"
#include "services/proxy_resolver/public/mojom/proxy_resolver.mojom.h"
namespace {
@@ -103,7 +107,6 @@ public:
// mojom::URLLoaderFactory implementation:
void CreateLoaderAndStart(mojo::PendingReceiver<network::mojom::URLLoader> receiver,
- int32_t routing_id,
int32_t request_id,
uint32_t options,
const network::ResourceRequest &url_request,
@@ -114,7 +117,7 @@ public:
if (!manager_)
return;
manager_->GetURLLoaderFactory()->CreateLoaderAndStart(
- std::move(receiver), routing_id, request_id, options, url_request,
+ std::move(receiver), request_id, options, url_request,
std::move(client), traffic_annotation);
}
@@ -220,16 +223,56 @@ void SystemNetworkContextManager::OnNetworkServiceCreated(network::mojom::Networ
network_service->SetUpHttpAuth(CreateHttpAuthStaticParams());
network_service->ConfigureHttpAuthPrefs(CreateHttpAuthDynamicParams());
+ // Configure the Certificate Transparency logs.
+ std::vector<std::pair<std::string, base::TimeDelta>> disqualified_logs =
+ certificate_transparency::GetDisqualifiedLogs();
+ std::vector<network::mojom::CTLogInfoPtr> log_list_mojo;
+ for (const auto &ct_log : certificate_transparency::GetKnownLogs()) {
+ network::mojom::CTLogInfoPtr log_info = network::mojom::CTLogInfo::New();
+ log_info->public_key = std::string(ct_log.log_key, ct_log.log_key_length);
+ log_info->name = ct_log.log_name;
+
+ std::string log_id = crypto::SHA256HashString(log_info->public_key);
+ auto it = std::lower_bound(
+ std::begin(disqualified_logs), std::end(disqualified_logs), log_id,
+ [](const auto& disqualified_log, const std::string& log_id) {
+ return disqualified_log.first < log_id;
+ });
+ if (it != std::end(disqualified_logs) && it->first == log_id)
+ log_info->disqualified_at = it->second;
+ log_list_mojo.push_back(std::move(log_info));
+ }
+ network_service->UpdateCtLogList(
+ std::move(log_list_mojo),
+ certificate_transparency::GetLogListTimestamp());
+
// The system NetworkContext is created first
network_service_network_context_.reset();
network_service->CreateNetworkContext(
network_service_network_context_.BindNewPipeAndPassReceiver(),
CreateNetworkContextParams());
+ // Handle --explicitly-allowed-ports
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kExplicitlyAllowedPorts)) {
+ std::vector<uint16_t> explicitly_allowed_network_ports;
+ std::string switch_value =
+ base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kExplicitlyAllowedPorts);
+ const auto split = base::SplitStringPiece(switch_value, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
+ for (const auto &piece : split) {
+ int port;
+ if (!base::StringToInt(piece, &port))
+ continue;
+ if (!net::IsPortValid(port))
+ continue;
+ explicitly_allowed_network_ports.push_back(static_cast<uint16_t>(port));
+ }
+
+ network_service->SetExplicitlyAllowedPorts(explicitly_allowed_network_ports);
+ }
// Configure the stub resolver. This must be done after the system
// NetworkContext is created, but before anything has the chance to use it.
// bool stub_resolver_enabled;
- // base::Optional<std::vector<network::mojom::DnsOverHttpsServerPtr>> dns_over_https_servers;
+ // absl::optional<std::vector<network::mojom::DnsOverHttpsServerPtr>> dns_over_https_servers;
// GetStubResolverConfig(local_state_, &stub_resolver_enabled, &dns_over_https_servers);
// content::GetNetworkService()->ConfigureStubHostResolver(stub_resolver_enabled, std::move(dns_over_https_servers));
}
@@ -256,16 +299,6 @@ void SystemNetworkContextManager::ConfigureDefaultNetworkContextParams(network::
// BrowserProcess itself, so will only be destroyed on shutdown, at which
// point, all NetworkContexts will be destroyed as well.
AddSSLConfigToNetworkContextParams(network_context_params);
-
- // CT is only enabled on Desktop platforms for now.
- network_context_params->enforce_chrome_ct_policy = true;
- for (const auto &ct_log : certificate_transparency::GetKnownLogs()) {
- // TODO(rsleevi): https://crbug.com/702062 - Remove this duplication.
- network::mojom::CTLogInfoPtr log_info = network::mojom::CTLogInfo::New();
- log_info->public_key = std::string(ct_log.log_key, ct_log.log_key_length);
- log_info->name = ct_log.log_name;
- network_context_params->ct_logs.push_back(std::move(log_info));
- }
}
network::mojom::NetworkContextParamsPtr SystemNetworkContextManager::CreateNetworkContextParams()
diff --git a/src/core/net/system_network_context_manager.h b/src/core/net/system_network_context_manager.h
index a234ead9..0078d710 100644
--- a/src/core/net/system_network_context_manager.h
+++ b/src/core/net/system_network_context_manager.h
@@ -50,8 +50,7 @@
#include "base/macros.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/url_loader_factory.mojom-forward.h"
-
+#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "net/proxy_config_monitor.h"
namespace cert_verifier {
diff --git a/src/core/net/url_request_custom_job_proxy.cpp b/src/core/net/url_request_custom_job_proxy.cpp
index f734db64..75868870 100644
--- a/src/core/net/url_request_custom_job_proxy.cpp
+++ b/src/core/net/url_request_custom_job_proxy.cpp
@@ -96,7 +96,7 @@ void URLRequestCustomJobProxy::reply(std::string mimeType, QIODevice *device)
if (m_client->m_device && !m_client->m_device->isReadable())
m_client->m_device->open(QIODevice::ReadOnly);
- if (m_client->m_firstBytePosition > 0)
+ if (m_client->m_device && m_client->m_firstBytePosition > 0)
m_client->m_device->seek(m_client->m_firstBytePosition);
qint64 deviceSize = m_client->m_device ? m_client->m_device->size() : -1;
@@ -158,7 +158,7 @@ void URLRequestCustomJobProxy::readyRead()
}
void URLRequestCustomJobProxy::initialize(GURL url, std::string method,
- base::Optional<url::Origin> initiator,
+ absl::optional<url::Origin> initiator,
std::map<std::string, std::string> headers)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
diff --git a/src/core/net/url_request_custom_job_proxy.h b/src/core/net/url_request_custom_job_proxy.h
index b14322f9..1d9eebb2 100644
--- a/src/core/net/url_request_custom_job_proxy.h
+++ b/src/core/net/url_request_custom_job_proxy.h
@@ -41,8 +41,8 @@
#define URL_REQUEST_CUSTOM_JOB_PROXY_H_
#include "base/memory/weak_ptr.h"
-#include "base/optional.h"
#include "base/sequenced_task_runner.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "url/gurl.h"
#include "url/origin.h"
#include <QtCore/QPointer>
@@ -90,7 +90,7 @@ public:
void abort();
void fail(int error);
void release();
- void initialize(GURL url, std::string method, base::Optional<url::Origin> initiatorOrigin, std::map<std::string, std::string> headers);
+ void initialize(GURL url, std::string method, absl::optional<url::Origin> initiatorOrigin, std::map<std::string, std::string> headers);
void readyRead();
// IO thread owned:
diff --git a/src/core/ozone/BUILD.gn b/src/core/ozone/BUILD.gn
index 48d68902..61ca197e 100644
--- a/src/core/ozone/BUILD.gn
+++ b/src/core/ozone/BUILD.gn
@@ -21,14 +21,19 @@ source_set("qt") {
deps = [
"//base",
+ "//ui/base:buildflags",
"//ui/ozone:ozone_base",
"//ui/ozone/common",
]
defines = [ "OZONE_IMPLEMENTATION" ]
-
+ libs = []
if (use_xkbcommon) {
configs += [ ":xkbcommon" ]
- libs = [ "xkbfile" ]
+ libs += [ "xkbfile" ]
+ }
+
+ if (ozone_platform_x11) {
+ libs += [ "X11" ]
}
}
diff --git a/src/core/ozone/gl_context_qt.cpp b/src/core/ozone/gl_context_qt.cpp
index 1dd7d8f6..8f9093a4 100644
--- a/src/core/ozone/gl_context_qt.cpp
+++ b/src/core/ozone/gl_context_qt.cpp
@@ -141,10 +141,12 @@ void* GLContextHelper::getEGLDisplay()
void* GLContextHelper::getXDisplay()
{
- QPlatformNativeInterface *pni = QGuiApplication::platformNativeInterface();
- if (pni)
- return pni->nativeResourceForScreen(QByteArrayLiteral("display"), qApp->primaryScreen());
+#if QT_CONFIG(xcb)
+ auto *x11app = qGuiApp->nativeInterface<QNativeInterface::QX11Application>();
+ return x11app ? x11app->display() : nullptr;
+#else
return nullptr;
+#endif
}
void* GLContextHelper::getNativeDisplay()
diff --git a/src/core/ozone/gl_ozone_egl_qt.cpp b/src/core/ozone/gl_ozone_egl_qt.cpp
index 14ba5e8d..2b28e29c 100644
--- a/src/core/ozone/gl_ozone_egl_qt.cpp
+++ b/src/core/ozone/gl_ozone_egl_qt.cpp
@@ -65,7 +65,7 @@ base::NativeLibrary LoadLibrary(const base::FilePath& filename) {
return library;
}
-bool GLOzoneEGLQt::LoadGLES2Bindings(gl::GLImplementation /*implementation*/)
+bool GLOzoneEGLQt::LoadGLES2Bindings(const gl::GLImplementationParts & /*implementation*/)
{
base::NativeLibrary eglgles2Library = dlopen(NULL, RTLD_LAZY);
if (!eglgles2Library) {
diff --git a/src/core/ozone/gl_ozone_egl_qt.h b/src/core/ozone/gl_ozone_egl_qt.h
index c55ba232..c2515a41 100644
--- a/src/core/ozone/gl_ozone_egl_qt.h
+++ b/src/core/ozone/gl_ozone_egl_qt.h
@@ -61,7 +61,7 @@ protected:
gl::EGLDisplayPlatform GetNativeDisplay() override;
// Sets up GL bindings for the native surface.
- bool LoadGLES2Bindings(gl::GLImplementation implementation) override;
+ bool LoadGLES2Bindings(const gl::GLImplementationParts &implementation) override;
};
} // namespace ui
diff --git a/src/core/ozone/gl_ozone_glx_qt.cpp b/src/core/ozone/gl_ozone_glx_qt.cpp
index 60b97020..19c24dcb 100644
--- a/src/core/ozone/gl_ozone_glx_qt.cpp
+++ b/src/core/ozone/gl_ozone_glx_qt.cpp
@@ -61,7 +61,8 @@ bool GLOzoneGLXQt::InitializeGLOneOffPlatform() {
}
bool GLOzoneGLXQt::InitializeStaticGLBindings(
- gl::GLImplementation implementation) {
+ const gl::GLImplementationParts &implementation) {
+ Q_UNUSED(implementation);
base::NativeLibrary library = dlopen(NULL, RTLD_LAZY);
if (!library) {
diff --git a/src/core/ozone/gl_ozone_glx_qt.h b/src/core/ozone/gl_ozone_glx_qt.h
index 7825cba3..f1bf8ac6 100644
--- a/src/core/ozone/gl_ozone_glx_qt.h
+++ b/src/core/ozone/gl_ozone_glx_qt.h
@@ -53,7 +53,7 @@ public:
~GLOzoneGLXQt() override {}
bool InitializeGLOneOffPlatform() override;
- bool InitializeStaticGLBindings(gl::GLImplementation implementation) override;
+ bool InitializeStaticGLBindings(const gl::GLImplementationParts &implementation) override;
bool InitializeExtensionSettingsOneOffPlatform() override;
void ShutdownGL() override;
void SetDisabledExtensionsPlatform(
diff --git a/src/core/ozone/gl_surface_egl_qt.cpp b/src/core/ozone/gl_surface_egl_qt.cpp
index 849f0ee4..f7d16292 100644
--- a/src/core/ozone/gl_surface_egl_qt.cpp
+++ b/src/core/ozone/gl_surface_egl_qt.cpp
@@ -60,71 +60,6 @@ using ui::GetLastEGLErrorString;
namespace gl {
-bool GLSurfaceEGLQt::g_egl_surfaceless_context_supported = false;
-bool GLSurfaceEGLQt::s_initialized = false;
-
-GLSurfaceEGLQt::~GLSurfaceEGLQt()
-{
- Destroy();
-}
-
-bool GLSurfaceEGLQt::InitializeOneOff()
-{
- if (s_initialized)
- return true;
-
- // Must be called before initializing the display.
- g_driver_egl.InitializeClientExtensionBindings();
-
- g_display = GLContextHelper::getEGLDisplay();
- if (!g_display) {
- LOG(ERROR) << "GLContextHelper::getEGLDisplay() failed.";
- return false;
- }
-
- g_config = GLContextHelper::getEGLConfig();
- if (!g_config) {
- LOG(ERROR) << "GLContextHelper::getEGLConfig() failed.";
- return false;
- }
-
- if (!eglInitialize(g_display, NULL, NULL)) {
- LOG(ERROR) << "eglInitialize failed with error " << GetLastEGLErrorString();
- return false;
- }
-
- g_client_extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
- g_extensions = eglQueryString(g_display, EGL_EXTENSIONS);
- g_egl_surfaceless_context_supported = ExtensionsContain(g_extensions, "EGL_KHR_surfaceless_context");
- if (g_egl_surfaceless_context_supported) {
- scoped_refptr<GLSurface> surface = new GLSurfacelessQtEGL(gfx::Size(1, 1));
- gl::GLContextAttribs attribs;
- scoped_refptr<GLContext> context = init::CreateGLContext(
- NULL, surface.get(), attribs);
-
- if (!context->MakeCurrent(surface.get()))
- g_egl_surfaceless_context_supported = false;
-
- // Ensure context supports GL_OES_surfaceless_context.
- if (g_egl_surfaceless_context_supported) {
- g_egl_surfaceless_context_supported = context->HasExtension(
- "GL_OES_surfaceless_context");
- context->ReleaseCurrent(surface.get());
- }
- }
-
- // Must be called after initializing the display.
- g_driver_egl.InitializeExtensionBindings();
-
- s_initialized = true;
- return true;
-}
-
-bool GLSurfaceEGLQt::InitializeExtensionSettingsOneOff()
-{
- return s_initialized;
-}
-
bool GLSurfaceEGL::InitializeExtensionSettingsOneOff()
{
return GLSurfaceEGLQt::InitializeExtensionSettingsOneOff();
@@ -237,12 +172,87 @@ bool GLSurfaceEGL::IsAndroidNativeFenceSyncSupported()
return false;
}
+DisplayType GLSurfaceEGL::GetDisplayType()
+{
+ return DisplayType::DEFAULT;
+}
+
+GLSurface *GLSurfaceEGL::createSurfaceless(const gfx::Size& size)
+{
+ return new GLSurfacelessQtEGL(size);
+}
+
+bool GLSurfaceEGLQt::g_egl_surfaceless_context_supported = false;
+bool GLSurfaceEGLQt::s_initialized = false;
+
GLSurfaceEGLQt::GLSurfaceEGLQt(const gfx::Size& size)
: GLSurfaceQt(size),
m_surfaceBuffer(0)
{
}
+GLSurfaceEGLQt::~GLSurfaceEGLQt()
+{
+ Destroy();
+}
+
+bool GLSurfaceEGLQt::InitializeOneOff()
+{
+ if (s_initialized)
+ return true;
+
+ // Must be called before initializing the display.
+ g_driver_egl.InitializeClientExtensionBindings();
+
+ g_display = GLContextHelper::getEGLDisplay();
+ if (!g_display) {
+ LOG(ERROR) << "GLContextHelper::getEGLDisplay() failed.";
+ return false;
+ }
+
+ g_config = GLContextHelper::getEGLConfig();
+ if (!g_config) {
+ LOG(ERROR) << "GLContextHelper::getEGLConfig() failed.";
+ return false;
+ }
+
+ if (!eglInitialize(g_display, NULL, NULL)) {
+ LOG(ERROR) << "eglInitialize failed with error " << GetLastEGLErrorString();
+ return false;
+ }
+
+ g_client_extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
+ g_extensions = eglQueryString(g_display, EGL_EXTENSIONS);
+ g_egl_surfaceless_context_supported = ExtensionsContain(g_extensions, "EGL_KHR_surfaceless_context");
+ if (g_egl_surfaceless_context_supported) {
+ scoped_refptr<GLSurface> surface = new GLSurfacelessQtEGL(gfx::Size(1, 1));
+ gl::GLContextAttribs attribs;
+ scoped_refptr<GLContext> context = init::CreateGLContext(
+ NULL, surface.get(), attribs);
+
+ if (!context->MakeCurrent(surface.get()))
+ g_egl_surfaceless_context_supported = false;
+
+ // Ensure context supports GL_OES_surfaceless_context.
+ if (g_egl_surfaceless_context_supported) {
+ g_egl_surfaceless_context_supported = context->HasExtension(
+ "GL_OES_surfaceless_context");
+ context->ReleaseCurrent(surface.get());
+ }
+ }
+
+ // Must be called after initializing the display.
+ g_driver_egl.InitializeExtensionBindings();
+
+ s_initialized = true;
+ return true;
+}
+
+bool GLSurfaceEGLQt::InitializeExtensionSettingsOneOff()
+{
+ return s_initialized;
+}
+
bool GLSurfaceEGLQt::Initialize(GLSurfaceFormat format)
{
Q_ASSERT(!m_surfaceBuffer);
diff --git a/src/core/ozone/ozone_platform_qt.cpp b/src/core/ozone/ozone_platform_qt.cpp
index 5b42acd9..0affec0d 100644
--- a/src/core/ozone/ozone_platform_qt.cpp
+++ b/src/core/ozone/ozone_platform_qt.cpp
@@ -92,6 +92,8 @@ private:
void InitializeUI(const ui::OzonePlatform::InitParams &) override;
void InitializeGPU(const ui::OzonePlatform::InitParams &) override;
+ void InitScreen(ui::PlatformScreen *) override {}
+
std::unique_ptr<QtWebEngineCore::SurfaceFactoryQt> surface_factory_ozone_;
std::unique_ptr<CursorFactory> cursor_factory_ozone_;
@@ -160,11 +162,27 @@ static std::string getCurrentKeyboardLayout()
if (dpy == nullptr)
return std::string();
+ int d;
+ if (!XkbQueryExtension(dpy, &d, &d, &d, &d, &d)) {
+ // no Xkb extension
+ return std::string();
+ }
+
XkbStateRec state;
if (XkbGetState(dpy, XkbUseCoreKbd, &state) != 0)
return std::string();
- XkbRF_VarDefsRec vdr;
+ XkbRF_VarDefsRec vdr {}; // zero initialize it
+ struct Cleanup {
+ XkbRF_VarDefsRec &vdr;
+ Cleanup(XkbRF_VarDefsRec &vdr) : vdr(vdr) { }
+ ~Cleanup() {
+ free (vdr.model);
+ free (vdr.layout);
+ free (vdr.variant);
+ free (vdr.options);
+ }
+ } cleanup(vdr);
if (XkbRF_GetNamesProp(dpy, nullptr, &vdr) == 0)
return std::string();
@@ -197,11 +215,6 @@ static std::string getCurrentKeyboardLayout()
void OzonePlatformQt::InitializeUI(const ui::OzonePlatform::InitParams &)
{
- overlay_manager_.reset(new StubOverlayManager());
- cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone());
- gpu_platform_support_host_.reset(ui::CreateStubGpuPlatformSupportHost());
- input_controller_ = CreateStubInputController();
-
#if BUILDFLAG(USE_XKBCOMMON)
std::string layout = getCurrentKeyboardLayout();
if (layout.empty()) {
@@ -215,6 +228,11 @@ void OzonePlatformQt::InitializeUI(const ui::OzonePlatform::InitParams &)
#endif // BUILDFLAG(USE_XKBCOMMON)
KeyboardLayoutEngineManager::SetKeyboardLayoutEngine(m_keyboardLayoutEngine.get());
+
+ overlay_manager_.reset(new StubOverlayManager());
+ input_controller_ = CreateStubInputController();
+ cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone());
+ gpu_platform_support_host_.reset(ui::CreateStubGpuPlatformSupportHost());
}
void OzonePlatformQt::InitializeGPU(const ui::OzonePlatform::InitParams &)
diff --git a/src/core/ozone/platform_window_qt.cpp b/src/core/ozone/platform_window_qt.cpp
index 42af7777..e8ac4d02 100644
--- a/src/core/ozone/platform_window_qt.cpp
+++ b/src/core/ozone/platform_window_qt.cpp
@@ -41,6 +41,7 @@
#include "base/bind.h"
#include "ozone/platform_window_qt.h"
+#include "ui/base/cursor/platform_cursor.h"
#include "ui/events/ozone/events_ozone.h"
#include "ui/events/platform/platform_event_source.h"
#include "ui/platform_window/platform_window_delegate.h"
@@ -64,6 +65,11 @@ gfx::Rect PlatformWindowQt::GetBounds() const
return bounds_;
}
+void PlatformWindowQt::Close()
+{
+ delegate_->OnClosed();
+}
+
void PlatformWindowQt::SetBounds(const gfx::Rect& bounds)
{
if (bounds == bounds_)
@@ -80,8 +86,8 @@ bool PlatformWindowQt::CanDispatchEvent(const ui::PlatformEvent& /*ne*/)
uint32_t PlatformWindowQt::DispatchEvent(const ui::PlatformEvent& native_event)
{
DispatchEventFromNativeUiEvent(
- native_event, base::Bind(&PlatformWindowDelegate::DispatchEvent,
- base::Unretained(delegate_)));
+ native_event, base::BindOnce(&PlatformWindowDelegate::DispatchEvent,
+ base::Unretained(delegate_)));
return ui::POST_DISPATCH_STOP_PROPAGATION;
}
diff --git a/src/core/ozone/platform_window_qt.h b/src/core/ozone/platform_window_qt.h
index 15c1c3fa..6a0984da 100644
--- a/src/core/ozone/platform_window_qt.h
+++ b/src/core/ozone/platform_window_qt.h
@@ -60,9 +60,9 @@ public:
void SetBounds(const gfx::Rect& bounds) override;
void Show(bool inactive = false) override { }
void Hide() override { }
- void Close() override { }
+ void Close() override;
bool IsVisible() const override { return true; }
- void SetTitle(const base::string16&) override { }
+ void SetTitle(const std::u16string&) override { }
void SetCapture() override { }
void ReleaseCapture() override { }
bool HasCapture() const override { return false; }
@@ -71,7 +71,7 @@ public:
void Minimize() override { }
void Restore() override { }
PlatformWindowState GetPlatformWindowState() const override { return PlatformWindowState::kUnknown; }
- void SetCursor(PlatformCursor) override { }
+ void SetCursor(scoped_refptr<PlatformCursor>) override { }
void MoveCursorTo(const gfx::Point&) override { }
void ConfineCursorToBounds(const gfx::Rect&) override { }
void SetRestoredBoundsInPixels(const gfx::Rect& bounds) override { }
diff --git a/src/core/ozone/surface_factory_qt.cpp b/src/core/ozone/surface_factory_qt.cpp
index 846d930d..ca3e13e0 100644
--- a/src/core/ozone/surface_factory_qt.cpp
+++ b/src/core/ozone/surface_factory_qt.cpp
@@ -52,24 +52,28 @@ SurfaceFactoryQt::SurfaceFactoryQt()
{
#if defined(USE_GLX)
if (GLContextHelper::getGlxPlatformInterface()) {
- m_impl = { gl::kGLImplementationDesktopGL };
+ m_impl = { gl::GLImplementationParts(gl::kGLImplementationDesktopGL),
+ gl::GLImplementationParts(gl::kGLImplementationDisabled) };
m_ozone.reset(new ui::GLOzoneGLXQt());
} else
#endif
if (GLContextHelper::getEglPlatformInterface()) {
- m_impl = { gl::kGLImplementationDesktopGL, gl::kGLImplementationEGLGLES2 };
+ m_impl = { gl::GLImplementationParts(gl::kGLImplementationDesktopGL),
+ gl::GLImplementationParts(gl::kGLImplementationEGLGLES2),
+ gl::GLImplementationParts(gl::kGLImplementationDisabled) };
m_ozone.reset(new ui::GLOzoneEGLQt());
} else {
- qFatal("No suitable graphics backend found\n");
+ qWarning("No suitable graphics backend found\n");
+ m_impl = { gl::GLImplementationParts(gl::kGLImplementationDisabled) };
}
}
-std::vector<gl::GLImplementation> SurfaceFactoryQt::GetAllowedGLImplementations()
+std::vector<gl::GLImplementationParts> SurfaceFactoryQt::GetAllowedGLImplementations()
{
return m_impl;
}
-ui::GLOzone* SurfaceFactoryQt::GetGLOzone(gl::GLImplementation implementation)
+ui::GLOzone *SurfaceFactoryQt::GetGLOzone(const gl::GLImplementationParts &implementation)
{
return m_ozone.get();
}
diff --git a/src/core/ozone/surface_factory_qt.h b/src/core/ozone/surface_factory_qt.h
index 232f11e0..da208f8e 100644
--- a/src/core/ozone/surface_factory_qt.h
+++ b/src/core/ozone/surface_factory_qt.h
@@ -50,10 +50,10 @@ class SurfaceFactoryQt : public ui::SurfaceFactoryOzone
{
public:
SurfaceFactoryQt();
- std::vector<gl::GLImplementation> GetAllowedGLImplementations() override;
- ui::GLOzone* GetGLOzone(gl::GLImplementation implementation) override;
+ std::vector<gl::GLImplementationParts> GetAllowedGLImplementations() override;
+ ui::GLOzone *GetGLOzone(const gl::GLImplementationParts &implementation) override;
private:
- std::vector<gl::GLImplementation> m_impl;
+ std::vector<gl::GLImplementationParts> m_impl;
std::unique_ptr<ui::GLOzone> m_ozone;
};
diff --git a/src/core/permission_manager_qt.cpp b/src/core/permission_manager_qt.cpp
index e6db004d..686e6121 100644
--- a/src/core/permission_manager_qt.cpp
+++ b/src/core/permission_manager_qt.cpp
@@ -89,6 +89,7 @@ static ProfileAdapter::PermissionType toQt(content::PermissionType type)
case content::PermissionType::STORAGE_ACCESS_GRANT:
case content::PermissionType::FONT_ACCESS:
case content::PermissionType::DISPLAY_CAPTURE:
+ case content::PermissionType::FILE_HANDLING:
case content::PermissionType::NUM:
LOG(INFO) << "Unexpected unsupported permission type: " << static_cast<int>(type);
break;
@@ -199,7 +200,7 @@ bool PermissionManagerQt::checkPermission(const QUrl &origin, ProfileAdapter::Pe
return m_permissions.contains(key) && m_permissions[key];
}
-int PermissionManagerQt::RequestPermission(content::PermissionType permission,
+void PermissionManagerQt::RequestPermission(content::PermissionType permission,
content::RenderFrameHost *frameHost,
const GURL& requesting_origin,
bool /*user_gesture*/,
@@ -207,7 +208,7 @@ int PermissionManagerQt::RequestPermission(content::PermissionType permission,
{
if (requesting_origin.is_empty()) {
std::move(callback).Run(blink::mojom::PermissionStatus::DENIED);
- return content::PermissionController::kNoPendingOperation;
+ return;
}
WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(
@@ -222,28 +223,27 @@ int PermissionManagerQt::RequestPermission(content::PermissionType permission,
std::move(callback).Run(blink::mojom::PermissionStatus::GRANTED);
else
std::move(callback).Run(blink::mojom::PermissionStatus::DENIED);
- return content::PermissionController::kNoPendingOperation;
+ return;
} else if (!canRequestPermissionFor(permissionType)) {
std::move(callback).Run(blink::mojom::PermissionStatus::DENIED);
- return content::PermissionController::kNoPendingOperation;
+ return;
}
int request_id = ++m_requestIdCount;
auto requestOrigin = toQt(requesting_origin);
m_requests.push_back({ request_id, permissionType, requestOrigin, std::move(callback) });
contentsDelegate->requestFeaturePermission(permissionType, requestOrigin);
- return request_id;
}
-int PermissionManagerQt::RequestPermissions(const std::vector<content::PermissionType>& permissions,
- content::RenderFrameHost* frameHost,
- const GURL& requesting_origin,
- bool /*user_gesture*/,
- base::OnceCallback<void(const std::vector<blink::mojom::PermissionStatus>&)> callback)
+void PermissionManagerQt::RequestPermissions(const std::vector<content::PermissionType> &permissions,
+ content::RenderFrameHost *frameHost,
+ const GURL &requesting_origin,
+ bool /*user_gesture*/,
+ base::OnceCallback<void(const std::vector<blink::mojom::PermissionStatus> &)> callback)
{
if (requesting_origin.is_empty()) {
std::move(callback).Run(std::vector<blink::mojom::PermissionStatus>(permissions.size(), blink::mojom::PermissionStatus::DENIED));
- return content::PermissionController::kNoPendingOperation;
+ return;
}
WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt *>(
@@ -271,7 +271,7 @@ int PermissionManagerQt::RequestPermissions(const std::vector<content::Permissio
}
if (answerable) {
std::move(callback).Run(result);
- return content::PermissionController::kNoPendingOperation;
+ return;
}
int request_id = ++m_requestIdCount;
@@ -282,7 +282,6 @@ int PermissionManagerQt::RequestPermissions(const std::vector<content::Permissio
if (canRequestPermissionFor(permissionType))
contentsDelegate->requestFeaturePermission(permissionType, requestOrigin);
}
- return request_id;
}
blink::mojom::PermissionStatus PermissionManagerQt::GetPermissionStatus(
diff --git a/src/core/permission_manager_qt.h b/src/core/permission_manager_qt.h
index f8d7e0ee..8cecfdf7 100644
--- a/src/core/permission_manager_qt.h
+++ b/src/core/permission_manager_qt.h
@@ -59,7 +59,7 @@ public:
bool checkPermission(const QUrl &origin, ProfileAdapter::PermissionType type);
// content::PermissionManager implementation:
- int RequestPermission(
+ void RequestPermission(
content::PermissionType permission,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
@@ -81,7 +81,7 @@ public:
const GURL& requesting_origin,
const GURL& embedding_origin) override;
- int RequestPermissions(
+ void RequestPermissions(
const std::vector<content::PermissionType>& permission,
content::RenderFrameHost* render_frame_host,
const GURL& requesting_origin,
diff --git a/src/core/platform_notification_service_qt.cpp b/src/core/platform_notification_service_qt.cpp
index 5f3017dc..63569ece 100644
--- a/src/core/platform_notification_service_qt.cpp
+++ b/src/core/platform_notification_service_qt.cpp
@@ -90,7 +90,7 @@ struct PersistentNotificationDelegate : UserNotificationController::Delegate {
virtual void clicked() override {
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
if (auto inst = content::NotificationEventDispatcher::GetInstance())
- inst->DispatchNotificationClickEvent(browser_context, notification_id, origin, base::nullopt, base::nullopt, base::DoNothing());
+ inst->DispatchNotificationClickEvent(browser_context, notification_id, origin, absl::nullopt, absl::nullopt, base::DoNothing());
}
virtual void closed(bool by_user) override {
@@ -114,6 +114,7 @@ PlatformNotificationServiceQt::~PlatformNotificationServiceQt() {}
void PlatformNotificationServiceQt::DisplayNotification(
const std::string &notification_id,
const GURL &origin,
+ const GURL &document_url,
const blink::PlatformNotificationData &notificationData,
const blink::NotificationResources &notificationResources)
{
diff --git a/src/core/platform_notification_service_qt.h b/src/core/platform_notification_service_qt.h
index 12aa2619..b5570868 100644
--- a/src/core/platform_notification_service_qt.h
+++ b/src/core/platform_notification_service_qt.h
@@ -58,6 +58,7 @@ public:
// |cancel_callback| argument. This method must be called on the UI thread.
void DisplayNotification(const std::string& notification_id,
const GURL& origin,
+ const GURL& document_url,
const blink::PlatformNotificationData& notificationData,
const blink::NotificationResources& notificationResources) override;
diff --git a/src/core/pref_service_adapter.cpp b/src/core/pref_service_adapter.cpp
index 9fcb1658..59bf2224 100644
--- a/src/core/pref_service_adapter.cpp
+++ b/src/core/pref_service_adapter.cpp
@@ -101,7 +101,6 @@ void PrefServiceAdapter::setup(const ProfileAdapter &profileAdapter)
registry->RegisterStringPref(language::prefs::kAcceptLanguages, std::string());
registry->RegisterListPref(spellcheck::prefs::kSpellCheckDictionaries);
registry->RegisterListPref(spellcheck::prefs::kSpellCheckForcedDictionaries);
- registry->RegisterListPref(spellcheck::prefs::kSpellCheckBlacklistedDictionaries);
registry->RegisterListPref(spellcheck::prefs::kSpellCheckBlocklistedDictionaries);
registry->RegisterStringPref(spellcheck::prefs::kSpellCheckDictionary, std::string());
registry->RegisterBooleanPref(spellcheck::prefs::kSpellCheckEnable, false);
@@ -183,9 +182,10 @@ void PrefServiceAdapter::setSpellCheckLanguages(const QStringList &languages)
QStringList PrefServiceAdapter::spellCheckLanguages() const
{
QStringList spellcheck_dictionaries;
- for (const auto &value : *m_prefService->GetList(spellcheck::prefs::kSpellCheckDictionaries)) {
+ const auto &list = m_prefService->GetList(spellcheck::prefs::kSpellCheckDictionaries);
+ for (size_t i = 0; i < list->GetSize(); ++i) {
std::string dictionary;
- if (value.GetAsString(&dictionary))
+ if (list->GetString(i, &dictionary))
spellcheck_dictionaries.append(QString::fromStdString(dictionary));
}
diff --git a/src/core/printing/print_view_manager_base_qt.cpp b/src/core/printing/print_view_manager_base_qt.cpp
index 8d2d1bfd..a170c95b 100644
--- a/src/core/printing/print_view_manager_base_qt.cpp
+++ b/src/core/printing/print_view_manager_base_qt.cpp
@@ -293,8 +293,8 @@ void PrintViewManagerBaseQt::UpdatePrintingEnabled()
enabled = true;
#endif
web_contents()->ForEachFrame(
- base::Bind(&PrintViewManagerBaseQt::SendPrintingEnabled,
- base::Unretained(this), enabled));
+ base::BindRepeating(&PrintViewManagerBaseQt::SendPrintingEnabled,
+ base::Unretained(this), enabled));
}
void PrintViewManagerBaseQt::NavigationStopped()
@@ -303,7 +303,7 @@ void PrintViewManagerBaseQt::NavigationStopped()
TerminatePrintJob(true);
}
-base::string16 PrintViewManagerBaseQt::RenderSourceName()
+std::u16string PrintViewManagerBaseQt::RenderSourceName()
{
return toString16(QLatin1String(""));
}
@@ -391,11 +391,6 @@ void PrintViewManagerBaseQt::PrintingFailed(int32_t cookie)
PrintManager::PrintingFailed(cookie);
ReleasePrinterQuery();
-
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_PRINT_JOB_RELEASED,
- content::Source<content::WebContents>(web_contents()),
- content::NotificationService::NoDetails());
}
void PrintViewManagerBaseQt::ScriptedPrint(printing::mojom::ScriptedPrintParamsPtr params,
@@ -462,23 +457,12 @@ void PrintViewManagerBaseQt::OnNotifyPrintJobEvent(const printing::JobEventDetai
switch (event_details.type()) {
case printing::JobEventDetails::FAILED: {
TerminatePrintJob(true);
-
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_PRINT_JOB_RELEASED,
- content::Source<content::WebContents>(web_contents()),
- content::NotificationService::NoDetails());
- break;
- }
- case printing::JobEventDetails::USER_INIT_DONE:
- case printing::JobEventDetails::DEFAULT_INIT_DONE:
- case printing::JobEventDetails::USER_INIT_CANCELED: {
- NOTREACHED();
- break;
- }
- case printing::JobEventDetails::ALL_PAGES_REQUESTED: {
- ShouldQuitFromInnerMessageLoop();
break;
}
+// case printing::JobEventDetails::ALL_PAGES_REQUESTED: {
+// ShouldQuitFromInnerMessageLoop();
+// break;
+// }
case printing::JobEventDetails::NEW_DOC:
#if defined(OS_WIN)
case printing::JobEventDetails::PAGE_DONE:
@@ -493,11 +477,6 @@ void PrintViewManagerBaseQt::OnNotifyPrintJobEvent(const printing::JobEventDetai
// of object registration.
m_didPrintingSucceed = true;
ReleasePrintJob();
-
- content::NotificationService::current()->Notify(
- chrome::NOTIFICATION_PRINT_JOB_RELEASED,
- content::Source<content::WebContents>(web_contents()),
- content::NotificationService::NoDetails());
break;
}
default:
@@ -532,11 +511,9 @@ bool PrintViewManagerBaseQt::RenderAllMissingPagesNow()
// pages in an hurry if a print_job_ is still pending. No need to wait for it
// to actually spool the pages, only to have the renderer generate them. Run
// a message loop until we get our signal that the print job is satisfied.
- // PrintJob will send a ALL_PAGES_REQUESTED after having received all the
- // pages it needs. MessageLoop::current()->Quit() will be called as soon as
- // print_job_->document()->IsComplete() is true on either ALL_PAGES_REQUESTED
- // or in DidPrintPage(). The check is done in
- // ShouldQuitFromInnerMessageLoop().
+ // |quit_inner_loop_| will be called as soon as
+ // print_job_->document()->IsComplete() is true in DidPrintDocument(). The
+ // check is done in ShouldQuitFromInnerMessageLoop().
// BLOCKS until all the pages are received. (Need to enable recursive task)
if (!RunInnerMessageLoop()) {
// This function is always called from DisconnectFromCurrentPrintJob() so we
diff --git a/src/core/printing/print_view_manager_base_qt.h b/src/core/printing/print_view_manager_base_qt.h
index 21069af6..96c2d441 100644
--- a/src/core/printing/print_view_manager_base_qt.h
+++ b/src/core/printing/print_view_manager_base_qt.h
@@ -45,7 +45,6 @@
#define PRINT_VIEW_MANAGER_BASE_QT_H
#include "base/memory/ref_counted_memory.h"
-#include "base/strings/string16.h"
#include "components/prefs/pref_member.h"
#include "components/printing/browser/print_manager.h"
#include "components/printing/common/print.mojom-forward.h"
@@ -77,7 +76,7 @@ public:
// Whether printing is enabled or not.
void UpdatePrintingEnabled();
- base::string16 RenderSourceName();
+ std::u16string RenderSourceName();
// mojom::PrintManagerHost:
void DidGetPrintedPagesCount(int32_t cookie, uint32_t number_pages) override;
@@ -144,9 +143,8 @@ private:
// Quits the current message loop if these conditions hold true: a document is
// loaded and is complete and waiting_for_pages_to_be_rendered_ is true. This
- // function is called in DidPrintDocument() or on ALL_PAGES_REQUESTED
- // notification. The inner message loop is created was created by
- // RenderAllMissingPagesNow().
+ // function is called in DidPrintDocument(). The inner message loop was
+ // created by RenderAllMissingPagesNow().
void ShouldQuitFromInnerMessageLoop();
// Terminates the print job. No-op if no print job has been created. If
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 3b66ad29..90b320eb 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -56,6 +56,7 @@
#include "base/values.h"
#include "base/memory/ref_counted_memory.h"
#include "base/task/post_task.h"
+#include "base/task/thread_pool.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/printer_query.h"
#include "components/printing/common/print.mojom.h"
@@ -65,6 +66,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "printing/metafile_skia.h"
+#include "printing/mojom/print.mojom-shared.h"
#include "printing/print_job_constants.h"
#include "printing/units.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
@@ -98,7 +100,7 @@ GetBytesFromHandle(const base::ReadOnlySharedMemoryRegion &handle)
// Write the PDF file to disk.
static void SavePdfFile(scoped_refptr<base::RefCountedBytes> data,
const base::FilePath &path,
- const QtWebEngineCore::PrintViewManagerQt::PrintToPDFFileCallback &saveCallback)
+ QtWebEngineCore::PrintViewManagerQt::PrintToPDFFileCallback saveCallback)
{
DCHECK_GT(data->size(), 0U);
@@ -109,7 +111,7 @@ static void SavePdfFile(scoped_refptr<base::RefCountedBytes> data,
base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE);
bool success = file.IsValid() && metafile.SaveTo(&file);
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(saveCallback, success));
+ base::BindOnce(std::move(saveCallback), success));
}
static base::DictionaryValue *createPrintSettings()
@@ -122,7 +124,7 @@ static base::DictionaryValue *createPrintSettings()
printSettings->SetInteger(printing::kPreviewRequestID, internalRequestId);
// The following are standard settings that Chromium expects to be set.
- printSettings->SetInteger(printing::kSettingPrinterType, static_cast<int>(printing::PrinterType::kPdf));
+ printSettings->SetInteger(printing::kSettingPrinterType, static_cast<int>(printing::mojom::PrinterType::kPdf));
printSettings->SetInteger(printing::kSettingDpiHorizontal, printing::kPointsPerInch);
printSettings->SetInteger(printing::kSettingDpiVertical, printing::kPointsPerInch);
@@ -209,22 +211,22 @@ void PrintViewManagerQt::PrintToPDFFileWithCallback(const QPageLayout &pageLayou
const QPageRanges &pageRanges,
bool printInColor,
const QString &filePath,
- const PrintToPDFFileCallback& callback)
+ PrintToPDFFileCallback callback)
{
if (callback.is_null())
return;
if (m_printSettings || !filePath.length()) {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(callback, false));
+ base::BindOnce(std::move(callback), false));
return;
}
m_pdfOutputPath = toFilePath(filePath);
- m_pdfSaveCallback = callback;
+ m_pdfSaveCallback = std::move(callback);
if (!PrintToPDFInternal(pageLayout, pageRanges, printInColor)) {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(callback, false));
+ base::BindOnce(std::move(m_pdfSaveCallback), false));
resetPdfState();
}
}
@@ -233,7 +235,7 @@ void PrintViewManagerQt::PrintToPDFWithCallback(const QPageLayout &pageLayout,
const QPageRanges &pageRanges,
bool printInColor,
bool useCustomMargins,
- const PrintToPDFCallback& callback)
+ PrintToPDFCallback callback)
{
if (callback.is_null())
return;
@@ -241,14 +243,14 @@ void PrintViewManagerQt::PrintToPDFWithCallback(const QPageLayout &pageLayout,
// If there already is a pending print in progress, don't try starting another one.
if (m_printSettings) {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(callback, QSharedPointer<QByteArray>()));
+ base::BindOnce(std::move(callback), QSharedPointer<QByteArray>()));
return;
}
- m_pdfPrintCallback = callback;
+ m_pdfPrintCallback = std::move(callback);
if (!PrintToPDFInternal(pageLayout, pageRanges, printInColor, useCustomMargins)) {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(callback, QSharedPointer<QByteArray>()));
+ base::BindOnce(std::move(m_pdfPrintCallback), QSharedPointer<QByteArray>()));
resetPdfState();
}
@@ -289,6 +291,19 @@ PrintViewManagerQt::PrintViewManagerQt(content::WebContents *contents)
}
+// static
+void PrintViewManagerQt::BindPrintManagerHost(mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost> receiver,
+ content::RenderFrameHost *rfh)
+{
+ auto *web_contents = content::WebContents::FromRenderFrameHost(rfh);
+ if (!web_contents)
+ return;
+ auto *print_manager = PrintViewManagerQt::FromWebContents(web_contents);
+ if (!print_manager)
+ return;
+ print_manager->BindReceiver(std::move(receiver), rfh);
+}
+
void PrintViewManagerQt::resetPdfState()
{
m_pdfOutputPath.clear();
@@ -310,7 +325,7 @@ void PrintViewManagerQt::NavigationStopped()
{
if (!m_pdfPrintCallback.is_null()) {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(m_pdfPrintCallback, QSharedPointer<QByteArray>()));
+ base::BindOnce(std::move(m_pdfPrintCallback), QSharedPointer<QByteArray>()));
}
resetPdfState();
PrintViewManagerBaseQt::NavigationStopped();
@@ -321,7 +336,7 @@ void PrintViewManagerQt::RenderProcessGone(base::TerminationStatus status)
PrintViewManagerBaseQt::RenderProcessGone(status);
if (!m_pdfPrintCallback.is_null()) {
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(m_pdfPrintCallback, QSharedPointer<QByteArray>()));
+ base::BindOnce(std::move(m_pdfPrintCallback), QSharedPointer<QByteArray>()));
}
resetPdfState();
}
@@ -375,6 +390,11 @@ void PrintViewManagerQt::CheckForCancel(int32_t preview_ui_id,
std::move(callback).Run(false);
}
+void PrintViewManagerQt::SetAccessibilityTree(int32_t, const ui::AXTreeUpdate &)
+{
+ // FIXME!
+}
+
void PrintViewManagerQt::MetafileReadyForPrinting(printing::mojom::DidPreviewDocumentParamsPtr params,
int32_t preview_ui_id)
{
@@ -391,11 +411,11 @@ void PrintViewManagerQt::MetafileReadyForPrinting(printing::mojom::DidPreviewDoc
if (!pdf_print_callback.is_null()) {
QSharedPointer<QByteArray> data_array = GetStdVectorFromHandle(params->content->metafile_data_region);
base::PostTask(FROM_HERE, {content::BrowserThread::UI},
- base::BindOnce(pdf_print_callback, data_array));
+ base::BindOnce(std::move(pdf_print_callback), data_array));
} else {
scoped_refptr<base::RefCountedBytes> data_bytes = GetBytesFromHandle(params->content->metafile_data_region);
- base::PostTask(FROM_HERE, {base::ThreadPool(), base::MayBlock()},
- base::BindOnce(&SavePdfFile, data_bytes, pdfOutputPath, pdf_save_callback));
+ base::ThreadPool::PostTask(FROM_HERE, { base::MayBlock() },
+ base::BindOnce(&SavePdfFile, data_bytes, pdfOutputPath, std::move(pdf_save_callback)));
}
}
diff --git a/src/core/printing/print_view_manager_qt.h b/src/core/printing/print_view_manager_qt.h
index 0496a9ba..bc55c57f 100644
--- a/src/core/printing/print_view_manager_qt.h
+++ b/src/core/printing/print_view_manager_qt.h
@@ -49,7 +49,6 @@
#include "qtwebenginecoreglobal_p.h"
#include "base/memory/ref_counted.h"
-#include "base/strings/string16.h"
#include "components/prefs/pref_member.h"
#include "components/printing/common/print.mojom.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -70,20 +69,24 @@ class PrintViewManagerQt
{
public:
~PrintViewManagerQt() override;
- typedef base::Callback<void(QSharedPointer<QByteArray> result)> PrintToPDFCallback;
- typedef base::Callback<void(bool success)> PrintToPDFFileCallback;
+
+ static void BindPrintManagerHost(mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost> receiver,
+ content::RenderFrameHost *rfh);
+
+ typedef base::OnceCallback<void(QSharedPointer<QByteArray> result)> PrintToPDFCallback;
+ typedef base::OnceCallback<void(bool success)> PrintToPDFFileCallback;
// Method to print a page to a Pdf document with page size \a pageSize in location \a filePath.
void PrintToPDFFileWithCallback(const QPageLayout &pageLayout,
const QPageRanges &pageRanges,
bool printInColor,
const QString &filePath,
- const PrintToPDFFileCallback& callback);
+ PrintToPDFFileCallback callback);
void PrintToPDFWithCallback(const QPageLayout &pageLayout,
const QPageRanges &pageRanges,
bool printInColor,
bool useCustomMargins,
- const PrintToPDFCallback &callback);
+ PrintToPDFCallback callback);
protected:
explicit PrintViewManagerQt(content::WebContents*);
@@ -108,7 +111,7 @@ protected:
CheckForCancelCallback callback) override;
void MetafileReadyForPrinting(printing::mojom::DidPreviewDocumentParamsPtr params,
int32_t preview_ui_id) override;
-
+ void SetAccessibilityTree(int32_t, const ui::AXTreeUpdate &) override;
private:
void resetPdfState();
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 7f7b7181..6e902ff5 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -51,6 +51,7 @@
#include "content/public/browser/shared_cors_origin_access_list.h"
#include "content/public/browser/storage_partition.h"
#include "services/network/public/cpp/cors/origin_access_list.h"
+#include "services/network/public/mojom/network_context.mojom.h"
#include "url/url_util.h"
#include "api/qwebengineurlscheme.h"
@@ -118,13 +119,13 @@ ProfileAdapter::ProfileAdapter(const QString &storageName):
ProfileAdapter::~ProfileAdapter()
{
m_cancelableTaskTracker->TryCancelAll();
- content::BrowserContext::NotifyWillBeDestroyed(m_profile.data());
+ m_profile->NotifyWillBeDestroyed();
while (!m_webContentsAdapterClients.isEmpty()) {
m_webContentsAdapterClients.first()->releaseProfile();
}
WebEngineContext::current()->removeProfileAdapter(this);
if (m_downloadManagerDelegate) {
- m_profile->GetDownloadManager(m_profile.data())->Shutdown();
+ m_profile->GetDownloadManager()->Shutdown();
m_downloadManagerDelegate.reset();
}
#if QT_CONFIG(ssl)
@@ -337,10 +338,10 @@ void ProfileAdapter::setHttpUserAgent(const QString &userAgent)
if (web_contents->GetBrowserContext() == m_profile.data())
web_contents->SetUserAgentOverride(blink::UserAgentOverride::UserAgentOnly(stdUserAgent), true);
- content::BrowserContext::ForEachStoragePartition(
- m_profile.get(), base::BindRepeating([](const std::string &user_agent, content::StoragePartition *storage_partition) {
- storage_partition->GetNetworkContext()->SetUserAgent(user_agent);
- }, stdUserAgent));
+ m_profile->ForEachStoragePartition(
+ base::BindRepeating([](const std::string &user_agent, content::StoragePartition *storage_partition) {
+ storage_partition->GetNetworkContext()->SetUserAgent(user_agent);
+ }, stdUserAgent));
}
ProfileAdapter::HttpCacheType ProfileAdapter::httpCacheType() const
@@ -479,10 +480,10 @@ const QList<QByteArray> ProfileAdapter::customUrlSchemes() const
void ProfileAdapter::updateCustomUrlSchemeHandlers()
{
- content::BrowserContext::ForEachStoragePartition(
- m_profile.get(), base::BindRepeating([](content::StoragePartition *storage_partition) {
- storage_partition->ResetURLLoaderFactories();
- }));
+ m_profile->ForEachStoragePartition(
+ base::BindRepeating([](content::StoragePartition *storage_partition) {
+ storage_partition->ResetURLLoaderFactories();
+ }));
}
void ProfileAdapter::removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *handler)
@@ -601,10 +602,10 @@ void ProfileAdapter::setHttpAcceptLanguage(const QString &httpAcceptLanguage)
}
}
- content::BrowserContext::ForEachStoragePartition(
- m_profile.get(), base::BindRepeating([](std::string accept_language, content::StoragePartition *storage_partition) {
- storage_partition->GetNetworkContext()->SetAcceptLanguage(accept_language);
- }, http_accept_language));
+ m_profile->ForEachStoragePartition(
+ base::BindRepeating([](std::string accept_language, content::StoragePartition *storage_partition) {
+ storage_partition->GetNetworkContext()->SetAcceptLanguage(accept_language);
+ }, http_accept_language));
}
void ProfileAdapter::clearHttpCache()
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index bc256bb0..24917fa8 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -105,7 +105,7 @@ void ProfileIODataQt::shutdownOnUIThread()
if (m_clearHttpCacheInProgress) {
m_clearHttpCacheInProgress = false;
content::BrowsingDataRemover *remover =
- content::BrowserContext::GetBrowsingDataRemover(m_profileAdapter->profile());
+ m_profileAdapter->profile()->GetBrowsingDataRemover();
remover->RemoveObserver(&m_removerObserver);
}
@@ -150,7 +150,7 @@ void ProfileIODataQt::clearHttpCache()
if (!m_clearHttpCacheInProgress) {
m_clearHttpCacheInProgress = true;
content::BrowsingDataRemover *remover =
- content::BrowserContext::GetBrowsingDataRemover(m_profileAdapter->profile());
+ m_profileAdapter->profile()->GetBrowsingDataRemover();
remover->AddObserver(&m_removerObserver);
remover->RemoveAndReply(base::Time(), base::Time::Max(),
content::BrowsingDataRemover::DATA_TYPE_CACHE,
@@ -163,7 +163,7 @@ void ProfileIODataQt::clearHttpCache()
void ProfileIODataQt::removeBrowsingDataRemoverObserver()
{
content::BrowsingDataRemover *remover =
- content::BrowserContext::GetBrowsingDataRemover(m_profileAdapter->profile());
+ m_profileAdapter->profile()->GetBrowsingDataRemover();
remover->RemoveObserver(&m_removerObserver);
}
@@ -198,8 +198,8 @@ void ProfileIODataQt::resetNetworkContext()
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
setFullConfiguration();
- content::BrowserContext::ForEachStoragePartition(
- m_profile, base::BindRepeating([](content::StoragePartition *storage) {
+ m_profile->ForEachStoragePartition(
+ base::BindRepeating([](content::StoragePartition *storage) {
auto storage_impl = static_cast<content::StoragePartitionImpl *>(storage);
storage_impl->ResetURLLoaderFactories();
storage_impl->ResetNetworkContext();
@@ -259,13 +259,9 @@ void ProfileIODataQt::ConfigureNetworkContextParams(bool in_memory,
}
if (!m_inMemoryOnly && !in_memory) {
network_context_params->http_server_properties_path = toFilePath(m_dataPath).AppendASCII("Network Persistent State");
- network_context_params->transport_security_persister_path = toFilePath(m_dataPath);
+ network_context_params->transport_security_persister_file_path = toFilePath(m_dataPath).AppendASCII("TransportSecurity");
}
-#if !BUILDFLAG(DISABLE_FTP_SUPPORT)
- network_context_params->enable_ftp_url_support = true;
-#endif // !BUILDFLAG(DISABLE_FTP_SUPPORT)
-
network_context_params->enforce_chrome_ct_policy = false;
// Should be initialized with existing per-profile CORS access lists.
diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp
index ec7da140..ae210b6c 100644
--- a/src/core/profile_qt.cpp
+++ b/src/core/profile_qt.cpp
@@ -87,8 +87,7 @@
namespace QtWebEngineCore {
ProfileQt::ProfileQt(ProfileAdapter *profileAdapter)
- : m_sharedCorsOriginAccessList(content::SharedCorsOriginAccessList::Create())
- , m_profileIOData(new ProfileIODataQt(this))
+ : m_profileIOData(new ProfileIODataQt(this))
, m_profileAdapter(profileAdapter)
#if BUILDFLAG(ENABLE_EXTENSIONS)
, m_extensionSystem(nullptr)
@@ -220,35 +219,6 @@ content::StorageNotificationService *ProfileQt::GetStorageNotificationService()
return nullptr;
}
-void ProfileQt::SetCorsOriginAccessListForOrigin(TargetBrowserContexts target_mode,
- const url::Origin &source_origin,
- std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns,
- std::vector<network::mojom::CorsOriginPatternPtr> block_patterns,
- base::OnceClosure closure)
-{
- Q_UNUSED(target_mode); // We have no related OTR profiles
-
- auto barrier_closure = base::BarrierClosure(2, std::move(closure));
-
- // Keep profile storage partitions' NetworkContexts synchronized.
- auto profile_setter = base::MakeRefCounted<content::CorsOriginPatternSetter>(
- source_origin,
- content::CorsOriginPatternSetter::ClonePatterns(allow_patterns),
- content::CorsOriginPatternSetter::ClonePatterns(block_patterns),
- barrier_closure);
- profile_setter->ApplyToEachStoragePartition(this);
-
- m_sharedCorsOriginAccessList->SetForOrigin(source_origin,
- std::move(allow_patterns),
- std::move(block_patterns),
- barrier_closure);
-}
-
-content::SharedCorsOriginAccessList *ProfileQt::GetSharedCorsOriginAccessList()
-{
- return m_sharedCorsOriginAccessList.get();
-}
-
#if QT_CONFIG(webengine_spellchecker)
void ProfileQt::FailedToLoadDictionary(const std::string &language)
{
diff --git a/src/core/profile_qt.h b/src/core/profile_qt.h
index 8ad1922d..61453e42 100644
--- a/src/core/profile_qt.h
+++ b/src/core/profile_qt.h
@@ -89,13 +89,6 @@ public:
content::BrowsingDataRemoverDelegate *GetBrowsingDataRemoverDelegate() override;
content::ClientHintsControllerDelegate *GetClientHintsControllerDelegate() override;
content::StorageNotificationService *GetStorageNotificationService() override;
- void SetCorsOriginAccessListForOrigin(TargetBrowserContexts target_mode,
- const url::Origin &source_origin,
- std::vector<network::mojom::CorsOriginPatternPtr> allow_patterns,
- std::vector<network::mojom::CorsOriginPatternPtr> block_patterns,
- base::OnceClosure closure) override;
-
- content::SharedCorsOriginAccessList *GetSharedCorsOriginAccessList() override;
std::string GetMediaDeviceIDSalt() override;
// Profile implementation:
@@ -127,7 +120,6 @@ private:
std::unique_ptr<BrowsingDataRemoverDelegateQt> m_removerDelegate;
std::unique_ptr<PermissionManagerQt> m_permissionManager;
std::unique_ptr<SSLHostStateDelegateQt> m_sslHostStateDelegate;
- scoped_refptr<content::SharedCorsOriginAccessList> m_sharedCorsOriginAccessList;
std::unique_ptr<ProfileIODataQt> m_profileIOData;
std::unique_ptr<content::PlatformNotificationService> m_platformNotificationService;
ProfileAdapter *m_profileAdapter;
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 9d5744cb..f2de01d6 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -56,7 +56,6 @@
#include "components/viz/common/surfaces/frame_sink_id_allocator.h"
#include "components/viz/host/host_frame_sink_manager.h"
#include "content/browser/compositor/image_transport_factory.h"
-#include "content/browser/renderer_host/display_util.h"
#include "content/browser/renderer_host/frame_tree.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/cursor_manager.h"
@@ -71,6 +70,7 @@
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/cursor/cursor.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/display/display_util.h"
#include "ui/events/blink/blink_event_util.h"
#include "ui/events/event.h"
#include "ui/events/gesture_detection/gesture_configuration.h"
@@ -129,13 +129,13 @@ static inline ui::GestureProvider::Config QtGestureProviderConfig() {
extern display::Display toDisplayDisplay(int id, const QScreen *screen);
-static blink::ScreenInfo screenInfoFromQScreen(QScreen *screen)
+static display::ScreenInfo screenInfoFromQScreen(QScreen *screen)
{
- blink::ScreenInfo r;
+ display::ScreenInfo r;
if (!screen)
screen = qApp->primaryScreen();
if (screen)
- content::DisplayUtil::DisplayToScreenInfo(&r, toDisplayDisplay(0, screen));
+ display::DisplayUtil::DisplayToScreenInfo(&r, toDisplayDisplay(0, screen));
else
r.device_scale_factor = qGuiApp->devicePixelRatio();
return r;
@@ -597,6 +597,11 @@ void RenderWidgetHostViewQt::DisplayCursor(const content::WebCursor &webCursor)
if (updateCursorFromResource(cursorInfo.type()))
return;
break;
+ case ui::mojom::CursorType::kEastWestNoResize:
+ case ui::mojom::CursorType::kNorthEastSouthWestNoResize:
+ case ui::mojom::CursorType::kNorthSouthNoResize:
+ case ui::mojom::CursorType::kNorthWestSouthEastNoResize:
+ // Use forbidden cursor matching webcursor_mac.mm and win_cursor_factory.cc
case ui::mojom::CursorType::kNoDrop:
case ui::mojom::CursorType::kNotAllowed:
shape = Qt::ForbiddenCursor;
@@ -664,18 +669,18 @@ void RenderWidgetHostViewQt::Destroy()
delete this;
}
-void RenderWidgetHostViewQt::SetTooltipText(const base::string16 &tooltip_text)
+void RenderWidgetHostViewQt::UpdateTooltipUnderCursor(const std::u16string &tooltip_text)
{
- DisplayTooltipText(tooltip_text);
+ UpdateTooltip(tooltip_text);
}
-void RenderWidgetHostViewQt::DisplayTooltipText(const base::string16 &tooltip_text)
+void RenderWidgetHostViewQt::UpdateTooltip(const std::u16string &tooltip_text)
{
if (host()->delegate() && m_adapterClient)
m_adapterClient->setToolTip(toQt(tooltip_text));
}
-void RenderWidgetHostViewQt::GetScreenInfo(blink::ScreenInfo *results)
+void RenderWidgetHostViewQt::GetScreenInfo(display::ScreenInfo *results)
{
*results = m_screenInfo;
}
@@ -748,15 +753,22 @@ void RenderWidgetHostViewQt::OnTextSelectionChanged(content::TextInputManager *t
Q_UNUSED(text_input_manager);
Q_UNUSED(updated_view);
- const content::TextInputManager::TextSelection *selection = GetTextInputManager()->GetTextSelection(updated_view);
- if (!selection)
- return;
+ // We obtain the TextSelection from focused RWH which is obtained from the
+ // frame tree.
+ content::RenderWidgetHostViewBase *focused_view =
+ GetFocusedWidget() ? GetFocusedWidget()->GetView() : nullptr;
+
+ if (!focused_view)
+ return;
#if defined(USE_OZONE)
- if (!selection->selected_text().empty() && selection->user_initiated()) {
- // Set the CLIPBOARD_TYPE_SELECTION to the ui::Clipboard.
- ui::ScopedClipboardWriter clipboard_writer(ui::ClipboardBuffer::kSelection);
- clipboard_writer.WriteText(selection->selected_text());
+ if (ui::Clipboard::IsSupportedClipboardBuffer(ui::ClipboardBuffer::kSelection)) {
+ const content::TextInputManager::TextSelection *selection = GetTextInputManager()->GetTextSelection(focused_view);
+ if (selection->selected_text().length() && selection->user_initiated()) {
+ // Set the ClipboardBuffer::kSelection to the ui::Clipboard.
+ ui::ScopedClipboardWriter clipboard_writer(ui::ClipboardBuffer::kSelection);
+ clipboard_writer.WriteText(selection->selected_text());
+ }
}
#endif // defined(USE_OZONE)
@@ -877,7 +889,7 @@ bool RenderWidgetHostViewQt::isPopup() const
bool RenderWidgetHostViewQt::updateScreenInfo()
{
- blink::ScreenInfo oldScreenInfo = m_screenInfo;
+ display::ScreenInfo oldScreenInfo = m_screenInfo;
QScreen *screen = m_delegate->window() ? m_delegate->window()->screen() : nullptr;
m_screenInfo = screenInfoFromQScreen(screen);
@@ -988,9 +1000,8 @@ void RenderWidgetHostViewQt::TakeFallbackContentFrom(content::RenderWidgetHostVi
{
DCHECK(!static_cast<RenderWidgetHostViewBase*>(view)->IsRenderWidgetHostViewChildFrame());
RenderWidgetHostViewQt *viewQt = static_cast<RenderWidgetHostViewQt *>(view);
- base::Optional<SkColor> color = viewQt->GetBackgroundColor();
- if (color)
- SetBackgroundColor(*color);
+ CopyBackgroundColorIfPresentFrom(*viewQt);
+
m_delegatedFrameHost->TakeFallbackContentFrom(viewQt->m_delegatedFrameHost.get());
host()->GetContentRenderingTimeoutFrom(viewQt->host());
}
@@ -1029,7 +1040,7 @@ void RenderWidgetHostViewQt::OnRenderFrameMetadataChangedAfterActivation(base::T
m_adapterClient->updateContentsSize(toQt(m_lastContentsSize));
}
-void RenderWidgetHostViewQt::synchronizeVisualProperties(const base::Optional<viz::LocalSurfaceId> &childSurfaceId)
+void RenderWidgetHostViewQt::synchronizeVisualProperties(const absl::optional<viz::LocalSurfaceId> &childSurfaceId)
{
if (childSurfaceId)
m_dfhLocalSurfaceIdAllocator.UpdateFromChild(*childSurfaceId);
@@ -1062,9 +1073,9 @@ ui::Compositor *RenderWidgetHostViewQt::GetCompositor()
return m_uiCompositor.get();
}
-base::Optional<content::DisplayFeature> RenderWidgetHostViewQt::GetDisplayFeature()
+absl::optional<content::DisplayFeature> RenderWidgetHostViewQt::GetDisplayFeature()
{
- return base::nullopt;
+ return absl::nullopt;
}
void RenderWidgetHostViewQt::SetDisplayFeatureForTesting(const content::DisplayFeature *)
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index 15ef4fa2..d3062ee7 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -125,8 +125,8 @@ public:
content::RenderWidgetHostViewBase *target_view,
gfx::PointF *transformed_point) override;
void Destroy() override;
- void SetTooltipText(const base::string16 &tooltip_text) override;
- void DisplayTooltipText(const base::string16& tooltip_text) override;
+ void UpdateTooltipUnderCursor(const std::u16string &tooltip_text) override;
+ void UpdateTooltip(const std::u16string& tooltip_text) override;
void WheelEventAck(const blink::WebMouseWheelEvent &event,
blink::mojom::InputEventResultState ack_result) override;
void GestureEventAck(const blink::WebGestureEvent &event,
@@ -136,7 +136,7 @@ public:
void OnDidUpdateVisualPropertiesComplete(const cc::RenderFrameMetadata &metadata);
// Overridden from RenderWidgetHostViewBase:
- void GetScreenInfo(blink::ScreenInfo *results) override;
+ void GetScreenInfo(display::ScreenInfo *screen_info) override;
gfx::Rect GetBoundsInRootWindow() override;
void ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch,
blink::mojom::InputEventResultState ack_result) override;
@@ -153,9 +153,15 @@ public:
void DidStopFlinging() override;
std::unique_ptr<content::SyntheticGestureTarget> CreateSyntheticGestureTarget() override;
ui::Compositor *GetCompositor() override;
- base::Optional<content::DisplayFeature> GetDisplayFeature() override;
+ absl::optional<content::DisplayFeature> GetDisplayFeature() override;
void SetDisplayFeatureForTesting(const content::DisplayFeature*) override;
#if defined(OS_MAC)
+ void ShowSharePicker(
+ const std::string &title,
+ const std::string &text,
+ const std::string &url,
+ const std::vector<std::string> &file_paths,
+ blink::mojom::ShareService::ShareCallback callback) override { QT_NOT_YET_IMPLEMENTED }
void SetActive(bool active) override { QT_NOT_YET_IMPLEMENTED }
void SpeakSelection() override { QT_NOT_YET_IMPLEMENTED }
void ShowDefinitionForSelection() override { QT_NOT_YET_IMPLEMENTED }
@@ -198,7 +204,7 @@ public:
ui::TextInputType getTextInputType() const;
void synchronizeVisualProperties(
- const base::Optional<viz::LocalSurfaceId> &childSurfaceId);
+ const absl::optional<viz::LocalSurfaceId> &childSurfaceId);
private:
friend class DelegatedFrameHostClientQt;
@@ -230,7 +236,7 @@ private:
DelegatedFrameHostClientQt m_delegatedFrameHostClient { this };
// VIZ
- blink::ScreenInfo m_screenInfo;
+ display::ScreenInfo m_screenInfo;
std::unique_ptr<content::DelegatedFrameHost> m_delegatedFrameHost;
std::unique_ptr<ui::Layer> m_rootLayer;
std::unique_ptr<ui::Compositor> m_uiCompositor;
diff --git a/src/core/render_widget_host_view_qt_delegate_client.cpp b/src/core/render_widget_host_view_qt_delegate_client.cpp
index 01691fd8..1af0b782 100644
--- a/src/core/render_widget_host_view_qt_delegate_client.cpp
+++ b/src/core/render_widget_host_view_qt_delegate_client.cpp
@@ -235,7 +235,7 @@ void RenderWidgetHostViewQtDelegateClient::visualPropertiesChanged()
m_rwhv->host()->SendScreenRects();
if (m_viewRectInDips.size() != oldViewRect.size() || screenInfoChanged)
- m_rwhv->synchronizeVisualProperties(base::nullopt);
+ m_rwhv->synchronizeVisualProperties(absl::nullopt);
}
bool RenderWidgetHostViewQtDelegateClient::forwardEvent(QEvent *event)
@@ -717,7 +717,8 @@ void RenderWidgetHostViewQtDelegateClient::handleGestureEvent(QNativeGestureEven
{
const Qt::NativeGestureType type = event->gestureType();
// These are the only supported gestures by Chromium so far.
- if (type == Qt::ZoomNativeGesture || type == Qt::SmartZoomNativeGesture) {
+ if (type == Qt::ZoomNativeGesture || type == Qt::SmartZoomNativeGesture
+ || type == Qt::BeginNativeGesture || type == Qt::EndNativeGesture) {
auto *hostDelegate = m_rwhv->host()->delegate();
if (hostDelegate && hostDelegate->GetInputEventRouter()) {
auto webEvent = WebEventFactory::toWebGestureEvent(event);
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index f52c17dc..474c9e76 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -262,7 +262,8 @@ void ContentRendererClientQt::PrepareErrorPage(content::RenderFrame *renderFrame
{
GetNavigationErrorStringsInternal(
renderFrame, httpMethod,
- error_page::Error::NetError((GURL)web_error.url(), web_error.reason(), net::ResolveErrorInfo(), web_error.has_copy_in_cache()),
+ error_page::Error::NetError((GURL)web_error.url(), web_error.reason(), web_error.extended_reason(),
+ net::ResolveErrorInfo(), web_error.has_copy_in_cache()),
errorHtml);
}
@@ -297,7 +298,7 @@ void ContentRendererClientQt::GetNavigationErrorStringsInternal(content::RenderF
error_page::LocalizedError::GetPageState(
error.reason(), error.domain(), error.url(), isPost, false,
error.stale_copy_in_cache(), false,
- RenderConfiguration::is_incognito_process(), false, false, false, locale);
+ RenderConfiguration::is_incognito_process(), false, false, false, locale, false);
resourceId = IDR_NET_ERROR_HTML;
@@ -489,35 +490,69 @@ static void AddExternalClearKey(std::vector<std::unique_ptr<media::KeySystemProp
}
#if BUILDFLAG(ENABLE_WIDEVINE)
-static media::SupportedCodecs GetSupportedCodecs(const std::vector<media::VideoCodec> &supported_video_codecs,
+media::SupportedCodecs GetVP9Codecs(const std::vector<media::VideoCodecProfile> &profiles)
+{
+ if (profiles.empty()) {
+ // If no profiles are specified, then all are supported.
+ return media::EME_CODEC_VP9_PROFILE0 | media::EME_CODEC_VP9_PROFILE2;
+ }
+
+ media::SupportedCodecs supported_vp9_codecs = media::EME_CODEC_NONE;
+ for (const auto& profile : profiles) {
+ switch (profile) {
+ case media::VP9PROFILE_PROFILE0:
+ supported_vp9_codecs |= media::EME_CODEC_VP9_PROFILE0;
+ break;
+ case media::VP9PROFILE_PROFILE2:
+ supported_vp9_codecs |= media::EME_CODEC_VP9_PROFILE2;
+ break;
+ default:
+ DVLOG(1) << "Unexpected " << GetCodecName(media::VideoCodec::kCodecVP9)
+ << " profile: " << GetProfileName(profile);
+ break;
+ }
+ }
+
+ return supported_vp9_codecs;
+}
+
+static media::SupportedCodecs GetSupportedCodecs(const media::CdmCapability& capability,
bool is_secure)
{
media::SupportedCodecs supported_codecs = media::EME_CODEC_NONE;
- // Audio codecs are always supported because the CDM only does decrypt-only
- // for audio. The only exception is when |is_secure| is true and there's no
- // secure video decoder available, which is a signal that secure hardware
- // decryption is not available either.
- // TODO(sandersd): Distinguish these from those that are directly supported,
- // as those may offer a higher level of protection.
- if (!supported_video_codecs.empty() || !is_secure) {
- supported_codecs |= media::EME_CODEC_OPUS;
- supported_codecs |= media::EME_CODEC_VORBIS;
- supported_codecs |= media::EME_CODEC_FLAC;
+ for (const auto& codec : capability.audio_codecs) {
+ switch (codec) {
+ case media::AudioCodec::kCodecOpus:
+ supported_codecs |= media::EME_CODEC_OPUS;
+ break;
+ case media::AudioCodec::kCodecVorbis:
+ supported_codecs |= media::EME_CODEC_VORBIS;
+ break;
+ case media::AudioCodec::kCodecFLAC:
+ supported_codecs |= media::EME_CODEC_FLAC;
+ break;
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
- supported_codecs |= media::EME_CODEC_AAC;
-#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
+ case media::AudioCodec::kCodecAAC:
+ supported_codecs |= media::EME_CODEC_AAC;
+ break;
+#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
+ default:
+ DVLOG(1) << "Unexpected supported codec: " << GetCodecName(codec);
+ break;
+ }
}
- // Video codecs are determined by what was registered for the CDM.
- for (const auto &codec : supported_video_codecs) {
- switch (codec) {
+ for (const auto &codec : capability.video_codecs) {
+ switch (codec.first) {
case media::VideoCodec::kCodecVP8:
supported_codecs |= media::EME_CODEC_VP8;
break;
case media::VideoCodec::kCodecVP9:
- supported_codecs |= media::EME_CODEC_VP9_PROFILE0;
- supported_codecs |= media::EME_CODEC_VP9_PROFILE2;
+ supported_codecs |= GetVP9Codecs(codec.second);
+ break;
+ case media::VideoCodec::kCodecAV1:
+ supported_codecs |= media::EME_CODEC_AV1;
break;
#if BUILDFLAG(USE_PROPRIETARY_CODECS)
case media::VideoCodec::kCodecH264:
@@ -525,7 +560,7 @@ static media::SupportedCodecs GetSupportedCodecs(const std::vector<media::VideoC
break;
#endif // BUILDFLAG(USE_PROPRIETARY_CODECS)
default:
- DVLOG(1) << "Unexpected supported codec: " << GetCodecName(codec);
+ DVLOG(1) << "Unexpected supported codec: " << GetCodecName(codec.first);
break;
}
}
@@ -542,11 +577,27 @@ static void AddWidevine(std::vector<std::unique_ptr<media::KeySystemProperties>>
}
// Codecs and encryption schemes.
- auto codecs = GetSupportedCodecs(capability->video_codecs, /*is_secure=*/false);
- const auto &encryption_schemes = capability->encryption_schemes;
- auto hw_secure_codecs = GetSupportedCodecs(capability->hw_secure_video_codecs,
- /*is_secure=*/true);
- const auto &hw_secure_encryption_schemes = capability->hw_secure_encryption_schemes;
+ media::SupportedCodecs codecs = media::EME_CODEC_NONE;
+ media::SupportedCodecs hw_secure_codecs = media::EME_CODEC_NONE;
+ base::flat_set<media::EncryptionScheme> encryption_schemes;
+ base::flat_set<media::EncryptionScheme> hw_secure_encryption_schemes;
+ if (capability->sw_secure_capability) {
+ codecs = GetSupportedCodecs(capability->sw_secure_capability.value(), /*is_secure=*/false);
+ encryption_schemes = capability->sw_secure_capability->encryption_schemes;
+ if (!base::Contains(capability->sw_secure_capability->session_types, media::CdmSessionType::kTemporary)) {
+ DVLOG(1) << "Temporary sessions must be supported.";
+ return;
+ }
+ }
+
+ if (capability->hw_secure_capability) {
+ hw_secure_codecs = GetSupportedCodecs(capability->hw_secure_capability.value(), /*is_secure=*/true);
+ hw_secure_encryption_schemes = capability->hw_secure_capability->encryption_schemes;
+ if (!base::Contains(capability->hw_secure_capability->session_types, media::CdmSessionType::kTemporary)) {
+ DVLOG(1) << "Temporary sessions must be supported.";
+ return;
+ }
+ }
// Robustness.
using Robustness = cdm::WidevineKeySystemProperties::Robustness;
@@ -558,15 +609,7 @@ static void AddWidevine(std::vector<std::unique_ptr<media::KeySystemProperties>>
max_video_robustness = Robustness::HW_SECURE_ALL;
}
- // Session types.
- bool cdm_supports_temporary_session = base::Contains(capability->session_types, media::CdmSessionType::kTemporary);
- if (!cdm_supports_temporary_session) {
- DVLOG(1) << "Temporary session must be supported.";
- return;
- }
-
auto persistent_license_support = media::EmeSessionTypeSupport::NOT_SUPPORTED;
- auto persistent_usage_record_support = media::EmeSessionTypeSupport::NOT_SUPPORTED;
// Others.
auto persistent_state_support = media::EmeFeatureSupport::REQUESTABLE;
@@ -575,8 +618,8 @@ static void AddWidevine(std::vector<std::unique_ptr<media::KeySystemProperties>>
concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties(
codecs, encryption_schemes, hw_secure_codecs,
hw_secure_encryption_schemes, max_audio_robustness, max_video_robustness,
- persistent_license_support, persistent_usage_record_support,
- persistent_state_support, distinctive_identifier_support));
+ persistent_license_support, persistent_state_support,
+ distinctive_identifier_support));
}
#endif // BUILDFLAG(ENABLE_WIDEVINE)
#endif // BUILDFLAG(ENABLE_LIBRARY_CDMS)
diff --git a/src/core/renderer/extensions/extensions_renderer_client_qt.cpp b/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
index b1998e02..4c214c45 100644
--- a/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
+++ b/src/core/renderer/extensions/extensions_renderer_client_qt.cpp
@@ -51,6 +51,7 @@
#include "base/command_line.h"
#include "base/lazy_instance.h"
+#include "base/stl_util.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "content/public/renderer/render_frame.h"
diff --git a/src/core/renderer/extensions/resource_request_policy_qt.cpp b/src/core/renderer/extensions/resource_request_policy_qt.cpp
index 70e97819..ad66ec4a 100644
--- a/src/core/renderer/extensions/resource_request_policy_qt.cpp
+++ b/src/core/renderer/extensions/resource_request_policy_qt.cpp
@@ -86,7 +86,7 @@ void ResourceRequestPolicyQt::OnExtensionUnloaded(const ExtensionId &extension_i
bool ResourceRequestPolicyQt::CanRequestResource(const GURL &resource_url,
blink::WebLocalFrame *frame,
ui::PageTransition transition_type,
- const base::Optional<url::Origin>& initiator_origin)
+ const absl::optional<url::Origin>& initiator_origin)
{
CHECK(resource_url.SchemeIs(kExtensionScheme));
diff --git a/src/core/renderer/extensions/resource_request_policy_qt.h b/src/core/renderer/extensions/resource_request_policy_qt.h
index 567eefae..f3c718c5 100644
--- a/src/core/renderer/extensions/resource_request_policy_qt.h
+++ b/src/core/renderer/extensions/resource_request_policy_qt.h
@@ -43,8 +43,8 @@
#include <set>
#include "base/macros.h"
-#include "base/optional.h"
#include "extensions/common/extension_id.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "ui/base/page_transition_types.h"
#include "url/origin.h"
@@ -76,7 +76,7 @@ public:
bool CanRequestResource(const GURL &resource_url,
blink::WebLocalFrame *frame,
ui::PageTransition transition_type,
- const base::Optional<url::Origin> &initiator_origin);
+ const absl::optional<url::Origin> &initiator_origin);
private:
Dispatcher *m_dispatcher;
diff --git a/src/core/renderer/plugins/loadable_plugin_placeholder_qt.cpp b/src/core/renderer/plugins/loadable_plugin_placeholder_qt.cpp
index f3604d1e..15f3e9ef 100644
--- a/src/core/renderer/plugins/loadable_plugin_placeholder_qt.cpp
+++ b/src/core/renderer/plugins/loadable_plugin_placeholder_qt.cpp
@@ -61,7 +61,7 @@ gin::WrapperInfo LoadablePluginPlaceholderQt::kWrapperInfo = {gin::kEmbedderNati
LoadablePluginPlaceholderQt::LoadablePluginPlaceholderQt(content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
const std::string& html_data,
- const base::string16& title)
+ const std::u16string& title)
: plugins::LoadablePluginPlaceholder(render_frame, params, html_data)
{}
diff --git a/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h b/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h
index 4c3b7ec8..f612cb8e 100644
--- a/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h
+++ b/src/core/renderer/plugins/loadable_plugin_placeholder_qt.h
@@ -63,7 +63,7 @@ private:
LoadablePluginPlaceholderQt(content::RenderFrame* render_frame,
const blink::WebPluginParams& params,
const std::string& html_data,
- const base::string16& title);
+ const std::u16string& title);
~LoadablePluginPlaceholderQt() override;
// content::LoadablePluginPlaceholder overrides.
diff --git a/src/core/renderer/render_configuration.cpp b/src/core/renderer/render_configuration.cpp
index ef9da7af..7870e80d 100644
--- a/src/core/renderer/render_configuration.cpp
+++ b/src/core/renderer/render_configuration.cpp
@@ -54,8 +54,8 @@ void RenderConfiguration::RegisterMojoInterfaces(
blink::AssociatedInterfaceRegistry *associated_interfaces)
{
associated_interfaces->AddInterface(
- base::Bind(&RenderConfiguration::OnRendererConfigurationAssociatedRequest,
- base::Unretained(this)));
+ base::BindRepeating(&RenderConfiguration::OnRendererConfigurationAssociatedRequest,
+ base::Unretained(this)));
}
void RenderConfiguration::UnregisterMojoInterfaces(
diff --git a/src/core/renderer/user_resource_controller.cpp b/src/core/renderer/user_resource_controller.cpp
index 029d02c8..daefb1f1 100644
--- a/src/core/renderer/user_resource_controller.cpp
+++ b/src/core/renderer/user_resource_controller.cpp
@@ -207,7 +207,7 @@ void UserResourceController::runScripts(QtWebEngineCore::UserScriptData::Injecti
continue;
blink::WebScriptSource source(blink::WebString::FromUTF8(script.source), script.url);
if (script.worldId)
- frame->ExecuteScriptInIsolatedWorld(script.worldId, source);
+ frame->ExecuteScriptInIsolatedWorld(script.worldId, source, blink::BackForwardCacheAware::kAllow); // FIXME, check
else
frame->ExecuteScript(source);
}
@@ -390,7 +390,7 @@ void UserResourceController::RegisterMojoInterfaces(
blink::AssociatedInterfaceRegistry *associated_interfaces)
{
associated_interfaces->AddInterface(
- base::Bind(&UserResourceController::BindReceiver, base::Unretained(this)));
+ base::BindRepeating(&UserResourceController::BindReceiver, base::Unretained(this)));
}
void UserResourceController::UnregisterMojoInterfaces(
diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp
index fff3eb70..ef3fbeaa 100644
--- a/src/core/renderer/web_channel_ipc_transport.cpp
+++ b/src/core/renderer/web_channel_ipc_transport.cpp
@@ -83,28 +83,31 @@ void WebChannelTransport::Install(blink::WebLocalFrame *frame, uint worldId)
{
v8::Isolate *isolate = blink::MainThreadIsolate();
v8::HandleScope handleScope(isolate);
+ v8::MicrotasksScope microtasks_scope(
+ isolate, v8::MicrotasksScope::kDoNotRunMicrotasks);
v8::Local<v8::Context> context;
if (worldId == 0)
context = frame->MainWorldScriptContext();
else
context = frame->IsolatedWorldScriptContext(worldId);
+ if (context.IsEmpty())
+ return;
v8::Context::Scope contextScope(context);
gin::Handle<WebChannelTransport> transport = gin::CreateHandle(isolate, new WebChannelTransport);
+ if (transport.IsEmpty())
+ return;
v8::Local<v8::Object> global = context->Global();
- v8::MaybeLocal<v8::Value> qtObjectValue = global->Get(context, gin::StringToV8(isolate, "qt"));
+ v8::Local<v8::Value> qtObjectValue;
v8::Local<v8::Object> qtObject;
- if (qtObjectValue.IsEmpty() || !qtObjectValue.ToLocalChecked()->IsObject()) {
+ if (!global->Get(context, gin::StringToV8(isolate, "qt")).ToLocal(&qtObjectValue) || !qtObjectValue->IsObject()) {
qtObject = v8::Object::New(isolate);
- auto whocares = global->Set(context, gin::StringToV8(isolate, "qt"), qtObject);
- // FIXME: Perhaps error out, but the return value is V8 internal...
- Q_UNUSED(whocares);
+ global->Set(context, gin::StringToV8(isolate, "qt"), qtObject).Check();
} else {
- qtObject = v8::Local<v8::Object>::Cast(qtObjectValue.ToLocalChecked());
+ qtObject = v8::Local<v8::Object>::Cast(qtObjectValue);
}
- auto whocares = qtObject->Set(context, gin::StringToV8(isolate, "webChannelTransport"), transport.ToV8());
- Q_UNUSED(whocares);
+ qtObject->Set(context, gin::StringToV8(isolate, "webChannelTransport"), transport.ToV8()).Check();
}
void WebChannelTransport::Uninstall(blink::WebLocalFrame *frame, uint worldId)
@@ -116,16 +119,16 @@ void WebChannelTransport::Uninstall(blink::WebLocalFrame *frame, uint worldId)
context = frame->MainWorldScriptContext();
else
context = frame->IsolatedWorldScriptContext(worldId);
+ if (context.IsEmpty())
+ return;
v8::Context::Scope contextScope(context);
v8::Local<v8::Object> global(context->Global());
- v8::MaybeLocal<v8::Value> qtObjectValue = global->Get(context, gin::StringToV8(isolate, "qt"));
- if (qtObjectValue.IsEmpty() || !qtObjectValue.ToLocalChecked()->IsObject())
+ v8::Local<v8::Value> qtObjectValue;
+ if (!global->Get(context, gin::StringToV8(isolate, "qt")).ToLocal(&qtObjectValue) || !qtObjectValue->IsObject())
return;
- v8::Local<v8::Object> qtObject = v8::Local<v8::Object>::Cast(qtObjectValue.ToLocalChecked());
- // FIXME: We can't do anything about a failure, so why the .. is it nodiscard?
- auto whocares = qtObject->Delete(context, gin::StringToV8(isolate, "webChannelTransport"));
- Q_UNUSED(whocares);
+ v8::Local<v8::Object> qtObject = v8::Local<v8::Object>::Cast(qtObjectValue);
+ qtObject->Delete(context, gin::StringToV8(isolate, "webChannelTransport")).Check();
}
void WebChannelTransport::NativeQtSendMessage(gin::Arguments *args)
@@ -229,17 +232,18 @@ void WebChannelIPCTransport::DispatchWebChannelMessage(const std::vector<uint8_t
v8::Context::Scope contextScope(context);
v8::Local<v8::Object> global(context->Global());
- v8::MaybeLocal<v8::Value> qtObjectValue(global->Get(context, gin::StringToV8(isolate, "qt")));
- if (qtObjectValue.IsEmpty() || !qtObjectValue.ToLocalChecked()->IsObject())
+ v8::Local<v8::Value> qtObjectValue;
+ if (!global->Get(context, gin::StringToV8(isolate, "qt")).ToLocal(&qtObjectValue) || !qtObjectValue->IsObject())
return;
- v8::Local<v8::Object> qtObject = v8::Local<v8::Object>::Cast(qtObjectValue.ToLocalChecked());
- v8::MaybeLocal<v8::Value> webChannelObjectValue(
- qtObject->Get(context, gin::StringToV8(isolate, "webChannelTransport")));
- if (webChannelObjectValue.IsEmpty() || !webChannelObjectValue.ToLocalChecked()->IsObject())
+ v8::Local<v8::Object> qtObject = v8::Local<v8::Object>::Cast(qtObjectValue);
+ v8::Local<v8::Value> webChannelObjectValue;
+ if (!qtObject->Get(context, gin::StringToV8(isolate, "webChannelTransport")).ToLocal(&webChannelObjectValue)
+ || !webChannelObjectValue->IsObject())
return;
- v8::Local<v8::Object> webChannelObject = v8::Local<v8::Object>::Cast(webChannelObjectValue.ToLocalChecked());
- v8::MaybeLocal<v8::Value> callbackValue(webChannelObject->Get(context, gin::StringToV8(isolate, "onmessage")));
- if (callbackValue.IsEmpty() || !callbackValue.ToLocalChecked()->IsFunction()) {
+ v8::Local<v8::Object> webChannelObject = v8::Local<v8::Object>::Cast(webChannelObjectValue);
+ v8::Local<v8::Value> callbackValue;
+ if (!webChannelObject->Get(context, gin::StringToV8(isolate, "onmessage")).ToLocal(&callbackValue)
+ || !callbackValue->IsFunction()) {
LOG(WARNING) << "onmessage is not a callable property of qt.webChannelTransport. Some things might not work as "
"expected.";
return;
@@ -254,26 +258,26 @@ void WebChannelIPCTransport::DispatchWebChannelMessage(const std::vector<uint8_t
v8::PropertyAttribute(v8::ReadOnly | v8::DontDelete));
DCHECK(!wasSet.IsNothing() && wasSet.FromJust());
- v8::Local<v8::Function> callback = v8::Local<v8::Function>::Cast(callbackValue.ToLocalChecked());
+ v8::Local<v8::Function> callback = v8::Local<v8::Function>::Cast(callbackValue);
v8::Local<v8::Value> argv[] = { messageObject };
frame->CallFunctionEvenIfScriptDisabled(callback, webChannelObject, 1, argv);
}
-void WebChannelIPCTransport::WillReleaseScriptContext(v8::Local<v8::Context> context, int worldId)
+void WebChannelIPCTransport::DidCreateScriptContext(v8::Local<v8::Context> context, int32_t worldId)
{
- if (static_cast<uint>(worldId) == m_worldId)
- m_canUseContext = false;
-}
-
-void WebChannelIPCTransport::DidClearWindowObject()
-{
- if (!m_canUseContext) {
+ if (static_cast<uint>(worldId) == m_worldId && !m_canUseContext) {
m_canUseContext = true;
if (m_worldInitialized)
WebChannelTransport::Install(render_frame()->GetWebFrame(), m_worldId);
}
}
+void WebChannelIPCTransport::WillReleaseScriptContext(v8::Local<v8::Context> context, int worldId)
+{
+ if (static_cast<uint>(worldId) == m_worldId)
+ m_canUseContext = false;
+}
+
void WebChannelIPCTransport::OnDestruct()
{
delete this;
diff --git a/src/core/renderer/web_channel_ipc_transport.h b/src/core/renderer/web_channel_ipc_transport.h
index 276167a6..f048a26d 100644
--- a/src/core/renderer/web_channel_ipc_transport.h
+++ b/src/core/renderer/web_channel_ipc_transport.h
@@ -64,8 +64,8 @@ private:
void DispatchWebChannelMessage(const std::vector<uint8_t> &json, uint32_t worldId) override;
// RenderFrameObserver
+ void DidCreateScriptContext(v8::Local<v8::Context> context, int32_t worldId) override;
void WillReleaseScriptContext(v8::Local<v8::Context> context, int worldId) override;
- void DidClearWindowObject() override;
void OnDestruct() override;
void BindReceiver(mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportRender> receiver);
diff --git a/src/core/renderer/web_engine_page_render_frame.cpp b/src/core/renderer/web_engine_page_render_frame.cpp
index e230e7fa..524a8d36 100644
--- a/src/core/renderer/web_engine_page_render_frame.cpp
+++ b/src/core/renderer/web_engine_page_render_frame.cpp
@@ -53,7 +53,7 @@
namespace QtWebEngineCore {
WebEnginePageRenderFrame::WebEnginePageRenderFrame(content::RenderFrame *render_frame)
- : content::RenderFrameObserver(render_frame), m_binding(this)
+ : content::RenderFrameObserver(render_frame), m_binding(this), m_ready(false)
{
render_frame->GetAssociatedInterfaceRegistry()->AddInterface(
base::BindRepeating(&WebEnginePageRenderFrame::BindReceiver, base::Unretained(this)));
@@ -68,22 +68,30 @@ void WebEnginePageRenderFrame::BindReceiver(
void WebEnginePageRenderFrame::FetchDocumentMarkup(uint64_t requestId,
FetchDocumentMarkupCallback callback)
{
- blink::WebString markup = blink::WebFrameContentDumper::DumpAsMarkup(
- render_frame()->GetWebFrame()) ;
+ blink::WebLocalFrame *frame = render_frame()->GetWebFrame();
+ blink::WebString markup;
+ if (m_ready)
+ markup = blink::WebFrameContentDumper::DumpAsMarkup(frame);
+ else
+ markup = blink::WebString::FromUTF8("<html><head></head><body></body></html>");
std::move(callback).Run(requestId, markup.Utf8());
}
void WebEnginePageRenderFrame::FetchDocumentInnerText(uint64_t requestId,
FetchDocumentInnerTextCallback callback)
{
- blink::WebString text = blink::WebFrameContentDumper::DumpFrameTreeAsText(
- render_frame()->GetWebFrame(), std::numeric_limits<std::size_t>::max());
+ blink::WebLocalFrame *frame = render_frame()->GetWebFrame();
+ blink::WebString text;
+ if (m_ready) {
+ text = blink::WebFrameContentDumper::DumpFrameTreeAsText(
+ frame, std::numeric_limits<int32_t>::max());
+ }
std::move(callback).Run(requestId, text.Utf8());
}
void WebEnginePageRenderFrame::SetBackgroundColor(uint32_t color)
{
- render_frame()->GetWebFrame()->View()->SetBaseBackgroundColorOverride(color);
+ render_frame()->GetWebFrame()->View()->SetBaseBackgroundColorOverrideForInspector(color);
}
void WebEnginePageRenderFrame::OnDestruct()
@@ -91,4 +99,8 @@ void WebEnginePageRenderFrame::OnDestruct()
delete this;
}
+void WebEnginePageRenderFrame::DidFinishLoad()
+{
+ m_ready = true;
+}
}
diff --git a/src/core/renderer/web_engine_page_render_frame.h b/src/core/renderer/web_engine_page_render_frame.h
index 3fb4657c..b91c5cb5 100644
--- a/src/core/renderer/web_engine_page_render_frame.h
+++ b/src/core/renderer/web_engine_page_render_frame.h
@@ -63,12 +63,14 @@ private:
FetchDocumentInnerTextCallback callback) override;
void SetBackgroundColor(uint32_t color) override;
void OnDestruct() override;
+ void DidFinishLoad() override;
void
BindReceiver(mojo::PendingAssociatedReceiver<qtwebenginepage::mojom::WebEnginePageRenderFrame>
receiver);
private:
mojo::AssociatedReceiver<qtwebenginepage::mojom::WebEnginePageRenderFrame> m_binding;
+ bool m_ready;
};
} // namespace
diff --git a/src/core/renderer_host/web_channel_ipc_transport_host.cpp b/src/core/renderer_host/web_channel_ipc_transport_host.cpp
index 43c3347b..fbf4cb9d 100644
--- a/src/core/renderer_host/web_channel_ipc_transport_host.cpp
+++ b/src/core/renderer_host/web_channel_ipc_transport_host.cpp
@@ -60,15 +60,6 @@ inline QDebug operator<<(QDebug stream, content::RenderFrameHost *frame)
return stream << "frame " << frame->GetRoutingID() << " in process " << frame->GetProcess()->GetID();
}
-template<class T>
-inline QDebug operator<<(QDebug stream, const base::Optional<T> &opt)
-{
- if (opt)
- return stream << *opt;
- else
- return stream << "nullopt";
-}
-
WebChannelIPCTransportHost::WebChannelIPCTransportHost(content::WebContents *contents, uint worldId, QObject *parent)
: QWebChannelAbstractTransport(parent)
, content::WebContentsObserver(contents)
@@ -155,6 +146,14 @@ void WebChannelIPCTransportHost::RenderFrameDeleted(content::RenderFrameHost *rf
m_renderFrames.erase(rfh);
}
+void WebChannelIPCTransportHost::BindReceiver(
+ mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportHost> receiver,
+ content::RenderFrameHost *rfh)
+{
+ m_receiver.Bind(rfh, std::move(receiver));
+}
+
+
const mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender> &
WebChannelIPCTransportHost::GetWebChannelIPCTransportRemote(content::RenderFrameHost *rfh)
{
diff --git a/src/core/renderer_host/web_channel_ipc_transport_host.h b/src/core/renderer_host/web_channel_ipc_transport_host.h
index 79423866..846a4da3 100644
--- a/src/core/renderer_host/web_channel_ipc_transport_host.h
+++ b/src/core/renderer_host/web_channel_ipc_transport_host.h
@@ -42,8 +42,8 @@
#include "qtwebenginecoreglobal.h"
+#include "content/public/browser/render_frame_host_receiver_set.h"
#include "content/public/browser/web_contents_observer.h"
-#include "content/public/browser/web_contents_receiver_set.h"
#include "qtwebengine/browser/qtwebchannel.mojom.h"
#include <QWebChannelAbstractTransport>
@@ -68,6 +68,10 @@ public:
// QWebChannelAbstractTransport
void sendMessage(const QJsonObject &message) override;
+ void BindReceiver(
+ mojo::PendingAssociatedReceiver<qtwebchannel::mojom::WebChannelTransportHost> receiver,
+ content::RenderFrameHost *rfh);
+
private:
void setWorldId(content::RenderFrameHost *frame, uint32_t worldId);
void resetWorldId();
@@ -85,7 +89,7 @@ private:
// Empty only during construction/destruction. Synchronized to all the
// WebChannelIPCTransports/RenderFrames in the observed WebContents.
uint32_t m_worldId;
- content::WebContentsFrameReceiverSet<qtwebchannel::mojom::WebChannelTransportHost> m_receiver;
+ content::RenderFrameHostReceiverSet<qtwebchannel::mojom::WebChannelTransportHost> m_receiver;
std::map<content::RenderFrameHost *,
mojo::AssociatedRemote<qtwebchannel::mojom::WebChannelTransportRender>>
m_renderFrames;
diff --git a/src/core/select_file_dialog_factory_qt.cpp b/src/core/select_file_dialog_factory_qt.cpp
index baad07b2..8fe0a0be 100644
--- a/src/core/select_file_dialog_factory_qt.cpp
+++ b/src/core/select_file_dialog_factory_qt.cpp
@@ -98,7 +98,7 @@ public:
// ui::SelectFileDialog implementation:
bool IsRunning(gfx::NativeWindow) const override;
void ListenerDestroyed() override;
- void SelectFileImpl(Type type, const base::string16 &title, const base::FilePath &default_path,
+ void SelectFileImpl(Type type, const std::u16string &title, const base::FilePath &default_path,
const FileTypeInfo *file_types, int file_type_index,
const base::FilePath::StringType &default_extension,
gfx::NativeWindow owning_window, void *params) override;
@@ -139,7 +139,7 @@ extern FilePickerController *createFilePickerController(FilePickerController::Fi
const QStringList &acceptedMimeTypes,
QObject *parent = nullptr);
-void SelectFileDialogQt::SelectFileImpl(Type type, const base::string16 &title,
+void SelectFileDialogQt::SelectFileImpl(Type type, const std::u16string &title,
const base::FilePath &default_path,
const FileTypeInfo *file_types, int file_type_index,
const base::FilePath::StringType &default_extension,
diff --git a/src/core/tools/CMakeLists.txt b/src/core/tools/CMakeLists.txt
index e16bfb92..733c124e 100644
--- a/src/core/tools/CMakeLists.txt
+++ b/src/core/tools/CMakeLists.txt
@@ -10,7 +10,12 @@ if(QT_FEATURE_webengine_spellchecker)
INSTALL_DIR ${INSTALL_LIBEXECDIR}
TOOLS_TARGET WebEngineCore
SOURCES main.cpp
+ INCLUDE_DIRECTORIES
+ ../../3rdparty/chromium/third_party/abseil-cpp
)
+ if(COMMAND qt_internal_return_unless_building_tools)
+ qt_internal_return_unless_building_tools()
+ endif()
qt_skip_warnings_are_errors(${dict_target_name})
add_dependencies(${dict_target_name} WebEngineCore)
qt_internal_extend_target(${dict_target_name} CONDITION WIN32
@@ -19,5 +24,15 @@ if(QT_FEATURE_webengine_spellchecker)
qt_internal_extend_target(${dict_target_name} CONDITION GCC OR CLANG
COMPILE_OPTIONS -Wno-unused-parameter
)
+ if(NOT QT_FEATURE_webengine_system_icu AND QT_WILL_INSTALL)
+ # tool can be called durig build so copy icu file
+ get_target_property(icuFile WebEngineCore ICUDTL_FILE)
+ addCopyCommand(${dict_target_name} "${icuFile}"
+ "${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}")
+ endif()
+ qt_internal_extend_target(${dict_target_name}
+ CONDITION NOT QT_FEATURE_webengine_system_icu
+ DEFINES USE_ICU_FILE
+ )
endif()
diff --git a/src/core/tools/main.cpp b/src/core/tools/main.cpp
index d7913251..a23de0f8 100644
--- a/src/core/tools/main.cpp
+++ b/src/core/tools/main.cpp
@@ -48,13 +48,16 @@ inline base::FilePath toFilePath(const QString &str)
return base::FilePath(toFilePathString(str));
}
-inline QString toQt(const base::string16 &string)
+#if defined(Q_OS_WIN)
+inline QString toQt(const std::wstring &string)
{
-#if defined(OS_WIN)
return QString::fromStdWString(string);
-#else
- return QString::fromUtf16(reinterpret_cast<const char16_t *>(string.data()), string.size());
+}
#endif
+
+inline QString toQt(const std::u16string &string)
+{
+ return QString::fromStdU16String(string);
}
inline QString toQt(const std::string &string)
@@ -151,7 +154,7 @@ int main(int argc, char *argv[])
"en-US.bdic\n\n";
return 1;
}
-
+#if defined(USE_ICU_FILE)
bool icuDataDirFound = false;
QString icuDataDir = QLibraryInfo::path(QLibraryInfo::DataPath)
% QLatin1String("/resources");
@@ -160,6 +163,8 @@ int main(int argc, char *argv[])
// (e.g. for the case when the tool is ran during build phase, and regular installed
// ICU data file is not available).
const QString icuPossibleEnvDataDir = qEnvironmentVariable("QT_WEBENGINE_ICU_DATA_DIR");
+ const QString appPath = QCoreApplication::applicationDirPath();
+ QLatin1String icuDataFilePath("/icudtl.dat");
if (!icuPossibleEnvDataDir.isEmpty() && QFileInfo::exists(icuPossibleEnvDataDir)) {
icuDataDir = icuPossibleEnvDataDir;
icuDataDirFound = true;
@@ -173,21 +178,24 @@ int main(int argc, char *argv[])
}
#endif
// Try to find the ICU data directory in the installed Qt location.
- else if (QFileInfo::exists(icuDataDir)) {
+ else if (QFileInfo::exists(icuDataDir + icuDataFilePath)) {
+ icuDataDirFound = true;
+ } else if (QFileInfo::exists(appPath + icuDataFilePath)) {
+ // during build icudtl file can be simply in application directory
+ icuDataDir = appPath;
icuDataDirFound = true;
}
-
if (icuDataDirFound) {
base::PathService::Override(base::DIR_QT_LIBRARY_DATA, toFilePath(icuDataDir));
} else {
QTextStream out(stdout);
out << "Couldn't find ICU data directory. Please check that the following path exists: "
<< icuDataDir
- << "\nAlternatively provide the directory path via the QT_WEBENGINE_ICU_DAT_DIR "
+ << "\nAlternatively provide the directory path via the QT_WEBENGINE_ICU_DATA_DIR "
"environment variable.\n\n";
return 1;
}
-
+#endif // USE_ICU_FILE
base::AtExitManager exit_manager;
base::i18n::InitializeICU();
diff --git a/src/core/touch_selection_controller_client_qt.h b/src/core/touch_selection_controller_client_qt.h
index 02febd9b..e3e86a33 100644
--- a/src/core/touch_selection_controller_client_qt.h
+++ b/src/core/touch_selection_controller_client_qt.h
@@ -74,7 +74,8 @@ public:
void ExecuteCommand(int command_id, int event_flags) override;
void RunContextMenu() override;
bool ShouldShowQuickMenu() override { return false; }
- base::string16 GetSelectedText() override { return base::string16(); }
+ std::u16string GetSelectedText() override { return std::u16string(); }
+ const char *GetType() override { return nullptr; } //FIXME?
// content::TouchSelectionControllerClientManager overrides
void DidStopFlinging() override;
diff --git a/src/core/touch_selection_menu_controller.cpp b/src/core/touch_selection_menu_controller.cpp
index cdec9a06..3a6d4916 100644
--- a/src/core/touch_selection_menu_controller.cpp
+++ b/src/core/touch_selection_menu_controller.cpp
@@ -53,17 +53,11 @@ TouchSelectionMenuController::~TouchSelectionMenuController()
int TouchSelectionMenuController::buttonCount()
{
- int buttonCount = 1;
-
- for (int commandId = 0; commandId <= static_cast<int>(Paste); ++commandId) {
- if (m_touchSelectionControllerClient->IsCommandIdEnabled(commandId))
- buttonCount++;
- }
-
- return buttonCount;
+ // Context menu should be always available
+ return qPopulationCount(static_cast<quint8>(availableActions())) + 1;
}
-bool TouchSelectionMenuController::isCommandEnabled(TouchSelectionCommand command)
+bool TouchSelectionMenuController::isCommandEnabled(TouchSelectionMenuController::TouchSelectionCommandFlag command)
{
return m_touchSelectionControllerClient->IsCommandIdEnabled(static_cast<int>(command));
}
@@ -88,4 +82,21 @@ void TouchSelectionMenuController::runContextMenu()
return m_touchSelectionControllerClient->RunContextMenu();
}
+TouchSelectionMenuController::TouchSelectionCommandFlags TouchSelectionMenuController::availableActions()
+{
+ TouchSelectionCommandFlags availableActions;
+
+ if (m_touchSelectionControllerClient->IsCommandIdEnabled(Cut)) {
+ availableActions |= TouchSelectionMenuController::Cut;
+ }
+ if (m_touchSelectionControllerClient->IsCommandIdEnabled(Copy)) {
+ availableActions |= TouchSelectionMenuController::Copy;
+ }
+ if (m_touchSelectionControllerClient->IsCommandIdEnabled(Paste)) {
+ availableActions |= TouchSelectionMenuController::Paste;
+ }
+
+ return availableActions;
+}
+
} // namespace QtWebEngineCore
diff --git a/src/core/touch_selection_menu_controller.h b/src/core/touch_selection_menu_controller.h
index 8955c729..a90695c8 100644
--- a/src/core/touch_selection_menu_controller.h
+++ b/src/core/touch_selection_menu_controller.h
@@ -50,16 +50,19 @@ class TouchSelectionControllerClientQt;
class Q_WEBENGINECORE_PRIVATE_EXPORT TouchSelectionMenuController : public QObject {
Q_OBJECT
public:
- enum TouchSelectionCommand {
- Cut,
- Copy,
- Paste
+ enum TouchSelectionCommandFlag {
+ Cut = 0x1,
+ Copy = 0x2,
+ Paste = 0x4
};
+ Q_DECLARE_FLAGS(TouchSelectionCommandFlags, TouchSelectionCommandFlag);
+ Q_FLAG(TouchSelectionCommandFlag)
TouchSelectionMenuController(TouchSelectionControllerClientQt *touchSelectionControllerClient);
~TouchSelectionMenuController();
int buttonCount();
- bool isCommandEnabled(TouchSelectionCommand);
+ bool isCommandEnabled(TouchSelectionCommandFlag);
+ TouchSelectionCommandFlags availableActions();
public Q_SLOTS:
void cut();
diff --git a/src/core/type_conversion.cpp b/src/core/type_conversion.cpp
index e8f8131b..af22aa2d 100644
--- a/src/core/type_conversion.cpp
+++ b/src/core/type_conversion.cpp
@@ -39,6 +39,7 @@
#include "type_conversion.h"
+#include "base/containers/contains.h"
#include <components/favicon_base/favicon_util.h>
#include <net/cert/x509_certificate.h>
#include <net/cert/x509_util.h>
@@ -48,7 +49,6 @@
#include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h"
#include <QtCore/qcoreapplication.h>
-#include <QtGui/qmatrix4x4.h>
#include <QtNetwork/qsslcertificate.h>
namespace QtWebEngineCore {
@@ -276,17 +276,6 @@ int flagsFromModifiers(Qt::KeyboardModifiers modifiers)
return modifierFlags;
}
-void convertToQt(const SkMatrix44 &m, QMatrix4x4 &c)
-{
- QMatrix4x4 qtMatrix(
- m.get(0, 0), m.get(0, 1), m.get(0, 2), m.get(0, 3),
- m.get(1, 0), m.get(1, 1), m.get(1, 2), m.get(1, 3),
- m.get(2, 0), m.get(2, 1), m.get(2, 2), m.get(2, 3),
- m.get(3, 0), m.get(3, 1), m.get(3, 2), m.get(3, 3));
- qtMatrix.optimize();
- c = qtMatrix;
-}
-
static QSslCertificate toCertificate(CRYPTO_BUFFER *buffer)
{
auto derCert = net::x509_util::CryptoBufferAsStringPiece(buffer);
diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h
index 9bf0416a..7f378457 100644
--- a/src/core/type_conversion.h
+++ b/src/core/type_conversion.h
@@ -49,7 +49,6 @@
#include <QRect>
#include <QString>
#include <QUrl>
-#include <base/strings/nullable_string16.h>
#include "base/files/file_path.h"
#include "base/time/time.h"
#include "net/cookies/canonical_cookie.h"
@@ -57,13 +56,11 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/skia/include/core/SkPixelRef.h"
-#include "third_party/skia/include/core/SkMatrix44.h"
#include "ui/base/ime/text_input_type.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_f.h"
#include "url/gurl.h"
-QT_FORWARD_DECLARE_CLASS(QMatrix4x4)
QT_FORWARD_DECLARE_CLASS(QSslCertificate)
namespace gfx {
@@ -77,24 +74,23 @@ class X509Certificate;
namespace QtWebEngineCore {
-inline QString toQt(const base::string16 &string)
-{
#if defined(OS_WIN)
+inline QString toQt(const std::wstring &string)
+{
return QString::fromStdWString(string);
-#else
- return QString::fromUtf16(reinterpret_cast<const char16_t *>(string.data()), string.size());
+}
#endif
+
+inline QString toQt(const std::u16string &string)
+{
+ return QString::fromStdU16String(string);
}
-inline QString toQt(const base::Optional<base::string16> &string)
+inline QString toQt(const absl::optional<std::u16string> &string)
{
if (!string.has_value())
return QString();
-#if defined(OS_WIN)
- return QString::fromStdWString(string->data());
-#else
- return QString::fromUtf16(string->data());
-#endif
+ return QString::fromStdU16String(*string);
}
inline QString toQString(const std::string &string)
@@ -113,25 +109,16 @@ inline QString toQt(const std::string &string)
return toQString(string);
}
-inline base::string16 toString16(const QString &qString)
-{
-#if defined(OS_WIN)
- return base::string16(qString.toStdWString());
-#else
- return base::string16((const char16_t *)qString.utf16());
-#endif
-}
-
-inline base::NullableString16 toNullableString16(const QString &qString)
+inline std::u16string toString16(const QString &qString)
{
- return base::NullableString16(toString16(qString), qString.isNull());
+ return qString.toStdU16String();
}
-inline base::Optional<base::string16> toOptionalString16(const QString &qString)
+inline absl::optional<std::u16string> toOptionalString16(const QString &qString)
{
if (qString.isNull())
- return base::nullopt;
- return base::make_optional(toString16(qString));
+ return absl::nullopt;
+ return absl::make_optional(qString.toStdU16String());
}
inline QUrl toQt(const GURL &url)
@@ -225,8 +212,6 @@ SkBitmap toSkBitmap(const QImage &image);
QIcon toQIcon(const gfx::Image &image);
QIcon toQIcon(const std::vector<SkBitmap> &bitmaps);
-void convertToQt(const SkMatrix44 &m, QMatrix4x4 &c);
-
inline QDateTime toQt(base::Time time)
{
return QDateTime::fromMSecsSinceEpoch(time.ToJavaTime());
@@ -264,7 +249,7 @@ inline base::FilePath toFilePath(const QString &str)
int flagsFromModifiers(Qt::KeyboardModifiers modifiers);
-inline QStringList fromVector(const std::vector<base::string16> &vector)
+inline QStringList fromVector(const std::vector<std::u16string> &vector)
{
QStringList result;
for (auto s: vector) {
diff --git a/src/core/user_script.cpp b/src/core/user_script.cpp
index 1c8a78cd..c66d0bdd 100644
--- a/src/core/user_script.cpp
+++ b/src/core/user_script.cpp
@@ -37,6 +37,8 @@
**
****************************************************************************/
+#include "base/strings/string_util.h"
+
#include "qtwebengine/userscript/user_script_data.h"
#include "user_script.h"
#include "type_conversion.h"
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 0a83b248..9472e774 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -76,6 +76,7 @@
#include "content/public/browser/download_request_utils.h"
#include "content/public/browser/host_zoom_map.h"
#include "content/public/browser/navigation_entry.h"
+#include "content/public/browser/navigation_entry_restore_context.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/common/content_switches.h"
@@ -151,21 +152,19 @@ static QVariant fromJSValue(const base::Value *result)
}
case base::Value::Type::INTEGER:
{
- int out;
- if (result->GetAsInteger(&out))
- ret.setValue(out);
+ if (auto out = result->GetIfInt())
+ ret.setValue(*out);
break;
}
case base::Value::Type::DOUBLE:
{
- double out;
- if (result->GetAsDouble(&out))
- ret.setValue(out);
+ if (auto out = result->GetIfDouble())
+ ret.setValue(*out);
break;
}
case base::Value::Type::STRING:
{
- base::string16 out;
+ std::u16string out;
if (result->GetAsString(&out))
ret.setValue(toQt(out));
break;
@@ -299,6 +298,8 @@ static void deserializeNavigationHistory(QDataStream &input, int *currentIndex,
int count;
input >> count >> *currentIndex;
+ std::unique_ptr<content::NavigationEntryRestoreContext> context = content::NavigationEntryRestoreContext::Create(); // FIXME?
+
entries->reserve(count);
// Logic taken from SerializedNavigationEntry::ReadFromPickle and ToNavigationEntries.
for (int i = 0; i < count; ++i) {
@@ -338,7 +339,7 @@ static void deserializeNavigationHistory(QDataStream &input, int *currentIndex,
std::unique_ptr<content::NavigationEntry> entry = content::NavigationController::CreateNavigationEntry(
toGurl(virtualUrl),
content::Referrer(toGurl(referrerUrl), static_cast<network::mojom::ReferrerPolicy>(referrerPolicy)),
- base::nullopt, // optional initiator_origin
+ absl::nullopt, // optional initiator_origin
// Use a transition type of reload so that we don't incorrectly
// increase the typed count.
ui::PAGE_TRANSITION_RELOAD,
@@ -349,7 +350,7 @@ static void deserializeNavigationHistory(QDataStream &input, int *currentIndex,
nullptr);
entry->SetTitle(toString16(title));
- entry->SetPageState(blink::PageState::CreateFromEncodedData(std::string(pageState.data(), pageState.size())));
+ entry->SetPageState(blink::PageState::CreateFromEncodedData(std::string(pageState.data(), pageState.size())), context.get());
entry->SetHasPostData(hasPostData);
entry->SetOriginalRequestURL(toGurl(originalRequestUrl));
entry->SetIsOverridingUserAgent(isOverridingUserAgent);
@@ -529,7 +530,7 @@ void WebContentsAdapter::initialize(content::SiteInstance *site)
Q_ASSERT(rvh);
if (!rvh->IsRenderViewLive())
static_cast<content::WebContentsImpl*>(m_webContents.get())->CreateRenderViewForRenderManager(
- rvh, base::nullopt, nullptr);
+ rvh, absl::nullopt, nullptr);
m_webContentsDelegate->RenderViewHostChanged(nullptr, rvh);
@@ -1116,7 +1117,7 @@ void WebContentsAdapter::download(const QUrl &url, const QString &suggestedFileN
{
CHECK_INITIALIZED();
content::BrowserContext *bctx = m_webContents->GetBrowserContext();
- content::DownloadManager *dlm = content::BrowserContext::GetDownloadManager(bctx);
+ content::DownloadManager *dlm = bctx->GetDownloadManager();
DownloadManagerDelegateQt *dlmd = m_profileAdapter->downloadManagerDelegate();
if (!dlm)
@@ -1319,14 +1320,14 @@ void WebContentsAdapter::printToPDF(const QPageLayout &pageLayout, const QPageRa
{
#if QT_CONFIG(webengine_printing_and_pdf)
CHECK_INITIALIZED();
- PrintViewManagerQt::PrintToPDFFileCallback callback = base::Bind(&callbackOnPdfSavingFinished,
- m_adapterClient,
- filePath);
+ PrintViewManagerQt::PrintToPDFFileCallback callback = base::BindOnce(&callbackOnPdfSavingFinished,
+ m_adapterClient,
+ filePath);
PrintViewManagerQt::FromWebContents(m_webContents.get())->PrintToPDFFileWithCallback(pageLayout,
pageRanges,
true,
filePath,
- callback);
+ std::move(callback));
#endif // QT_CONFIG(webengine_printing_and_pdf)
}
@@ -1337,14 +1338,14 @@ quint64 WebContentsAdapter::printToPDFCallbackResult(const QPageLayout &pageLayo
{
#if QT_CONFIG(webengine_printing_and_pdf)
CHECK_INITIALIZED(0);
- PrintViewManagerQt::PrintToPDFCallback callback = base::Bind(&callbackOnPrintingFinished,
- m_adapterClient,
- m_nextRequestId);
+ PrintViewManagerQt::PrintToPDFCallback callback = base::BindOnce(&callbackOnPrintingFinished,
+ m_adapterClient,
+ m_nextRequestId);
PrintViewManagerQt::FromWebContents(m_webContents.get())->PrintToPDFWithCallback(pageLayout,
pageRanges,
colorMode,
useCustomMargins,
- callback);
+ std::move(callback));
return m_nextRequestId++;
#else
Q_UNUSED(pageLayout);
@@ -1426,8 +1427,10 @@ void WebContentsAdapter::setBackgroundColor(const QColor &color)
{
CHECK_INITIALIZED();
SkColor c = toSk(color);
- if (content::RenderWidgetHostView *rwhv = m_webContents->GetRenderWidgetHostView())
+ if (content::RenderWidgetHostView *rwhv = m_webContents->GetRenderWidgetHostView()) {
rwhv->SetBackgroundColor(c);
+ ((content::RenderWidgetHostViewBase *)rwhv)->SetContentBackgroundColor(c);
+ }
if (color != Qt::transparent)
m_pageHost->SetBackgroundColor(c);
}
@@ -1552,7 +1555,8 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD
if (rvh) {
rvh->GetWidget()->DragSourceEndedAt(gfx::PointF(m_lastDragClientPos.x(), m_lastDragClientPos.y()),
gfx::PointF(m_lastDragScreenPos.x(), m_lastDragScreenPos.y()),
- ui::mojom::DragOperation(m_currentDropAction));
+ ui::mojom::DragOperation(m_currentDropAction),
+ base::DoNothing());
rvh->GetWidget()->DragSourceSystemDragEnded();
}
}
@@ -1664,7 +1668,8 @@ void WebContentsAdapter::enterDrag(QDragEnterEvent *e, const QPointF &screenPos)
rvh->GetWidget()->FilterDropData(m_currentDropData.get());
rvh->GetWidget()->DragTargetDragEnter(*m_currentDropData, toGfx(e->position()), toGfx(screenPos),
toWeb(e->possibleActions()),
- toWeb(e->buttons()) | toWeb(e->modifiers()));
+ toWeb(e->buttons()) | toWeb(e->modifiers()),
+ base::DoNothing());
}
Qt::DropAction WebContentsAdapte