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

2093 Коммитов

Автор SHA1 Сообщение Дата
Mason Chang e6f06e5cfc Bug 1127151. Part 4: Update TimeStamp::FromSystemTime with windows testing. r=kats 2015-02-13 17:17:28 +08:00
Nicholas Nethercote 3a7b0a9f57 Bug 1131901 (part 1) - Make PL_DHashTableAdd() infallible by default, and add a fallible alternative. r=froydnj.
I kept all the existing PL_DHashTableAdd() calls fallible, in order to be
conservative, except for the ones in nsAtomTable.cpp which already were
followed immediately by an abort on failure.

--HG--
extra : rebase_source : 526d96ab65e4d7d71197b90d086d19fbdd79b7b5
2015-02-02 14:48:58 -08:00
Andrew McCreight 31ba9aaed9 Bug 1131199, part 2 - Make PLDHashtInitEntry infallible. r=froydnj
Also, drop the unused table argument.
2015-02-11 09:46:40 -08:00
Nicholas Nethercote 63e3218e4c Back out changesets 2fcef6b54be7, 2be07829fefc, 66dfe37b8532, df3fcd2be8fd, 0a436bce77a6 (bug 1050035) for causing intermittent crashes and assertion failures.
--HG--
extra : rebase_source : eb30be83c3143c6c203585a80a18f180025efaba
2015-02-10 14:39:49 -08:00
Nicholas Nethercote 242708cf72 Bug 1127201 (attempt 2, part 1) - Replace most NS_ABORT_IF_FALSE calls with MOZ_ASSERT. r=Waldo.
--HG--
extra : rebase_source : 488e401ff87e31a2074c4108c4df0572d9536667
2015-02-09 14:34:50 -08:00
Andrew McCreight d3826daa16 Back out Bug 1127201 (part 2) for various problems. 2015-02-06 15:04:32 -08:00
Nicholas Nethercote d34f0301b8 Bug 1127201 (part 2) - Convert all NS_ABORT_IF_FALSE calls to MOZ_ASSERT. r=Waldo.
--HG--
extra : rebase_source : 99182e70335d2b5ff95f8c528ae992d37294be3a
2015-02-04 20:05:36 -08:00
Nicholas Nethercote b5913e0b3d Bug 1050035 (part 4) - Make PL_DHashTableAdd() infallible by default, and add a fallible alternative. r=froydnj.
I kept all the existing PL_DHashTableAdd() calls fallible, in order to be
conservative, except for the ones in nsAtomTable.cpp which already were
followed immediately by an abort on failure.

--HG--
extra : rebase_source : eeba14d732077ef2e412f4caca852de6b6b85f55
2015-02-02 14:48:58 -08:00
Nicholas Nethercote 9a36fdbde4 Bug 1050035 (part 2) - Remove the fallible version of PL_DHashTableInit(). r=froydnj,mrbkap.
Because it's no longer needed now that entry storage isn't allocated there.
(The other possible causes of failures are much less interesting and simply
crashing is a reasonable thing to do for them.)

This also makes PL_DNewHashTable() infallible.

--HG--
extra : rebase_source : 848cc9bbdfe434525857183b8370d309f3acbf49
2015-02-01 20:19:08 -08:00
Mike Hommey a35dbaeebf Bug 1126593 - Add a global fallible instance, so that using fallible works directly, everywhere. r=njn
--HG--
rename : memory/mozalloc/fallible.h => memory/fallible/fallible.h
2015-02-02 09:56:13 +09:00
Nicholas Nethercote 3163cfc2c1 Bug 1124973 (part 2) - Introduce PL_DHashTableSearch(), and replace most PL_DHashTableLookup() calls with it. r=froydnj.
It feels safer to use a function with a new name, rather than just changing the
behaviour of the existing function.

For most of these cases the PL_DHashTableLookup() result was checked with
PL_DHASH_ENTRY_IS_{FREE,BUSY} so the conversion was easy. A few of them
preceded that check with a useless null check, but the intent of these was
still easy to determine.

I'll do the trickier ones in subsequent patches.

