Commit Graph

90 Commits

Author SHA1 Message Date
Wes Kocher
ea76ed99d7 Backed out changeset 95494e68c722 (bug 1177488) for crashes in test_bug732665.xul CLOSED TREE
MozReview-Commit-ID: IFUHUBUCnCD
2016-03-25 12:11:48 -07:00
Nathan Froyd
418aa2af4f Bug 1177488 - use |const char*| for representing async call reasons; r=bz,fitzgen
Using a simple |const char*| is more memory-efficient than allocating a
JS string. We still have to allocate the JS string for passing things
into JS, but ideally we will be able to move the point of allocation
much closer to where it's actually needed, rather than indiscriminantly
doing it all the time.
2016-03-23 10:40:53 -04:00
Boris Zbarsky
e3b2de6aa9 Bug 1255817 part 2. Get rid of AutoJSAPI::OwnsErrorReporting and AutoJSAPI::TakeOwnershipOfErrorReporting. r=bholley 2016-03-23 11:44:54 -04:00
Boris Zbarsky
865750a216 Bug 1255817 part 1. Make AutoJSAPI always take ownership of error reporting. r=bholley 2016-03-23 11:44:54 -04:00
Boris Zbarsky
08a17f586c Bug 1257725 part 6. Get rid of ThreadsafeAutoJSContext. r=bholley 2016-03-23 11:02:57 -04:00
Boris Zbarsky
172598b4e2 Bug 1257335. Replace some AutoSafeJSContext uses with AutoJSAPI or AutoJSContext uses. r=bholley
In general, using an AutoJSAPI inited with an object is NOT the same as using
AutoSafeJSContext (or AutoJSAPI inited without an object) and then entering the
compartment of the object: the former will report exceptions to the global of
the object as it comes off the stack, while the latter will not.  This only
really matters if we have an object from a window or worker global and hence
might fire error events, or report internal stuff to the web console.

The changes to initing with an object made in this bug are OK for the following
reasons:

1) dom/base/Console.cpp: Always clears its exception before coming off the stack.
2) dom/base/nsDOMClassInfo.cpp: Inits with a non-web global.
3) dom/base/nsFrameMessageManager.cpp: Inits with a non-web global.
4) dom/media/MediaPermissionGonk.cpp: We probably want the caller to notice if
   anything here throws.
5) dom/xbl/nsXBLPrototypeBinding.cpp: Inits with a non-web global.
6) dom/xul/nsXULElement.cpp: Inits with a non-web global.
7) extensions/pref/autoconfig/src/nsJSConfigTriggers.cpp: Inits with a non-web global.
8) ipc/testshell/XPCShellEnvironment.cpp: Inits with a non-web global.
2016-03-18 10:48:38 -04:00
Boris Zbarsky
770278cde1 Bug 1257306. Simplify the implementation of AutoSafeJSContext (and therefore AutoJSContext, since AutoSafeJSContext will no longer be an AutoJSContext). r=bholley 2016-03-17 23:23:55 -04:00
Boris Zbarsky
3ff438ab43 Bug 1256424. Get rid of ThreadsafeAutoSafeJSContext. r=bholley 2016-03-14 20:48:39 -04:00
Wes Kocher
168746512d Backed out changeset ee3c99e6f676 (bug 1177488) for LeakSanitizer failures
MozReview-Commit-ID: FFfF4u2vOrS

