From 6d760436bc0d7081d5bdb50e4141171b6ba940ee Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 15 Jan 2014 18:22:24 +0100 Subject: Refactor the callback mechanism used by runJavaScript This prepares the way for other API made async like toHtml and toPlainText. Use a callback class with an implicit templated constructor to carry the functor across the API boundary and avoid the intermediate helper method as the ABI that we have to maintain. Also pass the callback result through WebContentsAdapterClient using a bookkeeping ID instead of transferring the callback to WebContentsAdapter. This will allow other calls, which might not already allow passing a callback functor, to use a consisten way of carrying back the result to the top API layer. Change-Id: Ia923767b9c1021a108c26da17d4c41878ef7cb95 Reviewed-by: Pierre Rossi --- src/webengine/api/qquickwebengineview_p_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/webengine/api') diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h index f0bc0a9fb..96632904c 100644 --- a/src/webengine/api/qquickwebengineview_p_p.h +++ b/src/webengine/api/qquickwebengineview_p_p.h @@ -138,6 +138,7 @@ public: virtual bool contextMenuRequested(const WebEngineContextMenuData &) Q_DECL_OVERRIDE; virtual void javascriptDialog(QSharedPointer) Q_DECL_OVERRIDE; virtual void runFileChooser(FileChooserMode, const QString &defaultFileName, const QStringList &acceptedMimeTypes) Q_DECL_OVERRIDE; + virtual void didRunJavaScript(const QVariant&, quint64) Q_DECL_OVERRIDE { } void setDevicePixelRatio(qreal); -- cgit v1.2.3