Commit Graph

437 Commits

Author SHA1 Message Date
Dorel Luca
e1e5c4c775 Backed out 4 changesets (bug 1521191) for causing leaks on multiple tests
Backed out changeset 138e162d2778 (bug 1521191)
Backed out changeset 3782d011cc9f (bug 1521191)
Backed out changeset 38d3da4804d7 (bug 1521191)
Backed out changeset d6ce4b187195 (bug 1521191)
2019-01-26 03:23:40 +02:00
Andrew McCreight
5c1bc6074f Bug 1521191, part 3 - Add a function to create a negative leak. r=froydnj
This is needed to test the test harness's handling of a negative leak
being reported by the XPCOM leak checker.

Depends on D17535

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

--HG--
extra : moz-landing-system : lando
2019-01-24 21:29:40 +00:00
Andrew McCreight
0eb5d04802 Bug 1521191, part 1 - Add method to disable dump statistics. r=froydnj
In order to test the test harness's handling of a process failing to
produce a leak log, add a special function that disables the bloat log
output.

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

--HG--
extra : moz-landing-system : lando
2019-01-24 21:30:44 +00:00
Andrew McCreight
1b2773c6d2 Bug 1521223, part 1 - Add an API to deliberately leak an object. r=froydnj
This is needed to test various leak checking harnesses.

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

--HG--
extra : moz-landing-system : lando
2019-01-23 17:03:12 +00:00
Nathan Froyd
a9fb00a2f6 Bug 1485216 - remove Scheduler and related code from xpcom/threads; r=mccr8
Quantum DOM is no longer a priority, and the extra code it introduces to
several places block useful refactorings.
2019-01-22 20:16:56 -05:00
Jan de Mooij
bd8f77645e Bug 1480121 - Remove the global stored in nsXPCWrappedJS. r=bzbarsky
Reasons for doing this:

* nsXPCWrappedJS has complicated GC behavior and we're seeing some oranges in this area.

* Due to the GC/CC complexity, the global stored in nsXPCWrappedJS *must be* the
  object's global in the root-wrapper (implies non-CCW) case. If we do that, the
  global is redundant because we can just get it from the object when we need it.

* For the CCW case, it probably doesn't matter too much which chrome global we
  use so we can use the compartment's first global - we now have an API for that.
  This may also save some memory because it avoids keeping globals alive unnecessarily
  and matches what we do for WrappedNatives and CCWs now. Furthermore, bug 1478359
  comment 12 suggests CCWs can only show up here for in-content XBL and that's in the
  process of being removed.

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

--HG--
extra : moz-landing-system : lando
2018-12-20 19:13:43 +00:00
Jeff Walden
ed23151bd7 Bug 1492937 - Make the JS subscript loader load scripts exclusively as UTF-8, with no way to specify any other encoding, and adjust a bunch of existing tests to use UTF-8 directly, rather than Unicode escape sequences or similar. (This also changes the encoding of .sjs scripts and all mochitest-browser tests in the tree from Latin-1 to UTF-8.) r=yzen, r=MattN, r=jimb, r=kmag 2018-12-19 13:46:20 -08:00
Jan de Mooij
7fa54ccf51 Bug 1512655 part 2 - Assert Cu.setWantXrays is never called on system-principal scopes. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D14695

--HG--
extra : moz-landing-system : lando
2018-12-18 18:42:28 +00:00
shindli
3841c4f8cd Backed out 3 changesets (bug 1512655) for bustages in s/xpconnect/src/XPCComponents.cpp:2001 CLOSED TREE
Backed out changeset 2593c7d67f51 (bug 1512655)
Backed out changeset da21d7e91e19 (bug 1512655)
Backed out changeset ccb15a086148 (bug 1512655)
2018-12-18 14:55:53 +02:00
Jan de Mooij
a2a91d4831 Bug 1512655 part 2 - Assert Cu.setWantXrays is never called on system-principal scopes. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D14695

--HG--
extra : moz-landing-system : lando
2018-12-17 20:38:59 +00:00
Jeff Walden
da31bae9c2 Bug 1492937 - Make mozIJSSubScriptLoader.loadSubScriptWithOptions interpret script data only as UTF-8, without any way to use another charset. r=kmag
--HG--
extra : rebase_source : ffcc1599cf68c007f875c99f20660961a447e966
2018-12-08 18:14:27 -05:00
Nika Layzell
11b083d72c Bug 1477432 - Part 9: Switch to using plain JS objects for nsIJS[IC]ID, r=mccr8
This is a complete rewrite of the interface while maintaining the same APIs.
Each ID is fully-contained within a single object, does not require a finalizer,
and is cheap to create.

