Граф коммитов

4967 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky 35afbb7590 Bug 1255201. Improve the stack handling in nsXPCComponents_Utils::ReportError for the DOMException case to include the stack from the DOMException. r=bholley 2016-03-11 23:59:10 -05:00
sajitk 823704b8d6 Bug 1219482: Replace PRLogModuleInfo with LazyLogModule in various files.r=benjamin 2016-01-28 10:35:00 -08:00
Jan de Mooij 40172eddb0 Bug 1212328 - Clean up some JSErrorReport-related code. r=Waldo,bz 2016-03-11 15:19:06 +01:00
Boris Zbarsky 692754b232 Bug 1255192 part 2. Clean up the JSContext usage around xpc::FindExceptionStackForConsoleReport now that it just needs a JSContext for rooting. r=bholley 2016-03-09 22:27:14 -05:00
Boris Zbarsky 891b63eeba Bug 1255192 part 1. Remove the JSContext argument of JS::ExceptionStackOrNull. r=bholley 2016-03-09 22:27:13 -05:00
Boris Zbarsky 36d4079be7 Bug 1254847 part 3. Make AutoEntryScript always take ownership of error reporting. r=bholley 2016-03-09 19:02:03 -05:00
Boris Zbarsky 0f63c48348 Bug 1254847 part 1. Take ownership of error reporting on the AutoEntryScript in nsXPCWrappedJSClass::DelegatedQueryInterface. r=bholley
If a QI method throws anything other than NS_NOINTERFACE, we should just report
it and propagate NS_NOINTERFACE out to callers.  And if it throws
NS_NOINTERFACE, then we already clear the pending exception in
nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject, then turn the null return
value into a C++ NS_NOINTERFACE return.
2016-03-09 19:02:03 -05:00
Boris Zbarsky 2e279c21e5 Bug 1254857. Switch the AutoEntryScript in xpc::EvalInSandbox to take ownership of error reporting. r=bholley
In practice we always propagate the exception out anyway, so this change is a no-op.
2016-03-09 15:28:54 -05:00
Boris Zbarsky bf71c8ea5b Bug 1254848 part 3. Take ownership of error reporting on the AutoEntryScript in AsyncScriptLoader::OnStreamComplete. r=bholley
There is no one else who cares about an exception left on the JSContext here: we're coming in off the event loop.
2016-03-09 15:28:42 -05:00
Boris Zbarsky 9c955ac670 Bug 1254848 part 2. Take ownership of error reporting on the AutoEntryScript in mozJSComponentLoader::PrepareObjectForLocation. r=bholley
This is only used for calling JS_FireOnNewGlobalObject, which never throws.
2016-03-09 15:28:41 -05:00
Boris Zbarsky 731f2ec68f Bug 1254848 part 1. Take ownership of error reporting on the AutoEntryScript in mozJSComponentLoader::ObjectForLocation. r=bholley
The code as it stood is a bit weird.  It sets up an AutoJSAPI that takes
ownership of error reporting.  Then later it also sets up an
AutoEntryScript... but keeps using the JSContext it got from the AutoJSAPI.
It's not obvious that there is any guarantee that this matches the JSContext
from the AutoEntryScript!

So we go ahead and change the things that are nominally using the
AutoEntryScript to use it JSContext and take ownership of error reporting on it
explicitly.  If the JSContext is the same as that of the AutoJSAPI, then we were
getting backstopped by its taking ownership of error reporting anyway.  If it's
not, we don't want to leave exceptions dangling on it.
2016-03-09 15:28:33 -05:00
Boris Zbarsky d0363ce0e6 Bug 1254846. Add an AutoEntryScript constructor that takes a JSObject instead of an nsIGlobalObject, for convenience. r=bholley 2016-03-09 15:28:26 -05:00
Mike Shal 053369e67e Bug 1253431 part 7 - Remove SDK_BINARY; r=gps
MozReview-Commit-ID: 4RmjsX966Qh

