File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,23 @@ explicit JobQueue(JSContext *cx);
34
34
*/
35
35
bool init (JSContext *cx);
36
36
37
+ /* *
38
+ * @brief Ask the embedding for the host defined data.
39
+ *
40
+ * SpiderMonkey doesn't itself have a notion of host defined data as defined
41
+ * by the HTML spec, so we need the embedding to provide this. See
42
+ * dom/script/ScriptSettings.h for details.
43
+ *
44
+ * If the embedding has the host defined data, this method should return the
45
+ * host defined data via the `data` out parameter and return `true`.
46
+ * The object in the `data` out parameter can belong to any compartment.
47
+ * If the embedding doesn't need the host defined data, this method should
48
+ * set the `data` out parameter to `nullptr` and return `true`.
49
+ * If any error happens while generating the host defined data, this method
50
+ * should set a pending exception to `cx` and return `false`.
51
+ */
52
+ bool getHostDefinedData (JSContext *cx, JS::MutableHandle<JSObject *> data) const override ;
53
+
37
54
/* *
38
55
* @brief Enqueue a reaction job `job` for `promise`, which was allocated at
39
56
* `allocationSite`. Provide `incumbentGlobal` as the incumbent global for
Original file line number Diff line number Diff line change @@ -26,6 +26,11 @@ JobQueue::JobQueue(JSContext *cx) {
26
26
finalizationRegistryCallbacks = new JS::PersistentRooted<FunctionVector>(cx); // Leaks but it's OK since freed at process exit
27
27
}
28
28
29
+ bool JobQueue::getHostDefinedData (JSContext *cx, JS::MutableHandle<JSObject *> data) const {
30
+ data.set (nullptr ); // We don't need the host defined data
31
+ return true ; // `true` indicates no error
32
+ }
33
+
29
34
bool JobQueue::enqueuePromiseJob (JSContext *cx,
30
35
[[maybe_unused]] JS::HandleObject promise,
31
36
JS::HandleObject job,
You can’t perform that action at this time.
0 commit comments