Commit Graph

2075 Commits

Author SHA1 Message Date
Bas Schouten
43311c24a3 Bug 1650629: Correctly wait when requested and report whether work was done by ProcessNextEvent when using TaskController. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D83004
2020-07-09 23:41:15 +00:00
Perry Jiang
9c0f970552 Bug 1642906 - initialize PerformanceCounter in WorkerPrivate initialization r=dom-workers-and-storage-reviewers,sg
- Fixes a data race where the member variable is being written to by
EnsurePerformanceCounter on the worker thread while being read on a separate
thread (via Worker.postMessage).
- Apply some pointer guildelines to the member variable getters.
- Constify some things that should be const.

Differential Revision: https://phabricator.services.mozilla.com/D82475
2020-07-09 05:23:14 +00:00
Jean-Yves Avenard
8ebce5b5a8 Bug 1649671 - Add DelayedDispatch support to AbstractThread (and TaskQueue). r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81811
2020-07-02 00:08:54 +00:00
Simon Giesecke
61e4a0be9b Bug 1649729 - Get rid of MOZ_ACCESS_THREAD_BOUND macro. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81843
2020-07-01 13:13:23 +00:00
Simon Giesecke
cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Bas Schouten
6323c24374 Bug 1606706 - Part 3: Enable new TaskController code by default. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D74673
2020-07-01 01:36:08 +00:00
Jean-Yves Avenard
4a24fe3c8e Bug 1647958 - P3. Have GetCurrentSerialEventTarget returns the currently running MessageLoop. r=nika
We want it to returning the actual nsThread if that's where the MessageLoop would dispatch its tasks; otherwise return the MessageLoop's EventTarget

Depends on D80357

Differential Revision: https://phabricator.services.mozilla.com/D80811
2020-06-30 08:04:10 +00:00
Honza Bambas
e3c8fc6ab0 Bug 1648781 - MOZ_LOG of timer events dispatch and run, MOZ_LOG of idle-dispatch timeout, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D81467
2020-06-30 10:57:28 +00:00
Brindusan Cristian
6f757f82da Backed out 2 changesets (bug 1647958) for conflicting with the backout of Bug 1648898. CLOSED TREE
Backed out changeset 55ecb48a0504 (bug 1647958)
Backed out changeset af210e0df79f (bug 1647958)
2020-06-30 10:59:29 +03:00
Jean-Yves Avenard
35e8e946e1 Bug 1647958 - P3. Have GetCurrentSerialEventTarget returns the currently running MessageLoop. r=nika
We want it to returning the actual nsThread if that's where the MessageLoop would dispatch its tasks; otherwise return the MessageLoop's EventTarget

Depends on D80357

Differential Revision: https://phabricator.services.mozilla.com/D80811
2020-06-30 02:49:05 +00:00
Nihanth Subramanya
359cdd5536 Bug 1555557 - Do cert override file writes off the main thread. r=keeler
Differential Revision: https://phabricator.services.mozilla.com/D35375
2020-06-29 17:00:58 +00:00
Nathan Froyd
d862df6fa7 Bug 1648787 - remove MOZ_GUARD_OBJECT bits from RecursiveMutex; r=dmajor,xpcom-reviewers,nika
Apparently I added these in the initial commit for RecursiveMutex.  I'm
not quite sure what I was thinking, but we don't need them for the
RecursiveMutex itself.  (We have them on the corresponding `*Auto*Lock`
classes, which are also `MOZ_RAII`.)