--HG--
extra : rebase_source : 0d9d94ed98ae8f1cfb9d5787edc1336ce1ee6785
2016-03-03 14:23:57 -05:00
Till Schneidereit dc24ad50e8 Bug 1254968 - Add support for running JS builtins' constructors over Xray wrappers without unwrapping the newTarget. r=bholley,f=bz 2016-02-10 23:09:13 +01:00
Ryan VanderMeulen 0647ba5d93 Bug 1251855 - Adjust expected results if RELEASE_BUILD is set. r=bz
--HG--
extra : rebase_source : e42a352a0a3e50408e0e8e09e7594416bf26cd3d
2016-03-05 16:41:44 -05:00
Boris Zbarsky 8db444c416 Bug 1254393. Take ownership of error reporting on the AutoEntryScript in nsXPCWrappedJSClass::CallMethod. r=bholley
There are several cases to consider in terms of where exceptions might come from
here:

1)  We could have an exception on the JSContext already when we set up the
AutoEntryScript.  In practice this does not happen, and once this change is made
we will add an assert to that effect in AutoJSAPI::InitInternal.  See bug 1112920.

2)  We could have an exception thrown by the XPCCallContext constructor, but it
never does that when initialized, as here, without a JSObject*.

3)  We can have an exception thrown by CallMethod itself, if the callee method
wants a JSContext or optional argc.  This patch switches that to using
CheckForException, which means it will behave exactly like exceptions thrown
from the actual implementation of the method we're calling in terms of how it's
reported and whether it's rethrown to callers, if any.

4)  We can have exceptions thrown various places (e.g. during argument and
retval/outparam conversions) after this point, but those are all under the scope
of the AutoScriptEvaluate, whose destructor will restore the JSContext state to whatever it
was when the AutoScriptEvaluate was created.  Since the AutoScriptEvaluate goes
out of scope before the AutoEntryScript does, there will be no dangling
exception on the JSContext at that point.

5)  We can have exceptions thrown by the actual method call.  Those are
reported, as needed, via CheckForException, and will continue to be so reported.

So in general there are two behavior changes here:

* We now treat the "callee wants JSContext or argc" case as the same as an
  exception from the callee, which is not what we used to do.

* If the object we're calling comes from an inner window whose outer window has
  been torn down, we will now correctly report the exception against that inner
  window.  Before this patch, what happend is that we would init the
  AutoEntryScript with the inner window, but FindJSContext would not find an
  nsIScriptContext on it (since its outer has been torn down), so we would use
  the safe JS context.  Then in xpc::SystemErrorReporter we would check for a
  window associated with the JSContext, not find one, check for an addon sandbox
  current compartment, see we're not in one, and then use the privileged junk
  scope for its error reporting.  The new setup in AutoJSAPI::ReportError checks
  for the current compartent being a window, which of course it is.
