Commit Graph

485 Commits

Author SHA1 Message Date
Jared Wein
ac11ea4de6 Bug 730318 - Implement a way for chrome js to enumerate the plugin objects on a page for activation. r=khuey 2012-03-28 08:53:56 -07:00
Jared Wein
a80b6db592 Backed out changeset 8e42ba558f07 (bug 730318) CLOSED TREE 2012-03-27 15:23:53 -07:00
Jared Wein
883053cd10 Bug 730318 - Implement a way for chrome js to enumerate the plugin objects on a page for activation. r=khuey 2012-03-27 13:50:50 -07:00
Andrew McCreight
d1c47fdce5 Bug 736563 - mark global objects held by live windows black during GC. r=smaug 2012-03-27 12:22:10 -07:00
Gregor Wagner
ec5cd78551 Bug 678695 - Settings API. r=sicking, fabrice, smaug 2012-03-26 14:49:38 -07:00
Bobby Holley
e3df69dd0f Bug 738874 - Don't allow non-classinfo XPCWNs to be wrapped cross-compartment. r=mrbkap 2012-03-25 22:35:50 -07:00
Makoto Kato
a41e6dd26b Bug 716333 - get rid of WithConversion (xpconnect part). r=bholley 2012-03-26 14:12:15 +09:00
Igor Bukanov
7296e0408c bug 737624 - memory-only encoding/decoding of scripts and functions. r=:luke
The patch shrinks the API presented in jsxdrapi.h down to 4 functions to
encode/decode scripts and interpreted functions to/from the memory. The
newly introduced implementation header vm/Xdr.h replaces the former
JSXDRState with the template class XDRState parametrized by the enum
type with two constants, XDR_ENCODE and XDR_DECODE. This way a compiler
can fully eliminate the former runtime checks for the decoding/encoding
mode. As a drawback this required to explicitly instantiate the xdr
implementation as I do not want to put all the xdr code to header files.

The memory-only XDR allows to avoid coping filename and to-be-atomized
chars to a temporary buffer as the code can just access the buffer
directly. Another change is that new XDRScript takes as a parameter its
parent script. This allowed to avoid keeping filename in XDRState and
simplify the filename management.

Another change is the removal of JS_HAS_HDR. As CloneScript uses XDR to
copy a script, JS_HAS_XDR cannot be disabled.

--HG--
rename : js/src/jsxdrapi.cpp => js/src/vm/Xdr.cpp
extra : rebase_source : f8f1536a86b7c3fe7296a16b6677bd21664af98a
2012-02-20 11:58:00 +01:00
Matt Brubeck
f83a9ab93e Merge mozilla-central and mozilla-inbound 2012-03-24 09:05:27 -07:00
Masatoshi Kimura
9177b368f2 Bug 736686 - Part 1: Make dictionary initializers callable off main thread. r=khuey 2012-03-24 12:33:49 +01:00
Dão Gottwald
766a2b3244 Backed out changeset 30798fdc5bad 2012-03-24 12:33:30 +01:00
Peter Van der Beken
6fd0c1b877 Bug 738593 - Rename IsProxy to IsDOMBinding; r=mrbkap 2012-03-16 16:44:09 +01:00
Ms2ger
679b93a7ba Bug 736619 - remove the unused struct ClearedGlobalObject from XPCJSRuntime; r=bholley 2012-03-24 09:18:22 +01:00
Jared Wein
3f49c23fdd Backed out changeset 5f79a3dd45ff (bug 730318) r=bustage 2012-03-23 11:46:12 -07:00
Jared Wein
61ab14237c Bug 730318 - Implement a way for chrome js to enumerate the plugin objects on a page for activation. r=khuey 2012-03-22 13:53:59 -07:00
Hessam Salehi
25b8143afe Bug 474505 - Replace uses of nsVoidPtrHashkey with nsPtrHashKey<T>; r=bsmedberg 2012-03-21 14:07:31 -04:00
Igor Bukanov
f8a4496d31 bug 737624 - memory-only encoding/decoding of scripts and functions. r=:luke
The patch shrinks the API presented in jsxdrapi.h down to 4 functions to
encode/decode scripts and interpreted functions to/from the memory. The
newly introduced implementation header vm/Xdr.h replaces the former
JSXDRState with the template class XDRState parametrized by the enum
type with two constants, XDR_ENCODE and XDR_DECODE. This way a compiler
can fully eliminate the former runtime checks for the decoding/encoding
mode. As a drawback this required to explicitly instantiate the xdr
implementation as I do not want to put all the xdr code to header files.

