Boris Zbarsky
445459b942
Bug 1342513. Set up a scripted caller override in AutoEntryScript. r=bholley
...
Otherwise if we have no explicit incumbent script we can end up getting an
incumbent off the script stack _above_ the AutoEntryScript, which is wrong.
MozReview-Commit-ID: LG3540tgRQ
2017-02-28 12:41:35 -05:00
Jan de Mooij
5a6befce76
Bug 1292892 part 2 - Some RootingContext cleanup. r=bz,terrence
2016-08-11 14:39:22 +02:00
Jan de Mooij
0ad12515f4
Bug 1292892 part 1 - Stop using JSRuntime outside SpiderMonkey. r=bz,terrence,fitzgen,kanru
2016-08-11 14:39:22 +02:00
Olli Pettay
06c2ac8e59
Bug 1292699 - Add a small helper to deal with cases when native side needs to ensure that slow script dialog shows up, r=bholley
...
--HG--
extra : rebase_source : ab0fc332e5b54921d7a05e0c008c65b29947ee27
2016-08-08 23:29:05 +03:00
Nicholas Nethercote
2ebfc5116b
Bug 1197973 - Use MOZ_MUST_USE in AutoJSAPI. r=bz.
2016-07-14 13:18:11 +10:00
Daniel Holbert
05575e6215
Bug 1285660: Annotate DocshellEntryMonitor as 'final', to fix clang warning about it having virtual functions & explictly-invoked non-virtual destructor. r=bholley
...
(Its destructor is explicitly invoked by Maybe::reset(). This is fine, as long as there are no subclasses that need custom destruction behavior -- and 'final' proves that there are no subclasses.)
MozReview-Commit-ID: LKiw3CT6wN7
2016-07-08 16:20:18 -07:00
Boris Zbarsky
d208b0de7a
Bug 1282150 part 3. Add a way to get the JSRuntime for the thread, and use it in various places for rooting. r=bholley
2016-07-07 20:08:26 -04:00
Boris Zbarsky
6542e6c3f0
Bug 1282150 part 1. Add a mozilla::dom::danger::GetJSContext API. r=bholley
2016-07-07 20:08:26 -04:00
Boris Zbarsky
eb139d85bf
Bug 1279313 part 1. Simplify AutoEntryScript to not make callers pass in a JSContext. r=bholley
2016-07-07 20:08:25 -04:00
Boris Zbarsky
9b1f1daa04
Bug 767938 part 10. Remove the now write-only XPCJSContextStack's actual stack of JSContexts and AutoCxPusher. r=bholley
2016-06-24 14:19:51 -04:00
Boris Zbarsky
cca4d3bf70
Bug 767938 part 9. Move the JSAutoRequest from AutoCxPusher to AutoJSAPI, because we're about to kill off AutoCxPusher. r=bholley
2016-06-24 14:19:51 -04:00
Boris Zbarsky
ad60b5c087
Bug 767938 part 7. Remove the now-debug-only uses of XPCJSContextStack::Peek and Count(). r=bholley
2016-06-24 14:19:50 -04:00
Boris Zbarsky
edb18fcfaf
Bug 767938 part 5. Stop using the JSContext stack to get the current JSContext. r=bholley
2016-06-24 14:19:50 -04:00
Boris Zbarsky
674ca7344c
Bug 767938 part 3. Make AutoJSAPI a ScriptSettingsStackEntry. r=bholley
2016-06-24 14:19:50 -04:00
Boris Zbarsky
e7805058b1
Bug 767938 part 2. Move control over pushing/popping ScriptSettingsStackEntry instances into subclasses, so we can do the conditional pushing/popping AutoJSAPI will need. r=bholley
2016-06-24 14:19:50 -04:00
Boris Zbarsky
78464e8e2a
Bug 767938 part 1. Change ScriptSettingsStackEntry to allow having stack entries that are neither candidates for being entry globals nor candidates for being incumbent globals. r=bholley
2016-06-24 14:19:50 -04:00
Boris Zbarsky
30a9fd5097
Bug 1276327. Remove the non-debug use of CxPusherIsStackTop(). r=bholley
2016-06-20 17:40:39 -04:00
Jan de Mooij
dad997a833
Bug 1277278 part 3 - Rename error reporter callback to warning reporter, assert it's only used for warnings. r=luke
...
--HG--
extra : rebase_source : ac1febc5220d649853f35c29de89a5e9ffb4fe98
2016-06-07 20:30:48 +02:00
Jan de Mooij
66faed38af
Bug 1277278 part 1 - Remove ContextOptions and make autoJSAPIOwnsErrorReporting the default. r=luke
...
--HG--
extra : rebase_source : aa1dcba100a3bb7a5057b07284cf4a99353afe5a
2016-06-07 20:30:48 +02:00
Boris Zbarsky
718461c894
Bug 1276276 part 5. Change AutoCxPusher to not worry about nsIScriptContext, since its JSContext never has one anymore. r=smaug
2016-06-02 10:34:40 -04:00
Boris Zbarsky
2385de9556
Bug 1276276 part 1. Make AutoJSAPI hold a strong ref to the nsIGlobalObject it's initialized with, so it won't go away while we're working with it. r=smaug
2016-06-02 10:34:39 -04:00
Nathan Froyd
cccdd9fbca
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
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