script: Impl cloning of JSPrincipals (#32706)

* Impl cloning of JSPrincipals

* bincode as workspace dependency

* Update mozjs and cc
This commit is contained in:
Samson 2024-07-06 12:25:38 +02:00 committed by GitHub
parent 5a9dc98f07
commit 59d0f1fe1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 77 additions and 15 deletions

View file

@ -30,12 +30,12 @@ use js::jsapi::{
GetPromiseUserInputEventHandlingState, HandleObject, Heap, InitConsumeStreamCallback,
InitDispatchToEventLoop, JSContext as RawJSContext, JSGCParamKey, JSGCStatus,
JSJitCompilerOption, JSObject, JSSecurityCallbacks, JSTracer, JS_AddExtraGCRootsTracer,
JS_InitDestroyPrincipalsCallback, JS_RequestInterruptCallback, JS_SetGCCallback,
JS_SetGCParameter, JS_SetGlobalJitCompilerOption, JS_SetOffthreadIonCompilationEnabled,
JS_SetParallelParsingEnabled, JS_SetSecurityCallbacks, JobQueue, MimeType,
PromiseRejectionHandlingState, PromiseUserInputEventHandlingState, SetDOMCallbacks,
SetGCSliceCallback, SetJobQueue, SetPreserveWrapperCallbacks, SetProcessBuildIdOp,
SetPromiseRejectionTrackerCallback, StreamConsumer as JSStreamConsumer,
JS_InitDestroyPrincipalsCallback, JS_InitReadPrincipalsCallback, JS_RequestInterruptCallback,
JS_SetGCCallback, JS_SetGCParameter, JS_SetGlobalJitCompilerOption,
JS_SetOffthreadIonCompilationEnabled, JS_SetParallelParsingEnabled, JS_SetSecurityCallbacks,
JobQueue, MimeType, PromiseRejectionHandlingState, PromiseUserInputEventHandlingState,
SetDOMCallbacks, SetGCSliceCallback, SetJobQueue, SetPreserveWrapperCallbacks,
SetProcessBuildIdOp, SetPromiseRejectionTrackerCallback, StreamConsumer as JSStreamConsumer,
};
use js::jsval::UndefinedValue;
use js::panic::wrap_panic;
@ -466,6 +466,7 @@ unsafe fn new_rt_and_cx_with_parent(
JS_SetSecurityCallbacks(cx, &SECURITY_CALLBACKS);
JS_InitDestroyPrincipalsCallback(cx, Some(principals::destroy_servo_jsprincipal));
JS_InitReadPrincipalsCallback(cx, Some(principals::read_jsprincipal));
// Needed for debug assertions about whether GC is running.
if cfg!(debug_assertions) {