gecko/js/xpconnect/idl
Igor Bukanov 5542df3342 bug 730221 - delegating serialization of script principals to the embedding. r=:luke,:bz
Currently to serialize principals stored in JSScript we have a rather complex
schema. First there is the transcode callback that the embedding must provide
to transcode principals using XDR API. Second we use rather complex glue code
to implement that callback in terms of writing/reading nsIObjectOutputStream/
nsIObjectInputStream. This glue code is duplicated in 3 places. All this can
be avoided if we simply delegate transcoding of principals to the caller. In
addition, at least in the case of the cached startup scripts we do not even
need to transcode the principals as the the cached scripts always have the
system principal so we can skip all the transcode complexity there.

The patch implemnts this idea. In particular, the code in JS engine
responsible for transcoding of principals is replaced by the single API
function JS_XDRSetPrincipals that the embedding can use to set principals for
decoded scripts and functions. Then the startup cache uses this to set the
principals for the decoded script to the system principals. The other two
places in nsJSContext::Serialize and  XBL_SerializeFunction that need to
serialize principals together with a function or script now uses common
utilities in nsXPConnect so the serialization complexity resides in the single
 place.
2012-02-13 14:10:04 +01:00
..
Makefile.in
mozIJSSubScriptLoader.idl Bug 705188 - Use IDL for mozIJSSubScriptLoader::LoadSubScript, {xpcIJSModuleLoader,nsIXPCComponents_Utils}::Import; r=bz 2011-12-18 11:09:16 +01:00
nsIJSContextStack.idl
nsIJSEngineTelemetryStats.idl
nsIJSRuntimeService.idl
nsIScriptError.idl Bug 711721 - merge nsIScriptError and nsIScriptError2 interfaces; r=neil, sr=bzbarsky 2011-12-21 16:51:29 -05:00
nsIXPConnect.idl bug 730221 - delegating serialization of script principals to the embedding. r=:luke,:bz 2012-02-13 14:10:04 +01:00
nsIXPCScriptable.idl Bug 720580 - Introduce a flag for global natives and assert that we have it. r=mrbkap 2012-03-05 15:22:44 -08:00
nsIXPCScriptNotify.idl
nsIXPCSecurityManager.idl
xpccomponents.idl Bug 729369 - Expose the same set of SpiderMonkey testing APIs to debug shell and debug browser chrome (r=Waldo) 2012-03-06 11:38:44 -08:00
xpcexception.idl
xpcIJSGetFactory.idl
xpcIJSModuleLoader.idl Bug 705188 - Use IDL for mozIJSSubScriptLoader::LoadSubScript, {xpcIJSModuleLoader,nsIXPCComponents_Utils}::Import; r=bz 2011-12-18 11:09:16 +01:00
xpcIJSWeakReference.idl Bug 705320 - Use IDL for xpcIJSWeakReference.get; r=bholley 2011-11-26 11:32:03 +01:00
xpcjsid.idl Bug 705333 - Use IDL for nsJSCID::{CreateInstance,GetService}; r=bholley 2011-12-03 22:50:16 +01:00