Commit Graph

132 Commits

Author SHA1 Message Date
Markus Stange
5c622cb38b Bug 1323100 - Create nsThreadPoolNaming::GetNextThreadName. r=froydnj
MozReview-Commit-ID: F0ZFFa5VkAW

--HG--
extra : rebase_source : 9ebc1118e30bf841af2a2d1df3ada4d31e4035bd
2016-12-22 00:38:41 +01:00
Markus Stange
2e4dfba476 Bug 1323100 - Create a version of NS_NewNamedThread that accepts an nsACString. r=froydnj
MozReview-Commit-ID: LhRjdzZeWCB

--HG--
extra : rebase_source : 350ec2fbdc535a72eed34dc20d67765e4602da4b
2016-12-22 00:05:51 +01:00
Wes Kocher
26a1ba5c14 Backed out 27 changesets (bug 1323100) for clipboard leaktest failures a=backout
Backed out changeset 84fb749698ab (bug 1323100)
Backed out changeset d6d25e8bd001 (bug 1323100)
Backed out changeset 1b0855bb0c38 (bug 1323100)
Backed out changeset b6953e3f5739 (bug 1323100)
Backed out changeset 5572f3b63215 (bug 1323100)
Backed out changeset 12fb4c533659 (bug 1323100)
Backed out changeset c36524e4e919 (bug 1323100)
Backed out changeset 1e3b3eddbe26 (bug 1323100)
Backed out changeset 061110f1ae12 (bug 1323100)
Backed out changeset 413dbd31725b (bug 1323100)
Backed out changeset 06550f7eca62 (bug 1323100)
Backed out changeset 940933b13b36 (bug 1323100)
Backed out changeset a6d75c1cd724 (bug 1323100)
Backed out changeset 681cacbbaa3b (bug 1323100)
Backed out changeset 3d53787293f6 (bug 1323100)
Backed out changeset c0340dfe4766 (bug 1323100)
Backed out changeset 9f554991549d (bug 1323100)
Backed out changeset 757539e7039a (bug 1323100)
Backed out changeset a3c9b45aa917 (bug 1323100)
Backed out changeset 23d69df98a66 (bug 1323100)
Backed out changeset 1297ded6a01d (bug 1323100)
Backed out changeset f4235b97257f (bug 1323100)
Backed out changeset 93419cb4f29f (bug 1323100)
Backed out changeset 865d1b81c804 (bug 1323100)
Backed out changeset 54acf4ef8e84 (bug 1323100)
Backed out changeset 88d17bcd8205 (bug 1323100)
Backed out changeset 0c466e5e8933 (bug 1323100)
2016-12-29 16:28:36 -08:00
Markus Stange
ce1d36ccc8 Bug 1323100 - Remove NS_SetThreadName which is now unused. r=froydnj
MozReview-Commit-ID: 7je5PhV1TsU

--HG--
extra : rebase_source : 74a4339b3c7338e85caf9287b225d75a556b2938
2016-12-20 14:43:11 +01:00
Markus Stange
b289e8b136 Bug 1323100 - Make NS_NewNamedThread use nsThreadManager::NewNamedThread. r=froydnj
MozReview-Commit-ID: 7e6l1A89he9

--HG--
extra : rebase_source : 0bbd888a568937710d3bb6cd5b856063e3405ae6
2016-12-20 14:18:22 +01:00
Markus Stange
2643eefe78 Bug 1323100 - Remove nsThreadPoolNaming::SetThreadPoolName because it's now unused. r=froydnj
MozReview-Commit-ID: CYgF2NGD6pt

--HG--
extra : rebase_source : cc09c212670d845c00629903b477674806618699
extra : source : 1cd63b3998c4a4c2ef5c59eee24bd344b2d3bc6d
2016-12-19 16:16:50 +01:00
Markus Stange
70d7bf2304 Bug 1323100 - Create nsThreadPoolNaming::GetNextThreadName. r=froydnj
MozReview-Commit-ID: F0ZFFa5VkAW

