Commit Graph

693 Commits

Author SHA1 Message Date
Daniel Holbert
c9dd5c94cc Bug 1233566: Drop unnecessary newline character from NS_WARNING in nsPersistentProperties. r=froydnj 2015-12-17 15:07:08 -08:00
Chris Peterson
7f4c4d76a4 Bug 1228947 - Replace mfbt/Constants.h with math.h. r=roc 2015-11-27 20:49:55 -08:00
Nathan Froyd
1d9140f7f6 Bug 1225923 - part 1 - convert all needs-to-copy instances of AppendElement(nsDependentString(...)); r=erahm
When people write:

  array.AppendElement(nsDependentString(...));

(resp. nsDependentCString), it's not clear whether they expect the newly
constructed dependent string to live in the array, or whether they're
just making a nsString-like holder whose contents can be freely copied
into the array's newly-created nsString.  Sometimes the latter is what
you prefer, and sometimes the former.  In all cases, however, the latter
behavior is what you get.

Let's try to make that behavior more explicit by pre-constructing
nsString elements and then using Assign to show that copying is taking
place.  This patch involves no functional change in behavior (it ought
to be epsilon faster due to using AppendElements, rather than repeatedly
calling AppendElement).
2015-11-18 10:25:19 -05:00
Birunthan Mohanathas
94998cf5fe Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Chris Peterson
e3e95816d8 Bug 1220035 - Fix -Wimplicit-fallthrough warnings in xpcom. r=mccr8
xpcom/base/nsDebugImpl.cpp:458:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsCheapSets.h:139:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsPersistentProperties.cpp:232:9 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsVariant.cpp:360:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsVariant.cpp:766:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsVariant.cpp:1658:9 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/ds/nsVariant.cpp:1661:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/glue/nsTextFormatter.cpp:355:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/glue/nsTextFormatter.cpp:362:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/io/nsWildCard.cpp:85:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
xpcom/io/nsWildCard.cpp:401:7 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
2015-10-29 21:31:32 -07:00
Eric Rahm
69f9ed90a7 Bug 1174785 - Part 2: Convert xpcom over to LogModule. r=froydnj 2015-10-19 12:50:14 -07: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
sajitk
a097ebf80d Bug 996105 - Added tests for registry access. Fixed wrong condition in ReadStringValue code. r=bsmedberg 2015-10-14 11:17:07 +05:30
Nigel Babu
5c5e2090ab Backed out changeset 7077589b174c (bug 996105) for failing its own tests ON A CLOSED TREE 2015-10-13 16:10:39 +05:30
sajitk
faf0b9e471 Bug 996105 - Added tests for registry access. Fixed wrong condition in ReadStringValue code. r=bsmedberg 2015-09-27 17:16:00 +02:00
Andrew McCreight
bf8e782bb7 Bug 931283, part 3 - Implement a cycle collected version of nsVariant. r=froydnj
Also, use this class for the component manager etc. in XPCOM.
2015-10-09 10:24:23 -07:00
Andrew McCreight
3a8776cc70 Bug 931283, part 2 - Split out nsVariant into a subclass. r=froydnj 2015-10-09 10:24:23 -07:00
Andrew McCreight
04775d9f01 Bug 931283, part 1 - Rename nsVariant to nsVariantBase. r=froydnj
Leave a typedef for compatibility. nsVariant will be defined as a
separate class in the next patch.

Also, remove an obsolete comment and fix some whitespace.
2015-10-09 10:24:23 -07:00
Nicholas Nethercote
6855b78fbf Bug 1201135 - Rename pldhash.{h,cpp} to PLDHashTable.{h,cpp}. r=mccr8. 2015-09-15 20:49:53 -07:00
Nicholas Nethercote
09b4a9e997 Bug 1203427 (part 5) - Add logging of timer firings. r=froydnj. 2015-09-10 00:50:51 -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
Chris Peterson
bcf08cea4c Bug 1204403 - Fix -Wshadow warnings in xpcom. r=mccr8 2015-09-07 23:56:16 -07:00
Nicholas Nethercote
ac3ae5e6c1 Bug 1121760 (part 6) - Move all remaining PL_DHash*() functions into PLDHashTable. r=poiru. 2015-09-14 14:23:47 -07:00
Nicholas Nethercote
93fcb9414c Bug 1121760 (part 5) - Remove PL_DHashMarkTableImmutable(). r=poiru. 2015-09-14 14:23:27 -07:00
Nicholas Nethercote
5c91fcd1e6 Bug 1121760 (part 3) - Remove PL_DHashTableRemove(). r=poiru. 2015-09-14 14:23:24 -07:00
Nicholas Nethercote
538c6626e9 Bug 1121760 (part 2) - Remove PL_DHashTableAdd(). r=poiru. 2015-09-14 14:23:12 -07:00
Nicholas Nethercote
ba83ffc5ec Bug 1121760 (part 1) - Remove PL_DHashTableSearch(). r=poiru. 2015-05-21 00:34:25 -07:00
Shu-yu Guo
45211869c8 Bug 1202902 - Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff) 2015-09-15 11:19:45 -07:00
Honza Bambas
ebd23f5a78 Bug 1199775 - mozilla::Tokenizer improvements vol 2. r=nfroyd 2015-09-02 06:20:00 +02:00
Miko Mynttinen
91ab8c9d00 Bug 1201287 - Cleanup nsSupportsPrimitives.cpp. r=smaug 2015-09-06 19:53:33 +03:00
Nicholas Nethercote
69d088e45f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
2015-08-27 20:44:53 -07:00
Miko Mynttinen
5415160f70 Bug 1197316 - Remove PR_snprintf calls in xpcom/. r=froydnj 2015-08-22 17:57:52 -07:00
Honza Bambas
f8b11fece7 Bug 1188983 - mozilla::Tokenizer improvements, r=nfroyd 2015-08-19 15:14:25 -07:00
Andrew McCreight
ec131acf8a Bug 1193564 - Check result of Read32 in nsSupportsArray::Read. r=erahm 2015-08-13 14:24:59 -07:00
Birunthan Mohanathas
e1f0334d06 Bug 1191100 - Remove XPIDL signature comments in .cpp files. r=ehsan
Comment-only so DONTBUILD.
2015-08-04 16:17:36 -07:00
Nicholas Nethercote
4a526ace27 Bug 1189156 (part 2) - Don't use enumeration style for nsTHashtable::SizeOf{In,Ex}cludingThis(). r=erahm.
After this change, we have ShallowSizeOf{In,Ex}cludingThis(), which don't do
anything to measure children. (They can be combined with iteration to measure
children.)

