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
Phil Ringnalda
c096566a7e
Back out 6 changesets (bug 1186745) for cpptest failure in runnable_utils_unittest, nrappkit_unittest, test_nr_socket_unittest
...
Backed out changeset c6142b815de0 (bug 1186745)
Backed out changeset d8f740ef2430 (bug 1186745)
Backed out changeset edc0b56d81fa (bug 1186745)
Backed out changeset 383f8ac033ea (bug 1186745)
Backed out changeset ce960a661987 (bug 1186745)
Backed out changeset 3e9783023fb2 (bug 1186745)
--HG--
extra : rebase_source : 4681d6abaaa927ddb863f944efc87e6c6f6c2e26
2015-09-28 19:05:02 -07:00
Xidorn Quan
e26e72c529
Bug 1186745 part 6 - Fix event leak when using NS_DispatchToCurrentThread. r=froydnj
...
--HG--
extra : source : 839c394ca2362db534c9a12b14be3a9f3f5d6ff5
2015-09-29 09:28:22 +10:00
Nathan Froyd
c6d5ee54fb
Bug 1179787 - part 2 - add template logic for smart pointer template arguments in NS_NewRunnableMethod*; r=botond
2015-07-02 11:17:49 -04:00
Nathan Froyd
8ddd161b85
Bug 1179787 - part 1 - forward StorensRefPtrPassByPtr's constructor argument; r=botond
...
StorensRefPtrPassByPtr is currently used for storing reference-counted
types passed as T* template arguments to NS_NewRunnableMethodWith*.
We'd also like to use it to store nsRefPtr<T> template arguments. While
it could be used in its current form, it'd be better for its constructor
to support forwarding, so that something like:
NS_NewRunnableMethodWithArg<nsRefPtr<T>>(..., nsRefPtr<T>(local));
doesn't cause unnecessary reference counting.
2015-07-02 11:05:52 -04:00
Ehsan Akhgari
7a81d59cb2
Bug 1188203 - Fix more constructors in XPCOM; r=froydnj
2015-07-28 12:24:37 -04:00
Randell Jesup
c87c478f4f
Bug 1155059: Patch 1&2 - Convert Dispatch() and friends to already_AddRefed<> r=froydnj
...
Modify Dispatch IDL and code to deal with MSVC issues with overloaded templates r=froydnj
2015-07-09 23:21:46 -04:00
Ryan VanderMeulen
8e70b92b80
Backed out changeset c1cd7aff7c94 (bug 1163320) for causing silent Hazard build bustage.
...
--HG--
extra : rebase_source : 34f9d17d9c9c3b2bfd5bd8d4be48a05acc0c5908
2015-06-03 12:46:19 -04:00
Botond Ballo
a1ee749697
Bug 1163320 - Variadic implementation of nsRunnableMethodArguments. r=froydnj
...
--HG--
extra : source : ed761807105b30069d5a7412f8dacf75429eeeb6
2015-05-11 17:24:21 -04:00
Cervantes Yu
55152ad9d9
Backout change 39e167bbd14c, a80140872ea5, adae9be2294d and b71ccef9c674 (bug 970307).
2015-05-19 14:31:25 +08:00
Carsten "Tomcat" Book
005c5ce415
Backed out changeset 4d2839eea957 (bug 970307)
2015-05-19 11:44:27 +02:00
Cervantes Yu
a12ce249b1
Backout change 39e167bbd14c, a80140872ea5, adae9be2294d and b71ccef9c674 (bug 970307).
...
--HG--
extra : rebase_source : 829e80228e07440285383316d2c4fea017828529
2015-05-19 14:31:25 +08:00
Gerald Squelart
2b1b8b1729
Bug 1153295 - Select StorensRefPtrPassPtr for types with AddRef and Release methods. r=nfroyd
2015-04-26 04:52:00 -04:00
Cervantes Yu
4f02100ffd
Backed out 2 changesets (bug 1138620
)
...
Backed out changeset e60b4b01c05d (bug 1138620
)
Backed out changeset 52d49dd25d6d (bug 1138620
)
2015-04-24 15:05:44 +08:00
Cervantes Yu
d827320379
Bug 1138620
- Part 1: Allow binary modules to create unmonitored threads that doesn't keep the Nuwa process from stabalization. r=nfroyd
2015-04-21 18:23:09 +08:00
Kartikaya Gupta
d7702657e5
Bug 1152753 - Add a wrapper to be able to dispatch C++11 lambdas to nsIThread. r=froydnj
2015-04-10 08:13:00 -04:00
Kartikaya Gupta
f7dbd8ca43
Bug 1146349 - Allow NS_NewRunnableMethodWithArgs to take up to 8 arguments. r=froydnj
2015-04-14 11:36:35 -04:00
Kartikaya Gupta
0f4033d26f
Back out cset 35cae02f1552 (bug 1152753) because it introduces a footgun. r=me
2015-04-10 12:13:55 -04:00
Kartikaya Gupta
1cc7ec6936
Bug 1152753 - Add a wrapper to be able to dispatch C++11 lambdas to nsIThread. r=froydnj
2015-04-10 08:13:00 -04:00
Ben Kelly
c32262c9c1
Bug 1142852 P1 Fix NS_NewNonOwningRunnableMethodWithArgs() so that it compiles. r=froydnj
2015-03-23 22:28:09 -04:00
Nathan Froyd
e7363b8b6b
Bug 1141692 - use an actual Atomic for nsThreadPoolNaming::mCounter; r=bsmedberg
...
Marking a variable as volatile is never the right thing to do when
dealing with threads. Use real atomic accesses instead.
2015-03-10 14:41:45 -04:00
Gerald Squelart
4495d81efb
Bug 1131445 - variadic NS_NewRunnableMethodWithArgs with storage&passing argument type decorators. r=waldo
...
--HG--
extra : rebase_source : 3c2104c19bb37624ec32a1ca4c50235e7cefd953
2015-03-01 18:12:00 +01:00
Ehsan Akhgari
4354953b4f
Bug 1118486 - Part 1: Use `= delete` instead of MOZ_DELETE directly; r=Waldo
...
Most of this patch (with the exception of dom/bindings/Codegen.py) was
generated by the following bash script:
#!/bin/bash
function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
! -wholename "*security/nss*" \
! -wholename "*/.hg*" \
! -wholename "*/.git*" \
! -wholename "obj-*" \
-type f \
\( -iname "*.cpp" \
-o -iname "*.h" \
-o -iname "*.cc" \
-o -iname "*.idl" \
-o -iname "*.ipdl" \
-o -iname "*.ipdlh" \
-o -iname "*.mm" \) | \
xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}
convert MOZ_DELETE '= delete'
2015-01-08 23:19:05 -05:00
Ehsan Akhgari
9297631e0b
Bug 1114880 follow-up: Rename MOZ_{STRONG,WEAK}_REF to MOZ_{OWNING,NON_OWNING}_REF
...
--HG--
extra : rebase_source : 51fff0785d112b5b87be3c6ff723c8986b37effe
2014-12-23 21:17:50 -05:00
Ehsan Akhgari
e25b96750f
Bug 1114983 - Use nsCOMPtr in nsRunnableMethodReceiver; r=froydnj
...
--HG--
extra : rebase_source : 4094a49ac67c76f789b685d59fcf3f27c7c304df
2014-12-23 17:30:55 -05:00
Chih-Kai (Patrick) Wang
fcb6d29268
Bug 970307: Part 1: Report status of each thread to find when all the threads are idle. r=nfroyd
2014-12-18 17:00:39 +08:00
Ryan VanderMeulen
fb8d05cd59
Backed out changesets 9beb53e53951, 4420bb4e5e7c, de1da65301a8, and cd9c2aaf1343 (bug 970307) for causing frequent B2G debug mochitest-11 crashes.
2014-11-24 17:18:27 -05:00
Patrick Wang (Chih-Kai Wang)
c0da861aa4
Bug 970307: Part 1: Report status of each thread to find when all the threads are idle. r=nfroyd
2014-11-24 15:21:52 +08:00
Nicholas Nethercote
f57e56e187
Bug 1058388 - Remove NS_COM_GLUE and IMETHOD_VISIBILITY. r=bsmedberg.
...
--HG--
extra : rebase_source : 250ec1323d4097101a8e0331a2bf7fab59f72b1d
2014-08-27 15:47:27 -07:00
Birunthan Mohanathas
16471161bb
Bug 1046841 - Fix more style violations in previously touched .h files in xpcom/. r=froydnj
2014-08-25 12:17:24 -07:00
Blake Kaplan
ca74ecaa11
Bug 1041881 - Don't take template parameters by value to avoid accidentally constructing objects. r=khuey
...
--HG--
extra : rebase_source : 92bf47631beed8dd0c3f5b29b1cfb0b30e502364
2014-07-29 14:46:16 -04:00
Ehsan Akhgari
520fd897ed
Bug 1045065 - Fix some bad implicit constructors in xpcom; r=froydnj
2014-07-28 13:19:06 -04:00
Benoit Jacob
e3ac914b37
Bug 1033358 - Make NS_IsMainThread use its own TLS so it's always correct, from early init to exit time - r=bsmedberg
2014-07-04 06:34:15 -04:00
Ryan VanderMeulen
6d9424856d
Backed out 10 changesets (bug 1033358, bug 774388, bug 1028383) for causing frequent shutdown crashes on a CLOSED TREE.
...
Backed out changeset a54b05c9e4a1 (bug 1028383)
Backed out changeset 37985f79e0c2 (bug 774388)
Backed out changeset d07521729077 (bug 774388)
Backed out changeset 9f14b17f358c (bug 774388)
Backed out changeset 2d347d6aa9bc (bug 774388)
Backed out changeset 99581dfb5ec4 (bug 774388)
Backed out changeset 2532e22d6135 (bug 774388)
Backed out changeset 719844108f1a (bug 774388)
Backed out changeset 7829c78348a4 (bug 1033358)
Backed out changeset c571df9a85de (bug 1033358)
2014-07-03 20:37:05 -04:00
Benoit Jacob
0e68107d00
Bug 1033358 - Make NS_IsMainThread use its own TLS so it's always correct, from early init to exit time - r=bsmedberg
2014-07-03 14:53:24 -04:00
Birunthan Mohanathas
c9fb2c0d48
Bug 1022456 - Fix modelines in xpcom/{base,glue,io,string,threads}/. r=froydnj
2014-06-30 08:39:45 -07:00
Birunthan Mohanathas
6b53f3d634
Bug 1022456 - Convert xpcom/glue/ to Gecko style. r=froydnj
2014-06-26 18:35:39 -07:00
Robert O'Callahan
9875463556
Bug 1015664
. Part 3: Remove NS_HIDDEN_VISIBILITY from NS_IMETHOD_VISIBILITY. r=bsmedberg
2014-06-03 00:08:27 +12:00
Randell Jesup
edc4e3927e
Bug 997286: Make NS_NewNamedThread safe if the event tries to commit suicide r=bsmedberg
2014-04-16 16:39:16 -04:00
Benjamin Smedberg
8fd1bc7f20
Bug 672843 part C - convert most of XPCOM except for xpcom/tests, r=vdjeric
2013-11-19 16:27:37 -05:00
Benoit Jacob
ba61b1281e
Bug 913847 - split NS_IsMainThread and NS_GetMainThread into a new MainThreadUtils.h header - r=ehsan
2013-09-19 09:54:41 -04:00
Wes Kocher
d67c764568
Backed out changeset 4eb44a3149ed (bug 913847)
2013-09-18 17:19:23 -07:00
Benoit Jacob
294691634b
Bug 913847 - split NS_IsMainThread and NS_GetMainThread into a new MainThreadUtils.h header - r=ehsan
2013-09-18 18:50:32 -04:00
Valentin Gosu
77d1d37b73
Bug 622728 - Add NS_NewRunnableMethodWithArg. r=bsmedberg
2013-09-06 21:29:24 -04:00
Karl Tomlinson
a9d139bd75
b=903270 set thread name for initial event of NS_NewNamedThread() r=dougt
...
--HG--
extra : transplant_source : %E7%24%5Be%ED.%F3HH%9A%9E%02r%EB%29%CD%EDf%09%F1
2013-08-27 12:36:45 +12:00
Nicholas Cameron
0514eb1ecd
Bug 903816. Fixups in non-layers files. r=roc
2013-08-12 11:15:10 +12:00
Ehsan Akhgari
2824b29025
Bug 895322 - Part 1: Replace the usages of MOZ_STATIC_ASSERT with C++11 static_assert; r=Waldo
...
This patch was mostly generated by running the following scripts on the codebase, with some
manual changes made afterwards:
# static_assert.sh
#!/bin/bash
# Command to convert an NSPR integer type to the equivalent standard integer type
function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
! -wholename "*security/nss*" \
! -wholename "*/.hg*" \
! -wholename "obj-ff-dbg*" \
! -name nsXPCOMCID.h \
! -name prtypes.h \
-type f \
\( -iname "*.cpp" \
-o -iname "*.h" \
-o -iname "*.cc" \
-o -iname "*.mm" \) | \
xargs -n 1 `dirname $0`/assert_replacer.py #sed -i -e "s/\b$1\b/$2/g"
}
convert MOZ_STATIC_ASSERT static_assert
hg rev --no-backup mfbt/Assertions.h \
media/webrtc/signaling/src/sipcc/core/includes/ccapi.h \
modules/libmar/src/mar_private.h \
modules/libmar/src/mar.h
# assert_replacer.py
#!/usr/bin/python
import sys
import re
pattern = re.compile(r"\bMOZ_STATIC_ASSERT\b")
def replaceInPlace(fname):
print fname
f = open(fname, "rw+")
lines = f.readlines()
for i in range(0, len(lines)):
while True:
index = re.search(pattern, lines[i])
if index != None:
index = index.start()
lines[i] = lines[i][0:index] + "static_assert" + lines[i][index+len("MOZ_STATIC_ASSERT"):]
for j in range(i + 1, len(lines)):
if lines[j].find(" ", index) == index:
lines[j] = lines[j][0:index] + lines[j][index+4:]
else:
break
else:
break
f.seek(0, 0)
f.truncate()
f.write("".join(lines))
f.close()
argc = len(sys.argv)
for i in range(1, argc):
replaceInPlace(sys.argv[i])
--HG--
extra : rebase_source : 4b4a4047d82f2c205b9fad8d56dfc3f1afc0b045
2013-07-18 13:59:53 -04:00