Commit Graph

6464 Commits

Author SHA1 Message Date
Aryeh Gregor
eb2a6135d7 Bug 1010756 - Helpful errors for using nsCOMPtr on non-XPCOM types; r=froydnj 2015-08-12 18:43:10 +03:00
Nicholas Nethercote
f979ab17aa Bug 1181443 (part 3, attempt 2) - Remove nsTHashtable::EnumerateEntries(), which is no longer used. r=froydnj. 2015-07-23 02:37:26 -07:00
Nathan Froyd
243206abba Bug 1192230 - clean up reference-counting in xpcom/; r=erahm 2015-07-01 12:27:43 -04:00
Terrence Cole
ae96ebf942 Bug 1193032 - Part 2: Make unlimited SliceBudget initialization explicit; r=ehoogeveen,r=mccr8 2015-08-11 08:42:24 -07:00
Birunthan Mohanathas
9049c96007 Bug 1185763 - Part 4: Swap elements if possible in r-value version of nsTArray::AppendElements. r=froydnj 2015-08-11 08:29:46 -07:00
Birunthan Mohanathas
fd290c6aa3 Bug 1185763 - Part 3: Rename nsTArray::MoveElementsFrom to AppendElements. r=froydnj 2015-08-11 08:29:46 -07:00
Birunthan Mohanathas
e53da56072 Bug 1185763 - Part 2: Remove non-rvalue version of nsTArray::MoveElementsFrom. r=froydnj 2015-08-11 08:29:46 -07:00
Kyle Huey
1ffb03e8dc Bug 1179909: Refactor stable state handling. r=smaug
This is motivated by three separate but related problems:

1. Our concept of recursion depth is broken for things that run from AfterProcessNextEvent observers (e.g. Promises). We decrement the recursionDepth counter before firing observers, so a Promise callback running at the lowest event loop depth has a recursion depth of 0 (whereas a regular nsIRunnable would be 1). This is a problem because it's impossible to distinguish a Promise running after a sync XHR's onreadystatechange handler from a top-level event (since the former runs with depth 2 - 1 = 1, and the latter runs with just 1).

2. The nsIThreadObserver mechanism that is used by a lot of code to run "after" the current event is a poor fit for anything that runs script. First, the order the observers fire in is the order they were added, not anything fixed by spec. Additionally, running script can cause the event loop to spin, which is a big source of pain here (bholley has some nasty bug caused by this).

3. We run Promises from different points in the code for workers and main thread. The latter runs from XPConnect's nsIThreadObserver callbacks, while the former runs from a hardcoded call to run Promises in the worker event loop. What workers do is particularly problematic because it means we can't get the right recursion depth no matter what we do to nsThread.

The solve this, this patch does the following:

