Commit Graph

1125 Commits

Author SHA1 Message Date
Gerald Squelart
25992688b7 Bug 1332825 - Use move semantics in MozPromise::All() and AllPromiseHolder - r=jwwang
MozPromise::All sets up 'Then' lambdas on all sub-promises, each one taking the
resolve/reject object by value.
Since this value will not be used again in the lambda, it is safe to Move it,
and from there MozPromiseHolder::Resolve/Reject can also Move it again into the
holder storage, potentially saving two copies per Resolve/Reject.
Also, once all sub-promises have been resolved, the resolve-values can be
Move'd into the joining promise's Resolve function.

MozReview-Commit-ID: 5oxgNEnE5lq

--HG--
extra : rebase_source : f0542055beb1434e7db384722c5123d888ca00e7
2017-01-21 17:33:49 +11:00
Gerald Squelart
5c95a7141e Bug 1332779 - InvokeAsync's MethodCall constructor should take forwarding refs instead of lvalues - r=jwwang
The aArgs parameter pack was already Forward'ed inside the constructor, so
maybe the '&&' was forgotten?

MozReview-Commit-ID: 7yg07axhZnp

--HG--
extra : rebase_source : dccd3ea5f0f1b6cadfe6bbc86c8ad34cb7f2c99e
2017-01-21 12:04:54 +11:00
Nicholas Nethercote
12647a7223 Bug 1332577 (part 7) - Rename mozilla_get_pseudo_stack() as profiler_get_pseudo_stack(). r=mstange.
This makes it consistent with other profiler functions.

--HG--
extra : rebase_source : 1e52acdc448691b8859bb147a0c70b198b432fe2
2017-01-20 15:07:05 +11:00
Nathan Froyd
28f29930ef Bug 1324894 - use standard Monitor APIs rather than PR_Interrupt in BackgroundHangMonitor; r=darchons
Using PR_Interrupt here makes life difficult for other things, such as
moving away from NSPR synchronization primitives.
2017-01-20 16:38:12 -05:00
JW Wang
84387b56fe Bug 1328130. Part 3 - remove unused functions and fix comments. r=gerald
MozReview-Commit-ID: JURmHasmhOU

--HG--
extra : rebase_source : f2113e74e5abb0d57b2c70eb7b47b5d6c2829a3d
extra : intermediate-source : 88255f6011134a455b3bee888ebee256209f8e56
extra : source : 5371fe5d527981419953fae96d5cc80d6d15b413
2017-01-11 23:52:24 +08:00
JW Wang
4f5754ca55 Bug 1328130. Part 2 - remove MozPromiseRequestHolder::Begin(). r=gerald
MozReview-Commit-ID: JL27n0Era6E

--HG--
extra : rebase_source : e6de76db3fb35b110370497f4060ea1c3f527f23
extra : intermediate-source : 5bc39a45ef042b895a5abda59cc0796e8cfb4be3
extra : source : a7f7faded7b112e8a971ca96b091a9a22214a2bb
2017-01-11 16:33:29 +08:00
JW Wang
bc040ae51e Bug 1328130. Part 1 - add ->Track(). r=gerald
MozReview-Commit-ID: FW7Urv6nyOS

--HG--
extra : rebase_source : 256576fa8b1e5bb6587e280512619f5d7e74a0cc
extra : intermediate-source : 82d0eea2d53edd8d538bc2d0fd0116046fb489b7
extra : source : 9f4301a98b836ec5fc4ca9e49e6a32f0232b71e5
2017-01-11 15:38:37 +08:00
Nicholas Nethercote
949658eb73 Bug 1329857 - Remove NS_METHOD and NS_CALLBACK. r=froydnj.
Bug 1295053 removed most uses of NS_METHOD and NS_CALLBACK, but one use was
unintentionally left behind (in the XPIDL parser) and another has since crept
in (in MediaDrmCDMProxy.h).

So this patch removes NS_METHOD and NS_CALLBACK. NS_METHOD_(nsresult) and
NS_CALLBACK_(nsresult, T) can still be used for the same purpose, but those
alternatives are less likely to be used unintentionally.

--HG--
extra : rebase_source : a50fc7b2a64a36d1ca9beda81bc0edb8f2ec1934
2017-01-10 14:08:43 +11:00
Gerald Squelart
5d4cad020a Bug 1320785 - Remove obsolete 'ns' from 'StorensRefPtrPassByPtr' - r=froydnj
MozReview-Commit-ID: FuhlsLVFdLi

