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

2149 Коммитов

Автор SHA1 Сообщение Дата
Daniel Holbert 082fd9cd7f Bug 1142841: Convert all nsRefPtr<nsIRunnable> to nsCOMPtr<nsIRunnable>. r=ehsan
This patch was generated by a script.  Here's the source of the script for
future reference:

find . \( -iname "*.cpp" -o -iname "*.h" \) | \
  xargs -n 1 sed -i "s/nsRefPtr<nsIRunnable>/nsCOMPtr<nsIRunnable>/g"
2015-03-17 09:29:17 -07:00
Cameron McCormack 9863e4114b Bug 1123523 - Part 4: Add macro for notifying observers only when they implement a specific derived interface. r=smaug 2015-03-14 16:34:40 +11:00
Nathan Froyd fca6fbc4c7 Bug 1142544 - delete now-unnecessary |extern "C++"| block from nsISupportsUtils.h; r=mccr8
We have blatant C++ code later on in the file; whatever C file(s) were
including nsISupportsUtils.h are now a distant memory.
2015-03-12 11:24:53 -04:00
Nathan Froyd e7363b8b6b Bug 1141692 - use an actual Atomic for nsThreadPoolNaming::mCounter; r=bsmedberg
Marking a variable as volatile is never the right thing to do when
dealing with threads.  Use real atomic accesses instead.
2015-03-10 14:41:45 -04:00
Andrew McCreight ea55946825 Bug 1119482, part 2 - Move HoldDropJSObjects.h from xpcom/glue to xpcom/base. r=froydnj
This will clear the way for a HoldDropJSObjects.cpp, as xpcom/glue seems to use weird linking rules.

--HG--
rename : xpcom/glue/HoldDropJSObjects.h => xpcom/base/HoldDropJSObjects.h
2015-03-10 16:41:38 -07:00
Andrew McCreight 75b58ba304 Bug 1139050 - Add moz.build BUG_COMPONENT metadata for xpcom/. r=froydnj 2015-03-10 16:41:38 -07:00
Carsten "Tomcat" Book cc4d1b9af9 Merge mozilla-central to b2g-inbound 2015-03-10 14:07:36 +01:00
Thomas Zimmermann 614234540f Bug 1137151: Enable test for non-public ref-counted destructors on gcc 4.8 and later, r=nfroyd 2015-03-10 13:44:02 +01:00
Mike Hommey ad8f212161 Bug 1139361 - Remove gTLSThreadID*, NS_TLS and mozilla::threads::ID. r=nfroyd 2015-03-10 11:10:58 +09:00
Mike Hommey 364038011c Bug 868814 - Fold mozalloc library into mozglue. r=njn
--HG--
rename : memory/mozalloc/moz.build => memory/mozalloc/staticruntime/moz.build
2015-03-10 10:01:52 +09:00
Gerald Squelart 4495d81efb Bug 1131445 - variadic NS_NewRunnableMethodWithArgs with storage&passing argument type decorators. r=waldo
--HG--
extra : rebase_source : 3c2104c19bb37624ec32a1ca4c50235e7cefd953
2015-03-01 18:12:00 +01:00
Nicholas Nethercote 19fa938cf7 Bug 1050035 (part 1, attempt 2) - Lazily allocate PLDHashTable::mEntryStore. r=froydnj.
This makes zero-element hash tables, which are common, smaller, and also avoids
unnecessary malloc/free pairs.

I did some measurements during some basic browsing of a few sites. I found that
35% of all live tables were empty with a few tabs open. And cumulatively, for
the whole session, 45% of tables never had an element added to them.

--HG--
extra : rebase_source : 306bb50f250c09aa03a5e4822f41d6f605d76a1d
2015-02-01 14:56:33 -08:00
Nicholas Nethercote a423210355 Bug 1132802 - Add more assertions to pldhash.cpp. r=froydnj.
The use of |new| in PL_NewDHashTable() is necessary to avoid the new
assertions in Init() from failing.