--HG--
extra : rebase_source : ab37a7a30be563861ded8631771181aacf054fd4
2015-01-22 21:06:55 -08:00
Nicholas Nethercote 8bd1f6f072 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 bd573c9b9c 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 6c486b0407 bug 1122100 - more MOZ_OVERRIDE in xpcomish stuff r=froydnj 2015-01-19 17:41:12 -05:00
Ehsan Akhgari fa5c39586f Bug 1123121 - Mark all nsCOMPtr_helper classes as stack class; r=froydnj 2015-01-19 12:39:36 -05:00
Ehsan Akhgari 0c1e071a73 Bug 1123000 - Mark nsDiscriminatedUnion::mInterfaceValue as owning; r=froydnj 2015-01-19 10:00:33 -05:00
Ehsan Akhgari f555db9bc7 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 f1d08feef9 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 cfc3bde8b2 Bug 1123109 - Mark nsStaticAtom::mStringBuffer as non-owning; r=froydnj 2015-01-19 09:05:44 -05:00
Ehsan Akhgari 614625066f Bug 1122996 - Convert nsSupportsArrayEnumerator::mArray into an nsCOMPtr; r=froydnj 2015-01-19 09:03:56 -05:00
Ehsan Akhgari 0cc0ba6ab4 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 4302209514 Bug 1122986 - Mark nsQueryElementAt::mCollection as non-owning; r=froydnj 2015-01-19 09:00:25 -05:00
Ehsan Akhgari 3bf8f8296a 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 69fe655b04 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 27ab169068 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 e39f0adeca 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 e9735966fa Bug 1121304 (part 2) - Remove PLDHashTableOps::{alloc,free}Table. r=froydnj. 2015-01-14 14:35:56 -08:00
Nicholas Nethercote 41dc319a7c Bug 1121304 (part 1) - Minor type clean-ups for PLDHashTable. r=froydnj. 2015-01-14 14:35:45 -08:00
Nicholas Nethercote 47221bc7f9 Bug 1120476 (part 4) - Remove PLDHashTableOps::finalize. r=froydnj.
--HG--
extra : rebase_source : b14dda8cdd5cd896d1e32950e38b2a9f7da4d99e
2015-01-13 19:02:35 -08:00
Nicholas Nethercote c7538c9776 Bug 1120476 (part 3) - Remove PLDHashTable::data. r=froydnj.
--HG--
extra : rebase_source : 24d10af3dbce3ada5252503bc80bb1a4e31bc1c9
2015-01-13 16:42:13 -08:00
Ehsan Akhgari 4354953b4f 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 62960a5119 Bug 1118024 - Add explicit PL_DHashTable{Add,Lookup,Remove} functions. r=nfroyd 2015-01-05 20:26:50 -06:00
Nathan Froyd 772bdaecb8 Bug 1117853 - remove duplicate mozilla/Attributes.h #include; r=bsmedberg 2014-01-22 18:37:02 -05:00
Ehsan Akhgari f32bb086bc Bug 1117035 - Mark virtual overridden functions as MOZ_OVERRIDE in XPCOM; r=froydnj 2015-01-05 11:25:41 -05:00
Mason Chang de0e409177 bug 552020 Part 3: Enable Creation of mozilla::TimeStamp from system timestamps. r=roc 2014-11-18 13:28:42 -08:00
Brian Birtles 862f1e6d3b 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 87e1d173f4 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 89dd1bd2d2 Bug 552020. Part 3: Enable creation of mozilla::TimeStamp from system Timestamps. r=roc 2014-11-14 08:31:04 -08:00
Jacek Caban 1fb284960f 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 97ebd4c29a Bug 1083530. Part 1 Create mozilla::TimeStamp constructor with system time param. r=roc 2014-10-29 13:36:51 -07:00
Brian Birtles cf167e36af Bug 1074651 - Detect integer overflow in BaseTimeDuration::TicksFromMilliseconds; r=bz 2014-10-02 15:14:12 +09:00
Brian Birtles e152025300 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 2268355a2b 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 06971eef4d 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 7d6c8bae55 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 9d4bf99681 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 924730126a 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 c333e39282 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 ac3405ae34 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 06744b6f48 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