Commit Graph

20 Commits

Author SHA1 Message Date
Sotaro Ikeda
e9fb4b338e Bug 1186796 - Replace nsBaseHashtable::EnumerateRead() calls in image/ with iterators r=njn 2015-11-10 23:07:09 -08:00
Nathan Froyd
6cdd2ef7ab Bug 1215763 - part 1 - remove unnecessary nsAutoPtr.h includes; r=seth
These turned up when grepping around for nsAutoPtr; it seemed easier to
remove them as a first step.
2015-10-17 06:52:21 -04:00
Nathan Froyd
e4e2da55c9 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
5254890206 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
Seth Fowler
88a49b8c51 Bug 1210553 - Remove the alternate flags arguments from SurfaceCache's Lookup functions. r=dholbert 2015-10-05 17:06:34 -07:00
Seth Fowler
7eae9e022f Bug 1146663 (Part 2) - Remove the concept of lifetimes from the SurfaceCache. r=dholbert 2015-09-19 16:20:59 -07:00
Nicholas Nethercote
cae6e9971a Bug 1203427 (part 1) - Add nsExpirationTracker::mName. r=froydnj.
There are many sub-classes of nsExpirationTracker. In order to distinguish them
nicely in the logging of timer firings, it's necessary to manually name each
one. (This wouldn't be necessary if there was a way to stringify template
parameters, but there isn't.)
2015-09-09 21:07:07 -07:00
Seth Fowler
f3261cccb4 Bug 1185800 - Add DecoderFlags and SurfaceFlags enum classes and use them instead of imgIContainer flags in all decoder-related code. r=tn 2015-08-14 17:56:44 -07:00
Seth Fowler
bbb9ada747 Bug 1192356 (Part 1) - Take advantage of mozilla::Tie() in SurfaceCache.cpp. r=dholbert 2015-08-11 23:50:31 -07:00
Daniel Holbert
584b0b326c Bug 1188569: Drop unneeded MOZ_WARN_UNUSED_RESULT from from LookupBestMatch in SurfaceCache.cpp. r=seth 2015-07-30 12:35:19 -07:00
Nicholas Nethercote
3a84fe11ee Bug 1188705 (part 3) - Simplify imgFrame::SizeOfExcludingThis(). r=seth.
imgFrame::SizeOfExcludingThis() measures heap and non-heap memory in a very
complex way. This patch simplifies it and removes gfxMemoryLocation in the
process. (gfxMemoryLocation::OUT_OF_PROCESS was unused.)
2015-07-28 21:02:45 -07:00
Seth Fowler
0879a5b457 Bug 1176124 (Part 2) - Add placeholder support to the SurfaceCache so we can avoid launching redundant decoders. r=dholbert 2015-07-19 18:39:44 -07:00
Seth Fowler
be3426ecf0 Bug 1176124 (Part 1) - Add a MatchType enum to LookupResult to let Lookup*() return more detailed information. r=dholbert 2015-07-19 18:39:40 -07:00
Seth Fowler
c37bebaf90 Bug 1183852 - Only mark surfaces as used in the SurfaceCache if a caller requested exactly that surface. r=dholbert 2015-07-14 22:19:02 -07:00
Seth Fowler
8408489fa0 Bug 1167557 - Crash when a null surface is passed to SurfaceCache::Insert. r=dholbert 2015-07-01 16:09:21 -07:00
Seth Fowler
f18cc406a1 Bug 1139641 - Return more information from SurfaceCache::Lookup and SurfaceCache::LookupBestMatch. r=dholbert 2015-06-30 18:57:03 -07:00
Carsten "Tomcat" Book
6a80e7f649 Backed out changeset dd25b4d148af (bug 1139641) for bustage on a CLOSED TREE 2015-06-03 08:51:36 +02:00
Seth Fowler
b3b99d2f64 Bug 1139641 - Return more information from SurfaceCache::Lookup and SurfaceCache::LookupBestMatch. r=dholbert 2015-06-02 23:30:14 -07:00
Seth Fowler
d7cc5cb3bd Bug 1170877 - Track how many times the SurfaceCache has overflowed and report it in about:memory. r=dholbert 2015-06-02 23:30:11 -07:00
Birunthan Mohanathas
a03f0be199 Bug 1038536 - Flatten image/src/ directory. r=seth 2015-05-14 20:52:05 -07:00