MCPcopy Create free account
hub / github.com/GNOME/gjs / enqueuePromiseJob

Method enqueuePromiseJob

gjs/context.cpp:966–988  ·  view source on GitHub ↗

See engine.cpp and JS::SetJobQueue().

Source from the content-addressed store, hash-verified

964
965// See engine.cpp and JS::SetJobQueue().
966bool GjsContextPrivate::enqueuePromiseJob(JSContext* cx [[maybe_unused]],
967 JS::HandleObject promise,
968 JS::HandleObject job,
969 JS::HandleObject allocation_site,
970 JS::HandleObject incumbent_global
971 [[maybe_unused]]) {
972 g_assert(cx == m_cx);
973 g_assert(from_cx(cx) == this);
974
975 gjs_debug(GJS_DEBUG_MAINLOOP,
976 "Enqueue job %s, promise=%s, allocation site=%s",
977 gjs_debug_object(job).c_str(), gjs_debug_object(promise).c_str(),
978 gjs_debug_object(allocation_site).c_str());
979
980 if (!m_job_queue.append(job)) {
981 JS_ReportOutOfMemory(m_cx);
982 return false;
983 }
984
985 JS::JobQueueMayNotBeEmpty(m_cx);
986 m_dispatcher.start();
987 return true;
988}
989
990// Override of JobQueue::runJobs(). Called by js::RunJobs(), and when execution
991// of the job queue was interrupted by the debugger and is resuming.

Callers

nothing calls this directly

Calls 3

gjs_debugFunction · 0.85
gjs_debug_objectFunction · 0.85
startMethod · 0.65

Tested by

no test coverage detected