Differential Revision: https://phabricator.services.mozilla.com/D81345
2020-06-29 15:37:21 +00:00
Honza Bambas
2b6b893f89 Bug 1638925 - Ensure that the event gets destroyed within the guards r=jya
Differential Revision: https://phabricator.services.mozilla.com/D80171
2020-06-24 13:51:25 +00:00
Honza Bambas
2946f7e5b9 Bug 1638925 - Do not keep a raw pointer to an event in LogTaskBase::Run RAII class to avoid possible work with a released pointer, r=jya
Differential Revision: https://phabricator.services.mozilla.com/D80640
2020-06-24 13:51:23 +00:00
Honza Bambas
5c088661ed Bug 1638925 - Log IPC messages, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79621
2020-06-25 12:27:51 +00:00
Honza Bambas
a81bb249b1 Bug 1638925 - Log names of nsINamed runnables, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79620
2020-06-24 13:49:44 +00:00
Honza Bambas
8ef571ccca Bug 1638925 - Log promise microtasks dispatch-and-run, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79618
2020-06-24 13:49:09 +00:00
Brindusan Cristian
d41e442d47 Backed out 2 changesets (bug 1606706) for wpt leaks. CLOSED TREE
Backed out changeset 42b8f6456d16 (bug 1606706)
Backed out changeset 3fe0b4051541 (bug 1606706)
2020-06-25 14:53:30 +03:00
Bas Schouten
f9399d1df7 Bug 1606706 - Part 3: Enable new TaskController code by default. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D74673
2020-06-25 08:04:01 +00:00
Jean-Yves Avenard
05a0f10af0 Bug 1637500 - P3. Have GetCurrentSerialEventTarget return running XPCOMThreadWrapper. r=froydnj
This will allow to remove AbstractThread::Current() as GetCurrentSerialEventTarget TLS value will be set whenever a task dispatched on the XPCOMThreadWrapper is run.

Differential Revision: https://phabricator.services.mozilla.com/D80355
2020-06-23 05:05:38 +00:00
Jean-Yves Avenard
87438519f0 Bug 1637500 - P2. Rename methods as they are not always dealing with "threads". r=froydnj
Before P1, GetCurrentThreadSerialEventTarget would have always returned the same data as NS_GetCurrentThread, making the comment incorrect Now it will properly return the running TaskQueue if any.

This change of name more clearly exposes what they are doing, as we aren't always dealing with threads directly; but a nsISerialEventTarget

Differential Revision: https://phabricator.services.mozilla.com/D80354
2020-06-23 05:05:36 +00:00
Jean-Yves Avenard
28c38fcc2b Bug 1637500 - P1. Have GetCurrentThreadSerialEventTarget returns the currently running TaskQueue if any. r=froydnj
In the future, we may want to extend GetCurrentThreadSerialEventTarget to return the actual nsISerialEventTarget used to dispatch the task.

Differential Revision: https://phabricator.services.mozilla.com/D80353
2020-06-23 05:02:39 +00:00
Jean-Yves Avenard
4e20dd6e65 Bug 1646054 - P2. Always retain dispatch flags r=froydnj
When TaskQueue was first conceived; it was only used with AbstractThreads and with tail dispatch.
By default, AbstractThread::Dispatch dropped the flags , as it was dispatching all tasks via the tail dispatcher.

It was an oversight, there's no use-case where we wouldn't want the dispatch flags to be carried forward.

It also simplifies the code and TaskQueue's use.

Depends on D80351

Differential Revision: https://phabricator.services.mozilla.com/D80352
2020-06-22 13:55:23 +00:00
Jean-Yves Avenard
ea34205395 Bug 1646054 - P1. Remove EventTargetWrapper class. r=froydnj
We also establish the intent of bug 1602167 on the TaskQueue object

Differential Revision: https://phabricator.services.mozilla.com/D80351
2020-06-22 13:55:21 +00:00
David Major
2a6bf134e0 Bug 1646407 - Fix a snprintf complaint in nsTimerImpl.cpp r=njn
We have a clang-plugin check that wants to prefer `SprintfLiteral` over `snprintf`, but for some reason this wasn't caught before clang-11. I _think_ it has to do with previous versions not being able to see that `buflen` was constant, but I'm not really sure.