Beyond using reserved slots, this code avoids using custom ClassOps, instead
preferring Symbol.hasInstance and eager constants.

One major change which occurred in this patch was the move from storing a nsCID
to storing the ContractID for JSCID objects. This eliminates the need for the
'refreshCID' method, and hopefully shouldn't have performance implications.

If we discover that there are performance problems there, we can look into
stashing the CID, and re-introduce 'refreshCID', despite its surprising
behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D2286
2018-11-16 17:27:44 -05:00
Nika Layzell
d2f648498e Bug 1477432 - Part 8: Remove test-only Components.classesById and Components.interfacesById, r=mccr8
These two interfaces are effectively never used, so to avoid needing to support
ClassID2JSValue with the new implementation, I remove them entirely.

Differential Revision: https://phabricator.services.mozilla.com/D2285
2018-11-16 17:27:42 -05:00
Nika Layzell
7954235168 Bug 1477432 - Part 5: Add a refreshCID method to JSCID objects, r=mccr8
This lets us get rid of the method 'initalize', which currently needs the
internal representation of JSCID.

This particular method is removed entirely in Part 9, and only exists to keep
intermediate states building & running.

Differential Revision: https://phabricator.services.mozilla.com/D2282
2018-11-16 17:27:37 -05:00
Nika Layzell
a3dbdf2c54 Bug 1477432 - Part 4: Remove the nsJSID XPCOM constructor, r=mccr8
Nobody was using it, so it's pretty easy to remove.

Differential Revision: https://phabricator.services.mozilla.com/D2281
2018-11-16 17:27:35 -05:00
Nika Layzell
a3a4d67877 Bug 1477432 - Part 3: Avoid using nsIJSID in Components.Constructor, r=mccr8
This should be mostly compatible with the original implementation. I tried to
simplify things here to just directly wrap and use JS objects, calling methods
on them. This eliminates the nsXPCConstructor type completely, replacing it with
a JSNative constructor with predefined READONLY | PERMANENT properties.

Differential Revision: https://phabricator.services.mozilla.com/D2280
2018-11-16 17:27:33 -05:00
Ehsan Akhgari
6f7b03e600 Bug 1504574 - Remove the XPCOM registration for nsDocumentEncoder; r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D10856
2018-11-05 23:16:04 -05:00
Ehsan Akhgari
c78ff51afb Bug 1504566 - Remove the XPCOM registration for nsHTMLCopyEncoder; r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D10958
2018-11-05 17:28:54 -05:00
Nika Layzell
7059a8ac77 Bug 1501910 - Pass enumerableOnly into nsIXPCScriptable::NewEnumerate, r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D9749
2018-10-25 10:24:36 -04:00
Andrew McCreight
c87fb5b0a9 Bug 1499865 - Make loadedModules and loadedComponents into array attributes. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D9561

--HG--
extra : moz-landing-system : lando
2018-10-23 23:28:44 +00:00
Andrew McCreight
4c274219f8 Bug 1497707, part 1 - Get rid of xpcIJSModuleLoader. r=kmag
This interface is only used for a few testing functions. Just move
them to Cu.

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

--HG--
extra : moz-landing-system : lando
2018-10-23 00:47:16 +00:00
Dorel Luca
88bfc3786c Backed out 5 changesets (bug 1497707) for android mass failures. CLOSED TREE
Backed out changeset bb1b80139e37 (bug 1497707)
Backed out changeset 11c813f192e2 (bug 1497707)
Backed out changeset 32595f9e73d3 (bug 1497707)
Backed out changeset f37f2d39ec9c (bug 1497707)
Backed out changeset 80bf9ddf5bed (bug 1497707)

--HG--
extra : rebase_source : 598b7732d9b994dfeb63c417841a4b9516ecdf19
2018-10-18 00:35:39 +03:00
Andrew McCreight
7c9511ad37 Bug 1497707, part 1 - Get rid of xpcIJSModuleLoader r=kmag
This interface is only used for a few testing functions. Just move
them to Cu.

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

--HG--
extra : moz-landing-system : lando
2018-10-17 20:45:41 +00:00
Andrew McCreight
ddf48a298f Bug 1490507, part 1 - Remove nsIXPCWrappedJSObjectGetter and move the comment r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D5690