2016-03-08 17:21:40 -05:00
Boris Zbarsky 3e5ab54341 Bug 1254230 kinda-fix. Make sure to never send script errors with stacks attached to the console service if the associated windows have already had FreeInnerObjects called on them. r=bholley 2016-03-08 17:21:40 -05:00
Boris Zbarsky 81b9b7ac71 Bug 1254380 part 2. Go ahead and log the stack from our exception in AutoJSAPI::ReportException even if we don't have a window. r=bholley 2016-03-08 17:21:40 -05:00
Boris Zbarsky 3d39097c61 Bug 1254293. Fix dom::GetArrayIndexFromId to actually follow the spec for large indices (i.e. ones that don't fit in in int32_t). r=peterv 2016-03-08 17:21:40 -05:00
Christoph Kerschbaumer 205c4c430e Bug 1254303 - Remove SEC_NORMAL from js/. r=sicking
MozReview-Commit-ID: JhPDn2yZE2g
2016-03-07 14:19:50 -08:00
Morgan Phillips d95ecfa483 Bug 1245877 - Expose error message names via the debugger object; r=jorendorff
--HG--
extra : rebase_source : 87a2c2f682285048be1c57c280f4e3af48b9d524
2016-03-04 12:21:57 -08:00
Luke Wagner b5a255ff58 Bug 1252498 - Baldr: add Wasm object behind pref, default off (r=jorendorff)
MozReview-Commit-ID: BlhrURAX26H

--HG--
extra : rebase_source : e1b540f06c2f3976f91242ac7b0b8ede29fbc5f2
2016-03-03 10:20:21 -06:00
Tracy Walker b37ee8a848 Bug 1242643 - Fix and re-enable /js/xpconnect/tests/browser_dead_object.js by triggering onunload from new/added test page - /js/xpconnect/tests/browser_deadObjectOnUnload.html. Also remove skip-if and added appropriate file support statement to browser.ini r=jimm 2016-03-02 16:13:33 -06:00
Boris Zbarsky 94e65058c3 Bug 1252565 part 1. Push the script environment preparer bits up from XPCJSRuntime to CycleCollectedJSRuntime, because we need them on workers to do ctypes on workers properly. r=bholley 2016-03-02 12:38:24 -05:00
Wes Kocher cba1a7bd55 Backed out 2 changesets (bug 1252565) for windows build bustage CLOSED TREE
Backed out changeset 9de2c10a1cc3 (bug 1252565)
Backed out changeset fc5c4cb02d24 (bug 1252565)

MozReview-Commit-ID: GCQedQwqslg

--HG--
extra : amend_source : 5fb6bd99e2ac56c01c06e1004262dfeb2ea56410
2016-03-02 10:44:11 -08:00
Boris Zbarsky 3baae07268 Bug 1252565 part 1. Push the script environment preparer bits up from XPCJSRuntime to CycleCollectedJSRuntime, because we need them on workers to do ctypes on workers properly. r=bholley 2016-03-02 12:38:24 -05:00
Boris Zbarsky 7aa5d59bc7 Bug 1251518. Fix js::ErrorReportToString to make a bit more sense, and change worker code to not use it anyway, so it matches the mainthread code. r=bholley,terrence 2016-03-01 13:49:21 -05:00
Trevor Saunders 32fdac666f bug 1250486 - get rid of the static ctor for XPCShellImpl.cpp r=bz
The dtor for PersistentRooted<> removes it from a linked list, which means we
need a static ctor to register that dtor with the atexit machinary.  So the
easiest thing to do is make sScriptedInterruptCallback a pointer that points to
a PersistentRootedValue we allocate on the heap.
2016-02-29 08:35:07 -05:00
Trevor Saunders fb15614836 bug 1250486 - make the ComponentsSH ctor constexpr r=bz 2016-02-29 08:35:07 -05:00
Trevor Saunders 079ee8ff2e bug 1250486 - make some xpconnect wrapper ctors constexpr to get rid of static constructors r=bz 2016-02-29 08:35:06 -05:00
Peter Van der Beken 38d879e09d Bug 1248478 - Remove some obsolete code in XrayWrapper.cpp. r=bholley.
--HG--
extra : rebase_source : 3c4aca4a228811f41aebf5b1f3619ee18346aedc
2016-02-16 19:30:49 +01:00
Ms2ger 5ed06a1f77 Bug 1250917 - Remove NS_SUCCESS_I_DID_SOMETHING; r=bholley
It hasn't been used for a while now.
2016-02-25 09:28:06 +01:00
Nathan Froyd 12d9670a60 Bug 1249389 - part 4 - make StartupCache::GetBuffer take a UniquePtr outparam; r=erahm
This change eliminates a number of nsAutoArrayPtr usages, as well as
making the pattern GetBuffer() -> NewObjectInputStreamFromBuffer more
pleasant.
2016-02-18 12:26:28 -05:00
Tom Schuster 331e14186a Bug 1249123 - Add telemetry for __defineGetter__/__defineSetter__ |this| values. data-review=bsmedberg r=till 2016-02-24 13:27:12 +01:00
Shu-yu Guo c80afef075 Bug 912337 - Make a pref to toggle whether DebuggeeWouldRun is a warning or an error. (r=jimb) 2016-02-19 13:46:07 -08:00
Kyle Huey 31dabb4558 Bug 1247117: De-namespace much of IndexedDB. r=baku 2016-02-16 13:46:08 -08:00
Jon Coppeard 37f1ed26f6 Bug 1247955 - Add telemetry for compacting GC r=terrence 2016-02-15 10:37:58 +00:00
Andrea Marchesini 4bf350a0ba Bug 1247122 - Propagate the NS_ERROR_OUT_OF_MEMORY from CycleCollectedJSRuntime CTOR, r=khuey 2016-02-14 13:30:25 +00:00
Nicholas Nethercote 931d190779 Bug 1244841 - Don't measure SharedArrayBuffer objects multiple times. r=lth.
Redoes object element measurement and reporting:

- Adds "non-heap/elements/shared", which reports a (size / refcount)
  measurement. Previously these measurements went into
  "non-heap/elements/mapped" and the full size would be erroneously reported
  for every thread sharing the buffer.

- Renames "non-heap/elements/mapped" as "non-heap/elements/normal".

- Renames "malloc-heap/elements/non-asm.js" as "malloc-heap/elements/normal".

- Leaves "{malloc,non}-heap/elements/asm.js" unchanged.

--HG--
extra : rebase_source : cd1a660000fcb95674b317098be2dfec792b2c8e
2016-02-12 09:18:46 +11:00
Terrence Cole b1f5e5fb23 Bug 1247515 - Check nsScriptErrorWithStack's mStack member for null before tracing; r=mccr8 2016-02-11 10:58:02 -08:00
Nicholas Nethercote 462eb9a0d4 Bug 1245737 (part 2) - Don't bother measuring DtoaState. r=bhackett.
It's gone from 4,096 bytes per JS thread to 72 bytes per thread. (Also, the
old code only measured the DtoaState for the main thread.)

