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

2156 Коммитов

Автор SHA1 Сообщение Дата
Honza Bambas 61aeafa22b Bug 1024056 - Simple ASCII lexical analyzer. r=nfroyd 2015-07-27 05:07:00 -04:00
Nicholas Nethercote 3e2de4702c 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.

--HG--
extra : rebase_source : 8a15ae2ee0949a241f6417bfab614affbec2987c
2015-07-23 02:35:27 -07:00
Andrew McCreight 18401c9409 Bug 931571, part 15 - Remove extra spaces in nsVariant macros. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight 14b12fbcf9 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 13e2d3a560 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 0994e4e4ed 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 4bdbcd2020 Bug 931571, part 11 - Turn nsDiscriminatedUnion's Traverse function into a method. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight 2cca253ff3 Bug 931571, part 10 - Turn SetFromVariant into a method. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight cb922209d3 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 8c28737b59 Bug 931571, part 8 - Turn ConvertToISupports, ConvertToInterface and ConvertToArray to methods. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight 219f81d45f Bug 931571, part 7 - Turn ConvertTo*String and ToString into methods. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight 83b488957d Bug 931571, part 6 - Make ConvertToID and String2ID into methods. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight 6c297a19d4 Bug 931571, part 5 - Turn basic ConvertTo functions into methods. r=froydnj 2015-07-23 12:28:30 -07:00
Andrew McCreight cadbb45b7f 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 79e1884b62 Bug 931571, part 3 - Rename return value of macro generated methods. r=froydnj 2015-07-23 12:28:29 -07:00
Andrew McCreight ca92d9ebc0 Bug 931571, part 2 - Convert Cleanup() and FreeArray() to methods. r=froydnj 2015-07-23 12:28:29 -07:00
Andrew McCreight 7b7d1a30b8 Bug 931571, part 1 - Use a constructor for nsDiscriminatedUnion. r=froydnj 2015-07-23 12:28:29 -07:00
Kyle Huey ee4f5ba9fb Bug 1185470: Remove 'Get' prefixes from hashtable iterator methods. r=froydnj 2015-07-20 20:21:28 +08:00
Andrew McCreight 74d0ecbbd9 Bug 1184695 - Fix some indentation in nsHashPropertyBag. r=poiru 2015-07-16 17:50:43 -07:00
Nicholas Nethercote a122bb402c Bug 1182926 - Fix "observer-service-suspect" bustage. r=poiru.
--HG--
extra : rebase_source : 3bc89688488a8b0f4c22dd10a7c2a24babd07733
2015-07-12 15:55:27 -07:00
Nicholas Nethercote 3aa4ed90e3 Bug 1181445 (part 13) - Use nsBaseHashTable::Iterator in xpcom/ds/. r=froydnj.
--HG--
extra : rebase_source : 0c143d4bb6de75d133984b41400cd612e4d1064e
2015-07-09 16:54:59 -07:00
Nicholas Nethercote 8626fc2a98 Bug 1181445 (part 3) - Use nsTHashTable::Iterator in nsObserverService. r=froydnj.
--HG--
extra : rebase_source : 1bbbc86315455a5af29d34c80feac2f206d7d9f2
2015-07-09 16:49:32 -07:00
Bill McCloskey a2c6c7d4bf Bug 1143006 - Show warning for http-on-* in child process (r=mrbkap) 2015-06-19 17:35:06 -07:00
Benoit Girard 2c6df6a9a9 Bug 858927 - Move the mozilla::TimeStamp into mozglue. r=glandium
--HG--
rename : xpcom/ds/TimeStamp.cpp => mozglue/misc/TimeStamp.cpp
rename : xpcom/ds/TimeStamp.h => mozglue/misc/TimeStamp.h
rename : xpcom/ds/TimeStamp_darwin.cpp => mozglue/misc/TimeStamp_darwin.cpp
rename : xpcom/ds/TimeStamp_posix.cpp => mozglue/misc/TimeStamp_posix.cpp
rename : xpcom/ds/TimeStamp_windows.cpp => mozglue/misc/TimeStamp_windows.cpp
rename : xpcom/ds/TimeStamp_windows.h => mozglue/misc/TimeStamp_windows.h
extra : commitid : 2MSXRaRzXEd
extra : rebase_source : 45ded19677e8557deb3b9203777656f5a13f6c04
2015-06-05 16:03:11 -04:00
Nicholas Nethercote a1b715b5df Bug 1174625 - Overhaul PLDHashTable's iterator. r=froydnj.
This change splits PLDHashTable::Iterator::NextEntry() into two separate
functions, which allow you to get the current element and advance the iterator
separately, which means you can use a for-loop to iterate instead of a
while-loop.

