Jean-Yves Avenard
de5872ee7a
Bug 1637890 - P2. Don't use ClearOnShutdown to destroy AbstractThread::MainThread(). r=froydnj
...
During the last cycle collection, state watchers may attempt to dispatch tasks to the current AbstractThread, so we can't clear the TLS entry until that step has completed.
We want the object to be deleted last; ordering in call to ClearOnShutdown() can't guarantee it.
Differential Revision: https://phabricator.services.mozilla.com/D75498
2020-05-18 16:12:28 +00:00
Bobby Holley
6e85e332ad
Bug 1631304 - Use thread observers for the tail dispatcher. r=jya
...
Differential Revision: https://phabricator.services.mozilla.com/D71710
2020-04-28 21:18:24 +00:00
Bobby Holley
216d17b976
Bug 1631304 - Mark the tail dispatcher as unavailable outside of event dispatch. r=jya
...
This is in preparation for running the tail dispatcher off
nsIThreadObserver callbacks, which only work during regular
event processing.
Differential Revision: https://phabricator.services.mozilla.com/D72264
2020-04-28 21:18:21 +00:00
Bobby Holley
d90069e220
Bug 1631304 - Reject AbstractThread dispatches after the main thread has ceased event proccessing. r=erahm
...
Differential Revision: https://phabricator.services.mozilla.com/D72263
2020-04-28 21:18:19 +00:00
Bobby Holley
a50600019a
Bug 1631304 - Replace EventTargetWrapper with XPCOMThreadWrapper. r=jya
...
This is how it used to be, before the Quantum DOM stuff. We use
nsIThreadInternal because that supports thread observers, which we
leverage in the next patch.
Differential Revision: https://phabricator.services.mozilla.com/D71709
2020-04-28 21:18:17 +00:00
Jean-Yves Avenard
6fa1bb5971
Bug 1630802 - P9. EventTargetWrapper runners don't need to be cancellable. r=bholley
...
It was required once upon a time to be able to use MozPromise on Workers.
Today a MozPromise work with nsISerialEventTarget and no longer rely on this. It can go.
Differential Revision: https://phabricator.services.mozilla.com/D71442
2020-04-20 02:08:23 +00:00
Jean-Yves Avenard
d882415a98
Bug 1630802 - P8. Remove unnecessary AutoEnter. r=bholley
...
AutoEnter was an attempt around a race between AbstractThread and MessageLoopAbstractThreadWrap that would cause AbstractThread::GetCurrent() to return an incorrect value. MessageLoopAbstractThreadWrapper is no more and as such AutoEnter is no longer required.
Differential Revision: https://phabricator.services.mozilla.com/D71279
2020-04-20 02:13:31 +00:00
Jean-Yves Avenard
f739ba2873
Bug 1630802 - P7. Remove CreateEventTargetWrapper and ensure that only a single AbstractThread exists par nsIThread. r=bholley
...
Differential Revision: https://phabricator.services.mozilla.com/D71492
2020-04-21 03:02:39 +00:00
Jean-Yves Avenard
61ac17fa16
Bug 1630802 - P3. Make AbstractThread::GetCurrent() return MainThread on the main thread. r=bholley
...
prior bug 1364821, AbstractThread::GetCurrent() would always return AbstractThread::MainThread() when called from the main thread.
After this change, we had to run within an AutoEnter scope.
A hidden side effect of this change was that under most cases AbstractThread::MainThread::Dispatch() would no longer use the tail dispatcher to dispatch a task.
It can be safely assume that whenever you're on the main thread, the equivalent AbstractThread is usable.
In the next commit, we will be removing AutoEnter entirely.
Differential Revision: https://phabricator.services.mozilla.com/D71148
2020-04-20 02:07:10 +00:00
Jean-Yves Avenard
08cdd889a1
Bug 1630802 - P1. Cleanup AbstractThread TLS lookup. r=gerald
...
Differential Revision: https://phabricator.services.mozilla.com/D69994
2020-04-20 02:06:51 +00:00
Ciure Andrei
82b75f7098
Backed out 3 changesets (bug 1631304) for causing MediaStream-MediaElement-srcObject.https.html wpt failures CLOSED TREE
...
Backed out changeset 54e27b897b3a (bug 1631304)
Backed out changeset 9ffa1843a04b (bug 1631304)
Backed out changeset 700adf5d3779 (bug 1631304)
2020-04-21 04:25:48 +03:00
Bobby Holley
db090baf2a
Bug 1631304 - Run the TailDispatcher off the Microtask queue. r=jya
...
Differential Revision: https://phabricator.services.mozilla.com/D71488
2020-04-20 19:12:43 +00:00
Ryan Hunt
f4a515c179
Bug 1523969 part 27 - Move method definition inline comments to new line in 'xpcom/'. r=froydnj
...
Differential Revision: https://phabricator.services.mozilla.com/D21131
--HG--
extra : rebase_source : 514f36238d908de221a0116f8e8a5d0cf18a168c
extra : histedit_source : 85743d2586a7307738866ce145b93dae2a664cf3
2019-02-25 16:14:01 -06:00
Karl Tomlinson
3218d3c266
Bug 1529399 replace AutoTaskGuard with equivalent AutoEnter r=padenot
...
Depends on D20605
Differential Revision: https://phabricator.services.mozilla.com/D20606
--HG--
extra : moz-landing-system : lando
2019-02-25 10:49:01 +00:00
Karl Tomlinson
df3203f7f5
bug 1529399 remove now-unnecessary aDrainDirectTasks parameter from EventTargetWrapper::Runner constructor r=padenot
...
Differential Revision: https://phabricator.services.mozilla.com/D20605
--HG--
extra : moz-landing-system : lando
2019-02-25 10:50:02 +00:00
Karl Tomlinson
a18b25dacc
Bug 1529399 Remove unnecessary wrapper runnable from CreateDirectTaskDrainer() for stable state runnables r=padenot
...
The original DrainDirectTask() call was added for reasons described in https://bugzilla.mozilla.org/show_bug.cgi?id=1144486#c16 which should now be unnecessary since https://hg.mozilla.org/integration/autoland/rev/ed7c9d7a635d
The code being removed here was rework to use an appropriate AbstractThread:
https://hg.mozilla.org/mozilla-central/rev/02e5708a75fcdd9e8e4b065995f00b29896fb4b5#l9.32
https://bugzilla.mozilla.org/show_bug.cgi?id=1314833#c76
Differential Revision: https://phabricator.services.mozilla.com/D20604
--HG--
extra : moz-landing-system : lando
2019-02-25 10:50:19 +00: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
Jean-Yves Avenard
6ba9a04554
Bug 1505910 - P2. Remove use of AsTaskQueue(). r=cpearce
...
Make IsCurrentThreadIn() const.
Depends on D11491
Differential Revision: https://phabricator.services.mozilla.com/D11492
--HG--
extra : moz-landing-system : lando
2018-11-12 01:09:03 +00:00
Emilio Cobos Álvarez
fffb25b74f
Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
...
This was done automatically replacing:
s/mozilla::Move/std::move/
s/ Move(/ std::move(/
s/(Move(/(std::move(/
Removing the 'using mozilla::Move;' lines.
And then with a few manual fixups, see the bug for the split series..
MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Nathan Froyd
efd709bd4f
Bug 1447744 - don't implement nsINamed for mozilla::Runnable when it's unused; r=erahm
...
We only use nsINamed on runnables for certain kinds of telemetry, and
those kinds of telemetry aren't being gathered on RELEASE_OR_BETA
builds. We effectively make nsINamed::GetName a no-op when we're not
collecting said telemetry. But implementing nsINamed does have a cost:
the vtable of every runnable (and we have hundreds of subclasses of
mozilla::Runnable) will contain pointers for GetName (and extra pointers
for QueryInterface/AddRef/Release), and all those pointers times all
those subclasses adds up quickly. Let's not implement nsINamed when
nsINamed isn't going to be used.
This change saves ~100K of binary size on x86-64 Linux; the savings
should be similar on other 64-bit systems, and ~50K on 32-bit systems.
2018-03-23 14:53:55 -04:00
Andrea Marchesini
eedd5e2174
Bug 1416724 - part 1 - AbstractThread::Dispatch should propage errors if failing the dispatching of Runnables, r=jwwang
2017-11-15 07:58:02 +01:00
shindli
385fb3428c
Backed out 4 changesets (bug 1416724) for failing /builds/worker/workspace/build/src/dom/media/hls/HLSDemuxer.cpp:89:5 r=backout on a CLOSED TREE
...
Backed out changeset 45352aa4319d (bug 1416724)
Backed out changeset 01d1e5263bcd (bug 1416724)
Backed out changeset bc854c315ec8 (bug 1416724)
Backed out changeset 35a50167485d (bug 1416724)
2017-11-15 09:49:04 +02:00
Andrea Marchesini
e521e16895
Bug 1416724 - part 1 - AbstractThread::Dispatch should propage errors if failing the dispatching of Runnables, r=jwwang
2017-11-15 07:58:02 +01:00
Andrea Marchesini
3f760d8258
Bug 1415564 - TaskQueue::Dispatch should return an error if failed, r=smaug
2017-11-09 01:43:40 +01:00
Bill McCloskey
5466ff7e51
Bug 1386893 - Update AbstractThread thread safety assertions to work with cooperative threading (r=jwwang)
...
MozReview-Commit-ID: 72xKyWOUXL5
2017-08-03 14:19:04 -07:00
Bill McCloskey
2273c53b75
Bug 1364821 - Introduce AbstractThread::AutoEnter and remove main thread's AbstractThread::GetCurrent() (r=jwwang)
...
MozReview-Commit-ID: FSLVn7xe3sq
2017-08-03 14:19:02 -07:00
Bill McCloskey
f115503a0b
Bug 1372405
- Provide names for all runnables in the tree (r=froydnj)
...
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book
8a1350b5a6
Backed out changeset 4f6302a98ae4 (bug 1372405
)
...
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey
6b3e84ed5f
Bug 1372405
- Provide names for all runnables in the tree (r=froydnj)
...
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book
ea1b86680c
Backed out changeset 9846de3bd954 (bug 1372405
)
...
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey
4592152411
Bug 1372405
- Provide names for all runnables in the tree (r=froydnj)
...
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Bill McCloskey
40acc9e3a0
Bug 1366072 - Make AbstractThread inherit from nsISerialEventTarget (r=jwwang)
...
MozReview-Commit-ID: 5L3gUEyGfyL
2017-06-13 14:50:58 -07:00
Kan-Ru Chen
36e1ce5909
Bug 1313200
- Init AbstractThread properly and early. r=froydnj
...
Separate AbstractThread::InitTLS and
AbstractThread::InitMainThread. Init AbstractThread main thread when
init nsThreadManager. Init AbstractThread TLS for all content process
types because for plugin and gmp processes we are doing IPC even
without init XPCOM and for content process init XPCOM requires IPC.
MozReview-Commit-ID: DhLub23oZz8
--HG--
extra : rebase_source : 6e4bfa03ec69e1eb694924903f1fa5e7259cbba3
2017-04-19 13:24:09 +08:00
Ben Kelly
7300a549b0
Bug 1345251 Make MozPromise usable on worker threads. r=gerald
2017-03-08 11:45:07 -05:00
Bevis Tseng
849cf42acf
Bug 1314833 - Part 1.1: Refator XPCOMThreadWrapper as EventTargetWrapper to allow EventTargets to be AbstractThreads. r=jwwang
...
MozReview-Commit-ID: FYjbKxcIc5o
--HG--
extra : rebase_source : 37d55a393552bf4cf5de1ad25c2039fde8517f3a
2016-11-29 13:01:18 +08:00
Matt Woodrow
74b953d168
Bug 1288618 - Part 6: Avoid unnecessarily allocating a TailDispatcher for XPCOMThreadWrapper. r=bholley
2016-09-21 21:24:43 +12:00
Carsten "Tomcat" Book
f918af64da
Backed out 16 changesets (bug 1288618) for bustage on a CLOSED TREE
...
Backed out changeset 06187d250f7a (bug 1288618)
Backed out changeset 2a47f8ea1d89 (bug 1288618)
Backed out changeset e179c8e8265d (bug 1288618)
Backed out changeset 25396a1af922 (bug 1288618)
Backed out changeset e98f835c6ee5 (bug 1288618)
Backed out changeset 24df0e89b273 (bug 1288618)
Backed out changeset f8bbdabdb6da (bug 1288618)
Backed out changeset 8b0adeab93df (bug 1288618)
Backed out changeset 95f23366de82 (bug 1288618)
Backed out changeset 63a9c689e1d5 (bug 1288618)
Backed out changeset 8f67443dccb8 (bug 1288618)
Backed out changeset 4e7fe69d5f45 (bug 1288618)
Backed out changeset 53b113acee42 (bug 1288618)
Backed out changeset 2583ae4e2e3b (bug 1288618)
Backed out changeset 75a61d0e71b7 (bug 1288618)
Backed out changeset da740b4fd484 (bug 1288618)
2016-09-21 08:44:11 +02:00
Matt Woodrow
4caf5b9aa0
Bug 1288618 - Part 6: Avoid unnecessarily allocating a TailDispatcher for XPCOMThreadWrapper. r=bholley
...
--HG--
extra : rebase_source : 38596e6ebfc7eb2fb863e242cee718060abe470c
2016-09-21 15:36:09 +12:00
Carsten "Tomcat" Book
571b01b867
Backed out changeset fdee8d1538b0 (bug 1288618)
2016-09-15 16:34:10 +02:00
Matt Woodrow
9c7f101c32
Bug 1288618 - Part 6: Avoid unnecessarily allocating a TailDispatcher for XPCOMThreadWrapper. r=bholley
2016-09-15 23:17:59 +12:00
Ben Kelly
11d56a06f0
Bug 1300118 P3 Fix TaskQueue sCurrentThread TLS handling for nsIEventTarget targets. r=jwwang
2016-09-13 20:12:15 -07:00
Wes Kocher
42f4e48aee
Backed out 6 changesets (bug 1300118) for frequent Windows VM Xpcshell failures a=backout CLOSED TREE
...
Backed out changeset 24f714ad248c (bug 1300118)
Backed out changeset 6fe61ed092e8 (bug 1300118)
Backed out changeset dd18e29b64bf (bug 1300118)
Backed out changeset 50882fb40551 (bug 1300118)
Backed out changeset 60e82c1780e5 (bug 1300118)
Backed out changeset e40df52925d5 (bug 1300118)
--HG--
extra : amend_source : 7475f45d827654abe309696d73fd86e75a497c32
2016-09-12 16:34:41 -07:00
Ben Kelly
0dbb87a4ff
Bug 1300118 P3 Fix TaskQueue sCurrentThread TLS handling for nsIEventTarget targets. r=jwwang
2016-09-12 12:32:21 -07:00
Ben Kelly
a8a4ae3c4f
Backout rev 5c7368370ff9 to 980659720b86 (bug 1300118 and bug 1300658) for incorrect bug number in commit message. r=me
2016-09-12 12:29:17 -07:00
Ben Kelly
6ef08d4672
Bug 1300118 P3 Fix TaskQueue sCurrentThread TLS handling for nsIEventTarget targets. r=jwwang
2016-09-12 11:21:01 -07:00
Kan-Ru Chen
b6d880aca1
Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
...
The patch is generated from following command:
rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,
MozReview-Commit-ID: AtLcWApZfES
--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
JW Wang
fd8704734d
Bug 1269963. Part 1 - Add a SyncRunnable::DispatchToThread() overload for AbstractThread. r=bobbyholley.
...
MozReview-Commit-ID: Jog4glNrUHw
2016-05-04 16:24:25 +08:00
Kyle Huey
941ab1f522
Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj
2016-05-05 01:45:00 -07:00
Carsten "Tomcat" Book
ba3fe0975c
Backed out changeset 85ce8cb0639a (bug 1268313)
...
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02:00
Kyle Huey
48a594a09e
Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj
2016-04-28 14:08:25 -07:00