--HG--
extra : moz-landing-system : lando
2018-10-09 21:14:37 +00:00
Andrew McCreight
5cbe1e4d48 Bug 1495820 - Inline do_QueryWrappedNative() r=bzbarsky
This method does very little, and is called in only a few places, so
just inline it. The error variant is not called at all. Simplifying
this makes it easier for me to change do_QueryInterface.

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

--HG--
extra : moz-landing-system : lando
2018-10-03 21:40:26 +00:00
Ehsan Akhgari
5d33bd136d Bug 1491561 follow-up: Add back Cu.createCommandParams() which was accidentally removed 2018-09-18 11:12:21 -04:00
Ehsan Akhgari
5d9d4af0cd Bug 1491574 - Part 2: Remove the XPCOM registration for nsPersistentProperties; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5950
2018-09-18 00:58:52 -04:00
Coroiu Cristina
40028657f0 Backed out 3 changesets (bug 1491574) for build bustage at builds/worker/workspace/build/src/netwerk/base/nsNetUtil.cpp on a CLOSED TREE
Backed out changeset 5390b485f7e4 (bug 1491574)
Backed out changeset 3d11b69de826 (bug 1491574)
Backed out changeset e7e8f3f70f8b (bug 1491574)
2018-09-18 07:10:20 +03:00
Ehsan Akhgari
9b9060a876 Bug 1491574 - Part 2: Remove the XPCOM registration for nsPersistentProperties; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5950
2018-09-17 22:05:34 -04:00
Ehsan Akhgari
02f08121ff Bug 1491561 - Remove the XPCOM registrations for LoadContext; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D5945
2018-09-17 21:28:39 -04:00
Ehsan Akhgari
743c23d1d0 Bug 1491588 - Remove the XPCOM registration for nsCommandParams; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D5959
2018-09-17 09:54:00 -04:00
Ehsan Akhgari
731d1adebd Bug 1491560 - Remove the XPCOM registration for nsCommandLine; r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D5944
2018-09-15 12:16:39 -04:00
Andrew McCreight
7637c6c2a1 Bug 1490503 - Mark more XPConnect classes builtinclass r=peterv
Also, make nsIXPCWrappedJSObjectGetter not scriptable to save a tiny amount of binary size.

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

--HG--
extra : moz-landing-system : lando
2018-09-14 17:52:36 +00:00
Ehsan Akhgari
6d56a36888 Bug 1489793 - Part 1: Remove the XPCOM component registration for EditorSpellCheck; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5371
2018-09-12 18:58:53 -04:00
shindli
53d4f9c065 Backed out 2 changesets (bug 1489793) for failures in editor/spellchecker/tests/test_bug1219928.html
Backed out changeset 9d793ccd3fca (bug 1489793)
Backed out changeset 30219dab424e (bug 1489793)
2018-09-12 05:59:31 +03:00
Ehsan Akhgari
d536808f38 Bug 1489793 - Part 1: Remove the XPCOM component registration for EditorSpellCheck; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D5371
2018-09-11 19:17:46 -04:00
Ehsan Akhgari
6bbaf2cf8c Bug 1489147 - Remove the XPCOM component registration for nsXPConnect; r=mccr8
We move the XPConnect() singleton accessor to nsIXConnect to make it available for consumers outside of XPConnect.  Most of the consumers of the singleton accessor just need the nsIXPConnect public interface, except for the IsShuttingDown() member which this patch adds to nsIXPConnect as well.

Differential Revision: https://phabricator.services.mozilla.com/D5151
2018-09-06 16:39:35 -04:00
shindli
2a86142e74 Backed out changeset d4ae1994c20c (bug 1489147) for bustages in JSDebugger.cpp on a CLOSED TREE 2018-09-06 22:12:44 +03:00
Ehsan Akhgari
bb7fcd9d69 Bug 1489147 - Remove the XPCOM component registration for nsXPConnect; r=mccr8
We move the XPConnect() singleton accessor to nsIXConnect to make it available for consumers outside of XPConnect.  Most of the consumers of the singleton accessor just need the nsIXPConnect public interface, except for the IsShuttingDown() member which this patch adds to nsIXPConnect as well.

Differential Revision: https://phabricator.services.mozilla.com/D5151
2018-09-06 14:52:07 -04:00
Ehsan Akhgari
e4ec6f1178 Bug 1483650 - Remove the component registration for nsCycleCollectorLogger; r=mccr8 2018-08-16 16:52:31 -04:00
Timothy Guan-tin Chien
bfd7aeb85d Bug 1431255 - Part III, Create per-origin sandboxes from XPCJSRuntime and load UA widgets scripts r=bholley,jaws,sfink
This patch creates the basic structure on how the widget scripts can be loaded
and be pointed to the Shadow Root, from the UAWidgetsChild.jsm.