As part of this change, the internals of PLDHashTable::Iterator were
significantly changed and simplified (and modelled after js::HashTable's
equivalent code). It's no longer duplicating code from PL_DHashTableEnumerator.
The chaos mode code was a casualty of this, but given how unreliable that code
has proven to be (see bug 1173212, bug 1174046) this is for the best. (We can
reimplement chaos mode once PLDHashTable::Iterator is back on more solid
footing again, if we think it's important.)

All these changes will make it much easier to add an alternative Iterator that
removes elements, which was turning out to be difficult with the prior code.

In order to make the for-loop header usually fit on a single line, I
deliberately renamed a bunch of things to have shorter names.

In summary, you used to write this:

  PLDHashTable::Iterator iter(&table);
  while (iter.HasMoreEntries()) {
    auto entry = static_cast<FooEntry*>(iter.NextEntry());
    // ... do stuff with |entry| ...
  }
  // iter's scope extends beyond here

and now you write this:

  for (auto iter = table.Iter(); !iter.Done(); iter.Next()) {
    auto entry = static_cast<FooEntry*>(iter.Get());
    // ... do stuff with |entry| ...
  }
  // iter's scope doesn't reach here

--HG--
extra : rebase_source : fa5cac2fc50b1ab7624030bced4763131280f4d8
2015-06-11 21:19:53 -07:00
Ted Mielczarek 572d721921 bug 1170586 - Make TimeStamp::FromSystemTime available on iOS. r=froydnj
--HG--
extra : commitid : 6y2iIFXPKyP
extra : rebase_source : 7c8e19589f5c005ff3c4c2f4158f1ac04394c269
2015-01-30 15:32:48 -05:00
Nicholas Nethercote 977758d61c Bug 1172761 (part 2) - Remove PL_DHashTableEnumerator use from nsPersistentProperties. r=froydnj.
The old code attempted to deal with any OOMs during this enumeration --
OOMs are possible because it's growing an nsCOMArray -- but failed to do so
correctly.

- It didn't check the return value of AppendObject().

- It did check that EntryCount() matched the return value of
  PL_DHashTableEnumerate(), but that's always (and vacuously) true.

The new code just returns NS_ERROR_OUT_OF_MEMORY if AppendObject() fails; this
is trivial now that it uses an iterator and doesn't have to call out to another
function.
2015-06-10 13:07:40 -07:00
Nicholas Nethercote 97aa68b77f Bug 1172761 (part 1) - Remove PL_DHashTableEnumerator use from nsAtomTable. r=froydnj.
--HG--
extra : rebase_source : 54fc0b6e09fe55a879212e666a682eaf76ab4f7b
2015-06-10 13:07:40 -07:00
Eric Rahm 75c4bebb79 Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-03 15:25:57 -07:00
Nicholas Nethercote 383a496bf6 Bug 1170416 (part 5) - Remove PLDHashTable::IsInitialized(). r=froydnj.
|mOps| is always non-null now, and there's no longer any distinction between
and uninitialized and initialized table. Yay.

--HG--
extra : rebase_source : 3d1fb72aee4dd21ff20db0ff3166d4e932ade897
2015-05-20 21:23:55 -07:00
Nicholas Nethercote e849e6588b Bug 1170416 (part 3) - Remove the PLDHashTable2 typedef. r=froydnj.
--HG--
extra : rebase_source : 9510ea47204fffa163cac43aeaaac6ae1ad80419
2015-05-19 16:46:17 -07:00
Carsten "Tomcat" Book 5471309381 Backed out 14 changesets (bug 1165515) for linux x64 e10s m2 test failures
Backed out changeset d68dcf2ef372 (bug 1165515)
Backed out changeset 7c3b45a47811 (bug 1165515)
Backed out changeset b668b617bef2 (bug 1165515)
Backed out changeset d0916e1283a2 (bug 1165515)
Backed out changeset ac4dc7489942 (bug 1165515)
Backed out changeset e9632ce8bc65 (bug 1165515)
Backed out changeset c16d215cc7e4 (bug 1165515)
Backed out changeset e4d474f3c51a (bug 1165515)
Backed out changeset d87680bf9f7c (bug 1165515)
Backed out changeset b3c0a45ba99e (bug 1165515)
Backed out changeset 9370fa197674 (bug 1165515)
Backed out changeset 50970d668ca1 (bug 1165515)
Backed out changeset ffa4eb6d24b9 (bug 1165515)
Backed out changeset 5fcf1203cc1d (bug 1165515)

--HG--
extra : rebase_source : 6fb850d063cbabe738f97f0380302153e3eae97a
2015-06-02 13:05:56 +02:00
Eric Rahm a9afd68cef Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-01 22:17:33 -07:00
Wes Kocher 4e9f80ed2e Backed out 14 changesets (bug 1165515) for b2g mochitest-6 permafail CLOSED TREE
Backed out changeset 9b97e2aa2ed9 (bug 1165515)
Backed out changeset 150606c022a2 (bug 1165515)
Backed out changeset 4e875a488349 (bug 1165515)
Backed out changeset 467e7feeb546 (bug 1165515)
Backed out changeset d6b6cc373197 (bug 1165515)
Backed out changeset 0615265b593c (bug 1165515)
Backed out changeset fafd1dce9f08 (bug 1165515)
Backed out changeset d1df869245f9 (bug 1165515)
Backed out changeset 6876a7c63611 (bug 1165515)
Backed out changeset b7841c94a9a3 (bug 1165515)
Backed out changeset e5e3617f7c73 (bug 1165515)
Backed out changeset 39be3db95978 (bug 1165515)
Backed out changeset 0ec74176f8de (bug 1165515)
Backed out changeset 5b928dd10d71 (bug 1165515)
2015-06-01 17:57:58 -07:00
Eric Rahm f82c0e7caf Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-01 14:31:01 -07:00
Botond Ballo 2e2a504271 Bug 1119980 - Use 'snprintf' instead of 'sprintf' to avoid a warning on Lollipop-based builds. r=froydnj
--HG--
extra : source : 7468f9a3aa03520a29e138d4df431f0b5d90967c
2015-05-26 14:33:55 -04:00
Phil Ringnalda 49dd872168 Back out 3 changesets (bug 1119980) for emulator-l bustage
CLOSED TREE

Backed out changeset 12ce98475c6e (bug 1119980)
Backed out changeset bdb8d05f8870 (bug 1119980)
Backed out changeset a68a18840492 (bug 1119980)
2015-05-25 18:48:51 -07:00
Botond Ballo 9934d127c1 Bug 1119980 - Use 'snprintf' instead of 'sprintf' to avoid a warning on Lollipop-based builds. r=froydnj
--HG--
extra : rebase_source : 4e915a12ba662ed45788238a5f0a45533888bd92
2015-05-25 20:45:17 -04:00
Nicholas Nethercote 01e0dbf44b Bug 1166598 (part 6) - Clean up nsStaticCaseInsensitiveNameTable. r=froydnj.
This patch simplifies nsStaticCaseInsensitiveNameTable greatly by taking
advantage of the following observations.

- |new| is infallible, so |new nsStaticCaseInsensitiveNameTable()| calls don't
  need their return value checked.

- nsStaticCaseInsensitiveNameTable::Init() checks if any of the added entries
  differ only in case, so the callers of that function don't need to do the
  same check.

- nsStaticCaseInsensitiveNameTable::Init() never returns false because
  moz_xmalloc() is infallible. (Its callers never check the return value
  anyway.) So it can be merged into the constructor. And
  ~nsStaticCaseInsensitiveNameTable() need not null-check |mNameArray|.

- PLDHashTable now has an initializing constructor and destructor, so these can
  be used in nsStaticCaseInsensitiveNameTable, thus avoiding manual
  PLD_HashTable{Init,Finish}() calls.
2015-05-05 21:13:53 -07:00
Eric Rahm 3925a960aa Bug 1165515 - Part 1: Convert PR_LOG to MOZ_LOG. r=froydnj 2015-05-21 13:22:04 -07:00
Nicholas Nethercote e90de3e5e0 Bug 1166586 (part 2) - Convert some easy PL_DHashTable{Init,Finish} cases. r=froydnj.
This patch converts easy cases, i.e. where the PL_DHashTableInit() call occurs
in a constructor and the PL_DHashTableFinish() call occurs in a destructor.

--HG--
extra : rebase_source : d8dc450f80ac23b8455141b471cc9ae823e1e384
2015-05-04 22:59:24 -07:00
Eric Rahm 4879ae86f4 Bug 1165518 - Part 2: Replace prlog.h with Logging.h. rs=froydnj 2015-05-19 11:15:34 -07:00
Nicholas Nethercote 399179a183 Bug 1165768 (part 6) - Convert |gAtomTable| to |PLDHashTable2*|. r=froydnj.
--HG--
extra : rebase_source : 77fc4a57aa1e426089b857d88f32c378127f9429
2015-05-18 00:52:08 -07:00
Nicholas Nethercote eab9ff6d25 Back out all four patches from bug 1161377. r=me.
Due to Android startup regressions (bug 1163066) and plugin crashes (bug
1165155).

--HG--
extra : rebase_source : 380f79e67dff4c4eaa2614f286a4d0669666b652
2015-05-14 21:48:43 -07:00
Nicholas Nethercote ba79e01ad2 Bug 1161377 (part 3, attempt 2) - Convert some easy PL_DHashTable{Init,Finish} cases. r=froydnj.
--HG--
extra : rebase_source : 990907701818b7da2b4e8955c419bb61130e266f
2015-05-12 17:33:26 -07:00
Nicholas Nethercote 9a60518e5b Bug 1161377 (part 2.5) - Move all static PLDHashTable instances onto the heap to avoid static constructors. r=froydnj.
--HG--
extra : rebase_source : 73029d4a1ed5a41263db882d66b1f380f5e7254b
2015-05-12 17:33:22 -07:00
Nicholas Nethercote 0323a0a1b5 Backout c375efe78e07 (bug 1161377 part 3) for (probably) increasing the static constructor count and regressing Fennec start-up time. r=me. 2015-05-10 22:16:18 -07:00
Nicholas Nethercote 17348fdef0 Bug 1161377 (part 3) - Convert some easy PL_DHashTable{Init,Finish} cases. r=froydnj.
This patch converts easy cases, i.e. where the PL_DHashTableInit() call occurs
in a constructor and the PL_DHashTableFinish() call occurs in a destructor.
2015-05-04 22:59:24 -07:00
Eric Rahm 645b42df1f Bug 1162242 - Part 1: Remove instances of #ifdef PR_LOGGING. r=froydnj
PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
2015-05-07 09:43:35 -07:00
Mike Hommey 924c9eb636 Bug 1134923 - Remove NS_Alloc/NS_Realloc/NS_Free. r=nfroyd
They are kept around for the sake of the standalone glue, which is used
for e.g. webapprt, which doesn't have direct access to jemalloc, and thus
still needs a wrapper to go through the xpcom function list and get to
jemalloc from there.
2015-05-01 09:40:30 +09:00