--HG--
extra : rebase_source : c1bb8330c4ca0dbf15a68a4dbd0dfeff615163be
2017-01-09 07:55:19 +11:00
Gerald Squelart
d551220947 Bug 1322964 - MozPromise.Then() taking only one resolve+reject method - r=jwwang
Then and ThenPromise can now be given only one member function, which takes a
`const MozPromise::ResolveOrRejectValue&`.

MozReview-Commit-ID: 5Zm0i27GHcA

--HG--
extra : rebase_source : 1ed068681616fa0aa5fa77f8dbf78ccbd727f363
2016-12-08 23:09:07 -10:00
Gerald Squelart
b3e89a3af9 Bug 1322964 - MozPromise.Then() taking only one resolve+reject function - r=jwwang
Then and ThenPromise can now be given only one function object, which takes a
`const MozPromise::ResolveOrRejectValue&`.

MozReview-Commit-ID: BEtc3spK9Yh

--HG--
extra : rebase_source : 1b16ad15ebfcdfb653d8d98073adee0f8b27b46e
2017-01-03 16:15:14 +11:00
Gerald Squelart
9a05a0446d Bug 1322964 - MozPromise clean-up - r=jwwang
Removed 'virtual' from overrides, as per coding guidelines.
Fixed some incorrect indentations, and inconsistencies.

MozReview-Commit-ID: 4kNVgoDljG3

--HG--
extra : rebase_source : 7b25abacc7cfc1a6898963bc58120204c70bee45
2016-12-08 10:48:48 -10:00
Markus Stange
4bdc4ca0fb Bug 1323100 - Register most of the remaining threadfunc threads with the profiler. r=froydnj
As far as I can tell, this covers all the remaining threads which we start
using PR_CreateThread, except the ones that are created inside NSPR or NSS,
and except for the Shutdown Watchdog thread in nsTerminator.cpp and the
CacheIO thread. The Shutdown Watchdog thread stays alive past leak detection
during shutdown (by design), so we'd report leaks if we profiled it. The
CacheIO thread seems to stay alive past shutdown leak detection sometimes as
well.

This adds a AutoProfilerRegister stack class for easy registering and
unregistering. There are a few places where we still call
profiler_register_thread() and profiler_unregister_thread() manually, either
because registration happens conditionally, or because there is a variable that
gets put on the stack before the AutoProfilerRegister (e.g. a dynamically
generated thread name). AutoProfilerRegister needs to be the first object on
the stack because it uses its own `this` pointer as the stack top address.

MozReview-Commit-ID: 3vwhS55Yzt

--HG--
extra : rebase_source : 56dd27282e7bd09a7e7dc7ca09ccfe3a0198e7af
2017-01-05 16:34:26 +01:00
Markus Stange
f603a27cd8 Bug 1323100 - Stop double-registering the LazyIdleThread with the profiler. r=froydnj
MozReview-Commit-ID: 2vdcgCcdOYJ

--HG--
extra : rebase_source : fd8b7c4a3052b261317d832ec03ee1c93be723b9
2016-12-21 23:07:26 +01:00
Markus Stange
e442f76c87 Bug 1323100 - Register named threads with the profiler. r=froydnj
MozReview-Commit-ID: FbE4BTcnfEh

--HG--
extra : rebase_source : 98ae8f4c48c396e35a77c81599b7b38790dea10b
2016-12-14 19:50:11 -05:00
Markus Stange
8924022f9d Bug 1323100 - Add nsThreadManager::NewNamedThread API. r=froydnj
The point of this exercise is to make the thread name available in the thread
func of the thread, so that we can register the thread with the profiler from
the very start of its lifetime, and so that registration and unregistration
can be inside the same function.

MozReview-Commit-ID: DiiMKUQVr55

--HG--
extra : rebase_source : 24b15d56315ad49e72b3e9b76db7fb634f3bfe01
2016-12-20 15:10:20 +01:00
Markus Stange
7fd52a7829 Bug 1323100 - Use nsThreadPoolNaming::GetNextThreadName and NS_NewNamedThread in nsThreadPool. r=froydnj
MozReview-Commit-ID: 6IB5yvJtAQm

