summaryrefslogtreecommitdiff
path: root/gjs/context-private.h
diff options
context:
space:
mode:
Diffstat (limited to 'gjs/context-private.h')
-rw-r--r--gjs/context-private.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gjs/context-private.h b/gjs/context-private.h
index 8004dbc0..6244a107 100644
--- a/gjs/context-private.h
+++ b/gjs/context-private.h
@@ -37,6 +37,7 @@
#include "gjs/context.h"
#include "gjs/jsapi-util.h"
#include "gjs/macros.h"
+#include "gjs/mainloop.h"
#include "gjs/profiler.h"
namespace js {
@@ -81,6 +82,7 @@ class GjsContextPrivate : public JS::JobQueue {
JobQueueStorage m_job_queue;
GSource* m_promise_queue_source;
GCancellable* m_promise_queue_source_cancellable;
+ Gjs::MainLoop* m_main_loop;
std::vector<std::pair<DestroyNotify, void*>> m_destroy_notifications;
std::vector<Gjs::Closure::Ptr> m_async_closures;
@@ -176,6 +178,8 @@ class GjsContextPrivate : public JS::JobQueue {
[[nodiscard]] JSObject* internal_global() const {
return m_internal_global.get();
}
+ void main_loop_ref() { m_main_loop->ref(); }
+ bool main_loop_unref() { return m_main_loop->unref(); }
[[nodiscard]] GjsProfiler* profiler() const { return m_profiler; }
[[nodiscard]] const GjsAtoms& atoms() const { return *m_atoms; }
[[nodiscard]] bool destroying() const { return m_destroying.load(); }