--HG--
extra : rebase_source : 9ebc1118e30bf841af2a2d1df3ada4d31e4035bd
2016-12-22 00:38:41 +01:00
Markus Stange
6e0ccc9df6 Bug 1323100 - Create a version of NS_NewNamedThread that accepts an nsACString. r=froydnj
MozReview-Commit-ID: LhRjdzZeWCB

--HG--
extra : rebase_source : 350ec2fbdc535a72eed34dc20d67765e4602da4b
2016-12-22 00:05:51 +01: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
25ced2b192 Bug 1313497 - Expose Is/RemoveSmartPointer - r=froydnj
Moved IsRefcountedSmartPointer and StripSmartPointer from ::detail to
::mozilla, to permit their use from other files.
Renamed StripSmartPointer to RemoveSmartPointer, for consistency with the
usual 'Remove...' type traits.

MozReview-Commit-ID: GMEbWCGfdpc

--HG--
extra : rebase_source : 3139cef1e18625b751e7d90ebfc0db5ef5bfec6b
2016-11-17 14:34:24 +11:00
Gerald Squelart
b3fb2f5bf4 Bug 1318228 - NewRunnable defaults to StoreCopyPassByConstLRef - r=froydnj
MozReview-Commit-ID: LmQHthMLUd3

--HG--
extra : rebase_source : 84ab099977d6ab32c6f0afb354569bdcec5ce0a5
2016-11-17 17:07:02 +11:00
Andreas Farre
3aecf57375 Bug 1198381 - Implement the requestIdleCallback feature, r=froydnj,mattwoodrow,smaug
Expose requestIdleCallback on Window and implement running callbacks
in idle periods by posting rICs to the main threads idle queue.

MozReview-Commit-ID: KSYQsyaZ6is

--HG--
extra : rebase_source : 6abd41c2de96b39004f1b2c3c740e81de570970c
2016-08-22 14:52:45 +02:00
Andreas Farre
d87b4d239b Bug 1198381 - Extend nsIThread with idleDispatch, r=froydnj,smaug
The intent of idleDispatch is the possibility to have a runnable
executed when the thread is idle. This is accomplished by adding an
event queue for idle tasks that will only be considered when the main
event queue is empty and the caller of ProcessNextEvent doesn't
require that we wait until there is an event on the main event queue.

MozReview-Commit-ID: IDWQfzZqWpZ

--HG--
extra : rebase_source : 0d5bfeebd08e01597c2cd8b76e8e848d9f9c58f0
2016-08-24 16:18:06 +02:00
Carsten "Tomcat" Book
e42af6918c Backed out changeset 333a899fb5e6 (bug 1198381) 2016-10-25 12:32:56 +02:00
Carsten "Tomcat" Book
1895ce466b Backed out changeset eb2606332cb8 (bug 1198381) 2016-10-25 12:32:54 +02:00
Andreas Farre
1380385c69 Bug 1198381 - Implement the requestIdleCallback feature, r=froydnj,mattwoodrow,smaug
Expose requestIdleCallback on Window and implement running callbacks
in idle periods by posting rICs to the main threads idle queue.

MozReview-Commit-ID: KSYQsyaZ6is

--HG--
extra : rebase_source : 4bdd578b654d05cab600489d30d859452d1bc888
2016-08-22 14:52:45 +02:00
Andreas Farre
60a3a10742 Bug 1198381 - Extend nsIThread with idleDispatch, r=froydnj,smaug
The intent of idleDispatch is the possibility to have a runnable
executed when the thread is idle. This is accomplished by adding an
event queue for idle tasks that will only be considered when the main
event queue is empty and the caller of ProcessNextEvent doesn't
require that we wait until there is an event on the main event queue.

MozReview-Commit-ID: IDWQfzZqWpZ

--HG--
extra : rebase_source : b16ff65d7a9b2fa16216a9ce8756358014d7ad96
2016-08-24 16:18:06 +02:00
Nicholas Nethercote
b71747b2ac Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.