--HG--
extra : rebase_source : 3e3f22ed091dc881bed294bc64c611400021aaa8
2016-12-22 00:14:30 +01:00
Markus Stange
692210bd80 Bug 1323100 - Assign names to all remaining threads that are created through NS_NewThread and create them using NS_NewNamedThread instead. r=froydnj
MozReview-Commit-ID: 7W1dt2BBKJZ

--HG--
extra : rebase_source : c7e335dac2e0f02782f0eb229a7181c8d01317a2
2016-12-21 11:43:50 +01:00
Bill McCloskey
8a53959bbe Bug 1320753 - Make TabGroup event target be a ThrottledEventQueue for timers, workers (r=bkelly)
MozReview-Commit-ID: FCfYz02r8yI
2016-12-23 11:48:13 -08:00
Wes Kocher
b427632e5a Merge m-c to inbound, a=merge 2016-12-19 16:48:34 -08:00
JW Wang
6567965ad9 Bug 1324335. Part 1 - give MozPromiseHolder a move constructor. r=gerald
MozReview-Commit-ID: BBY4u0JSJTM

--HG--
extra : rebase_source : db81fc96d024304d3eef7f7b5ba503e0753662f2
extra : source : 4a22337cb08711fe4b0fe44d58a8d520c11c975f
2016-12-17 11:12:00 +08:00
Jeff Walden
be049bba4a Bug 1315560 - Make nsThreadSyncDispatch::IsPending properly respect the C++ memory model with respect to threads. r=froydnj
--HG--
extra : rebase_source : 309596fd407a13900fdf51f7e6f1972b8613026e
2016-11-07 15:24:11 -08:00
JW Wang
b4d0509caa Bug 1321744. Part 4 - fix comments. r=gerald
MozReview-Commit-ID: HPIDi9tUHD3

--HG--
extra : rebase_source : c22cb4da5f3916559f3776409fdbefaf5328ac0b
2016-12-14 10:59:41 +08:00
JW Wang
d4d5d4d5bb Bug 1321744. Part 3 - remove ThenPromise and replace its use with Then. r=gerald
MozReview-Commit-ID: AsmePdCp2tC

--HG--
extra : rebase_source : e08ac48584375d2bc12f5b73a1e60f2800359ed9
extra : intermediate-source : 94e727f7cd11bb04812da3662a0ee1fd461cc832
extra : source : 5307716231f93b01c0357011f8849015d4d97d0a
2016-12-04 08:51:25 +08:00
JW Wang
fbfcb37762 Bug 1321744. Part 2 - add the ability of promise chaining to Then(). r=gerald
MozReview-Commit-ID: IaDgoWcmFRO

--HG--
extra : rebase_source : 420834ba105e2606e10f2dfef480a3586a5f8fb3
extra : intermediate-source : 1c2f25bdf9e1dcac085df830e6de7193d66dbe10
extra : source : 4bb6d68fb29d3b0c5eb3a66705b69892b1c94ad4
2016-12-13 17:07:03 +08:00
JW Wang
dea1beb2c4 Bug 1321744. Part 1 - re-implement MozPromise::Then() using the command pattern. r=gerald
MozReview-Commit-ID: 2FkjtBKjIAc

--HG--
extra : rebase_source : 9cda835345135b483640226f7a4afdbc26459a82
extra : intermediate-source : 74f5fc402b87c073d581c1a6f6798c7522809dbf
extra : source : 7e7aa2e92f1f1deb901a8e04b68de999340a772d
2016-12-02 15:41:19 +08:00
Carsten "Tomcat" Book
eb5f79ce29 Merge mozilla-central to autoland 2016-12-13 16:53:28 +01:00
JW Wang
52ec68d60c Bug 1323155 - fix data race in mCompletionPromise. r=gerald
MozReview-Commit-ID: J2TVNWvx9pb

--HG--
extra : rebase_source : 64b4f60500eafd24660141103a22693ce37dfd2b
2016-12-13 16:55:14 +08:00
Andrew McCreight
fccb0645ed Bug 1323042 - forbid MOZ_COUNT_{CTOR,DTOR} for nsISupports classes; r=froydnj 2016-12-12 09:27:58 -05:00
Nathan Froyd
826598caba Backout aba6c73511a2 (bug 1307961) for massive test bustage resulting in a CLOSED TREE; r=alltheorange 2016-12-12 08:45:46 -05:00
Andrew McCreight
e31b5489da Bug 1307961 - require consistent bloatview reporting for nsISupports classes; r=froydnj 2016-12-12 07:58:33 -05:00
Tomislav Jurin
348bfffc19 Bug 1296189 - Replace NS_RUNTIMEABORT("some string literal message") with MOZ_CRASH(). r=froydnj 2016-12-02 13:46:53 -08:00
JW Wang
0bd4f42b74 Bug 1321471. Part 2 - remove CompletionPromise() to enforce use of ThenPromise(). r=jwwang
MozReview-Commit-ID: 9zC3JnzumES