The memory-only XDR allows to avoid coping filename and to-be-atomized
chars to a temporary buffer as the code can just access the buffer
directly. Another change is that new XDRScript takes as a parameter its
parent script. This allowed to avoid keeping filename in XDRState and
simplify the filename management.

Another change is the removal of JS_HAS_HDR. As CloneScript uses XDR to
copy a script, JS_HAS_XDR cannot be disabled.

--HG--
rename : js/src/jsxdrapi.cpp => js/src/vm/Xdr.cpp
2012-02-20 11:58:00 +01:00
Ms2ger
8775c56114 Backed out changeset f33e1e959036; r=bustage 2012-03-24 11:04:34 +01:00
Igor Bukanov
8e97874303 bug 737624 - memory-only encoding/decoding of scripts and functions. r=:luke
The patch shrinks the API presented in jsxdrapi.h down to 4 functions to
encode/decode scripts and interpreted functions to/from the memory. The
newly introduced implementation header vm/Xdr.h replaces the former
JSXDRState with the template class XDRState parametrized by the enum
type with two constants, XDR_ENCODE and XDR_DECODE. This way a compiler
can fully eliminate the former runtime checks for the decoding/encoding
mode. As a drawback this required to explicitly instantiate the xdr
implementation as I do not want to put all the xdr code to header files.

The memory-only XDR allows to avoid coping filename and to-be-atomized
chars to a temporary buffer as the code can just access the buffer
directly. Another change is that new XDRScript takes as a parameter its
parent script. This allowed to avoid keeping filename in XDRState and
simplify the filename management.

Another change is the removal of JS_HAS_HDR. As CloneScript uses XDR to
copy a script, JS_HAS_XDR cannot be disabled.

--HG--
rename : js/src/jsxdrapi.cpp => js/src/vm/Xdr.cpp
2012-02-20 11:58:00 +01:00
Bobby Holley
5213bf72dd Bug 733984 - Explicitly disallow shadowing on location wrappers. r=mrbkap
This was taken care of in other ways before, but we need to be more explicit about it now that we're doing more Xray stuff with Location wrappers.
2012-03-23 15:58:18 -07:00
Bobby Holley
f8fe97314f Bug 667388 - Introduce the PUNCTURE wrapper action. r=mrbkap 2012-03-23 14:59:27 -07:00
Bobby Holley
563b97de8f Bug 667388 - Make the chrome-to-content Xray wrapper derive CrossCompartmentWrapper. r=mrbkap
The current situation seems incorrect, especially given the behavior of CrossOriginWrapper and XrayProxy. Currently it doesn't matter, but it probably will in the future.
2012-03-23 14:59:27 -07:00
Bobby Holley
4a0cc78ae2 Bug 733984 - Apply Location wrappers for same-origin cross-compartment wrapping. r=mrbkap
This isn't an issue right now, since it can't ever happen outside of sandboxes, which content can't use. But if it could, it could get a pure CrossCompartmentWrapper to a Location object, which is bad.
2012-03-23 14:59:23 -07:00
Bobby Holley
da79fb87b2 Bug 733984 - Use the Location security policy even for content accessing chrome. r=mrbkap
I'm adding asserts about when we do and don't have a Location object behind the wrapper, and this case was hitting them. What we do here doesn't so much matter given how this stuff all works. On the one hand, statically using a restrictive policy is slightly more defense-in-depth. On the other hand, if this stuff is broken we're screwed in much more serious ways than content reading chrome locations, and using a consistent wrapper scheme allows us to make stronger asserts and assumptions.

I opted for stronger assumptions and more understandable security code. If Blake feels strongly though, I could go the other way and sprinkle '|| isChrome(obj)' throughout the asserts though.
2012-03-23 14:59:19 -07:00
Bobby Holley
1b0610af05 Bug 733984 - Clarify the security characteristics of Location objects. r=mrbkap
I was getting confused by some of the naming and lack of comments here.
2012-03-23 14:59:07 -07:00
Bobby Holley
ac2c44ee09 Bug 733984 - Stop specializing createHolder, and simplify holder creation in WrapperFactory::Rewrap. r=mrbkap 2012-03-23 14:59:04 -07:00
Jared Wein
3c05f07191 Backed out changeset 5f79a3dd45ff (bug 730318) r=bustage 2012-03-23 11:11:31 -07:00
Igor Bukanov
fbeb82e29f 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
Igor Bukanov
877dee50e1 bug 736978 - remove JS_FinalizeStub. r=:billm
Currently the GC finalizes on the background thread only objects with null
JSClass::finalize. However, this implies that any object that uses
JS_FinalizeStub for the finalizer would be prevented from the background
finalization.

