gecko/js/xpconnect
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
..
crashtests Bug 705875 - Check for null IID pointers and references in XPCConvert. r=khuey 2011-12-01 18:24:28 -08:00
idl bug 730221 - delegating serialization of script principals to the embedding. r=:luke,:bz 2012-02-13 14:10:04 +01:00
loader bug 730221 - delegating serialization of script principals to the embedding. r=:luke,:bz 2012-02-13 14:10:04 +01:00
public Bug 714353 - Remove nsIXPCScriptable::Trace (r=mrbkap) 2012-01-04 14:13:15 -08:00
shell Remove JS_GetScriptedCaller (bug 732652, r=luke,mrbkap,bholley,smaug,bent). 2012-03-06 15:33:12 -08:00
src bug 730221 - delegating serialization of script principals to the embedding. r=:luke,:bz 2012-02-13 14:10:04 +01:00
tests Bug 735544 - Allow exception stacks to cross compartment boundaries. r=luke 2012-03-15 15:19:52 -07:00
wrappers bug 736978 - remove JS_FinalizeStub. r=:billm 2012-03-19 15:27:58 +01:00
Makefile.in Bug 691411 - Move js/src/xpconnect to js/xpconnect and rename source files while we're at it. r=khuey, sr=mrbkap 2011-10-14 10:52:47 -07:00