Commit Graph

1749 Commits

Author SHA1 Message Date
Kris Maglione
9b7d0838b7 Bug 1475899: Part 1 - Track live nsThreads and add a method of enumerating them. r=erahm
This will allow us to enumerate active threads in order to report their
memory.

MozReview-Commit-ID: IExELSkFdwB

--HG--
extra : source : 2916b5e05b6d100e91448f21cb4082e41a86e87c
2018-07-14 02:19:59 -07:00
Brindusan Cristian
9cde10a0a1 Backed out 5 changesets (bug 1475899) for build bustages on /workspace/build/src/xpcom/base/MemoryMapping.cpp. CLOSED TREE
Backed out changeset fbf0e4b12c8e (bug 1475899)
Backed out changeset b4394660fde2 (bug 1475899)
Backed out changeset e89ebe1f22f2 (bug 1475899)
Backed out changeset 391b97f0e5c0 (bug 1475899)
Backed out changeset 2916b5e05b6d (bug 1475899)
2018-07-19 02:02:40 +03:00
Kris Maglione
4dab7b4343 Bug 1475899: Part 5 - Add thread stack memory reporter for Windows. r=erahm,aklotz
MozReview-Commit-ID: Bv6OPmUhl5Y

--HG--
extra : rebase_source : b159db438a3c1a7b9d2bbb11f36100f9a89d567e
2018-07-17 13:09:45 -07:00
Kris Maglione
3d58783354 Bug 1475899: Part 4 - Add memory reporter for committed thread stack sizes on Linux. r=erahm
Later patches add support for Windows. OS-X will need a follow-up.

MozReview-Commit-ID: DDd6uir4KzM

--HG--
extra : rebase_source : a28826d3331d057f4d35bec56da7738a727d9768
2018-07-14 02:21:30 -07:00
Kris Maglione
9ce29230ec Bug 1475899: Part 2 - Store stack base pointer for nsThreads on Linux. r=erahm,jld
This change stores the base allocation address and actual allocated stack size
(as opposed to the requested size, which may be 0), so that we can map them to
VM regions in a memory reporter.

MozReview-Commit-ID: IZbbyQ9pKHr

--HG--
extra : rebase_source : 1b61bfd63931ce9e2bf9a71905468336971d0956
2018-07-14 02:28:05 -07:00
Kris Maglione
7d18889141 Bug 1475899: Part 1 - Track live nsThreads and add a method of enumerating them. r=erahm
This will allow us to enumerate active threads in order to report their
memory.

MozReview-Commit-ID: IExELSkFdwB

--HG--
extra : rebase_source : 94b63857357639b201b85bdd7bfc4fbe1d4b7f62
2018-07-14 02:19:59 -07:00
Doug Thayer
f460428e9c Bug 1265824 - Add StaticMonitor r=froydnj
For the IPC work monitoring when textures become unlocked, we
need a Monitor equivalent of StaticMutex - this implements that.

MozReview-Commit-ID: IceQNeqVQ8f

--HG--
extra : rebase_source : 184750cfde201ef0ce7e70301761e3e51e82b3a3
2018-06-29 15:27:22 -07:00
Cosmin Sabou
fea686b1f6 Backed out 10 changesets (bug 1265824) for causing reftests failures on global-composite-operation.html. CLOSED TREE
Backed out changeset 391c8e7897df (bug 1265824)
Backed out changeset 27c7daabd1a3 (bug 1265824)
Backed out changeset 7c90215a2eca (bug 1265824)
Backed out changeset c141fb67cf9a (bug 1265824)
Backed out changeset 239ab9f9ef52 (bug 1265824)
Backed out changeset 39ae151b3d8c (bug 1265824)
Backed out changeset 71b23fbe1fec (bug 1265824)
Backed out changeset 295dd1a6a09f (bug 1265824)
Backed out changeset 6aecd088e02c (bug 1265824)
Backed out changeset bf9d73b214fc (bug 1265824)
2018-07-23 19:36:37 +03:00
Doug Thayer
f0121c2b2b Bug 1265824 - Add StaticMonitor r=froydnj
For the IPC work monitoring when textures become unlocked, we
need a Monitor equivalent of StaticMutex - this implements that.

MozReview-Commit-ID: IceQNeqVQ8f

--HG--
extra : rebase_source : b05f8fe9b87e47e57ef8450c91edfdd9244d3287
2018-06-29 15:27:22 -07:00
Tarek Ziadé
0538cd57e2 Bug 1472668 - Don't reset performance counters when reading their values - r=baku
We're changing the counters behavior since they are not notifications anymore.
In the new behavior they don't get reset when they are retrieved,
so we can have several consumers via the promise.

If the values overflow, we let the wrapping occur (unsigned values).

MozReview-Commit-ID: 1adkszScYo4

--HG--
extra : rebase_source : cd554ad4cfa643b09f75bb07e38b5d35e08cf470
2018-07-10 10:06:41 +02:00
Jean-Yves Avenard
1fc1c669ce Bug 1409664 - P8. Make explicit shutdown of TaskQueue optional. r=gerald
Summary:
With this change TaskQueue no longer requires an explicit call to BeginShutdown(). The taskqueue will automatically shutdown once it's now longer referenced.

Depends on D1620

Tags: #secure-revision

Bug #: 1409664

Differential Revision: https://phabricator.services.mozilla.com/D1621
2018-07-03 11:45:18 -07:00
Jean-Yves Avenard
84177fa544 Bug 1409664 - P7. Remove unused TaskQueue method. r=gerald
Summary:
Depends on D1619

Tags: #secure-revision

Bug #: 1409664

Differential Revision: https://phabricator.services.mozilla.com/D1620
2018-07-03 11:45:18 -07:00
Emilio Cobos Álvarez
a36447ed0d Bug 1470930: Make RunnableKind an enum class. r=froydnj
I'm about to introduce a mozilla::Cancelable type, and RunnableKind::Cancelable
would conflict with it otherwise.

MozReview-Commit-ID: 3FAoHAtUE6W
2018-06-26 18:21:19 +02:00
Chris Peterson
2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Doug Thayer
10ff9c706f Bug 1448040 - Remove HangMonitor/ChromeHangs r=Nika
Fairly straightforward, just a blanket removal. Haven't heard
anything on dev-platform or fx-data-dev regarding this removal,
so I think it's likely safe to remove on Nightly, and we can
revert if anyone makes a fuss.

As part of removing the HangMonitor, I renamed a few things and
reorganized the namespaces to not depend on a HangMonitor
namespace. Hopefully this doesn't produce too much noise in the
diff, it just seemed appropriate to move everything around
rather than keep dangling vestiges of the old system.

MozReview-Commit-ID: 8C8NFnOP5GU

--HG--
extra : rebase_source : dd000a05bfc2da40c586644d33ca4508fa5330f6
2018-04-29 18:21:20 -07:00
Jean-Yves Avenard
46cc265bba Bug 1468241 - P1. Add MozPromise::CreateAndResolveOrReject method r=gerald
Useful when using promise chaining in combination with MozPromise::ResolveOrRejectValue parameter.

MozReview-Commit-ID: F8qMh7yFnHQ