--HG--
extra : rebase_source : 63cf962ce146142b72ffa0d6fcd3d8af1ec88bca
2015-02-11 20:24:33 -08:00
Nicholas Nethercote 6bf8ed2521 Bug 1127201 (attempt 2, part 3) - Remove the NS_ABORT_IF_FALSE macro. r=Waldo.
--HG--
extra : rebase_source : b0ff8671df31c6da4a2063ede611b3c554540950
2015-02-04 20:07:09 -08:00
Trevor Saunders 99d941db3c bug 1133075 - add more MOZ_OVERRIDE r=froydnj, waldo, jrmuizel 2015-02-18 17:03:30 -05:00
Nicholas Nethercote 8fc460a98a Bug 1131199, part 3 - Update comments relating to PLDHashTableOp::initEntry. r=mccr8.
DONTBUILD because this is a comment-only change.

--HG--
extra : rebase_source : 51501a06196814dbdabbd8b170ec41ccbf6ed2d0
2015-02-11 14:24:47 -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
Andrew McCreight c11d7db0a4 Back out Bug 1127201 (part 3) for various problems. 2015-02-06 15:04:00 -08:00
Nicholas Nethercote 33e98ebdf0 Bug 1127201 (part 3) - Remove the NS_ABORT_IF_FALSE macro. r=Waldo.
--HG--
extra : rebase_source : 7403ecb72a24be30b3871674b511894af9af1f3a
2015-02-04 20:07:09 -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 f325953043 Bug 1050035 (part 3) - Remove PL_NewDHashTable() and PL_DHashTableDestroy(). r=froydnj.
Because they are now just equivalent to |new PLDHashTable()| +
PL_DHashTableInit() and PL_DHashTableFinish(t) + |delete t|, respectively.

They're only used in a handful of places and obscure things more than they
clarify -- I only recently worked out exactly how they different from Init()
and Finish().

--HG--
extra : rebase_source : c958491447523becff3e01de45a5d2d227d1ecd3
2015-02-01 20:36:52 -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
Nicholas Nethercote 2438e023a8 Bug 1050035 (part 1) - Lazily allocate PLDHashTable::mEntryStore. r=froydnj.
This makes zero-element hash tables, which are common, smaller, and also avoids
unnecessary malloc/free pairs.

I did some measurements during some basic browsing of a few sites. I found that
35% of all live tables were empty with a few tabs open. And cumulatively, for
the whole session, 45% of tables never had an element added to them.

There is more to be done w.r.t. simplifying initialization, which will occur in
the next patch.

--HG--
extra : rebase_source : b9bfdcd680f39f3c947a49ae8462c04bc5e38805
2015-02-01 14:56:33 -08:00
Xidorn Quan f303a6cca2 Bug 1127045 part 3 - Make nsTArray support reverse iterating. r=froydnj
--HG--
extra : source : 6cd8187de27872308575077e6b4ba4d6df1fc312
2015-02-04 19:07:32 +11:00
Xidorn Quan 9a5955f0b8 Bug 1126552 part 1 - Make nsTArray support range-based for loops. r=froydnj
--HG--
extra : source : d8670bac983f9bc2b5886af2396d84ec9b4832a7
2015-02-04 19:07:32 +11:00
Xidorn Quan f910a5e603 Bug 1126552 part 0 - Rename end to iend to avoid shadowing warnings. r=froydnj
--HG--
extra : source : 7466982b362d61eda808c1ec848ecd45ef1c1c97
2015-02-04 19:07:32 +11:00
Nicholas Nethercote 27f5668308 Bug 1127401 - Tweak PL_DHashTableSearch() to counter a Fennec regression. r=froydnj.
PL_DHashTableLookup() had the same return protocol as SearchTable(), which
meant that compilers could generate a tail call from the former to the latter.
Bug 1124973 replaced PL_DHashTableLookup() with PL_DHashTableSearch(), which
has a slightly different return protocol, and so the tail call was lost. This
appears to be the cause of the Fennec performance regression.