--HG--
extra : rebase_source : 0c7f5e290b388b2f35837a5f757f2d962b973da3
2016-03-14 13:15:21 -07:00
Nathan Froyd
6b6c2a1fcd Bug 1177488 - use |const char*| for representing async call reasons; r=bz,fitzgen
Using a simple |const char*| is more memory-efficient than allocating a
JS string.  We still have to allocate the JS string for passing things
into JS, but ideally we will be able to move the point of allocation
much closer to where it's actually needed, rather than indiscriminantly
doing it all the time.
2016-03-08 16:29:25 -05:00
Boris Zbarsky
c1e007e11b Bug 1255181. Remove AutoJSAPI::InitWithLegacyErrorReporting. r=bholley 2016-03-09 19:02:25 -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
Kyle Huey
91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Boris Zbarsky
89a6485e7f Bug 1172246. Make sure CallSetup's handling of exceptions it wants to deal with itself works even when the callable is a JSNative that uses the JS_Report*Error APIs instead of throwing exceptions in the usual way. r=bholley 2015-06-08 16:16:27 -04:00
Boris Zbarsky
888bc2d651 Back out bug 1172246 because of mochitest-JP bustage. Who needs tests that we care about running on try anyway? 2015-11-20 18:00:27 -05:00
Boris Zbarsky
bc25c907d6 Bug 1172246. Make sure CallSetup's handling of exceptions it wants to deal with itself works even when the callable is a JSNative that uses the JS_Report*Error APIs instead of throwing exceptions in the usual way. r=bholley 2015-06-08 16:16:27 -04:00
Nikhil Marathe
6ecbcec387 Bug 1225717. Make AutoJSAPI::TakeOwnershipOfErrorReporting actually work on workers as long as no one calls JS_ReportPendingException manually. r=bholley 2015-11-20 16:29:41 -05:00
Tom Tromey
141af2d368 Bug 1160307 - capture async stack frames on Javascript timeline markers. r=fitzgen, r=smaug r=Paolo 2015-11-05 11:31:00 +01:00
Michael Layzell
0097c41e01 Bug 1201190 - Part 3: Mark every consumer of GUARD_OBJECT as MOZ_RAII, r=ehsan 2015-09-12 16:53:33 -04:00
Ryan VanderMeulen
7f057e1c5f Backed out changeset 0dca237df7e2 (bug 1160307) for causing bug 1184752.
--HG--
extra : rebase_source : 56a2060af6a1d4cbb1f21665d65e50ec3b834265
2015-07-16 20:38:13 -04:00
Tom Tromey
3ff8c1f3fa Bug 1160307 - Capture async stack frames on Javascript timeline markers. r=fitzgen, r=smaug, r=Paolo 2015-07-15 12:15:00 -04:00
Boris Zbarsky
6d8f096996 Bug 1174486 part 2. Add a way to explicitly report a pending exception on an AutoJSAPI that has taken ownership of error reporting. r=bholley
This is needed for some cases that currently report an exception and then do
some other work on the same cx (specifically, nsXBLProtoImplField::InstallField).
2015-06-15 20:10:38 -04:00
Olli Pettay
f366ad344b Bug 1149891, backout bug 1081038 because it made us run mutation observer callbacks against the spec, part 1, r=bholley
--HG--
extra : rebase_source : 2ca34acdc148fceb35439aff38b97daf51f1fd65
2015-05-29 19:10:19 +03:00
Tom Tromey
13be65d0c5 Bug 1050500 - Add callee information to Javascript timeline markers. r=smaug
--HG--
extra : rebase_source : dbd9e09496ca7c0e4f9798adf1f8f72749537d1a
2015-05-20 05:28:00 -04:00
Andrew McCreight
9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Jim Blandy
ebd83c9a61 Bug 1152577: Add 'aReason' argument to AutoEntryScript constructor, and provide plausible names for its instantiations. r=bholley
--HG--
extra : rebase_source : 8ab7a3628a5b4d94b957f24e23e4c5c7871db97c
2015-04-08 21:23:48 -04:00
Ehsan Akhgari
15d7918ec6 Bug 1123112 - Mark AutoEntryScript as stack class, and clarify the ownership of its members; r=smaug 2015-01-18 18:43:03 -05:00
Ehsan Akhgari
4354953b4f Bug 1118486 - Part 1: Use = delete instead of MOZ_DELETE directly; r=Waldo
Most of this patch (with the exception of dom/bindings/Codegen.py) was
generated by the following bash script:

#!/bin/bash

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "*/.git*" \
       ! -wholename "obj-*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -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 MOZ_DELETE '= delete'
