summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-09-22 20:08:04 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-09-22 20:15:13 +0200
commit29e75ab2ede9e13321faeec61e1d77f3caa6118c (patch)
treebafd4479f5a84db963eef0c04e7a5d86627f6691 /src
parent98702f186c66a6eedb90b5d4823c53afd8794770 (diff)
parentbb6fffd1ad3168edc9d67492cca585084d8ae6b4 (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts: src/core/certificate_error_controller.cpp src/core/compositor/display_gl_output_surface_qsg.cpp src/webengine/doc/src/webengine_certificate_error.qdoc tests/auto/quick/qmltests/data/tst_certificateError.qml Change-Id: I976958a0833030bfd7c3ed762585eb12031306b0
Diffstat (limited to 'src')
m---------src/3rdparty0
-rw-r--r--src/core/certificate_error_controller.cpp4
-rw-r--r--src/core/compositor/display_gl_output_surface.cpp4
-rw-r--r--src/core/compositor/display_gl_output_surface.h1
-rw-r--r--src/core/devtools_frontend_qt.cpp11
-rw-r--r--src/core/devtools_frontend_qt.h3
-rw-r--r--src/core/favicon_manager.cpp23
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp5
-rw-r--r--src/core/renderer/content_renderer_client_qt.h1
-rw-r--r--src/webengine/api/qquickwebenginefaviconprovider.cpp23
10 files changed, 64 insertions, 11 deletions
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 5958153d4c472c038117a0cc927505e158fd3fd
+Subproject c5637fa9071bb6d53b5d21ac713f2a5191f8c16
diff --git a/src/core/certificate_error_controller.cpp b/src/core/certificate_error_controller.cpp
index 03918e158..0c0137ca4 100644
--- a/src/core/certificate_error_controller.cpp
+++ b/src/core/certificate_error_controller.cpp
@@ -206,7 +206,7 @@ QString CertificateErrorController::errorString() const
case QWebEngineCertificateError::CertificateContainsErrors:
return getQStringForMessageId(IDS_CERT_ERROR_CONTAINS_ERRORS_DESCRIPTION);
case QWebEngineCertificateError::CertificateNoRevocationMechanism:
- return getQStringForMessageId(IDS_CERT_ERROR_NO_REVOCATION_MECHANISM_DETAILS);
+ return getQStringForMessageId(IDS_CERT_ERROR_NO_REVOCATION_MECHANISM_DESCRIPTION);
case QWebEngineCertificateError::CertificateRevoked:
return getQStringForMessageId(IDS_CERT_ERROR_REVOKED_CERT_DESCRIPTION);
case QWebEngineCertificateError::CertificateInvalid:
@@ -223,6 +223,8 @@ QString CertificateErrorController::errorString() const
return getQStringForMessageId(IDS_CERT_ERROR_VALIDITY_TOO_LONG_DESCRIPTION);
case QWebEngineCertificateError::CertificateTransparencyRequired:
return getQStringForMessageId(IDS_CERT_ERROR_CERTIFICATE_TRANSPARENCY_REQUIRED_DESCRIPTION);
+ case QWebEngineCertificateError::SslObsoleteVersion:
+ return getQStringForMessageId(IDS_SSL_ERROR_OBSOLETE_VERSION_DESCRIPTION);
case QWebEngineCertificateError::CertificateUnableToCheckRevocation: // Deprecated in Chromium.
default:
break;
diff --git a/src/core/compositor/display_gl_output_surface.cpp b/src/core/compositor/display_gl_output_surface.cpp
index 9467d6ea0..16a925bd4 100644
--- a/src/core/compositor/display_gl_output_surface.cpp
+++ b/src/core/compositor/display_gl_output_surface.cpp
@@ -212,6 +212,7 @@ void DisplayGLOutputSurface::swapBuffersOnGpuThread(unsigned int id, std::unique
QMutexLocker locker(&m_mutex);
m_middleBuffer->serviceId = id;
m_middleBuffer->fence = CompositorResourceFence::create(std::move(fence));
+ m_readyToUpdate = true;
}
if (auto obs = observer())
@@ -305,12 +306,13 @@ gfx::OverlayTransform DisplayGLOutputSurface::GetDisplayTransform()
void DisplayGLOutputSurface::swapFrame()
{
QMutexLocker locker(&m_mutex);
- if (m_middleBuffer && m_middleBuffer->serviceId) {
+ if (m_readyToUpdate) {
std::swap(m_middleBuffer, m_frontBuffer);
m_taskRunner->PostTask(FROM_HERE,
base::BindOnce(&DisplayGLOutputSurface::swapBuffersOnVizThread,
base::Unretained(this)));
m_taskRunner.reset();
+ m_readyToUpdate = false;
}
}
diff --git a/src/core/compositor/display_gl_output_surface.h b/src/core/compositor/display_gl_output_surface.h
index dc6273923..5c6b1ab23 100644
--- a/src/core/compositor/display_gl_output_surface.h
+++ b/src/core/compositor/display_gl_output_surface.h
@@ -145,6 +145,7 @@ private:
std::unique_ptr<Buffer> m_backBuffer;
std::unique_ptr<Buffer> m_middleBuffer;
std::unique_ptr<Buffer> m_frontBuffer;
+ bool m_readyToUpdate = false;
scoped_refptr<base::SingleThreadTaskRunner> m_taskRunner;
scoped_refptr<viz::VizProcessContextProvider> m_vizContextProvider;
};
diff --git a/src/core/devtools_frontend_qt.cpp b/src/core/devtools_frontend_qt.cpp
index 810c91b94..da82a46d3 100644
--- a/src/core/devtools_frontend_qt.cpp
+++ b/src/core/devtools_frontend_qt.cpp
@@ -226,7 +226,9 @@ DevToolsFrontendQt *DevToolsFrontendQt::Show(QSharedPointer<WebContentsAdapter>
DevToolsFrontendQt::DevToolsFrontendQt(QSharedPointer<WebContentsAdapter> webContentsAdapter,
content::WebContents *inspectedContents)
: content::WebContentsObserver(webContentsAdapter->webContents())
- , m_webContentsAdapter(webContentsAdapter)
+ , m_frontendAdapter(webContentsAdapter)
+ , m_inspectedAdapter(static_cast<WebContentsDelegateQt *>(inspectedContents->GetDelegate())
+ ->webContentsAdapter())
, m_inspectedContents(inspectedContents)
, m_inspect_element_at_x(-1)
, m_inspect_element_at_y(-1)
@@ -246,7 +248,7 @@ DevToolsFrontendQt::DevToolsFrontendQt(QSharedPointer<WebContentsAdapter> webCon
DevToolsFrontendQt::~DevToolsFrontendQt()
{
- if (QSharedPointer<WebContentsAdapter> p = m_webContentsAdapter)
+ if (QSharedPointer<WebContentsAdapter> p = m_frontendAdapter)
p->setInspector(false);
}
@@ -325,8 +327,8 @@ void DevToolsFrontendQt::DocumentAvailableInMainFrame()
void DevToolsFrontendQt::WebContentsDestroyed()
{
- if (m_inspectedContents)
- static_cast<WebContentsDelegateQt *>(m_inspectedContents->GetDelegate())->webContentsAdapter()->devToolsFrontendDestroyed(this);
+ if (m_inspectedAdapter)
+ m_inspectedAdapter->devToolsFrontendDestroyed(this);
if (m_agentHost) {
m_agentHost->DetachClient(this);
@@ -594,6 +596,7 @@ void DevToolsFrontendQt::AgentHostClosed(content::DevToolsAgentHost *agentHost)
DCHECK(agentHost == m_agentHost.get());
m_agentHost = nullptr;
m_inspectedContents = nullptr;
+ m_inspectedAdapter = nullptr;
Close();
}
diff --git a/src/core/devtools_frontend_qt.h b/src/core/devtools_frontend_qt.h
index 9fefcb435..423131c4e 100644
--- a/src/core/devtools_frontend_qt.h
+++ b/src/core/devtools_frontend_qt.h
@@ -115,7 +115,8 @@ private:
void CreateJsonPreferences(bool clear);
// We shouldn't be keeping it alive
- QWeakPointer<WebContentsAdapter> m_webContentsAdapter;
+ QWeakPointer<WebContentsAdapter> m_frontendAdapter;
+ WebContentsAdapter *m_inspectedAdapter;
WebContentsDelegateQt *m_frontendDelegate;
content::WebContents *m_inspectedContents;
scoped_refptr<content::DevToolsAgentHost> m_agentHost;
diff --git a/src/core/favicon_manager.cpp b/src/core/favicon_manager.cpp
index a1e133775..3cb417c4f 100644
--- a/src/core/favicon_manager.cpp
+++ b/src/core/favicon_manager.cpp
@@ -52,6 +52,11 @@
#include "third_party/skia/include/core/SkPixelRef.h"
#include "ui/gfx/geometry/size.h"
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#include <qiconengine.h>
+#include <private/qicon_p.h>
+#endif
+
namespace QtWebEngineCore {
static inline bool isResourceUrl(const QUrl &url)
@@ -331,6 +336,20 @@ QUrl FaviconManager::candidateIconUrl(bool touchIconsEnabled) const
return iconUrl;
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+static QPixmap getUnscaledPixmap(QIcon icon, const QSize &size)
+{
+ QPixmap pixmap = icon.data_ptr()->engine->pixmap(size, QIcon::Normal, QIcon::Off);
+ pixmap.setDevicePixelRatio(1.0);
+ return pixmap;
+}
+#else
+static QPixmap getUnscaledPixmap(const QIcon &icon, const QSize &size)
+{
+ return icon.pixmap(size, 1.0);
+}
+#endif
+
void FaviconManager::generateCandidateIcon(bool touchIconsEnabled)
{
Q_ASSERT(m_candidateCount);
@@ -349,7 +368,7 @@ void FaviconManager::generateCandidateIcon(bool touchIconsEnabled)
if (!it->multiSize) {
if (!m_candidateIcon.availableSizes().contains(it->size))
- m_candidateIcon.addPixmap(icon.pixmap(it->size));
+ m_candidateIcon.addPixmap(getUnscaledPixmap(icon, it->size));
continue;
}
@@ -357,7 +376,7 @@ void FaviconManager::generateCandidateIcon(bool touchIconsEnabled)
const auto sizes = icon.availableSizes();
for (const QSize &size : sizes) {
if (!m_candidateIcon.availableSizes().contains(size))
- m_candidateIcon.addPixmap(icon.pixmap(size));
+ m_candidateIcon.addPixmap(getUnscaledPixmap(icon, size));
}
}
}
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 7567775fb..8c70f2e42 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -362,6 +362,11 @@ bool ContentRendererClientQt::OverrideCreatePlugin(content::RenderFrame *render_
return content::ContentRendererClient::OverrideCreatePlugin(render_frame, params, plugin);
}
+bool ContentRendererClientQt::IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path)
+{
+ return plugin_path.value() == FILE_PATH_LITERAL("internal-pdf-viewer/");
+}
+
#if BUILDFLAG(ENABLE_PLUGINS)
// static
blink::WebPlugin* ContentRendererClientQt::CreatePlugin(content::RenderFrame* render_frame,
diff --git a/src/core/renderer/content_renderer_client_qt.h b/src/core/renderer/content_renderer_client_qt.h
index 3cbd5b9ee..24a841cb8 100644
--- a/src/core/renderer/content_renderer_client_qt.h
+++ b/src/core/renderer/content_renderer_client_qt.h
@@ -114,6 +114,7 @@ public:
bool OverrideCreatePlugin(content::RenderFrame *render_frame,
const blink::WebPluginParams &params,
blink::WebPlugin **plugin) override;
+ bool IsOriginIsolatedPepperPlugin(const base::FilePath& plugin_path) override;
content::BrowserPluginDelegate *CreateBrowserPluginDelegate(content::RenderFrame *render_frame,
const content::WebPluginInfo &info,
const std::string &mime_type,
diff --git a/src/webengine/api/qquickwebenginefaviconprovider.cpp b/src/webengine/api/qquickwebenginefaviconprovider.cpp
index 3255f22be..f817e4016 100644
--- a/src/webengine/api/qquickwebenginefaviconprovider.cpp
+++ b/src/webengine/api/qquickwebenginefaviconprovider.cpp
@@ -47,6 +47,11 @@
#include <QtGui/QIcon>
#include <QtGui/QPixmap>
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+#include <QtGui/qiconengine.h>
+#include <QtGui/private/qicon_p.h>
+#endif
+
QT_BEGIN_NAMESPACE
using QtWebEngineCore::FaviconInfo;
@@ -113,6 +118,20 @@ void QQuickWebEngineFaviconProvider::detach(QQuickWebEngineView *view)
delete iconUrls;
}
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+static QPixmap getUnscaledPixmap(QIcon icon, const QSize &size)
+{
+ QPixmap pixmap = icon.data_ptr()->engine->pixmap(size, QIcon::Normal, QIcon::Off);
+ pixmap.setDevicePixelRatio(1.0);
+ return pixmap;
+}
+#else
+static QPixmap getUnscaledPixmap(const QIcon &icon, const QSize &size)
+{
+ return icon.pixmap(size, 1.0);
+}
+#endif
+
QPixmap QQuickWebEngineFaviconProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
{
Q_UNUSED(size);
@@ -138,11 +157,11 @@ QPixmap QQuickWebEngineFaviconProvider::requestPixmap(const QString &id, QSize *
if (size)
*size = bestSize;
- return icon.pixmap(bestSize).copy();
+ return getUnscaledPixmap(icon, bestSize).copy();
}
const QSize &fitSize = findFitSize(icon.availableSizes(), requestedSize, bestSize);
- const QPixmap &iconPixmap = icon.pixmap(fitSize);
+ const QPixmap &iconPixmap = getUnscaledPixmap(icon, fitSize);
if (size)
*size = iconPixmap.size();