Граф коммитов

2226 Коммитов

Автор SHA1 Сообщение Дата
Chris Peterson 8a9e2d2bd4 Bug 1272513 - Part 2: Remove redundant -Wshadow CXXFLAGS from moz.build files. r=glandium 2016-05-14 00:54:55 -07:00
Kyle Huey 941ab1f522 Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
Nathan Froyd 9b00f3e468 Bug 1262399 - remove Impl suffixes from nsSupports* implementations; r=mccr8
Having the Impl suffix isn't really necessary, and if we start creating
instances of these classes directly, it's also rather ugly.  Let's get
rid of them.
2016-05-03 15:25:41 -05:00
Nicholas Nethercote 7cc5e1d84e Bug 1268772 (part 5) - Use MOZ_MUST_USE in other parts of xpcom/ds/. r=erahm.
As well as adding MOZ_MUST_USE to a number of functions, this patch:

- Changes the return type of nsObserverList::GetObserverList() from |nsresult|
  to |void|, because it always returned NS_OK and none of the callers checked
  the result.

- Removes an unnecessary |new| check in nsSupportsArray::Enumerate().

--HG--
extra : rebase_source : 3a93124ef2a7db3929119194ceacbc56bc80d2c6
2016-04-28 17:11:17 +10:00
Nicholas Nethercote 2ae68d12e9 Bug 1268772 (part 4) - Use MOZ_MUST_USE with NS_NewISupportsArray(). r=erahm.
A few callers of NS_NewISupportsArray() didn't use the return value to detect
failure, but instead checked if the |array| argument was null after the call.
This is inconsistent with the majority of the calls to NS_NewISupportsArray().
This patch changes them to be checked in the normal way.

--HG--
extra : rebase_source : bf91836d7c3b159833c303a3716f4d9366f8b76a
2016-05-02 09:06:47 +10:00
Nicholas Nethercote e049e2be4f Bug 1268772 (part 3) - Remove NS_NewWindowsRegKey()'s return value. r=erahm.
It's always NS_OK. The patch also removes an unnecessary failure check as a
result.

--HG--
extra : rebase_source : 3a0c30f9ca0e838682204ed1a8d46d6ab35e20b8
2016-05-02 09:06:45 +10:00
Nicholas Nethercote 27327f8bea Bug 1268772 (part 2) - Make infallible nsVariant methods return |void| instead of |nsresult|. r=erahm.
This makes things clearer and removes some unnecessary nsresult checks.

The patch also:
- removes some unnecessary |new| and moz_xmalloc() checks;
- adds MOZ_MUST_USE to some fallible nsVariant methods.

--HG--
extra : rebase_source : fd0bd0c55c22ebf194246ec9997fe971cf282e69
2016-04-29 13:47:44 +10:00
Nicholas Nethercote a2776c6af7 Bug 1268772 (part 1) - Remove nsCheapSet::Put()'s return value. r=erahm.
It's always NS_OK and none of the call sites look at it.

--HG--
extra : rebase_source : c70ca0c98ef27065ddfacc0a1e84dcfef2ff500a
2016-04-28 15:59:58 +10:00
Carsten "Tomcat" Book ba3fe0975c Backed out changeset 85ce8cb0639a (bug 1268313)
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02:00
Nicholas Nethercote 2511b2c327 Bug 1267550 (part 2) - Rename MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE. r=froydnj.
It's an annotation that is used a lot, and should be used even more, so a
shorter name is better.

MozReview-Commit-ID: 1VS4Dney4WX

--HG--
extra : rebase_source : b26919c1b0fcb32e5339adeef5be5becae6032cf
2016-04-27 14:16:50 +10:00
Kyle Huey 48a594a09e Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-04-28 14:08:25 -07:00
Chris Peterson c2fe3cc9ea Bug 1266295 - Remove unnecessary compiler version checks for gcc <= 4.8.0 in xpcom. r=froydnj 2016-04-17 17:10:00 -07:00
Nicholas Nethercote d8cfadc76d Bug 1261744 - Add two missing null checks for nsStringBuffer::Alloc(). r=erahm.
--HG--
extra : rebase_source : 7465db70cf5a3e19416a742481b3321e8b6eef16
2016-04-07 09:35:50 +10:00
Valentin Gosu a44929e1eb Bug 1261382 - Add ReadUntil method to Tokenizer r=mayhemer 2016-04-08 16:27:32 +02:00
Nicholas Nethercote 9601d6a63f Bug 1261735 (part 4) - Change StaticAtomEntry::mAtom to |StaticAtom*|. r=erahm.
This required reordering a bunch of stuff, so I took the opportunity to do a
big reordering. The new order:

- class CheckStaticAtomSizes;
- class DynamicAtom, class StaticAtom, their methods;
- gAtomTable and related functions;
- ~DynamicAtom() (here because it depends on gAtomTable stuff);
- gStaticAtomTable and related functions;
- exported functions.

