summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-09 15:22:24 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-09 15:22:24 +0200
commit0eac492b5c66b1774118c387dd527ad419e51be7 (patch)
tree37324fdefd615e433dd65073390d7b9996d660d3 /src
parent5d6086d1b97461b35c143839a8a6ba1b990bb87c (diff)
parent99d46a8a918dee7323bc3d4f1624c47c097f9a3a (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src')
m---------src/3rdparty0
-rw-r--r--src/buildtools/gn.pro10
-rw-r--r--src/core/api/qtwebenginecoreglobal.cpp4
-rw-r--r--src/core/api/qwebenginecallback.h20
-rw-r--r--src/core/api/qwebenginecallback_p.h85
-rw-r--r--src/core/api/qwebengineclientcertificatestore.cpp12
-rw-r--r--src/core/api/qwebengineclientcertificatestore.h2
-rw-r--r--src/core/api/qwebenginecookiestore.cpp21
-rw-r--r--src/core/api/qwebenginecookiestore.h4
-rw-r--r--src/core/api/qwebenginecookiestore_p.h6
-rw-r--r--src/core/api/qwebenginehttprequest.cpp42
-rw-r--r--src/core/api/qwebenginehttprequest.h19
-rw-r--r--src/core/api/qwebenginemessagepumpscheduler_p.h3
-rw-r--r--src/core/api/qwebenginenotification.cpp6
-rw-r--r--src/core/api/qwebenginequotarequest.cpp3
-rw-r--r--src/core/api/qwebenginequotarequest.h3
-rw-r--r--src/core/api/qwebengineregisterprotocolhandlerrequest.cpp2
-rw-r--r--src/core/api/qwebengineregisterprotocolhandlerrequest.h6
-rw-r--r--src/core/api/qwebengineurlrequestinfo.cpp29
-rw-r--r--src/core/api/qwebengineurlrequestinfo.h2
-rw-r--r--src/core/api/qwebengineurlrequestinfo_p.h11
-rw-r--r--src/core/api/qwebengineurlrequestinterceptor.h8
-rw-r--r--src/core/api/qwebengineurlrequestjob.cpp5
-rw-r--r--src/core/api/qwebengineurlrequestjob.h4
-rw-r--r--src/core/api/qwebengineurlscheme.cpp17
-rw-r--r--src/core/api/qwebengineurlscheme.h4
-rw-r--r--src/core/api/qwebengineurlschemehandler.h2
-rw-r--r--src/core/clipboard_change_observer.h64
-rw-r--r--src/core/clipboard_qt.cpp88
-rw-r--r--src/core/clipboard_qt.h59
-rw-r--r--src/core/compositor/compositor.cpp2
-rw-r--r--src/core/compositor/compositor_resource_tracker.cpp8
-rw-r--r--src/core/config/linux.pri3
-rw-r--r--src/core/config/windows.pri22
-rw-r--r--src/core/content_main_delegate_qt.cpp2
-rw-r--r--src/core/core_chromium.pri6
-rw-r--r--src/core/core_module.pro4
-rw-r--r--src/core/core_project.pro5
-rw-r--r--src/core/doc/src/qtwebenginecore-index.qdoc6
-rw-r--r--src/core/doc/src/qtwebenginecore-module.qdoc2
-rw-r--r--src/core/download_manager_delegate_qt.cpp11
-rw-r--r--src/core/file_picker_controller.cpp31
-rw-r--r--src/core/printing/print_view_manager_qt.cpp28
-rw-r--r--src/core/profile_io_data_qt.cpp16
-rw-r--r--src/core/profile_qt.cpp4
-rw-r--r--src/core/profile_qt.h2
-rw-r--r--src/core/render_widget_host_view_qt.cpp8
-rw-r--r--src/core/render_widget_host_view_qt_delegate.h1
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp7
-rw-r--r--src/core/renderer/user_resource_controller.cpp11
-rw-r--r--src/core/web_engine_context.cpp23
-rw-r--r--src/core/web_engine_context_threads.cpp2
-rw-r--r--src/core/web_engine_library_info.cpp30
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp4
-rw-r--r--src/webengine/api/qquickwebengineloadrequest.cpp2
-rw-r--r--src/webengine/api/qtwebengineglobal.cpp4
-rw-r--r--src/webengine/doc/qtwebengine.qdocconf3
-rw-r--r--src/webengine/doc/src/external-resources.qdoc12
-rw-r--r--src/webengine/doc/src/qtwebengine-debugging.qdoc12
-rw-r--r--src/webengine/doc/src/qtwebengine-deploying.qdoc28
-rw-r--r--src/webengine/doc/src/qtwebengine-examples.qdoc2
-rw-r--r--src/webengine/doc/src/qtwebengine-features.qdoc54
-rw-r--r--src/webengine/doc/src/qtwebengine-index.qdoc4
-rw-r--r--src/webengine/doc/src/qtwebengine-module.qdoc2
-rw-r--r--src/webengine/doc/src/qtwebengine-overview.qdoc54
-rw-r--r--src/webengine/doc/src/qtwebengine-platform-notes.qdoc32
-rw-r--r--src/webengine/doc/src/qwebengine-licensing.qdoc2
-rw-r--r--src/webengine/doc/src/webengineview_lgpl.qdoc6
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.cpp7
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.h1
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp5
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quickwindow.h1
-rw-r--r--src/webengine/ui_delegates_manager.cpp2
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.cpp4
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp9
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp6
-rw-r--r--src/webenginewidgets/api/qwebengineview.cpp2
-rw-r--r--src/webenginewidgets/api/qwebengineview_p.h1
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc4
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc2
-rw-r--r--src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc2
-rw-r--r--src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc72
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc2
-rw-r--r--src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc4
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp7
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h1
86 files changed, 602 insertions, 526 deletions
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 3d95374cb8de20b3e15538f1ecb5b78bf9d1cdc
+Subproject 0ac2b1fddcd3e1b1e18bf7c7c14a6466deb9ba8
diff --git a/src/buildtools/gn.pro b/src/buildtools/gn.pro
index 30ada9357..b6bf9cfc4 100644
--- a/src/buildtools/gn.pro
+++ b/src/buildtools/gn.pro
@@ -18,9 +18,13 @@ build_pass|!debug_and_release {
src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT")
gn_bootstrap = $$system_path($$absolute_path(gn/build/gen.py, $$src_3rd_party_dir))
- gn_configure = $$system_quote($$gn_bootstrap) --no-last-commit-position --out-path $$out_path \
- --cc \"$$which($$QMAKE_CC)\" --cxx \"$$which($$QMAKE_CXX)\" \
- --ld \"$$which($$QMAKE_LINK)\"
+ gn_gen_args = --no-last-commit-position --out-path $$out_path \
+ --cc \"$$which($$QMAKE_CC)\" --cxx \"$$which($$QMAKE_CXX)\" \
+ --ld \"$$which($$QMAKE_LINK)\"
+
+ msvc:!clang_cl: gn_gen_args += --use-lto
+
+ gn_configure = $$system_quote($$gn_bootstrap) $$gn_gen_args
macos {
gn_configure += --isysroot \"$$QMAKE_MAC_SDK_PATH\"
}
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp
index abdb92e28..abc2bd406 100644
--- a/src/core/api/qtwebenginecoreglobal.cpp
+++ b/src/core/api/qtwebenginecoreglobal.cpp
@@ -58,7 +58,8 @@ QT_END_NAMESPACE
#ifndef QT_NO_OPENGL
#ifdef Q_OS_MACOS
-static bool needsOfflineRendererWorkaround() {
+static bool needsOfflineRendererWorkaround()
+{
size_t hwmodelsize = 0;
if (sysctlbyname("hw.model", nullptr, &hwmodelsize, nullptr, 0) == -1)
@@ -134,4 +135,3 @@ Q_WEBENGINECORE_PRIVATE_EXPORT void initialize()
#endif // QT_NO_OPENGL
}
} // namespace QtWebEngineCore
-
diff --git a/src/core/api/qwebenginecallback.h b/src/core/api/qwebenginecallback.h
index b981b2afb..49efc50b2 100644
--- a/src/core/api/qwebenginecallback.h
+++ b/src/core/api/qwebenginecallback.h
@@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE
namespace QtWebEnginePrivate {
-template <typename T>
+template<typename T>
class QWebEngineCallbackPrivateBase : public QSharedData {
public:
QWebEngineCallbackPrivateBase() {}
@@ -62,32 +62,32 @@ public:
virtual void operator()(T) = 0;
};
-template <typename T, typename F>
+template<typename T, typename F>
class QWebEngineCallbackPrivate : public QWebEngineCallbackPrivateBase<T> {
public:
- QWebEngineCallbackPrivate(F callable)
- : m_callable(callable)
- {}
+ QWebEngineCallbackPrivate(F callable) : m_callable(callable) {}
void operator()(T value) override { m_callable(value); }
+
private:
F m_callable;
};
} // namespace QtWebEnginePrivate
-template <typename T>
+template<typename T>
class QWebEngineCallback {
public:
- template <typename F>
+ template<typename F>
QWebEngineCallback(F f)
: d(new QtWebEnginePrivate::QWebEngineCallbackPrivate<T, F>(f))
- { }
- QWebEngineCallback() { }
+ {}
+ QWebEngineCallback() {}
void swap(QWebEngineCallback &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
operator bool() const { return d; }
+
private:
friend class QtWebEngineCore::CallbackDirectory;
- QExplicitlySharedDataPointer<QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> > d;
+ QExplicitlySharedDataPointer<QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T>> d;
};
Q_DECLARE_SHARED(QWebEngineCallback<int>)
diff --git a/src/core/api/qwebenginecallback_p.h b/src/core/api/qwebenginecallback_p.h
index 24b4495df..133a86f6d 100644
--- a/src/core/api/qwebenginecallback_p.h
+++ b/src/core/api/qwebenginecallback_p.h
@@ -62,11 +62,11 @@
#include <type_traits>
// keep in sync with Q_DECLARE_SHARED... in qwebenginecallback.h
-#define FOR_EACH_TYPE(F) \
- F(bool) \
- F(int) \
- F(const QString &) \
- F(const QByteArray &) \
+#define FOR_EACH_TYPE(F) \
+ F(bool) \
+ F(int) \
+ F(const QString &) \
+ F(const QByteArray &) \
F(const QVariant &)
namespace QtWebEngineCore {
@@ -82,7 +82,7 @@ public:
{
// "Cancel" pending callbacks by calling them with an invalid value.
// This guarantees that each callback is called exactly once.
- for (CallbackSharedDataPointerBase * const sharedPtrBase: m_callbackMap) {
+ for (CallbackSharedDataPointerBase *const sharedPtrBase : m_callbackMap) {
Q_ASSERT(sharedPtrBase);
sharedPtrBase->invokeEmpty();
delete sharedPtrBase;
@@ -106,20 +106,18 @@ public:
template<typename T>
void invokeEmpty(const QWebEngineCallback<T> &callback);
-#define DEFINE_INVOKE_FOR_TYPE(Type) \
- void invoke(quint64 callbackId, Type result) { \
- invokeInternal<Type>(callbackId, std::forward<Type>(result)); \
- }
+#define DEFINE_INVOKE_FOR_TYPE(Type) \
+ void invoke(quint64 callbackId, Type result) { invokeInternal<Type>(callbackId, std::forward<Type>(result)); }
FOR_EACH_TYPE(DEFINE_INVOKE_FOR_TYPE)
#undef DEFINE_INVOKE_FOR_TYPE
- template <typename A>
+ template<typename A>
void invokeDirectly(const QWebEngineCallback<typename std::remove_reference<A>::type &> &callback, A &argument)
{
return callback.d.data()->operator()(argument);
}
- template <typename A>
+ template<typename A>
void invokeDirectly(const QWebEngineCallback<typename std::remove_reference<A>::type> &callback, const A &argument)
{
return callback.d.data()->operator()(std::forward<const A &>(argument));
@@ -127,39 +125,45 @@ public:
private:
struct CallbackSharedDataPointerBase {
- virtual ~CallbackSharedDataPointerBase() { }
+ virtual ~CallbackSharedDataPointerBase() {}
virtual void invokeEmpty() = 0;
virtual void doRef() = 0;
virtual void doDeref() = 0;
- virtual operator bool () const = 0;
+ virtual operator bool() const = 0;
};
- template <typename T>
+ template<typename T>
struct CallbackSharedDataPointer : public CallbackSharedDataPointerBase {
- CallbackDirectory* parent;
+ CallbackDirectory *parent;
QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *callback;
~CallbackSharedDataPointer() { doDeref(); }
- CallbackSharedDataPointer() : parent(0), callback(0) { }
+ CallbackSharedDataPointer() : parent(0), callback(0) {}
CallbackSharedDataPointer(const CallbackSharedDataPointer<T> &other)
- : parent(other.parent), callback(other.callback) { doRef(); }
+ : parent(other.parent), callback(other.callback)
+ {
+ doRef();
+ }
CallbackSharedDataPointer(CallbackDirectory *p, QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *c)
- : parent(p), callback(c) { Q_ASSERT(callback); doRef(); }
+ : parent(p), callback(c)
+ {
+ Q_ASSERT(callback);
+ doRef();
+ }
void invokeEmpty() override;
- operator bool () const override { return callback; }
+ operator bool() const override { return callback; }
private:
void doRef() override;
void doDeref() override;
};
- QHash<quint64, CallbackSharedDataPointerBase*> m_callbackMap;
+ QHash<quint64, CallbackSharedDataPointerBase *> m_callbackMap;
};
template<typename T>
-inline
-void CallbackDirectory::registerCallback(quint64 callbackId, const QWebEngineCallback<T> &callback)
+inline void CallbackDirectory::registerCallback(quint64 callbackId, const QWebEngineCallback<T> &callback)
{
if (!callback.d)
return;
@@ -167,10 +171,9 @@ void CallbackDirectory::registerCallback(quint64 callbackId, const QWebEngineCal
}
template<typename T>
-inline
-void CallbackDirectory::invokeInternal(quint64 callbackId, T result)
+inline void CallbackDirectory::invokeInternal(quint64 callbackId, T result)
{
- CallbackSharedDataPointerBase * const sharedPtrBase = m_callbackMap.take(callbackId);
+ CallbackSharedDataPointerBase *const sharedPtrBase = m_callbackMap.take(callbackId);
if (!sharedPtrBase)
return;
@@ -181,8 +184,7 @@ void CallbackDirectory::invokeInternal(quint64 callbackId, T result)
}
template<typename T>
-inline
-void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *callback)
+inline void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<T> *callback)
{
Q_ASSERT(callback);
using NoRefT = typename std::remove_reference<T>::type;
@@ -192,24 +194,21 @@ void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallba
}
template<>
-inline
-void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<bool> *callback)
+inline void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<bool> *callback)
{
Q_ASSERT(callback);
(*callback)(false);
}
template<>
-inline
-void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<int> *callback)
+inline void CallbackDirectory::invokeEmptyInternal(QtWebEnginePrivate::QWebEngineCallbackPrivateBase<int> *callback)
{
Q_ASSERT(callback);
(*callback)(0);
}
template<typename T>
-inline
-void CallbackDirectory::invokeEmpty(const QWebEngineCallback<T> &callback)
+inline void CallbackDirectory::invokeEmpty(const QWebEngineCallback<T> &callback)
{
if (!callback.d)
return;
@@ -217,9 +216,8 @@ void CallbackDirectory::invokeEmpty(const QWebEngineCallback<T> &callback)
invokeEmptyInternal(callback.d.data());
}
-template <typename T>
-inline
-void CallbackDirectory::CallbackSharedDataPointer<T>::doRef()
+template<typename T>
+inline void CallbackDirectory::CallbackSharedDataPointer<T>::doRef()
{
if (!callback)
return;
@@ -227,9 +225,8 @@ void CallbackDirectory::CallbackSharedDataPointer<T>::doRef()
callback->ref.ref();
}
-template <typename T>
-inline
-void CallbackDirectory::CallbackSharedDataPointer<T>::doDeref()
+template<typename T>
+inline void CallbackDirectory::CallbackSharedDataPointer<T>::doDeref()
{
if (!callback)
return;
@@ -237,9 +234,8 @@ void CallbackDirectory::CallbackSharedDataPointer<T>::doDeref()
delete callback;
}
-template <typename T>
-inline
-void CallbackDirectory::CallbackSharedDataPointer<T>::invokeEmpty()
+template<typename T>
+inline void CallbackDirectory::CallbackSharedDataPointer<T>::invokeEmpty()
{
if (!callback)
return;
@@ -248,8 +244,7 @@ void CallbackDirectory::CallbackSharedDataPointer<T>::invokeEmpty()
parent->invokeEmptyInternal(callback);
}
-#define CHECK_RELOCATABLE(x) \
- Q_STATIC_ASSERT((QTypeInfoQuery<QWebEngineCallback< x > >::isRelocatable));
+#define CHECK_RELOCATABLE(x) Q_STATIC_ASSERT((QTypeInfoQuery<QWebEngineCallback<x>>::isRelocatable));
FOR_EACH_TYPE(CHECK_RELOCATABLE)
#undef CHECK_RELOCATABLE
diff --git a/src/core/api/qwebengineclientcertificatestore.cpp b/src/core/api/qwebengineclientcertificatestore.cpp
index 854628b29..84f273328 100644
--- a/src/core/api/qwebengineclientcertificatestore.cpp
+++ b/src/core/api/qwebengineclientcertificatestore.cpp
@@ -49,13 +49,6 @@ QT_BEGIN_NAMESPACE
#if QT_CONFIG(ssl)
/*!
- \class QWebEngineClientCertificateStore::Entry
- \inmodule QtWebEngineCore
- \since 5.13
- \brief This structure holds the certificate and the private key.
-*/
-
-/*!
\class QWebEngineClientCertificateStore
\inmodule QtWebEngineCore
\since 5.13
@@ -68,9 +61,8 @@ QT_BEGIN_NAMESPACE
*/
QWebEngineClientCertificateStore::QWebEngineClientCertificateStore(QtWebEngineCore::ClientCertificateStoreData *storeData)
- : m_storeData(storeData)
-{
-}
+ : m_storeData(storeData)
+{}
/*!
Destroys this QWebEngineClientCertificateStore object.
diff --git a/src/core/api/qwebengineclientcertificatestore.h b/src/core/api/qwebengineclientcertificatestore.h
index 68705e80b..a4c83bb2e 100644
--- a/src/core/api/qwebengineclientcertificatestore.h
+++ b/src/core/api/qwebengineclientcertificatestore.h
@@ -49,7 +49,7 @@
namespace QtWebEngineCore {
struct ClientCertificateStoreData;
class ProfileAdapter;
-}
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
diff --git a/src/core/api/qwebenginecookiestore.cpp b/src/core/api/qwebenginecookiestore.cpp
index 3897fb128..40594b9c0 100644
--- a/src/core/api/qwebenginecookiestore.cpp
+++ b/src/core/api/qwebenginecookiestore.cpp
@@ -47,15 +47,14 @@
#include <QByteArray>
#include <QUrl>
-
namespace {
-inline GURL toGurl(const QUrl& url)
+inline GURL toGurl(const QUrl &url)
{
return GURL(url.toString().toStdString());
}
-}
+} // namespace
QT_BEGIN_NAMESPACE
@@ -68,8 +67,7 @@ QWebEngineCookieStorePrivate::QWebEngineCookieStorePrivate(QWebEngineCookieStore
, m_deleteAllCookiesPending(false)
, m_getAllCookiesPending(false)
, delegate(0)
-{
-}
+{}
void QWebEngineCookieStorePrivate::processPendingUserCookies()
{
@@ -112,7 +110,8 @@ void QWebEngineCookieStorePrivate::rejectPendingUserCookies()
m_pendingUserCookies.clear();
}
-void QWebEngineCookieStorePrivate::setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie, const QUrl &origin)
+void QWebEngineCookieStorePrivate::setCookie(const QWebEngineCallback<bool> &callback, const QNetworkCookie &cookie,
+ const QUrl &origin)
{
const quint64 currentCallbackId = callback ? m_nextCallbackId++ : static_cast<quint64>(CallbackDirectory::NoCallbackId);
@@ -201,7 +200,7 @@ bool QWebEngineCookieStorePrivate::canAccessCookies(const QUrl &firstPartyUrl, c
toGurl(firstPartyUrl),
net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
- QWebEngineCookieStore::FilterRequest request = { firstPartyUrl, url, thirdParty, false, 0};
+ QWebEngineCookieStore::FilterRequest request = { firstPartyUrl, url, thirdParty, false, 0 };
return filterCallback(request);
}
@@ -249,10 +248,7 @@ QWebEngineCookieStore::QWebEngineCookieStore(QObject *parent)
Destroys this QWebEngineCookieStore object.
*/
-QWebEngineCookieStore::~QWebEngineCookieStore()
-{
-
-}
+QWebEngineCookieStore::~QWebEngineCookieStore() {}
/*!
Adds \a cookie to the cookie store.
@@ -298,7 +294,8 @@ void QWebEngineCookieStore::loadAllCookies()
//TODO: use callbacks or delete dummy ones
if (d_ptr->m_getAllCookiesPending)
return;
- d_ptr->callbackDirectory.registerCallback(CallbackDirectory::GetAllCookiesCallbackId, QWebEngineCallback<const QByteArray&>());
+ d_ptr->callbackDirectory.registerCallback(CallbackDirectory::GetAllCookiesCallbackId,
+ QWebEngineCallback<const QByteArray &>());
//this will trigger cookieAdded signal
d_ptr->getAllCookies();
}
diff --git a/src/core/api/qwebenginecookiestore.h b/src/core/api/qwebenginecookiestore.h
index 36bb64ccf..3d313ac23 100644
--- a/src/core/api/qwebenginecookiestore.h
+++ b/src/core/api/qwebenginecookiestore.h
@@ -52,7 +52,7 @@
namespace QtWebEngineCore {
class ProfileAdapter;
class CookieMonsterDelegateQt;
-}
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
@@ -93,6 +93,6 @@ private:
QT_END_NAMESPACE
-Q_DECLARE_METATYPE(QWebEngineCookieStore*)
+Q_DECLARE_METATYPE(QWebEngineCookieStore *)
#endif // QWEBENGINECOOKIESTORE_H
diff --git a/src/core/api/qwebenginecookiestore_p.h b/src/core/api/qwebenginecookiestore_p.h
index 3df0e3590..a79e2b095 100644
--- a/src/core/api/qwebenginecookiestore_p.h
+++ b/src/core/api/qwebenginecookiestore_p.h
@@ -66,8 +66,7 @@ class CookieMonsterDelegateQt;
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate
-{
+class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate {
Q_DECLARE_PUBLIC(QWebEngineCookieStore)
struct CookieData {
quint64 callbackId;
@@ -76,9 +75,10 @@ class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineCookieStorePrivate
};
friend class QTypeInfo<CookieData>;
QWebEngineCookieStore *q_ptr;
+
public:
QtWebEngineCore::CallbackDirectory callbackDirectory;
- std::function<bool(const QWebEngineCookieStore::FilterRequest&)> filterCallback;
+ std::function<bool(const QWebEngineCookieStore::FilterRequest &)> filterCallback;
QVector<CookieData> m_pendingUserCookies;
quint64 m_nextCallbackId;
bool m_deleteSessionCookiesPending;
diff --git a/src/core/api/qwebenginehttprequest.cpp b/src/core/api/qwebenginehttprequest.cpp
index b64af4466..3395cc99f 100644
--- a/src/core/api/qwebenginehttprequest.cpp
+++ b/src/core/api/qwebenginehttprequest.cpp
@@ -67,8 +67,7 @@ QT_BEGIN_NAMESPACE
\value Post The POST method.
*/
-class QWebEngineHttpRequestPrivate : public QSharedData
-{
+class QWebEngineHttpRequestPrivate : public QSharedData {
public:
QUrl url;
QWebEngineHttpRequest::Method method;
@@ -77,23 +76,18 @@ public:
Headers headers;
QByteArray postData;
- inline QWebEngineHttpRequestPrivate()
- {
- }
+ QWebEngineHttpRequestPrivate() {}
- ~QWebEngineHttpRequestPrivate()
- {
- }
+ ~QWebEngineHttpRequestPrivate() {}
- QWebEngineHttpRequestPrivate(const QWebEngineHttpRequestPrivate &other)
- : QSharedData(other)
+ QWebEngineHttpRequestPrivate(const QWebEngineHttpRequestPrivate &other) : QSharedData(other)
{
method = other.method;
url = other.url;
headers = other.headers;
}
- inline bool operator==(const QWebEngineHttpRequestPrivate &other) const
+ bool operator==(const QWebEngineHttpRequestPrivate &other) const
{
return method == other.method
&& url == other.url
@@ -128,10 +122,7 @@ QWebEngineHttpRequest::QWebEngineHttpRequest(const QUrl &url,
/*!
Creates a copy of \a other.
*/
-QWebEngineHttpRequest::QWebEngineHttpRequest(const QWebEngineHttpRequest &other)
- : d(other.d)
-{
-}
+QWebEngineHttpRequest::QWebEngineHttpRequest(const QWebEngineHttpRequest &other) : d(other.d) {}
/*!
Disposes of the QWebEngineHttpRequest object.
@@ -207,7 +198,6 @@ QWebEngineHttpRequest QWebEngineHttpRequest::postRequest(const QUrl &url,
return result;
}
-
/*!
Returns the method this WebEngine request is using.
@@ -291,8 +281,7 @@ bool QWebEngineHttpRequest::hasHeader(const QByteArray &headerName) const
*/
QByteArray QWebEngineHttpRequest::header(const QByteArray &headerName) const
{
- QWebEngineHttpRequestPrivate::Headers::ConstIterator it =
- d->findHeader(headerName);
+ QWebEngineHttpRequestPrivate::Headers::ConstIterator it = d->findHeader(headerName);
if (it != d->headers.constEnd())
return it->second;
return QByteArray();
@@ -334,16 +323,15 @@ void QWebEngineHttpRequest::unsetHeader(const QByteArray &key)
d->setHeader(key, QByteArray());
}
-QWebEngineHttpRequestPrivate::Headers::ConstIterator
-QWebEngineHttpRequestPrivate::findHeader(const QByteArray &key) const
+QWebEngineHttpRequestPrivate::Headers::ConstIterator QWebEngineHttpRequestPrivate::findHeader(const QByteArray &key) const
{
Headers::ConstIterator it = headers.constBegin();
Headers::ConstIterator end = headers.constEnd();
- for ( ; it != end; ++it)
+ for (; it != end; ++it)
if (qstricmp(it->first.constData(), key.constData()) == 0)
return it;
- return end; // not found
+ return end; // not found
}
QWebEngineHttpRequestPrivate::Headers QWebEngineHttpRequestPrivate::allHeaders() const
@@ -355,9 +343,8 @@ QVector<QByteArray> QWebEngineHttpRequestPrivate::headersKeys() const
{
QVector<QByteArray> result;
result.reserve(headers.size());
- Headers::ConstIterator it = headers.constBegin(),
- end = headers.constEnd();
- for ( ; it != end; ++it)
+ Headers::ConstIterator it = headers.constBegin(), end = headers.constEnd();
+ for (; it != end; ++it)
result << it->first;
return result;
@@ -385,8 +372,7 @@ void QWebEngineHttpRequestPrivate::unsetHeader(const QByteArray &key)
auto firstEqualsKey = [&key](const HeaderPair &header) {
return qstricmp(header.first.constData(), key.constData()) == 0;
};
- headers.erase(std::remove_if(headers.begin(), headers.end(), firstEqualsKey),
- headers.end());
+ headers.erase(std::remove_if(headers.begin(), headers.end(), firstEqualsKey), headers.end());
}
/*!
@@ -408,7 +394,7 @@ void QWebEngineHttpRequestPrivate::setHeaderInternal(const QByteArray &key, cons
unsetHeader(key);
if (value.isNull())
- return; // only wanted to erase key
+ return; // only wanted to erase key
HeaderPair pair;
pair.first = key;
diff --git a/src/core/api/qwebenginehttprequest.h b/src/core/api/qwebenginehttprequest.h
index 8735dfb8e..1c4d7837b 100644
--- a/src/core/api/qwebenginehttprequest.h
+++ b/src/core/api/qwebenginehttprequest.h
@@ -49,11 +49,9 @@
QT_BEGIN_NAMESPACE
-
class QWebEngineHttpRequestPrivate;
-class Q_WEBENGINECORE_EXPORT QWebEngineHttpRequest
-{
+class Q_WEBENGINECORE_EXPORT QWebEngineHttpRequest {
public:
enum Method {
Get,
@@ -61,22 +59,23 @@ public:
};
explicit QWebEngineHttpRequest(const QUrl &url = QUrl(),
- const QWebEngineHttpRequest::Method &method = QWebEngineHttpRequest::Get);
+ const QWebEngineHttpRequest::Method &method = QWebEngineHttpRequest::Get);
QWebEngineHttpRequest(const QWebEngineHttpRequest &other);
~QWebEngineHttpRequest();
#ifdef Q_COMPILER_RVALUE_REFS
- QWebEngineHttpRequest &operator=(QWebEngineHttpRequest &&other) Q_DECL_NOTHROW { swap(other);
- return *this; }
+ QWebEngineHttpRequest &operator=(QWebEngineHttpRequest &&other) Q_DECL_NOTHROW
+ {
+ swap(other);
+ return *this;
+ }
#endif
QWebEngineHttpRequest &operator=(const QWebEngineHttpRequest &other);
- static QWebEngineHttpRequest postRequest(const QUrl &url,
- const QMap<QString, QString> &postData);
+ static QWebEngineHttpRequest postRequest(const QUrl &url, const QMap<QString, QString> &postData);
void swap(QWebEngineHttpRequest &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
bool operator==(const QWebEngineHttpRequest &other) const;
- inline bool operator!=(const QWebEngineHttpRequest &other) const
- { return !operator==(other); }
+ inline bool operator!=(const QWebEngineHttpRequest &other) const { return !operator==(other); }
Method method() const;
void setMethod(QWebEngineHttpRequest::Method method);
diff --git a/src/core/api/qwebenginemessagepumpscheduler_p.h b/src/core/api/qwebenginemessagepumpscheduler_p.h
index 46ed62f54..07b2ca203 100644
--- a/src/core/api/qwebenginemessagepumpscheduler_p.h
+++ b/src/core/api/qwebenginemessagepumpscheduler_p.h
@@ -59,8 +59,7 @@
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineMessagePumpScheduler : public QObject
-{
+class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineMessagePumpScheduler : public QObject {
Q_OBJECT
public:
QWebEngineMessagePumpScheduler(std::function<void()> callback);
diff --git a/src/core/api/qwebenginenotification.cpp b/src/core/api/qwebenginenotification.cpp
index 0b1d48ce9..f91eabd25 100644
--- a/src/core/api/qwebenginenotification.cpp
+++ b/src/core/api/qwebenginenotification.cpp
@@ -90,13 +90,11 @@ public:
*/
QWebEngineNotification::QWebEngineNotification(const QSharedPointer<UserNotificationController> &controller)
: d_ptr(new QWebEngineNotificationPrivate(this, controller))
-{ }
+{}
/*! \internal
*/
-QWebEngineNotification::~QWebEngineNotification()
-{
-}
+QWebEngineNotification::~QWebEngineNotification() {}
/*!
Returns \c true if the two notifications belong to the same message chain.
diff --git a/src/core/api/qwebenginequotarequest.cpp b/src/core/api/qwebenginequotarequest.cpp
index 49c9f041f..7686d0806 100644
--- a/src/core/api/qwebenginequotarequest.cpp
+++ b/src/core/api/qwebenginequotarequest.cpp
@@ -64,8 +64,7 @@ QT_BEGIN_NAMESPACE
/*! \internal */
QWebEngineQuotaRequest::QWebEngineQuotaRequest(QSharedPointer<QtWebEngineCore::QuotaRequestController> controller)
: d_ptr(controller)
-{
-}
+{}
/*!
Rejects a request for larger persistent storage.
diff --git a/src/core/api/qwebenginequotarequest.h b/src/core/api/qwebenginequotarequest.h
index 1f6333b3b..da72116c8 100644
--- a/src/core/api/qwebenginequotarequest.h
+++ b/src/core/api/qwebenginequotarequest.h
@@ -47,7 +47,7 @@
namespace QtWebEngineCore {
class QuotaPermissionContextQt;
class QuotaRequestController;
-}
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
@@ -63,6 +63,7 @@ public:
qint64 requestedSize() const;
bool operator==(const QWebEngineQuotaRequest &that) const { return d_ptr == that.d_ptr; }
bool operator!=(const QWebEngineQuotaRequest &that) const { return d_ptr != that.d_ptr; }
+
private:
QWebEngineQuotaRequest(QSharedPointer<QtWebEngineCore::QuotaRequestController>);
friend QtWebEngineCore::QuotaPermissionContextQt;
diff --git a/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp b/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp
index 1921f78f4..a3960327d 100644
--- a/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp
+++ b/src/core/api/qwebengineregisterprotocolhandlerrequest.cpp
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
/*! \internal */
QWebEngineRegisterProtocolHandlerRequest::QWebEngineRegisterProtocolHandlerRequest(
- QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController> d_ptr)
+ QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController> d_ptr)
: d_ptr(std::move(d_ptr))
{}
diff --git a/src/core/api/qwebengineregisterprotocolhandlerrequest.h b/src/core/api/qwebengineregisterprotocolhandlerrequest.h
index 281e81e73..67caf1590 100644
--- a/src/core/api/qwebengineregisterprotocolhandlerrequest.h
+++ b/src/core/api/qwebengineregisterprotocolhandlerrequest.h
@@ -47,7 +47,7 @@
namespace QtWebEngineCore {
class RegisterProtocolHandlerRequestController;
class WebContentsDelegateQt;
-}
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
@@ -63,9 +63,9 @@ public:
QString scheme() const;
bool operator==(const QWebEngineRegisterProtocolHandlerRequest &that) const { return d_ptr == that.d_ptr; }
bool operator!=(const QWebEngineRegisterProtocolHandlerRequest &that) const { return d_ptr != that.d_ptr; }
+
private:
- QWebEngineRegisterProtocolHandlerRequest(
- QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController>);
+ QWebEngineRegisterProtocolHandlerRequest(QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController>);
friend QtWebEngineCore::WebContentsDelegateQt;
QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController> d_ptr;
};
diff --git a/src/core/api/qwebengineurlrequestinfo.cpp b/src/core/api/qwebengineurlrequestinfo.cpp
index dc2d07740..3cbb4da17 100644
--- a/src/core/api/qwebengineurlrequestinfo.cpp
+++ b/src/core/api/qwebengineurlrequestinfo.cpp
@@ -68,8 +68,10 @@ ASSERT_ENUMS_MATCH(QWebEngineUrlRequestInfo::ResourceTypeLast, content::RESOURCE
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::LinkNavigation, QWebEngineUrlRequestInfo::NavigationTypeLink)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::TypedNavigation, QWebEngineUrlRequestInfo::NavigationTypeTyped)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::FormSubmittedNavigation, QWebEngineUrlRequestInfo::NavigationTypeFormSubmitted)
-ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::BackForwardNavigation, QWebEngineUrlRequestInfo::NavigationTypeBackForward)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::FormSubmittedNavigation,
+ QWebEngineUrlRequestInfo::NavigationTypeFormSubmitted)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::BackForwardNavigation,
+ QWebEngineUrlRequestInfo::NavigationTypeBackForward)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::ReloadNavigation, QWebEngineUrlRequestInfo::NavigationTypeReload)
ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, QWebEngineUrlRequestInfo::NavigationTypeOther)
@@ -82,7 +84,7 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, Q
The QWebEngineUrlRequestInfo is useful for setting extra header fields for requests
or for redirecting certain requests without payload data to another URL.
This class cannot be instantiated or copied by the user, instead it will
- be created by Qt WebEngine and sent through the virtual function
+ be created by \QWE and sent through the virtual function
QWebEngineUrlRequestInterceptor::interceptRequest() if an interceptor has been set.
*/
@@ -124,8 +126,9 @@ ASSERT_ENUMS_MATCH(QtWebEngineCore::WebContentsAdapterClient::OtherNavigation, Q
execution of this function is finished.
*/
-
-QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource, QWebEngineUrlRequestInfo::NavigationType navigation, const QUrl &u, const QUrl &fpu, const QByteArray &m)
+QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource,
+ QWebEngineUrlRequestInfo::NavigationType navigation,
+ const QUrl &u, const QUrl &fpu, const QByteArray &m)
: resourceType(resource)
, navigationType(navigation)
, shouldBlockRequest(false)
@@ -133,31 +136,24 @@ QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRe
, firstPartyUrl(fpu)
, method(m)
, changed(false)
-{
-}
+{}
/*!
\internal
*/
-QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfo &&p)
- : d_ptr(p.d_ptr.take())
-{
-}
+QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfo &&p) : d_ptr(p.d_ptr.take()) {}
/*!
\internal
*/
-QWebEngineUrlRequestInfo::~QWebEngineUrlRequestInfo()
-{
-}
+QWebEngineUrlRequestInfo::~QWebEngineUrlRequestInfo() {}
/*!
\internal
*/
-QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfoPrivate *p)
- : d_ptr(p)
+QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfoPrivate *p) : d_ptr(p)
{
d_ptr->q_ptr = this;
}
@@ -247,7 +243,6 @@ QUrl QWebEngineUrlRequestInfo::firstPartyUrl() const
return d_ptr->firstPartyUrl;
}
-
/*!
Returns the HTTP method of the request (for example, GET or POST).
*/
diff --git a/src/core/api/qwebengineurlrequestinfo.h b/src/core/api/qwebengineurlrequestinfo.h
index f37693cda..cf5a4801d 100644
--- a/src/core/api/qwebengineurlrequestinfo.h
+++ b/src/core/api/qwebengineurlrequestinfo.h
@@ -48,7 +48,7 @@
namespace QtWebEngineCore {
class NetworkDelegateQt;
class URLRequestNotification;
-}
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
diff --git a/src/core/api/qwebengineurlrequestinfo_p.h b/src/core/api/qwebengineurlrequestinfo_p.h
index 9afd04398..9d795b2b5 100644
--- a/src/core/api/qwebengineurlrequestinfo_p.h
+++ b/src/core/api/qwebengineurlrequestinfo_p.h
@@ -65,15 +65,12 @@ class URLRequest;
QT_BEGIN_NAMESPACE
-class QWebEngineUrlRequestInfoPrivate
-{
+class QWebEngineUrlRequestInfoPrivate {
Q_DECLARE_PUBLIC(QWebEngineUrlRequestInfo)
public:
- QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource
- , QWebEngineUrlRequestInfo::NavigationType navigation
- , const QUrl &u
- , const QUrl &fpu
- , const QByteArray &m);
+ QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType resource,
+ QWebEngineUrlRequestInfo::NavigationType navigation, const QUrl &u, const QUrl &fpu,
+ const QByteArray &m);
QWebEngineUrlRequestInfo::ResourceType resourceType;
QWebEngineUrlRequestInfo::NavigationType navigationType;
diff --git a/src/core/api/qwebengineurlrequestinterceptor.h b/src/core/api/qwebengineurlrequestinterceptor.h
index 027486b40..4d3020306 100644
--- a/src/core/api/qwebengineurlrequestinterceptor.h
+++ b/src/core/api/qwebengineurlrequestinterceptor.h
@@ -50,15 +50,11 @@
QT_BEGIN_NAMESPACE
-class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInterceptor : public QObject
-{
+class Q_WEBENGINECORE_EXPORT QWebEngineUrlRequestInterceptor : public QObject {
Q_OBJECT
Q_DISABLE_COPY(QWebEngineUrlRequestInterceptor)
public:
- explicit QWebEngineUrlRequestInterceptor(QObject *p = nullptr)
- : QObject (p)
- {
- }
+ explicit QWebEngineUrlRequestInterceptor(QObject *p = nullptr) : QObject(p) {}
virtual void interceptRequest(QWebEngineUrlRequestInfo &info) = 0;
};
diff --git a/src/core/api/qwebengineurlrequestjob.cpp b/src/core/api/qwebengineurlrequestjob.cpp
index bc860b3b3..3bb9d1732 100644
--- a/src/core/api/qwebengineurlrequestjob.cpp
+++ b/src/core/api/qwebengineurlrequestjob.cpp
@@ -84,11 +84,10 @@ QT_BEGIN_NAMESPACE
/*!
\internal
*/
-QWebEngineUrlRequestJob::QWebEngineUrlRequestJob(URLRequestCustomJobDelegate * p)
+QWebEngineUrlRequestJob::QWebEngineUrlRequestJob(URLRequestCustomJobDelegate *p)
: QObject(p) // owned by the jobdelegate and deleted when the job is done
, d_ptr(p)
-{
-}
+{}
/*!
\internal
diff --git a/src/core/api/qwebengineurlrequestjob.h b/src/core/api/qwebengineurlrequestjob.h
index dee09b6e1..6d4a9e734 100644
--- a/src/core/api/qwebengineurlrequestjob.h
+++ b/src/core/api/qwebengineurlrequestjob.h
@@ -49,7 +49,7 @@
namespace QtWebEngineCore {
class URLRequestCustomJobDelegate;
class URLRequestCustomJobProxy;
-} // namespace
+} // namespace QtWebEngineCore
QT_BEGIN_NAMESPACE
@@ -83,7 +83,7 @@ private:
QWebEngineUrlRequestJob(QtWebEngineCore::URLRequestCustomJobDelegate *);
friend class QtWebEngineCore::URLRequestCustomJobProxy;
- QtWebEngineCore::URLRequestCustomJobDelegate* d_ptr;
+ QtWebEngineCore::URLRequestCustomJobDelegate *d_ptr;
};
QT_END_NAMESPACE
diff --git a/src/core/api/qwebengineurlscheme.cpp b/src/core/api/qwebengineurlscheme.cpp
index 9f7288f2d..f4efad717 100644
--- a/src/core/api/qwebengineurlscheme.cpp
+++ b/src/core/api/qwebengineurlscheme.cpp
@@ -48,8 +48,7 @@ QT_BEGIN_NAMESPACE
ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::Syntax::Path, url::SCHEME_WITHOUT_AUTHORITY)
ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::Syntax::Host, url::SCHEME_WITH_HOST)
ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::Syntax::HostAndPort, url::SCHEME_WITH_HOST_AND_PORT)
-ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::Syntax::HostPortAndUserInformation,
- url::SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION)
+ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::Syntax::HostPortAndUserInformation, url::SCHEME_WITH_HOST_PORT_AND_USER_INFORMATION)
ASSERT_ENUMS_MATCH(QWebEngineUrlScheme::PortUnspecified, url::PORT_UNSPECIFIED)
@@ -88,7 +87,7 @@ public:
URLs.
Custom URL schemes must be configured early at application startup, before
- creating any Qt WebEngine classes. In general this means the schemes need to be configured before
+ creating any \QWE classes. In general this means the schemes need to be configured before
a QGuiApplication or QApplication instance is created.
Every registered scheme configuration applies globally to all profiles.
@@ -193,10 +192,7 @@ public:
Content-Security-Policy checks.
*/
-QWebEngineUrlScheme::QWebEngineUrlScheme(QWebEngineUrlSchemePrivate *d)
- : d(d)
-{
-}
+QWebEngineUrlScheme::QWebEngineUrlScheme(QWebEngineUrlSchemePrivate *d) : d(d) {}
/*!
Constructs a web engine URL scheme with default values.
@@ -378,6 +374,11 @@ void QWebEngineUrlScheme::registerScheme(const QWebEngineUrlScheme &scheme)
return;
}
+ if (url::IsStandard(scheme.d->name.data(), url::Component(0, scheme.d->name.size()))) {
+ qWarning() << "QWebEngineUrlScheme::registerScheme: Scheme" << scheme.name() << "is a standard scheme";
+ return;
+ }
+
if (g_schemesLocked) {
qWarning() << "QWebEngineUrlScheme::registerScheme: Too late to register scheme" << scheme.name();
return;
@@ -394,7 +395,7 @@ void QWebEngineUrlScheme::registerScheme(const QWebEngineUrlScheme &scheme)
*/
QWebEngineUrlScheme QWebEngineUrlScheme::schemeByName(const QByteArray &name)
{
- base::StringPiece namePiece{name.data(), static_cast<size_t>(name.size())};
+ base::StringPiece namePiece{ name.data(), static_cast<size_t>(name.size()) };
if (const url::CustomScheme *cs = url::CustomScheme::FindScheme(namePiece))
return QWebEngineUrlScheme(new QWebEngineUrlSchemePrivate(*cs));
return QWebEngineUrlScheme();
diff --git a/src/core/api/qwebengineurlscheme.h b/src/core/api/qwebengineurlscheme.h
index f3ceb0596..095b47320 100644
--- a/src/core/api/qwebengineurlscheme.h
+++ b/src/core/api/qwebengineurlscheme.h
@@ -46,7 +46,9 @@
#include <QtCore/qobjectdefs.h>
#include <QtCore/qshareddata.h>
-namespace QtWebEngineCore { class WebEngineContext; }
+namespace QtWebEngineCore {
+class WebEngineContext;
+}
QT_BEGIN_NAMESPACE
diff --git a/src/core/api/qwebengineurlschemehandler.h b/src/core/api/qwebengineurlschemehandler.h
index be80241f1..09c5b08cb 100644
--- a/src/core/api/qwebengineurlschemehandler.h
+++ b/src/core/api/qwebengineurlschemehandler.h
@@ -58,7 +58,7 @@ public:
QWebEngineUrlSchemeHandler(QObject *parent = Q_NULLPTR);
~QWebEngineUrlSchemeHandler();
- virtual void requestStarted(QWebEngineUrlRequestJob*) = 0;
+ virtual void requestStarted(QWebEngineUrlRequestJob *) = 0;
private:
Q_DISABLE_COPY(QWebEngineUrlSchemeHandler)
diff --git a/src/core/clipboard_change_observer.h b/src/core/clipboard_change_observer.h
new file mode 100644
index 000000000..f9b33fc93
--- /dev/null
+++ b/src/core/clipboard_change_observer.h
@@ -0,0 +1,64 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $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 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.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-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 (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$
+**
+****************************************************************************/
+
+#ifndef CLIPBOARD_CHANGE_OBSERVER_H
+#define CLIPBOARD_CHANGE_OBSERVER_H
+
+#include <QClipboard>
+#include <QMap>
+#include <QObject>
+
+namespace QtWebEngineCore {
+
+class ClipboardChangeObserver : public QObject {
+ Q_OBJECT
+public:
+ ClipboardChangeObserver();
+ quint64 getSequenceNumber(QClipboard::Mode mode) { return sequenceNumber.value(mode); }
+
+private Q_SLOTS:
+ void trackChange(QClipboard::Mode mode);
+
+private:
+ QMap<QClipboard::Mode, quint64> sequenceNumber;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // CLIPBOARD_CHANGE_OBSERVER_H
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index d7fa225cd..f4a14570a 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -42,15 +42,15 @@
// found in the LICENSE.Chromium file.
#include "clipboard_qt.h"
-#include "ui/base/clipboard/clipboard.h"
-#include "ui/base/clipboard/clipboard_constants.h"
-#include "ui/base/clipboard/clipboard_format_type.h"
-
+#include "clipboard_change_observer.h"
#include "type_conversion.h"
#include "base/logging.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/clipboard/custom_data_helper.h"
+#include "ui/base/clipboard/clipboard.h"
+#include "ui/base/clipboard/clipboard_constants.h"
+#include "ui/base/clipboard/clipboard_format_type.h"
#include <QGuiApplication>
#include <QImage>
@@ -91,12 +91,13 @@ QMimeData *getUncommittedData()
return uncommittedData.data();
}
-} // namespace
+} // namespace
namespace ui {
// Factory function
-Clipboard* Clipboard::Create() {
+Clipboard *Clipboard::Create()
+{
return new ClipboardQt;
}
@@ -104,7 +105,7 @@ Clipboard* Clipboard::Create() {
namespace QtWebEngineCore {
-void ClipboardQt::WriteObjects(ui::ClipboardType type, const ObjectMap& objects)
+void ClipboardQt::WriteObjects(ui::ClipboardType type, const ObjectMap &objects)
{
DCHECK(CalledOnValidThread());
DCHECK(IsSupportedClipboardType(type));
@@ -114,7 +115,9 @@ void ClipboardQt::WriteObjects(ui::ClipboardType type, const ObjectMap& objects)
// Commit the accumulated data.
if (uncommittedData)
- QGuiApplication::clipboard()->setMimeData(uncommittedData.take(), type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ QGuiApplication::clipboard()->setMimeData(uncommittedData.take(),
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard
+ : QClipboard::Selection);
if (type == ui::CLIPBOARD_TYPE_COPY_PASTE && IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) {
ObjectMap::const_iterator text_iter = objects.find(CBF_TEXT);
@@ -126,17 +129,17 @@ void ClipboardQt::WriteObjects(ui::ClipboardType type, const ObjectMap& objects)
}
}
-void ClipboardQt::WriteText(const char* text_data, size_t text_len)
+void ClipboardQt::WriteText(const char *text_data, size_t text_len)
{
getUncommittedData()->setText(QString::fromUtf8(text_data, text_len));
}
-void ClipboardQt::WriteHTML(const char* markup_data, size_t markup_len, const char* url_data, size_t url_len)
+void ClipboardQt::WriteHTML(const char *markup_data, size_t markup_len, const char *url_data, size_t url_len)
{
getUncommittedData()->setHtml(QString::fromUtf8(markup_data, markup_len));
}
-void ClipboardQt::WriteRTF(const char* rtf_data, size_t data_len)
+void ClipboardQt::WriteRTF(const char *rtf_data, size_t data_len)
{
getUncommittedData()->setData(QString::fromLatin1(ui::kMimeTypeRTF), QByteArray(rtf_data, data_len));
}
@@ -146,12 +149,12 @@ void ClipboardQt::WriteWebSmartPaste()
getUncommittedData()->setData(QString::fromLatin1(ui::kMimeTypeWebkitSmartPaste), QByteArray());
}
-void ClipboardQt::WriteBitmap(const SkBitmap& bitmap)
+void ClipboardQt::WriteBitmap(const SkBitmap &bitmap)
{
getUncommittedData()->setImageData(toQImage(bitmap).copy());
}
-void ClipboardQt::WriteBookmark(const char* title_data, size_t title_len, const char* url_data, size_t url_len)
+void ClipboardQt::WriteBookmark(const char *title_data, size_t title_len, const char *url_data, size_t url_len)
{
// FIXME: Untested, seems to be used only for drag-n-drop.
// Write as a mozilla url (UTF16: URL, newline, title).
@@ -159,29 +162,32 @@ void ClipboardQt::WriteBookmark(const char* title_data, size_t title_len, const
QString title = QString::fromUtf8(title_data, title_len);
QByteArray data;
- data.append(reinterpret_cast<const char*>(url.utf16()), url.size() * 2);
+ data.append(reinterpret_cast<const char *>(url.utf16()), url.size() * 2);
data.append('\n');
- data.append(reinterpret_cast<const char*>(title.utf16()), title.size() * 2);
+ data.append(reinterpret_cast<const char *>(title.utf16()), title.size() * 2);
getUncommittedData()->setData(QString::fromLatin1(ui::kMimeTypeMozillaURL), data);
}
-void ClipboardQt::WriteData(const ui::ClipboardFormatType& format, const char* data_data, size_t data_len)
+void ClipboardQt::WriteData(const ui::ClipboardFormatType &format, const char *data_data, size_t data_len)
{
getUncommittedData()->setData(QString::fromStdString(format.ToString()), QByteArray(data_data, data_len));
}
-bool ClipboardQt::IsFormatAvailable(const ui::ClipboardFormatType& format, ui::ClipboardType type) const
+bool ClipboardQt::IsFormatAvailable(const ui::ClipboardFormatType &format, ui::ClipboardType type) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
return mimeData && mimeData->hasFormat(QString::fromStdString(format.ToString()));
}
void ClipboardQt::Clear(ui::ClipboardType type)
{
- QGuiApplication::clipboard()->clear(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ QGuiApplication::clipboard()->clear(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard
+ : QClipboard::Selection);
}
-void ClipboardQt::ReadAvailableTypes(ui::ClipboardType type, std::vector<base::string16>* types, bool* contains_filenames) const
+void ClipboardQt::ReadAvailableTypes(ui::ClipboardType type, std::vector<base::string16> *types,
+ bool *contains_filenames) const
{
if (!types || !contains_filenames) {
NOTREACHED();
@@ -189,7 +195,8 @@ void ClipboardQt::ReadAvailableTypes(ui::ClipboardType type, std::vector<base::s
}
types->clear();
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
if (mimeData->hasImage() && !mimeData->formats().contains(QStringLiteral("image/png")))
@@ -203,22 +210,24 @@ void ClipboardQt::ReadAvailableTypes(ui::ClipboardType type, std::vector<base::s
ui::ReadCustomDataTypes(customData.constData(), customData.size(), types);
}
-
-void ClipboardQt::ReadText(ui::ClipboardType type, base::string16* result) const
+void ClipboardQt::ReadText(ui::ClipboardType type, base::string16 *result) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (mimeData)
*result = toString16(mimeData->text());
}
-void ClipboardQt::ReadAsciiText(ui::ClipboardType type, std::string* result) const
+void ClipboardQt::ReadAsciiText(ui::ClipboardType type, std::string *result) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (mimeData)
*result = mimeData->text().toStdString();
}
-void ClipboardQt::ReadHTML(ui::ClipboardType type, base::string16* markup, std::string* src_url, uint32_t* fragment_start, uint32_t* fragment_end) const
+void ClipboardQt::ReadHTML(ui::ClipboardType type, base::string16 *markup, std::string *src_url,
+ uint32_t *fragment_start, uint32_t *fragment_end) const
{
markup->clear();
if (src_url)
@@ -226,16 +235,18 @@ void ClipboardQt::ReadHTML(ui::ClipboardType type, base::string16* markup, std::
*fragment_start = 0;
*fragment_end = 0;
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
*markup = toString16(mimeData->html());
*fragment_end = static_cast<uint32_t>(markup->length());
}
-void ClipboardQt::ReadRTF(ui::ClipboardType type, std::string* result) const
+void ClipboardQt::ReadRTF(ui::ClipboardType type, std::string *result) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
const QByteArray byteArray = mimeData->data(QString::fromLatin1(ui::kMimeTypeRTF));
@@ -244,7 +255,8 @@ void ClipboardQt::ReadRTF(ui::ClipboardType type, std::string* result) const
SkBitmap ClipboardQt::ReadImage(ui::ClipboardType type) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return SkBitmap();
QImage image = qvariant_cast<QImage>(mimeData->imageData());
@@ -267,21 +279,22 @@ SkBitmap ClipboardQt::ReadImage(ui::ClipboardType type) const
return bitmap;
}
-void ClipboardQt::ReadCustomData(ui::ClipboardType clipboard_type, const base::string16& type, base::string16* result) const
+void ClipboardQt::ReadCustomData(ui::ClipboardType clipboard_type, const base::string16 &type, base::string16 *result) const
{
- const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(clipboard_type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData(
+ clipboard_type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
if (!mimeData)
return;
const QByteArray customData = mimeData->data(QString::fromLatin1(ui::kMimeTypeWebCustomData));
ui::ReadCustomDataForType(customData.constData(), customData.size(), type, result);
}
-void ClipboardQt::ReadBookmark(base::string16* title, std::string* url) const
+void ClipboardQt::ReadBookmark(base::string16 *title, std::string *url) const
{
NOTIMPLEMENTED();
}
-void ClipboardQt::ReadData(const ui::ClipboardFormatType& format, std::string* result) const
+void ClipboardQt::ReadData(const ui::ClipboardFormatType &format, std::string *result) const
{
const QMimeData *mimeData = QGuiApplication::clipboard()->mimeData();
if (!mimeData)
@@ -292,7 +305,8 @@ void ClipboardQt::ReadData(const ui::ClipboardFormatType& format, std::string* r
uint64_t ClipboardQt::GetSequenceNumber(ui::ClipboardType type) const
{
- return clipboardChangeObserver()->getSequenceNumber(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard : QClipboard::Selection);
+ return clipboardChangeObserver()->getSequenceNumber(type == ui::CLIPBOARD_TYPE_COPY_PASTE ? QClipboard::Clipboard
+ : QClipboard::Selection);
}
-} // namespace QtWebEngineCore
+} // namespace QtWebEngineCore
diff --git a/src/core/clipboard_qt.h b/src/core/clipboard_qt.h
index d5fa35af6..7884da167 100644
--- a/src/core/clipboard_qt.h
+++ b/src/core/clipboard_qt.h
@@ -42,57 +42,36 @@
#include "ui/base/clipboard/clipboard.h"
-#include <QClipboard>
-#include <QMap>
-#include <QObject>
-
namespace QtWebEngineCore {
-class ClipboardChangeObserver : public QObject {
- Q_OBJECT
-public:
- ClipboardChangeObserver();
- quint64 getSequenceNumber(QClipboard::Mode mode) {
- return sequenceNumber.value(mode);
- }
-
-private Q_SLOTS:
- void trackChange(QClipboard::Mode mode);
-
-private:
- QMap<QClipboard::Mode, quint64> sequenceNumber;
-};
-
class ClipboardQt : public ui::Clipboard {
public:
uint64_t GetSequenceNumber(ui::ClipboardType type) const override;
- bool IsFormatAvailable(const ui::ClipboardFormatType& format, ui::ClipboardType type) const override;
+ bool IsFormatAvailable(const ui::ClipboardFormatType &format, ui::ClipboardType type) const override;
void Clear(ui::ClipboardType type) override;
- void ReadAvailableTypes(ui::ClipboardType type, std::vector<base::string16>* types, bool* contains_filenames) const override;
- void ReadText(ui::ClipboardType type, base::string16* result) const override;
- void ReadAsciiText(ui::ClipboardType type, std::string* result) const override;
- void ReadHTML(ui::ClipboardType type,
- base::string16* markup,
- std::string* src_url,
- uint32_t* fragment_start,
- uint32_t* fragment_end) const override;
- void ReadRTF(ui::ClipboardType type, std::string* result) const override;
+ void ReadAvailableTypes(ui::ClipboardType type, std::vector<base::string16> *types,
+ bool *contains_filenames) const override;
+ void ReadText(ui::ClipboardType type, base::string16 *result) const override;
+ void ReadAsciiText(ui::ClipboardType type, std::string *result) const override;
+ void ReadHTML(ui::ClipboardType type, base::string16 *markup, std::string *src_url, uint32_t *fragment_start,
+ uint32_t *fragment_end) const override;
+ void ReadRTF(ui::ClipboardType type, std::string *result) const override;
SkBitmap ReadImage(ui::ClipboardType type) const override;
- void ReadCustomData(ui::ClipboardType clipboard_type, const base::string16& type, base::string16* result) const override;
- void ReadBookmark(base::string16* title, std::string* url) const override;
- void ReadData(const ui::ClipboardFormatType& format, std::string* result) const override;
+ void ReadCustomData(ui::ClipboardType clipboard_type, const base::string16 &type, base::string16 *result) const override;
+ void ReadBookmark(base::string16 *title, std::string *url) const override;
+ void ReadData(const ui::ClipboardFormatType &format, std::string *result) const override;
- void OnPreShutdown() override { }
+ void OnPreShutdown() override {}
protected:
- void WriteObjects(ui::ClipboardType type, const ObjectMap& objects) override;
- void WriteText(const char* text_data, size_t text_len) override;
- void WriteHTML(const char* markup_data, size_t markup_len, const char* url_data, size_t url_len) override;
- void WriteRTF(const char* rtf_data, size_t data_len) override;
- void WriteBookmark(const char* title_data, size_t title_len, const char* url_data, size_t url_len) override;
+ void WriteObjects(ui::ClipboardType type, const ObjectMap &objects) override;
+ void WriteText(const char *text_data, size_t text_len) override;
+ void WriteHTML(const char *markup_data, size_t markup_len, const char *url_data, size_t url_len) override;
+ void WriteRTF(const char *rtf_data, size_t data_len) override;
+ void WriteBookmark(const char *title_data, size_t title_len, const char *url_data, size_t url_len) override;
void WriteWebSmartPaste() override;
- void WriteBitmap(const SkBitmap& bitmap) override;
- void WriteData(const ui::ClipboardFormatType& format, const char* data_data, size_t data_len) override;
+ void WriteBitmap(const SkBitmap &bitmap) override;
+ void WriteData(const ui::ClipboardFormatType &format, const char *data_data, size_t data_len) override;
};
} // namespace QtWebEngineCore
diff --git a/src/core/compositor/compositor.cpp b/src/core/compositor/compositor.cpp
index cc45db9e7..56693961c 100644
--- a/src/core/compositor/compositor.cpp
+++ b/src/core/compositor/compositor.cpp
@@ -56,7 +56,7 @@ Compositor::Compositor(content::RenderWidgetHost *host)
{
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- m_taskRunner = base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::UI});
+ m_taskRunner = base::CreateSingleThreadTaskRunnerWithTraits({content::BrowserThread::UI, base::TaskPriority::USER_VISIBLE});
m_beginFrameSource =
std::make_unique<viz::DelayBasedBeginFrameSource>(
std::make_unique<viz::DelayBasedTimeSource>(m_taskRunner.get()),
diff --git a/src/core/compositor/compositor_resource_tracker.cpp b/src/core/compositor/compositor_resource_tracker.cpp
index 6530f3249..73242c693 100644
--- a/src/core/compositor/compositor_resource_tracker.cpp
+++ b/src/core/compositor/compositor_resource_tracker.cpp
@@ -213,6 +213,9 @@ void CompositorResourceTracker::scheduleUpdateMailboxes(std::vector<CompositorRe
#if QT_CONFIG(opengl)
scoped_refptr<base::SingleThreadTaskRunner> gpuTaskRunner = gpu_task_runner();
DCHECK(gpuTaskRunner);
+ thread_local bool currentThreadIsGpu = gpuTaskRunner->BelongsToCurrentThread();
+ if (currentThreadIsGpu)
+ return updateMailboxes(std::move(resources));
gpuTaskRunner->PostTask(
FROM_HERE,
base::BindOnce(&CompositorResourceTracker::updateMailboxes,
@@ -243,8 +246,11 @@ void CompositorResourceTracker::updateMailboxes(std::vector<CompositorResource *
void CompositorResourceTracker::scheduleRunSubmitCallback()
{
+ thread_local bool currentThreadIsUi = content::BrowserThread::CurrentlyOn(content::BrowserThread::UI);
+ if (currentThreadIsUi)
+ return runSubmitCallback();
base::PostTaskWithTraits(
- FROM_HERE, { content::BrowserThread::UI },
+ FROM_HERE, { content::BrowserThread::UI, base::TaskPriority::USER_VISIBLE },
base::BindOnce(&CompositorResourceTracker::runSubmitCallback,
m_weakPtrFactory.GetWeakPtr()));
}
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
index 3eb436910..95b7a4bda 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -36,8 +36,7 @@ clang {
gn_args += \
is_clang=true \
clang_use_chrome_plugins=false \
- clang_base_path=\"$${clang_prefix}\" \
- use_lld=false
+ clang_base_path=\"$${clang_prefix}\"
linux-clang-libc++: gn_args += use_libcxx=true
} else {
diff --git a/src/core/config/windows.pri b/src/core/config/windows.pri
index 9eb15830d..429e4e45f 100644
--- a/src/core/config/windows.pri
+++ b/src/core/config/windows.pri
@@ -1,7 +1,6 @@
include(common.pri)
gn_args += \
- is_clang=false \
use_sysroot=false \
enable_session_service=false \
ninja_use_custom_environment_files=false \
@@ -9,6 +8,22 @@ gn_args += \
win_linker_timing=true \
com_init_check_hook_disabled=true
+use_lld_linker: gn_args += use_lld=true
+else: gn_args += use_lld=false
+
+clang_cl {
+ clang_full_path = $$system_path($$which($${QMAKE_CXX}))
+ # Remove the "\bin\clang-cl.exe" part:
+ clang_dir = $$dirname(clang_full_path)
+ clang_prefix = $$join(clang_dir,,,"\..")
+ gn_args += \
+ is_clang=true \
+ clang_use_chrome_plugins=false \
+ clang_base_path=$$system_quote($$system_path($$clean_path($$clang_prefix)))
+} else {
+ gn_args += is_clang=false
+}
+
isDeveloperBuild() {
gn_args += \
is_win_fastlink=true
@@ -56,6 +71,8 @@ msvc:contains(QT_ARCH, "i386"):!usingMSVC32BitCrossCompiler() {
msvc {
equals(MSVC_VER, 15.0) {
MSVS_VERSION = 2017
+ } else: equals(MSVC_VER, 16.0) {
+ MSVS_VERSION = 2019
} else {
error("Visual Studio compiler version \"$$MSVC_VER\" is not supported by Qt WebEngine")
}
@@ -69,7 +86,6 @@ msvc {
GN_TARGET_CPU = $$gnArch($$QT_ARCH)
gn_args += target_cpu=\"$$GN_TARGET_CPU\"
-
} else {
- error("Qt WebEngine for Windows can only be built with the Microsoft Visual Studio C++ compiler")
+ error("Qt WebEngine for Windows can only be built with a Microsoft Visual Studio C++ compatible compiler")
}
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index dc32bb8c1..57f8af63c 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -226,9 +226,7 @@ static void SafeOverridePathImpl(const char *keyName, int key, const base::FileP
bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code)
{
SafeOverridePath(base::FILE_EXE, WebEngineLibraryInfo::getPath(base::FILE_EXE));
-#if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE
SafeOverridePath(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA));
-#endif
SafeOverridePath(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES));
#if QT_CONFIG(webengine_spellchecker)
SafeOverridePath(base::DIR_APP_DICTIONARIES, WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES));
diff --git a/src/core/core_chromium.pri b/src/core/core_chromium.pri
index 89fb40864..4d8db0d1e 100644
--- a/src/core/core_chromium.pri
+++ b/src/core/core_chromium.pri
@@ -37,6 +37,11 @@ qtConfig(egl): CONFIG += egl
INCLUDEPATH += $$PWD $$PWD/api
+clang_cl {
+ QMAKE_CFLAGS -= $$QMAKE_CFLAGS_MSVC_COMPAT
+ QMAKE_CXXFLAGS -= $$QMAKE_CFLAGS_MSVC_COMPAT
+}
+
SOURCES = \
accessibility_activation_observer.cpp \
accessibility_tree_formatter_qt.cpp \
@@ -149,6 +154,7 @@ HEADERS = \
certificate_error_controller_p.h \
certificate_error_controller.h \
client_cert_select_controller.h \
+ clipboard_change_observer.h \
clipboard_qt.h \
command_line_pref_store_qt.h \
color_chooser_qt.h \
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index 3b5d37f29..e2fa3494d 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -55,7 +55,7 @@ LIBS_PRIVATE += -L$$api_library_path
CONFIG *= no_smart_library_merge
osx {
LIBS_PRIVATE += -Wl,-force_load,$${api_library_path}$${QMAKE_DIR_SEP}lib$${api_library_name}.a
-} else:msvc {
+} else: win32 {
!isDeveloperBuild() {
# Remove unused functions and data in debug non-developer builds, because the binaries will
# be smaller in the shipped packages.
@@ -74,7 +74,7 @@ osx {
LIBS_PRIVATE += -Wl,-whole-archive -l$$api_library_name -Wl,-no-whole-archive
}
-win32-msvc* {
+win32 {
POST_TARGETDEPS += $${api_library_path}$${QMAKE_DIR_SEP}$${api_library_name}.lib
} else {
POST_TARGETDEPS += $${api_library_path}$${QMAKE_DIR_SEP}lib$${api_library_name}.a
diff --git a/src/core/core_project.pro b/src/core/core_project.pro
index ecb4a3ab5..3205ac604 100644
--- a/src/core/core_project.pro
+++ b/src/core/core_project.pro
@@ -1,7 +1,10 @@
TEMPLATE = lib
# Fake project to make QtCreator happy.
-include(core_common.pri)
+include(core_chromium.pri)
+
+HEADERS =
+SOURCES =
linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri
diff --git a/src/core/doc/src/qtwebenginecore-index.qdoc b/src/core/doc/src/qtwebenginecore-index.qdoc
index 4d540e277..692e33d1d 100644
--- a/src/core/doc/src/qtwebenginecore-index.qdoc
+++ b/src/core/doc/src/qtwebenginecore-index.qdoc
@@ -29,9 +29,9 @@
\page qtwebenginecore-index.html
\title Qt WebEngine Core
- \brief Provides common API shared by Qt WebEngine and Qt WebEngine Widgets.
+ \brief Provides common API shared by \QWE and \QWE Widgets.
- Qt WebEngine Core provides API shared by \l {Qt WebEngine} and \l {Qt WebEngine Widgets}.
+ \QWE Core provides API shared by \l {Qt WebEngine} and \l {Qt WebEngine Widgets}.
\section1 Getting Started
@@ -61,7 +61,7 @@
This is a snapshot of the integration of Chromium into Qt.
Qt Commercial Edition licensees that wish to distribute applications that
- use the Qt WebEngine module need to be aware of their obligations under the
+ use the \QWE module need to be aware of their obligations under the
GNU Library General Public License (LGPLv2).
Developers using the Open Source Edition can choose to redistribute
diff --git a/src/core/doc/src/qtwebenginecore-module.qdoc b/src/core/doc/src/qtwebenginecore-module.qdoc
index 65e0766de..c976d024c 100644
--- a/src/core/doc/src/qtwebenginecore-module.qdoc
+++ b/src/core/doc/src/qtwebenginecore-module.qdoc
@@ -39,7 +39,7 @@
\snippet qtwebenginecore_build_snippet.qdoc 1
- If you use qmake to build your projects, Qt WebEngine Core is usually
+ If you use qmake to build your projects, \QWE Core is usually
indirectly included through the \l{Qt WebEngine QML Types}{Qt WebEngine} or
\l{Qt WebEngine Widgets C++ Classes}{Qt WebEngine Widgets} modules.
diff --git a/src/core/download_manager_delegate_qt.cpp b/src/core/download_manager_delegate_qt.cpp
index 724b33a7a..2af958068 100644
--- a/src/core/download_manager_delegate_qt.cpp
+++ b/src/core/download_manager_delegate_qt.cpp
@@ -175,8 +175,15 @@ bool DownloadManagerDelegateQt::DetermineDownloadTarget(download::DownloadItem*
int uniquifier = base::GetUniquePathNumber(tmpFilePath, base::FilePath::StringType());
if (uniquifier > 0)
suggestedFilePath = toQt(tmpFilePath.InsertBeforeExtensionASCII(base::StringPrintf(" (%d)", uniquifier)).AsUTF8Unsafe());
- else if (uniquifier == -1)
- suggestedFilePath = toQt(tmpFilePath.InsertBeforeExtensionASCII(base::StringPrintf(" - %s", base::TimeToISO8601(item->GetStartTime()).c_str())).AsUTF8Unsafe());
+ else if (uniquifier == -1) {
+ base::Time::Exploded exploded;
+ item->GetStartTime().LocalExplode(&exploded);
+ std::string suffix = base::StringPrintf(
+ " - %04d-%02d-%02dT%02d%02d%02d.%03d", exploded.year, exploded.month,
+ exploded.day_of_month, exploded.hour, exploded.minute,
+ exploded.second, exploded.millisecond);
+ suggestedFilePath = toQt(tmpFilePath.InsertBeforeExtensionASCII(suffix).AsUTF8Unsafe());
+ }
item->AddObserver(this);
QList<ProfileAdapterClient*> clients = m_profileAdapter->clients();
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 05aed8d2b..3e64afd20 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -63,24 +63,35 @@ FilePickerController::~FilePickerController() = default;
void FilePickerController::accepted(const QStringList &files)
{
- FilePickerController::filesSelectedInChooser(files);
+ QStringList stringList;
+
+ for (const QString &file : files) {
+ if (QDir(file).isAbsolute())
+ stringList.append(file);
+ else
+ qWarning("Ignore invalid item in FilePickerController::accepted(QStringList): %s", qPrintable(file));
+ }
+
+ FilePickerController::filesSelectedInChooser(stringList);
}
void FilePickerController::accepted(const QVariant &files)
{
QStringList stringList;
+ QList<QUrl> urlList = QUrl::fromStringList(files.toStringList());
- if (files.canConvert(QVariant::StringList)) {
- stringList = files.toStringList();
- } else if (files.canConvert<QList<QUrl> >()) {
- const QList<QUrl> urls = files.value<QList<QUrl>>();
- for (const QUrl &url : urls)
- stringList.append(url.toLocalFile());
+ if (urlList.isEmpty()) {
+ FilePickerController::accepted(stringList);
} else {
- qWarning("An unhandled type '%s' was provided in FilePickerController::accepted(QVariant)", files.typeName());
+ for (const QUrl &url : qAsConst(urlList)) {
+ if (url.isValid() && url.scheme() == "file" && !url.path().isEmpty())
+ stringList.append(url.path());
+ else
+ qWarning("Ignore invalid item in FilePickerController::accepted(QVariant): %s", qPrintable(url.toString()));
+ }
+
+ FilePickerController::accepted(stringList);
}
-
- FilePickerController::filesSelectedInChooser(stringList);
}
void FilePickerController::rejected()
diff --git a/src/core/printing/print_view_manager_qt.cpp b/src/core/printing/print_view_manager_qt.cpp
index 2bf11990a..b6a2b42ec 100644
--- a/src/core/printing/print_view_manager_qt.cpp
+++ b/src/core/printing/print_view_manager_qt.cpp
@@ -151,21 +151,12 @@ static base::DictionaryValue *createPrintSettingsFromQPageLayout(const QPageLayo
bool useCustomMargins)
{
base::DictionaryValue *printSettings = createPrintSettings();
-
- //Set page size attributes, chromium expects these in micrometers
- QRectF pageSizeInMillimeter = pageLayout.pageSize().rect(QPageSize::Millimeter);
- if (!useCustomMargins) {
- // QPrinter will extend this size with its margins
- QMarginsF margins = pageLayout.margins(QPageLayout::Millimeter);
- pageSizeInMillimeter = pageSizeInMillimeter.marginsRemoved(margins);
- }
- std::unique_ptr<base::DictionaryValue> sizeDict(new base::DictionaryValue);
- sizeDict->SetInteger(printing::kSettingMediaSizeWidthMicrons, pageSizeInMillimeter.width() * kMicronsToMillimeter);
- sizeDict->SetInteger(printing::kSettingMediaSizeHeightMicrons, pageSizeInMillimeter.height() * kMicronsToMillimeter);
- printSettings->Set(printing::kSettingMediaSize, std::move(sizeDict));
+ QRectF pageSizeInMillimeter;
if (useCustomMargins) {
// Apply page margins when printing to PDF
+ pageSizeInMillimeter = pageLayout.pageSize().rect(QPageSize::Millimeter);
+
QMargins pageMarginsInPoints = pageLayout.marginsPoints();
std::unique_ptr<base::DictionaryValue> marginsDict(new base::DictionaryValue);
marginsDict->SetInteger(printing::kSettingMarginTop, pageMarginsInPoints.top());
@@ -175,12 +166,23 @@ static base::DictionaryValue *createPrintSettingsFromQPageLayout(const QPageLayo
printSettings->Set(printing::kSettingMarginsCustom, std::move(marginsDict));
printSettings->SetInteger(printing::kSettingMarginsType, printing::CUSTOM_MARGINS);
+
+ // pageSizeInMillimeter is in portrait orientation. Transpose it if necessary.
+ printSettings->SetBoolean(printing::kSettingLandscape, pageLayout.orientation() == QPageLayout::Landscape);
} else {
// QPrinter will handle margins
+ pageSizeInMillimeter = pageLayout.paintRect(QPageLayout::Millimeter);
printSettings->SetInteger(printing::kSettingMarginsType, printing::NO_MARGINS);
+
+ // pageSizeInMillimeter already contains the orientation.
+ printSettings->SetBoolean(printing::kSettingLandscape, false);
}
- printSettings->SetBoolean(printing::kSettingLandscape, pageLayout.orientation() == QPageLayout::Landscape);
+ //Set page size attributes, chromium expects these in micrometers
+ std::unique_ptr<base::DictionaryValue> sizeDict(new base::DictionaryValue);
+ sizeDict->SetInteger(printing::kSettingMediaSizeWidthMicrons, pageSizeInMillimeter.width() * kMicronsToMillimeter);
+ sizeDict->SetInteger(printing::kSettingMediaSizeHeightMicrons, pageSizeInMillimeter.height() * kMicronsToMillimeter);
+ printSettings->Set(printing::kSettingMediaSize, std::move(sizeDict));
return printSettings;
}
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index 5d317b7f0..96248a55a 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -49,6 +49,7 @@
#include "content/public/common/content_features.h"
#include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
#include "chrome/browser/net/chrome_mojo_proxy_resolver_factory.h"
+#include "chrome/common/chrome_switches.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "net/cert/cert_verifier.h"
#include "net/cert/ct_log_verifier.h"
@@ -100,13 +101,6 @@
namespace QtWebEngineCore {
-static const char* const kDefaultAuthSchemes[] = { net::kBasicAuthScheme,
- net::kDigestAuthScheme,
-#if QT_CONFIG(webengine_kerberos)
- net::kNegotiateAuthScheme,
-#endif
- net::kNtlmAuthScheme };
-
static bool doNetworkSessionParamsMatch(const net::HttpNetworkSession::Params &first,
const net::HttpNetworkSession::Params &second)
{
@@ -345,8 +339,14 @@ void ProfileIODataQt::generateStorage()
m_storage->set_ct_policy_enforcer(base::WrapUnique(new net::DefaultCTPolicyEnforcer()));
m_storage->set_host_resolver(net::HostResolver::CreateDefaultResolver(NULL));
m_storage->set_ssl_config_service(std::make_unique<net::SSLConfigServiceDefaults>());
+ if (!m_httpAuthPreferences) {
+ m_httpAuthPreferences.reset(new net::HttpAuthPreferences());
+ std::string serverWhitelist = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(switches::kAuthServerWhitelist);
+ m_httpAuthPreferences->SetServerWhitelist(serverWhitelist);
+ }
m_storage->set_http_auth_handler_factory(net::HttpAuthHandlerFactory::CreateDefault(
- m_urlRequestContext->host_resolver()));
+ m_urlRequestContext->host_resolver(),
+ m_httpAuthPreferences.get()));
m_storage->set_transport_security_state(std::make_unique<net::TransportSecurityState>());
if (!m_dataPath.isEmpty()) {
diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp
index 14a39de49..5977a28a8 100644
--- a/src/core/profile_qt.cpp
+++ b/src/core/profile_qt.cpp
@@ -246,7 +246,9 @@ content::BackgroundSyncController* ProfileQt::GetBackgroundSyncController()
content::BrowsingDataRemoverDelegate *ProfileQt::GetBrowsingDataRemoverDelegate()
{
- return new BrowsingDataRemoverDelegateQt();
+ if (!m_removerDelegate)
+ m_removerDelegate.reset(new BrowsingDataRemoverDelegateQt);
+ return m_removerDelegate.get();
}
content::PermissionControllerDelegate *ProfileQt::GetPermissionControllerDelegate()
diff --git a/src/core/profile_qt.h b/src/core/profile_qt.h
index 5a602f56a..704c5a6e4 100644
--- a/src/core/profile_qt.h
+++ b/src/core/profile_qt.h
@@ -60,6 +60,7 @@ class ExtensionSystemQt;
namespace QtWebEngineCore {
+class BrowsingDataRemoverDelegateQt;
class ProfileAdapter;
class PermissionManagerQt;
class SSLHostStateDelegateQt;
@@ -130,6 +131,7 @@ private:
friend class ContentBrowserClientQt;
friend class WebContentsAdapter;
scoped_refptr<net::URLRequestContextGetter> m_urlRequestContextGetter;
+ std::unique_ptr<BrowsingDataRemoverDelegateQt> m_removerDelegate;
std::unique_ptr<PermissionManagerQt> m_permissionManager;
std::unique_ptr<SSLHostStateDelegateQt> m_sslHostStateDelegate;
std::unique_ptr<PrefService> m_prefService;
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 414fc6582..994e3a3d6 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -666,9 +666,9 @@ void RenderWidgetHostViewQt::DidCreateNewRendererCompositorFrameSink(viz::mojom:
void RenderWidgetHostViewQt::SubmitCompositorFrame(const viz::LocalSurfaceId &local_surface_id, viz::CompositorFrame frame, base::Optional<viz::HitTestRegionList>)
{
bool scrollOffsetChanged = (m_lastScrollOffset != frame.metadata.root_scroll_offset);
- bool contentsSizeChanged = (m_lastContentsSize != frame.metadata.scrollable_viewport_size);
+ bool contentsSizeChanged = (m_lastContentsSize != frame.metadata.root_layer_size);
m_lastScrollOffset = frame.metadata.root_scroll_offset;
- m_lastContentsSize = frame.metadata.scrollable_viewport_size;
+ m_lastContentsSize = frame.metadata.root_layer_size;
// Force to process swap messages
uint32_t frame_token = frame.metadata.frame_token;
@@ -934,9 +934,9 @@ void RenderWidgetHostViewQt::visualPropertiesChanged()
m_viewRectInDips = toGfx(m_delegate->viewGeometry().toAlignedRect());
gfx::Rect oldWindowRect = m_windowRectInDips;
- QWindow *window = m_delegate->window();
- m_windowRectInDips = window ? toGfx(window->frameGeometry()) : gfx::Rect();
+ m_windowRectInDips = toGfx(m_delegate->windowGeometry());
+ QWindow *window = m_delegate->window();
content::ScreenInfo oldScreenInfo = m_screenInfo;
m_screenInfo = screenInfoFromQScreen(window ? window->screen() : nullptr);
diff --git a/src/core/render_widget_host_view_qt_delegate.h b/src/core/render_widget_host_view_qt_delegate.h
index cbf92a8d4..6066284d9 100644
--- a/src/core/render_widget_host_view_qt_delegate.h
+++ b/src/core/render_widget_host_view_qt_delegate.h
@@ -91,6 +91,7 @@ public:
virtual ~RenderWidgetHostViewQtDelegate() { }
virtual void initAsPopup(const QRect&) = 0;
virtual QRectF viewGeometry() const = 0;
+ virtual QRect windowGeometry() const = 0;
virtual void setKeyboardFocus() = 0;
virtual bool hasKeyboardFocus() = 0;
virtual void lockMouse() = 0;
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index fa1e20f24..f69a8b64f 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -152,7 +152,14 @@ void ContentRendererClientQt::RenderThreadStarted()
blink::WebString file(blink::WebString::FromASCII("file"));
blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(qrc, file, blink::WebString(), true,
network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
+
#if BUILDFLAG(ENABLE_EXTENSIONS)
+ // Allow the pdf viewer extension to access chrome resources
+ blink::WebURL pdfViewerExtension(blink::KURL("chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai"));
+ blink::WebString chromeResources(blink::WebString::FromASCII("chrome"));
+ blink::WebSecurityPolicy::AddOriginAccessAllowListEntry(pdfViewerExtension, chromeResources, blink::WebString(), true,
+ network::mojom::CorsOriginAccessMatchPriority::kDefaultPriority);
+
ExtensionsRendererClientQt::GetInstance()->RenderThreadStarted();
#endif
}
diff --git a/src/core/renderer/user_resource_controller.cpp b/src/core/renderer/user_resource_controller.cpp
index 46f5de2c2..be5e6f043 100644
--- a/src/core/renderer/user_resource_controller.cpp
+++ b/src/core/renderer/user_resource_controller.cpp
@@ -138,7 +138,6 @@ public:
private:
// RenderFrameObserver implementation.
void DidCommitProvisionalLoad(bool is_same_document_navigation, ui::PageTransition transition) override;
- void DidClearWindowObject() override;
void DidFinishDocumentLoad() override;
void DidFinishLoad() override;
void FrameDetached() override;
@@ -241,14 +240,10 @@ void UserResourceController::RenderFrameObserverHelper::DidCommitProvisionalLoad
// that the WebChannelTransportHost is ready to receive messages.
m_runner.reset(new Runner(render_frame()->GetWebFrame()));
-}
-void UserResourceController::RenderFrameObserverHelper::DidClearWindowObject()
-{
- // This is called both before and after DidCommitProvisionalLoad, non-null
- // m_runner means it's after.
- if (m_runner)
- m_runner->run(UserScriptData::DocumentElementCreation);
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
+ base::BindOnce(&Runner::run, m_runner->AsWeakPtr(), UserScriptData::DocumentElementCreation));
}
void UserResourceController::RenderFrameObserverHelper::DidFinishDocumentLoad()
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 7c6b6669d..33cc723f5 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -196,9 +196,9 @@ void WebEngineContext::destroyProfileAdapter()
{
if (content::RenderProcessHost::run_renderer_in_process()) {
Q_ASSERT(m_profileAdapters.count() == 1);
- // this might be default profile
- m_defaultProfileAdapter.release();
- delete m_profileAdapters.first();
+ // this is a default profile
+ m_defaultProfileAdapter.reset();
+ Q_ASSERT(m_profileAdapters.isEmpty());
}
}
@@ -216,9 +216,11 @@ void WebEngineContext::addProfileAdapter(ProfileAdapter *profileAdapter)
}
}
- if (content::RenderProcessHost::run_renderer_in_process() &&
- !m_profileAdapters.isEmpty()) {
- qFatal("Single mode supports only single profile.");
+ if (content::RenderProcessHost::run_renderer_in_process()){
+ if (!m_profileAdapters.isEmpty())
+ qFatal("Single mode supports only single profile.");
+ // there is only one profle therefore make it 'default'
+ m_defaultProfileAdapter.reset(profileAdapter);
}
m_profileAdapters.append(profileAdapter);
}
@@ -307,8 +309,13 @@ WebEngineContext *WebEngineContext::current()
ProfileAdapter *WebEngineContext::createDefaultProfileAdapter()
{
Q_ASSERT(!m_destroyed);
- if (!m_defaultProfileAdapter)
- m_defaultProfileAdapter.reset(new ProfileAdapter(QStringLiteral("Default")));
+ if (!m_defaultProfileAdapter) {
+ ProfileAdapter *profile = new ProfileAdapter(QStringLiteral("Default"));
+ // profile when added to m_profileAdapters might be set default
+ // profile in case of single-process
+ if (!m_defaultProfileAdapter)
+ m_defaultProfileAdapter.reset(profile);
+ }
return m_defaultProfileAdapter.get();
}
diff --git a/src/core/web_engine_context_threads.cpp b/src/core/web_engine_context_threads.cpp
index 75f8bd470..e92cf3e9b 100644
--- a/src/core/web_engine_context_threads.cpp
+++ b/src/core/web_engine_context_threads.cpp
@@ -82,7 +82,7 @@ struct GpuThreadControllerQt : content::GpuThreadController
if (s_gpuProcessDestroyed)
return;
- s_gpuProcess = std::make_unique<content::GpuProcess>(base::ThreadPriority::NORMAL);
+ s_gpuProcess = std::make_unique<content::GpuProcess>(base::ThreadPriority::DISPLAY);
auto gpuInit = std::make_unique<gpu::GpuInit>();
gpuInit->InitializeInProcess(base::CommandLine::ForCurrentProcess(), gpuPreferences);
auto childThread = new content::GpuChildThread(params, std::move(gpuInit));
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index 12ffd91e6..1c8316430 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -257,34 +257,6 @@ QString dictionariesPath()
}
#endif // QT_CONFIG(webengine_spellchecker)
-QString icuDataPath()
-{
- static bool initialized = false;
- static QString potentialResourcesPath =
-#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD)
- getResourcesPath(frameworkBundle());
-#else
- QLibraryInfo::location(QLibraryInfo::DataPath) % QLatin1String("/resources");
-#endif
- if (!initialized) {
- initialized = true;
- if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) {
- qWarning("Qt WebEngine ICU data not found at %s. Trying parent directory...", qPrintable(potentialResourcesPath));
- potentialResourcesPath = QLibraryInfo::location(QLibraryInfo::DataPath);
- }
- if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) {
- qWarning("Qt WebEngine ICU data not found at %s. Trying application directory...", qPrintable(potentialResourcesPath));
- potentialResourcesPath = QCoreApplication::applicationDirPath();
- }
- if (!QFileInfo::exists(potentialResourcesPath % QLatin1String("/icudtl.dat"))) {
- qWarning("Qt WebEngine ICU data not found at %s. Trying fallback directory... The application MAY NOT work.", qPrintable(potentialResourcesPath));
- potentialResourcesPath = fallbackDir();
- }
- }
-
- return potentialResourcesPath;
-}
-
QString resourcesDataPath()
{
static bool initialized = false;
@@ -341,7 +313,7 @@ base::FilePath WebEngineLibraryInfo::getPath(int key)
directory = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
break;
case base::DIR_QT_LIBRARY_DATA:
- return toFilePath(icuDataPath());
+ return toFilePath(resourcesDataPath());
case ui::DIR_LOCALES:
return toFilePath(localesPath());
#if QT_CONFIG(webengine_spellchecker)
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
index 8aff4e625..cbd0e994a 100644
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ b/src/webengine/api/qquickwebenginedownloaditem.cpp
@@ -136,7 +136,7 @@ QQuickWebEngineDownloadItemPrivate::~QQuickWebEngineDownloadItemPrivate()
\l{WebEngineProfile::downloadRequested}{downloadRequested} signal together
with a newly created WebEngineDownloadItem. The application can then examine
this item and decide whether to accept it or not. A signal handler must
- explicitly call accept() on the item for Qt WebEngine to actually start
+ explicitly call accept() on the item for \QWE to actually start
downloading and writing data to disk. If no signal handler calls accept(),
then the download request will be automatically rejected and nothing will be
written to disk.
@@ -155,7 +155,7 @@ QQuickWebEngineDownloadItemPrivate::~QQuickWebEngineDownloadItemPrivate()
\section2 Web Page Downloads
In addition to normal file downloads, which consist simply of retrieving
- some raw bytes from the network and writing them to disk, Qt WebEngine also
+ some raw bytes from the network and writing them to disk, \QWE also
supports saving complete web pages, which involves parsing the page's HTML,
downloading any dependent resources, and potentially packaging everything
into a special file format (\l savePageFormat). To check if a download is
diff --git a/src/webengine/api/qquickwebengineloadrequest.cpp b/src/webengine/api/qquickwebengineloadrequest.cpp
index b3422c516..5ad99ea2e 100644
--- a/src/webengine/api/qquickwebengineloadrequest.cpp
+++ b/src/webengine/api/qquickwebengineloadrequest.cpp
@@ -127,7 +127,7 @@ QString QQuickWebEngineLoadRequest::errorString() const
\value WebEngineView.NoErrorDomain
Error type is not known.
\value WebEngineView.InternalErrorDomain
- Content cannot be interpreted by Qt WebEngine.
+ Content cannot be interpreted by \QWE.
\value WebEngineView.ConnectionErrorDomain
Error results from a faulty network connection.
\value WebEngineView.CertificateErrorDomain
diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp
index d181f44aa..a11618dba 100644
--- a/src/webengine/api/qtwebengineglobal.cpp
+++ b/src/webengine/api/qtwebengineglobal.cpp
@@ -54,9 +54,9 @@ namespace QtWebEngine {
\ingroup qtwebengine-namespaces
\keyword QtWebEngine Namespace
- \brief Helper functions for the Qt WebEngine (Qt Quick) module.
+ \brief Helper functions for the \QWE (Qt Quick) module.
- The \l[CPP]{QtWebEngine} namespace is part of the Qt WebEngine module.
+ The \l[CPP]{QtWebEngine} namespace is part of the \QWE module.
*/
/*!
diff --git a/src/webengine/doc/qtwebengine.qdocconf b/src/webengine/doc/qtwebengine.qdocconf
index b1e3a2ded..50f2e2ceb 100644
--- a/src/webengine/doc/qtwebengine.qdocconf
+++ b/src/webengine/doc/qtwebengine.qdocconf
@@ -81,4 +81,7 @@ navigation.landingpage = "Qt WebEngine"
navigation.cppclassespage = "Qt WebEngine C++ Classes and Namespaces"
navigation.qmltypespage = "Qt WebEngine QML Types"
+# \QWE macro expands to 'Qt WebEngine' without auto-linking anywhere.
+macro.QWE = "Qt \\WebEngine"
+
Cpp.ignoretokens += Q_WEBENGINE_EXPORT QWEBENGINEWIDGETS_EXPORT
diff --git a/src/webengine/doc/src/external-resources.qdoc b/src/webengine/doc/src/external-resources.qdoc
index e4fe9bba6..55f6a68a3 100644
--- a/src/webengine/doc/src/external-resources.qdoc
+++ b/src/webengine/doc/src/external-resources.qdoc
@@ -95,18 +95,6 @@
\title Hunspell Project
*/
-/*
- This prevents autolinking of each occurrence of 'WebEngine'
- To link to the WebEngine QML type, use explicit linking:
- \l [QML] WebEngine
- \sa {QtWebEngine::}{WebEngine}
-*/
-/*!
- \externalpage nolink
- \title WebEngine
- \internal
-*/
-
/*!
\externalpage https://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
\title RFC 2616 section 19.5.1
diff --git a/src/webengine/doc/src/qtwebengine-debugging.qdoc b/src/webengine/doc/src/qtwebengine-debugging.qdoc
index b8b004095..088db5f87 100644
--- a/src/webengine/doc/src/qtwebengine-debugging.qdoc
+++ b/src/webengine/doc/src/qtwebengine-debugging.qdoc
@@ -31,7 +31,7 @@
\section1 Console Logging
- JavaScript executed inside Qt WebEngine can use the
+ JavaScript executed inside \QWE can use the
\l{Chrome console API} to log information to a console. The logging messages
are forwarded to Qt's logging facilities inside a \c js
\l{QLoggingCategory}{logging category}. However, only warning and fatal
@@ -40,19 +40,19 @@
by reimplementing \l{QWebEnginePage::javaScriptConsoleMessage()}, or
connecting to \l{WebEngineView::javaScriptConsoleMessage()}.
- All messages can also be accessed through the Qt WebEngine developer
+ All messages can also be accessed through the \QWE developer
tools.
\section1 Qt WebEngine Developer Tools
- The Qt WebEngine module provides web developer tools that make it easy
+ The \QWE module provides web developer tools that make it easy
to inspect and debug layout and performance issues of any web content.
The developer tools are accessed as a local web page using a Chromium or
- Qt WebEngine based browser, such as the Chrome browser.
+ \QWE based browser, such as the Chrome browser.
- To activate the developer tools, start an application that uses Qt
- WebEngine with the command-line arguments:
+ To activate the developer tools, start an application that uses \QWE
+ with the command-line arguments:
\badcode
--remote-debugging-port=<port_number>
diff --git a/src/webengine/doc/src/qtwebengine-deploying.qdoc b/src/webengine/doc/src/qtwebengine-deploying.qdoc
index c9f0f3580..7b9f3fd4a 100644
--- a/src/webengine/doc/src/qtwebengine-deploying.qdoc
+++ b/src/webengine/doc/src/qtwebengine-deploying.qdoc
@@ -34,7 +34,7 @@
\l{Deploying Applications on macOS}{macdeployqt} automate the steps to
generate a stand-alone application package.
- When manually deploying applications that depend on Qt WebEngine, all the
+ When manually deploying applications that depend on \QWE, all the
files that are required to run the application have to be included:
libraries, QML imports, plugins, and translations.
@@ -42,27 +42,27 @@
\section1 Target Platforms
- Qt WebEngine does try to support all \l{Supported Platforms} of Qt. However,
+ \QWE does try to support all \l{Supported Platforms} of Qt. However,
due to different requirements of Chromium this is not always possible. Known
limitations are:
\list
- \li Qt WebEngine currently supports only Windows, Linux, and \macos.
+ \li \QWE currently supports only Windows, Linux, and \macos.
- \li On Windows, Qt WebEngine only supports Windows Vista or newer as
+ \li On Windows, \QWE only supports Windows Vista or newer as
target platform. Due to use of newer API in Chromium, Windows XP is
not supported. WinRT is not supported, either.
\endlist
\section1 Deploying Applications Manually
- When manually deploying applications that depend on Qt WebEngine, the
+ When manually deploying applications that depend on \QWE, the
following files might have to be deployed:
\list
\li Libraries
\li QML imports
- \li Qt WebEngine process
+ \li \QWE process
\li Resources
\li Translations
\li Audio and video codecs
@@ -71,7 +71,7 @@
\section2 Deploying Libraries
The following libraries must be deployed with applications that depend on
- Qt WebEngine:
+ \QWE:
\list
\li QtWebEngineCore library
@@ -84,10 +84,10 @@
If Qt Quick integration is used in the application, the QtWebEngine import
directory needs to be deployed.
- \section2 Deploying Qt WebEngine Processes
+ \section2 Deploying \QWE Processes
- Qt WebEngine takes advantage of the multi-process model that the Chromium
- project offers. The multi-process model requires that the Qt WebEngine
+ \QWE takes advantage of the multi-process model that the Chromium
+ project offers. The multi-process model requires that the \QWE
Process executable be deployed alongside your application.
The WebEngine process is executed for each QWebEngineView or WebEngineView
@@ -96,18 +96,18 @@
running. This is a common approach used by most modern web engines to
provide a stable browsing experience.
- At runtime, Qt WebEngine looks for the \c QtWebEngineProcess executable in
+ At runtime, \QWE looks for the \c QtWebEngineProcess executable in
the directory that
QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath) returns.
For Qt installations, this is \c QTDIR/libexec (Linux) or \c QTDIR\bin
(Windows). The path can be changed by defining a \c qt.conf file, for
example. Alternatively, an executable path can be set as a value of the
- \c QTWEBENGINEPROCESS_PATH environment variable. On \macos, Qt WebEngine
+ \c QTWEBENGINEPROCESS_PATH environment variable. On \macos, \QWE
looks for the executable in \c .app/Helpers/QtWebEngineProcess.
\section2 Deploying Resources
- Qt WebEngine requires the following resource files:
+ \QWE requires the following resource files:
\list
\li \c qtwebengine_resources.pak contains the resources needed by
@@ -120,7 +120,7 @@
DPI displays.
\li \c icudtl.dat provides support for International Components for
Unicode (ICU). It is the Chromium version of ICU, which is not
- needed if Qt WebEngine was configured to use the system ICU.
+ needed if \QWE was configured to use the system ICU.
\endlist
Resources are searched from the following locations:
diff --git a/src/webengine/doc/src/qtwebengine-examples.qdoc b/src/webengine/doc/src/qtwebengine-examples.qdoc
index 24604e3dd..d31895078 100644
--- a/src/webengine/doc/src/qtwebengine-examples.qdoc
+++ b/src/webengine/doc/src/qtwebengine-examples.qdoc
@@ -28,7 +28,7 @@
/*!
\group webengine-examples
\title Qt WebEngine Examples
- \brief Examples demonstrating the Qt WebEngine usage.
+ \brief Examples demonstrating the \QWE usage.
\ingroup all-examples
These examples and demonstrations show a range of different uses for \l{Qt WebEngine},
diff --git a/src/webengine/doc/src/qtwebengine-features.qdoc b/src/webengine/doc/src/qtwebengine-features.qdoc
index f53c118a8..5c6bdda5d 100644
--- a/src/webengine/doc/src/qtwebengine-features.qdoc
+++ b/src/webengine/doc/src/qtwebengine-features.qdoc
@@ -29,9 +29,9 @@
\page qtwebengine-features.html
\title Qt WebEngine Features
- \brief Summarizes Qt WebEngine features.
+ \brief Summarizes \QWE features.
- Qt WebEngine supports the following features:
+ \QWE supports the following features:
\list
\li \l{Audio and Video Codecs}
@@ -55,7 +55,7 @@
\section1 Audio and Video Codecs
- Qt WebEngine supports the MPEG-4 Part 14 (MP4) file format only if the
+ \QWE supports the MPEG-4 Part 14 (MP4) file format only if the
required proprietary audio and video codecs, such as H.264 and MPEG layer-3
(MP3), have been enabled. Proprietary codecs can be enabled by passing the
following option to the \c configure tool when configuring Qt:
@@ -73,8 +73,8 @@
For more information, see \l{Qt Configure Options}.
- When using qmake to build just the Qt WebEngine module, the following
- command can be used (in this example, the Qt WebEngine source code is
+ When using qmake to build just the \QWE module, the following
+ command can be used (in this example, the \QWE source code is
located in \c {C:\qt\qtwebengine}):
\code
@@ -95,7 +95,7 @@
The Chromium DevTools provide the ability to inspect and debug layout and
performance issues of any web content.
- This feature can be tested by launching a Qt WebEngine application with the
+ This feature can be tested by launching a \QWE application with the
command line option \c {--remote-debugging-port=[your-port]} or by setting
the environment variable \c QTWEBENGINE_REMOTE_DEBUGGING, and then using a
Chromium based browser (such as \l{WebEngine Widgets Simple Browser Example}
@@ -116,12 +116,12 @@
\section1 Client Certificates
Some web servers, in particular many intranet sites, require the client to
- authenticate itself with a certificate, called a \e {client certificate}. Qt WebEngine
+ authenticate itself with a certificate, called a \e {client certificate}. \QWE
will read the client certificates installed in the system settings in macOS and
Windows, and on Linux those installed into the NSS database. Certificates can
be installed into the NSS database using the \c pk12util tool.
- By default, QtWebEngine will not offer any client certificates to servers, as doing
+ By default, \QWE will not offer any client certificates to servers, as doing
so uniquely identifies the user and might violate privacy expectations.
To activate support for client certificates, an application needs to listen to
@@ -132,7 +132,7 @@
\section1 Custom Schemes
- Qt WebEngine makes it possible for the application to define its own custom
+ \QWE makes it possible for the application to define its own custom
URL schemes with specialized security policies and transport mechanisms.
Custom schemes can be used to implement alternative network protocols with
@@ -145,7 +145,7 @@
\section1 Drag and Drop
- Qt WebEngine supports HTML5 drag and drop.
+ \QWE supports HTML5 drag and drop.
This feature can be tested by opening an HTML5 drag and drop demo, such as
\l{HTML5 Demos - Drag and Drop}, \l{HTML5 Demos - Simple Drag and Drop}, or
@@ -160,7 +160,7 @@
\section1 Fullscreen
- Qt WebEngine supports viewing web content in fullscreen mode. For more
+ \QWE supports viewing web content in fullscreen mode. For more
information, see \l{WebEngineSettings::fullscreenSupportEnabled}
{WebEngineSettings.fullscreenSupportEnabled},
\l{WebEngineView::fullScreenRequested}{WebEngineView.fullScreenRequested},
@@ -176,7 +176,7 @@
\section1 HTML5 DRM
- Qt WebEngine supports viewing DRM protected videos if the \l{Widevine DRM}
+ \QWE supports viewing DRM protected videos if the \l{Widevine DRM}
plugin has been installed.
The video format most commonly used by DRM services, H.264, requires
@@ -191,12 +191,12 @@
\section1 HTML5 Geolocation
- Qt WebEngine supports JavaScript Geolocation API with \l {Qt Location} as a
+ \QWE supports JavaScript Geolocation API with \l {Qt Location} as a
backend. The application has to explicitly allow the feature by using
QWebEnginePage::Geolocation or \l{WebEngineView::Feature}
{WebEngineView.Feature}.
- If Qt Location has been built before Qt WebEngine then this feature can be
+ If Qt Location has been built before \QWE then this feature can be
tested by using \l{WebEngine Widgets Maps Example}{Maps} and allowing it to
find the current position of the user. Note that on Windows an external GPS
receiver must be connected to the application. For more information, see
@@ -206,7 +206,7 @@
\section1 HTTP/2 Protocol
- Qt WebEngine supports the Chromium implementation of the \l{HTTP/2}
+ \QWE supports the Chromium implementation of the \l{HTTP/2}
protocol.
This feature can be tested by opening an HTTP/2 demo, such as the
@@ -225,7 +225,7 @@
\li Displaying form validation messages
\endlist
- Qt WebEngine provides standard dialogs for these functions. In widget-based
+ \QWE provides standard dialogs for these functions. In widget-based
applications, the standard dialogs are based on QDialog, whereas in Qt Quick
applications, they can be based either on Qt Quick Controls 1 or Qt Quick
Controls 2 (since Qt 5.8). The latter are used only on \c eglfs platforms.
@@ -234,7 +234,7 @@
Controls 2, set the \c QTWEBENGINE_DIALOG_SET environment variable to either
\c{QtQuickControls1} or \c{QtQuickControls2}.
- Qt WebEngine Widgets dialogs can be customized by reimplementing the
+ \QWE Widgets dialogs can be customized by reimplementing the
QWebEnginePage::chooseFiles(), QWebEnginePage::javaScriptAlert(),
QWebEnginePage::javaScriptConfirm(), and QWebEnginePage::javaScriptPrompt()
functions.
@@ -249,7 +249,7 @@
\section1 Pepper Plugin API
- Qt WebEngine supports loading Pepper Plugin API (PPAPI) plugins if
+ \QWE supports loading Pepper Plugin API (PPAPI) plugins if
WebEngineSettings::pluginsEnabled or QWebEngineSettings::PluginsEnabled
is set.
@@ -321,7 +321,7 @@
\section1 Print to PDF
- Qt WebEngine supports printing a web page to a PDF file. For more
+ \QWE supports printing a web page to a PDF file. For more
information, see QWebEnginePage::printToPdf() and
\l{WebEngineView::printToPdf}{WebEngineView.printToPdf}.
@@ -332,7 +332,7 @@
\section1 Process Models
- Qt WebEngine uses multiple OS processes to isolate web sites from each other
+ \QWE uses multiple OS processes to isolate web sites from each other
and from the client application, improving security and robustness. The
following process models, or ways to divide web sites between OS processes,
are supported:
@@ -355,7 +355,7 @@
and \c{https://de.wikipedia.org/} would belong to the same site.
A site instance is a collection of web pages belonging to the same site.
- When the application explicitly loads a URL into Qt WebEngine (via \l
+ When the application explicitly loads a URL into \QWE (via \l
QWebEnginePage::setUrl, for example), a new site instance is created for the
page. However, when the user clicks same-site links on the page, the
existing site instance is merely extended with more pages.
@@ -388,7 +388,7 @@
\section1 Spellchecker
- Qt WebEngine supports integrating spellchecking support into HTML forms to
+ \QWE supports integrating spellchecking support into HTML forms to
enable users to submit spellchecked messages. When the user clicks on
an underlined misspelled word, the default context menu displays up to four
suggestions. Selecting one will replace the misspelled word.
@@ -408,7 +408,7 @@
These two files can be converted into the \c bdic format by using the
\c qwebengine_convert_dict tool that is shipped together with Qt.
- When the Qt WebEngine spellchecker initializes, it will try to load the
+ When the \QWE spellchecker initializes, it will try to load the
\c bdict dictionaries and to check them for consistency.
If \c QTWEBENGINE_DICTIONARIES_PATH is set, the spellchecker uses the
@@ -417,7 +417,7 @@
executable if it exists. If it does not exist, it will look in \c
QT_INSTALL_PREFIX/qtwebengine_dictionaries.
- On macOS, depending on how Qt WebEngine is configured at build time, there
+ On macOS, depending on how \QWE is configured at build time, there
are two possibilities how spellchecking data is found:
\list
@@ -427,7 +427,7 @@
means the results will depend on the installed OS dictionaries)
\endlist
- Thus, in the macOS Hunspell case, Qt WebEngine will look in the \e
+ Thus, in the macOS Hunspell case, \QWE will look in the \e
qtwebengine_dictionaries subdirectory located inside the application bundle
\c Resources directory, and also in the \c Resources directory located
inside the Qt framework bundle.
@@ -461,7 +461,7 @@
\section1 Touch
- Qt WebEngine supports touch devices for navigating and interacting with web pages.
+ \QWE supports touch devices for navigating and interacting with web pages.
Applications can prohibit the use of touch events in the following ways:
@@ -477,7 +477,7 @@
\section1 View Source
- Qt WebEngine supports viewing the HTML source of a web page.
+ \QWE supports viewing the HTML source of a web page.
This feature can be used from custom menus or assigned to custom events.
For more information, see WebEngineView::WebAction, and QWebEnginePage::WebAction.
diff --git a/src/webengine/doc/src/qtwebengine-index.qdoc b/src/webengine/doc/src/qtwebengine-index.qdoc
index bd6cc9a32..f668cf87b 100644
--- a/src/webengine/doc/src/qtwebengine-index.qdoc
+++ b/src/webengine/doc/src/qtwebengine-index.qdoc
@@ -31,9 +31,9 @@
\brief Provides functionality for rendering regions of dynamic web content.
- \e {Qt WebEngine} provides functionality for rendering regions of dynamic web content.
+ \QWE provides functionality for rendering regions of dynamic web content.
- The functionality in Qt WebEngine is divided into the following modules:
+ The functionality in \QWE is divided into the following modules:
\annotatedlist qtwebengine-modules
diff --git a/src/webengine/doc/src/qtwebengine-module.qdoc b/src/webengine/doc/src/qtwebengine-module.qdoc
index 2d4d1b8da..5554bd519 100644
--- a/src/webengine/doc/src/qtwebengine-module.qdoc
+++ b/src/webengine/doc/src/qtwebengine-module.qdoc
@@ -31,7 +31,7 @@
\brief Exposes C++ functionality to Qt Quick.
\ingroup modules
- The Qt WebEngine module exposes C++ functionality to Qt Quick.
+ The \QWE module exposes C++ functionality to Qt Quick.
To include the definitions of the module's classes, use the
following directive:
diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc
index 58c0708cc..6aa1af89e 100644
--- a/src/webengine/doc/src/qtwebengine-overview.qdoc
+++ b/src/webengine/doc/src/qtwebengine-overview.qdoc
@@ -29,10 +29,10 @@
\page qtwebengine-overview.html
\title Qt WebEngine Overview
- The Qt WebEngine module provides a web browser engine that makes it easy to embed content from
+ The \QWE module provides a web browser engine that makes it easy to embed content from
the World Wide Web into your Qt application on platforms that do not have a native web engine.
- Qt WebEngine provides C++ classes and QML types for rendering HTML, XHTML, and SVG documents,
+ \QWE provides C++ classes and QML types for rendering HTML, XHTML, and SVG documents,
styled using Cascading Style Sheets (CSS) and scripted with JavaScript. HTML documents can be
made fully editable by the user through the use of the \c{contenteditable} attribute on HTML
elements.
@@ -41,7 +41,7 @@
\image qtwebengine-architecture.png
- The functionality in Qt WebEngine is divided into the following modules:
+ The functionality in \QWE is divided into the following modules:
\list
\li \l{Qt WebEngine Widgets Module} for creating widget-based web applications
@@ -49,7 +49,7 @@
\li \l{Qt WebEngine Core Module} for interacting with Chromium
\endlist
- Page rendering and JavaScript execution are separated from the GUI process into the Qt WebEngine
+ Page rendering and JavaScript execution are separated from the GUI process into the \QWE
Process. It is a library that must be shipped with the application if the Qt libraries are
bundled into the application.
@@ -57,7 +57,7 @@
\image qtwebenginewidgets-model.png
- A \e {web engine view} is the main widget component of the Qt WebEngine module. It can be used
+ A \e {web engine view} is the main widget component of the \QWE module. It can be used
in various applications to load web content. Within a view, a \e {web engine page} holds a main
frame that is responsible for web content, the \e history of navigated links, and \e actions.
The view and page are quite similar, as they provide a set of common functions.
@@ -66,7 +66,7 @@
\e cookies. Profiles can be used to isolate pages from each other. A typical use case is a
dedicated profile for a \e {private browsing} mode, where no information is permanently saved.
- \note The Qt WebEngine Widgets module uses the \l{Qt Quick Scene Graph}{Qt Quick scene graph}
+ \note The \QWE Widgets module uses the \l{Qt Quick Scene Graph}{Qt Quick scene graph}
to compose the elements of a web page into one view. This means that the UI process
requires OpenGL ES 2.0 or OpenGL 2.0 for its rendering.
@@ -74,27 +74,27 @@
\image qtwebengine-model.png
- The Qt WebEngine QML implementation contains the same elements as the Qt WebEngine Widgets
+ The \QWE QML implementation contains the same elements as the \QWE Widgets
implementation, except that there is no separately accessible web engine page.
The supported page functionality is integrated into the web engine view.
\section2 Qt WebEngine Core Module
- The Qt WebEngine core is based on the \l {Chromium Project}. Chromium provides its own network
+ The \QWE core is based on the \l {Chromium Project}. Chromium provides its own network
and painting engines and is developed tightly together with its dependent modules.
- \note Qt WebEngine is based on Chromium, but does not contain or use any services
+ \note \QWE is based on Chromium, but does not contain or use any services
or add-ons that might be part of the Chrome browser that is built and delivered by Google.
You can find more detailed information about the differences between Chromium and Chrome in this
\l{https://chromium.googlesource.com/chromium/src/+/master/docs/chromium_browser_vs_google_chrome.md}{overview}
that is part of the documentation in the \l {Chromium Project} upstream source tree.
- This version of Qt WebEngine is based on Chromium version 69.0.3497.128, with
- additional security fixes from newer versions.
+ This version of \QWE is based on Chromium version 73.0.3683, with additional security
+ fixes from newer versions.
\section2 Qt WebEngine Process
- The Qt WebEngine Process is a separate executable that is used to render web pages and
+ The \QWE Process is a separate executable that is used to render web pages and
execute JavaScript. This mitigates security issues and isolates crashes caused by specific
content.
@@ -177,7 +177,7 @@
\section1 Script Injection
- Qt WebEngine does not allow direct access to the document object model (DOM) of a page.
+ \QWE does not allow direct access to the document object model (DOM) of a page.
However, the DOM can be inspected and adapted by injecting scripts.
The DOM of a page is constructed when the document is ready, typically
@@ -191,7 +191,7 @@
script to run, the injection point, and the world where the script is run. This enables
accessing the DOM to manipulate it within a world.
- Since Qt 5.8, Qt WebEngine supports augmenting a script by using the
+ Since Qt 5.8, \QWE supports augmenting a script by using the
following \l{Metadata Block}{Greasemonkey-like attributes}:
\list
@@ -221,8 +221,8 @@
\section1 Managing Certificates
- Qt WebEngine uses its own network stack, and therefore QSslConfiguration is not used to
- open SSL connections. Instead, Qt WebEngine uses the root CA certificates from the operating
+ \QWE uses its own network stack, and therefore QSslConfiguration is not used to
+ open SSL connections. Instead, \QWE uses the root CA certificates from the operating
system to validate the peer's certificate.
The \l{WebEngineCertificateError::error} and \l{QWebEngineCertificateError::Error} enumerations
@@ -232,9 +232,9 @@
\section1 Proxy Support
- Qt WebEngine uses the proxy settings from \l{Qt Network}, and forwards them to Chromium's
- networking stack. If QNetworkProxy::applicationProxy is set, it will also be used for Qt
- WebEngine. If QNetworkProxyFactory::usesSystemConfiguration() is enabled, the proxy settings
+ \QWE uses the proxy settings from \l{Qt Network}, and forwards them to Chromium's
+ networking stack. If QNetworkProxy::applicationProxy is set, it will also be used for \QWE.
+ If QNetworkProxyFactory::usesSystemConfiguration() is enabled, the proxy settings
are automatically retrieved from the system. Settings from an installed QNetworkProxyFactory
will be ignored, though.
@@ -246,7 +246,7 @@
QWebEnginePage::proxyAuthenticationRequired is emitted.
For Qt Quick, a dialog is shown.
- Not all properties of QNetworkProxy are supported by Qt WebEngine. That is,
+ Not all properties of QNetworkProxy are supported by \QWE. That is,
QNetworkProxy::type(), QNetworkProxy::hostName() and QNetworkProxy::port() are taken into
account. All other proxy settings such as QNetworkProxy::rawHeader() are ignored.
@@ -254,7 +254,7 @@
To support High DPI devices, it is recommended that the application attribute
Qt::AA_EnableHighDpiScaling is set to enable automatic scaling based on the
- pixel density of the monitor. In Qt WebEngine applications, the scaling
+ pixel density of the monitor. In \QWE applications, the scaling
affects the default zooming factor and scrollbar size.
For example:
@@ -268,7 +268,7 @@
}
\endcode
- Qt WebEngine bundles images for normal and high-dpi resolutions into
+ \QWE bundles images for normal and high-dpi resolutions into
\e qtwebengine_resources_100p.pak and \e qtwebengine_resources_200p.pak
files. Depending on the target resolutions, one or both of these files need
to be deployed.
@@ -277,7 +277,7 @@
\section1 Using WebEngine Core
- Qt WebEngine Core provides an API shared by Qt WebEngine and Qt WebEngine Widgets for handling
+ \QWE Core provides an API shared by \QWE and \QWE Widgets for handling
URL requests issued for the networking stack of Chromium and for accessing its HTTP cookies.
Implementing the QWebEngineUrlRequestInterceptor interface and installing the interceptor on a
@@ -294,17 +294,17 @@
\section1 Platform Notes
- Qt WebEngine currently supports only Windows, Linux, and \macos. Due to Chromium build
+ \QWE currently supports only Windows, Linux, and \macos. Due to Chromium build
requirements it also often requires a newer compiler than the rest of Qt. See
\l{Qt WebEngine Platform Notes} for further details.
\section1 Related Modules
- Qt WebEngine supersedes the \l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit}
+ \QWE supersedes the \l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit}
module, which is based on the
WebKit project, but has not been actively synchronized with the upstream WebKit code since
- Qt 5.2 and has been deprecated in Qt 5.5. For tips on how to change a Qt WebKit widgets
- application to use Qt WebEngine widgets, see \l{Porting from Qt WebKit to Qt WebEngine}.
+ Qt 5.2 and has been deprecated in Qt 5.5. For tips on how to change a Qt \WebKit widgets
+ application to use \QWE widgets, see \l{Porting from Qt WebKit to Qt WebEngine}.
The \l{Qt WebView} module allows to use a native web browser on platforms where one is
available.
diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
index 0b2aebfce..fefb47795 100644
--- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
@@ -29,9 +29,9 @@
\page qtwebengine-platform-notes.html
\title Qt WebEngine Platform Notes
- \brief Contains information about issues that are specific to the Qt WebEngine module.
+ \brief Contains information about issues that are specific to the \QWE module.
- \section1 Building Qt WebEngine from Source
+ \section1 Building \QWE from Source
Static builds are not supported.
@@ -53,7 +53,7 @@
\li \l {macOS}
\endlist
- The tests for skipping the Qt WebEngine build are located in the
+ The tests for skipping the \QWE build are located in the
\c qtwebengine repository, in the \c tools\qmake\mkspecs subdirectory.
They can be found by searching for \c skipBuild.
@@ -71,8 +71,8 @@
On Windows, Visual Studio 2017 and Windows 10 SDK are required.
- Qt WebEngine can only be built on 64-bit Windows, with a x64-bit toolchain.
- For building Qt WebEngine for x86 applications, you need to configure
+ \QWE can only be built on 64-bit Windows, with a x64-bit toolchain.
+ For building \QWE for x86 applications, you need to configure
and compile Qt with the Visual Studio 2017 x64 to x86 cross-compile
toolchain. This toolchain can be set up on the command line by running
\c{vcvarsall.bat amd64_x86}.
@@ -82,7 +82,7 @@
On Linux, Clang or GCC version 5 or later is required.
Supported configurations are \c linux-g++ and \c{linux-clang}.
- Qt WebEngine requires \c pkg-config to detect most of its dependencies. The
+ \QWE requires \c pkg-config to detect most of its dependencies. The
following \c pkg-config files are required:
\list
@@ -115,13 +115,13 @@
\li \macos 10.12 SDK or later
\endlist
- \note Qt WebEngine cannot be built for the 32-bit mode of \macos (using the
+ \note \QWE cannot be built for the 32-bit mode of \macos (using the
\c macx-clang-32 \c mkspec).
- \section1 Using Earlier Qt Versions to Build Qt WebEngine
+ \section1 Using Earlier Qt Versions to Build \QWE
- Building Qt WebEngine with earlier Qt versions (down to the last LTS
- version) is supported. It means that Qt WebEngine 5.11 can be built with
+ Building \QWE with earlier Qt versions (down to the last LTS
+ version) is supported. It means that \QWE 5.11 can be built with
Qt 5.9.x, Qt 5.10.x, and Qt 5.11.
To use an earlier Qt version to build Qt Webengine:
@@ -134,7 +134,7 @@
\section1 Mac App Store Compatibility
- Applications using Qt WebEngine are not compatible with the Mac App Store, because:
+ Applications using \QWE are not compatible with the Mac App Store, because:
\list
\li The Chromium part of the code uses several private API methods, which are prohibited by
@@ -150,7 +150,7 @@
\section1 macOS Airplay Support on MacBooks with Dual GPUs
- To make Qt WebEngine work correctly when streaming to an AppleTV from a MacBook that supports
+ To make \QWE work correctly when streaming to an AppleTV from a MacBook that supports
GPU switching, it is important to add the \c NSSupportsAutomaticGraphicsSwitching option to the
application Info.plist file, with the value set to \c YES. Otherwise rendering issues might
occur when creating new web engine view instances after Airplay is switched on or off.
@@ -167,9 +167,9 @@
\section1 Sandboxing Support
- Qt WebEngine provides out-of-the-box sandboxing support for Chromium render processes on Linux
+ \QWE provides out-of-the-box sandboxing support for Chromium render processes on Linux
and \macos. Sandboxing is currently not supported on Windows due to a limitation in how
- the sandbox is set up and how it interacts with the host process provided by the Qt WebEngine
+ the sandbox is set up and how it interacts with the host process provided by the \QWE
libraries.
On \macos, there are no special requirements for enabling sandbox support.
@@ -184,7 +184,7 @@
\section1 Accessibility and Performance
- Qt WebEngine enables accessibility support for web pages when the following conditions
+ \QWE enables accessibility support for web pages when the following conditions
are met:
\list
@@ -197,7 +197,7 @@
Due to some limitations, the Linux QPA plugin almost always reports that accessibility should
be activated. On big HTML pages, this can cause a significant slowdown in rendering speed.
- Because of that, from Qt 5.9 onwards, Qt WebEngine accessibility support is disabled by default
+ Because of that, from Qt 5.9 onwards, \QWE accessibility support is disabled by default
on Linux.
It can be re-enabled by setting the \c QTWEBENGINE_ENABLE_LINUX_ACCESSIBILITY environment
variable to a non-empty value.
diff --git a/src/webengine/doc/src/qwebengine-licensing.qdoc b/src/webengine/doc/src/qwebengine-licensing.qdoc
index fa5d656d0..8795ca44c 100644
--- a/src/webengine/doc/src/qwebengine-licensing.qdoc
+++ b/src/webengine/doc/src/qwebengine-licensing.qdoc
@@ -30,7 +30,7 @@
\group qtwebengine-licensing
\title Qt WebEngine Licensing
-The Qt specific parts of the Qt WebEngine module are dual-licensed
+The Qt specific parts of the \QWE module are dual-licensed
under Commercial and GNU Lesser General Public License (LGPLv3).
In addition, the module contains code licensed under LGPLv2.
diff --git a/src/webengine/doc/src/webengineview_lgpl.qdoc b/src/webengine/doc/src/webengineview_lgpl.qdoc
index 3b375c532..9095fac65 100644
--- a/src/webengine/doc/src/webengineview_lgpl.qdoc
+++ b/src/webengine/doc/src/webengineview_lgpl.qdoc
@@ -213,7 +213,7 @@
An internal URL for accessing the currently displayed web site icon,
also known as favicon or shortcut icon. The icon is already downloaded
- and stored by the Qt WebEngine's favicon manager.
+ and stored by the \QWE's favicon manager.
This read-only URL corresponds to the image used within a mobile browser
application to represent a bookmarked page on the device's home screen.
@@ -230,7 +230,7 @@
\endqml
Specifying the \c{sourceSize} property of the \c{Image} element informs
- the Qt WebEngine's favicon provider about the requested size. The
+ the \QWE's favicon provider about the requested size. The
favicon provider tries to find the best fit among the web page candidate
icons. If \c{sourceSize} property is not specified, the provider provides
the icon with the largest resolution.
@@ -629,7 +629,7 @@
\value WebEngineView.NoErrorDomain
\value WebEngineView.InternalErrorDomain
- Content fails to be interpreted by Qt WebEngine.
+ Content fails to be interpreted by \QWE.
\value WebEngineView.ConnectionErrorDomain
Error results from faulty network connection.
\value WebEngineView.CertificateErrorDomain
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
index e756ee157..4d3a71a79 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.cpp
@@ -104,6 +104,13 @@ QRectF RenderWidgetHostViewQtDelegateQuick::viewGeometry() const
return QRectF(mapToGlobal(QPointF(0, 0)), size());
}
+QRect RenderWidgetHostViewQtDelegateQuick::windowGeometry() const
+{
+ if (!window())
+ return QRect();
+ return window()->frameGeometry();
+}
+
void RenderWidgetHostViewQtDelegateQuick::setKeyboardFocus()
{
setFocus(true);
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h
index 4edf37cff..00158b3ac 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.h
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h
@@ -60,6 +60,7 @@ public:
void initAsPopup(const QRect&) override;
QRectF viewGeometry() const override;
+ QRect windowGeometry() const override;
void setKeyboardFocus() override;
bool hasKeyboardFocus() override;
void lockMouse() override;
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp
index 3c6c743e0..91ef84960 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp
+++ b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.cpp
@@ -67,6 +67,11 @@ QRectF RenderWidgetHostViewQtDelegateQuickWindow::viewGeometry() const
return m_realDelegate->viewGeometry();
}
+QRect RenderWidgetHostViewQtDelegateQuickWindow::windowGeometry() const
+{
+ return frameGeometry();
+}
+
void RenderWidgetHostViewQtDelegateQuickWindow::show()
{
QQuickWindow::show();
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
index 039f6102a..35a30d976 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
+++ b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
@@ -57,6 +57,7 @@ public:
void initAsPopup(const QRect&) override;
QRectF viewGeometry() const override;
+ QRect windowGeometry() const override;
void setKeyboardFocus() override {}
bool hasKeyboardFocus() override { return false; }
void lockMouse() override {}
diff --git a/src/webengine/ui_delegates_manager.cpp b/src/webengine/ui_delegates_manager.cpp
index cd4b8ed81..19274bedf 100644
--- a/src/webengine/ui_delegates_manager.cpp
+++ b/src/webengine/ui_delegates_manager.cpp
@@ -64,7 +64,7 @@
namespace QtWebEngineCore {
#define NO_SEPARATOR
-#if defined(Q_OS_WIN)
+#if defined(Q_CC_MSVC) && !defined(Q_CC_CLANG)
#define FILE_NAME_CASE_STATEMENT(TYPE, COMPONENT) \
case UIDelegatesManager::TYPE:\
return QString::fromLatin1(#TYPE ##".qml");
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.cpp b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
index deb92bfd3..4575f2929 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem.cpp
+++ b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
@@ -117,7 +117,7 @@ static inline QWebEngineDownloadItem::DownloadInterruptReason toDownloadInterrup
\l{QWebEngineProfile::downloadRequested}{downloadRequested} signal together
with a newly created QWebEngineDownloadItem. The application can then
examine this item and decide whether to accept it or not. A signal handler
- must explicitly call accept() on the item for Qt WebEngine to actually start
+ must explicitly call accept() on the item for \QWE to actually start
downloading and writing data to disk. If no signal handler calls accept(),
then the download request will be automatically rejected and nothing will be
written to disk.
@@ -147,7 +147,7 @@ static inline QWebEngineDownloadItem::DownloadInterruptReason toDownloadInterrup
\section2 Web Page Downloads
In addition to normal file downloads, which consist simply of retrieving
- some raw bytes from the network and writing them to disk, Qt WebEngine also
+ some raw bytes from the network and writing them to disk, \QWE also
supports saving complete web pages, which involves parsing the page's HTML,
downloading any dependent resources, and potentially packaging everything
into a special file format (\l savePageFormat). To check if a download is
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 9c6749f39..e1b9a8fe3 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -485,7 +485,7 @@ void QWebEnginePagePrivate::authenticationRequired(QSharedPointer<Authentication
void QWebEnginePagePrivate::releaseProfile()
{
- qDebug("Release of profile requested but WebEnginePage still not deleted. Expect troubles !");
+ qWarning("Release of profile requested but WebEnginePage still not deleted. Expect troubles !");
// this is not the way to go, but might avoid the crash if user code does not make any calls to page.
delete q_ptr->d_ptr.take();
}
@@ -715,6 +715,13 @@ void QWebEnginePagePrivate::bindPageAndView(QWebEnginePage *page, QWebEngineView
view->d_func()->pageChanged(oldPage, page);
if (oldWidget != widget)
view->d_func()->widgetChanged(oldWidget, widget);
+
+ // At this point m_ownsPage should still refer to oldPage,
+ // it is only set for the new page after binding.
+ if (view->d_func()->m_ownsPage) {
+ delete oldPage;
+ view->d_func()->m_ownsPage = false;
+ }
}
}
diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp
index 47b3f4363..237d68473 100644
--- a/src/webenginewidgets/api/qwebengineprofile.cpp
+++ b/src/webenginewidgets/api/qwebengineprofile.cpp
@@ -403,6 +403,8 @@ QString QWebEngineProfile::downloadPath() const
}
/*!
+ \since 5.13
+
Overrides the default path used for download location, setting it to \a path.
If set to the null string, the default path is restored.
@@ -832,8 +834,8 @@ void QWebEngineProfile::removeAllUrlSchemeHandlers()
Currently only affects Linux/NSS installations where it enables OCSP.
- As long as one profile has this option enabled, all other profiles will be
- able to use it for their certificate verification.
+ As long as one profile has \a enabled set to \c true, all other profiles
+ will be able to use it for their certificate verification.
\sa isUsedForGlobalCertificateVerification(), httpCacheType()
*/
diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp
index 91fc86cdf..6c08df343 100644
--- a/src/webenginewidgets/api/qwebengineview.cpp
+++ b/src/webenginewidgets/api/qwebengineview.cpp
@@ -126,6 +126,7 @@ static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *obje
QWebEngineViewPrivate::QWebEngineViewPrivate()
: page(0)
, m_dragEntered(false)
+ , m_ownsPage(false)
{
#ifndef QT_NO_ACCESSIBILITY
QAccessible::installFactory(&webAccessibleFactory);
@@ -176,6 +177,7 @@ QWebEnginePage* QWebEngineView::page() const
if (!d->page) {
QWebEngineView *that = const_cast<QWebEngineView*>(this);
that->setPage(new QWebEnginePage(that));
+ d->m_ownsPage = true;
}
return d->page;
}
diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h
index 28fb883aa..7848e0cf3 100644
--- a/src/webenginewidgets/api/qwebengineview_p.h
+++ b/src/webenginewidgets/api/qwebengineview_p.h
@@ -77,6 +77,7 @@ public:
QWebEnginePage *page;
bool m_dragEntered;
+ mutable bool m_ownsPage;
};
#ifndef QT_NO_ACCESSIBILITY
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
index b6c5cb497..a9e0e69ea 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-examples.qdoc
@@ -28,13 +28,13 @@
/*!
\group webengine-widgetexamples
\title Qt WebEngine Widgets Examples
- \brief Examples demonstrating the Qt WebEngine Widgets usage.
+ \brief Examples demonstrating the \QWE Widgets usage.
\ingroup all-examples
Qt provides an integrated Web browser component based on Chromium, the popular
open source browser engine.
- These examples and demonstrations show a range of different uses for Qt WebEngine,
+ These examples and demonstrations show a range of different uses for \QWE,
from displaying Web pages within a Qt user interface to an implementation of
a basic function Web browser.
*/
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
index abfd17ce3..b93bc86f2 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-index.qdoc
@@ -67,7 +67,7 @@
This is a snapshot of the integration of Chromium into Qt.
Qt Commercial Edition licensees that wish to distribute applications that
- use the Qt WebEngine module need to be aware of their obligations under the
+ use the \QWE module need to be aware of their obligations under the
GNU Library General Public License (LGPLv2).
Developers using the Open Source Edition can choose to redistribute
diff --git a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
index 35fed802c..6f3eac5ad 100644
--- a/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebenginewidgets-module.qdoc
@@ -33,7 +33,7 @@
\ingroup qtwebengine-modules
\qtvariable webenginewidgets
- The Qt WebEngineWidgets module provides a web browser engine as well as C++ classes to render
+ The \QWEWidgets module provides a web browser engine as well as C++ classes to render
and interact with web content.
To include the definitions of the module's classes, use the
diff --git a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
index 7bc7ff48d..e3fdc4ff1 100644
--- a/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
+++ b/src/webenginewidgets/doc/src/qtwebkitportingguide.qdoc
@@ -28,7 +28,7 @@
/*!
\page qtwebenginewidgets-qtwebkitportingguide.html
\title Porting from Qt WebKit to Qt WebEngine
- \brief Overview of the differences between the Qt WebKit and Qt WebEngine API.
+ \brief Overview of the differences between the Qt \WebKit and \QWE API.
The following sections contain information about porting an application that uses the
\l{http://doc.qt.io/archives/qt-5.3/qtwebkit-index.html}{Qt WebKit}
@@ -37,17 +37,17 @@
\section1 Architecture
- Chromium provides its own network and painting engines, which Qt WebEngine uses. This, among
- other things, allows Qt WebEngine to provide better and more reliable support for the latest
- HTML5 specification than Qt WebKit. However, Qt WebEngine is thus also heavier than Qt WebKit
+ Chromium provides its own network and painting engines, which \QWE uses. This, among
+ other things, allows \QWE to provide better and more reliable support for the latest
+ HTML5 specification than Qt \WebKit. However, \QWE is thus also heavier than Qt \WebKit
and does not provide direct access to the network stack and the HTML document through C++ APIs.
\section1 Class Names
- The Qt WebEngine equivalent of Qt WebKit C++ classes are prefixed by
+ The \QWE equivalent of Qt \WebKit C++ classes are prefixed by
"\e QWebEngine" instead of "\e QWeb".
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
#include <QWebHistory>
#include <QWebHistoryItem>
@@ -59,7 +59,7 @@
QWebPage
QWebView
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
#include <QWebEngineHistory>
#include <QWebEngineHistoryItem>
@@ -77,23 +77,23 @@
\section2 In qmake Project Files
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QT += webkitwidgets
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
QT += webenginewidgets
\endcode
\section2 Including the Module in Source Files
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
#include <QtWebKit/QtWebKit>
#include <QtWebKitWidgets/QtWebKitWidgets> // With Qt >= 4.8
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
#include <QtWebEngineWidgets/QtWebEngineWidgets>
\endcode
@@ -104,22 +104,22 @@
HTML frames can be used to divide web pages into several areas where the content can be
represented individually.
- In Qt WebKit, QWebFrame represents a frame inside a web page. Each QWebPage object contains at
+ In Qt \WebKit, QWebFrame represents a frame inside a web page. Each QWebPage object contains at
least one frame, the main frame, obtained using QWebPage::mainFrame(). Additional frames will
be created for the HTML \c <frame> element, which defines the appearance and contents of a
single frame, or the \c <iframe> element, which inserts a frame within a block of text.
- In Qt WebEngine, frame handling has been merged into the QWebEnginePage class. All child frames
+ In \QWE, frame handling has been merged into the QWebEnginePage class. All child frames
are now considered part of the content, and only accessible through JavaScript. Methods of the
QWebFrame class, such as \c load() are now available directly through the QWebEnginePage itself.
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QWebPage page;
connect(page.mainFrame(), SIGNAL(urlChanged(const QUrl&)), SLOT(mySlotName()));
page.mainFrame()->load(url);
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
QWebEnginePage page;
connect(&page, SIGNAL(urlChanged(const QUrl&)), SLOT(mySlotName()));
@@ -129,12 +129,12 @@
\section1 Some Methods Now Return Their Result Asynchronously
- Because Qt WebEngine uses a multi-process architecture, calls to some methods from applications
+ Because \QWE uses a multi-process architecture, calls to some methods from applications
will return immediately, while the results should be received asynchronously via a callback
mechanism. A function pointer, a functor, or a lambda expression must be provided to handle the
results when they become available.
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QWebPage *page = new QWebPage;
QTextEdit *textEdit = new QTextEdit;
@@ -142,7 +142,7 @@
textEdit->setPlainText(page->toHtml());
textEdit->setPlainText(page->toPlainText());
\endcode
- \b {Qt WebEngine (with a lambda function in C++11)}
+ \b {\QWE (with a lambda function in C++11)}
\code
QWebEnginePage *page = new QWebEnginePage;
QTextEdit *textEdit = new QTextEdit;
@@ -150,7 +150,7 @@
page->toHtml([textEdit](const QString &result){ textEdit->setPlainText(result); });
page->toPlainText([textEdit](const QString &result){ textEdit->setPlainText(result); });
\endcode
- \b {Qt WebEngine (with a functor template wrapping a member function)}
+ \b {\QWE (with a functor template wrapping a member function)}
\code
template<typename Arg, typename R, typename C>
struct InvokeWrapper {
@@ -174,7 +174,7 @@
page->toHtml(invoke(textEdit, &QTextEdit::setPlainText));
page->toPlainText(invoke(textEdit, &QTextEdit::setPlainText));
\endcode
- \b {Qt WebEngine (with a regular functor)}
+ \b {\QWE (with a regular functor)}
\code
struct SetPlainTextFunctor {
QTextEdit *textEdit;
@@ -192,29 +192,29 @@
\endcode
- \section1 Qt WebEngine Does Not Interact with QNetworkAccessManager
+ \section1 \QWE Does Not Interact with QNetworkAccessManager
Some classes of Qt Network such as QAuthenticator were reused for their interface
- but, unlike Qt WebKit, Qt WebEngine has its own HTTP implementation and cannot
+ but, unlike Qt \WebKit, \QWE has its own HTTP implementation and cannot
go through a QNetworkAccessManager.
The signals and methods of QNetworkAccessManager that are still supported were
moved to the QWebEnginePage class.
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QNetworkAccessManager qnam;
QWebPage page;
page.setNetworkAccessManager(&qnam);
connect(&qnam, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticate(QNetworkReply*,QAuthenticator*)));
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
QWebEnginePage page;
connect(&page, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authenticate(QNetworkReply*,QAuthenticator*)));
\endcode
- \note In Qt WebEngine, the QAuthenticator must be explicitly set to null to
+ \note In \QWE, the QAuthenticator must be explicitly set to null to
cancel authentication:
\code
@@ -233,12 +233,12 @@
It is currently only possible to run JavaScript on the main frame of a page and the
result is returned asynchronously to the provided functor.
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QWebPage *page = new QWebPage;
qDebug() << page->mainFrame()->evaluateJavaScript("'Java' + 'Script'");
\endcode
- \b {Qt WebEngine (with lambda expressions in C++11)}
+ \b {\QWE (with lambda expressions in C++11)}
\code
QWebEnginePage *page = new QWebEnginePage;
page->runJavaScript("'Java' + 'Script'", [](const QVariant &result){ qDebug() << result; });
@@ -255,12 +255,12 @@
the contentEditable attribute in the latest HTML standard. Therefore, QWebEnginePage::runJavaScript
is all that is needed.
- \b {Qt WebKit}
+ \b {Qt \WebKit}
\code
QWebPage page;
page.setContentEditable(true);
\endcode
- \b {Qt WebEngine}
+ \b {\QWE}
\code
QWebEnginePage page;
page.runJavaScript("document.documentElement.contentEditable = true");
@@ -269,35 +269,35 @@
\section1 Unavailable Qt WebKit API
- The Qt WebKit classes and methods in this list will not be available in Qt WebEngine.
+ The Qt \WebKit classes and methods in this list will not be available in \QWE.
\table
\row
\li QGraphicsWebView
- \li Qt WebEngine is designed for being used with hardware acceleration. Because we could not
+ \li \QWE is designed for being used with hardware acceleration. Because we could not
support a web view class in a QGraphicsView unless it would be attached to a QGLWidget
viewport, this feature is out of scope.
\row
\li QWebElement
- \li Qt WebEngine uses a multi-process architecture and this means that
+ \li \QWE uses a multi-process architecture and this means that
any access to the internal structure of the page has to be done
asynchronously, any query result must be returned through callbacks.
The QWebElement API was designed for synchronous access and this
would require a complete redesign.
\row
\li QWebDatabase
- \li The Web SQL Database feature that this API was wrapping in Qt WebKit
+ \li The Web SQL Database feature that this API was wrapping in Qt \WebKit
was dropped from the HTML5 standard.
\row
\li QWebPluginDatabase, QWebPluginFactory, QWebPluginInfo, QWebPage::setPalette,
QWebView::setRenderHints
- \li Qt WebEngine renders web pages using Skia and is not using QPainter
+ \li \QWE renders web pages using Skia and is not using QPainter
or Qt for this purpose. The HTML5 standard also now offers much
better alternatives that were not available when native controls
- plugins were introduced in Qt WebKit.
+ plugins were introduced in Qt \WebKit.
\row
\li QWebHistoryInterface
- \li Visited links are persisted automatically by Qt WebEngine.
+ \li Visited links are persisted automatically by \QWE.
\row
\li QWebPage::setContentEditable
\li In the latest HTML standard, any document element can be made editable through the
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index f9ab710d1..c451344d2 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -440,7 +440,7 @@
/*!
\fn void QWebEnginePage::triggerAction(WebAction action, bool checked = false)
This function can be called to trigger the specified \a action.
- It is also called by Qt WebEngine if the user triggers the action, for example
+ It is also called by \QWE if the user triggers the action, for example
through a context menu item.
If \a action is a checkable action, then \a checked specifies whether the action
diff --git a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
index 568e7a63a..fce1e8d8f 100644
--- a/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebengineview_lgpl.qdoc
@@ -33,7 +33,7 @@
\inmodule QtWebEngineWidgets
- A \e {web view} is the main widget component of the Qt WebEngine web browsing module.
+ A \e {web view} is the main widget component of the \QWE web browsing module.
It can be used in various applications to display web content live from the
Internet.
@@ -129,7 +129,7 @@
The HTML document is loaded immediately, whereas external objects are loaded asynchronously.
- When using this method, Qt WebEngine assumes that external resources, such as
+ When using this method, \QWE assumes that external resources, such as
JavaScript programs or style sheets, are encoded in UTF-8 unless otherwise
specified. For example, the encoding of an external script can be specified
through the \c charset attribute of the HTML script tag. Alternatively, the
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 140314681..817d6e408 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp
@@ -238,6 +238,13 @@ QRectF RenderWidgetHostViewQtDelegateWidget::viewGeometry() const
return QRectF(mapToGlobal(pos()), size());
}
+QRect RenderWidgetHostViewQtDelegateWidget::windowGeometry() const
+{
+ if (!window())
+ return QRect();
+ return window()->frameGeometry();
+}
+
void RenderWidgetHostViewQtDelegateWidget::setKeyboardFocus()
{
// The root item always has focus within the root focus scope:
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
index a736aa5cf..7746c4405 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
@@ -67,6 +67,7 @@ public:
void initAsPopup(const QRect&) override;
QRectF viewGeometry() const override;
+ QRect windowGeometry() const override;
void setKeyboardFocus() override;
bool hasKeyboardFocus() override;
void lockMouse() override;