1. Consolidate some handling of microtasks and all handling of stable state from appshell and WorkerPrivate into CycleCollectedJSRuntime.
2. Make the recursionDepth counter only available to CycleCollectedJSRuntime (and its consumers) and remove it from the nsIThreadInternal and nsIThreadObserver APIs.
3. Adjust the recursionDepth counter so that microtasks run with the recursionDepth of the task they are associated with.
4. Introduce the concept of metastable state to replace appshell's RunBeforeNextEvent. Metastable state is reached after every microtask or task is completed. This provides the semantics that bent and I want for IndexedDB, where transactions autocommit at the end of a microtask and do not "spill" from one microtask into a subsequent microtask. This differs from appshell's RunBeforeNextEvent in two ways:
a) It fires between microtasks, which was the motivation for starting this.
b) It no longer ensures that we're at the same event loop depth in the native event queue. bent decided we don't care about this.
5. Reorder stable state to happen after microtasks such as Promises, per HTML. Right now we call the regular thread observers, including appshell, before the main thread observer (XPConnect), so stable state tasks happen before microtasks.
2015-08-11 06:10:46 -07:00
Bobby Holley
bd090a5647 Bug 1190495 - Hoist TaskQueue into xpcom. r=froydnj 2015-08-11 08:55:22 -04:00
Alfredo Yang
df30a6a272 Bug 1146086: use promise to Init() in PlatformDecoderModule. r=jya,r=cpearce 2015-08-11 14:09:12 +10:00
ffxbld
e634dfaf18 Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2015-08-10 12:20:42 -07:00
Bobby Holley
d42705aa77 Bug 1190492 - Hoist AbstractThread and TaskDispatcher to xpcom. r=froydnj 2015-08-07 16:38:35 -07:00
Bobby Holley
bea07f4a19 Bug 1190492 - Init AbstractThread statics from XPCOM. r=froydnj 2015-08-07 16:38:34 -07:00
Nicholas Nethercote
b955288b21 Bug 1190735 - Remove nsITimer.TYPE_REPEATING_PRECISE. r=froydnj. 2015-08-04 17:30:53 -07:00
Nicholas Nethercote
7ada34a0b2 Backout 04a196339ca4 (bug 1181443, part 3) so that bug 1182961's patches can be backed out. 2015-08-06 16:28:13 -07:00
Andrew McCreight
d302172a02 Bug 1189423 - part 2 - Remove superfluous |new| result check. r=froydnj 2015-07-30 15:06:00 +02:00
Andrew McCreight
b205064536 Bug 1189423 - part 1 - Add MOZ_COUNT_CTOR/DTOR for nsXPTCStubBase. r=froydnj 2015-08-04 14:30:00 +02:00
Nicholas Nethercote
8386a99684 Bug 1181443 (part 3) - Remove nsTHashtable::EnumerateEntries(), which is no longer used. r=froydnj. 2015-07-23 02:37:26 -07:00
Botond Ballo
4a77fdbb9e Bug 1056356 - Add support for nsRefPtr<const T>. r=froydnj 2015-08-05 13:52:06 -04:00
Aryeh Gregor
a3c0771347 Bug 1190823 - Move OwningNonNull.h to xpcom/base/; r=froydnj 2015-08-05 15:28:27 +03:00
Bobby Holley
b76f59ad54 Bug 1191063 - Followup comments. r=me DONTBUILD 2015-08-04 17:36:06 -07:00
Birunthan Mohanathas
9b6236a10a Bug 1191100 - Remove XPIDL signature comments in .cpp files. r=ehsan
Comment-only so DONTBUILD.
2015-08-04 16:17:36 -07:00
Bobby Holley
dd5864d4dd Bug 1190496 - Hoist SharedThreadPool into xpcom. r=froydnj 2015-08-04 14:00:58 -07:00
Bobby Holley
52f61becb4 Bug 1190496 - Init SharedThreadPool from XPCOM rather than MediaDecoder. r=froydnj 2015-08-04 14:00:52 -07:00
James Cheng
894409e112 Bug 1189231 - Impl operator->* to nsAutoPtr. r=nfroyd 2015-07-30 21:02:00 -04:00
Nicholas Nethercote
845b474b3c Bug 1189156 (part 4) - Don't use enumeration style for nsBaseHashtable::SizeOf{In,Ex}cludingThis(). r=erahm,jfkthame.
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)
2015-07-30 21:19:57 -07:00
Nicholas Nethercote
f23a15f104 Bug 1189156 (part 2) - Don't use enumeration style for nsTHashtable::SizeOf{In,Ex}cludingThis(). r=erahm.
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)

And we still have the existing single-arg SizeOf{In,Ex}cluding() functions,
which work if the entry type itself defines SizeOfExcludingThis().
2015-07-29 01:50:52 -07:00
Nicholas Hurley
8642eb435f Bug 1127618 - make push caches work in e10s. r=mcmanus r=froydnj IGNORE IDL 2015-07-31 13:50:08 -07:00
Arnaud Bienner
f15d620dea Bug 1186603 - Add a "Contains" method for string classes and use it in HTMLInputElement. r=nfroyd 2015-07-30 19:45:25 +02:00
Jesse Ruderman
e08f0ec656 Bug 1024259: Use NS_FREE_PERMANENT_DATA more consistently. r=mccr8 2015-07-31 12:11:48 -07:00
Kyle Huey
19e891a252 Bug 1152574: Fix console service discarding to run when it is actually safe to do so (off of inner-window-destroyed). Also add a backstop at xpcom-shutdown to discard any cycle collected messages before it is too late. r=froydnj 2015-07-31 06:49:27 -07:00
Andrew McCreight
4df5cf03f0 Bug 1189122 - Assert when we Suspect() when a CC scan is in progress. r=smaug
This can cause leaks that are invisible to our XPCOM leak detection system.

To avoid this, classes should not addref or release in their Traverse methods.
2015-07-29 20:48:00 +02:00
Nicholas Nethercote
d130e7465e Bug 1189156 (part 1) - Don't use enumeration style for PLDHashTable::SizeOf{In,Ex}cludingThis(). r=froydnj.
After this change, we have PLDHashTable::ShallowSizeOf{In,Ex}cludingThis(),
which don't do anything to measure children. (They can be combined with
iteration to measure children.)