--HG--
extra : rebase_source : 5fd4bf9a3f0c628dc3f74c0d8a81aadf48fd6dd7
2016-04-06 12:01:24 +10:00
Nicholas Nethercote cd63c6bfee Bug 1261735 (part 3) - De-virtualize nsIAtom::IsStaticAtom(). r=froydnj,erahm.
This avoids the need for some virtual function calls and also will help lead to
distinct representations for dynamic and static atoms.

--HG--
extra : rebase_source : 16bbe6f1e1309ee3e4fab7a0d222e638178a2a9c
2016-04-06 11:28:40 +10:00
Nicholas Nethercote a1d85c6ab8 Bug 1261735 (part 2) - Inline some {Dynamic,Static}Atom methods. r=erahm.
--HG--
extra : rebase_source : 0e50d8542fdf5de18b22dd2aa4a5fea71f48d032
2016-04-06 11:28:39 +10:00
Nicholas Nethercote e4dec8d42f Bug 1261735 (part 1) - Overhaul the atom implementation. r=froydnj,erahm.
This patch changes things so that dynamic atoms and static atoms have distinct
implementations. This is a step towards allowing dynamic atoms and static atoms
to have different layouts in memory, which will allow static atoms to be
represented more compactly.

Specifically, the patch does the following.

- It renames AtomImpl as DynamicAtom and PermanentAtomImpl as StaticAtom, and
  the latter is no longer a subclass of the former. This required duplicating
  some methods from the former into the latter: ScriptableToString(),
  ToUTF8String(), ScriptableEquals(), IsStaticAtom(). (This duplication will
  disappear in the future if the representations of dynamic atoms and static
  atoms diverge. Indeed, SizeOfIncludingThis() is already different in the two
  classes.)

- It replaces all mentions of "permanent"/"non-permanent" atoms with
  "static"/"dynamic".

- In ~DynamicAtom() it removes the check that causes gAtomTable to be deleted
  when it becomes empty. This will only happen at shutdown and so doesn't seem
  useful.

- It documents better various things, especially the basics of the
  dynamic/static split, the transmutation of dynamic atoms to static atoms, and
  the details of the SizeOf functions.

--HG--
extra : rebase_source : dbf903012e70ebf1a43de1e1088db1bc1b8dd4f4
2016-04-01 11:18:06 +11:00
Nicholas Nethercote d376f9f82e Bug 1260871 - Remove do_GetAtom() and rename NS_NewAtom() as NS_Atomize(). r=erahm.
do_GetAtom() is currently just a synonym for NS_NewAtom().

--HG--
extra : rebase_source : f4409784f931616cbc300591e6b843d30805c273
2016-03-29 10:09:43 +11:00
Nicholas Nethercote bbfe3dbc14 Bug 1257402 - Remove NS_NewPermanentAtom() and nsIAtomService.getPermanentAtom(). r=froydnj,kmag.
The former is only used inconsequentially in tests. The second is not used at
all.

--HG--
extra : rebase_source : 4cfe11f933f1fe8f788e823c5107941085cef92c
2016-03-17 13:11:31 +11:00
Nicholas Nethercote ea7e61e63c Bug 1257128 (part 2) - Remove nsIAtomService.get{,Permanent}AtomUTF8. r=froydnj. 2016-03-16 21:09:18 +11:00
Nicholas Nethercote 41e924c6e0 Bug 1257128 (part 1) - Remove nsIAtom.equalsUTF8. r=froydnj.
It's only used in tests.
2016-03-16 21:05:30 +11:00
Nicholas Nethercote ab34e9bd7a Bug 1257207 - Increase ATOM_HASHTABLE_INITIAL_LENGTH. r=froydnj.
This avoids one gAtomTable resizing.

--HG--
extra : rebase_source : 136e9db9653d4632986c2462f51c5c008475e1de
2016-03-24 09:17:55 +11:00
Ms2ger 3a6fa6704c Bug 1255343 - Stop returning nsresult from NS_RegisterStaticAtoms; r=ehsan
It only ever returns NS_OK, and none of the callers check the result.
2016-03-18 09:03:43 +01:00
Nicholas Nethercote a2f068b2ad Bug 1253085 - Remove the |PLDHashTable*| argument from PLDHash{HashKey,MatchEntry}. r=froydnj.
This is easy because it's never needed.

--HG--
extra : rebase_source : 78830dab41c40a1544fa55fc69ca9c1c6709d767
2016-03-16 15:33:44 +11:00
Eric Rahm 4c23f5cd8d Bug 1251482 - Remove remaining references to MOZILLA_XPCOMRT_API from xpcom. r=froydnj 2016-02-26 18:10:56 -08:00
Wes Kocher 72d9604d91 Backed out 8 changesets (bug 1251482, bug 1251494, bug 1251473, bug 1239870) for gtest failures
Backed out changeset f064a5efbb8c (bug 1251494)
Backed out changeset 9e33adec1aa6 (bug 1251482)
Backed out changeset ab0347657e25 (bug 1251473)
Backed out changeset 1d385d4f195d (bug 1239870)
Backed out changeset ceb3e1ee7dda (bug 1239870)
Backed out changeset 8574075bf42f (bug 1239870)
Backed out changeset ba077a3afbc7 (bug 1239870)
Backed out changeset eb99ab06414d (bug 1239870)