Differential Revision: https://phabricator.services.mozilla.com/D1726
2018-06-20 22:14:05 +00:00
Andreea Pavel
f85f162e83 Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2018-06-20 14:31:42 +03:00
Tarek Ziadé
a895a7efea Bug 1464571 - fixes DOM Worker performance counters - r=baku,froydnj
Now uses StaticPrefs instead of DOMPrefs, and how we count dispatches for Workers.

MozReview-Commit-ID: DTumwcI5bG

--HG--
extra : rebase_source : 0cf5312e714fb260c01df647b2cd1fcc28ffc415
2018-06-19 16:14:06 +02:00
Andi-Bogdan Postelnicu
78304aaf0d Bug 1453795 - XPCOM - Initialize member fields in classes/ structures. r=froydnj
--HG--
extra : rebase_source : c9d9e80b83ad52d8ac9203f491f1c9469a7e9b0c
extra : amend_source : ca502ae98ff21a2e3d1ab2d389310f3a5aded5ed
2018-06-15 14:41:20 +03:00
Nathan Froyd
f9040bbbb9 Bug 1458337 - eliminate unneeded runnable histograms; r=farre
We no longer care about these histograms, and the measurements that they
take can be noticed in profiles.
2018-06-13 18:12:11 -04:00
Olli Pettay
bad979936f Bug 1468112 - Use runnable name also for IdleTaskRunner's timer, r=farre 2018-06-12 12:17:08 +03:00
Cosmin Sabou
0f45148664 Backed out changeset 531593bacc4e (bug 1448040) for Android build bustages on HangAnnotations.h. CLOSED TREE
--HG--
extra : rebase_source : ea3618023c548a8ca6ca14749633c194606af52f
2018-06-07 19:22:31 +03:00
Doug Thayer
87bf13e093 Bug 1448040 - Remove HangMonitor/ChromeHangs r=Nika
Fairly straightforward, just a blanket removal. Haven't heard
anything on dev-platform or fx-data-dev regarding this removal,
so I think it's likely safe to remove on Nightly, and we can
revert if anyone makes a fuss.

As part of removing the HangMonitor, I renamed a few things and
reorganized the namespaces to not depend on a HangMonitor
namespace. Hopefully this doesn't produce too much noise in the
diff, it just seemed appropriate to move everything around
rather than keep dangling vestiges of the old system.

MozReview-Commit-ID: 8C8NFnOP5GU

--HG--
extra : rebase_source : 59e4a6ced7d14d2a01c0b79e944078ea84cae523
2018-04-29 18:21:20 -07:00
Andreea Pavel
4ced6e8b2d Merge mozilla-central to autoland. a=merge 2018-06-03 07:27:01 +03:00
Emilio Cobos Álvarez
1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02: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
Dorel Luca
d54a3b06aa Backed out changeset da12c077747f (bug 1448040) for Android build bustage on build/src/obj-firefox/dist/include/mozilla/HangAnnotations.h. CLOSED TREE
--HG--
extra : amend_source : 683201b5a47af3cb7fdcb7426c65f1c9ed713186
2018-05-25 20:13:26 +03:00
Doug Thayer
9765bdd0e0 Bug 1448040 - Remove HangMonitor/ChromeHangs r=Nika
Fairly straightforward, just a blanket removal. Haven't heard
anything on dev-platform or fx-data-dev regarding this removal,
so I think it's likely safe to remove on Nightly, and we can
revert if anyone makes a fuss.

As part of removing the HangMonitor, I renamed a few things and
reorganized the namespaces to not depend on a HangMonitor
namespace. Hopefully this doesn't produce too much noise in the
diff, it just seemed appropriate to move everything around
rather than keep dangling vestiges of the old system.

MozReview-Commit-ID: 8C8NFnOP5GU

--HG--
extra : rebase_source : a8840bd26f4b01b756ffa72345ababb625048550
2018-04-29 18:21:20 -07:00
Brindusan Cristian
309ff0bd1f Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-05-25 03:08:34 +03:00
Nathan Froyd
f97057b242 Bug 1463893 - make nsThreadStartupEvent's destructor private; r=erahm
Whatever compiler bugs required this destructor to be public have
either long since been fixed, or the compilers themselves have become
obsolete.  Plus we get to fix a wrong comment and make another class
final in the process.
2018-05-24 16:44:37 -04:00
Gabriele Svelto
ebc0a715dc Bug 1464229 - Remove obsolete CPU-selection attributes when creating a new process on MacOS X; r=froydnj
MozReview-Commit-ID: DvqC9Vl8i6n

--HG--
extra : rebase_source : da4327f3d45f751032f908fa074be43b49af0086
2018-05-24 14:24:53 +02:00
Csoregi Natalia
2f779be8d9 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-06-02 01:03:45 +03:00
Markus Stange
5c8783fa29 Bug 1462784 - Annotate idle stacks in nsThreadPool. r=froydnj
MozReview-Commit-ID: GtHBHQiXpf3

--HG--
extra : rebase_source : 833e61843ca01402bf90559215c87deb43382bdc
2018-05-24 08:58:44 -04:00
Markus Stange
d562be6650 Bug 1462784 - Annotate idle stacks in the main thread event loop. r=froydnj
MozReview-Commit-ID: I4WSeZtXPBD

--HG--
extra : rebase_source : dc2006446e5fee89c3bc0ac2ff4eb81729093565
2018-05-16 13:26:51 -04:00
Csoregi Natalia
fc2ed6e92a Backed out 18 changesets (bug 1462784) for ESlint failure on FlameGraph.js:1297. CLOSED TREE
Backed out changeset 79556798ff9f (bug 1462784)
Backed out changeset 88321efb673b (bug 1462784)
Backed out changeset 7880f9dc7023 (bug 1462784)
Backed out changeset 71fe35fd1f7e (bug 1462784)
Backed out changeset a543b94b049a (bug 1462784)
Backed out changeset d1ca8b0f2221 (bug 1462784)
Backed out changeset 68eabfbf3c16 (bug 1462784)
Backed out changeset 34e71c789903 (bug 1462784)
Backed out changeset 6fe79d1ca1bd (bug 1462784)
Backed out changeset e5ad2e525ea9 (bug 1462784)
Backed out changeset 329645ff1e23 (bug 1462784)
Backed out changeset e09c38853172 (bug 1462784)
Backed out changeset 0663d1a6d2da (bug 1462784)
Backed out changeset 106967fc29d2 (bug 1462784)
Backed out changeset 99b4a433a8e5 (bug 1462784)
Backed out changeset 1d38a4cf5a4a (bug 1462784)
Backed out changeset 692017229de6 (bug 1462784)
Backed out changeset c2911a626671 (bug 1462784)
2018-06-01 23:42:00 +03:00
Markus Stange
8aaf6f7c90 Bug 1462784 - Annotate idle stacks in nsThreadPool. r=froydnj
MozReview-Commit-ID: GtHBHQiXpf3

--HG--
extra : rebase_source : be3703a710058930bfbcd53463137ab4151356c4
2018-05-24 08:58:44 -04:00
Markus Stange
11e9f7cb35 Bug 1462784 - Annotate idle stacks in the main thread event loop. r=froydnj
MozReview-Commit-ID: I4WSeZtXPBD