--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
2016-09-01 15:01:16 +10:00
Nicholas Nethercote
060123c88a Bug 1295053 (part 1) - Don't use NS_METHOD for xpcom thread utility functions. r=froydnj.
These don't need __stdcall on Win32.

--HG--
extra : rebase_source : 9af47c64571a2c7459f95c46e737c5ef50d47909
2016-08-15 14:29:43 +10:00
Nicholas Nethercote
e7f10a07fd Bug 1293603 (part 2) - Make Run() declarations consistent. r=erahm.
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.

As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.

--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
2016-08-08 12:18:10 +10:00
Andrew McCreight
d2ec8127e0 Bug 1279609 - nsRunnableMethodImpl should use a non-public destructor. r=froydnj 2016-07-05 12:03:18 -07:00
Nathan Froyd
f7ee3c3dbf Bug 1281626 - part 5 - move nsRunnableFunction into mozilla::detail and rename it; r=khuey
We do this for similar reasons as nsRunnableMethod*: less prefixing and
a more obvious signal that this is a private implementation class.
2016-06-28 22:24:54 -04:00
Nathan Froyd
65715152b1 Bug 1281626 - part 4 - change NS_NewRunnableFunction to return already_AddRefed; r=khuey
This change makes it more consistent with NS_NewRunnableMethod and also
opens up optimization opportunities for later.
2016-06-28 22:24:54 -04:00
Nathan Froyd
f624e16333 Bug 1281626 - part 2 - make RunnableMethod* internals final classes; r=khuey
This step is mostly tidiness.
2016-06-28 22:24:54 -04:00
Nathan Froyd
bcf3920031 Bug 1281626 - part 1 - move nsRunnableMethod* into mozilla::detail and rename them; r=khuey
Less ns-prefixing is more better.  Also, this renaming makes clearer
that these classes are private implementation details, which is good,
because we're going to take advantage of that fact in a bit.
2016-06-28 22:24:54 -04:00
Gerald Squelart
e8513ef5ee Bug 1271593 - NS_NewRunnableFunction should forward its arg - r=froydnj
By perfect-forwarding its argument, we can automatically gain move semantics
optimization when storing the given function object into nsRunnableFunction.
Also it allows movable-only function objects.

Note that any reference is removed from the type to be stored, so that the
runnable always contain a concrete function object.

MozReview-Commit-ID: 9EZK84ZhMvR

--HG--
extra : rebase_source : e1f87c3284fda4df6d13839ea6a0b0c2ce196833
2016-06-02 01:21:36 +02:00
L. David Baron
fc6592bdbc Bug 1271182 - Add some deleted assignment operators and copy constructors. r=khuey
These are generally good practice for reference-counted objects; they
catch cases where these operations are used by accident, breaking
reference-counting.

This doesn't show any existing problems, though.