2015-01-08 23:19:05 -05:00
Nikhil Marathe
3d31470511 Bug 1107777 - Add autoJSAPIOwnsErrorReporting flag to JSContext options. AutoJSAPI sets it. r=bholley 2014-12-16 02:02:37 -08:00
Bobby Holley
455f15535d Bug 1103324 - Instantiate an AutoNoJSAPI when dispatching IPC messages. r=billm 2014-12-06 09:51:14 -08:00
Gabor Krizsanits
172768a8cc Bug 1081038 - part1: Microtask in AutoEntryScript. r=bholley 2014-11-14 16:46:26 +01:00
Kannan Vijayan
4ac6dd569f Bug 1050774 - Record script execution in timeline view. r=bholley 2014-11-13 16:22:24 -05:00
Carsten "Tomcat" Book
b7f71a3e33 Backed out changeset b1f8365b8a92 (bug 1081038) for dt Test Failures on a CLOSED TREE 2014-11-13 11:48:21 +01:00
Gabor Krizsanits
a6f3398faa Bug 1081038 - part 1: Microtask in AutoEntryScript. r=bholley 2014-11-13 09:50:12 +01:00
Bobby Holley
0e8bf218c0 Bug 1070842 - Move nsJSUtils::CompileFunction (and consequently event handler compilation and XBL compilation) off of nsJSUtils::ReportPendingException. r=bz 2014-09-29 15:34:21 +02:00
Bobby Holley
99864a2a38 Bug 1070842 - Introduce an API on AutoJSAPI to allow Gecko to handle exceptions without meddling from the JS engine. r=bz 2014-09-29 15:34:21 +02:00
Bobby Holley
be9e0c4e41 Bug 1070696 - Implement a JSObject* override to AutoJSAPI::Init(). r=smaug 2014-09-21 21:31:53 +02:00
Bobby Holley
43e0dc6c0c Bug 981218 - Remove the JSAutoCompartment from cx pushing. r=bobowen
By this point, AutoJSAPI takes care of entering the correct compartment, so this
no longer serves a purpose.
2014-08-21 17:13:50 -07:00
Bobby Holley
993920dcec Bug 796938 - Switch nsHTMLDocument::Open and XMLDocument::Load to a new GetEntryDocument API and remove nsContentUtils::GetDocumentFromContext. r=smaug 2014-08-19 12:02:06 -07:00
Bobby Holley
ad265a7fcd Bug 951991 - Implement GetEntryGlobal. r=smaug 2014-08-19 12:02:05 -07:00
Bobby Holley
a5c1a27839 Bug 1052052 - Convert AutoJSContext to AutoJSAPI. r=gabor
With this change, the only cx push left in the tree happens inside of AutoJSAPI. \o/
2014-08-14 18:47:16 -07:00
Bobby Holley
e70ddb7476 Bug 1052052 - Hoist Auto*JSContext into nsContentUtils and kill nsCxPusher.{cpp,h}. r=gabor 2014-08-14 18:47:15 -07:00
Bobby Holley
850fc35028 Bug 1052052 - Hoist AutoCxPusher into ScriptSettings.h. r=gabor 2014-08-14 18:47:15 -07:00
Jim Blandy
bb0be928e2 Bug 971673: Ensure mozilla::dom::ScriptSettingsStackEntry is only used as a base class: make its constructor protected. r=bholley 2014-08-14 16:23:15 -07:00
Ryan VanderMeulen
30ae466592 Backed out changesets 5b1a3161f614, 17a9673ed782, and a9b8c346d295 (bug 1052052) for B2G non-unified bustage. 2014-08-14 17:23:10 -04:00
Bobby Holley
b9ebf1d31f Bug 1052052 - Convert AutoJSContext to AutoJSAPI. r=gabor
With this change, the only cx push left in the tree happens inside of AutoJSAPI. \o/
2014-08-14 12:54:37 -07:00
Bobby Holley
3e4d70a655 Bug 1052052 - Hoist Auto*JSContext into nsContentUtils and kill nsCxPusher.{cpp,h}. r=gabor 2014-08-14 12:54:34 -07:00
Bobby Holley
35f3a10cb0 Bug 1052052 - Hoist AutoCxPusher into ScriptSettings.h. r=gabor 2014-08-14 12:53:52 -07:00
Seth Fowler
0fd6e994ae Bug 913586 (Part 4) - Update Maybe users in dom. r=bz
--HG--
extra : rebase_source : 7b6159b00b3bf4f919b30f1bccc8939cc04fe526
2014-08-13 15:39:41 -07:00
Bobby Holley
7c1bca4f69 Bug 1052042 - Move the pre-pop GC to AutoEntryScript. r=billm 2014-08-13 15:36:44 -07:00