--HG--
extra : rebase_source : 34057b3394d0557156a9d5ab82695b352786707d
2018-05-16 13:26:51 -04:00
Noemi Erli
1fd69fa2bc Backed out 18 changesets (bug 1462784) for failures in devtools/client/performance/test/unit/test_tree-model-08.js on a CLOSED TREE
Backed out changeset a74d36598442 (bug 1462784)
Backed out changeset c8192175f360 (bug 1462784)
Backed out changeset cde492240e99 (bug 1462784)
Backed out changeset 8c8d30fa406c (bug 1462784)
Backed out changeset ad3802ffb780 (bug 1462784)
Backed out changeset 2fe10732076c (bug 1462784)
Backed out changeset 268a72b7c3c4 (bug 1462784)
Backed out changeset 4055eb6c3bc6 (bug 1462784)
Backed out changeset 3901070e2e60 (bug 1462784)
Backed out changeset 2faf787fbbdf (bug 1462784)
Backed out changeset 8f06963c7c6f (bug 1462784)
Backed out changeset 036e6f64e224 (bug 1462784)
Backed out changeset e670f156a603 (bug 1462784)
Backed out changeset cd39588aece4 (bug 1462784)
Backed out changeset 2ac65d100fa2 (bug 1462784)
Backed out changeset ea05ff70a51d (bug 1462784)
Backed out changeset 8a06c0ba42f7 (bug 1462784)
Backed out changeset 52ed9a039ad2 (bug 1462784)
2018-06-01 01:06:29 +03:00
Markus Stange
f49ebb6920 Bug 1462784 - Annotate idle stacks in nsThreadPool. r=froydnj
MozReview-Commit-ID: GtHBHQiXpf3

--HG--
extra : rebase_source : 9d5a9c01ca0ffc5b5b8f7546914d4c0f7467ec4a
2018-05-24 08:58:44 -04:00
Markus Stange
f6f086f419 Bug 1462784 - Annotate idle stacks in the main thread event loop. r=froydnj
MozReview-Commit-ID: I4WSeZtXPBD

--HG--
extra : rebase_source : ec639d76a3592a79b4fbced472147ef45e2825ea
2018-05-16 13:26:51 -04:00
Gabriele Svelto
67a43f4a6a Bug 1451005 - Forward all memory-pressure events to the child processes; r=njn
When memory-pressure events were first used in an e10s environment it was
to implement memory minimization from about:memory. However when low memory
detection was first introduced in Firefox OS an issue arised with this scheme:
every process was using a kernel-based low-latency mechanism to detect low
memory scenarios and send memory-pressure events; but the main process events
were also being forwarded to all child processes causing listeners to be
triggered twice. Because of this -no-forward events were introduced and used.
Currently however low-memory is detected via polling, so there will always be
a significant delay between the beginning of the low-memory scenario and its
detection. Because of this there is no value in having content processes poll
on their own and it's best to have only the main process do it and then
forward the memory-pressure events to all child processes.

MozReview-Commit-ID: AMQOsEgECme

--HG--
extra : rebase_source : 1b408b31dd27940981407f50f2e5f07e354b16d7
2018-05-12 01:21:13 +02:00
Andrew McCreight
45174e0771 Bug 1457281 - Remove dom.ipc.scheduler pref. r=froydnj
The JS engine has changed the APIs that cooperative scheduling relies
on into immediate crashes. Some users seem to set the prefs, and then
we get a lot of crashes on Nightly. This removes the top-level pref to
save them some grief.

I continue to pass the pref as false to the child process to avoid
weirdness if we somehow we get this far when the parent and child have
different versions.

MozReview-Commit-ID: 3o3yV2efx2r

--HG--
extra : rebase_source : 398c4d77ce3f78f3814ac97882b4a5e3190c44f7
2018-04-26 14:21:25 -07:00
Jan Henning
991ff633f3 Bug 1335148 - Part 2: Introduce notification for end of memory pressure. r=gsvelto,snorp
For Fennec on Android, if we haven't received memory pressure notifications from
the OS for a certain amount of time (in the order of ~15 mins), we assume that
we're no longer under memory pressure. In order to turn the bfcache back on when
that happens, we now want to be able to forward this fact to Gecko as well.

Unfortunately, the way memory pressure is tracked using an atomic variable
doesn't easily allow to fully extend the existing priority rules between "new"
and "ongoing" to include a new "stopping of memory pressure" event. Since we're
not using Dispatch*Eventual*MemoryPressure on Android and therefore the queuing
priority behaviour isn't actually relevant for us, we just ignore that and only
enforce that a pending "new" memory pressure event takes priority over a "stop"
event.

MozReview-Commit-ID: 90C9KogUyvf

--HG--
extra : rebase_source : 4e71a31433557d8d486f941953717a88d5d87e7d
2018-03-30 13:26:24 +02:00
Tarek Ziadé
90bafd1f42 Bug 1452580 - remove RELEASE_OR_BETA defines for PerformanceCounter usage - r=baku,erahm,farre
PerformanceCounters are currently disabled in two ways:

- a preference that's off by default "dom.performance.enable_scheduler_timing"
- calls made only for nightly using #ifndef RELEASE_OR_BETA

In order to simplify the code, let's remove the #ifndef and rely only on the pref.
That will also allows us to use the feature in every version going forward.

The performance will not be impacted since the current code is already using
the (cached) pref value to determine if the counters are used.

MozReview-Commit-ID: 47t2M1O13aH

--HG--
extra : rebase_source : e129e1829f1dc37c019e50e156474c4876d6d6cb
2018-04-24 22:03:06 +02:00
Nathan Froyd
9362ad6e83 Bug 1454052 - make MakeScopeExit a MOZ_MUST_USE function; r=gerald
Otherwise, one can do thinkos like:

  MakeScopeExit(...);

and the scope exiting function will execute much earlier than the
intended:

  auto guard = MakeScopeExit(...);
2018-04-18 12:14:18 -04:00
Noemi Erli
1b65998665 Merge inbound to mozilla-central. a=merge 2018-04-14 12:49:03 +03:00
Jan de Mooij
2dd36cfeae Bug 1452982 part 9 - Remove/rename remaining ZoneGroup references. r=jonco 2018-04-14 09:03:47 +02:00
Tom Bannister
988d18881f Bug 1434710 - Replaced all instances of mozilla::IndexSequence, mozilla::MakeIndexSequence and mozilla::IndexSequenceFor with std::index_sequence, std::make_index_sequence and std::index_sequence_for and removed mfbt/IndexSequence.h. r=botond
MozReview-Commit-ID: 1Ema7TUNr5v

--HG--
extra : rebase_source : e5bb164dbe19993214e8c16f92b0a1f5d2ff3fa1
2018-04-09 21:12:13 +10:00
Sebastian Hengst
0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon
a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Jim Blandy
863f939532 Bug 1452410 - Simplify ThrottledEventQueue's shutdown behavior. r=froydnj 2018-04-06 14:44:42 -07:00
Nika Layzell
0c3ba13e4c Bug 1437167 - Part 1: Stop using PRIntervalTime as the argument to CondVar::Wait and Monitor::Wait, r=mstange, r=froydnj 2018-04-10 17:49:47 -04:00
Nathan Froyd
038d4e78b8 Bug 1448544 - remove AutoVsyncTelemetry; r=farre
We had this for Quantum DOM, but that effort is stalled/dead, so we
should just remove the code and associated Telemetry histograms.
2018-04-07 11:54:03 -04:00
Tarek Ziadé
f9138cc6f4 Bug 1447768 - part 2 - Dispatch counters in the parent process - r=baku
Chromeutils.RequestPerformanceMetrics() is now composed of two parts:
- calls content processes via IPDL to get their counters
- directly dispatch counters from the parent process

