Commit Graph

27 Commits

Author SHA1 Message Date
Kyle Huey
c73656947b Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07: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
Nathan Froyd
583afa0965 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -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
Nathan Froyd
085aa479e6 Bug 1175621 - make WrapRunnable* more efficient by utilizing moves in wrapper functions; r=ekr
Calls to WrapRunnable* copy their arguments already; we don't need to
copy them a second time when constructing the actual runnable.  In
addition to making things more efficient, this change also permits calls
to WrapRunnable to correctly handle objects that can only be moved, and
not copied.
2015-06-17 10:52:48 -04:00
Nathan Froyd
2c0ec52c9a Bug 1162026 - move WrapRunnable &co over to variadic templates; r=ekr 2015-05-05 16:21:37 -04:00
Byron Campen [:bwc]
98910d890f Bug 1099414: Ensure that NrSocketIpc is destroyed on STS, for consistency. r=ekr
--HG--
extra : rebase_source : e706370706dd0d9ec938798966c752f298a260bf
2014-12-23 16:22:02 -08:00
Randell Jesup
9c505baf27 Bug 1030372: use explicit runnable and Release for ReadBlob to avoid wrong-thread release assert r=bsmedberg relanding on a CLOSED TREE
--HG--
extra : amend_source : 4351ac6c3a17885cd5a24d19c080ff8aa610de3f
2015-01-11 00:28:34 -05:00
Tom Schuster
967d0d250a Backout changeset b4ebefd0f7e3:a8044fd506db Bug 1117607, Bug 1118087, Bug 1118092, Bug 1118105, Bug 1030372, Bug 1079627 on CLOSED TREE 2015-01-11 20:43:32 +01:00
Randell Jesup
0ef23256a4 Bug 1030372: use explicit runnable and Release for ReadBlob to avoid wrong-thread release assert r=bsmedberg 2015-01-11 00:28:34 -05:00
Nathan Froyd
de4d7777c1 Bug 968803 - part 2 - statically type runnable classes that return a result; r=ekr 2014-02-06 10:21:55 -05:00
EKR
67c54cf1da Bug 854085. Make thread asserts conditional on DEBUG not MOZ_DEBUG. r=jesup 2013-04-16 13:13:09 -07:00
EKR
266f6535f8 Bug 856848 - Fix thread crash r=ehugg
Bug 856848 - Fix thread crash r=ehugg,ekr
2013-04-01 12:34:36 -07:00
Ryan VanderMeulen
59c03675bb Backed out changeset f556245d6da1 (bug 856848) for build bustage on a CLOSED TREE. 2013-04-11 15:42:37 -04:00
EKR
046c5d0db8 Bug 856848 - Fix thread crash r=ehugg,ekr 2013-04-01 12:34:36 -07:00
EKR
4648337f9e Assert on WrapRunnableRet with NS_DISPATCH_NORMAL
Bug 847439. Assert on WrapRunnableRet with NS_DISPATCH_NORMAL. r=derf,jesup
2013-03-04 08:51:48 -08:00
Mike Hommey
74f28e30ee Bug 854085 - Fix unused-but-set-variable from ASSERT_ON_THREAD macro in media/mtransport/runnable_utils.h. r=jesup 2013-03-26 11:07:02 +01:00
Mike Hommey
ea912ef189 Backout changeset 1c7bf97d3b6f (bug 854085) for bustage 2013-03-26 09:12:36 +01:00
Mike Hommey
8e53e396ae Bug 854085 - Fix unused-but-set-variable from ASSERT_ON_THREAD macro in media/mtransport/runnable_utils.h. r=jesup 2013-03-26 08:47:49 +01:00
Jan-Ivar Bruaroey
5ce93456e9 Bug 824851: Fixed RUN_ON_THREAD to not dispatch on own thread. r=ekr 2012-12-28 15:42:53 -05:00
EKR
693c7463fa Bug 821292 - Clean up runnables when RUN_ON_THREAD runs on the same thread. r=jesup 2012-12-21 07:11:02 -08:00
EKR
4ccc635ab9 Bug 820102 - Clean up MediaPipeline threading (re-land after fix). r=derf,jesup 2012-12-21 06:03:22 -08:00
Ed Morley
020839f9bb Backout 21409a401d75 (bug 821292),9587e39f9a50 (bug 820102) for conflicts and assertions respectively, on a CLOSED TREE 2012-12-21 16:15:01 +00:00
EKR
e6f9ea6e63 Bug 821292 - Clean up runnables when RUN_ON_THREAD runs on the same thread. r=jesup 2012-12-21 07:11:02 -08:00
EKR
470d172869 Bug 820102 - Clean up MediaPipeline threading. r=derf,jesup 2012-12-21 06:03:22 -08:00
EKR
3b298160b5 Bug 815039, Add template to bind non-member function calls into runnables. r=jesup 2012-12-02 16:53:47 -08:00
EKR
7e1291fe34 Bug 790517: mtransport - Generic media transport subsystem for ICE and DTLS r=jesup,bsmith,mcmanus 2012-10-02 13:04:58 -07:00