Commit Graph

587 Commits

Author SHA1 Message Date
Nicholas Nethercote
c0a8a6e993 Bug 1123151 (part 2) - Add PLDHashTable::IsInitialized(). r=froydnj.
This encapsulates most of the uses of PLDHashTable::ops.

--HG--
extra : rebase_source : 7760ce8e46a37e87dcfe590e809a21df01fe510f
2015-01-19 16:11:34 -08:00
Nicholas Nethercote
a5c8dbfaf4 Bug 1123151 (part 1) - Set PLDHashTable::ops consistently. r=froydnj.
Currently the setting of PLDHashTable::ops is very haphazard.

- PLDHashTable has no constructor, so it's not auto-nulled, so lots of places
  null it themselves.

- In the fallible PLDHashTable::Init() function, if the entry storage
  allocation fails we'll be left with a table that has |ops| set -- indicating
  it's been initialized -- but has null entry storage. I'm not certain this can
  cause problems but it feels unsafe, and some (but not all) callers of Init()
  null it on failure.

- PLDHashTable does not null |ops| in Finish(), so some (but not all) callers
  do this themselves.

This patch makes things simpler.

- It adds a constructor that zeroes |ops|.

- It modifies Init() so that it only sets |ops| once success is ensured.

- It zeroes |ops| in Finish().

- Finally, it removes all the now-unnecessary |ops| nulling done by the users
  of PLDHashTable.

--HG--
extra : rebase_source : bb34979c218d152562a2f9c7e5215256c111cc5b
2015-01-19 16:01:24 -08:00
Trevor Saunders
43229d1314 bug 1122100 - more MOZ_OVERRIDE in xpcomish stuff r=froydnj 2015-01-19 17:41:12 -05:00
Ehsan Akhgari
f2ea365c3b Bug 1123121 - Mark all nsCOMPtr_helper classes as stack class; r=froydnj 2015-01-19 12:39:36 -05:00
Ehsan Akhgari
d4a2ec7dbf Bug 1123000 - Mark nsDiscriminatedUnion::mInterfaceValue as owning; r=froydnj 2015-01-19 10:00:33 -05:00
Ehsan Akhgari
6b2552fda4 Bug 1122991 - Mark findIndexOfClosure as stack class, and make its targetElement member a void*; r=froydnj 2015-01-19 10:00:32 -05:00
Ehsan Akhgari
f9ad2fe834 Bug 1122990 - Mark nsPropertiesParser as stack class, and make its mProps member a strong ref; r=froydnj 2015-01-19 10:00:31 -05:00
Ehsan Akhgari
8b1fa5a577 Bug 1123109 - Mark nsStaticAtom::mStringBuffer as non-owning; r=froydnj 2015-01-19 09:05:44 -05:00
Ehsan Akhgari
bff7b1f7c4 Bug 1122996 - Convert nsSupportsArrayEnumerator::mArray into an nsCOMPtr; r=froydnj 2015-01-19 09:03:56 -05:00
Ehsan Akhgari
56dfa74dcd Bug 1122995 - Clarify the lifetime rules applying to the permanent and non-permanent nsIATOM* members in nsAtomTable.cpp; r=froydnj 2015-01-19 09:03:10 -05:00
Ehsan Akhgari
32f1fc1f6e Bug 1122986 - Mark nsQueryElementAt::mCollection as non-owning; r=froydnj 2015-01-19 09:00:25 -05:00
Ehsan Akhgari
056d3a8525 Bug 1122989 - Remove nsIPersistentProperties::Subclass(); r=froydnj
This method is unused, and more importantly it causes us to store an
unsafe reference in nsPersistentProperties.  It's best to remove it.
2015-01-19 08:59:01 -05:00
Nicholas Nethercote
5a62e7fcbf Bug 1121304 (part 2, attempt 2) - Remove PLDHashTableOps::{alloc,free}Table. r=froydnj.
--HG--
extra : rebase_source : bc119bd0d3b6944e8c5a000950e0c4052cb70aef
2015-01-14 14:35:56 -08:00
Nicholas Nethercote
09c7443b86 Bug 1121304 (part 1, attempt 2) - Minor type clean-ups for PLDHashTable. r=froydnj.
--HG--
extra : rebase_source : cccc747bf900804a566853d8eb7f16cf82a26978
2015-01-14 14:35:45 -08:00
Phil Ringnalda
9a3738d626 Backed out 2 changesets (bug 1121304) for consistent b2g hangs in webgl-color-test.html?frame=1&__&preserve&premult&_____
Backed out changeset 20651ac19549 (bug 1121304)
Backed out changeset 758afec77c95 (bug 1121304)
2015-01-14 22:02:23 -08:00
Nicholas Nethercote
7e78186cb9 Bug 1121304 (part 2) - Remove PLDHashTableOps::{alloc,free}Table. r=froydnj. 2015-01-14 14:35:56 -08:00
Nicholas Nethercote
364e4fe100 Bug 1121304 (part 1) - Minor type clean-ups for PLDHashTable. r=froydnj. 2015-01-14 14:35:45 -08:00
Nicholas Nethercote
e7f3233097 Bug 1120476 (part 4) - Remove PLDHashTableOps::finalize. r=froydnj.
--HG--
extra : rebase_source : b14dda8cdd5cd896d1e32950e38b2a9f7da4d99e
2015-01-13 19:02:35 -08:00
Nicholas Nethercote
00b5865c2a Bug 1120476 (part 3) - Remove PLDHashTable::data. r=froydnj.
--HG--
extra : rebase_source : 24d10af3dbce3ada5252503bc80bb1a4e31bc1c9
2015-01-13 16:42:13 -08:00
Ehsan Akhgari
b6e35bb4b4 Bug 1118486 - Part 1: Use = delete instead of MOZ_DELETE directly; r=Waldo
Most of this patch (with the exception of dom/bindings/Codegen.py) was
generated by the following bash script:

