summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-09-28 12:09:01 +0200
committerSimon Hausmann <simon.hausmann@theqtcompany.com>2015-11-02 14:42:26 +0000
commit10cd4401b9e4e9fde2a8e17c70a0d11d2dfc306f (patch)
treefd289fe42d8818163e8a80ab41598927f7723f92
parent22da1274f0dd9cf7211fdca21e9634a85ae25430 (diff)
Properly mark value based classes
Change-Id: I937ce0daf2fa73d7179a5f62585abfb1acea7264 Reviewed-by: Michael BrĂ¼ning <michael.bruning@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
-rw-r--r--src/core/api/qwebenginecallback.h7
-rw-r--r--src/core/api/qwebenginecallback_p.h6
-rw-r--r--src/core/api/qwebenginecookiestoreclient_p.h4
-rw-r--r--src/core/common/user_script_data.h6
-rw-r--r--src/webenginewidgets/api/qwebenginehistory.h4
-rw-r--r--src/webenginewidgets/api/qwebenginescript.h2
6 files changed, 27 insertions, 2 deletions
diff --git a/src/core/api/qwebenginecallback.h b/src/core/api/qwebenginecallback.h
index ddee20d06..b675438f5 100644
--- a/src/core/api/qwebenginecallback.h
+++ b/src/core/api/qwebenginecallback.h
@@ -81,12 +81,19 @@ public:
: d(new QtWebEnginePrivate::QWebEngineCallbackPrivate<T, F>(f))
{ }
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;
};
+Q_DECLARE_SHARED(QWebEngineCallback<int>)
+Q_DECLARE_SHARED(QWebEngineCallback<const QByteArray &>)
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineCallback<bool>)
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineCallback<const QString &>)
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineCallback<const QVariant &>)
+
QT_END_NAMESPACE
#endif // QWEBENGINECALLBACK_H
diff --git a/src/core/api/qwebenginecallback_p.h b/src/core/api/qwebenginecallback_p.h
index f0c25fe9e..9bc9b9727 100644
--- a/src/core/api/qwebenginecallback_p.h
+++ b/src/core/api/qwebenginecallback_p.h
@@ -47,6 +47,7 @@
#include <QVariant>
#include <type_traits>
+// keep in sync with Q_DECLARE_SHARED... in qwebenginecallback.h
#define FOR_EACH_TYPE(F) \
F(bool) \
F(int) \
@@ -227,6 +228,11 @@ void CallbackDirectory::CallbackSharedDataPointer<T>::invokeEmpty()
parent->invokeEmptyInternal(callback);
}
+#define CHECK_RELOCATABLE(x) \
+ Q_STATIC_ASSERT((QTypeInfoQuery<QWebEngineCallback< x > >::isRelocatable));
+FOR_EACH_TYPE(CHECK_RELOCATABLE)
+#undef CHECK_RELOCATABLE
+
} // namespace QtWebEngineCore
#endif // QWEBENGINECALLBACK_P_H
diff --git a/src/core/api/qwebenginecookiestoreclient_p.h b/src/core/api/qwebenginecookiestoreclient_p.h
index 68ab6549f..6b959c562 100644
--- a/src/core/api/qwebenginecookiestoreclient_p.h
+++ b/src/core/api/qwebenginecookiestoreclient_p.h
@@ -70,7 +70,7 @@ class QWEBENGINE_PRIVATE_EXPORT QWebEngineCookieStoreClientPrivate {
QNetworkCookie cookie;
QUrl origin;
};
-
+ friend class QTypeInfo<CookieData>;
public:
Q_DECLARE_PUBLIC(QWebEngineCookieStoreClient)
QtWebEngineCore::CallbackDirectory callbackDirectory;
@@ -102,6 +102,8 @@ public:
void onCookieChanged(const QNetworkCookie &cookie, bool removed);
};
+Q_DECLARE_TYPEINFO(QWebEngineCookieStoreClientPrivate::CookieData, Q_MOVABLE_TYPE);
+
QT_END_NAMESPACE
#endif // QWEBENGINECOOKIESTORECLIENT_P_H
diff --git a/src/core/common/user_script_data.h b/src/core/common/user_script_data.h
index 3dfec0ec3..d0856e02a 100644
--- a/src/core/common/user_script_data.h
+++ b/src/core/common/user_script_data.h
@@ -60,4 +60,10 @@ struct UserScriptData {
uint64 scriptId;
};
+QT_BEGIN_NAMESPACE
+
+Q_DECLARE_TYPEINFO(UserScriptData, Q_MOVABLE_TYPE);
+
+QT_END_NAMESPACE
+
#endif // USER_SCRIPT_DATA_H
diff --git a/src/webenginewidgets/api/qwebenginehistory.h b/src/webenginewidgets/api/qwebenginehistory.h
index 0471e28e6..3dcea9469 100644
--- a/src/webenginewidgets/api/qwebenginehistory.h
+++ b/src/webenginewidgets/api/qwebenginehistory.h
@@ -65,6 +65,9 @@ public:
QUrl iconUrl() const;
bool isValid() const;
+
+ void swap(QWebEngineHistoryItem &other) Q_DECL_NOTHROW { qSwap(d, other.d); }
+
private:
QWebEngineHistoryItem(QWebEngineHistoryItemPrivate *priv);
Q_DECLARE_PRIVATE_D(d.data(), QWebEngineHistoryItem)
@@ -73,6 +76,7 @@ private:
friend class QWebEngineHistoryPrivate;
};
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineHistoryItem)
class QWebEngineHistoryPrivate;
class QWEBENGINEWIDGETS_EXPORT QWebEngineHistory {
diff --git a/src/webenginewidgets/api/qwebenginescript.h b/src/webenginewidgets/api/qwebenginescript.h
index 4cff2631d..29126b110 100644
--- a/src/webenginewidgets/api/qwebenginescript.h
+++ b/src/webenginewidgets/api/qwebenginescript.h
@@ -99,7 +99,7 @@ private:
QSharedDataPointer<QtWebEngineCore::UserScript> d;
};
-Q_DECLARE_SHARED(QWebEngineScript)
+Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6(QWebEngineScript)
#ifndef QT_NO_DEBUG_STREAM
QWEBENGINEWIDGETS_EXPORT QDebug operator<<(QDebug, const QWebEngineScript &);