summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-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
51 files changed, 406 insertions, 359 deletions
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)