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

57 Коммитов

Автор SHA1 Сообщение Дата
Jon Coppeard e6bd951e8e Bug 1342012 - Refactor nsJSUtils::ExecutionContext to separate compilation and execution steps and allow extraction of compiled JSScript r=nbp r=smaug 2018-12-06 16:52:16 -05:00
Emilio Cobos Álvarez 006a4ab94a Bug 1516366 - Move nsOnloadBlocker and nsDocumentOnStack to nsDocument.cpp, and shrink nsDocument.h to the minimmum. r=smaug
This needs to add a few of includes in other places which were relying on the
massive (now gone) list in nsDocument.h.

I also needed to move an AnimationTimeline destructor out of line because it
relied on dom::Animation being defined, yet Animation.h includes
AnimationTimeline.h, so include hell.

Differential Revision: https://phabricator.services.mozilla.com/D15366
2018-12-29 20:41:42 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Nicholas Nethercote 2fcd08a173 Bug 1486690 - Rename NS_str{,}dup and remove unnecessary checks after calls to them. r=glandium
The 'x' prefix makes it clearer that these are infallible.

A couple of nsJSID methods are now also infallible.

--HG--
extra : rebase_source : fcce44a00212d6d341afbf3827b31bd4f7355ad5
2018-08-28 15:58:54 +10:00
Jan de Mooij 9b9ef5d8db Bug 1479363 part 3 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in dom/xbl and dom/xul. r=bholley 2018-07-31 08:37:07 +02:00
Jan de Mooij 80adc67aba Bug 1478955 part 1 - Rename JSAutoRealm to JSAutoRealmAllowCCW. r=luke 2018-07-28 12:12:26 +02:00
Jan de Mooij 3201853e80 Bug 1468752 part 4 - Remove JS_GetGlobalForObject. r=bz 2018-07-06 12:54:00 +02:00
Jan de Mooij 45a7ade57e Bug 1469217 part 2 - Add APIs taking getter/setter objects instead of JSNatives. r=anba 2018-06-21 11:05:42 +02:00
Andi-Bogdan Postelnicu f0898732d8 Bug 1453795 - DOM/XBL - Initialize member fields in classes/ structures. r=mrbkap
--HG--
extra : rebase_source : b993a685d80aa4ed1975d07cb641ca2133cfd4d2
extra : amend_source : 3501d5f70d05b921b41fa15c3ce97b79a59209ac
2018-06-15 17:01:06 +03:00
Jan de Mooij 80e44e8003 Bug 1461292 part 1 - Rename JSAutoCompartment to JSAutoRealm. r=bz,luke 2018-05-16 10:53:16 +02:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Emilio Cobos Álvarez 500ff7c746 Bug 1446342: Don't include forms in the scope chain for XBL datetime bindings. r=smaug
Reviewers: smaug

Bug #: 1446342

Differential Revision: https://phabricator.services.mozilla.com/D769

MozReview-Commit-ID: HK7nChYf0X6
2018-03-20 01:34:09 +01:00
Kris Maglione 83371fe0b5 Bug 1445551: Part 4 - Remove compartment-per-addon. r=mccr8
The compartment-per-addon code was added so that we could segregate at least
some of the code from system-privileged add-ons into tagged compartments, even
when it ran in browser windows. That allowed us to apply certain special
behavior to them, such as enabling e10s shims, and to track some performance
characteristics.

The only remaining chrome-privileged add-ons now are system add-ons controlled
by us, and the shim system and per-compartment performance metrics are gone,
it no longer serves a purpose.

MozReview-Commit-ID: Ap186bWAaqP

--HG--
extra : rebase_source : c5bf81b44dd42b7cebce2784b7dd98480b41b593
2018-03-13 19:43:30 -07:00
Jan de Mooij 7f30bf48a7 Bug 1417844 part 2 - Remove JSVersion from CompileOptions, CompartmentBehaviors, scripts. r=evilpie 2017-11-17 12:12:39 +01:00
Nicholas Nethercote d225f7151b Bug 1400460 - Rename nsIAtom as nsAtom. r=hiro.
(Path is actually r=froydnj.)

Bug 1400459 devirtualized nsIAtom so that it is no longer a subclass of
nsISupports. This means that nsAtom is now a better name for it than nsIAtom.

MozReview-Commit-ID: 91U22X2NydP

--HG--
rename : xpcom/ds/nsIAtom.h => xpcom/ds/nsAtom.h
extra : rebase_source : ac3e904a21b8b48e74534fff964f1623ee937c67
2017-10-03 09:05:19 +11:00
Jan de Mooij bc31f1ee31 Bug 1394835 part 1 - Spit JS_DefineProperty* APIs in separate data/accessor overloads. r=evilpie,bz 2017-08-30 15:35:06 +02:00
Masatoshi Kimura 38894511bc Bug 1390106 - Stop using versioned scripts in dom. r=mrbkap
MozReview-Commit-ID: 89KvCoTAg3I