Differential Revision: https://phabricator.services.mozilla.com/D80021
2020-06-21 13:12:30 +00:00
Eric Rahm
ba9b93f039 Bug 1646543 - Replace blacklist with more appropriate names. r=xpcom-reviewers,nika
This removes variants of "blacklist" from the xpcom directory. The preference name "network.file.path_blacklist" is left in place and will need a more thorough plan for removal. Instances of `MOZ_ASAN_BLACKLIST` remain as well and should be replaced in a larger modifcation of the `#define` in the mfbt component.

Differential Revision: https://phabricator.services.mozilla.com/D80098
2020-06-17 23:55:46 +00:00
Brindusan Cristian
35fe5d64b2 Backed out 4 changesets (bug 1638925) for build bustages at ipc_channel_posix.cc. CLOSED TREE
Backed out changeset e0fe5351fdf7 (bug 1638925)
Backed out changeset 2c8b67413cd6 (bug 1638925)
Backed out changeset 4ea2c9ceb540 (bug 1638925)
Backed out changeset 84236f1b9064 (bug 1638925)
2020-06-17 20:28:41 +03:00
Honza Bambas
f2278bf3e2 Bug 1638925 - Log IPC messages, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79621
2020-06-17 16:15:06 +00:00
Honza Bambas
91ff5e401f Bug 1638925 - Log names of nsINamed runnables, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79620
2020-06-17 16:14:27 +00:00
Honza Bambas
828868b839 Bug 1638925 - Log promise microtasks dispatch-and-run, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79618
2020-06-17 16:13:51 +00:00
Simon Giesecke
298981065e Bug 1645339 - Use range-based for with nsTObserverArray in xpcom. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D79484
2020-06-15 08:55:27 +00:00
Jean-Yves Avenard
d5528b6394 Bug 1641737 - P4. Add UseDirectTaskDispatch/UseSynchronousDispatch to MozPromiseHolder. r=bholley
The allows to not have to deal with MozPromise::Private directly.

Differential Revision: https://phabricator.services.mozilla.com/D78208
2020-06-12 05:56:39 +00:00
Jean-Yves Avenard
7b7d64db67 Bug 1641737 - P1. Set dispatch type to chained promises. r=bholley
When chaining a MozPromise set to be dispatched via the direct task queue (or synchronous), it makes sense for the chained promise to be dispatched in the same fashion.

All MozPromises generated by the IPC bindings are set to use the direct task queue in order to prevent the then runnable to run out of order with other IPC tasks.
We want to preserve that task ordering by default.

Differential Revision: https://phabricator.services.mozilla.com/D78178
2020-06-12 05:56:26 +00:00
Jean-Yves Avenard
4e41c1b386 Bug 1644009 - P14. Fallback to normal dispatch on release. r=bholley
We shouldn't ever get there, but just in case, better than a null deref.

Differential Revision: https://phabricator.services.mozilla.com/D79097
2020-06-12 05:10:57 +00:00
Jean-Yves Avenard
a56b255f0f Bug 1644009 - P13. Don't have AutoTaskGuard inherit from AutoTaskDispatcher. r=bholley.
This prevent being able to assert in the AutoTaskDispatcher that we are using it from the right thread/taskqueue as the SimpleTaskQueue object isn't thread-safe.

We want to assert that all nsIDirectTaskDispatcher methods are only ever accessed on the underlying thread. To do so require that the scope of AutoTaskDispatcher to terminate prior the AutoTaskGuard one.

Differential Revision: https://phabricator.services.mozilla.com/D79096
2020-06-12 05:10:55 +00:00
Jean-Yves Avenard
d846483194 Bug 1644009 - P10. Make MozPromise access direct task dispatcher using QI(nsIDirectTaskDispatcher). r=bholley
Differential Revision: https://phabricator.services.mozilla.com/D79094
2020-06-12 05:10:32 +00:00
Jean-Yves Avenard
1e2af615c7 Bug 1644009 - P9. Add nsIDirectTaskDispatcher interface. r=froydnj
We extract the dealing of direct tasks from the TailDispatcher object and move into to the existing nsThread and TaskQueue classes.
TaskQueue is made to work with do_QueryInterface.