This patch also removes the PL_DHashTableSizeOf{In,Ex}cludingThis() functions.
They're not necessary because the methods can be used instead.

Finally, the patch deliberately converts some SizeOfExcludingThis() calls to
SizeOfIncludingThis(). These are all done on heap pointers so this change is
valid.
2015-07-29 22:28:20 -07:00
James Cheng
975d4109b8 Bug 975246 - Part2- Test Invoking via operator->*. r=nfroyd 2015-07-29 02:52:00 +02:00
Nicholas Nethercote
b003fba482 Bug 1188745 - Rename nsTArray::SizeOfExcludingThis() as ShallowSizeOfExcludingThis(). r=froydnj.
This makes it clearer that, unlike how SizeOf*() functions usually work, this
doesn't measure any children hanging off the array.

And do likewise for nsTObserverArray.
2015-07-28 23:24:24 -07:00
Byron Campen [:bwc]
861c18b24e Bug 1059572 - Part 2: Make absolutely sure a timer is removed before reinitting it. r=nfroyd 2015-07-28 10:10:54 -05:00
Byron Campen [:bwc]
88ad80b638 Bug 1059572 - Part 1: Move PostTimerEvent to TimerThread to allow TimerThread's monitor to protect it. r=nfroyd 2015-07-22 12:39:34 -05:00
Byron Campen [:bwc]
5024c05759 Bug 1059572 - Part 0.5: Fixes for pre-existing problems in TestTimers. r=nfroyd 2015-07-29 11:43:40 -05:00
Byron Campen [:bwc]
6e85d7f435 Bug 1059572 - Part 0: Fuzz test for timers. r=nfroyd 2015-07-29 11:16:14 -05:00
Aidin Gharibnavaz
4685f4a3ce Bug 108603 - Remove NS_IMPL_QUERY_INTERFACE_INHERITED0. r=mccr8, r=froydnj 2015-07-24 12:13:00 -04:00
Bobby Holley
106e778c81 Bug 1188696 - Hoist nsRefPtr.h into MFBT. r=froydnj 2015-07-29 10:44:59 -07:00
Bobby Holley
a567cf64a6 Bug 1188696 - Remove the XPCOM dependencies in nsRefPtr.h. r=froydnj 2015-07-29 10:44:58 -07:00
Nathan Froyd
026867efd9 Bug 1179787 - part 2 - add template logic for smart pointer template arguments in NS_NewRunnableMethod*; r=botond 2015-07-02 11:17:49 -04:00
Nathan Froyd
83085fda54 Bug 1179787 - part 1 - forward StorensRefPtrPassByPtr's constructor argument; r=botond
StorensRefPtrPassByPtr is currently used for storing reference-counted
types passed as T* template arguments to NS_NewRunnableMethodWith*.
We'd also like to use it to store nsRefPtr<T> template arguments.  While
it could be used in its current form, it'd be better for its constructor
to support forwarding, so that something like:

  NS_NewRunnableMethodWithArg<nsRefPtr<T>>(..., nsRefPtr<T>(local));

doesn't cause unnecessary reference counting.
2015-07-02 11:05:52 -04:00
Ryan VanderMeulen
7e14fbd090 Bug 1180017 - Fix up the badly-horked backout and re-land.
CLOSED TREE
2015-07-29 12:31:47 -04:00
Jim Blandy
2b89c02c18 Bug 1180017 - Give GCCellPtr is<T> and to<T> methods, replacing isFoo and toFoo methods. Fix callers. r=terrence 2015-07-03 15:06:23 -07:00
Carsten "Tomcat" Book
a908483c16 Backed out changeset 465793bc6fcf (bug 1180017) for suspicion of causing bug 1188799 2015-07-29 15:27:12 +02:00
Jacek Caban
f600ce1d47 Bug 1188431 - Fixed length argument handling in char16ptr_t variant of NS_ConvertUTF16toUTF8 constructor. r=nfroyd 2015-07-29 12:26:40 +02:00
Jim Blandy
04e076a9d6 Bug 1180017: Give GCCellPtr is<T> and as<T> methods, replacing isFoo and toFoo methods. Fix callers. r=terrence 2015-07-07 09:52:01 -07:00
Ehsan Akhgari
843a39d44d Bug 1188203 - Fix more constructors in XPCOM; r=froydnj 2015-07-28 12:24:37 -04:00