Commit Graph

63 Commits

Author SHA1 Message Date
Ehsan Akhgari
8c296bbcd4 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00
Bobby Holley
e80993f0d4 Bug 695292 - Port SimpleTest.executeSoon() to SpecialPowers. r=mrbkap
If we just naively use the thread manager to dispatch the event via SpecialPowers,
we cannot avoid the XPCWrappedJS for the runnable being in chrome scope (even if
we pass a content object, we make the call in chrome scope, so we pass a cross-
compartment wrapper). This means that the machinery in
nsXPCWrappedJSClass::CheckForException ends up calling the error reporter for the
SpecialPowers scope, which isn't what we want.

Messing around with the implementation of CheckForException is playing with fire.
So we work around this with an explicit Cu API. :-(
2012-08-17 15:13:23 -07:00
Phil Ringnalda
d8f4aa9d3c Back out e6761635f9cf (bug 695292) for Android mochitest bustage on a CLOSED TREE 2012-08-16 21:35:53 -07:00
Bobby Holley
5a6f34eba3 Bug 695292 - Port SimpleTest.executeSoon() to SpecialPowers. r=mrbkap
If we just naively use the thread manager to dispatch the event via SpecialPowers,
we cannot avoid the XPCWrappedJS for the runnable being in chrome scope (even if
we pass a content object, we make the call in chrome scope, so we pass a cross-
compartment wrapper). This means that the machinery in
nsXPCWrappedJSClass::CheckForException ends up calling the error reporter for the
SpecialPowers scope, which isn't what we want.

Messing around with the implementation of CheckForException is playing with fire.
So we work around this with an explicit Cu API. :-(
2012-08-16 18:33:27 -07:00
Aryeh Gregor
982100775b Bug 780618 - Move all error codes to nsError.h; r=ehsan 2012-07-27 17:03:27 +03:00
Kyle Huey
018dc47367 Bug 781700: Don't hold strong references to databases from the synchronization queue, so that GCing a database will unblock waiting operations. r=bent
--HG--
extra : rebase_source : 2f1b2405ffc91831d33eb91e4b2d61c2b1ac872b
2012-08-10 09:15:02 -07:00
Mike Hommey
c1b35e7b2a Bug 774032 bonus - Use @DEPTH@ and @relativesrcdir@ in Makefile.in. r=ted 2012-08-04 20:26:44 +02:00
Bobby Holley
75f3cd7c86 Bug 773962 - Introduce Cu.recomputeWrappers. r=mrbkap
It's sort of annoying to add this API just for tests, but there's not another
great way to trigger a compartment-wide transplant with Xray waivers
(since setting document.domain doesn't recompute wrappers to/from chrome, and
Xray waivers will stop being accessible to content entirely in bug 742444).
2012-07-23 15:51:18 +02:00
Justin Lebar
2170f814d5 Bug 773980 - Add Components.utils.isDeadWrapper. r=bholley
--HG--
rename : js/xpconnect/tests/Makefile.in => js/xpconnect/tests/browser/Makefile.in
2012-07-19 12:39:43 -04:00
Gabor Krizsanits
ce3fab5c93 Bug 769273 - part3: Cu.nukeSandbox. r=bholley 2012-07-17 17:41:07 +02:00
Olli Pettay
6e882d2abe Bug 773803 - Remove nsIScriptObjectOwner, r=bz
--HG--
rename : dom/base/nsIScriptObjectOwner.h => dom/base/nsIScriptEventHandlerOwner.h
2012-07-14 01:23:59 +03:00
Bobby Holley
f3dc2d0945 Bug 771202 - Add a PostTransplant nsIXPCScriptable hook. r=peterv 2012-07-13 10:55:14 +02:00
Kyle Huey
d1532c7382 Bug 765936. r=bent,peterv 2012-07-06 10:28:51 -07:00
Bill McCloskey
0dd01290a1 Bug 758034 - Clean up browser GC API (r=smaug) 2012-06-30 14:16:32 -07:00
Bobby Holley
e673afa8f2 Bug 755255 - Hoist pending exception junk into XPCJSRuntime. r=mrbkap 2012-06-21 16:14:49 +02:00
Fabrice Desré
7a73ff8ad0 Bug 766378 - adds a createArrayIn() call to create JS arrays in a given scope [r=mrbkap] 2012-06-19 16:54:46 -07:00
Ms2ger
587f726fbe Bug 762436 - Get rid of the nsresult return value for nsIXPCScriptable::GetScriptableFlags(); r=mrbkap 2012-06-17 10:11:16 +02:00
Gervase Markham
638c878b13 Bug 759095 - upgrade license to MPL 2, and other licensing cleanups.
--HG--
extra : rebase_source : da55a4937383eda2baf7c9a362501da8ee664146
2012-05-29 16:52:43 +01:00
Gervase Markham
87620f5676 Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00
Andrew Paprocki
e565d0e693 Bug 736792 - Add JSOPTION_STRICT_MODE for embedders to force ES5 strict mode for all code without requiring "use strict" annotations. r=njn 2012-05-05 15:26:16 -04:00
Ms2ger
9a5ae693e0 Bug 741245 - Remove nsresult return value from nsXPConnect::GetSafeJSContext(); r=bholley 2012-05-05 11:00:05 +02:00
Ms2ger
cdc1f73263 Bug 741347 - Remove nsIXPConnect::DefineDOMQuickStubs, call DOM_DefineQuickStubs directly instead; r=bholley 2012-04-14 15:05:17 +02:00
Ms2ger
b8ae2456b2 Backing out bf0a78471e5e:dc7022e2d807 for inexplicable windows crashes. 2012-04-14 17:52:34 +02:00
Ms2ger
bd900a0e7f Bug 741347 - Remove nsIXPConnect::DefineDOMQuickStubs, call DOM_DefineQuickStubs directly instead; r=bholley 2012-04-14 15:05:17 +02:00
Ms2ger
9f95d23e65 Bug 741245 - Remove nsresult return value from nsXPConnect::GetSafeJSContext(); r=bholley 2012-04-14 15:05:01 +02:00
Ms2ger
488b5263dd Merge m-c to m-i. 2012-04-09 09:32:28 +02:00
Igor Bukanov
d3018bc6d8 Bug 737364 - part 2 - replace JSContext with JSRuntime in the GC-related API
This part replaces the JSContext *cx argument in most GC-related API
with JSRuntime *rt. When possible, the patch removes the code to obtain
a temporary cx just to run the GC.

The patch also removes JS_DestroyContextMaybeGC. That function is not
used in FF code base and its implementation is broken. It requires that
the context has an entered compartment when it is destroyed, which in
turns implies a missing leave compartment call.
2012-03-28 12:13:30 +02:00
Kyle Huey
c06dcdfb58 Fix Bug 743376. r=bz 2012-04-06 17:44:50 -07:00
Igor Bukanov
3a859b7a76 Bug 737365 - stop using the cx during finalization, part 1.
This part changes the signatures for various finalization API to take
not JSContext* but rather either JSFreeOp structure or its
library-private counterpart FreeOp. These structures wrap parameters
that are passed to the finalizers removing most of explicit dependencies
on JSContext in the finalization code.
2012-03-19 15:34:55 +01:00
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
Bill McCloskey
8317610173 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
Bobby Holley
73485885f8 Bug 720580 - Do the last bit of wrapped global initialization once the dust has settled. r=mrbkap 2012-03-05 15:22:45 -08:00
Bobby Holley
d3868262e8 Bug 720580 - Stop passing aExtraPtr to InitClassesWithNewWrapedGlobal. r=mrbkap
We only ever pass null here anyway, and this whole infrastructure is going away real soon now.
2012-03-05 15:22:44 -08:00
Bobby Holley
1a5208e617 Bug 720580 - Remove unnecessary aIID parameter from nsIXPConnect::InitClassesWithNewWrappedGlobal. r=mrbkap 2012-03-05 15:22:44 -08:00
Bobby Holley
a7519fcb64 Bug 720580 - Introduce a flag for global natives and assert that we have it. r=mrbkap 2012-03-05 15:22:44 -08:00
Bobby Holley
b1d50a8c93 Bug 720580 - Indicate free bits in nsIXPCScriptable.idl. r=mrbkap 2012-03-05 15:22:43 -08:00
Bill McCloskey
6b3aa0565d Bug 641025 - Incremental GC (r=igor,smaug,roc,cdleary,gregor) 2012-02-17 14:35:20 -08:00
Bill McCloskey
502e67c72c Bug 706227 - Add way for JS_GC API users to give detailed reason for invocation (r=mccr8) 2012-01-25 10:59:55 -08:00
John Schoenick
e58ad87df1 Bug 718899 - Implement Cu.forceShrinkingGC / Cu.schedulePreciseShrinkingGC r=gwagner 2012-01-19 10:58:25 -08:00
Bill McCloskey
10193ec801 Bug 714418 - Remove nsIXPCScriptable::DONT_SHARE_PROTOTYPE (r=bholley, sr=mrbkap) 2012-01-04 14:13:20 -08:00
Bill McCloskey
2971953b5e Bug 714353 - Remove nsIXPCScriptable::Trace (r=mrbkap) 2012-01-04 14:13:15 -08:00
Bill McCloskey
488641b46d Bug 714350 - Remove nsXPConnect::RestoreWrappedNativePrototype (r=mrbkap) 2012-01-04 14:13:08 -08:00
Boris Zbarsky
00746e91ea Backing out bug 707717 because it seems to be a perf hit, not a perf win. 2011-12-28 16:22:05 -05:00
Boris Zbarsky
8a05054a41 Bug 707717. Don't dynamically mutate the proto chains of DOM prototypes. r=peterv 2011-12-26 11:31:07 -05:00
aceman
42a71aa907 Bug 711721 - merge nsIScriptError and nsIScriptError2 interfaces; r=neil, sr=bzbarsky 2011-12-21 16:51:29 -05:00
Ms2ger
fecfdf8492 Bug 708330 - Use IDL for Components.utils.getWeakReference; r=bholley 2011-12-18 11:11:56 +01:00
Ms2ger
07b93b8f80 Bug 708326 - Use IDL for Components.utils.forceGC; r=bholley 2011-12-18 11:11:23 +01:00
Ms2ger
39999e4c63 Bug 708253 - Use IDL for Components.(utils.)reportError; r=bholley 2011-12-18 11:10:59 +01:00
Ms2ger
f96b5a8d5b Bug 705355 - Use IDL for Components.utils.evalInSandbox; r=bholley 2011-12-18 11:09:56 +01:00
Ms2ger
edaf8cc36e Bug 705188 - Use IDL for mozIJSSubScriptLoader::LoadSubScript, {xpcIJSModuleLoader,nsIXPCComponents_Utils}::Import; r=bz 2011-12-18 11:09:16 +01:00