MozReview-Commit-ID: HlgcEOzkyAq

--HG--
extra : rebase_source : 60e81a27cd3a1bf1378e6b977529964507633b63
2018-04-04 13:36:25 +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
Andreas Pehrson
8bb83ab05d Bug 1351655 - Log which SharedThreadPools are not yet destroyed on shutdown-threads. r=froydnj
We risk a shutdown hang without any clues if a dangling reference somewhere
keeps a SharedThreadPool alive past xpcom-shutdown-threads. This because
xpcom-shutdown-threads waits for all SharedThreadPool to be destroyed before
advancing shutdown further. nsCycleCollector::Shutdown comes after
xpcom-shutdown-threads so it is possible that a reference-cycle unexpectedly
keeps a SharedThreadPool alive and blocks shutdown indefinitely.

This patch attempts to help diagnose future cases like this by printing which
SharedThreadPools we are going to wait for to stderr.

MozReview-Commit-ID: CwTApYUMikA

--HG--
extra : rebase_source : f29d04508cf492c82d65f324d7b1990849a0da13
2018-01-23 11:40:37 +01:00
Miko Mynttinen
65c6bee9d6 Bug 1445302 - Replace TArray.RemoveElementAt(TArray.Length() - 1) pattern with TArray.RemoveLastElement() or TArray.PopLastElement() r=froydnj
MozReview-Commit-ID: rGjabnP2iz

--HG--
extra : rebase_source : 1ef6c5ce028ac9ebd9f3176d57835c43fe46bada
2018-03-13 14:51:33 +01:00
Jan-Ivar Bruaroey
2a02bb226b Bug 1445533 - Use for(:) in MozPromise code. r=gerald
MozReview-Commit-ID: BsKR2o25hIQ

--HG--
extra : rebase_source : b150952128e9e7ad3ccc6603b1584dde40b82c5f
2018-03-13 19:13:18 -04:00
Jan-Ivar Bruaroey
608cdac3cb Bug 1445533 - Remove a refcount in MozPromise::Steal(), and use MakeRefPtr a few places. r=gerald
MozReview-Commit-ID: 2jFzxiqBVpc

--HG--
extra : rebase_source : 54947af96e3fc6abb51e73e1ace4b49a6a95fc46
2018-03-13 09:55:01 -04:00
Tarek Ziadé
86edd52973 Bug 1437438 - Add a performance counter to track scheduler activity - r=farre,froydnj
Adds a PeformanceCounter class that is used in DocGroup and WorkerPrivate
to track runnables execution and dispatch counts.

MozReview-Commit-ID: 51DLj6ORD2O

--HG--
extra : rebase_source : b481c9aa3b735569722bb7472872ec2d22adcb89
2018-03-06 10:19:19 +01:00
Nathan Froyd
e7492f2d00 Bug 1443932 - part 1 - add nsIThreadManager::kThreadPoolStackSize; r=erahm
A lot of our thread pools use the default stack size for the platform
they're on, which can be rather large (8MB, usually, on Linux and OS X)
and is probably too much for the typical thread in the thread pool
regardless.  SharedThreadPool already has some logic for selecting a
reasonable stack size for worker threads; let's move that logic to
nsIThreadManager so that logic (and constant) can be shared more
broadly.  (That we already have a couple of instances of
SharedThreadPool usage solely for this constant suggests that it is a
concept that should be available in a more central location.)
2018-03-07 20:33:17 -05:00
Cosmin Sabou
ed1b2a8736 Backed out 4 changesets (bug 1437167) for build bustages on nsUpdateDriver.cpp and WindowsMessageLoop.cpp on a CLOSED TREE.
Backed out changeset b98740e7c639 (bug 1437167)
Backed out changeset 4476e8f51fa6 (bug 1437167)
Backed out changeset c79dc40faa41 (bug 1437167)
Backed out changeset b608d2dcbb86 (bug 1437167)
2018-03-06 00:09:46 +02:00
Nika Layzell
262be91f75 Bug 1437167 - Part 1: Stop using PRIntervalTime as the argument to CondVar::Wait and Monitor::Wait, r=mstange, r=froydnj
MozReview-Commit-ID: BN18I8Q6c7S
2018-03-05 16:00:00 -05:00
Chris Peterson
d09123f248 Bug 1436263 - Part 1: Replace final override virtual function specifiers with just final. r=froydnj
MozReview-Commit-ID: DE5HkIhsZ6D

--HG--
extra : rebase_source : 94831c1e13a840dd2ea0600f64bcf70c2bf938d9
extra : source : cf9283bf1b0bca3a6311c98e227329d451f80ecb
2018-02-05 22:46:57 -08:00
Josh Matthews
b82cc41d64 Bug 1436742 - Expose docgroup used to dispatch events when possible. r=froydnj
--HG--
extra : rebase_source : a317dda863548a795e450e539d4328b5a4ecc050
2018-02-09 16:17:01 -05:00
Andrea Marchesini
8cdf705535 Bug 1435174 - Remove the renaming 'using namespace workers', r=bkelly 2018-02-05 19:55:07 +01:00
Nathan Froyd
ec2a2fe38f Bug 1434856 - move runnable prioritization checks outside of event queue locks; r=erahm
Otherwise, we might enter JS, decide to GC, and deadlock because we were
trying to dispatch tasks to the main thread's event queue while holding
the lock for the event queue.
2018-02-02 13:55:05 -05:00
Byron Campen [:bwc]
c3c54d2281 Bug 1431755 - Part 1: Add a variant of NS_GetCurrentThread that does not auto-create an nsIThread. r=froydnj
MozReview-Commit-ID: 9naTxaANX4u

--HG--
extra : rebase_source : 8ab21e09a6c154b90bd233212680fa93a96e0106
2018-01-19 09:41:22 -06:00
Andreas Pehrson
f12e78691b Bug 1299515 - Make const nsMainThreadPtrHandle<T> usable. r=erahm
This enables having a const nsMainThreadPtrHandle<T> member which we want to
ensure doesn't get assigned to, but whose (the `T`'s) non-const methods are
still usable on main thread. Similar to how RefPtr<T> works.

MozReview-Commit-ID: 8CG0MwIZmLc

--HG--
extra : rebase_source : f0e897d3bf4f9a4d752e964ef63de73a9e710752
2017-11-22 11:24:18 +01:00
Andrea Marchesini
a8a933a51f Bug 1425559 - Implement nsIThreadManager::spinEventLoopUntilOrShutdown, r=smaug
Currently nsIThreadManager::spinEventLoopUntil doesn't monitor the shutting
down. Firefox shutting down can be blocked by a 'broken' use of
nsIThreadManager::spinEventLoopUntil.
nsIThreadManager::spinEventLoopUntilOrShutdown should be used instead.
2018-01-28 08:41:36 +01:00
Chris Peterson
944d82e014 Bug 1428535 - Revert some unnecessary -Wsuggest-override warning suppressions.
It was decided in bug 1430669 that we won't enable gcc's -Wsuggest-override warnings at this time, so these ugly pragmas from bug 1428535 won't be necessary.