--HG--
extra : rebase_source : bfe0772b8c760a45ca3665e2c0939b121189520a
2016-02-05 14:50:55 +11:00
Carsten "Tomcat" Book b8f6140f54 merge mozilla-inbound to mozilla-central a=merge 2016-02-10 11:47:34 +01:00
Nicholas Nethercote ff840e5f16 Bug 1246855 (part 2) - Measure CompartmentPrivates during memory reporting. r=terrence.
This also expands the coverage to include the hash table elements in the
mWrappedJSMap.
2016-02-10 08:41:38 +11:00
Nicholas Nethercote 2684992fcd Bug 1246855 (part 1) - Remove the in-advance measurement of CompartmentPrivates. r=terrence.
Measuring in advance confuses DMD. It's better to measure during reporting.
The next patch will reinstate the measurement, but during reporting.
2016-02-10 08:36:35 +11:00
Carsten "Tomcat" Book b4793d108a Merge mozilla-central to fx-team 2016-02-09 13:10:45 +01:00
Alexandre Poirot b17d42cf5c Bug 1141222 - Create ScriptError with stack from Cu.reportError. r=bholley 2016-02-09 02:50:16 -08:00
Myk Melez a6aff185d2 Bug 1238576 - disable mozApps API on desktop/Android; r=ehsan,ochameau,bz,mcmanus,jmaher,marco 2016-02-08 11:24:22 -08:00
Boris Zbarsky 5289b5b26f Bug 1243824. Add support for static functions and attributes on JSXrays. r=bholley 2016-02-05 10:41:08 -05:00
Bobby Holley 49d2ca1cfe Bug 1244222 - Tests. r=bz 2016-02-09 14:55:52 -08:00
Bobby Holley 461355d146 Bug 1244222 - Check for function interfaces in DelegatedQueryInterface. r=bz 2016-02-09 14:55:49 -08:00