MozReview-Commit-ID: EvRkNCymOqT
2016-05-25 18:04:35 -07:00
Kyle Huey
941ab1f522 Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
Kyle Huey
7c2af31504 Bug 1268313: Part 5 - Make NS_NewRunnableMethod able to call const functions. r=froydnj 2016-05-05 01:44:59 -07:00
Kyle Huey
156b8c1933 Bug 1268313: Part 4 - Replace NewCancelableRunnableMethod with NS_NewCancelableRunnableMethod. r=froydnj 2016-05-05 01:44:59 -07:00
Kyle Huey
7f54121b91 Bug 1268313: Part 3 - Replace some NewCancelableRunnableMethod with NS_NewNonOwningCancelableRunnableMethod. r=froydnj 2016-05-05 01:44:59 -07:00
Carsten "Tomcat" Book
5d43a44ec6 Backed out changeset 3f2f3fcac66b (bug 1268313)
--HG--
extra : rebase_source : 438e7d7077b900ef252bd628f4559424eebd211f
2016-04-29 14:21:23 +02:00
Carsten "Tomcat" Book
4bb6f48de3 Backed out changeset 6a8d57e8fa8e (bug 1268313)
--HG--
extra : rebase_source : 8690897fd41073f22c8b25db5e8ce88df76a2bb7
2016-04-29 14:21:22 +02:00
Carsten "Tomcat" Book
894326b653 Backed out changeset 726f7361e0b8 (bug 1268313)
--HG--
extra : rebase_source : 3e04a6751a1cce2be7692763b4520dcca053f210
2016-04-29 14:21:20 +02:00
Carsten "Tomcat" Book
ba3fe0975c Backed out changeset 85ce8cb0639a (bug 1268313)
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02:00
Kyle Huey
48a594a09e Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-04-28 14:08:25 -07:00
Kyle Huey
732a15e600 Bug 1268313: Part 5 - Make NS_NewRunnableMethod able to call const functions. r=froydnj 2016-04-28 14:08:24 -07:00
Kyle Huey
c724d0c867 Bug 1268313: Part 4 - Replace NewCancelableRunnableMethod with NS_NewCancelableRunnableMethod. r=froydnj 2016-04-28 14:08:24 -07:00
Kyle Huey
a13954d079 Bug 1268313: Part 3 - Replace some NewCancelableRunnableMethod with NS_NewNonOwningCancelableRunnableMethod. r=froydnj 2016-04-28 14:08:24 -07:00
Kyle Huey
c73656947b Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07:00
Kyle Huey
2709afd167 Bug 1263311: Part 3 - s/nsCancelableRunnable/CancelableRunnable/g. r=froydnj 2016-04-11 11:40:06 -07:00
Kyle Huey
1cc02aa8c6 Bug 1263311: Part 1 - Change the nsICancelableRunnable interface. r=froydnj 2016-04-11 11:40:06 -07:00
Wes Kocher
7d2cebe912 Backed out 3 changesets (bug 1263311) for Windows build failures in ServiceWorkerPrivate.cpp CLOSED TREE
Backed out changeset 0434a548e1fe (bug 1263311)
Backed out changeset 60b1be29446c (bug 1263311)
Backed out changeset 18132498bc40 (bug 1263311)

MozReview-Commit-ID: LPEa05QobdQ
2016-04-11 12:50:56 -07:00
Kyle Huey
d200ed89d0 Bug 1263311: Part 3 - s/nsCancelableRunnable/CancelableRunnable/g. r=froydnj 2016-04-11 11:40:06 -07:00
Kyle Huey
f13a6fc866 Bug 1263311: Part 1 - Change the nsICancelableRunnable interface. r=froydnj 2016-04-11 11:40:06 -07:00
Botond Ballo
5a57a5b196 Bug 1163320 - Variadic implementation of nsRunnableMethodArguments. r=froydnj
MozReview-Commit-ID: 13YyOyiionD

--HG--
extra : rebase_source : 89a0ad0877ed3290a41288523fe9b13d9c5bac7d
extra : source : ed761807105b30069d5a7412f8dacf75429eeeb6
2015-05-11 17:24:21 -04:00
Nathan Froyd
01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Xidorn Quan
7ba467bc22 Bug 1186745 part 6 - Fix event leak when using NS_DispatchToCurrentThread. r=froydnj
--HG--
extra : source : c8159664670c96e6cfa4c856d6eb14bb9495cd6f
2015-10-06 13:00:59 +11:00
Wes Kocher
1d312920f4 Backed out 6 changesets (bug 1186745) for android Cpp failures
Backed out changeset 237a6acf0709 (bug 1186745)
Backed out changeset 7b530871783a (bug 1186745)
Backed out changeset 73f73b531fc8 (bug 1186745)
Backed out changeset e36909748ddf (bug 1186745)
Backed out changeset 3a31df8787f0 (bug 1186745)
Backed out changeset df9cb8f5f0a5 (bug 1186745)
2015-10-02 10:35:09 -07:00
Xidorn Quan
863594b840 Bug 1186745 part 6 - Fix event leak when using NS_DispatchToCurrentThread. r=froydnj
--HG--
extra : source : a0baaf79582846e447014b2e933266c3150941aa
2015-10-03 00:18:24 +10:00