summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
m---------src/3rdparty0
-rw-r--r--src/core/CMakeLists.txt17
-rw-r--r--src/core/accessibility_tree_formatter_qt.cpp7
-rw-r--r--src/core/api/CMakeLists.txt2
-rw-r--r--src/core/api/configure.cmake6
-rw-r--r--src/core/api/qwebenginehttprequest.cpp8
-rw-r--r--src/core/api/qwebengineloadinginfo.h1
-rw-r--r--src/core/api/qwebenginepage.cpp4
-rw-r--r--src/core/browser_accessibility_manager_qt.cpp24
-rw-r--r--src/core/browser_accessibility_manager_qt.h8
-rw-r--r--src/core/browser_accessibility_qt.cpp32
-rw-r--r--src/core/browser_accessibility_qt.h5
-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.cpp104
-rw-r--r--src/core/clipboard_qt.h22
-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/configure/BUILD.root.gn.in45
-rw-r--r--src/core/content_browser_client_qt.cpp168
-rw-r--r--src/core/content_browser_client_qt.h30
-rw-r--r--src/core/content_client_qt.cpp53
-rw-r--r--src/core/content_client_qt.h4
-rw-r--r--src/core/content_main_delegate_qt.cpp3
-rw-r--r--src/core/delegated_frame_host_client_qt.cpp4
-rw-r--r--src/core/delegated_frame_host_client_qt.h2
-rw-r--r--src/core/devtools_frontend_qt.cpp224
-rw-r--r--src/core/devtools_frontend_qt.h16
-rw-r--r--src/core/doc/src/qtwebengine-platform-notes.qdoc6
-rw-r--r--src/core/download_manager_delegate_qt.cpp12
-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.cpp2
-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.cpp18
-rw-r--r--src/core/media_capture_devices_dispatcher.h18
-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/plugin_response_interceptor_url_loader_throttle.cpp3
-rw-r--r--src/core/net/plugin_response_interceptor_url_loader_throttle.h4
-rw-r--r--src/core/net/proxying_restricted_cookie_manager_qt.cpp18
-rw-r--r--src/core/net/proxying_restricted_cookie_manager_qt.h14
-rw-r--r--src/core/net/proxying_url_loader_factory_qt.cpp41
-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.cpp2
-rw-r--r--src/core/net/url_request_custom_job_proxy.h4
-rw-r--r--src/core/ozone/BUILD.gn1
-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.cpp12
-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.cpp8
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp117
-rw-r--r--src/core/renderer/extensions/extensions_renderer_client_qt.cpp2
-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/print_web_view_helper_delegate_qt.cpp25
-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.cpp29
-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.txt6
-rw-r--r--src/core/tools/main.cpp12
-rw-r--r--src/core/touch_selection_controller_client_qt.h3
-rw-r--r--src/core/touch_selection_menu_controller.h2
-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.cpp80
-rw-r--r--src/core/web_contents_adapter.h2
-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.cpp112
-rw-r--r--src/core/web_engine_error.cpp2
-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_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/doc/snippets/qtpdf-build.cmake4
-rw-r--r--src/pdf/plugins/imageformats/pdf/CMakeLists.txt2
-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.cpp48
-rw-r--r--src/pdf/qpdfdestination.h51
-rw-r--r--src/pdf/qpdfdestination_p.h27
-rw-r--r--src/pdf/qpdfdocument.cpp25
-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.qdoc25
-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.h31
-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.cpp36
-rw-r--r--src/pdf/qpdfsearchresult.h40
-rw-r--r--src/pdf/qpdfsearchresult_p.h33
-rw-r--r--src/pdf/qpdfselection.cpp48
-rw-r--r--src/pdf/qpdfselection.h57
-rw-r--r--src/pdf/qpdfselection_p.h27
-rw-r--r--src/pdf/qtpdfglobal.h25
-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.cpp30
-rw-r--r--src/pdfquick/qquickpdfdocument_p.h26
-rw-r--r--src/pdfquick/qquickpdflinkmodel.cpp30
-rw-r--r--src/pdfquick/qquickpdflinkmodel_p.h26
-rw-r--r--src/pdfquick/qquickpdfnavigationstack.cpp30
-rw-r--r--src/pdfquick/qquickpdfnavigationstack_p.h26
-rw-r--r--src/pdfquick/qquickpdfsearchmodel.cpp30
-rw-r--r--src/pdfquick/qquickpdfsearchmodel_p.h26
-rw-r--r--src/pdfquick/qquickpdfselection.cpp30
-rw-r--r--src/pdfquick/qquickpdfselection_p.h26
-rw-r--r--src/pdfquick/qquicktableviewextra.cpp30
-rw-r--r--src/pdfquick/qquicktableviewextra_p.h28
-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/webenginequick/api/qquickwebenginetouchselectionmenurequest.cpp4
-rw-r--r--src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p.h4
-rw-r--r--src/webenginequick/doc/src/webengineview_lgpl.qdoc20
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp7
193 files changed, 2195 insertions, 1811 deletions
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 39aa0ea99a30c9c15fb3640fe9a2638982548c0
+Subproject dd2725bea8f4d044a5740461b4cd685bf4cb8ca
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index f991e90d..7eb131e2 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)
@@ -119,8 +118,8 @@ foreach(arch ${archs})
net/client_cert_store_data.cpp net/client_cert_store_data.h
net/cookie_monster_delegate_qt.cpp net/cookie_monster_delegate_qt.h
net/custom_url_loader_factory.cpp net/custom_url_loader_factory.h
- net/proxy_config_monitor.cpp
- net/proxy_config_service_qt.cpp
+ net/proxy_config_monitor.cpp net/proxy_config_monitor.h
+ net/proxy_config_service_qt.cpp net/proxy_config_service_qt.h
net/proxying_restricted_cookie_manager_qt.cpp net/proxying_restricted_cookie_manager_qt.h
net/proxying_url_loader_factory_qt.cpp net/proxying_url_loader_factory_qt.h
net/qrc_url_scheme_handler.cpp net/qrc_url_scheme_handler.h
@@ -145,8 +144,6 @@ foreach(arch ${archs})
profile_adapter_client.cpp profile_adapter_client.h
profile_io_data_qt.cpp profile_io_data_qt.h
profile_qt.cpp profile_qt.h
- proxy_config_monitor.h
- proxy_config_service_qt.h
quota_permission_context_qt.cpp quota_permission_context_qt.h
quota_request_controller.h
quota_request_controller_impl.cpp quota_request_controller_impl.h
@@ -276,6 +273,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
@@ -287,6 +285,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
@@ -426,9 +425,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 f878f346..ffc45003 100644
--- a/src/core/api/CMakeLists.txt
+++ b/src/core/api/CMakeLists.txt
@@ -80,7 +80,7 @@ qt_internal_add_docs(WebEngineCore
add_custom_command(
OUTPUT chromium_attributions.qdoc
- COMMAND ${Python2_EXECUTABLE} chromium/tools/licenses.py
+ 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
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/qwebenginehttprequest.cpp b/src/core/api/qwebenginehttprequest.cpp
index f5733cde..d199bff1 100644
--- a/src/core/api/qwebenginehttprequest.cpp
+++ b/src/core/api/qwebenginehttprequest.cpp
@@ -182,16 +182,16 @@ QWebEngineHttpRequest QWebEngineHttpRequest::postRequest(const QUrl &url,
QWebEngineHttpRequest result(url);
result.setMethod(QWebEngineHttpRequest::Post);
- QString buffer;
+ QByteArray buffer;
for (QMap<QString, QString>::const_iterator it = postData.begin(); it != postData.end(); it++) {
QByteArray key = QUrl::toPercentEncoding(it.key());
QByteArray value = QUrl::toPercentEncoding(it.value());
if (buffer.length() > 0)
- buffer += QLatin1Char('&');
- buffer += key + QLatin1Char('=') + value;
+ buffer += '&';
+ buffer.append(key).append('=').append(value);
}
- result.setPostData(buffer.toLatin1());
+ result.setPostData(buffer);
result.setHeader(QByteArrayLiteral("Content-Type"),
QByteArrayLiteral("application/x-www-form-urlencoded"));
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..8e03aea0 100644
--- a/src/core/api/qwebenginepage.cpp
+++ b/src/core/api/qwebenginepage.cpp
@@ -456,8 +456,6 @@ void QWebEnginePagePrivate::didFetchDocumentInnerText(quint64 requestId, const Q
void QWebEnginePagePrivate::didPrintPage(quint64 requestId, QSharedPointer<QByteArray> result)
{
#if QT_CONFIG(webengine_printing_and_pdf)
- Q_Q(QWebEnginePage);
-
// If no currentPrinter is set that means that were printing to PDF only.
if (!currentPrinter) {
if (!result.data())
@@ -833,8 +831,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_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index b1d7f1a2..8587229d 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -55,12 +55,9 @@ BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
{
#if QT_CONFIG(accessibility)
Q_ASSERT(delegate);
- QObject *parent = nullptr;
- if (delegate->AccessibilityIsMainFrame()) {
- auto *access = static_cast<QtWebEngineCore::WebContentsAccessibilityQt *>(delegate->AccessibilityGetWebContentsAccessibility());
- parent = access ? access->accessibilityParentObject() : nullptr;
- }
- return new BrowserAccessibilityManagerQt(parent, initialTree, delegate);
+ QtWebEngineCore::WebContentsAccessibilityQt *access = nullptr;
+ access = static_cast<QtWebEngineCore::WebContentsAccessibilityQt *>(delegate->AccessibilityGetWebContentsAccessibility());
+ return new BrowserAccessibilityManagerQt(access, initialTree, delegate);
#else
return nullptr;
#endif // QT_CONFIG(accessibility)
@@ -79,10 +76,11 @@ BrowserAccessibilityManager *BrowserAccessibilityManager::Create(
#if QT_CONFIG(accessibility)
BrowserAccessibilityManagerQt::BrowserAccessibilityManagerQt(
- QObject *parentObject, const ui::AXTreeUpdate &initialTree,
+ QtWebEngineCore::WebContentsAccessibilityQt *webContentsAccessibility,
+ const ui::AXTreeUpdate &initialTree,
BrowserAccessibilityDelegate* delegate)
: BrowserAccessibilityManager(delegate)
- , m_parentObject(parentObject)
+ , m_webContentsAccessibility(webContentsAccessibility)
{
Initialize(initialTree);
m_valid = true; // BrowserAccessibilityQt can start using the AXTree
@@ -95,7 +93,15 @@ BrowserAccessibilityManagerQt::~BrowserAccessibilityManagerQt()
QAccessibleInterface *BrowserAccessibilityManagerQt::rootParentAccessible()
{
- return QAccessible::queryAccessibleInterface(m_parentObject);
+ content::BrowserAccessibility *parent_node = GetParentNodeFromParentTree();
+ if (!parent_node) {
+ Q_ASSERT(m_webContentsAccessibility);
+ return QAccessible::queryAccessibleInterface(m_webContentsAccessibility->accessibilityParentObject());
+ }
+
+ auto *parent_manager =
+ static_cast<BrowserAccessibilityManagerQt *>(parent_node->manager());
+ return parent_manager->rootParentAccessible();
}
void BrowserAccessibilityManagerQt::FireBlinkEvent(ax::mojom::Event event_type,
diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h
index 2a1d273b..de0022a4 100644
--- a/src/core/browser_accessibility_manager_qt.h
+++ b/src/core/browser_accessibility_manager_qt.h
@@ -49,12 +49,16 @@
QT_FORWARD_DECLARE_CLASS(QAccessibleInterface)
+namespace QtWebEngineCore {
+class WebContentsAccessibilityQt;
+}
+
namespace content {
class BrowserAccessibilityManagerQt : public BrowserAccessibilityManager
{
public:
- BrowserAccessibilityManagerQt(QObject *parentObject,
+ BrowserAccessibilityManagerQt(QtWebEngineCore::WebContentsAccessibilityQt *webContentsAccessibility,
const ui::AXTreeUpdate &initialTree,
BrowserAccessibilityDelegate *delegate);
~BrowserAccessibilityManagerQt() override;
@@ -68,7 +72,7 @@ public:
private:
Q_DISABLE_COPY(BrowserAccessibilityManagerQt)
- QObject *m_parentObject;
+ QtWebEngineCore::WebContentsAccessibilityQt *m_webContentsAccessibility;
bool m_valid = false;
};
diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index bf11646b..7cb7c81d 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -59,11 +59,7 @@ namespace content {
// static
BrowserAccessibility *BrowserAccessibility::Create()
{
-#if QT_CONFIG(accessibility)
return new BrowserAccessibilityQt();
-#else
- return nullptr;
-#endif // QT_CONFIG(accessibility)
}
const BrowserAccessibilityQt *ToBrowserAccessibilityQt(const BrowserAccessibility *obj)
@@ -78,7 +74,6 @@ QAccessibleInterface *toQAccessibleInterface(BrowserAccessibility *obj)
BrowserAccessibilityQt::BrowserAccessibilityQt()
{
- QAccessible::registerAccessibleInterface(this);
}
bool BrowserAccessibilityQt::isValid() const
@@ -89,7 +84,7 @@ bool BrowserAccessibilityQt::isValid() const
QObject *BrowserAccessibilityQt::object() const
{
- return nullptr;
+ return m_object;
}
QAccessibleInterface *BrowserAccessibilityQt::childAt(int x, int y) const
@@ -221,9 +216,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 +232,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 +391,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:
@@ -661,11 +650,24 @@ QAccessible::State BrowserAccessibilityQt::state() const
return state;
}
+void BrowserAccessibilityQt::Init(BrowserAccessibilityManager *manager, ui::AXNode *node)
+{
+ BrowserAccessibility::Init(manager, node);
+
+ Q_ASSERT(parent());
+ Q_ASSERT(parent()->object());
+ m_object = new QObject(parent()->object());
+ QString name = toQt(GetAuthorUniqueId());
+ if (!name.isEmpty())
+ m_object->setObjectName(name);
+
+ m_id = QAccessible::registerAccessibleInterface(this);
+}
+
void BrowserAccessibilityQt::Destroy()
{
// delete this
- QAccessible::Id interfaceId = QAccessible::uniqueId(this);
- QAccessible::deleteAccessibleInterface(interfaceId);
+ QAccessible::deleteAccessibleInterface(m_id);
}
QStringList BrowserAccessibilityQt::actionNames() const
@@ -839,7 +841,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_accessibility_qt.h b/src/core/browser_accessibility_qt.h
index 32a4fc76..c02e51c8 100644
--- a/src/core/browser_accessibility_qt.h
+++ b/src/core/browser_accessibility_qt.h
@@ -80,6 +80,7 @@ public:
QAccessible::State state() const override;
// BrowserAccessible
+ void Init(BrowserAccessibilityManager *manager, ui::AXNode *node) override;
void Destroy() override;
// QAccessibleActionInterface
@@ -142,6 +143,10 @@ public:
QAccessibleInterface* table() const override;
void modelChange(QAccessibleTableModelChangeEvent *event) override;
+
+private:
+ QObject *m_object = nullptr;
+ QAccessible::Id m_id;
};
const BrowserAccessibilityQt *ToBrowserAccessibilityQt(const BrowserAccessibility *obj);
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 6549a19d..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.
@@ -51,6 +51,7 @@
#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"
@@ -77,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
@@ -114,7 +121,10 @@ extern void CFHtmlExtractMetadata(const std::string &cf_html, std::string *base_
size_t *html_start, size_t *fragment_start, size_t *fragment_end);
#endif // defined(Q_OS_WIN)
-void ClipboardQt::WritePortableRepresentations(ui::ClipboardBuffer type, const ObjectMap &objects, std::unique_ptr<ui::DataTransferEndpoint> data_src)
+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));
@@ -122,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(),
@@ -132,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),
- nullptr);
+ 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));
@@ -229,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();
@@ -244,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);
@@ -273,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();
@@ -357,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);
@@ -369,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);
@@ -404,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
@@ -450,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/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..7f27b6ac 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/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
index 2ba599e4..44545470 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,10 +213,12 @@ 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/",
"//extensions/buildflags:buildflags",
+ "//printing/buildflags:buildflags",
"//qtwebengine/common:mojo_bindings",
"//rlz/buildflags:buildflags",
"//third_party/blink/public/mojom:mojom_platform",
@@ -334,12 +336,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 += [
@@ -352,21 +357,19 @@ source_set("qtwebengine_sources") {
"//chrome/browser/printing/print_job_worker.cc",
"//chrome/browser/printing/print_job_worker.h",
]
- deps += [
- "//printing/buildflags:buildflags",
- ]
}
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) {
@@ -575,10 +578,12 @@ repack("qtwebengine_repack_resources_200") {
repack("qtwebengine_repack_resources_devtools") {
sources = [
"$root_gen_dir/content/browser/devtools/devtools_resources.pak",
+ "$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
]
output = "$root_out_dir/qtwebengine_devtools_resources.pak"
deps = [
"//content/browser/devtools:devtools_resources_grit",
+ "//third_party/blink/public:devtools_inspector_resources_grit",
]
}
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index f8d1afe1..2b1485b2 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"
@@ -157,6 +157,7 @@
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
#include "extensions/browser/process_map.h"
#include "extensions/browser/url_loader_factory_manager.h"
+#include "extensions/browser/view_type_utils.h"
#include "extensions/common/constants.h"
#include "extensions/common/manifest_handlers/mime_types_handler.h"
#include "extensions/extension_web_contents_observer_qt.h"
@@ -165,6 +166,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 +202,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 +236,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 +419,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 +432,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 +480,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 +503,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 +593,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
@@ -605,9 +613,9 @@ bool ContentBrowserClientQt::WillCreateRestrictedCookieManager(network::mojom::R
content::BrowserContext *browser_context,
const url::Origin & /*origin*/,
const net::IsolationInfo & /*isolation_info*/,
- bool is_service_worker,
- int process_id,
- int routing_id,
+ bool /*is_service_worker*/,
+ int /*process_id*/,
+ int /*routing_id*/,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> *receiver)
{
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> orig_receiver = std::move(*receiver);
@@ -618,7 +626,6 @@ bool ContentBrowserClientQt::WillCreateRestrictedCookieManager(network::mojom::R
ProxyingRestrictedCookieManagerQt::CreateAndBind(
ProfileIODataQt::FromBrowserContext(browser_context),
std::move(target_rcm_remote),
- is_service_worker, process_id, routing_id,
std::move(orig_receiver));
return false; // only made a proxy, still need the actual impl to be made.
@@ -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);
@@ -773,7 +782,7 @@ ContentBrowserClientQt::CreateURLLoaderThrottles(
ProtocolHandlerRegistryFactory::GetForBrowserContext(browser_context)));
#if BUILDFLAG(ENABLE_EXTENSIONS)
result.push_back(std::make_unique<PluginResponseInterceptorURLLoaderThrottle>(
- browser_context, request.destination, frame_tree_node_id));
+ request.destination, frame_tree_node_id));
#endif
return result;
}
@@ -1085,9 +1094,14 @@ void ContentBrowserClientQt::RegisterNonNetworkSubresourceURLLoaderFactories(int
if (web_contents)
url = web_contents->GetVisibleURL();
+ bool is_background_page = false;
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+ is_background_page = extensions::GetViewType(web_contents) == extensions::mojom::ViewType::kExtensionBackgroundPage;
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+
// Install file scheme if necessary:
bool install_file_scheme = false;
- if (web_contents) {
+ if (web_contents && !is_background_page) {
const auto *settings = static_cast<WebContentsDelegateQt *>(web_contents->GetResponsibleWebContents()->GetDelegate())->webEngineSettings();
if (settings->testAttribute(QWebEngineSettings::LocalContentCanAccessFileUrls)) {
for (const auto &local_scheme : url::GetLocalSchemes()) {
@@ -1172,7 +1186,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 +1194,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..90e604e7 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.
@@ -134,10 +136,6 @@ static QString getProgramFilesDir(bool x86Dir = false)
#include "content/public/common/pepper_plugin_info.h"
#include "ppapi/shared_impl/ppapi_permissions.h"
-namespace switches {
-const char kPpapiWidevinePath[] = "ppapi-widevine-path";
-}
-
static QString ppapiPluginsPath()
{
// Look for plugins in /plugins/ppapi or application dir.
@@ -184,7 +182,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 +267,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 +298,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 +321,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 +330,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 +359,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 +374,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/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/delegated_frame_host_client_qt.h b/src/core/delegated_frame_host_client_qt.h
index f9bc99d2..89cd3700 100644
--- a/src/core/delegated_frame_host_client_qt.h
+++ b/src/core/delegated_frame_host_client_qt.h
@@ -40,7 +40,7 @@
#ifndef DELEGATED_FRAME_HOST_CLIENT_QT_H
#define DELEGATED_FRAME_HOST_CLIENT_QT_H
-#include "qtwebenginecoreglobal_p.h"
+#include <QtWebEngineCore/private/qtwebenginecoreglobal_p.h>
#include "content/browser/renderer_host/delegated_frame_host.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 9a773696..46dd4e0b 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.
@@ -89,11 +89,10 @@ namespace {
constexpr char kScreencastEnabled[] = "screencastEnabled";
-std::unique_ptr<base::DictionaryValue> BuildObjectForResponse(const net::HttpResponseHeaders *rh,
- bool success,
- int net_error)
+base::DictionaryValue BuildObjectForResponse(const net::HttpResponseHeaders *rh,
+ bool success, int net_error)
{
- auto response = std::make_unique<base::DictionaryValue>();
+ base::DictionaryValue response;
int responseCode = 200;
if (rh) {
responseCode = rh->response_code();
@@ -101,9 +100,9 @@ std::unique_ptr<base::DictionaryValue> BuildObjectForResponse(const net::HttpRes
// In case of no headers, assume file:// URL and failed to load
responseCode = 404;
}
- response->SetInteger("statusCode", responseCode);
- response->SetInteger("netError", net_error);
- response->SetString("netErrorName", net::ErrorToString(net_error));
+ response.SetInteger("statusCode", responseCode);
+ response.SetInteger("netError", net_error);
+ response.SetString("netErrorName", net::ErrorToString(net_error));
auto headers = std::make_unique<base::DictionaryValue>();
size_t iterator = 0;
@@ -114,7 +113,7 @@ std::unique_ptr<base::DictionaryValue> BuildObjectForResponse(const net::HttpRes
while (rh && rh->EnumerateHeaderLines(&iterator, &name, &value))
headers->SetString(name, value);
- response->Set("headers", std::move(headers));
+ response.Set("headers", std::move(headers));
return response;
}
@@ -167,14 +166,14 @@ private:
base::Value id(stream_id_);
base::Value encodedValue(encoded);
- bindings_->CallClientFunction("DevToolsAPI.streamWrite", &id, &chunkValue, &encodedValue);
+ bindings_->CallClientFunction("DevToolsAPI", "streamWrite", std::move(id), std::move(chunkValue), std::move(encodedValue));
std::move(resume).Run();
}
void OnComplete(bool success) override
{
auto response = BuildObjectForResponse(response_headers_.get(), success, loader_->NetError());
- bindings_->SendMessageAck(request_id_, response.get());
+ bindings_->SendMessageAck(request_id_, std::move(response));
bindings_->m_loaders.erase(bindings_->m_loaders.find(this));
}
@@ -301,12 +300,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;
@@ -374,42 +373,52 @@ 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);
response.SetBoolean("urlValid", false);
- SendMessageAck(request_id, &response);
+ SendMessageAck(request_id, std::move(response));
return;
}
@@ -443,7 +452,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;
@@ -454,18 +463,17 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me
} else if (content::HasWebUIScheme(gurl)) {
base::DictionaryValue response;
response.SetInteger("statusCode", 403);
- SendMessageAck(request_id, &response);
+ SendMessageAck(request_id, std::move(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;
@@ -475,50 +483,50 @@ void DevToolsFrontendQt::HandleMessageFromDevToolsFrontend(const std::string &me
SetPreference(kScreencastEnabled, "false");
m_preferences = std::move(*m_prefStore->GetValues());
- SendMessageAck(request_id, &m_preferences);
+ SendMessageAck(request_id, m_preferences.Clone());
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),
@@ -540,18 +548,18 @@ 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;
}
if (request_id)
- SendMessageAck(request_id, nullptr);
+ SendMessageAck(request_id, base::Value());
}
void DevToolsFrontendQt::SetEyeDropperActive(bool active)
@@ -561,8 +569,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();
}
@@ -575,60 +583,56 @@ void DevToolsFrontendQt::ColorPickedInEyeDropper(int r, int g, int b, int a)
color.SetInteger("g", g);
color.SetInteger("b", b);
color.SetInteger("a", a);
- CallClientFunction("DevToolsAPI.eyeDropperPickedColor", &color, nullptr, nullptr);
+ CallClientFunction("DevToolsAPI", "eyeDropperPickedColor", std::move(color));
}
void DevToolsFrontendQt::DispatchProtocolMessage(content::DevToolsAgentHost *agentHost, base::span<const uint8_t> message)
{
Q_UNUSED(agentHost);
- base::StringPiece message_sp(reinterpret_cast<const char*>(message.data()), message.size());
- if (message_sp.length() < kMaxMessageChunkSize) {
- std::string param;
- base::EscapeJSONString(message_sp, true, &param);
- std::string code = "DevToolsAPI.dispatchMessage(" + param + ");";
- base::string16 javascript = base::UTF8ToUTF16(code);
- web_contents()->GetMainFrame()->ExecuteJavaScript(javascript, base::NullCallback());
- return;
- }
+ base::StringPiece str_message(reinterpret_cast<const char*>(message.data()), message.size());
+
+ if (str_message.length() < kMaxMessageChunkSize) {
+ CallClientFunction("DevToolsAPI", "dispatchMessage",
+ base::Value(std::string(str_message)));
+ } else {
+ size_t total_size = str_message.length();
+ for (size_t pos = 0; pos < str_message.length(); pos += kMaxMessageChunkSize) {
+ base::StringPiece str_message_chunk = str_message.substr(pos, kMaxMessageChunkSize);
- size_t total_size = message_sp.length();
- for (size_t pos = 0; pos < message_sp.length(); pos += kMaxMessageChunkSize) {
- std::string param;
- 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);
- web_contents()->GetMainFrame()->ExecuteJavaScript(javascript, base::NullCallback());
+ CallClientFunction("DevToolsAPI", "dispatchMessageChunk",
+ base::Value(std::string(str_message_chunk)),
+ base::Value(base::NumberToString(pos ? 0 : total_size)));
+ }
}
}
-void DevToolsFrontendQt::CallClientFunction(const std::string &function_name,
- const base::Value *arg1,
- const base::Value *arg2,
- const base::Value *arg3)
+void DevToolsFrontendQt::CallClientFunction(const std::string &object_name,
+ const std::string &method_name,
+ base::Value arg1, base::Value arg2, base::Value arg3,
+ base::OnceCallback<void(base::Value)> cb)
+
{
- std::string javascript = function_name + "(";
- if (arg1) {
- std::string json;
- base::JSONWriter::Write(*arg1, &json);
- javascript.append(json);
- if (arg2) {
- base::JSONWriter::Write(*arg2, &json);
- javascript.append(", ").append(json);
- if (arg3) {
- base::JSONWriter::Write(*arg3, &json);
- javascript.append(", ").append(json);
+ base::Value arguments(base::Value::Type::LIST);
+ if (!arg1.is_none()) {
+ arguments.Append(std::move(arg1));
+ if (!arg2.is_none()) {
+ arguments.Append(std::move(arg2));
+ if (!arg3.is_none()) {
+ arguments.Append(std::move(arg3));
}
}
}
- javascript.append(");");
- web_contents()->GetMainFrame()->ExecuteJavaScript(base::UTF8ToUTF16(javascript), base::NullCallback());
+ web_contents()->GetMainFrame()->ExecuteJavaScriptMethod(base::ASCIIToUTF16(object_name),
+ base::ASCIIToUTF16(method_name),
+ std::move(arguments),
+ std::move(cb));
+
}
-void DevToolsFrontendQt::SendMessageAck(int request_id, const base::Value *arg)
+void DevToolsFrontendQt::SendMessageAck(int request_id, base::Value arg)
{
base::Value id_value(request_id);
- CallClientFunction("DevToolsAPI.embedderMessageAck", &id_value, arg, nullptr);
+ CallClientFunction("DevToolsAPI", "embedderMessageAck", std::move(id_value), std::move(arg));
}
void DevToolsFrontendQt::AgentHostClosed(content::DevToolsAgentHost *agentHost)
diff --git a/src/core/devtools_frontend_qt.h b/src/core/devtools_frontend_qt.h
index aac5909d..015600cf 100644
--- a/src/core/devtools_frontend_qt.h
+++ b/src/core/devtools_frontend_qt.h
@@ -82,10 +82,12 @@ public:
void DisconnectFromTarget();
- void CallClientFunction(const std::string& function_name,
- const base::Value* arg1,
- const base::Value* arg2,
- const base::Value* arg3);
+ void CallClientFunction(const std::string &object_name,
+ const std::string &method_name,
+ base::Value arg1 = {},
+ base::Value arg2 = {},
+ base::Value arg3 = {},
+ base::OnceCallback<void(base::Value)> cb = base::NullCallback());
WebContentsDelegateQt *frontendDelegate() const
{
@@ -101,15 +103,15 @@ 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);
+ void SendMessageAck(int request_id, base::Value arg1);
void SetPreference(const std::string &name, const std::string &value);
void RemovePreference(const std::string &name);
void ClearPreferences();
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/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 58f6507a..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;
}
@@ -227,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));
@@ -316,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 90f5dcc0..140cb7db 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -225,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())
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 c9256f8a..c976798a 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -290,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))
{
}
@@ -310,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()
@@ -347,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()) {
@@ -475,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)
@@ -487,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));
@@ -541,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/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/plugin_response_interceptor_url_loader_throttle.cpp b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
index d66e69ef..0fc518a9 100644
--- a/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
+++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.cpp
@@ -68,10 +68,9 @@
namespace QtWebEngineCore {
PluginResponseInterceptorURLLoaderThrottle::PluginResponseInterceptorURLLoaderThrottle(
- content::BrowserContext *browser_context,
network::mojom::RequestDestination request_destination,
int frame_tree_node_id)
- : m_browser_context(browser_context), m_request_destination(request_destination), m_frame_tree_node_id(frame_tree_node_id)
+ : m_request_destination(request_destination), m_frame_tree_node_id(frame_tree_node_id)
{}
void PluginResponseInterceptorURLLoaderThrottle::WillProcessResponse(const GURL &response_url,
diff --git a/src/core/net/plugin_response_interceptor_url_loader_throttle.h b/src/core/net/plugin_response_interceptor_url_loader_throttle.h
index 0e10b212..d4ff8784 100644
--- a/src/core/net/plugin_response_interceptor_url_loader_throttle.h
+++ b/src/core/net/plugin_response_interceptor_url_loader_throttle.h
@@ -54,8 +54,7 @@ namespace QtWebEngineCore {
class PluginResponseInterceptorURLLoaderThrottle : public blink::URLLoaderThrottle
{
public:
- PluginResponseInterceptorURLLoaderThrottle(content::BrowserContext *browser_context,
- network::mojom::RequestDestination request_destination,
+ PluginResponseInterceptorURLLoaderThrottle(network::mojom::RequestDestination request_destination,
int frame_tree_node_id);
~PluginResponseInterceptorURLLoaderThrottle() override = default;
@@ -67,7 +66,6 @@ private:
// layer chance to initialize its browser side state.
void ResumeLoad();
- content::BrowserContext *m_browser_context = nullptr;
const network::mojom::RequestDestination m_request_destination;
const int m_frame_tree_node_id;
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.cpp b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
index f86c0e99..f66a4c1a 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.cpp
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.cpp
@@ -61,9 +61,6 @@ namespace QtWebEngineCore {
// static
void ProxyingRestrictedCookieManagerQt::CreateAndBind(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -72,7 +69,6 @@ void ProxyingRestrictedCookieManagerQt::CreateAndBind(ProfileIODataQt *profileIo
base::BindOnce(&ProxyingRestrictedCookieManagerQt::CreateAndBindOnIoThread,
profileIoData,
std::move(underlying_rcm),
- is_service_worker, process_id, frame_id,
std::move(receiver)));
}
@@ -80,31 +76,21 @@ void ProxyingRestrictedCookieManagerQt::CreateAndBind(ProfileIODataQt *profileIo
// static
void ProxyingRestrictedCookieManagerQt::CreateAndBindOnIoThread(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
auto wrapper = base::WrapUnique(new ProxyingRestrictedCookieManagerQt(
profileIoData->getWeakPtrOnIOThread(),
- std::move(underlying_rcm),
- is_service_worker, process_id, frame_id));
+ std::move(underlying_rcm)));
mojo::MakeSelfOwnedReceiver(std::move(wrapper), std::move(receiver));
}
ProxyingRestrictedCookieManagerQt::ProxyingRestrictedCookieManagerQt(
base::WeakPtr<ProfileIODataQt> profileIoData,
- mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlyingRestrictedCookieManager,
- bool is_service_worker,
- int32_t process_id,
- int32_t frame_id)
+ mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlyingRestrictedCookieManager)
: m_profileIoData(std::move(profileIoData))
, underlying_restricted_cookie_manager_(std::move(underlyingRestrictedCookieManager))
- , is_service_worker_(is_service_worker)
- , process_id_(process_id)
- , frame_id_(frame_id)
, weak_factory_(this)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
diff --git a/src/core/net/proxying_restricted_cookie_manager_qt.h b/src/core/net/proxying_restricted_cookie_manager_qt.h
index 3d4765b3..37271dfd 100644
--- a/src/core/net/proxying_restricted_cookie_manager_qt.h
+++ b/src/core/net/proxying_restricted_cookie_manager_qt.h
@@ -56,9 +56,6 @@ public:
// Expects to be called on the UI thread.
static void CreateAndBind(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver);
~ProxyingRestrictedCookieManagerQt() override;
@@ -98,24 +95,15 @@ public:
private:
ProxyingRestrictedCookieManagerQt(base::WeakPtr<ProfileIODataQt> profileIoData,
- mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int32_t process_id,
- int32_t frame_id);
+ mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm);
static void CreateAndBindOnIoThread(ProfileIODataQt *profileIoData,
mojo::PendingRemote<network::mojom::RestrictedCookieManager> underlying_rcm,
- bool is_service_worker,
- int process_id,
- int frame_id,
mojo::PendingReceiver<network::mojom::RestrictedCookieManager> receiver);
base::WeakPtr<ProfileIODataQt> m_profileIoData;
mojo::Remote<network::mojom::RestrictedCookieManager> underlying_restricted_cookie_manager_;
- bool is_service_worker_;
- int process_id_;
- int frame_id_;
base::WeakPtrFactory<ProxyingRestrictedCookieManagerQt> weak_factory_;
diff --git a/src/core/net/proxying_url_loader_factory_qt.cpp b/src/core/net/proxying_url_loader_factory_qt.cpp
index 6505e550..be2a6814 100644
--- a/src/core/net/proxying_url_loader_factory_qt.cpp
+++ b/src/core/net/proxying_url_loader_factory_qt.cpp
@@ -50,6 +50,7 @@
#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"
@@ -111,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,
@@ -129,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;
@@ -163,9 +165,8 @@ 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;
@@ -191,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)
@@ -249,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()
@@ -356,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.
@@ -375,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_);
}
@@ -435,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);
@@ -522,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) {
@@ -543,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)
{
@@ -554,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 b5758334..75868870 100644
--- a/src/core/net/url_request_custom_job_proxy.cpp
+++ b/src/core/net/url_request_custom_job_proxy.cpp
@@ -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 e0f9b8a4..61ca197e 100644
--- a/src/core/ozone/BUILD.gn
+++ b/src/core/ozone/BUILD.gn
@@ -21,6 +21,7 @@ source_set("qt") {
deps = [
"//base",
+ "//ui/base:buildflags",
"//ui/ozone:ozone_base",
"//ui/ozone/common",
]
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 33d7bd99..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_;
@@ -213,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()) {
@@ -231,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 d28e789e..009f2f0e 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)
@@ -589,13 +589,13 @@ void RenderWidgetHostViewQtDelegateClient::handleTouchEvent(QTouchEvent *event)
// Check first if the touch event should be routed to the selectionController
if (!touchPoints.isEmpty()) {
switch (touchPoints[0].second.state()) {
- case Qt::TouchPointPressed:
+ case QEventPoint::Pressed:
action = ui::MotionEvent::Action::DOWN;
break;
- case Qt::TouchPointMoved:
+ case QEventPoint::Updated:
action = ui::MotionEvent::Action::MOVE;
break;
- case Qt::TouchPointReleased:
+ case QEventPoint::Released:
action = ui::MotionEvent::Action::UP;
break;
default:
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index f52c17dc..e407c4f2 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -120,8 +120,6 @@
namespace QtWebEngineCore {
-static const char kHttpErrorDomain[] = "http";
-
ContentRendererClientQt::ContentRendererClientQt()
{
#if BUILDFLAG(ENABLE_EXTENSIONS)
@@ -262,7 +260,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 +296,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 +488,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 +558,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 +575,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 +607,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 +616,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..0506be87 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"
@@ -70,7 +71,6 @@
namespace chrome {
const char kExtensionInvalidRequestURL[] = "chrome-extension://invalid/";
-const char kExtensionResourceInvalidRequestURL[] = "chrome-extension-resource://invalid/";
}
namespace QtWebEngineCore {
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/print_web_view_helper_delegate_qt.cpp b/src/core/renderer/print_web_view_helper_delegate_qt.cpp
index beae6ecf..5dcfaafd 100644
--- a/src/core/renderer/print_web_view_helper_delegate_qt.cpp
+++ b/src/core/renderer/print_web_view_helper_delegate_qt.cpp
@@ -43,11 +43,17 @@
#include "content/public/renderer/render_frame.h"
#include "content/public/renderer/render_view.h"
+#include "extensions/buildflags/buildflags.h"
#include "extensions/common/constants.h"
#include "third_party/blink/public/web/web_document.h"
#include "third_party/blink/public/web/web_element.h"
#include "third_party/blink/public/web/web_local_frame.h"
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+#include "chrome/common/webui_url_constants.h"
+#include "extensions/common/constants.h"
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+
#include "print_web_view_helper_delegate_qt.h"
#include "web_engine_library_info.h"
@@ -56,14 +62,23 @@ PrintWebViewHelperDelegateQt::~PrintWebViewHelperDelegateQt() {}
blink::WebElement PrintWebViewHelperDelegateQt::GetPdfElement(blink::WebLocalFrame *frame)
{
+#if BUILDFLAG(ENABLE_EXTENSIONS)
GURL url = frame->GetDocument().Url();
- if (url.SchemeIs(extensions::kExtensionScheme) && url.host() == extension_misc::kPdfExtensionId) {
+ bool inside_print_preview = url.GetOrigin() == chrome::kChromeUIPrintURL;
+ bool inside_pdf_extension = url.SchemeIs(extensions::kExtensionScheme) &&
+ url.host_piece() == extension_misc::kPdfExtensionId;
+ if (inside_print_preview || inside_pdf_extension) {
// <object> with id="plugin" is created in
- // chrome/browser/resources/pdf/pdf.js.
- auto plugin_element = frame->GetDocument().GetElementById("plugin");
- CHECK(!plugin_element.IsNull());
- return plugin_element;
+ // chrome/browser/resources/pdf/pdf_viewer_base.js.
+ auto viewer_element = frame->GetDocument().GetElementById("viewer");
+ if (!viewer_element.IsNull() && !viewer_element.ShadowRoot().IsNull()) {
+ auto plugin_element = viewer_element.ShadowRoot().QuerySelector("#plugin");
+ if (!plugin_element.IsNull())
+ return plugin_element;
+ }
+ NOTREACHED();
}
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
return blink::WebElement();
}
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 c86888a2..ef3fbeaa 100644
--- a/src/core/renderer/web_channel_ipc_transport.cpp
+++ b/src/core/renderer/web_channel_ipc_transport.cpp
@@ -83,14 +83,20 @@ 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::Local<v8::Value> qtObjectValue;
@@ -113,6 +119,8 @@ 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());
@@ -224,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;
@@ -249,7 +258,7 @@ 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);
}
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 63cb234d..733c124e 100644
--- a/src/core/tools/CMakeLists.txt
+++ b/src/core/tools/CMakeLists.txt
@@ -10,8 +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
)
- qt_internal_return_unless_building_tools()
+ 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
diff --git a/src/core/tools/main.cpp b/src/core/tools/main.cpp
index a977fc22..1721f71d 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)
@@ -194,7 +197,6 @@ int main(int argc, char *argv[])
}
#endif // USE_ICU_FILE
- base::AtExitManager exit_manager;
base::i18n::InitializeICU();
base::FilePath file_in_path = toFilePath(argv[1]);
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.h b/src/core/touch_selection_menu_controller.h
index a90695c8..1167d8bc 100644
--- a/src/core/touch_selection_menu_controller.h
+++ b/src/core/touch_selection_menu_controller.h
@@ -55,7 +55,7 @@ public:
Copy = 0x2,
Paste = 0x4
};
- Q_DECLARE_FLAGS(TouchSelectionCommandFlags, TouchSelectionCommandFlag);
+ Q_DECLARE_FLAGS(TouchSelectionCommandFlags, TouchSelectionCommandFlag)
Q_FLAG(TouchSelectionCommandFlag)
TouchSelectionMenuController(TouchSelectionControllerClientQt *touchSelectionControllerClient);
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..6f35513b 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"
@@ -132,8 +133,6 @@ namespace QtWebEngineCore {
return; \
}
-static const int kTestWindowWidth = 800;
-static const int kTestWindowHeight = 600;
static const int kHistoryStreamVersion = 4;
static QVariant fromJSValue(const base::Value *result)
@@ -151,21 +150,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 +296,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 +337,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 +348,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 +528,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 +1115,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 +1318,17 @@ 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::FromWebContents(m_webContents.get())->PrintToPDFFileWithCallback(pageLayout,
+ PrintViewManagerQt::PrintToPDFFileCallback callback = base::BindOnce(&callbackOnPdfSavingFinished,
+ m_adapterClient,
+ filePath);
+ content::WebContents *webContents = m_webContents.get();
+ if (content::WebContents *guest = guestWebContents())
+ webContents = guest;
+ PrintViewManagerQt::FromWebContents(webContents)->PrintToPDFFileWithCallback(pageLayout,
pageRanges,
true,
filePath,
- callback);
+ std::move(callback));
#endif // QT_CONFIG(webengine_printing_and_pdf)
}
@@ -1337,14 +1339,17 @@ 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::FromWebContents(m_webContents.get())->PrintToPDFWithCallback(pageLayout,
+ PrintViewManagerQt::PrintToPDFCallback callback = base::BindOnce(&callbackOnPrintingFinished,
+ m_adapterClient,
+ m_nextRequestId);
+ content::WebContents *webContents = m_webContents.get();
+ if (content::WebContents *guest = guestWebContents())
+ webContents = guest;
+ PrintViewManagerQt::FromWebContents(webContents)->PrintToPDFWithCallback(pageLayout,
pageRanges,
colorMode,
useCustomMargins,
- callback);
+ std::move(callback));
return m_nextRequestId++;
#else
Q_UNUSED(pageLayout);
@@ -1426,8 +1431,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);
}
@@ -1437,6 +1444,12 @@ content::WebContents *WebContentsAdapter::webContents() const
return m_webContents.get();
}
+content::WebContents *WebContentsAdapter::guestWebContents() const
+{
+ std::vector<content::WebContents *> innerWebContents = m_webContents->GetInnerWebContents();
+ return !innerWebContents.empty() ? innerWebContents[0] : nullptr;
+}
+
#if QT_CONFIG(webengine_webchannel)
QWebChannel *WebContentsAdapter::webChannel() const
{
@@ -1544,15 +1557,15 @@ void WebContentsAdapter::startDragging(QObject *dragSource, const content::DropD
// dropping data into them. We don't even try to support dropping into PDF input fields,
// since it's not working in Chrome right now.
content::WebContents *targetWebContents = m_webContents.get();
- std::vector<content::WebContents *> innerWebContents = m_webContents->GetInnerWebContents();
- if (!innerWebContents.empty())
- targetWebContents = innerWebContents[0];
+ if (content::WebContents *guest = guestWebContents())
+ targetWebContents = guest;
content::RenderViewHost *rvh = targetWebContents->GetRenderViewHost();
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 +1677,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 WebContentsAdapter::updateDragPosition(QDragMoveEvent *e, const QPointF &screenPos)
@@ -1674,7 +1688,7 @@ Qt::DropAction WebContentsAdapter::updateDragPosition(QDragMoveEvent *e, const Q
m_lastDragClientPos = e->position();
m_lastDragScreenPos = screenPos;
rvh->GetWidget()->DragTargetDragOver(toGfx(m_lastDragClientPos), toGfx(m_lastDragScreenPos), toWeb(e->possibleActions()),
- toWeb(e->buttons()) | toWeb(e->modifiers()));
+ toWeb(e->buttons()) | toWeb(e->modifiers()), base::DoNothing());
waitForUpdateDragActionCalled();
return toQt(ui::mojom::DragOperation(m_currentDropAction));
}
@@ -1720,7 +1734,7 @@ void WebContentsAdapter::endDragging(QDropEvent *e, const QPointF &screenPos)
m_lastDragClientPos = e->position();
m_lastDragScreenPos = screenPos;
rvh->GetWidget()->DragTargetDrop(*m_currentDropData, toGfx(m_lastDragClientPos), toGfx(m_lastDragScreenPos),
- toWeb(e->buttons()) | toWeb(e->modifiers()));
+ toWeb(e->buttons()) | toWeb(e->modifiers()), base::DoNothing());
m_currentDropData.reset();
}
@@ -1764,7 +1778,7 @@ void WebContentsAdapter::resetSelection()
if (auto rwhv = static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView())) {
if (auto mgr = rwhv->GetTextInputManager())
if (auto selection = const_cast<content::TextInputManager::TextSelection *>(mgr->GetTextSelection(rwhv)))
- selection->SetSelection(base::string16(), 0, gfx::Range(), false);
+ selection->SetSelection(std::u16string(), 0, gfx::Range(), false);
}
}
@@ -2035,7 +2049,7 @@ void WebContentsAdapter::undiscard()
Q_ASSERT(rvh);
if (!rvh->IsRenderViewLive())
static_cast<content::WebContentsImpl *>(m_webContents.get())
- ->CreateRenderViewForRenderManager(rvh, base::nullopt, nullptr);
+ ->CreateRenderViewForRenderManager(rvh, absl::nullopt, nullptr);
m_webContentsDelegate->RenderViewHostChanged(nullptr, rvh);
m_adapterClient->initializationFinished();
m_adapterClient->selectionChanged();
diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h
index 26cfa1b6..9066e7a7 100644
--- a/src/core/web_contents_adapter.h
+++ b/src/core/web_contents_adapter.h
@@ -208,6 +208,7 @@ public:
#if QT_CONFIG(webengine_webchannel)
QWebChannel *webChannel() const;
void setWebChannel(QWebChannel *, uint worldId);
+ WebChannelIPCTransportHost *webChannelTransport() { return m_webChannelTransport.get(); }
#endif
FindTextHelper *findTextHelper();
@@ -239,6 +240,7 @@ public:
// meant to be used within WebEngineCore only
void initialize(content::SiteInstance *site);
content::WebContents *webContents() const;
+ content::WebContents *guestWebContents() const;
void updateRecommendedState();
void setRequestInterceptor(QWebEngineUrlRequestInterceptor *interceptor);
QWebEngineUrlRequestInterceptor* requestInterceptor() const;
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index ef79c8f4..014bbe74 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -180,6 +180,10 @@ static bool shouldUseActualURL(content::NavigationEntry *entry)
if (entry->GetPageType() != content::PAGE_TYPE_NORMAL)
return false;
+ // Show the virtual URL based on custom base, if present
+ if (!entry->GetBaseURLForDataURL().is_empty())
+ return false;
+
// Show invalid data URL
std::string mime_type, charset, data;
if (!net::DataURL::Parse(entry->GetURL(), &mime_type, &charset, &data))
@@ -215,8 +219,8 @@ void WebContentsDelegateQt::NavigationStateChanged(content::WebContents* source,
}
}
-QUrl WebContentsDelegateQt::url(content::WebContents* source) const {
-
+QUrl WebContentsDelegateQt::url(content::WebContents *source) const
+{
content::NavigationEntry *entry = source->GetController().GetVisibleEntry();
QUrl newUrl;
if (entry) {
@@ -227,7 +231,7 @@ QUrl WebContentsDelegateQt::url(content::WebContents* source) const {
GURL strippedUrl = net::SimplifyUrlForRequest(url);
newUrl = QUrl(QString("%1:%2").arg(content::kViewSourceScheme, QString::fromStdString(strippedUrl.spec())));
}
- // If there is a visible entry there are special cases when we dont wan't to use the actual URL
+ // If there is a visible entry there are special cases where we dont wan't to use the actual URL
if (newUrl.isEmpty())
newUrl = shouldUseActualURL(entry) ? toQt(url) : toQt(entry->GetVirtualURL());
}
@@ -513,7 +517,7 @@ void WebContentsDelegateQt::DidFailLoad(content::RenderFrameHost* render_frame_h
return;
}
// Qt6: Consider getting rid of the error_description (Chromium already has)
- base::string16 error_description;
+ std::u16string error_description;
error_description = error_page::LocalizedError::GetErrorDetails(
error_code <= 0 ? error_page::Error::kNetErrorDomain : error_page::Error::kHttpErrorDomain,
error_code, false, false);
@@ -558,10 +562,10 @@ void WebContentsDelegateQt::WebContentsCreated(content::WebContents * /*source_c
static_cast<WebContentsViewQt *>(view)->setFactoryClient(m_viewClient);
}
-content::ColorChooser *WebContentsDelegateQt::OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<blink::mojom::ColorSuggestionPtr> &suggestion)
+std::unique_ptr<content::ColorChooser> WebContentsDelegateQt::OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<blink::mojom::ColorSuggestionPtr> &suggestion)
{
Q_UNUSED(suggestion);
- ColorChooserQt *colorChooser = new ColorChooserQt(source, toQt(color));
+ auto colorChooser = std::make_unique<ColorChooserQt>(source, toQt(color));
m_viewClient->showColorDialog(colorChooser->controller());
return colorChooser;
@@ -603,7 +607,7 @@ void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost * /*frameHos
{
QStringList acceptedMimeTypes;
acceptedMimeTypes.reserve(params.accept_types.size());
- for (std::vector<base::string16>::const_iterator it = params.accept_types.begin(); it < params.accept_types.end(); ++it)
+ for (std::vector<std::u16string>::const_iterator it = params.accept_types.begin(); it < params.accept_types.end(); ++it)
acceptedMimeTypes.append(toQt(*it));
m_filePickerController.reset(createFilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode),
@@ -616,7 +620,7 @@ void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost * /*frameHos
}
bool WebContentsDelegateQt::DidAddMessageToConsole(content::WebContents *source, blink::mojom::ConsoleMessageLevel log_level,
- const base::string16 &message, int32_t line_no, const base::string16 &source_id)
+ const std::u16string &message, int32_t line_no, const std::u16string &source_id)
{
Q_UNUSED(source);
m_viewClient->javaScriptConsoleMessage(mapToJavascriptConsoleMessageLevel(log_level), toQt(message), static_cast<int>(line_no), toQt(source_id));
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 4704f78f..f32dc797 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -126,7 +126,7 @@ public:
void CloseContents(content::WebContents *source) override;
void LoadProgressChanged(double progress) override;
bool HandleKeyboardEvent(content::WebContents *source, const content::NativeWebKeyboardEvent &event) override;
- content::ColorChooser* OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<blink::mojom::ColorSuggestionPtr> &suggestions) override;
+ std::unique_ptr<content::ColorChooser> OpenColorChooser(content::WebContents *source, SkColor color, const std::vector<blink::mojom::ColorSuggestionPtr> &suggestions) override;
void WebContentsCreated(content::WebContents *source_contents, int opener_render_process_id, int opener_render_frame_id,
const std::string &frame_name, const GURL &target_url, content::WebContents *new_contents) override;
content::JavaScriptDialogManager *GetJavaScriptDialogManager(content::WebContents *source) override;
@@ -137,7 +137,7 @@ public:
scoped_refptr<content::FileSelectListener> listener,
const blink::mojom::FileChooserParams& params) override;
bool DidAddMessageToConsole(content::WebContents *source, blink::mojom::ConsoleMessageLevel log_level,
- const base::string16 &message, int32_t line_no, const base::string16 &source_id) override;
+ const std::u16string &message, int32_t line_no, const std::u16string &source_id) override;
void FindReply(content::WebContents *source, int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) override;
void RequestMediaAccessPermission(content::WebContents *web_contents,
const content::MediaStreamRequest &request,
diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h
index 8b59fc34..32fcef69 100644
--- a/src/core/web_contents_view_qt.h
+++ b/src/core/web_contents_view_qt.h
@@ -78,7 +78,7 @@ public:
content::RenderWidgetHostViewBase *CreateViewForChildWidget(content::RenderWidgetHost* render_widget_host) override;
- void SetPageTitle(const base::string16& title) override { }
+ void SetPageTitle(const std::u16string& title) override { }
void RenderViewReady() override { }
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 41aed57e..a0dc4043 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -42,11 +42,13 @@
#include <math.h>
#include "base/base_switches.h"
+#include "base/bind.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/power_monitor/power_monitor.h"
#include "base/power_monitor/power_monitor_device_source.h"
#include "base/run_loop.h"
+#include "base/strings/string_split.h"
#include "base/task/post_task.h"
#include "base/task/sequence_manager/thread_controller_with_message_pump_impl.h"
#include "base/task/thread_pool/thread_pool_instance.h"
@@ -77,7 +79,9 @@
#include "content/public/browser/browser_main_runner.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
+#if QT_CONFIG(webengine_pepper_plugins)
#include "content/public/browser/plugin_service.h"
+#endif
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/common/content_features.h"
@@ -141,6 +145,7 @@
#include <QNetworkProxy>
#include <QtGui/qpa/qplatformintegration.h>
#include <QtGui/private/qguiapplication_p.h>
+#include <QtQuick/private/qsgrhisupport_p.h>
#include <QLoggingCategory>
#if QT_CONFIG(opengl)
@@ -152,40 +157,10 @@ QT_END_NAMESPACE
namespace QtWebEngineCore {
#if QT_CONFIG(opengl)
-static bool usingANGLE()
-{
-#if defined(Q_OS_WIN)
- if (qt_gl_global_share_context())
- return qt_gl_global_share_context()->isOpenGLES();
- return QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGLES;
-#else
- return false;
-#endif
-}
-static bool usingDefaultSGBackend()
+static bool usingSupportedSGBackend()
{
- if (QQuickWindow::graphicsApi() != QSGRendererInterface::OpenGL)
- return false;
-
- const QStringList args = QGuiApplication::arguments();
-
- // follow the logic from contextFactory in src/quick/scenegraph/qsgcontextplugin.cpp
- QString device = QQuickWindow::sceneGraphBackend();
-
- for (int index = 0; index < args.count(); ++index) {
- if (args.at(index).startsWith(QLatin1String("--device="))) {
- device = args.at(index).mid(9);
- break;
- }
- }
-
- if (device.isEmpty())
- device = qEnvironmentVariable("QT_QUICK_BACKEND");
- if (device.isEmpty())
- device = qEnvironmentVariable("QMLSCENE_DEVICE");
-
- return device.isEmpty();
+ return QQuickWindow::graphicsApi() == QSGRendererInterface::OpenGL;
}
bool usingSoftwareDynamicGL()
@@ -206,7 +181,7 @@ bool usingSoftwareDynamicGL()
static const char *getGLType(bool enableGLSoftwareRendering)
{
const char *glType = nullptr;
- const bool tryGL = (usingDefaultSGBackend() && !usingSoftwareDynamicGL()
+ const bool tryGL = (usingSupportedSGBackend() && !usingSoftwareDynamicGL()
&& QGuiApplicationPrivate::platformIntegration()->hasCapability(
QPlatformIntegration::OpenGL))
|| enableGLSoftwareRendering;
@@ -221,7 +196,7 @@ static const char *getGLType(bool enableGLSoftwareRendering)
glType = gl::kGLImplementationDesktopName;
// Check if Core profile was requested and is supported.
if (sharedFormat.profile() == QSurfaceFormat::CoreProfile) {
-#ifdef Q_OS_MACOS
+#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
glType = gl::kGLImplementationCoreProfileName;
#else
qWarning("An OpenGL Core Profile was requested, but it is not supported "
@@ -231,8 +206,7 @@ static const char *getGLType(bool enableGLSoftwareRendering)
}
break;
case QSurfaceFormat::OpenGLES:
- glType = usingANGLE() ? gl::kGLImplementationANGLEName
- : gl::kGLImplementationEGLName;
+ glType = gl::kGLImplementationEGLName;
break;
case QSurfaceFormat::OpenVG:
case QSurfaceFormat::DefaultRenderableType:
@@ -278,13 +252,16 @@ static void logContext(const char *glType, base::CommandLine *cmd)
"Surface Type: %s\n"
"Surface Profile: %s\n"
"Surface Version: %d.%d\n"
- "Using Default SG Backend: %s\n"
+ "QSG RHI Backend: %s\n"
+ "Using Supported QSG Backend: %s\n"
"Using Software Dynamic GL: %s\n"
- "Using Angle: %s\n\n"
+ "Using Multithreaded OpenGL: %s\n\n"
"Init Parameters:\n %s",
glType, type, profile, sharedFormat.majorVersion(), sharedFormat.minorVersion(),
- usingDefaultSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no",
- usingANGLE() ? "yes" : "no", qPrintable(params.join(" ")));
+ qUtf8Printable(QSGRhiSupport::instance()->rhiBackendName()),
+ usingSupportedSGBackend() ? "yes" : "no", usingSoftwareDynamicGL() ? "yes" : "no",
+ !WebEngineContext::isGpuServiceOnUIThread() ? "yes" : "no",
+ qPrintable(params.join(" ")));
#else
qCInfo(webEngineContextLog) << "WebEngine compiled with no opengl enabled.";
#endif //QT_CONFIG(opengl)
@@ -314,26 +291,14 @@ static void setupProxyPac(base::CommandLine *commandLine)
}
}
-static bool waitForViz = false;
-static void completeVizCleanup()
-{
- waitForViz = false;
-}
-
static void cleanupVizProcess()
{
auto gpuChildThread = content::GpuChildThread::instance();
if (!gpuChildThread)
return;
- auto vizMain = gpuChildThread->viz_main();
- auto vizCompositorThreadRunner = vizMain->viz_compositor_thread_runner();
- if (!vizCompositorThreadRunner)
- return;
- waitForViz = true;
content::GetHostFrameSinkManager()->SetConnectionLostCallback(base::DoNothing());
auto factory = static_cast<content::VizProcessTransportFactory*>(content::ImageTransportFactory::GetInstance());
factory->PrepareForShutDown();
- vizCompositorThreadRunner->CleanupForShutdown(base::BindOnce(&completeVizCleanup));
}
static QStringList parseEnvCommandLine(const QString &cmdLine)
@@ -446,10 +411,6 @@ void WebEngineContext::destroy()
// on IO thread (triggered by ~BrowserMainRunner). But by that time the UI
// task runner is not working anymore so we need to do this earlier.
cleanupVizProcess();
- while (waitForViz) {
- flushMessages();
- QThread::msleep(50);
- }
destroyGpuProcess();
// Flush the UI message loop before quitting.
flushMessages();
@@ -742,7 +703,13 @@ WebEngineContext::WebEngineContext()
if (glType) {
#if QT_CONFIG(opengl)
- parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType);
+#if defined(Q_OS_WIN)
+ // See below
+ if (glType == gl::kGLImplementationCoreProfileName)
+ parsedCommandLine->AppendSwitchASCII(switches::kUseGL, gl::kGLImplementationDesktopName);
+ else
+#endif
+ parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType);
parsedCommandLine->AppendSwitch(switches::kInProcessGPU);
if (enableGLSoftwareRendering) {
parsedCommandLine->AppendSwitch(switches::kDisableGpuRasterization);
@@ -757,28 +724,20 @@ WebEngineContext::WebEngineContext()
// Core Profile context, even if Qt uses a legacy profile, which causes
// "Could not share GL contexts" warnings, because it's not possible to share between Core and
// legacy profiles. See GLContextWGL::Initialize().
- // Given that Desktop GL Core profile is not currently supported on Windows anyway, pass this
- // switch to get rid of the warnings.
- //
- // The switch is also used to determine which version of OpenGL ES to use (2 or 3) when using
- // ANGLE.
- // If the switch is not set, Chromium will always try to create an ES3 context, even if Qt uses
- // an ES2 context, which causes resource sharing issues (black screen),
- // see gpu::gles2::GenerateGLContextAttribs().
- // Make sure to disable ES3 context creation when using ES2.
- const bool isGLES2Context = QOpenGLContext::globalShareContext()->isOpenGLES()
- && QOpenGLContext::globalShareContext()->format().majorVersion() == 2;
- if (!usingANGLE() || isGLES2Context)
+ if (glType != gl::kGLImplementationCoreProfileName)
parsedCommandLine->AppendSwitch(switches::kDisableES3GLContext);
#endif
#endif //QT_CONFIG(opengl)
} else {
+ parsedCommandLine->AppendSwitchASCII(switches::kUseGL, "disabled");
parsedCommandLine->AppendSwitch(switches::kDisableGpu);
+ parsedCommandLine->AppendSwitch(switches::kInProcessGPU);
}
registerMainThreadFactories();
content::ContentMainParams contentMainParams(m_mainDelegate.get());
+ contentMainParams.setup_signal_handlers = false;
#if defined(OS_WIN)
contentMainParams.sandbox_info = QtWebEngineSandbox::staticSandboxInterfaceInfo();
sandbox::SandboxInterfaceInfo sandbox_info = {0};
@@ -793,8 +752,8 @@ WebEngineContext::WebEngineContext()
mojoConfiguration.is_broker_process = true;
mojo::core::Init(mojoConfiguration);
- // This block mirrors ContentMainRunnerImpl::RunServiceManager():
- m_mainDelegate->PreCreateMainMessageLoop();
+ // This block mirrors ContentMainRunnerImpl::RunBrowser():
+ m_mainDelegate->PreBrowserMain();
base::MessagePump::OverrideMessagePumpForUIFactory(messagePumpFactory);
content::BrowserTaskExecutor::Create();
m_mainDelegate->PostEarlyInitialization(false);
@@ -828,11 +787,6 @@ WebEngineContext::WebEngineContext()
base::ThreadRestrictions::SetIOAllowed(true);
- if (parsedCommandLine->HasSwitch(network::switches::kExplicitlyAllowedPorts)) {
- std::string allowedPorts = parsedCommandLine->GetSwitchValueASCII(network::switches::kExplicitlyAllowedPorts);
- net::SetExplicitlyAllowedPorts(allowedPorts);
- }
-
#if defined(OS_LINUX)
media::AudioManager::SetGlobalAppName(QCoreApplication::applicationName().toStdString());
#endif
@@ -844,7 +798,7 @@ WebEngineContext::WebEngineContext()
// be created from the FILE thread, and that GetPluginInfoArray is synchronous, it
// can't loads plugins synchronously from the IO thread to serve the render process' request
// and we need to make sure that it happened beforehand.
- content::PluginService::GetInstance()->GetPlugins(base::Bind(&dummyGetPluginCallback));
+ content::PluginService::GetInstance()->GetPlugins(base::BindOnce(&dummyGetPluginCallback));
#endif
#if QT_CONFIG(webengine_printing_and_pdf)
@@ -908,7 +862,7 @@ base::CommandLine* WebEngineContext::commandLine() {
argv.resize(appArgs.size());
#if defined(Q_OS_WIN)
for (int i = 0; i < appArgs.size(); ++i)
- argv[i] = toString16(appArgs[i]);
+ argv[i] = appArgs[i].toStdWString();
#else
for (int i = 0; i < appArgs.size(); ++i)
argv[i] = appArgs[i].toStdString();
@@ -963,7 +917,7 @@ const char *qWebEngineChromiumVersion() noexcept
*/
const char *qWebEngineChromiumSecurityPatchVersion() noexcept
{
- return "92.0.4515.166"; // FIXME: Remember to update
+ return "94.0.4606.126"; // FIXME: Remember to update
}
QT_END_NAMESPACE
diff --git a/src/core/web_engine_error.cpp b/src/core/web_engine_error.cpp
index 0d326473..52a84494 100644
--- a/src/core/web_engine_error.cpp
+++ b/src/core/web_engine_error.cpp
@@ -44,12 +44,10 @@ const int WebEngineError::UserAbortedError = net::ERR_ABORTED;
namespace {
const int noError = 0;
-const int systemRelatedErrors = -1;
const int connectionRelatedErrors = -100;
const int certificateErrors = -200;
const int httpErrors = -300;
const int cacheErrors = -400;
-const int internalErrors = -500;
const int ftpErrors = -600;
const int certificateManagerErrors = -700;
const int dnsResolverErrors = -800;
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 6b11cf0c..8f580e53 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -347,7 +347,7 @@ base::FilePath WebEngineLibraryInfo::getPath(int key)
return toFilePath(directory.isEmpty() ? fallbackDir() : directory);
}
-base::string16 WebEngineLibraryInfo::getApplicationName()
+std::u16string WebEngineLibraryInfo::getApplicationName()
{
return toString16(qApp->applicationName());
}
diff --git a/src/core/web_engine_library_info.h b/src/core/web_engine_library_info.h
index e7dc195f..2926365b 100644
--- a/src/core/web_engine_library_info.h
+++ b/src/core/web_engine_library_info.h
@@ -42,7 +42,6 @@
#define WEB_ENGINE_LIBRARY_INFO_H
#include "base/files/file_path.h"
-#include "base/strings/string16.h"
#include <QString>
enum {
@@ -56,7 +55,7 @@ class WebEngineLibraryInfo {
public:
static base::FilePath getPath(int key);
// Called by localized_error in our custom chrome layer
- static base::string16 getApplicationName();
+ static std::u16string getApplicationName();
static std::string getResolvedLocale();
static std::string getApplicationLocale();
#if defined(OS_WIN)
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index 45d5bcfc..007249f4 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -50,6 +50,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_switches.h"
#include "media/base/media_switches.h"
+#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
#include "third_party/blink/public/common/renderer_preferences/renderer_preferences.h"
#include "third_party/blink/public/common/web_preferences/web_preferences.h"
@@ -438,7 +439,7 @@ void WebEngineSettings::applySettingsToWebPreferences(blink::web_pref::WebPrefer
}
// Apply native CaptionStyle parameters.
- base::Optional<ui::CaptionStyle> style;
+ absl::optional<ui::CaptionStyle> style;
if (base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kForceCaptionStyle)) {
style = ui::CaptionStyle::FromSpec(
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kForceCaptionStyle));
diff --git a/src/core/web_usb_detector_qt.cpp b/src/core/web_usb_detector_qt.cpp
index 0fd89833..5ae155a2 100644
--- a/src/core/web_usb_detector_qt.cpp
+++ b/src/core/web_usb_detector_qt.cpp
@@ -43,6 +43,7 @@
#include "content/public/browser/device_service.h"
#include "device/base/features.h"
+#include "services/device/public/mojom/usb_device.mojom.h"
WebUsbDetectorQt::WebUsbDetectorQt() = default;
diff --git a/src/gn/CMakeLists.txt b/src/gn/CMakeLists.txt
index 4d25debb..a76d1dce 100644
--- a/src/gn/CMakeLists.txt
+++ b/src/gn/CMakeLists.txt
@@ -17,7 +17,7 @@ set(GN_SOURCE_DIR ${WEBENGINE_ROOT_SOURCE_DIR}/src/3rdparty/gn)
set(GN_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${WEBENGINE_ROOT_SOURCE_DIR}/cmake")
-find_package(Python2 REQUIRED)
+find_package(Python3 REQUIRED)
find_package(Ninja 1.7.2 REQUIRED)
if(WIN32)
@@ -30,7 +30,7 @@ file(MAKE_DIRECTORY ${GN_BINARY_DIR})
add_custom_command(
OUTPUT ${GN_EXECUTABLE}
WORKING_DIRECTORY ${GN_BINARY_DIR}
- COMMAND ${Python2_EXECUTABLE} ${GN_SOURCE_DIR}/build/gen.py
+ COMMAND ${Python3_EXECUTABLE} ${GN_SOURCE_DIR}/build/gen.py
--no-last-commit-position
--out-path ${GN_BINARY_DIR}/$<CONFIG>
--cc ${CMAKE_C_COMPILER}
diff --git a/src/ninja/CMakeLists.txt b/src/ninja/CMakeLists.txt
index f7ece52d..6f43b89f 100644
--- a/src/ninja/CMakeLists.txt
+++ b/src/ninja/CMakeLists.txt
@@ -10,7 +10,7 @@ project(Ninja
set(NINJA_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../3rdparty/ninja)
set(NINJA_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
-find_package(Python2 REQUIRED)
+find_package(Python3 REQUIRED)
if(WIN32)
set(NINJA_EXECUTABLE ninja.exe)
@@ -25,7 +25,7 @@ add_custom_command(
WORKING_DIRECTORY ${NINJA_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory ${NINJA_BINARY_DIR}/$<CONFIG>
COMMAND ${CMAKE_COMMAND} -E chdir ${NINJA_BINARY_DIR}/$<CONFIG>
- ${Python2_EXECUTABLE} ${NINJA_SOURCE_DIR}/configure.py --bootstrap
+ ${Python3_EXECUTABLE} ${NINJA_SOURCE_DIR}/configure.py --bootstrap
USES_TERMINAL
VERBATIM
)
diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
index 9e4004ad..12a1c829 100644
--- a/src/pdf/CMakeLists.txt
+++ b/src/pdf/CMakeLists.txt
@@ -1,7 +1,6 @@
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)
create_pkg_config_host_wrapper(${CMAKE_CURRENT_BINARY_DIR})
@@ -99,10 +98,12 @@ foreach(arch ${archs})
list(APPEND gnArgArg
qtwebengine_target="${buildDir}/${config}/${arch}:QtPdf"
+ enable_ipc_fuzzer=false
enable_remoting=false
enable_resource_allowlist_generation=false
enable_web_speech=false
chrome_pgo_phase=0
+ strip_absolute_paths_from_debug_symbols=false
)
if(LINUX)
diff --git a/src/pdf/doc/snippets/qtpdf-build.cmake b/src/pdf/doc/snippets/qtpdf-build.cmake
index d46b9c3e..b4372d41 100644
--- a/src/pdf/doc/snippets/qtpdf-build.cmake
+++ b/src/pdf/doc/snippets/qtpdf-build.cmake
@@ -1,2 +1,2 @@
-find_package(Qt5 COMPONENTS Pdf REQUIRED)
-target_link_libraries(mytarget Qt5::Pdf)
+find_package(Qt6 REQUIRED COMPONENTS Pdf)
+target_link_libraries(mytarget Qt6::Pdf)
diff --git a/src/pdf/plugins/imageformats/pdf/CMakeLists.txt b/src/pdf/plugins/imageformats/pdf/CMakeLists.txt
index ee290782..517d152c 100644
--- a/src/pdf/plugins/imageformats/pdf/CMakeLists.txt
+++ b/src/pdf/plugins/imageformats/pdf/CMakeLists.txt
@@ -1,6 +1,6 @@
qt_internal_add_plugin(QPdfPlugin
OUTPUT_NAME qpdf
- TYPE imageformats
+ PLUGIN_TYPE imageformats
SOURCES
main.cpp
qpdfiohandler.cpp qpdfiohandler_p.h
diff --git a/src/pdf/plugins/imageformats/pdf/main.cpp b/src/pdf/plugins/imageformats/pdf/main.cpp
index b4d59353..c5ad4da0 100644
--- a/src/pdf/plugins/imageformats/pdf/main.cpp
+++ b/src/pdf/plugins/imageformats/pdf/main.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2019 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp b/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
index 4f610935..76b38ce8 100644
--- a/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
+++ b/src/pdf/plugins/imageformats/pdf/qpdfiohandler.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2019 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h b/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
index 99a91154..562909f0 100644
--- a/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
+++ b/src/pdf/plugins/imageformats/pdf/qpdfiohandler_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2019 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdfbookmarkmodel.cpp b/src/pdf/qpdfbookmarkmodel.cpp
index 0450870a..8d8bb197 100644
--- a/src/pdf/qpdfbookmarkmodel.cpp
+++ b/src/pdf/qpdfbookmarkmodel.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -224,6 +227,8 @@ QPdfBookmarkModel::QPdfBookmarkModel(QObject *parent)
{
}
+QPdfBookmarkModel::~QPdfBookmarkModel() = default;
+
QPdfDocument* QPdfBookmarkModel::document() const
{
Q_D(const QPdfBookmarkModel);
diff --git a/src/pdf/qpdfbookmarkmodel.h b/src/pdf/qpdfbookmarkmodel.h
index 8e06a154..315222a6 100644
--- a/src/pdf/qpdfbookmarkmodel.h
+++ b/src/pdf/qpdfbookmarkmodel.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -68,7 +71,9 @@ public:
};
Q_ENUM(Role)
- explicit QPdfBookmarkModel(QObject *parent = nullptr);
+ QPdfBookmarkModel() : QPdfBookmarkModel(nullptr) {}
+ explicit QPdfBookmarkModel(QObject *parent);
+ ~QPdfBookmarkModel() override;
QPdfDocument* document() const;
void setDocument(QPdfDocument *document);
diff --git a/src/pdf/qpdfdestination.cpp b/src/pdf/qpdfdestination.cpp
index b70e031c..33ec391d 100644
--- a/src/pdf/qpdfdestination.cpp
+++ b/src/pdf/qpdfdestination.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -68,25 +71,10 @@ QPdfDestination::QPdfDestination(QPdfDestinationPrivate *d)
{
}
-QPdfDestination::QPdfDestination(const QPdfDestination &other)
- : d(other.d)
-{
-}
-
-QPdfDestination::QPdfDestination(QPdfDestination &&other) noexcept
- : d(std::move(other.d))
-{
-}
-
-QPdfDestination::~QPdfDestination()
-{
-}
-
-QPdfDestination &QPdfDestination::operator=(const QPdfDestination &other)
-{
- d = other.d;
- return *this;
-}
+QPdfDestination::~QPdfDestination() = default;
+QPdfDestination::QPdfDestination(const QPdfDestination &other) = default;
+QPdfDestination::QPdfDestination(QPdfDestination &&other) noexcept = default;
+QPdfDestination &QPdfDestination::operator=(const QPdfDestination &other) = default;
/*!
\property QPdfDestination::valid
diff --git a/src/pdf/qpdfdestination.h b/src/pdf/qpdfdestination.h
index f9c186ff..e445f0e5 100644
--- a/src/pdf/qpdfdestination.h
+++ b/src/pdf/qpdfdestination.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -47,25 +50,28 @@ QT_BEGIN_NAMESPACE
class QPdfDestinationPrivate;
-class Q_PDF_EXPORT QPdfDestination
+class QPdfDestination
{
- Q_GADGET
+ Q_GADGET_EXPORT(Q_PDF_EXPORT)
Q_PROPERTY(bool valid READ isValid)
Q_PROPERTY(int page READ page)
Q_PROPERTY(QPointF location READ location)
Q_PROPERTY(qreal zoom READ zoom)
public:
- ~QPdfDestination();
- QPdfDestination(const QPdfDestination &other);
- QPdfDestination &operator=(const QPdfDestination &other);
- QPdfDestination(QPdfDestination &&other) noexcept;
- QPdfDestination &operator=(QPdfDestination &&other) noexcept { swap(other); return *this; }
+ Q_PDF_EXPORT ~QPdfDestination();
+ Q_PDF_EXPORT QPdfDestination(const QPdfDestination &other);
+ Q_PDF_EXPORT QPdfDestination &operator=(const QPdfDestination &other);
+
+ Q_PDF_EXPORT QPdfDestination(QPdfDestination &&other) noexcept;
+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QPdfDestination)
+
void swap(QPdfDestination &other) noexcept { d.swap(other.d); }
- bool isValid() const;
- int page() const;
- QPointF location() const;
- qreal zoom() const;
+
+ Q_PDF_EXPORT bool isValid() const;
+ Q_PDF_EXPORT int page() const;
+ Q_PDF_EXPORT QPointF location() const;
+ Q_PDF_EXPORT qreal zoom() const;
protected:
QPdfDestination();
@@ -77,6 +83,7 @@ protected:
protected:
QExplicitlySharedDataPointer<QPdfDestinationPrivate> d;
};
+Q_DECLARE_SHARED(QPdfDestination)
Q_PDF_EXPORT QDebug operator<<(QDebug, const QPdfDestination &);
diff --git a/src/pdf/qpdfdestination_p.h b/src/pdf/qpdfdestination_p.h
index 3520fb79..f1e63912 100644
--- a/src/pdf/qpdfdestination_p.h
+++ b/src/pdf/qpdfdestination_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -48,6 +51,8 @@
// We mean it.
//
+#include "qpdfdestination.h"
+
#include <QPointF>
QT_BEGIN_NAMESPACE
diff --git a/src/pdf/qpdfdocument.cpp b/src/pdf/qpdfdocument.cpp
index dffc1e11..5a6dca99 100644
--- a/src/pdf/qpdfdocument.cpp
+++ b/src/pdf/qpdfdocument.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdfdocument.h b/src/pdf/qpdfdocument.h
index 54ca687f..9a81d4a8 100644
--- a/src/pdf/qpdfdocument.h
+++ b/src/pdf/qpdfdocument.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -90,7 +93,8 @@ public:
};
Q_ENUM(MetaDataField)
- explicit QPdfDocument(QObject *parent = nullptr);
+ QPdfDocument() : QPdfDocument(nullptr) {}
+ explicit QPdfDocument(QObject *parent);
~QPdfDocument();
DocumentError load(const QString &fileName);
diff --git a/src/pdf/qpdfdocument_p.h b/src/pdf/qpdfdocument_p.h
index b6ee2dfd..9c816adc 100644
--- a/src/pdf/qpdfdocument_p.h
+++ b/src/pdf/qpdfdocument_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdfdocumentrenderoptions.h b/src/pdf/qpdfdocumentrenderoptions.h
index cafb4716..a30feac2 100644
--- a/src/pdf/qpdfdocumentrenderoptions.h
+++ b/src/pdf/qpdfdocumentrenderoptions.h
@@ -2,34 +2,37 @@
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -47,22 +50,22 @@ QT_BEGIN_NAMESPACE
class QPdfDocumentRenderOptions
{
public:
- Q_DECL_CONSTEXPR QPdfDocumentRenderOptions() noexcept : m_renderFlags(0), m_rotation(0), m_reserved(0) {}
+ constexpr QPdfDocumentRenderOptions() noexcept : m_renderFlags(0), m_rotation(0), m_reserved(0) {}
- Q_DECL_CONSTEXPR QPdf::Rotation rotation() const noexcept { return static_cast<QPdf::Rotation>(m_rotation); }
- Q_DECL_RELAXED_CONSTEXPR void setRotation(QPdf::Rotation r) noexcept { m_rotation = r; }
+ constexpr QPdf::Rotation rotation() const noexcept { return static_cast<QPdf::Rotation>(m_rotation); }
+ constexpr void setRotation(QPdf::Rotation r) noexcept { m_rotation = r; }
- Q_DECL_CONSTEXPR QPdf::RenderFlags renderFlags() const noexcept { return static_cast<QPdf::RenderFlags>(m_renderFlags); }
- Q_DECL_RELAXED_CONSTEXPR void setRenderFlags(QPdf::RenderFlags r) noexcept { m_renderFlags = r; }
+ constexpr QPdf::RenderFlags renderFlags() const noexcept { return static_cast<QPdf::RenderFlags>(m_renderFlags); }
+ constexpr void setRenderFlags(QPdf::RenderFlags r) noexcept { m_renderFlags = r; }
- Q_DECL_CONSTEXPR QRect scaledClipRect() const noexcept { return m_clipRect; }
- Q_DECL_RELAXED_CONSTEXPR void setScaledClipRect(const QRect &r) noexcept { m_clipRect = r; }
+ constexpr QRect scaledClipRect() const noexcept { return m_clipRect; }
+ constexpr void setScaledClipRect(const QRect &r) noexcept { m_clipRect = r; }
- Q_DECL_CONSTEXPR QSize scaledSize() const noexcept { return m_scaledSize; }
- Q_DECL_RELAXED_CONSTEXPR void setScaledSize(const QSize &s) noexcept { m_scaledSize = s; }
+ constexpr QSize scaledSize() const noexcept { return m_scaledSize; }
+ constexpr void setScaledSize(const QSize &s) noexcept { m_scaledSize = s; }
private:
- friend Q_DECL_CONSTEXPR inline bool operator==(QPdfDocumentRenderOptions lhs, QPdfDocumentRenderOptions rhs) noexcept;
+ friend constexpr inline bool operator==(QPdfDocumentRenderOptions lhs, QPdfDocumentRenderOptions rhs) noexcept;
QRect m_clipRect;
QSize m_scaledSize;
@@ -75,14 +78,14 @@ private:
Q_DECLARE_TYPEINFO(QPdfDocumentRenderOptions, Q_PRIMITIVE_TYPE);
-Q_DECL_CONSTEXPR inline bool operator==(QPdfDocumentRenderOptions lhs, QPdfDocumentRenderOptions rhs) noexcept
+constexpr inline bool operator==(QPdfDocumentRenderOptions lhs, QPdfDocumentRenderOptions rhs) noexcept
{
return lhs.m_clipRect == rhs.m_clipRect && lhs.m_scaledSize == rhs.m_scaledSize &&
lhs.m_renderFlags == rhs.m_renderFlags && lhs.m_rotation == rhs.m_rotation &&
lhs.m_reserved == rhs.m_reserved && lhs.m_reserved2 == rhs.m_reserved2; // fix -Wunused-private-field
}
-Q_DECL_CONSTEXPR inline bool operator!=(QPdfDocumentRenderOptions lhs, QPdfDocumentRenderOptions rhs) noexcept
+constexpr inline bool operator!=(QPdfDocumentRenderOptions lhs, QPdfDocumentRenderOptions rhs) noexcept
{
return !operator==(lhs, rhs);
}
diff --git a/src/pdf/qpdfdocumentrenderoptions.qdoc b/src/pdf/qpdfdocumentrenderoptions.qdoc
index b8b50627..8e03df88 100644
--- a/src/pdf/qpdfdocumentrenderoptions.qdoc
+++ b/src/pdf/qpdfdocumentrenderoptions.qdoc
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdflinkmodel.cpp b/src/pdf/qpdflinkmodel.cpp
index 5c2596bb..93d39020 100644
--- a/src/pdf/qpdflinkmodel.cpp
+++ b/src/pdf/qpdflinkmodel.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdflinkmodel_p.h b/src/pdf/qpdflinkmodel_p.h
index cf9c0aad..495370fe 100644
--- a/src/pdf/qpdflinkmodel_p.h
+++ b/src/pdf/qpdflinkmodel_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdflinkmodel_p_p.h b/src/pdf/qpdflinkmodel_p_p.h
index 0606b474..14c8bc73 100644
--- a/src/pdf/qpdflinkmodel_p_p.h
+++ b/src/pdf/qpdflinkmodel_p_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdfnamespace.h b/src/pdf/qpdfnamespace.h
index e76d0abd..9c2d3bf0 100644
--- a/src/pdf/qpdfnamespace.h
+++ b/src/pdf/qpdfnamespace.h
@@ -2,34 +2,37 @@
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -38,12 +41,13 @@
#ifndef QPDFNAMESPACE_H
#define QPDFNAMESPACE_H
+#include <QtPdf/qtpdfglobal.h>
#include <QtCore/qobject.h>
QT_BEGIN_NAMESPACE
namespace QPdf {
- Q_NAMESPACE
+ Q_NAMESPACE_EXPORT(Q_PDF_EXPORT)
enum Rotation {
Rotate0,
@@ -65,9 +69,8 @@ namespace QPdf {
};
Q_FLAG_NS(RenderFlag)
Q_DECLARE_FLAGS(RenderFlags, RenderFlag)
+ Q_DECLARE_OPERATORS_FOR_FLAGS(RenderFlags)
}
-Q_DECLARE_OPERATORS_FOR_FLAGS(QPdf::RenderFlags)
-
QT_END_NAMESPACE
#endif
diff --git a/src/pdf/qpdfnamespace.qdoc b/src/pdf/qpdfnamespace.qdoc
index 96bb090e..3dbe5959 100644
--- a/src/pdf/qpdfnamespace.qdoc
+++ b/src/pdf/qpdfnamespace.qdoc
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdfpagenavigation.cpp b/src/pdf/qpdfpagenavigation.cpp
index 031b3896..41066252 100644
--- a/src/pdf/qpdfpagenavigation.cpp
+++ b/src/pdf/qpdfpagenavigation.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdfpagenavigation.h b/src/pdf/qpdfpagenavigation.h
index dc412c33..9c967bad 100644
--- a/src/pdf/qpdfpagenavigation.h
+++ b/src/pdf/qpdfpagenavigation.h
@@ -2,34 +2,37 @@
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -58,7 +61,8 @@ class Q_PDF_EXPORT QPdfPageNavigation : public QObject
Q_PROPERTY(bool canGoToNextPage READ canGoToNextPage NOTIFY canGoToNextPageChanged)
public:
- explicit QPdfPageNavigation(QObject *parent = nullptr);
+ QPdfPageNavigation() : QPdfPageNavigation(nullptr) {}
+ explicit QPdfPageNavigation(QObject *parent);
~QPdfPageNavigation();
QPdfDocument* document() const;
diff --git a/src/pdf/qpdfpagerenderer.cpp b/src/pdf/qpdfpagerenderer.cpp
index 8be0cfa2..9d0ff18f 100644
--- a/src/pdf/qpdfpagerenderer.cpp
+++ b/src/pdf/qpdfpagerenderer.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdfpagerenderer.h b/src/pdf/qpdfpagerenderer.h
index faeaef8a..0898e03e 100644
--- a/src/pdf/qpdfpagerenderer.h
+++ b/src/pdf/qpdfpagerenderer.h
@@ -2,34 +2,37 @@
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -64,7 +67,8 @@ public:
};
Q_ENUM(RenderMode)
- explicit QPdfPageRenderer(QObject *parent = nullptr);
+ QPdfPageRenderer() : QPdfPageRenderer(nullptr) {}
+ explicit QPdfPageRenderer(QObject *parent);
~QPdfPageRenderer() override;
RenderMode renderMode() const;
diff --git a/src/pdf/qpdfsearchmodel.cpp b/src/pdf/qpdfsearchmodel.cpp
index 4d4e86ce..e515cabf 100644
--- a/src/pdf/qpdfsearchmodel.cpp
+++ b/src/pdf/qpdfsearchmodel.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -123,7 +126,7 @@ QString QPdfSearchModel::searchString() const
return d->searchString;
}
-void QPdfSearchModel::setSearchString(QString searchString)
+void QPdfSearchModel::setSearchString(const QString &searchString)
{
Q_D(QPdfSearchModel);
if (d->searchString == searchString)
diff --git a/src/pdf/qpdfsearchmodel.h b/src/pdf/qpdfsearchmodel.h
index 1a413c76..d051fdc4 100644
--- a/src/pdf/qpdfsearchmodel.h
+++ b/src/pdf/qpdfsearchmodel.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -63,7 +66,8 @@ public:
_Count
};
Q_ENUM(Role)
- explicit QPdfSearchModel(QObject *parent = nullptr);
+ QPdfSearchModel() : QPdfSearchModel(nullptr) {}
+ explicit QPdfSearchModel(QObject *parent);
~QPdfSearchModel();
QList<QPdfSearchResult> resultsOnPage(int page) const;
@@ -77,7 +81,7 @@ public:
QVariant data(const QModelIndex &index, int role) const override;
public Q_SLOTS:
- void setSearchString(QString searchString);
+ void setSearchString(const QString &searchString);
void setDocument(QPdfDocument *document);
Q_SIGNALS:
diff --git a/src/pdf/qpdfsearchmodel_p.h b/src/pdf/qpdfsearchmodel_p.h
index 551eff47..3b89f5f3 100644
--- a/src/pdf/qpdfsearchmodel_p.h
+++ b/src/pdf/qpdfsearchmodel_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdf/qpdfsearchresult.cpp b/src/pdf/qpdfsearchresult.cpp
index 629a8765..7c096868 100644
--- a/src/pdf/qpdfsearchresult.cpp
+++ b/src/pdf/qpdfsearchresult.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -42,12 +45,19 @@ QT_BEGIN_NAMESPACE
QPdfSearchResult::QPdfSearchResult() :
QPdfSearchResult(new QPdfSearchResultPrivate()) { }
-QPdfSearchResult::QPdfSearchResult(int page, QList<QRectF> rects, QString contextBefore, QString contextAfter) :
- QPdfSearchResult(new QPdfSearchResultPrivate(page, rects, contextBefore, contextAfter)) { }
+QPdfSearchResult::QPdfSearchResult(int page, QList<QRectF> rects,
+ QString contextBefore, QString contextAfter)
+ : QPdfSearchResult(new QPdfSearchResultPrivate(page, std::move(rects),
+ std::move(contextBefore),
+ std::move(contextAfter)))
+{
+}
QPdfSearchResult::QPdfSearchResult(QPdfSearchResultPrivate *d) :
QPdfDestination(static_cast<QPdfDestinationPrivate *>(d)) { }
+QPdfSearchResult::~QPdfSearchResult() = default;
+
QString QPdfSearchResult::contextBefore() const
{
return static_cast<QPdfSearchResultPrivate *>(d.data())->contextBefore;
diff --git a/src/pdf/qpdfsearchresult.h b/src/pdf/qpdfsearchresult.h
index 0acf03d5..f191b008 100644
--- a/src/pdf/qpdfsearchresult.h
+++ b/src/pdf/qpdfsearchresult.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -46,20 +49,20 @@ QT_BEGIN_NAMESPACE
class QPdfSearchResultPrivate;
-class Q_PDF_EXPORT QPdfSearchResult : public QPdfDestination
+class QPdfSearchResult : public QPdfDestination
{
- Q_GADGET
+ Q_GADGET_EXPORT(Q_PDF_EXPORT)
Q_PROPERTY(QString contextBefore READ contextBefore)
Q_PROPERTY(QString contextAfter READ contextAfter)
Q_PROPERTY(QList<QRectF> rectangles READ rectangles)
public:
- QPdfSearchResult();
- ~QPdfSearchResult() {}
+ Q_PDF_EXPORT QPdfSearchResult();
+ Q_PDF_EXPORT ~QPdfSearchResult();
- QString contextBefore() const;
- QString contextAfter() const;
- QList<QRectF> rectangles() const;
+ Q_PDF_EXPORT QString contextBefore() const;
+ Q_PDF_EXPORT QString contextAfter() const;
+ Q_PDF_EXPORT QList<QRectF> rectangles() const;
private:
QPdfSearchResult(int page, QList<QRectF> rects, QString contextBefore, QString contextAfter);
@@ -68,6 +71,7 @@ private:
friend class QPdfSearchModelPrivate;
friend class QQuickPdfNavigationStack;
};
+Q_DECLARE_SHARED(QPdfSearchResult)
Q_PDF_EXPORT QDebug operator<<(QDebug, const QPdfSearchResult &);
diff --git a/src/pdf/qpdfsearchresult_p.h b/src/pdf/qpdfsearchresult_p.h
index eca37890..2ad25aa6 100644
--- a/src/pdf/qpdfsearchresult_p.h
+++ b/src/pdf/qpdfsearchresult_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -48,6 +51,8 @@
// We mean it.
//
+#include "qpdfsearchresult.h"
+
#include "qpdfdestination_p.h"
QT_BEGIN_NAMESPACE
@@ -58,9 +63,9 @@ public:
QPdfSearchResultPrivate() = default;
QPdfSearchResultPrivate(int page, QList<QRectF> rects, QString contextBefore, QString contextAfter) :
QPdfDestinationPrivate(page, rects.first().topLeft(), 0),
- contextBefore(contextBefore),
- contextAfter(contextAfter),
- rects(rects) {}
+ contextBefore{std::move(contextBefore)},
+ contextAfter{std::move(contextAfter)},
+ rects{std::move(rects)} {}
QString contextBefore;
QString contextAfter;
diff --git a/src/pdf/qpdfselection.cpp b/src/pdf/qpdfselection.cpp
index 2b263f44..514d8a0e 100644
--- a/src/pdf/qpdfselection.cpp
+++ b/src/pdf/qpdfselection.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -77,25 +80,10 @@ QPdfSelection::QPdfSelection(QPdfSelectionPrivate *d)
{
}
-QPdfSelection::QPdfSelection(const QPdfSelection &other)
- : d(other.d)
-{
-}
-
-QPdfSelection::QPdfSelection(QPdfSelection &&other) noexcept
- : d(std::move(other.d))
-{
-}
-
-QPdfSelection::~QPdfSelection()
-{
-}
-
-QPdfSelection &QPdfSelection::operator=(const QPdfSelection &other)
-{
- d = other.d;
- return *this;
-}
+QPdfSelection::~QPdfSelection() = default;
+QPdfSelection::QPdfSelection(const QPdfSelection &other) = default;
+QPdfSelection::QPdfSelection(QPdfSelection &&other) noexcept = default;
+QPdfSelection &QPdfSelection::operator=(const QPdfSelection &other) = default;
/*!
\property QPdfSelection::valid
diff --git a/src/pdf/qpdfselection.h b/src/pdf/qpdfselection.h
index 70077fdb..dbd9dff4 100644
--- a/src/pdf/qpdfselection.h
+++ b/src/pdf/qpdfselection.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -48,9 +51,9 @@ QT_BEGIN_NAMESPACE
class QPdfSelectionPrivate;
-class Q_PDF_EXPORT QPdfSelection
+class QPdfSelection
{
- Q_GADGET
+ Q_GADGET_EXPORT(Q_PDF_EXPORT)
Q_PROPERTY(bool valid READ isValid)
Q_PROPERTY(QList<QPolygonF> bounds READ bounds)
Q_PROPERTY(QRectF boundingRectangle READ boundingRectangle)
@@ -59,20 +62,23 @@ class Q_PDF_EXPORT QPdfSelection
Q_PROPERTY(int endIndex READ endIndex)
public:
- ~QPdfSelection();
- QPdfSelection(const QPdfSelection &other);
- QPdfSelection &operator=(const QPdfSelection &other);
- QPdfSelection(QPdfSelection &&other) noexcept;
- QPdfSelection &operator=(QPdfSelection &&other) noexcept { swap(other); return *this; }
+ Q_PDF_EXPORT ~QPdfSelection();
+ Q_PDF_EXPORT QPdfSelection(const QPdfSelection &other);
+ Q_PDF_EXPORT QPdfSelection &operator=(const QPdfSelection &other);
+
+ Q_PDF_EXPORT QPdfSelection(QPdfSelection &&other) noexcept;
+ QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_MOVE_AND_SWAP(QPdfSelection)
+
void swap(QPdfSelection &other) noexcept { d.swap(other.d); }
- bool isValid() const;
- QList<QPolygonF> bounds() const;
- QString text() const;
- QRectF boundingRectangle() const;
- int startIndex() const;
- int endIndex() const;
+
+ Q_PDF_EXPORT bool isValid() const;
+ Q_PDF_EXPORT QList<QPolygonF> bounds() const;
+ Q_PDF_EXPORT QString text() const;
+ Q_PDF_EXPORT QRectF boundingRectangle() const;
+ Q_PDF_EXPORT int startIndex() const;
+ Q_PDF_EXPORT int endIndex() const;
#if QT_CONFIG(clipboard)
- void copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const;
+ Q_PDF_EXPORT void copyToClipboard(QClipboard::Mode mode = QClipboard::Clipboard) const;
#endif
private:
@@ -85,6 +91,7 @@ private:
private:
QExplicitlySharedDataPointer<QPdfSelectionPrivate> d;
};
+Q_DECLARE_SHARED(QPdfSelection)
QT_END_NAMESPACE
diff --git a/src/pdf/qpdfselection_p.h b/src/pdf/qpdfselection_p.h
index 0c176b32..b3056536 100644
--- a/src/pdf/qpdfselection_p.h
+++ b/src/pdf/qpdfselection_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -48,6 +51,8 @@
// We mean it.
//
+#include "qpdfselection.h"
+
#include <QList>
#include <QPolygonF>
diff --git a/src/pdf/qtpdfglobal.h b/src/pdf/qtpdfglobal.h
index 8b4b0c20..b31917b6 100644
--- a/src/pdf/qtpdfglobal.h
+++ b/src/pdf/qtpdfglobal.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdfquick/plugin.cpp b/src/pdfquick/plugin.cpp
index 23f32bc3..20fcf639 100644
--- a/src/pdfquick/plugin.cpp
+++ b/src/pdfquick/plugin.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdfquick/qml/+material/PdfStyle.qml b/src/pdfquick/qml/+material/PdfStyle.qml
index 12df3046..6ec0741b 100644
--- a/src/pdfquick/qml/+material/PdfStyle.qml
+++ b/src/pdfquick/qml/+material/PdfStyle.qml
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdfquick/qml/+universal/PdfStyle.qml b/src/pdfquick/qml/+universal/PdfStyle.qml
index e92f2a08..3c322359 100644
--- a/src/pdfquick/qml/+universal/PdfStyle.qml
+++ b/src/pdfquick/qml/+universal/PdfStyle.qml
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdfquick/qml/PdfMultiPageView.qml b/src/pdfquick/qml/PdfMultiPageView.qml
index 71485c21..39f9831e 100644
--- a/src/pdfquick/qml/PdfMultiPageView.qml
+++ b/src/pdfquick/qml/PdfMultiPageView.qml
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdfquick/qml/PdfPageView.qml b/src/pdfquick/qml/PdfPageView.qml
index b90ad2d7..986f4156 100644
--- a/src/pdfquick/qml/PdfPageView.qml
+++ b/src/pdfquick/qml/PdfPageView.qml
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdfquick/qml/PdfScrollablePageView.qml b/src/pdfquick/qml/PdfScrollablePageView.qml
index 51d9e530..9432f7be 100644
--- a/src/pdfquick/qml/PdfScrollablePageView.qml
+++ b/src/pdfquick/qml/PdfScrollablePageView.qml
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdfquick/qml/PdfStyle.qml b/src/pdfquick/qml/PdfStyle.qml
index 090465ce..55e9ca3c 100644
--- a/src/pdfquick/qml/PdfStyle.qml
+++ b/src/pdfquick/qml/PdfStyle.qml
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdfquick/qquickpdfdocument.cpp b/src/pdfquick/qquickpdfdocument.cpp
index 2f5360f3..b9ee0b72 100644
--- a/src/pdfquick/qquickpdfdocument.cpp
+++ b/src/pdfquick/qquickpdfdocument.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -70,6 +73,11 @@ QQuickPdfDocument::QQuickPdfDocument(QObject *parent)
connect(&m_doc, &QPdfDocument::pageCountChanged, this, &QQuickPdfDocument::pageCountChanged);
}
+/*!
+ \internal
+*/
+QQuickPdfDocument::~QQuickPdfDocument() = default;
+
void QQuickPdfDocument::componentComplete()
{
if (m_doc.error() == QPdfDocument::IncorrectPasswordError)
diff --git a/src/pdfquick/qquickpdfdocument_p.h b/src/pdfquick/qquickpdfdocument_p.h
index cfeeb7b9..29877d0d 100644
--- a/src/pdfquick/qquickpdfdocument_p.h
+++ b/src/pdfquick/qquickpdfdocument_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -80,6 +83,7 @@ class Q_PDFQUICK_EXPORT QQuickPdfDocument : public QObject, public QQmlParserSta
public:
explicit QQuickPdfDocument(QObject *parent = nullptr);
+ ~QQuickPdfDocument() override;
void classBegin() override {}
void componentComplete() override;
diff --git a/src/pdfquick/qquickpdflinkmodel.cpp b/src/pdfquick/qquickpdflinkmodel.cpp
index 68a05663..5d3d2165 100644
--- a/src/pdfquick/qquickpdflinkmodel.cpp
+++ b/src/pdfquick/qquickpdflinkmodel.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -105,6 +108,11 @@ QQuickPdfLinkModel::QQuickPdfLinkModel(QObject *parent)
}
/*!
+ \internal
+*/
+QQuickPdfLinkModel::~QQuickPdfLinkModel() = default;
+
+/*!
\qmlproperty PdfDocument PdfLinkModel::document
This property holds the PDF document in which links are to be found.
diff --git a/src/pdfquick/qquickpdflinkmodel_p.h b/src/pdfquick/qquickpdflinkmodel_p.h
index d777643e..e7dcc6a3 100644
--- a/src/pdfquick/qquickpdflinkmodel_p.h
+++ b/src/pdfquick/qquickpdflinkmodel_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -64,6 +67,7 @@ class Q_PDFQUICK_EXPORT QQuickPdfLinkModel : public QPdfLinkModel
public:
explicit QQuickPdfLinkModel(QObject *parent = nullptr);
+ ~QQuickPdfLinkModel() override;
QQuickPdfDocument *document() const;
void setDocument(QQuickPdfDocument *document);
diff --git a/src/pdfquick/qquickpdfnavigationstack.cpp b/src/pdfquick/qquickpdfnavigationstack.cpp
index b1554b98..3992322e 100644
--- a/src/pdfquick/qquickpdfnavigationstack.cpp
+++ b/src/pdfquick/qquickpdfnavigationstack.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -60,6 +63,11 @@ QQuickPdfNavigationStack::QQuickPdfNavigationStack(QObject *parent)
}
/*!
+ \internal
+*/
+QQuickPdfNavigationStack::~QQuickPdfNavigationStack() = default;
+
+/*!
\qmlmethod void PdfNavigationStack::forward()
Goes back to the page, location and zoom level that was being viewed before
diff --git a/src/pdfquick/qquickpdfnavigationstack_p.h b/src/pdfquick/qquickpdfnavigationstack_p.h
index 1d37a4a8..44ccb787 100644
--- a/src/pdfquick/qquickpdfnavigationstack_p.h
+++ b/src/pdfquick/qquickpdfnavigationstack_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -67,6 +70,7 @@ class Q_PDFQUICK_EXPORT QQuickPdfNavigationStack : public QObject
public:
explicit QQuickPdfNavigationStack(QObject *parent = nullptr);
+ ~QQuickPdfNavigationStack() override;
Q_INVOKABLE void push(int page, QPointF location, qreal zoom, bool emitJumped = true);
Q_INVOKABLE void update(int page, QPointF location, qreal zoom);
diff --git a/src/pdfquick/qquickpdfsearchmodel.cpp b/src/pdfquick/qquickpdfsearchmodel.cpp
index 85003cd0..b5d9bc67 100644
--- a/src/pdfquick/qquickpdfsearchmodel.cpp
+++ b/src/pdfquick/qquickpdfsearchmodel.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -60,6 +63,11 @@ QQuickPdfSearchModel::QQuickPdfSearchModel(QObject *parent)
this, &QQuickPdfSearchModel::onResultsChanged);
}
+/*!
+ \internal
+*/
+QQuickPdfSearchModel::~QQuickPdfSearchModel() = default;
+
QQuickPdfDocument *QQuickPdfSearchModel::document() const
{
return m_quickDocument;
diff --git a/src/pdfquick/qquickpdfsearchmodel_p.h b/src/pdfquick/qquickpdfsearchmodel_p.h
index ad92d422..de1d86f4 100644
--- a/src/pdfquick/qquickpdfsearchmodel_p.h
+++ b/src/pdfquick/qquickpdfsearchmodel_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -69,6 +72,7 @@ class Q_PDFQUICK_EXPORT QQuickPdfSearchModel : public QPdfSearchModel
public:
explicit QQuickPdfSearchModel(QObject *parent = nullptr);
+ ~QQuickPdfSearchModel() override;
QQuickPdfDocument *document() const;
void setDocument(QQuickPdfDocument * document);
diff --git a/src/pdfquick/qquickpdfselection.cpp b/src/pdfquick/qquickpdfselection.cpp
index 48ff0d8b..bc4b7a76 100644
--- a/src/pdfquick/qquickpdfselection.cpp
+++ b/src/pdfquick/qquickpdfselection.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -83,6 +86,11 @@ QQuickPdfSelection::QQuickPdfSelection(QQuickItem *parent)
#endif
}
+/*!
+ \internal
+*/
+QQuickPdfSelection::~QQuickPdfSelection() = default;
+
QQuickPdfDocument *QQuickPdfSelection::document() const
{
return m_document;
diff --git a/src/pdfquick/qquickpdfselection_p.h b/src/pdfquick/qquickpdfselection_p.h
index b364a6c0..997f9564 100644
--- a/src/pdfquick/qquickpdfselection_p.h
+++ b/src/pdfquick/qquickpdfselection_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -74,6 +77,7 @@ class Q_PDFQUICK_EXPORT QQuickPdfSelection : public QQuickItem
public:
explicit QQuickPdfSelection(QQuickItem *parent = nullptr);
+ ~QQuickPdfSelection() override;
QQuickPdfDocument *document() const;
void setDocument(QQuickPdfDocument * document);
diff --git a/src/pdfquick/qquicktableviewextra.cpp b/src/pdfquick/qquicktableviewextra.cpp
index 6ce45967..9687150a 100644
--- a/src/pdfquick/qquicktableviewextra.cpp
+++ b/src/pdfquick/qquicktableviewextra.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -59,6 +62,11 @@ QQuickTableViewExtra::QQuickTableViewExtra(QObject *parent) : QObject(parent)
{
}
+/*!
+ \internal
+*/
+QQuickTableViewExtra::~QQuickTableViewExtra() = default;
+
QPoint QQuickTableViewExtra::cellAtPos(qreal x, qreal y) const
{
QPointF position(x, y);
diff --git a/src/pdfquick/qquicktableviewextra_p.h b/src/pdfquick/qquicktableviewextra_p.h
index 30eed696..c1969e04 100644
--- a/src/pdfquick/qquicktableviewextra_p.h
+++ b/src/pdfquick/qquicktableviewextra_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2020 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -64,7 +67,8 @@ class Q_PDFQUICK_EXPORT QQuickTableViewExtra : public QObject
Q_PROPERTY(QQuickTableView *tableView READ tableView WRITE setTableView)
public:
- QQuickTableViewExtra(QObject *parent = nullptr);
+ explicit QQuickTableViewExtra(QObject *parent = nullptr);
+ ~QQuickTableViewExtra() override;
QQuickTableView * tableView() const { return m_tableView; }
void setTableView(QQuickTableView * tableView) { m_tableView = tableView; }
diff --git a/src/pdfwidgets/qpdfview.cpp b/src/pdfwidgets/qpdfview.cpp
index cd2a8ef8..601ea098 100644
--- a/src/pdfwidgets/qpdfview.cpp
+++ b/src/pdfwidgets/qpdfview.cpp
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdfwidgets/qpdfview.h b/src/pdfwidgets/qpdfview.h
index 25c0e7f6..92c39740 100644
--- a/src/pdfwidgets/qpdfview.h
+++ b/src/pdfwidgets/qpdfview.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
@@ -75,7 +78,8 @@ public:
};
Q_ENUM(ZoomMode)
- explicit QPdfView(QWidget *parent = nullptr);
+ QPdfView() : QPdfView(nullptr) {}
+ explicit QPdfView(QWidget *parent);
~QPdfView();
void setDocument(QPdfDocument *document);
diff --git a/src/pdfwidgets/qpdfview_p.h b/src/pdfwidgets/qpdfview_p.h
index 60f67ec4..c7ea47d8 100644
--- a/src/pdfwidgets/qpdfview_p.h
+++ b/src/pdfwidgets/qpdfview_p.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2017 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Tobias König <tobias.koenig@kdab.com>
-** 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/pdfwidgets/qtpdfwidgetsglobal.h b/src/pdfwidgets/qtpdfwidgetsglobal.h
index 6c73a34f..c8a2b514 100644
--- a/src/pdfwidgets/qtpdfwidgetsglobal.h
+++ b/src/pdfwidgets/qtpdfwidgetsglobal.h
@@ -1,34 +1,37 @@
/****************************************************************************
**
** Copyright (C) 2017 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:LGPL$
** 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
+** Foundation and appearing in the file LICENSE.LGPL3 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.
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.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.
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
diff --git a/src/webenginequick/api/qquickwebenginetouchselectionmenurequest.cpp b/src/webenginequick/api/qquickwebenginetouchselectionmenurequest.cpp
index f406587d..0ba2a496 100644
--- a/src/webenginequick/api/qquickwebenginetouchselectionmenurequest.cpp
+++ b/src/webenginequick/api/qquickwebenginetouchselectionmenurequest.cpp
@@ -90,7 +90,9 @@ QQuickWebEngineTouchSelectionMenuRequestPrivate::QQuickWebEngineTouchSelectionMe
/*!
Destroys the touch selection menu request.
*/
-QQuickWebEngineTouchSelectionMenuRequest::~QQuickWebEngineTouchSelectionMenuRequest() = default;
+QQuickWebEngineTouchSelectionMenuRequest::~QQuickWebEngineTouchSelectionMenuRequest()
+{
+}
/*!
Returns the number of buttons that must be displayed, based on the available actions.
diff --git a/src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p.h b/src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p.h
index c6a8fc8c..b7ea4f06 100644
--- a/src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p.h
+++ b/src/webenginequick/api/qquickwebenginetouchselectionmenurequest_p.h
@@ -79,13 +79,13 @@ public:
Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted FINAL)
Q_PROPERTY(QRect selectionBounds READ selectionBounds CONSTANT FINAL REVISION(1))
Q_PROPERTY(TouchSelectionCommandFlags touchSelectionCommandFlags READ touchSelectionCommandFlags CONSTANT FINAL REVISION(1))
- QML_NAMED_ELEMENT(QQuickWebEngineTouchSelectionMenuRequest)
+ QML_NAMED_ELEMENT(TouchSelectionMenuRequest)
QML_ADDED_IN_VERSION(6, 3)
QML_UNCREATABLE("")
QQuickWebEngineTouchSelectionMenuRequest(QRect bounds,
QtWebEngineCore::TouchSelectionMenuController *touchSelectionMenuController);
- virtual ~QQuickWebEngineTouchSelectionMenuRequest();
+ ~QQuickWebEngineTouchSelectionMenuRequest();
int buttonCount();
bool isAccepted() const;
diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
index c2a002a3..7063a92f 100644
--- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc
+++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc
@@ -1090,8 +1090,6 @@
Also if the audio is paused, this signal is emitted with an approximate \b{two-second
delay}, from the moment the audio is paused.
- This signal is also emitted for Flash plugin audio.
-
If a web page contains two videos that are started in sequence, this signal
gets emitted only once, for the first video to generate sound. After both
videos are stopped, the signal is emitted upon the last sound generated.
@@ -1167,8 +1165,6 @@
\a wasRecentlyAudible, is changed, due to audio being 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{2 second
- delay}, from the moment the audio is paused.
*/
/*!
@@ -1477,3 +1473,19 @@
\sa renderProcessPid
*/
+
+/*!
+ \qmlsignal WebEngineView::touchSelectionMenuRequested(TouchSelectionMenuRequest *request)
+ \since QtWebEngine 6.3
+ \readonly
+
+ This signal is emitted when a touch selection menu is requested at a specified position.
+
+ The \a request can be handled by using the methods of the TouchSelectionMenuRequest
+ type.
+
+ \note Signal handlers need to call \c{request.accepted = true} to prevent a default touch
+ selection menu from showing up.
+
+ \sa TouchSelectionMenuRequest
+*/
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
index aa136b66..4fa0667b 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
@@ -76,11 +76,16 @@ protected:
}
void focusInEvent(QFocusEvent *event) override
{
+ Q_ASSERT(event->reason() != Qt::PopupFocusReason);
m_client->forwardEvent(event);
}
void focusOutEvent(QFocusEvent *event) override
{
- m_client->forwardEvent(event);
+ // The keyboard events are supposed to go to the parent RenderHostView and WebUI
+ // popups should never have focus, therefore ignore focusOutEvent as losing focus
+ // will trigger pop close request from blink
+ if (event->reason() != Qt::PopupFocusReason)
+ m_client->forwardEvent(event);
}
void inputMethodEvent(QInputMethodEvent *event) override
{