--HG--
extra : rebase_source : c4d41c3128c6521fdbb7ac8386446b2b846f21f0
2016-12-02 10:40:01 +08:00
Ryan VanderMeulen
9bd4ab78e6 Merge m-c to inbound. a=merge 2016-12-01 09:33:46 -05:00
JW Wang
b49cd98e3b Bug 1321250 - Add MozPromise::ThenPromise() for easier promise chaining. r=jya
MozReview-Commit-ID: 7J60CN0HbOW

--HG--
extra : rebase_source : d5fae5853c2c6c3197361db9c62424b6cbe9f593
extra : source : 8ab119efc0d23e9d919846489a0bdc9473d2fbd6
2016-11-30 18:23:12 +08:00
Bill McCloskey
6df682a091 Bug 1320753 - Adding nsINamed naming to nsITimer (r=ehsan)
MozReview-Commit-ID: AbyLcMhRvbx
2016-11-30 18:01:59 -08:00
Bill McCloskey
972fbd3fdf Bug 1320753 - Add nsINamed and have Runnable implement it (r=ehsan)
MozReview-Commit-ID: 6Vuw3aJ3860
2016-11-30 18:01:59 -08:00
Gerald Squelart
43d8fb333c Bug 1313497 - InvokeAsync taking a lambda - r=froydnj
This new InvokeAsync overload takes a single lambda (or any function object).
This is most useful when a method call is not strictly necessary.

Avoid obvious copies by refusing lvalue-references.
(If one day this is really needed, the implementation is already there, hidden
inside `namespace detail`).

MozReview-Commit-ID: 57gPBz9kO1q

--HG--
extra : rebase_source : c9330ca2b6d06dac0318f38a68dadbbccc112325
2016-11-13 11:13:07 +11:00
Gerald Squelart
e4d1e66e1a Bug 1313497 - Storages can be provided to InvokeAsync - r=froydnj
InvokeAsync' Storages work like NewRunnableMethod, where template
parameters must be given, to specify the storage of arguments that are passed
to the target method.
This is especially useful when target methods take references (or pointers),
and there is a choice between passing the reference as-is because the object is
long-lived, or by taking a copy otherwise.

If no Storages are provided, InvokeAsync will store (non-reference/pointer)
objects and move them into the target method parameters.

MozReview-Commit-ID: 9qTQf84bOMv

--HG--
extra : rebase_source : c73e803f9024fbaf0ff8b2e615013a42f4f3c914
2016-11-11 15:10:46 +11:00
Andreas Farre
5ae81e4455 Bug 1313989 - Remove MutexAutoUnlock in nsThread::GetIdleEvent. r=froydnj,mattwoodrow
Rewrite VsyncRefreshDriverTimer::GetTimerRate to always use the cached
value of the vsync rate in VsyncChild to avoid processing events on
the main thread.

Since VsyncChild::GetTimerRate is called in VsyncRefreshDriverTimer's
constructor, that cached value is bound to be set soon. This should
make the period of time we need to guess in
VsyncRefreshDriverTimer::GetTimerRate very short.

MozReview-Commit-ID: 1bnHNXAP8jY

--HG--
extra : rebase_source : 5a731962d417c4b3352970b2adb92b5d31de021c
2016-11-10 10:01:51 +01:00
JW Wang
edcebe85dc Bug 1225731 - Early bailout from TaskQueue::DispatchLocked(). r=froydnj
MozReview-Commit-ID: Xhj87WeRID

--HG--
extra : rebase_source : 0de51688f506a1e302129e69a6353a9d48e6bfed
2016-11-10 15:45:45 +08:00
JW Wang
fa5d7da911 Bug 1316529. Part 2 - remove TaskQueue::DispatchMode. r=froydnj
MozReview-Commit-ID: 5F2OHCpxx7K

--HG--
extra : rebase_source : 215c489a6da017692c491e8ae1e8be8fb2d7a64d
2016-11-10 15:34:35 +08:00
JW Wang
f94c8356e3 Bug 1316529. Part 1 - Remove TaskQueue::mIsFlushing. r=froydnj
MozReview-Commit-ID: 3x4OO7B2htB