And we still have the existing single-arg SizeOf{In,Ex}cluding() functions,
which work if the entry type itself defines SizeOfExcludingThis().
2015-07-29 01:50:52 -07:00
Nicholas Nethercote
8bc2be4de1 Bug 1189156 (part 1) - Don't use enumeration style for PLDHashTable::SizeOf{In,Ex}cludingThis(). r=froydnj.
After this change, we have PLDHashTable::ShallowSizeOf{In,Ex}cludingThis(),
which don't do anything to measure children. (They can be combined with
iteration to measure children.)

This patch also removes the PL_DHashTableSizeOf{In,Ex}cludingThis() functions.
They're not necessary because the methods can be used instead.

Finally, the patch deliberately converts some SizeOfExcludingThis() calls to
SizeOfIncludingThis(). These are all done on heap pointers so this change is
valid.
2015-07-29 22:28:20 -07:00
Honza Bambas
07fc6c3685 Bug 1024056 - Simple ASCII lexical analyzer. r=nfroyd 2015-07-27 05:07:00 -04:00
Nicholas Nethercote
b1a271ed78 Bug 1181443 (part 1) - Use nsTHashtable::Iterator in nsCheapSet. r=froydnj.
nsCheapSet is used little enough that I didn't bother creating an iterator for
it.

I removed the dependency on PLDHashOperator by introducing nsCheapSetOperator,
which is equivalent.
2015-07-23 02:35:27 -07:00
Andrew McCreight
e40986f583 Bug 931571, part 15 - Remove extra spaces in nsVariant macros. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight
37e9703046 Bug 931571, part 14 - Delete various ways to copy or move nsDiscriminatedUnion. r=froydnj
nsDiscriminatedUnion owns memory without using smart pointers, so implementing anything
that would copy or move around one of these will require some care. Just forbid these
for now.
2015-07-23 12:28:30 -07:00
Andrew McCreight
708b3f5da4 Bug 931571, part 13 - Add a destructor for nsDiscriminatedUnion. r=froydnj
The existing nsDiscriminateUnions either always call Cleanup() when they
are about to go away, or they only handle scalar values so it is safe to
call Cleanup() on them without worrying about another discriminated union
having taken over any memory owned by this union.
2015-07-23 12:28:30 -07:00
Andrew McCreight
549a807921 Bug 931571, part 12 - Add nsDiscriminatedUnion::GetType(). r=froydnj
This is not quite enough to make the data members private because
XPCVariant pokes around to do some JS array stuff.
2015-07-23 12:28:30 -07:00
Andrew McCreight
34efb30120 Bug 931571, part 11 - Turn nsDiscriminatedUnion's Traverse function into a method. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight
3cbbce0b13 Bug 931571, part 10 - Turn SetFromVariant into a method. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight
753e925a63 Bug 931571, part 9 - Turn most of the nsVariant setters into nsDiscriminated methods. r=froydnj
This also adds a new nsDiscriminatedUnion method SetFromDOMString, as somebody added an nsVariant method without the corresponding helper.
2015-07-23 12:28:30 -07:00
Andrew McCreight
000a18bbde Bug 931571, part 8 - Turn ConvertToISupports, ConvertToInterface and ConvertToArray to methods. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight
51fedecbfb Bug 931571, part 7 - Turn ConvertTo*String and ToString into methods. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight
ecda5f23fb Bug 931571, part 6 - Make ConvertToID and String2ID into methods. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight
3f5ef7e2c8 Bug 931571, part 5 - Turn basic ConvertTo functions into methods. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight
9e77e4be3a Bug 931571, part 4 - Fix some spacing inside macros.
There's more that could be done to fix the style, but this was bothering me.
2015-07-23 12:28:30 -07:00
Andrew McCreight
59986fc413 Bug 931571, part 3 - Rename return value of macro generated methods. r=froydnj 2015-07-23 12:28:29 -07:00
Andrew McCreight
06c877e501 Bug 931571, part 2 - Convert Cleanup() and FreeArray() to methods. r=froydnj 2015-07-23 12:28:29 -07:00
Andrew McCreight
0f713cbe02 Bug 931571, part 1 - Use a constructor for nsDiscriminatedUnion. r=froydnj 2015-07-23 12:28:29 -07:00
Kyle Huey
b8d33919e9 Bug 1185470: Remove 'Get' prefixes from hashtable iterator methods. r=froydnj 2015-07-20 20:21:28 +08:00