Commit Graph

6465 Commits

Author SHA1 Message Date
David Major
b9b192ef7a Bug 1192844: Accept 0xCC padding in WindowsDllDetourPatcher::CreateTrampoline. r=m_kato 2015-08-12 13:10:04 -04:00
Aryeh Gregor
977959ed20 Bug 1010756 - Helpful errors for using nsCOMPtr on non-XPCOM types; r=froydnj 2015-08-12 18:43:10 +03:00
Nicholas Nethercote
b68592bb63 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
2d7616c186 Bug 1192230 - clean up reference-counting in xpcom/; r=erahm 2015-07-01 12:27:43 -04:00
Terrence Cole
47bf2a49bb Bug 1193032 - Part 2: Make unlimited SliceBudget initialization explicit; r=ehoogeveen,r=mccr8 2015-08-11 08:42:24 -07:00
Birunthan Mohanathas
ebeccde38d 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
a44818609c Bug 1185763 - Part 3: Rename nsTArray::MoveElementsFrom to AppendElements. r=froydnj 2015-08-11 08:29:46 -07:00
Birunthan Mohanathas
dd7b872b07 Bug 1185763 - Part 2: Remove non-rvalue version of nsTArray::MoveElementsFrom. r=froydnj 2015-08-11 08:29:46 -07:00
Kyle Huey
0a62d4d460 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
4a12af4a65 Bug 1190495 - Hoist TaskQueue into xpcom. r=froydnj 2015-08-11 08:55:22 -04:00
Alfredo Yang
fa4f511520 Bug 1146086: use promise to Init() in PlatformDecoderModule. r=jya,r=cpearce 2015-08-11 14:09:12 +10:00
ffxbld
26b7d0300a Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2015-08-10 12:20:42 -07:00
Bobby Holley
7ab1ef1472 Bug 1190492 - Hoist AbstractThread and TaskDispatcher to xpcom. r=froydnj 2015-08-07 16:38:35 -07:00
Bobby Holley
b76e5a15e3 Bug 1190492 - Init AbstractThread statics from XPCOM. r=froydnj 2015-08-07 16:38:34 -07:00
Nicholas Nethercote
6a0cbc501c Bug 1190735 - Remove nsITimer.TYPE_REPEATING_PRECISE. r=froydnj. 2015-08-04 17:30:53 -07:00
Nicholas Nethercote
1b756bbd42 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
0ecbd46917 Bug 1189423 - part 2 - Remove superfluous |new| result check. r=froydnj 2015-07-30 15:06:00 +02:00
Andrew McCreight
1ed95a9c7c Bug 1189423 - part 1 - Add MOZ_COUNT_CTOR/DTOR for nsXPTCStubBase. r=froydnj 2015-08-04 14:30:00 +02:00
Nicholas Nethercote
a49a3010c8 Bug 1181443 (part 3) - Remove nsTHashtable::EnumerateEntries(), which is no longer used. r=froydnj. 2015-07-23 02:37:26 -07:00
Botond Ballo
0369104893 Bug 1056356 - Add support for nsRefPtr<const T>. r=froydnj 2015-08-05 13:52:06 -04:00
Aryeh Gregor
3713e55caa Bug 1190823 - Move OwningNonNull.h to xpcom/base/; r=froydnj 2015-08-05 15:28:27 +03:00
Bobby Holley
9f9bae1800 Bug 1191063 - Followup comments. r=me DONTBUILD 2015-08-04 17:36:06 -07:00
Birunthan Mohanathas
e1f0334d06 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
da17ea5369 Bug 1190496 - Hoist SharedThreadPool into xpcom. r=froydnj 2015-08-04 14:00:58 -07:00
Bobby Holley
adb9010a55 Bug 1190496 - Init SharedThreadPool from XPCOM rather than MediaDecoder. r=froydnj 2015-08-04 14:00:52 -07:00
James Cheng
d4c8522d1e Bug 1189231 - Impl operator->* to nsAutoPtr. r=nfroyd 2015-07-30 21:02:00 -04:00
Nicholas Nethercote
953689e82d 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
4a526ace27 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
ea6d236bfa Bug 1127618 - make push caches work in e10s. r=mcmanus r=froydnj IGNORE IDL 2015-07-31 13:50:08 -07:00
Arnaud Bienner
7b9f3acd58 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
5e6905f92a Bug 1024259: Use NS_FREE_PERMANENT_DATA more consistently. r=mccr8 2015-07-31 12:11:48 -07:00
Kyle Huey
2a7e8dc443 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
66083b4f91 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
8bc2be4de1 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
973c50a883 Bug 975246 - Part2- Test Invoking via operator->*. r=nfroyd 2015-07-29 02:52:00 +02:00
Nicholas Nethercote
242308999c 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]
dde8d36fb0 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]
b3903a6fc7 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]
85218cb3b2 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]
b9b7f9420c Bug 1059572 - Part 0: Fuzz test for timers. r=nfroyd 2015-07-29 11:16:14 -05:00
Aidin Gharibnavaz
31046168cb Bug 108603 - Remove NS_IMPL_QUERY_INTERFACE_INHERITED0. r=mccr8, r=froydnj 2015-07-24 12:13:00 -04:00
Bobby Holley
59c4d9cf6c Bug 1188696 - Hoist nsRefPtr.h into MFBT. r=froydnj 2015-07-29 10:44:59 -07:00
Bobby Holley
ec207ee3d4 Bug 1188696 - Remove the XPCOM dependencies in nsRefPtr.h. r=froydnj 2015-07-29 10:44:58 -07:00
Nathan Froyd
9fa2417770 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
fd3db03ce7 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
3abd642d14 Bug 1180017 - Fix up the badly-horked backout and re-land.
CLOSED TREE
2015-07-29 12:31:47 -04:00
Jim Blandy
631796ff1f 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
1ff25152c8 Backed out changeset 465793bc6fcf (bug 1180017) for suspicion of causing bug 1188799 2015-07-29 15:27:12 +02:00
Jacek Caban
7e144224ba 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
55e28f7b3b 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