To fix this the patch removes JS_FinalizeStub replacing it with NULL in all
cases when the class has no custom finalizer. For style consistency the patch
also removed the usage of JSCLASS_NO_OPTIONAL_MEMBERS in the static
declarations as the compiler fills the missing fields with null in any cases.
2012-03-19 15:27:58 +01:00
Prabindh Sundareson
b62d17df9a Bug 735594 - Add check for MOZ_JSDEBUGGER so that --enable-jsd=no works. r=bholley+khuey 2012-03-15 20:12:45 -04:00
Bobby Holley
7aa891a8c8 Bug 734475 - Take the full union of native sets when bringing non-PreCreate XPWNs across compartments. r=mrbkap 2012-03-16 12:47:20 -07:00
Peter Van der Beken
526e189372 Fix for bug 736229 (Stop storing expando objects in the wrapper cache, store the proxy instead). r=jst. 2012-03-14 15:22:10 +01:00
Marco Bonardo
ff249f47c5 Merge inbound and central 2012-03-16 13:42:16 +01:00
Ms2ger
126a61ae1e Bug 722154 - Part f: Remove custom quickstubs for vertexAttrib[1-4]fv; r=bjacob 2012-03-16 10:53:41 +01:00
Ms2ger
0fa822c551 Bug 722154 - Part e: Remove custom quickstubs for uniform[1-4][i,f]v and uniformMatrix[2-4]fv; r=bjacob 2012-03-16 10:52:42 +01:00
Ms2ger
6c8b1e6b1c Bug 722154 - Part d: Remove custom quickstub for readPixels; r=bjacob 2012-03-16 10:50:51 +01:00
Ms2ger
9fe057f15e Bug 722154 - Part c: Remove custom quickstubs for compressedTexImage2D and compressedTexSubImage2D; r=bjacob 2012-03-16 10:50:33 +01:00
Ms2ger
475f50510f Bug 722154 - Part b: Remove custom quickstub for bufferSubData; r=bjacob 2012-03-16 10:50:18 +01:00
Ms2ger
3b2c005617 Bug 722154 - Part a: Remove custom quickstub for bufferData; r=bjacob 2012-03-16 10:50:00 +01:00
Ms2ger
90fe48b371 Bug 550309 - Part e: Remove custom quickstub for getImageData and return an actual ImageData; r=bz 2012-03-16 10:48:55 +01:00
Ms2ger
364d2a12d3 Bug 550309 - Part c: Implement ImageData; r=bz 2012-03-16 10:44:08 +01:00
Bobby Holley
6261b39dd3 Bug 736316 - Components.utils.getGlobalForObject should unwrap cross-compartment wrappers. r=khuey 2012-03-15 19:47:06 -07:00
Ryan VanderMeulen
4c60195e21 Backout ca1873b20652 (bug 735594) due to mochitest-4 orange. r=http://i.qkme.me/36kr7a.jpg 2012-03-15 21:27:51 -04:00
Prabindh Sundareson
fd437e4fad Bug 735594 - Add check for MOZ_JSDEBUGGER so that --enable-jsd=no works. r=bholley 2012-03-15 20:12:45 -04:00
Blake Kaplan
7a4eeff601 Bug 727884 - Make nsWrapperCache::WrapObject take a JSObject scope instead of XPCWrappedNativeScope. r=peterv 2012-03-14 16:25:40 +01:00
Ekanan Ketunuti
6dd7569b81 Bug 722180 - Remove error codes for proxies. r=khuey 2012-02-01 18:53:29 +07:00
Bobby Holley
c9729c8e9a Bug 735544 - Allow exception stacks to cross compartment boundaries. r=luke 2012-03-15 15:19:52 -07:00
Kyle Huey
3232e8df17 No bug: Fix ply being stupid, take 2. r=me 2012-03-13 10:31:53 -07:00
Marco Bonardo
3e58667468 Merge last green PGO from inbound to central 2012-03-13 11:17:21 +01:00
Masatoshi Kimura
e441461b51 Bug 721569 - Implement Blob constructor. r=sicking 2012-03-12 21:44:56 -07:00