summaryrefslogtreecommitdiffstats
path: root/src/core/type_conversion.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-15 12:45:59 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-04-20 14:32:58 +0000
commitd56128c315ad89dddf507b10dc4332d05cc42f91 (patch)
tree65a2b340c82350d95cb29a1576e1053d6ba84a0c /src/core/type_conversion.h
parent5b8aad9fa24caeb50ff3640d01590a15ee4e23d8 (diff)
Improve thread-safety of custom scheme handlers
Avoids accessing the QWebEngineUrlSchemeHandler from any other thread than the UI thread, since it may be deleted at any time on the UI thread. Change-Id: Icb4331b3c36f6f619a9fd975d155a9fd608dc5e9 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/core/type_conversion.h')
-rw-r--r--src/core/type_conversion.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/type_conversion.h b/src/core/type_conversion.h
index eb874a26d..e97ebed6f 100644
--- a/src/core/type_conversion.h
+++ b/src/core/type_conversion.h
@@ -73,6 +73,11 @@ inline QString toQt(const std::string &string)
return QString::fromStdString(string);
}
+inline QByteArray toQByteArray(const std::string &string)
+{
+ return QByteArray::fromStdString(string);
+}
+
inline base::string16 toString16(const QString &qString)
{
#if defined(OS_WIN)