--HG--
extra : rebase_source : 221b1f40bb071933ad3e320ce2fa491b2a5917fb
extra : amend_source : 7fc3e6ff067aa5ae8d728e1751de3d2590d31493
2018-01-17 11:39:34 -08:00
Chris Peterson
37efe4d0e6 Bug 1428535 - Add missing override specifiers to overridden virtual functions. r=froydnj
MozReview-Commit-ID: DCPTnyBooIe

--HG--
extra : rebase_source : cfec2d96faeb11656d86d760a34e0a04cacddb13
extra : intermediate-source : 6176724d63788b0fe8caa3f91607c2d93dbaa7ec
extra : source : eebbb0600447f9b64aae3bcd47b4be66c02a51ea
2017-11-05 19:37:28 -08:00
Mike Conley
921cb8735c Bug 1397426 - Rename TabChild's notion of "active tabs" to "visible tabs" and move logic into renderLayers. r=billm
MozReview-Commit-ID: 1bBNwew7uCk

--HG--
extra : rebase_source : 0e59b548c6c01d7feaf9f40c282ab2f55e47bab7
extra : source : 4643e46ff8d3e84d10ff178e15a1be7f734b020f
2017-11-03 11:27:29 -04:00
Andrew McCreight
b2ca279d4f Bug 1426779 - Disable precise runnable leakchecking names on release and beta. r=froydnj
The NS_IMPL_NAMED_* macros rely on the mName field, which are not
defined on beta or release, so don't use them on those branches, so
that Firefox will build.

MozReview-Commit-ID: 9wEnPqshBJ8

--HG--
extra : rebase_source : 1ee201c1f0049b02fb57679908915920226592a2
2018-01-04 12:59:02 -08:00
Andreas Farre
9450b8fef3 Bug 1425566 - Collect telemetry for unlabeled idle runnables. r=erahm 2018-01-03 14:19:03 +01:00
Andrew McCreight
4e452aadbf Bug 1410209, part 3 - Use Runnable::mName for the class name with XPCOM leak checking. r=smaug
Most subclasses of Runnable don't bother to override AddRef and
Release, so XPCOM leak checking ends up reporting Runnable, which
makes it impossible to know what is actually leaking.

Each subclass of Runnable is already required to pass in the name of
the class, which is stored in the field mName. This patch changes
Runnable to use mName as the class name for XPCOM leak checking, thus
giving each subclass a specific name without needing to change the
hundreds of existing subclasses of Runnable.

The limitation of this approach is the classes that DO use
NS_IMPL_ADDREF/RELEASE_INHERITED end up using the same class name that
is used by the superclass AddRef/Release, but with a different size,
which causes assertions in the leak checker. To work around this, I
change NS_IMPL_ADDREF/RELEASE_INHERITED to not call into
NS_LOG_ADDREF/RELEASE for classes that are a subclass of
Runnable. This needs to use IsConvertible<> and not IsBaseOf<> because
the latter requires the classes involved to be defined, and headers
can use nsISupportsImpl.h without nsThreadUtils.h.

MozReview-Commit-ID: H0pgvwQSZAE

--HG--
extra : rebase_source : 0be13fe2e649e62be1f9471fc03fac43024eb0aa
2017-10-25 13:51:17 -07:00
Andreas Farre
40c26995ea Bug 1410096 - Move labeled queues to SchedulerGroup. r=smaug
This improves the performance of GetEvent and PutEvent in
LabeledEventQueue by removing a hash table mapping groups to queues.
2017-12-15 21:17:31 +01:00
Andreas Farre
54b84f70d3 Bug 1417107 - Use histogram key suffix 'unlabeled' instead of 'labeled'. r=erahm
Make unlabeled runnables be the runnables we tag with extra
information, since they're the ones we want to decrease.

Note: This changes values gathered for telemetry!
2017-12-15 17:02:50 +01:00
Jean-Yves Avenard
a1172cfb0e Bug 1424647: Prevent race on AllPromiseHolder::mPromise. r=jwwang
If any of the promises gets resolved/rejected prior MozPromise::All completing, it would return nullptr

MozReview-Commit-ID: Lqhv2t2upvF

--HG--
extra : rebase_source : 0c85172958c00a2ac3aa0bd33e4e50dd1893c3ba
2017-12-10 23:31:04 +01:00
Eric Rahm
07c97a5afe Bug 1423773 - Part 1: Remove usage of nsStringGlue.h. r=glandium
This removes an unnecessary level of indirection by replacing all
nsStringGlue.h instances with just nsString.h.

--HG--
extra : rebase_source : 340989240af4018f3ebfd92826ae11b0cb46d019
2017-12-06 16:52:51 -08:00
Mike Conley
053fbea1fc Backed out changeset 4643e46ff8d3 (bug 1397426)
--HG--
extra : rebase_source : 3e235d725c42300f3c8f3af51850e3c4e1aa7ddf
2017-12-06 16:03:32 -05:00
Mike Conley
cacae0556b Bug 1397426 - Rename TabChild's notion of "active tabs" to "visible tabs" and move logic into renderLayers. r=billm
MozReview-Commit-ID: 1bBNwew7uCk

--HG--
extra : rebase_source : fb907f0e9f02635b122dbf67da7a7c1292427cec
2017-11-03 11:27:29 -04:00
Gabriele Svelto
3e3a359edc Bug 1402519 - Remove MOZ_CRASHREPORTER directives from xpcom; r=froydnj
MozReview-Commit-ID: HS3M0DJQ3qc

--HG--
extra : rebase_source : c535b0760480deea1c9889c629c52857bf52ea64
2017-10-10 11:59:39 +02:00
shindli
fb855aa7ba Backed out 16 changesets (bug 1402519) for conflicts during merge r=backout on a CLOSED TREE
Backed out changeset 07fcf163241a (bug 1402519)
Backed out changeset c6d2ad45d8e2 (bug 1402519)
Backed out changeset 8a3caca61294 (bug 1402519)
Backed out changeset 01425eae2c48 (bug 1402519)
Backed out changeset cf298d3815de (bug 1402519)
Backed out changeset e1964f4389cd (bug 1402519)
Backed out changeset f405337f3569 (bug 1402519)
Backed out changeset a76356fd3359 (bug 1402519)
Backed out changeset d3bb350d1c34 (bug 1402519)
Backed out changeset 9d3bfd9f932c (bug 1402519)
Backed out changeset e3dd6e5b073f (bug 1402519)
Backed out changeset e801b0c00134 (bug 1402519)
Backed out changeset 8a4139fa5dca (bug 1402519)
Backed out changeset 8d01c14ac1ca (bug 1402519)
Backed out changeset 24e0dcd01898 (bug 1402519)
Backed out changeset f8fdf450613f (bug 1402519)
2017-11-23 00:11:44 +02:00
Gabriele Svelto
13364cc36b Bug 1402519 - Remove MOZ_CRASHREPORTER directives from xpcom; r=froydnj
MozReview-Commit-ID: HS3M0DJQ3qc