This patch splits SearchTable() in two (using templates to avoid explicit code
duplication). SearchTable<false>() now has the same return protocol as
PL_DHashTableSearch(), and so the tail call can now be used again.
2015-01-29 20:18:28 -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
Jim Mathies d5d37f938c Bug 1095754 - Miscellaneous code cleanup nits found along the way. r=me 2015-01-29 13:41:57 -06:00
Nicholas Nethercote 4d7c72cbf7 Bug 1126546 - Make PLDHashTable::keyHash private. r=froydnj.
As well as renaming and privatizing |keyHash|, this patch also:

- renames GetKeyHash() to ComputeKeyHash(), which better indicates it's not
  some kind of getter function; and

- makes PLDHashEntryStub inherit from PLDHashEntryHdr, for consistency with
  everywhere else.
2015-01-28 21:33:38 -08:00
Nicholas Nethercote 7f17f40494 Bug 1124973 (part 7) - Remove PL_DHashTableLookup. r=froydnj.
This patch:

- Removes PL_DHashTableLookup().

- Removes PL_DHASH_ENTRY_IS_BUSY(). It's barely used and
  PL_DHASH_ENTRY_IS_FREE() suffices.

- Removes a non-useful, non-sequitur comment ("However, use...").

--HG--
extra : rebase_source : 8ee03b52f78e726515902d59af633f9ad015affa
2015-01-26 16:02:05 -08: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 097aa5a98e Bug 1124973 (part 1) - Always use inheritance rather than composition for PLDHashTable entries. r=froydnj.
Because (a) this is how it's usually done, (b) it allows static_cast<> instead
of reinterpret_cast<>, and (c) it will make subsequent patches easier.

--HG--
extra : rebase_source : 76e67d4b6ec0e5dc898a8214b6a6b562f9e08380
2015-01-22 21:05:52 -08:00
Xidorn Quan c6aaaa4c77 Bug 1124029 - Fix 64bit shift warning in nsVoidArray. r=froydnj
--HG--
extra : source : dba319233ef2df517d3ba37b4406357fb007dec7
extra : histedit_source : 4ad36db364b75ceb3566ef2f48507ad314d2e238
2015-01-28 08:55:44 +11:00
Nicholas Nethercote 48710afc66 Bug 1124920 - Remove PLDHashTable::Operate(). r=froydnj.
--HG--
extra : rebase_source : f029d3ca8835232b3c1d4188aa63a0004c1aad4b
2015-01-22 15:43:18 -08:00
Chris Peterson 2da1f21a45 Bug 1125665 - Fix -Wunused-private-field warning in PLDHashTable and mark xpcom/glue as FAIL_ON_WARNINGS. r=froydnj 2015-01-25 00:25:13 -08:00
Masatoshi Kimura 6cc5dabbee Bug 1111290 - Part 3: Remove TypedEnum.h and fold TypedEnumInternal.h into TypedEnumBits.h. r=waldo 2015-01-26 07:22:11 +09:00
Masatoshi Kimura 86502e6537 Bug 1111290 - Part 2: Non-mechanical changes. r=waldo 2015-01-26 07:22:08 +09:00
Tom Schuster 66ad9a2e49 Bug 1125356 - Use JS_NewPlainObject in the browser. r=bz 2015-01-24 16:38:08 +01:00
Ehsan Akhgari f4b09875cf Bug 1125179 - Mark some functions generated by CC macros as override; r=mccr8 2015-01-23 14:27:18 -05:00
Jim Mathies 60cb268efa Bug 1121970 - Debug output from printf_stderr gets clipped on Windows. r=nfroyd 2015-01-20 08:18:26 -06:00
Nicholas Nethercote 2116ab605f Bug 1123151 (part 3) - Make PLDHashTable::ops private. r=froydnj.
This required adding a getter and a setter, but they're used sparingly.

--HG--
extra : rebase_source : 2a40e459de2a7a9e2bb6d65b046e4a920b212326
2015-01-19 16:34:44 -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