--HG--
extra : rebase_source : 24831fa454a1cc6fff70a9b1eb509d0f5aeb800a
2017-08-14 20:42:55 +09:00
Boris Zbarsky 66481a7a29 Bug 1371259 part 9. Make UnwrapReflectorToISupports return already_AddRefed<nsISupports>. r=peterv
The main reason to not do this would be performance (avoiding the
addref/release), but there are two main mitigating factors:

1)  All calls to UnwrapReflectorToISupports that pass in a Web IDL object
    already do the addref (and in fact QI).  So this only affects the
    XPCWrappedNative case.

2)  The vast majority of the callers proceed to QI on the pointer anyway, and a
    second addref is cheap; it's the first addref after a CC that can be
    expensive on a cycle-collected object.

Going through the changes one by one:

* In GlobalObject::GetAsSupports, we do have a change that slightly slows down
  precisely in the XPCWrappedNative global case.  That's the message managers
  and the backstagepass.  And this really only affects calls to Web IDL statics
  from those globals.

* In UnwrapArgImpl we're talking about a Web IDL method taking an "external
  interface" type, and the UnwrapReflectorToISupports call is immediately
  followed by QI anyway.

* In UnwrapXPConnectImpl we're talking about the case when we have a
  non-WebIDL-object implementation of a Web IDL interface.  Again, this is the
  message manager globals, for EventTarget.  And we have a QI call immediately
  after the UnwrapReflectorToISupports.

* In the generated HasInstance hook for EventTarget we will be slightly slower
  when the LHS of the instanceof is an XPCWrappedNative.  And not much slower,
  because again there's an immediate QI.

* In InstallXBLField we're never going to have an XPCWrappedNative as thisObj;
  it's always an Element in practice.  So this is no more expensive than before.

* In sandbox's GetPrincipalOrSOP we now have an extra addref.  But it was
  followed by various QIs anyway.

* In XPCConvert::JSValToXPCException we have an extra addref if someone throws
  an XPCWrappedNative, which is fairly unlikely; our actual Exception objects
  are on Web IDL bindings.  Plus we have an immediate QI.

* In xpc::HasInstance we have an extra addred if the LHS of instanceof is an
  XPCWrappedNative.  But, again, there's an immediated QI after the
  UnwrapReflectorToISupports.

* In xpcJSWeakReference::Init we are likely doing an extra addref, but again
  immediately followed by QI.

I think it's worth making this change just to remove the footgun and that the
perf impact, if any, is pretty minimal.
2017-07-10 16:05:26 -04:00
Boris Zbarsky 9cdb2834a8 Bug 1371259 part 8. Get rid of nsIXPConnect::GetNativeOfWrapper. r=peterv
Most of these changes are just replacements of GetNativeOfWrapper with
UnwrapReflectorToISupports, which is all it did under the hood.

The other changes are as follows:

* In nsDOMClassInfo, we really care whether we have a window, so we can just
  UNWRAP_OBJECT to the Window interface, since Window is always on Web IDL
  bindings now.  Also, the weird compartment check hasn't been needed ever since
  GetNativeOfWrapper stopped returning things off the passed-in object's
  prototype chain (Firefox 22, bug 658909).
* The only use of do_QueryWrapper was to get a Window in nsDocument; again we
  can UNWRAP_OBJECT.
* In XPCJSRuntime, we again just want to check for a Window, so UNWRAP_OBJECT.
2017-07-10 16:05:25 -04:00
Boris Zbarsky 5c76874a46 Bug 1371259 part 3. Change UnwrapObject<> and the UNWRAP_OBJECT macro to allow passing in mutable object or value handles for the thing being unwrapped, and do so at various callsites. r=peterv
I did audit all UNWRAP_OBJECT callers to make sure that the lifetimes of all the
temporary Rooted or the RefPtrs they unwrap into are long enough.
2017-07-10 16:05:24 -04:00
Ting-Yu Lin 200de4b5fa Bug 1363640 Part 3 - Strip whitespaces for files under dom/xbl. r=heycam
MozReview-Commit-ID: 3WBsFIgFZU9