--HG--
extra : rebase_source : bb09e9e3b01d39e91a1377117fa127a09c29cccd
2017-10-10 11:59:39 +02: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
Jed Davis
c7f8a32bf4 Bug 1401786 - Move base::LaunchApp options into a LaunchOptions struct, like upstream Chromium. r=billm
MozReview-Commit-ID: 74IXV4oGeWR

--HG--
extra : rebase_source : ef4021a60506a8fc5fa5a35e3f3fefb9dbad75d6
2017-09-08 20:35:06 -06:00
Bill McCloskey
9ff9bd7c1e Bug 1412192 - Use main-thread JSContext in SystemZoneResource::IsAvailable (r=froydnj)
MozReview-Commit-ID: BC9OoHVaMEI
2017-11-11 21:04:20 -08:00
Bill McCloskey
0ab7bc4583 Bug 1412191 - Fix CooperativeThreadPool thread count assertion (r=froydnj)
MozReview-Commit-ID: 4oUM0rh4ySs
2017-11-11 21:04:20 -08:00
Bill McCloskey
79162c692a Bug 1395029 - Scheduler support for blockThreadedExecution (r=froydnj)
MozReview-Commit-ID: EXRMRh9SCsQ
2017-11-11 21:04:20 -08:00
Bill McCloskey
38f2553236 Bug 1412189 - Avoid main-thread access in PrioritizedEventQueue::SelectQueue (r=stone)
MozReview-Commit-ID: GY43FXgqr2h
2017-11-11 21:04:20 -08:00
Chris Peterson
feb58d9d37 Bug 1416164 - Replace NS_NOTYETIMPLEMENTED with MOZ_ASSERT_UNREACHABLE. r=froydnj
MozReview-Commit-ID: B5TZB3v52wY

--HG--
extra : rebase_source : 56bef4eead24901191f190e31d2841710097cdcf
2017-10-25 00:37:02 -07:00
Andrea Marchesini
3f760d8258 Bug 1415564 - TaskQueue::Dispatch should return an error if failed, r=smaug 2017-11-09 01:43:40 +01:00
Nicholas Nethercote
79aa95fa24 Bug 1414150 - Remove the "idle_queue.*" prefs. r=farre.
There's no good reason why these can't be code constants.

Especially given that, due to a bug, changes to the
"idle_queue.{min,long}_period" constants were not being passed onto the C++
code!

Here's why: those two prefs were specified as integers in all.js. But we used
AddFloatVarCache() to set up the reading of those prefs. libpref fakes floats
by storing them as strings and then converting them to floats when they are
read.

Which means that AddFloatVarCache() used to fail to get the value from all.js
-- because there's a type mismatch, int vs. string -- and instead use the
fallback default. That value is the same as the one in all.js, which is lucky.
But if someone changed the value in about:config to 100 (an integer), a similar
failure would have occured and the value used by the C++ code wouldn't be
updated!

Also note that idle_queue.max_timer_thread_bound did not have a value in
all.js.

What a mess!

--HG--
extra : rebase_source : 86f8fa905163803eb95007609c029e18c2c4f586
2017-11-08 07:54:16 +11:00
Phil Ringnalda
e0e1cf4354 Backed out 4 changesets (bug 1406327) for crashing other tests, crashing itself, and assertion failures
Backed out changeset 471c710b19b1 (bug 1406327)
Backed out changeset 5890bb3a0d97 (bug 1406327)
Backed out changeset 63c8ee57e38c (bug 1406327)
Backed out changeset 345972733daa (bug 1406327)

MozReview-Commit-ID: IwWx11QSuS4
2017-11-01 21:44:12 -07:00
Daosheng Mu
f10ab3c49f Bug 1406327 - Part 4: RefreshVRDisplays needs to be at VRListenerThread; r=kip
MozReview-Commit-ID: KuhPFqMhTDB

--HG--
extra : rebase_source : 53dac47c5ede72acbe2760f056ca88f8cbc0c6b9
2017-11-01 22:15:06 +08:00
Adam Gashlin
3da1701e2d Bug 1401400 - Part 3. Process all threads when crashing for hang. r=gsvelto
MozReview-Commit-ID: JH4PGYJreF7
2017-10-19 14:49:13 -07:00
Phil Ringnalda
ac48293bbe Backed out 5 changesets (bug 1401400) for eslint failure
Backed out changeset 788f5831a14d (bug 1401400)
Backed out changeset 3ccd39a02c21 (bug 1401400)
Backed out changeset e5860d5128fb (bug 1401400)
Backed out changeset fa28abe68df1 (bug 1401400)
Backed out changeset 0290bb0af376 (bug 1401400)

MozReview-Commit-ID: 8e9kQEaE7Bs
2017-10-26 19:29:38 -07:00
Adam Gashlin
be677dbba0 Bug 1401400 - Part 3: Process all threads when crashing for hang. r=gsvelto 2017-10-19 14:49:13 -07:00
Andrew McCreight
989d6728ca Bug 1412119 - Re-fix mode lines in xpcom. r=erahm 2017-10-26 14:39:00 -04:00
Kris Maglione
b46bd8b6b0 Bug 1411817: Add do_AddRef overloads for nsCOMPtr<T> and nsRevocableEventPtr<T>. r=froydnj
MozReview-Commit-ID: gEU7whtNHc

--HG--
extra : rebase_source : 6763e6b31be8a3341f968eef057b756fbfe3cbbe
extra : amend_source : da6140fb0559d78b46e80e72e8b6768bf2364fb1
2017-10-25 19:46:50 -07:00
Nathan Froyd
a7b1f6e01e Bug 1410575 - avoid hash table re-lookups in LabeledEventQueue::GetEvent; r=erahm
We can save the entry in the hashtable, and then re-use that entry as a
starting point for removing from the hashtable, should that become
necessary.  This saves us having to rehash things, at a minimum.
2017-10-26 13:45:29 -04:00
Sebastian Hengst
31bf3a1a42 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 4Lk5P5UYmTe
2017-10-24 11:52:35 +02:00
Nathan Froyd
322e865fb8 Bug 1402044 - don't inline InputEventStatistics::Get(); r=erahm
Defining Get() in the declaration of InputEventStatistics implicitly
sticks an "inline" on the function, which is not what we want: inlining
it spreads around a lot of static initialization code.  Providing an
out-of-line definition is much better in terms of code size.
2017-10-23 12:15:16 -04:00
Nathan Froyd
8a54fa305a Bug 1410232 - fix SchedulerGroupSet::Put when transitioning to multiple groups; r=billm
We were moving state from single -> multi, but we weren't doing anything
with the group that was passed in for such cases.
2017-10-23 08:49:41 -04:00
Sebastian Hengst
af53b8aad8 merge mozilla-central to autoland. r=merge a=merge 2017-10-23 23:52:54 +02:00
Philippe Normand
bf7e42184a Bug 1410023 - Non-unified build fixes for xpcom/threads. r=froydnj
The recent Timer implementation changes from Bug 1404198 broke non-unified builds.