#!/bin/bash

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "*/.git*" \
       ! -wholename "obj-*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_DELETE '= delete'
2015-01-08 23:19:05 -05:00
Michael Pruett
9424a24884 Bug 1118024 - Add explicit PL_DHashTable{Add,Lookup,Remove} functions. r=nfroyd 2015-01-05 20:26:50 -06:00
Nathan Froyd
d45572ca64 Bug 1117853 - remove duplicate mozilla/Attributes.h #include; r=bsmedberg 2014-01-22 18:37:02 -05:00
Ehsan Akhgari
4f80dee4e8 Bug 1117035 - Mark virtual overridden functions as MOZ_OVERRIDE in XPCOM; r=froydnj 2015-01-05 11:25:41 -05:00
Mason Chang
a88f78597a bug 552020 Part 3: Enable Creation of mozilla::TimeStamp from system timestamps. r=roc 2014-11-18 13:28:42 -08:00
Brian Birtles
40b569b50a Bug 1073336 part 3a - Allow TimeStamp == and != operators to work with null timestamps; r=froydnj 2014-11-17 13:45:56 +09:00
Ryan VanderMeulen
57225618ce Backed out changesets a99bd0b3b075, a7fb851f823a, and 9fc2d99376cd (bug 552020) for non-unified bustage and OSX 10.6 tsvgr crashes.
CLOSED TREE
2014-11-14 15:57:35 -05:00
Mason Chang
97966e77aa Bug 552020. Part 3: Enable creation of mozilla::TimeStamp from system Timestamps. r=roc 2014-11-14 08:31:04 -08:00
Jacek Caban
4129770618 Bug 1092130 - Fixed build errors found by mingw after bug 1076698 landed (-Werror=missing-braces errors). r=cpearce 2014-11-03 10:28:52 +01:00
Mason Chang
a4b08a413f Bug 1083530. Part 1 Create mozilla::TimeStamp constructor with system time param. r=roc 2014-10-29 13:36:51 -07:00
Brian Birtles
5bc3dbc321 Bug 1074651 - Detect integer overflow in BaseTimeDuration::TicksFromMilliseconds; r=bz 2014-10-02 15:14:12 +09:00
Brian Birtles
c0aa1e51cf Bug 1039924 part 8 - Include FloatingPoint.h in StickyTimeDuration.h; r=froydnj
Overlooked review feedback from comment:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1039924#c43
2014-09-25 14:35:51 +09:00
Brian Birtles
953d64c3f3 Bug 1039924 part 7 - Add unary minus operator to BaseTimeDuration; r=froydnj
This patch adds the unary minus operator so, for example, we can write:

  TimeDuration sinceBeforeYourSunBurnedHot = -TimeDuration::Forever();
2014-09-25 14:25:50 +09:00
Brian Birtles
4c6a27410d Bug 1039924 part 5 - Add StickyTimeDuration; r=froydnj
This patch adds another implementation of BaseTimeDuration's ValueCalculator
template parameter that is careful to preserve Forever/-Forever values when
performing arithmetic.

It also defines a typedef for a specialization of BaseTimeDuration that uses
this new ValueCalculator definition.
2014-09-25 14:25:50 +09:00
Brian Birtles
c4e801e7cf Bug 1039924 part 4 - Fill out TimeDurationValueCalculator and use it; r=froydnj
This patch builds on the templatization from the previous patch to move
arithmetic on the mValue member of BaseTimeDuration to the ValueCalculator
template parameter.
2014-09-25 14:25:49 +09:00
Brian Birtles
99025a6c9b Bug 1039924 part 3 - Templatize TimeDuration so it can support different behaviors with regards to tick count arithmetic; r=froydnj
This patch prepares the way for having a separate StickyTimeDuration class
by factoring TimeDuration into a templated base class: BaseTimeDuration.
BaseTimeDuration takes a templated parameter, ValueCalculator, which is a helper
object that defines how various arithmetic operations are performed on its
mValue member (an int64_t count of ticks).

