@@ -92,6 +92,10 @@ struct JsAPIHooks
92
92
93
93
typedef JsErrorCode (WINAPI *JsrtSerializeParserState)(JsValueRef script, JsValueRef *buffer, JsParseScriptAttributes parseAttributes);
94
94
typedef JsErrorCode (WINAPI *JsrtRunScriptWithParserState)(JsValueRef script, JsSourceContext sourceContext, JsValueRef sourceUrl, JsParseScriptAttributes parseAttributes, JsValueRef parserState, JsValueRef *result);
95
+
96
+ typedef JsErrorCode (WINAPI *JsrtQueueBackgroundParse)(JsScriptContents* contents, DWORD* dwBgParseCookie);
97
+ typedef JsErrorCode (WINAPI *JsrtDiscardBackgroundParse)(DWORD dwBgParseCookie, void * buffer, bool * callerOwnsBuffer);
98
+ typedef JsErrorCode (WINAPI *JsrtExecuteBackgroundParse)(DWORD dwBgParseCookie, JsValueRef script, JsSourceContext sourceContext, WCHAR *url, JsParseScriptAttributes parseAttributes, JsValueRef parserState, JsValueRef *result);
95
99
96
100
typedef JsErrorCode (WINAPI *JsrtTTDCreateRecordRuntimePtr)(JsRuntimeAttributes attributes, bool enableDebugging, size_t snapInterval, size_t snapHistoryLength, TTDOpenResourceStreamCallback openResourceStream, JsTTDWriteBytesToStreamCallback writeBytesToStream, JsTTDFlushAndCloseStreamCallback flushAndCloseStream, JsThreadServiceCallback threadService, JsRuntimeHandle *runtime);
97
101
typedef JsErrorCode (WINAPI *JsrtTTDCreateReplayRuntimePtr)(JsRuntimeAttributes attributes, const char * infoUri, size_t infoUriCount, bool enableDebugging, TTDOpenResourceStreamCallback openResourceStream, JsTTDReadBytesFromStreamCallback readBytesFromStream, JsTTDFlushAndCloseStreamCallback flushAndCloseStream, JsThreadServiceCallback threadService, JsRuntimeHandle *runtime);
@@ -195,6 +199,10 @@ struct JsAPIHooks
195
199
JsrtSerializeParserState pfJsrtSerializeParserState;
196
200
JsrtRunScriptWithParserState pfJsrtRunScriptWithParserState;
197
201
202
+ JsrtQueueBackgroundParse pfJsrtQueueBackgroundParse;
203
+ JsrtDiscardBackgroundParse pfJsrtDiscardBackgroundParse;
204
+ JsrtExecuteBackgroundParse pfJsrtExecuteBackgroundParse;
205
+
198
206
JsrtTTDCreateRecordRuntimePtr pfJsrtTTDCreateRecordRuntime;
199
207
JsrtTTDCreateReplayRuntimePtr pfJsrtTTDCreateReplayRuntime;
200
208
JsrtTTDCreateContextPtr pfJsrtTTDCreateContext;
@@ -430,6 +438,10 @@ class ChakraRTInterface
430
438
431
439
static JsErrorCode WINAPI JsSerializeParserState (JsValueRef script, JsValueRef *buffer, JsParseScriptAttributes parseAttributes) { return HOOK_JS_API (SerializeParserState (script, buffer, parseAttributes)); }
432
440
static JsErrorCode WINAPI JsRunScriptWithParserState (JsValueRef script, JsSourceContext sourceContext, JsValueRef sourceUrl, JsParseScriptAttributes parseAttributes, JsValueRef parserState, JsValueRef * result) { return HOOK_JS_API (RunScriptWithParserState (script, sourceContext, sourceUrl, parseAttributes, parserState, result)); }
441
+
442
+ static JsErrorCode WINAPI JsQueueBackgroundParse (JsScriptContents* contents, DWORD* dwBgParseCookie) { return HOOK_JS_API (QueueBackgroundParse (contents, dwBgParseCookie)); }
443
+ static JsErrorCode WINAPI JsDiscardBackgroundParse (DWORD dwBgParseCookie, void * buffer, bool * callerOwnsBuffer) { return HOOK_JS_API (DiscardBackgroundParse (dwBgParseCookie, buffer, callerOwnsBuffer)); }
444
+ static JsErrorCode WINAPI JsExecuteBackgroundParse (DWORD dwBgParseCookie, JsValueRef script, JsSourceContext sourceContext, WCHAR *url, JsParseScriptAttributes parseAttributes, JsValueRef parserState, JsValueRef *result) { return HOOK_JS_API (ExecuteBackgroundParse (dwBgParseCookie, script, sourceContext, url, parseAttributes, parserState, result)); }
433
445
};
434
446
435
447
class AutoRestoreContext
0 commit comments