MozReview-Commit-ID: 7r9SEk4VGNU
2016-02-26 17:14:57 -08:00
Eric Rahm ae72b68e62 Bug 1251482 - Remove remaining references to MOZILLA_XPCOMRT_API from xpcom. r=froydnj 2016-02-26 15:31:19 -08:00
Nathan Froyd 2697b8c4a2 Bug 1251495 - remove unnecessary Logging.h include from nsStaticAtom.h; r=erahm 2016-02-25 16:38:26 -05:00
Nicholas Nethercote 711418387a Bug 1250396 (part 2) - Remove nsStaticAtomStringType. r=froydnj.
It's only used in one file and obscures more than it enlightens.

--HG--
extra : rebase_source : 70759ab71c0955d8f83c142cf5f1fb9f56d294e5
2016-02-23 16:55:59 +11:00
Nicholas Nethercote d637d20fdf Bug 1250396 (part 1) - Document a subtle contraint on nsIAtom. r=froydnj.
--HG--
extra : rebase_source : d26b318240e504f170d5649f4c12eadf05c433b8
2016-02-17 11:30:02 +11:00
Brian Birtles f646d50d07 Bug 1249212 part 2 - Fix infinity handling in StickyTimeDurationValueCalculator::Multiply; r=froydnj
This patch brings the behavior of this method into line with the comment that
describes it and other methods in this class that have a similar test.

I discovered this bug while exercising this code from animation code and was
getting test failures due to returning -Infinity instead of the expected
Infinity.
2016-02-19 08:37:31 +09:00
Nicholas Nethercote 9eda713f8b Bug 1247850 - Shrink NameTableKey in nsStaticCaseInsensitiveNameTable. r=froydnj,erahm.
This patch removes NameTableEntry::mString. This requires adding mNameArray to
NameTableKey so that we can index off it in matchNameKeysCaseInsensitive().

This change saves 41.5 KiB per process.
2016-02-12 16:55:51 +11:00
ISHIKAWA, Chiaki be2b50a7f8 Bug 1248252 - Improper outdated octal constant syntax in M-C tree. Use '0o' prefix. r=dao
Be warned. Do not attemp to change the .js "test" source code in ./js
They are meant to check

 - the outdated 0666 octal constant is still parsed correctly,
 - the outdated 0666 octal constant raises syntax error flag
   in strict mode, etc.

So leave them alone.
2016-02-15 08:57:00 +01:00
Valentin Gosu 52d81f715f Bug 241788 - mozilla::Tokenizer - token type for \n should whitespace if given in constructor r=honzab 2016-02-05 14:43:45 +01:00
Wilmer Paulino 99af515866 Bug 1237668 - Remove nsSimpleUnicharStreamFactory r=froydnj 2016-01-11 19:31:29 -05:00
Nicholas Nethercote ec89bbf7f2 Bug 1237151 (part 3) - Remove ignored qualifiers in all remaining code. r=froydnj. 2016-01-05 17:08:45 -08:00
Bogdan Postelnicu a2071162e7 Bug 1234542 - Don't use fallible Add in SetStringProperty. r=froydnj
--HG--
extra : rebase_source : 697c493e0150953f6a8fb152109ef228673f15a0
2016-01-04 07:14:00 -05:00
Daniel Holbert 31284e2a5e Bug 1233566: Drop unnecessary newline character from NS_WARNING in nsPersistentProperties. r=froydnj 2015-12-17 15:07:08 -08:00
Chris Peterson 46bb7c80dd Bug 1228947 - Replace mfbt/Constants.h with math.h. r=roc
--HG--
extra : rebase_source : 4ab2c4a917ea90055e48bd6adcb53904f2266ee0
2015-11-27 20:49:55 -08:00
Nathan Froyd 8a2948e596 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 9985829ecc Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Chris Peterson 4cbe614b32 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 5b38c55967 Bug 1174785 - Part 2: Convert xpcom over to LogModule. r=froydnj
--HG--
extra : rebase_source : 58d3b32bd0174f2540512cef810cafdd3556ef6b
2015-10-19 12:50:14 -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
sajitk b564e1db32 Bug 996105 - Added tests for registry access. Fixed wrong condition in ReadStringValue code. r=bsmedberg
--HG--
extra : amend_source : 8b78a62b071a515f3652e77c2abd37561ebf3380
2015-10-14 11:17:07 +05:30
Nigel Babu 640106b762 Backed out changeset 7077589b174c (bug 996105) for failing its own tests ON A CLOSED TREE 2015-10-13 16:10:39 +05:30
sajitk 5491f00db4 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 c97953414d 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 642c4344e2 Bug 931283, part 2 - Split out nsVariant into a subclass. r=froydnj 2015-10-09 10:24:23 -07:00