summaryrefslogtreecommitdiff
path: root/Source/WTF
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-12-26 00:24:34 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:31:19 +0000
commitb9e202b0f12f275d4aade98943df92bf67684f52 (patch)
tree4471f3da5f573679c3f42b0ad54c46bdd0a50910 /Source/WTF
parent1c8f056531c65706b85c44c2db657ea891be868d (diff)
downloadqtwebkit-b9e202b0f12f275d4aade98943df92bf67684f52.tar.gz
Imported WebKit commit 12fbea815480c3b3fad139cd8dfb82e8c954bc9a
Change-Id: Iccbb1e8bd8b7f72322614224c203fc509a8dbb79 Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WTF')
-rw-r--r--Source/WTF/wtf/Assertions.h2
-rw-r--r--Source/WTF/wtf/PlatformQt.cmake6
-rw-r--r--Source/WTF/wtf/WorkQueue.h7
-rw-r--r--Source/WTF/wtf/qt/WorkQueueQt.cpp7
4 files changed, 22 insertions, 0 deletions
diff --git a/Source/WTF/wtf/Assertions.h b/Source/WTF/wtf/Assertions.h
index 28060cc98..787c05f42 100644
--- a/Source/WTF/wtf/Assertions.h
+++ b/Source/WTF/wtf/Assertions.h
@@ -38,6 +38,8 @@
Defining any of the symbols explicitly prevents this from having any effect.
*/
+#undef __STDC_FORMAT_MACROS
+#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
diff --git a/Source/WTF/wtf/PlatformQt.cmake b/Source/WTF/wtf/PlatformQt.cmake
index a85dc6abe..1e64e8bb2 100644
--- a/Source/WTF/wtf/PlatformQt.cmake
+++ b/Source/WTF/wtf/PlatformQt.cmake
@@ -40,13 +40,19 @@ if (USE_GLIB)
list(APPEND WTF_SYSTEM_INCLUDE_DIRECTORIES
${GLIB_INCLUDE_DIRS}
)
+ list(APPEND WTF_LIBRARIES
+ ${GLIB_GOBJECT_LIBRARIES}
+ ${GLIB_LIBRARIES}
+ )
endif ()
if (WIN32)
list(APPEND WTF_LIBRARIES
winmm
)
+endif ()
+if (MSVC)
set(WTF_POST_BUILD_COMMAND "${CMAKE_BINARY_DIR}/DerivedSources/WTF/postBuild.cmd")
file(WRITE "${WTF_POST_BUILD_COMMAND}" "@xcopy /y /s /d /f \"${WTF_DIR}/wtf/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/WTF\" >nul 2>nul\n@xcopy /y /s /d /f \"${DERIVED_SOURCES_DIR}/WTF/*.h\" \"${DERIVED_SOURCES_DIR}/ForwardingHeaders/WTF\" >nul 2>nul\n")
file(MAKE_DIRECTORY ${DERIVED_SOURCES_DIR}/ForwardingHeaders/WTF)
diff --git a/Source/WTF/wtf/WorkQueue.h b/Source/WTF/wtf/WorkQueue.h
index c5f81666b..ca93aa7f8 100644
--- a/Source/WTF/wtf/WorkQueue.h
+++ b/Source/WTF/wtf/WorkQueue.h
@@ -52,6 +52,12 @@
#include <wtf/win/WorkItemWin.h>
#endif
+#if PLATFORM(QT)
+QT_BEGIN_NAMESPACE
+class QProcess;
+QT_END_NAMESPACE
+#endif
+
namespace WTF {
class WorkQueue final : public FunctionDispatcher {
@@ -83,6 +89,7 @@ public:
void unregisterSocketEventHandler(int);
#elif PLATFORM(QT)
QSocketNotifier* registerSocketEventHandler(int, QSocketNotifier::Type, std::function<void()>);
+ void dispatchOnTermination(QProcess*, std::function<void()>);
#elif OS(DARWIN)
dispatch_queue_t dispatchQueue() const { return m_dispatchQueue; }
#endif
diff --git a/Source/WTF/wtf/qt/WorkQueueQt.cpp b/Source/WTF/wtf/qt/WorkQueueQt.cpp
index 5d412361c..be04dae3f 100644
--- a/Source/WTF/wtf/qt/WorkQueueQt.cpp
+++ b/Source/WTF/wtf/qt/WorkQueueQt.cpp
@@ -28,6 +28,7 @@
#include "WorkQueue.h"
#include <QObject>
+#include <QProcess>
#include <QThread>
#include <wtf/Threading.h>
@@ -122,6 +123,12 @@ void WorkQueue::dispatchAfter(std::chrono::nanoseconds duration, std::function<v
itemQt->moveToThread(m_workThread);
}
+void WorkQueue::dispatchOnTermination(QProcess* process, std::function<void()> function)
+{
+ WorkQueue::WorkItemQt* itemQt = new WorkQueue::WorkItemQt(this, process, SIGNAL(finished(int, QProcess::ExitStatus)), function);
+ itemQt->moveToThread(m_workThread);
+}
+
}
#include "WorkQueueQt.moc"