--HG--
extra : rebase_source : c87acca6565dd282f79dec481f0abf5aea9066a1
2017-10-20 17:36:29 +01:00
Nathan Froyd
7c3d6e9065 Bug 1410088 - don't copy QueueEntry(ies) when calling LabeledEventQueue::GetEvent; r=erahm
We were extracting elements from the queue and unnecessarily refcounting
them, rather than transferring the owning reference out of the queue and
out to the caller.
2017-10-19 16:22:55 -04:00
Nathan Froyd
aeec9a0da6 Bug 1410086 - don't copy QueueEntry(ies) when checking LabeledEventQueue for ready events; r=erahm
There's no need to copy events in the queue to check whether they are
ready to run or not.
2017-10-19 16:22:55 -04:00
Nicholas Nethercote
78030c0e7b Bug 1409598 - Change nsIXPCScriptable::className and nsIClassInfo::{contractID,classDescription} from string to AUTF8String. r=froydnj.
This lets us replace moz_xstrdup() of string literals with AssignLiteral(),
among other improvements.

--HG--
extra : rebase_source : 9994d8ccb4f196cf63564b0dac2ae6c4370defb4
2017-10-18 13:17:26 +11:00
Sebastian Hengst
32f7c8fec3 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: 1h3kZyrtqSt
2017-10-17 11:45:16 +02:00
Kris Maglione
f6ba082a01 Bug 1404198: Part 2b - Switch to NS_NewTimer* in xpcom. r=njn
MozReview-Commit-ID: BEtHEpOmT1E

--HG--
extra : rebase_source : dac8a182f1ad76df6715146e1da1279c02c0406f
2017-10-15 23:11:22 -07:00
Kris Maglione
3c7ea8250b Bug 1404198: Part 2a - Add non-virtual constructors for nsITimer. r=njn
MozReview-Commit-ID: 3I7MAquvMHj

--HG--
extra : rebase_source : 9fb92a49fb9b89aec738aca5f77ef3a612802df6
2017-10-15 23:10:17 -07:00
Daosheng Mu
e41dc03f86 Bug 1392216 - Part 1: Create VR listener thread in GPU process; r=dvander,kip
MozReview-Commit-ID: Img0HT9ax90

--HG--
extra : rebase_source : ef3e2dac31f498454121639aa46657c0cd16f949
2017-10-05 18:12:45 +08:00
Jed Davis
b39b9e95d4 Bug 1406971 - Change nsProcess to use LaunchApp from IPC, instead of NSPR, on Unix. r=froydnj
This also fixes the Unix part of bug 678369, and fixes bug 147659 as a
convenient side-effect of using LaunchApp (which has the desired
fd-closing behavior already) rather than directly using fork/exec.

The main goal is to work around bug 227246, where PR_CreateProcess on
Unix interferes with anything else that tries to use child processes.
This does not fix that bug -- NSPR will still cause problems if used in
that way -- but it's an adequate workaround for that bug in Gecko in
almost all cases (the one known exception is nsAuthSambaNTLM, which uses
NSPR directly and needs to be fixed separately).

Waiting for the child process uses waitpid() directly, sharing the
existing code used for OS X.

MozReview-Commit-ID: 6zfZ1Zgk2i9

--HG--
extra : rebase_source : e8230503d82943af4563d8d63baa029d8a698683
2017-10-06 19:58:33 -06:00
Sebastian Hengst
8ff69604ce merge mozilla-inbound to mozilla-central. r=merge a=merge 2017-10-12 12:40:23 +03:00
Chris Pearce
5ef6d52547 Bug 1407248 - Include StaticPtr.h in SystemGroup.cpp. r=billm
We were using a StaticRefPtr without it being fully defined for
SystemGroupImpl::sSingleton, resulting in a non-unified build failure.

MozReview-Commit-ID: AgSuVvGTri7

--HG--
extra : rebase_source : 906e30e8c2c21e13a045a941e9d92e1d2d2af079
2017-10-10 16:34:27 +02:00
Bill McCloskey
7ccc0ef499 Bug 1404629 - Make Queue emptiness assertion DEBUG-only (r=froydnj)
MozReview-Commit-ID: HIAJKbdiBCf
2017-10-11 14:05:32 -07:00
James Cheng
8cd834cd62 Bug 1365894 - Make SystemGroupImpl be a normal ref-counted object. r=ehsan
MozReview-Commit-ID: LUcoBhNx2M5