--HG--
extra : rebase_source : 63699a4f10a418171cf9fa3205761c7b53129360
2017-05-09 20:45:11 -07:00
Boris Zbarsky 77a2c8f1f2 Bug 1359859. Use the right entry global for XBL constructor/destructor/field execution. r=bholley
The test doesn't verify that the exceptions are reported to the browser console,
but I manually checked that they are.  Adding a test for that part could be
pretty annoying.
2017-04-26 13:57:55 -04:00
Iris Hsiao 27dd75df0c Backed out changeset d19a04e55bef (bug 1359859) for mochitest failure. a=backout
CLOSED TREE
2017-04-27 11:46:12 +08:00
Boris Zbarsky d91dc284ca Bug 1359859. Use the right entry global for XBL constructor/destructor/field execution. r=bholley
The test doesn't verify that the exceptions are reported to the browser console,
but I manually checked that they are.  Adding a test for that part could be
pretty annoying.
2017-04-26 13:57:55 -04:00
Nicolas B. Pierron 39741d711a Bug 1331662 part 2 - Replace nsJSUtils::EvaluateString calls by ExecutionContext scopes. r=bz 2017-03-22 13:42:27 +00:00
Nicholas Nethercote 5622a00748 Bug 1297300 - Add missing checks to GetSpec() calls in dom/xbl/. r=bz.
--HG--
extra : rebase_source : b7279c4ce02ac111c39dc099652fe0837b98f30b
2016-09-08 14:19:01 +10:00
Chris Peterson b175c9fdd5 Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07: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
Till Schneidereit 36af475fe5 Bug 1198193 - Change all functions taking CallArgs to take const CallArgs& instead. r=Waldo
--HG--
extra : rebase_source : b7cd505c80b34d33d98e336490b117792030d9d5
2015-08-27 21:18:37 +02:00
Ms2ger fe465275e2 Bug 1173344 - Remove an intermediary root from nsXBLProtoImplField's FieldGetterImpl; r=jandem
--HG--
extra : commitid : 9A0bnmsSNog
2015-06-20 09:16:50 +02:00
Boris Zbarsky 3437c1a714 Bug 1174486 part 4. Stop reporting exceptions in nsJSUtils::EvaluateString and have its consumers use AutoJSAPIs that take ownership of error reporting instead. r=bholley 2015-06-15 20:11:06 -04:00
Olli Pettay 6c339b4947 Bug 1149891, backout bug 1081038 because it made us run mutation observer callbacks against the spec, part 2, r=bholley
--HG--
extra : rebase_source : 3d34419ec07782b1a3260c36fc64a1b26b3679e8
2015-05-29 19:11:09 +03:00
Andrew McCreight 9e8f4b219e Bug 1152551, part 2 - Fix mode lines in dom/. r=jst 2015-05-03 15:32:37 -04:00
Mike Hommey 924c9eb636 Bug 1134923 - Remove NS_Alloc/NS_Realloc/NS_Free. r=nfroyd
They are kept around for the sake of the standalone glue, which is used
for e.g. webapprt, which doesn't have direct access to jemalloc, and thus
still needs a wrapper to go through the xpcom function list and get to
jemalloc from there.
2015-05-01 09:40:30 +09: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
Mike Hommey b077d9624d Bug 1134920 - Use moz_xmalloc/moz_xrealloc/free instead of nsMemory::Alloc/Realloc/Free. r=nfroyd 2015-04-01 13:51:45 +09:00
Boris Zbarsky 5d2ae0a555 Bug 1140573 part 4. Drop the parent argument from js::NewFunctionByIdWithReserved. r=waldo 2015-03-09 12:50:08 -04:00
Gabor Krizsanits dbcc1f28d5 Bug 1081038 - part2: Removing nsAutoMicroTask where we have AutoEntryScript. r=bholley 2014-11-14 16:46:26 +01:00
Carsten "Tomcat" Book c969ca2647 Backed out changeset 9243c59c3e56 (bug 1081038) 2014-11-13 11:48:00 +01:00
Gabor Krizsanits beb54125e8 Bug 1081038 - part 2: Removing nsAutoMicroTask where we have AutoEntryScript. r=bholley 2014-11-13 09:50:15 +01:00
Boris Zbarsky e25768cbf9 Bug 1095660 part 5. Change nsJSUtils::EvaluateString to take an explicit scope chain. r=bholley 2014-11-12 17:04:29 -05:00
Boris Zbarsky 6ee4ab8789 Bug 1088002 part 2. Change JS_DefineElement, JS_DefineProperty, JS_DefineUCProperty, JS_DefinePropertyById, and JS_DefineProperties to default to using JSNative accessors, not JSPropertyOp accessors. r=waldo 2014-10-29 15:06:31 -04:00
Chris Peterson d126c3c24f Bug 1063962 - Replace jschar typedef with C++11 char16_t type. r=jandem 2014-07-21 21:43:21 -07:00
Jan de Mooij 44da586636 Bug 1034191 - Make nsDependentJSString users work with Latin1 strings and nursery-allocated strings. r=bz 2014-07-05 17:30:54 +02:00
Bill McCloskey 64b94c4b6d Bug 1017310 - Associate JS compartments with add-on chrome XBL (r=bholley) 2014-06-23 16:33:37 -07:00
Jason Orendorff 76d9f6e407 Bug 645416, part 22 - Remove JSCompartment::wrapId. r=terrence.
This is unnecessary now that object jsids no longer exist. Both string and
symbol jsids point only to GC things in the atoms compartment, which are safe
to pass to any compartment without wrapping.

--HG--
extra : rebase_source : 82c21e8474df05b1bb42c14d872c981205bbe879
2014-06-23 10:57:02 -05:00
Eric Faust f9d65507e2 Bug 1011660 - Remove separate DOMClass struct. (r=bz) 2014-06-18 13:19:19 -07:00
Bobby Holley 699946fc90 Bug 1022016 - Redesign nsDependentJSString API to be less of a footgun. r=gabor 2014-06-10 20:15:56 -07:00