This patch does not actually define or use the ValueCalculator parameter yet but
simply performs the renaming and templatization.

With regards to the templatization, arithmetic operators are defined to take
objects with the same ValueCalculator template parameter (so that we don't, for
example, apply non-safe arithmetic to a StickyTimeDuration).
However, comparison operators are defined to also operate on objects with
a different ValueCalculator template parameter since comparison should be
independent of the type of arithmetic used.

Likewise, the constructor and assignment operator are defined to operate on
objects with a different ValueCalculator template parameter so that objects can
be converted from TimeDuration to StickyTimeDuration and vice-versa.
The constructor is marked as explicit, however, so that we don't silently
convert a StickyTimeDuration to a TimeDuration and unwittingly apply
non-safe arithmetic to a StickyTimeDuration.

TimeDuration is defined as a specialization of BaseTimeDuration that uses
TimeDurationValueCalculator as its ValueCalculator type.
TimeDurationValueCalculator is filled-in in a subsequent patch.
2014-09-25 14:25:49 +09:00
Brian Birtles
c668976a1d Bug 1039924 part 2 - Convert between Forever and Infinity when converting TimeDurations; r=froydnj
Now that the implementation of a number of TimeDuration methods have been
delegated to a separate TimeDurationPlatformUtils class, it is easier to add
consistent handling to the parameters passed to and from those methods.

This patch adds checks when converting between TimeDurations and doubles so that
Forever (represented by a tick count of INT64_MAX) is paired with
PositiveInfinity, and INT64_MIN is paired with NegativeInfinity.
2014-09-25 14:25:49 +09:00
Brian Birtles
01e071c1ca Bug 1039924 part 1 - Separate platform-dependent parts of TimeDuration into TimeDurationPlatformUtils; r=froydnj
In order to have different templated versions of TimeDuration we first split out
the platform-specific code so that this code doesn't need to concern itself with
templates (and because putting template code in .cpp files is messy).
2014-09-25 14:25:48 +09:00
Honza Bambas
cbcc956da6 Bug 1034638 - Don't make QPC to GTC fallback in TimeStamp_windows let change differences of previously taken timestamps, r=robarnold 2014-09-16 15:51:51 +02:00
Andrew McCreight
01d312c5b8 Bug 931285, part 2 - Implement a cycle collected version of nsHashPropertyBag and use it from JS. r=froydnj 2014-09-08 09:41:32 -07:00
Andrew McCreight
623aaaa7d9 Bug 931285, part 1 - Factor out a base class for nsHashPropertyBag that does not implement refcounting. r=froydnj
Also remove the unused NS_NewHashPropertyBag.
2014-09-08 09:41:22 -07:00
Nicholas Nethercote
8b3951c20f Bug 1057912 - Privatize most of PLDHashTable's fields. r=roc.
--HG--
extra : rebase_source : 0f55e70b63d9c191fbd9418cb1177ff534deeed9
2014-08-25 16:56:33 -07:00
Birunthan Mohanathas
e5756cb55e Bug 1046841 - Convert remaining files in xpcom/{ds,glue,sample}/ to Gecko style. r=froydnj 2014-08-25 12:17:28 -07:00
Birunthan Mohanathas
87bd70f161 Bug 1046841 - Fix more style violations in previously touched .h files in xpcom/. r=froydnj 2014-08-25 12:17:24 -07:00
Kyle Huey
cc8ecc64fc Bug 1049694: Remove unused mozilla::CharTokenizer. r=froydnj 2014-08-08 11:11:33 -07:00
Nicholas Nethercote
8c60d14a1a Bug 1050009 - Initialize pldhash tables with a length, not a capacity. r=roc.
* * *
imported patch rm-dummy-params

--HG--
extra : rebase_source : c25987eb11bae197218d5fc53b77def19afa36ac
2014-08-06 06:31:21 -07:00
Nicholas Nethercote
d2e16bf467 No bug. Remove two "njn: ..." comments I accidentally left in. r=me.
DONTBUILD because the patches contains only trivial comment changes.

--HG--
extra : rebase_source : ecc0bd10c43c6d4223f5301ff11cbd2a56c9912b
2014-08-06 16:19:55 -07:00
Ehsan Akhgari
8686c5e382 Bug 1048239 - Fix more bad implicit constructors in XPCOM; r=froydnj 2014-08-05 09:36:32 -04:00
Nicholas Nethercote
91ad4f1869 Bug 1047220 - Shrink the static atoms table. r=bz.
--HG--
extra : rebase_source : a7f8d54cce7f20d784371348f0d0cabdacf43c0a
2014-07-31 22:57:13 -07:00
Nicholas Nethercote
2d1ea36d04 Bug 1046529 (part 2) - Ensure static atoms always end up in gStaticAtomTable. r=bz,hsivonen. 2014-07-30 23:22:42 -07:00
Nicholas Nethercote
d4369ce42c Bug 1046529 (part 1) - Split and simplify AtomTableKey's constructors. r=bz. 2014-07-30 23:22:40 -07:00