--HG--
extra : rebase_source : 10010b8cc206c16980c9e1601445f262104f1dd2
2017-10-09 13:40:12 -04:00
Nicholas Nethercote
8a68e6fb83 Bug 1403868 (part 4) - Reduce tools/profiler/public/*.h to almost nothing in non-MOZ_GECKO_PROFILER builds. r=mstange.
Currently the Gecko Profiler defines a moderate amount of stuff when
MOZ_GECKO_PROFILER is undefined. It also #includes various headers, including
JS ones. This is making it difficult to separate Gecko's media stack for
inclusion in Servo.

This patch greatly simplifies how things are exposed. The starting point is:

- GeckoProfiler.h can be #included unconditionally;

- everything else from the profiler must be guarded by MOZ_GECKO_PROFILER.

In practice this introduces way too many #ifdefs, so the patch loosens it by
adding no-op macros for a number of the most common operations.

The net result is that #ifdefs and macros are used a bit more, but almost
nothing is exposed in non-MOZ_GECKO_PROFILER builds (including
ProfilerMarkerPayload.h and GeckoProfiler.h), and understanding what is exposed
is much simpler than before.

Note also that in BHR, ThreadStackHelper is now entirely absent in
non-MOZ_GECKO_PROFILER builds.
2017-10-04 09:11:18 +11:00
Luke Wagner
c577a512d7 Bug 1347644 - Make NS_ProxyRelease runnables cancelable (r=bkelly)
MozReview-Commit-ID: 238uix57pl6
2017-10-06 10:55:24 -05:00
Cervantes Yu
0469f7535b Bug 1400294 - Add 'noShell' attribute to nsIProcess to use CreateProcess() for launching a process that doesn't require shell service on Windows. r=froydnj,r=aklotz,r=dmajor
This adds an attribute 'noShell' to nsIProcess that is used to launch a process
using CreateProcess() if we are sure we are launching an executable and don't
require the extra work of the Windows shell service.

MozReview-Commit-ID: 7p0iHCZK1uX
2017-10-03 11:29:14 +08:00
Wes Kocher
0196bb1eed Merge m-c to inbound, a=merge
MozReview-Commit-ID: 9KMX1mdjylD
2017-09-29 14:48:25 -07:00
Wes Kocher
eb9a2ed0f2 Merge inbound to central, a=merge
MozReview-Commit-ID: IqwKWn7ceHC
2017-09-29 14:47:25 -07:00
Cosm
b4871889d9 Bug 1385335 - Use RecursiveMutex in AsyncPanZoomController.r=botond
MozReview-Commit-ID: ETzQVCu1o7z

--HG--
extra : rebase_source : c7126c098f63e8ce12506dfaee0d995091512b06
2017-09-27 08:41:51 +05:30
David Major
d381d825e6 Bug 1376638 followup: update comment to reflect code changes. DONTBUILD 2017-09-29 12:25:10 -04:00
Philippe Normand
cf92431595 Bug 1404305 - Include nsCOMArray.h and SystemGroup in nsThreadPool.cpp to fix the build in non-unified mode. r=froydnj
MozReview-Commit-ID: 1bZHw4TS9L1

--HG--
extra : rebase_source : 8ee48871ab0ae82c70ce7eb3bd64e0497891fc97
2017-09-28 14:32:26 +01:00
Wes Kocher
22a72df7fe Merge inbound to m-c a=merge
MozReview-Commit-ID: 6viJ4wRxLa8
2017-09-26 15:54:51 -07:00
Bevis Tseng
da72a5478c Bug 1399707 - Make entries in TabChild::sActiveTabs and EventLoopActivation::mEventGroups unique. r=billm
--HG--
extra : rebase_source : ffccc53b6b1055d7cfeb281ee145b897807a7810
2017-09-13 11:59:35 +08:00
Sebastian Hengst
7eec7a0a11 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: mr7OYuaLKE
2017-09-21 15:23:43 +02:00
Nathan Froyd
3393422869 Bug 1401662 - don't inline nsThreadManager::get(); r=erahm
Defining get() in the declaration of nsThreadManager implicitly sticks
an "inline" on the function, which is not what we want: inlining it
spreads around a lot of static initialization code.  Providing an
out-of-line definition is much better in terms of code size.
2017-09-20 17:10:20 -04:00
Byron Campen [:bwc]
6b3da0609f Bug 1383019: Move more logic under the protection of nsTimerImpl::mMutex, and simplify. r=froydnj, a=abillings
MozReview-Commit-ID: JjYScKwyika

--HG--
extra : rebase_source : a5a8a17f86459ace51d9250454bd4cf1433130b0
2017-09-14 12:19:24 -05:00
Philippe Normand
fb80b50e2e Bug 1399825 - Include nsXULAppAPI.h in nsThreadManager.cpp. r=Ms2ger
This ensures XRE_IsContentProcess() is defined, as it's used in this file.

MozReview-Commit-ID: GwBYcFBiUBK
2017-09-14 12:51:41 +01:00
James Cheng
0c675a3236 Bug 1393710 - Add thread name into NS_DebugBreak for better debugging. r=froydnj
MozReview-Commit-ID: AvqajMgtpuh

--HG--
extra : rebase_source : 13e99f103abc9e39ec4cff15f720cd09a9e6b2c5
2017-08-30 11:13:50 +08:00
Wes Kocher
1ea82f66aa Merge m-c to autoland, a=merge
MozReview-Commit-ID: AHxJvcR2Tpa
2017-09-20 17:47:16 -07:00
Blake Kaplan
04b86e2150 Bug 1398393 - Set Servo thread state on cooperative threads. r=billm
By doing this we avoid triggering assertions in the Servo code that ensure
we have registered the thread with Servo and set the proper state on it.

MozReview-Commit-ID: K6qHrYoQDLm

--HG--
extra : rebase_source : d01b0aad42273f6b92b7cfd5f5fe17ffe7b4cda0
2017-09-08 16:50:34 -07:00
Blake Kaplan
c1ce54a82a Bug 1401412 - Destroy this singleton during XPCOM shutdown. r=smaug
Unfortunately, this needed some additional trickery in order to keep its
constructor "private". I stole this trick from [1]. With this patch, we tear
down the statistics object during XPCOM shutdown intead of after it. I don't
believe that we need the object to live past the ClearOnShutdown destructors.

[1] http://rienajouter.blogspot.com/2014/10/makeshared-and-makeunique-for-classes.html

MozReview-Commit-ID: JsiN6Bq9Yp4

--HG--
extra : rebase_source : dd26c8e6906a6c9fd500c28379f8c63fd7c3ad6a
2017-09-19 17:38:05 -07:00
Bill McCloskey
0f4e7d4fe6 Bug 1398423 - Fix LabeledEventQueue bug with unlabeled events (r=froydnj)
MozReview-Commit-ID: 7ru62QTkya2
2017-09-11 19:11:03 -07:00
Bill McCloskey
b9683a5b18 Bug 1398423 - Make linked list of SchedulerGroups static (r=froydnj)
MozReview-Commit-ID: GgfdRlhPiHP
2017-09-11 19:11:01 -07:00
Bill McCloskey
9c4cbe52d1 Bug 1398417 - Fix PrioritizedEventQueue bugs with input event prioritization (r=stone)
MozReview-Commit-ID: 4wk8EUv0h7C
2017-09-11 19:10:57 -07:00
James Cheng
fb6af85bd2 Bug 1397344 - Use Decay to ensure StoreCopyPassByXXX stores the value by copy not by reference. r=gerald
MozReview-Commit-ID: Ec9yjYdQ1jC

--HG--
extra : rebase_source : 6b2f63bf7af9a3c8a879ac6f3865abf6be9a4155
2017-09-07 17:02:13 +08:00
Bill McCloskey
9cbaae8cfc Bug 1396155 - Allow LabeledEventQueue to be used outside the Scheduler (r=froydnj)
MozReview-Commit-ID: 4yEX39HXh9W
2017-09-07 22:31:34 -07:00
Bill McCloskey
4219e067da Bug 1396155 - Support active tab prioritization and round-robin scheduling in LabeledEventQueue (r=froydnj)
MozReview-Commit-ID: Ax5rWAKN50h
2017-09-07 22:31:34 -07:00
Philippe Normand
af237419fa Bug 1402824 - Include nsComponentManagerUtils.h in nsThreadUtils.cpp to fix non-unified build. r=billm
do_CreateInstance was used without prior declaration.

MozReview-Commit-ID: 4LkXAcZytM7

--HG--
extra : rebase_source : a983330be02ed058a109ba3bbfd6ecdd3f2ddf56
2017-09-25 11:01:25 +01:00
Philippe Normand
41218b0c60 Bug 1402824 - Include LabeledEventQueue.h in ThreadEventQueue.cpp to fix non-unified build. r=billm
LabeledEventQueue was used without prior declaration.

MozReview-Commit-ID: 3aqGDb0cZFY

--HG--
extra : rebase_source : 08e207b2024e5ba1be1eb0c55ddbe7b0fc405637
2017-09-25 10:59:47 +01:00
Philippe Normand
98e504e3be Bug 1402824 - Include AbstractThread in SystemGroup.cpp to fix non-unified build. r=billm
AbstractThread was used without prior declaration.

MozReview-Commit-ID: BmP83mmjX3b

--HG--
extra : rebase_source : 4f079246b7dd6c378eba97897f74a3c9623540df
2017-09-25 10:59:02 +01:00
Philippe Normand
4e80469013 Bug 1402824 - Include nsIThreadInteral.h in SynchronizedEventQueue to fix non-unified. r=billm
nsIThreadObserver (defined in nsIThreadInternal.h) was used without prior
declaration.

MozReview-Commit-ID: 9cSuERgUPtl

--HG--
extra : rebase_source : 15219cba6f5a41c42aa1103d8c958a55ac3b9af0
2017-09-25 10:56:13 +01:00
Philippe Normand
8bb48e0de1 Bug 1402824 - Add missing includes in Scheduler.h to fix non-unified build. r=billm
nsTArray and EventLoopActivation were used without prior declaration.

MozReview-Commit-ID: C05YG6Nzh52

--HG--
extra : rebase_source : 3f78b6a1d73f4d59d3aac4b2da79c27cae404897
2017-09-25 10:55:10 +01:00