--HG--
extra : rebase_source : daf50feae64f625370145b59a0377c7671645f19
2016-11-10 15:28:48 +08:00
Olli Pettay
cb803253a5 bug 1306591, add secondary event queue to let high priority messages to be processed sooner, r=billm
--HG--
extra : rebase_source : 2ce6e06783e399e787d0445943f9f39bcef1cc22
2016-11-08 14:05:45 +02:00
Ben Kelly
2ee0844d95 Bug 1300659 P1 Add the ThrottledEventQueue class. r=froydnj 2016-11-07 12:30:17 -08:00
Phil Ringnalda
06521a66a4 Merge m-c to m-i
MozReview-Commit-ID: 7W5SwSOspcB
2016-11-04 21:04:44 -07:00
Andreas Farre
8f6319bbcd Bug 1315187 - Assert that thread calling IdleDispatch is the thread that will run it. r=smaug
MozReview-Commit-ID: LGrKeIUaGCD

--HG--
extra : rebase_source : 210092f7e0d533bcd2f2748a52460152dc462b61
2016-11-04 09:08:31 +01:00
Andreas Farre
261494e785 Bug 1314314 - Restrict when idle callbacks are fired. r=bkelly
MozReview-Commit-ID: L9ZTVFeHGTw

--HG--
extra : rebase_source : 7178cd47eba6b95539bf9e7f44df8e596de13ebf
2016-11-03 18:47:23 +01:00
Eric Rahm
63cd7f256f Bug 1313469 - Part 2: Convert TestCOMArray to a gtest. r=froydnj
MozReview-Commit-ID: CEhXX60lpZ8

--HG--
rename : xpcom/tests/TestCOMArray.cpp => xpcom/tests/gtest/TestCOMArray.cpp
2016-11-04 16:21:59 -07:00
Phil Ringnalda
c0dcc76ef6 Backed out 18 changesets (bug 1313469, bug 1313468, bug 1313474, bug 1313472, bug 1313473, bug 1313470, bug 1313471, bug 1313467, bug 1313466) for OS X gtest crashes
CLOSED TREE

Backed out changeset 5b5686e1bcd1 (bug 1313474)
Backed out changeset e8d20bdd13d4 (bug 1313473)
Backed out changeset 643bdd25166e (bug 1313473)
Backed out changeset 9a33c84ab30a (bug 1313472)
Backed out changeset 4d84926813e9 (bug 1313472)
Backed out changeset c85e7a7a5a99 (bug 1313471)
Backed out changeset 5d82bc9436ab (bug 1313471)
Backed out changeset 00f7b342bb29 (bug 1313470)
Backed out changeset f012923cfd8b (bug 1313470)
Backed out changeset e7d5b8135ae6 (bug 1313470)
Backed out changeset 82bf00ff6505 (bug 1313469)
Backed out changeset 5364fc8db9b0 (bug 1313469)
Backed out changeset 02959aa60196 (bug 1313468)
Backed out changeset 3c25a6ed5914 (bug 1313467)
Backed out changeset 0acc0a131101 (bug 1313467)
Backed out changeset 6fae1bbd3819 (bug 1313467)
Backed out changeset 107eb264a40d (bug 1313467)
Backed out changeset 9b60e295a885 (bug 1313466)

MozReview-Commit-ID: IKsAZxBYMfv

--HG--
rename : xpcom/tests/gtest/TestAutoPtr.cpp => xpcom/tests/TestAutoPtr.cpp
rename : xpcom/tests/gtest/TestAutoRef.cpp => xpcom/tests/TestAutoRef.cpp
rename : xpcom/tests/gtest/TestCOMArray.cpp => xpcom/tests/TestCOMArray.cpp
rename : xpcom/tests/gtest/TestCOMPtr.cpp => xpcom/tests/TestCOMPtr.cpp
rename : xpcom/tests/gtest/TestCOMPtrEq.cpp => xpcom/tests/TestCOMPtrEq.cpp
rename : xpcom/tests/gtest/TestFile.cpp => xpcom/tests/TestFile.cpp
rename : xpcom/tests/gtest/TestHashtables.cpp => xpcom/tests/TestHashtables.cpp
rename : xpcom/tests/gtest/TestID.cpp => xpcom/tests/TestID.cpp
2016-11-03 23:00:47 -07:00