Commit Graph

21 Commits

Author SHA1 Message Date
Nathan Froyd
c845c30279 Bug 1298676 - part 1 - add IOInterposer::Enable(); r=aklotz
In some parts of the crash reporter, we need to disable I/O
interposition, then turn it back on.  We didn't have a function for
re-enabling the I/O interposer...until now.
2017-01-10 16:31:25 -05:00
Tom Tromey
2177f7ad7f Bug 757969 - use __thread in ThreadLocal; r=froydnj 2016-01-22 10:33:44 -07:00
Nathan Froyd
4e6d8f6705 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
2015-10-18 01:24:48 -04:00
Nathan Froyd
bf7f6dda03 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
Jesse Ruderman
6785bc0e32 Bug 1024259: Use NS_FREE_PERMANENT_DATA more consistently. r=mccr8 2015-07-31 12:11:48 -07:00
Birunthan Mohanathas
a29151dc87 Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Kartikaya Gupta
ebe4a3e37e Bug 1039866 - Rip out a bunch of metro-only code. r=jimm,gavin,rstrong 2015-04-23 15:10:30 -04:00
Andrew McCreight
00f75cda98 Bug 1151541, part 2 - Fix mode lines in xpcom/. r=froydnj 2015-04-09 10:25:05 -07:00
Rafael Kourdis
064a8327d2 Bug 1030487 - Don't report main-thread I/O to Telemetry unless it lasts more than 50ms; r=vladan 2014-08-18 18:42:14 -04:00
Birunthan Mohanathas
b241110f15 Bug 1046841 - Convert xpcom/build/ to Gecko style. r=froydnj 2014-08-13 11:45:37 -07:00
Ehsan Akhgari
a1bc484e45 Bug 1048280 - Fix more bad implicit constructors in XPCOM; r=froydnj 2014-08-05 09:36:59 -04:00
Aaron Klotz
5a629da513 Bug 1021187: Main thread should be unregistred from IOInterposer in ASAN builds; r=ehsan 2014-06-10 14:33:19 -06:00
Ehsan Akhgari
5dee03cb86 Bug 999888: Make ObserverLists not use mozilla::AtomicRefCounted; r=froydnj 2014-04-29 11:32:03 -06:00
Aaron Klotz
49df12a249 Bug 999888: Make IOInterposer leakcheck-friendly; f=ehsan, r=froydnj 2014-04-29 11:29:43 -06:00
Aaron Klotz
0c4a7687a4 Bug 935482: New IOInterposer observer for recording main thread I/O to file; r=froydnj 2014-04-19 14:28:02 -06:00
Aaron Klotz
b3ab7df76b Bug 913653: Remove lock from IOInterposer and add IOInterposer thread registration; r=froydnj 2014-04-08 22:57:52 -06:00
Jan Beich
5db5e2a2c8 Bug 983957 - Remove SPS ifdef from IOInterposer to unbreak non-SPS platforms; r=aklotz 2014-03-18 16:24:36 -06:00
Aaron Klotz
0b03b70a55 Bug 973353: Disable IOInterposer when reporting a crash; r=froydnj,ted 2014-03-15 00:10:39 -06:00
Aaron Klotz
d411544c64 Bug 972577: Consolidate IOInterposer initialization code; r=froydnj,BenWa,jimm 2014-03-14 16:35:01 -06:00
Wes Kocher
a5be17bbc4 Backed out changeset 2bdd2d042847 (bug 972577) for non-unified bustage on a CLOSED TREE 2014-03-14 15:27:21 -07:00
Aaron Klotz
0a951fc88b Bug 972577: Consolidate IOInterposer initialization code; r=froydnj,BenWa,jimm 2014-03-14 13:47:24 -06:00