We continue accessing the direct tasks dispatcher via the TailDispatcher for now, which itself will forward the dealing of such tasks to the underlying thread.

Differential Revision: https://phabricator.services.mozilla.com/D79093
2020-06-12 05:10:25 +00:00
Jean-Yves Avenard
974a9641a4 Bug 1644009 - P8. Add SimpleTaskQueue object. r=froydnj
We will use it later for implementing direct task dispatching where required.

Differential Revision: https://phabricator.services.mozilla.com/D79092
2020-06-12 05:10:12 +00:00
Bas Schouten
45104a7a29 Bug 1644292: Duplicate code for runnable telemetry for runnables executed inside TaskController. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D78888
2020-06-09 13:02:37 +00:00
Bas Schouten
c2dc5d2a40 Bug 1644288: Explicitly do not use timeDurationHelper when TaskController is enabled. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D78825
2020-06-09 12:42:24 +00:00
Razvan Maries
caec984d54 Backed out 7 changesets (bug 1641737) assertion failures. CLOSED TREE
Backed out changeset 7f7b98339065 (bug 1641737)
Backed out changeset 32fba417ebd0 (bug 1641737)
Backed out changeset abd9cd77f3cb (bug 1641737)
Backed out changeset e3bf9a45db6a (bug 1641737)
Backed out changeset 94d47578009c (bug 1641737)
Backed out changeset 28bca5c5b8b4 (bug 1641737)
Backed out changeset 0296d0f6c1d1 (bug 1641737)
2020-06-09 18:55:08 +03:00
Jean-Yves Avenard
bb29b401bc Bug 1641737 - P4. Add UseDirectTaskDispatch/UseSynchronousDispatch to MozPromiseHolder. r=bholley
The allows to not have to deal with MozPromise::Private directly.

Differential Revision: https://phabricator.services.mozilla.com/D78208
2020-06-09 07:23:57 +00:00
Jean-Yves Avenard
0e3faed81f Bug 1641737 - P1. Set dispatch type to chained promises. r=bholley
When chaining a MozPromise set to be dispatched via the direct task queue (or synchronous), it makes sense for the chained promise to be dispatched in the same fashion.

All MozPromises generated by the IPC bindings are set to use the direct task queue in order to prevent the then runnable to run out of order with other IPC tasks.
We want to preserve that task ordering by default.

Differential Revision: https://phabricator.services.mozilla.com/D78178
2020-06-09 07:23:29 +00:00
Dana Keeler
ac4d01ea49 Bug 1644224 - make nsTimerEvent::sCanDeleteAllocator atomic/sequentially consistent r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78771
2020-06-08 19:59:40 +00:00
Simon Giesecke
ebbc7ae838 Bug 1642989 - Use RemoveLastElements instead of RemoveElementsAt where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78049
2020-06-08 08:50:15 +00:00
Simon Giesecke
13502cf27c Bug 1642991 - Use RemoveElementsBy where easily possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D78055
2020-06-08 09:01:48 +00:00
Bas Schouten
8032d4373e Bug 1606706 - Part 2: Integrate new TaskController code into tree and allow usage by pref. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D74672
2020-06-04 00:02:18 +00:00
Bas Schouten
c01e9666a7 Bug 1606706 - Part 1: Add new TaskController code to the tree. r=smaug,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D74671
2020-06-03 23:39:58 +00:00
Bogdan Tara
2719f07eb0 Backed out 2 changesets (bug 1606706) for talos tests timeouts CLOSED TREE
Backed out changeset ab3e1a067a71 (bug 1606706)
Backed out changeset c47cf57dab71 (bug 1606706)
2020-06-03 11:51:04 +03:00
Bas Schouten
3a3972c388 Bug 1606706 - Part 2: Integrate new TaskController code into tree and allow usage by pref. r=smaug,?
Differential Revision: https://phabricator.services.mozilla.com/D74672
2020-06-02 11:36:38 +00:00