The UAWidgetsClass class asks for a sandbox from Cu.getUAWidgetScope(), which
calls into XPCJSRuntime::GetUAWidgetScope(). It creates and keeps the
sandboxes, in a GCHashMap keyed to the origin, so we could reuse it if needed.

MozReview-Commit-ID: J6W4PDQWMcN

--HG--
extra : rebase_source : a62b0a22195f09cdb508df72c954e20d18c7bf68
2018-06-27 11:34:07 -07:00
Jan de Mooij
5824a03a39 Bug 1478359 - Store a global object in nsXPCWrappedJS and use it for realm-entering. r=mccr8
The problem we're solving here: getting/entering the realm/global of a cross-compartment wrapper doesn't make sense once there are multiple realms in a compartment and the CCW will be shared by all of them. Because nsXPCWrappedJS can store a CCW, we will no longer be able to use this JSObject to enter the target realm.

What this patch does: we pass a JSContext* to nsXPCWrappedJS::GetNewOrUsed and we use this to store a global object in nsXPCWrappedJS (with the invariant that the object and global stored in nsXPCWrappedJS are same-compartment). Then when we want to enter the nsXPCWrappedJS's target realm, we use this global object instead of the maybe-CCW object. Because we currently still have one realm per compartment and the objects are same-compartment, this is guaranteed to preserve behavior for now.

nsXPCWrappedJS has some code to deal with weak pointers. Fortunately this applies only to root wrappers and root wrappers always store an unwrapped JSObject, so the extra global we store is guaranteed to be marked by the GC in that case (a global object is never collected when there are live JSObjects belonging to the same realm).
2018-08-07 11:57:41 +02:00
Jan de Mooij
af31466131 Bug 1479712 part 2 - Remove unused nsIXPConnect.getWrappedNativePrototype. r=bholley 2018-08-02 09:15:41 +02:00
Brian Hackett
d138090586 Bug 1465287 Part 7 - Add IPDL and IDL for record/replay directives and fatal errors, r=mccr8.
--HG--
extra : rebase_source : 5f938acb994cf777cfd0630980f29aa03045789c
2018-07-22 11:51:55 +00:00
Jan de Mooij
7f38cbf185 Bug 1465728 part 3 - Rename Cu.getCompartmentLocation to Cu.getRealmLocation. r=bz 2018-06-06 11:44:17 +02:00
Peter Van der Beken
d73809b86f Bug 1453011 - Remove PostCreatePrototype. r=bz.
--HG--
extra : rebase_source : 6c096b964e43a3460a092b0f0b1ed9b512fd98c9
2018-03-22 11:31:05 +01:00
Peter Van der Beken
33304e70f6 Bug 1453011 - Remove some unused nsIXPCScriptable flags. r=bz.
--HG--
extra : rebase_source : bd116870762e7b9b0fcae558039c3522acb30009
2018-03-22 10:37:43 +01:00
Peter Van der Beken
1cd3ab60da Bug 1453011 - Remove nsXPCClassInfo. r=bz.
--HG--
extra : rebase_source : 4f137f69ad8613c149a25260c3ceeb029b823117
2018-03-22 09:42:21 +01:00
Nika Layzell
14da321a67 Bug 1444745 - Part 5: Update consumers of nsIInterfaceInfo to use the nsXPTInterfaceInfo directly, r=mccr8
Due to the decision to keep the old API on nsXPTInterfaceInfo in part 4, this is
a fairly straightforward patch.

1. I had to change a couple of consumers of `IsRetval()` due to the movement of
that flag.
2. I changed all code which held a nsIInterfaceInfo to hold an `const
nsXPTInterfaceInfo*` instead.
3. I changed code which used the nsIInterfaceInfoManager to instead call the
static methods on nsXPTInterfaceInfo.
2018-04-17 19:20:56 -04:00
Adrian Wielgosik
2bd02cd742 Bug 1170771 - Remove ThisTranslator and support code. r=bz
MozReview-Commit-ID: Fv0F4RLCnkL

--HG--
extra : rebase_source : 24c3746ebde37b2bf4ab383cee781dd3bceb93b2
2018-04-05 12:49:24 +02:00