Граф коммитов

2088 Коммитов

Автор SHA1 Сообщение Дата
Nick Alexander 83b88fa9d4 Bug 1612032 - Remove vestigial NS_FUNCTION_TIMER. r=froydnj
This should have been removed years ago with Bug 792502.

Differential Revision: https://phabricator.services.mozilla.com/D88054
2020-08-24 18:47:18 +00:00
Honza Bambas 2bc91fef35 Bug 1657974 - MOZ_LOG schedule and run of `FrameRequestCallback`, r=froydnj
Depends on D86740

Differential Revision: https://phabricator.services.mozilla.com/D86741
2020-08-13 14:41:16 +00:00
Honza Bambas 13026539fa Bug 1657960 - MOZ_LOG schedule and run of `mStyleFlushObservers` and `mLayoutFlushObservers`, r=froydnj
Depends on D86737

Differential Revision: https://phabricator.services.mozilla.com/D86738
2020-08-13 14:41:15 +00:00
Doug Thayer 5f41a2f565 Bug 1658732 - Replace mStartupFinished with TryLock in StartupCache r=froydnj
To be honest, it's still a mystery why we observed a regression in
sessionrestore_no_auto_restore in bug 1658732. The regression won't reproduce
on profiled runs, and the bad recordings happen before the supposedly offending
code ever actually runs. It feels most likely that it is a more or less random
confluence of factors causing a regression; however, 33% is too large of a
number to ignore.

The changes in this patch do not seem to yield the same regression, and they
are arguably more correct anyway. Instead of simply turning off the cache after
startup is finished, we simply avoid blocking waiting for the write from inside
GetBuffer. This way, if the write is not getting in the way of GetBuffer, we
can still benefit from a cached version of whatever it is we're looking for.

Differential Revision: https://phabricator.services.mozilla.com/D87221
2020-08-20 18:37:21 +00:00
Erik Nordin 943f31b50b Bug 1659875 - Fix Incorrect Assertion In Mutex.h r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D87527
2020-08-19 01:41:24 +00:00
Gerald Squelart 6635ca3144 Bug 1659034 - Only call PROFILER_UNREGISTER_THREAD in nsThread::ThreadFunc if PROFILER_REGISTER_THREAD was called before - r=canaltinova
Differential Revision: https://phabricator.services.mozilla.com/D87050
2020-08-14 10:53:39 +00:00
Nathan Froyd e3ebda1914 Bug 1223932 - delete guard object uses from the tree; r=jwalden
CLOSED TREE

We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Mihai Alexandru Michis a911a108d0 Backed out changeset ac9c811bc427 (bug 1223932) for causing spidermonkey rust failures.
CLOSED TREE
2020-07-30 18:23:21 +03:00
Nathan Froyd bec9f9b93a Bug 1223932 - delete guard object uses from the tree; r=jwalden
We don't need these macros anymore, for two reasons:

1. We have static analysis to provide the same sort of checks via `MOZ_RAII`
   and friends.
2. clang now warns for the "temporary that should have been a declaration" case.

The extra requirements on class construction also show up during debug tests
as performance problems.

This change was automated by using the following sed script:

```
# Remove declarations in classes.
/MOZ_DECL_USE_GUARD_OBJECT_NOTIFIER/d
/MOZ_GUARD_OBJECT_NOTIFIER_INIT/d

# Remove individual macros, carefully.
{
  # We don't have to worry about substrings here because the closing
  # parenthesis "anchors" the match.
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_TO_PARENT)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_PARAM_IN_IMPL)/)/g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_IN_IMPL)/)/g;

  # Remove the longer identifier first.
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM_TO_PARENT//g;
  s/MOZ_GUARD_OBJECT_NOTIFIER_ONLY_PARAM//g;
}

# Remove the actual include.
\@# *include "mozilla/GuardObjects.h"@d
```

and running:

```
find . -name \*.cpp -o -name \*.h | grep -v 'GuardObjects.h' |xargs sed -i -f script 2>/dev/null
mach clang-format
```

Differential Revision: https://phabricator.services.mozilla.com/D85168
2020-07-30 14:22:38 +00:00
Kristen Wright 8ae32c1779 bug 1637829 - Increase the number of background pool threads r=froydnj
Having a thread limit of 1 in the background thread pools causes deadlock when attempting synchonous dispatch on the same pool. Increasing the thread limit on each pool to 2 lessens the risk of this kind of deadlock, so it's not the perfect solution where we wouldn't allow any kind of offthread synchronous dispatch that could cause a deadlock. These thread pools may eventually scale larger, so this patch sets the idle thread limit low.

Differential Revision: https://phabricator.services.mozilla.com/D83999
2020-07-21 15:07:27 +00:00
Bas Schouten 562faeceb0 Bug 1651842: Fix event delay being not/incorrecty reported when using TaskController. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D83542
2020-07-17 19:21:16 +00:00
Jean-Yves Avenard 498938c5ca Bug 1651249 - Dispatch to the current SerialEventTarget by default. r=froydnj
Dispatching to the underlying thread of what could be a thread-pool can lead to data-race as the code won't be run where you expect it to.

Differential Revision: https://phabricator.services.mozilla.com/D82632
2020-07-14 21:17:31 +00:00
Honza Bambas b3cbab1c49 Bug 1651068 - Include `Task` from `TaskController` in MOZ_LOG=events, r=bas
Differential Revision: https://phabricator.services.mozilla.com/D83065
2020-07-14 16:17:18 +00:00
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