summaryrefslogtreecommitdiff
path: root/utils/ipc/tools
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-09-08 20:47:19 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2021-05-26 13:03:27 +0900
commit139d8855747799da9218f36720004fb1927bd2ef (patch)
tree7f3f47e68e08cfcf19ee9f37cc91f31690b9fc53 /utils/ipc/tools
parenta7ded8e8f5dd0ae0841960280fe9a7107f945a34 (diff)
utils: ipc: Update mojo
Update mojo from the Chromium repository. The commit from which this was taken is: 9c138d992bfc1fb8f4f7bcf58d00bf19c219e4e2 "Updating trunk VERSION from 4523.0 to 4524.0" The update-mojo.sh script was used for this update. Bug: https://bugs.libcamera.org/show_bug.cgi?id=34 Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'utils/ipc/tools')
-rw-r--r--utils/ipc/tools/README4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/ipc/tools/README b/utils/ipc/tools/README
new file mode 100644
index 00000000..d5c24fc3
--- /dev/null
+++ b/utils/ipc/tools/README
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: CC0-1.0
+
+Files in this directory are imported from 9c138d992bfc of Chromium. Do not
+modify them manually.
notifiers_) { NotifierSet &set = it.second; delete set.read.qnotifier; delete set.write.qnotifier; delete set.exception.qnotifier; } } void QtEventDispatcher::registerEventNotifier(EventNotifier *notifier) { NotifierSet &set = notifiers_[notifier->fd()]; QSocketNotifier::Type qtype; void (QtEventDispatcher::*method)(int); NotifierPair *pair; switch (notifier->type()) { case EventNotifier::Read: default: qtype = QSocketNotifier::Read; method = &QtEventDispatcher::readNotifierActivated; pair = &set.read; break; case EventNotifier::Write: qtype = QSocketNotifier::Write; method = &QtEventDispatcher::writeNotifierActivated; pair = &set.write; break; case EventNotifier::Exception: qtype = QSocketNotifier::Exception; method = &QtEventDispatcher::exceptionNotifierActivated; pair = &set.exception; break; } QSocketNotifier *qnotifier = new QSocketNotifier(notifier->fd(), qtype); connect(qnotifier, &QSocketNotifier::activated, this, method); pair->notifier = notifier; pair->qnotifier = qnotifier; } void QtEventDispatcher::unregisterEventNotifier(EventNotifier *notifier) { NotifierSet &set = notifiers_[notifier->fd()]; NotifierPair *pair; switch (notifier->type()) { case EventNotifier::Read: default: pair = &set.read; break; case EventNotifier::Write: pair = &set.write; break; case EventNotifier::Exception: pair = &set.exception; break; } delete pair->qnotifier; pair->qnotifier = nullptr; pair->notifier = nullptr; } void QtEventDispatcher::readNotifierActivated(int socket) { EventNotifier *notifier = notifiers_[socket].read.notifier; notifier->activated.emit(notifier); } void QtEventDispatcher::writeNotifierActivated(int socket) { EventNotifier *notifier = notifiers_[socket].write.notifier; notifier->activated.emit(notifier); } void QtEventDispatcher::exceptionNotifierActivated(int socket) { EventNotifier *notifier = notifiers_[socket].exception.notifier; notifier->activated.emit(notifier); } void QtEventDispatcher::registerTimer(Timer *timer) { std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now(); std::chrono::steady_clock::duration duration = timer->deadline() - now; std::chrono::milliseconds msec = std::chrono::duration_cast<std::chrono::milliseconds>(duration); int timerId = startTimer(msec.count()); timers_[timerId] = timer; timerIds_[timer] = timerId; } void QtEventDispatcher::unregisterTimer(Timer *timer) { auto it = timerIds_.find(timer); if (it == timerIds_.end()) return; timers_.erase(it->second); killTimer(it->second); timerIds_.erase(it); } void QtEventDispatcher::timerEvent(QTimerEvent *event) { Timer *timer = timers_[event->timerId()]; timer->stop(); timer->timeout.emit(timer); } void QtEventDispatcher::processEvents() { std::cout << "QtEventDispatcher::processEvents() should not be called" << std::endl; } void QtEventDispatcher::interrupt() { QCoreApplication::eventDispatcher()->interrupt(); }