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

2382 Коммитов

Автор SHA1 Сообщение Дата
Michael Layzell 8b7ba021a4 Bug 1339537 - Part 6: Pass std::function values tree by const reference instead of by value, r=ehsan
MozReview-Commit-ID: PVAqU2DPs2
2017-04-27 12:44:57 -04:00
Petr Sumbera 0e17adee7c Bug 1354510 - Firefox build should recognize Solaris. r=glandium
--HG--
extra : rebase_source : 2bec2709a26a5295e723b0ecc424b0d648715bb7
2017-04-11 00:01:32 -07:00
Florian Queze b5916a37c7 Bug 1355216 - Mark last parameters that are almost always falsy as optional, r=froydnj. 2017-04-12 00:07:30 +02:00
Carsten "Tomcat" Book 207b516e89 merge mozilla-inbound to mozilla-central a=merge 2017-04-06 12:50:50 +02:00
Eric Rahm 807d2c062b Bug 1353544 - Replace usage of PR_BEGIN_MACRO in xpcom. r=froydnj 2017-04-05 18:06:44 -07:00
Daniel Holbert 2a33c81425 Bug 1353941: Convert a MOZ_RELEASE_ASSERT() expression to "if" + MOZ_CRASH(), to work around clang 3.8 segfault. r=froydnj
MozReview-Commit-ID: Bq2DM61YvQ3

--HG--
extra : rebase_source : 2d546cbabd71f17ac0d9d8b3a98271d57ffc428c
2017-04-05 18:24:56 -07:00
Bevis Tseng 5daae11f33 Bug 1345464 - Add an optional EventTarget to nsExpirationTracker to support Labeling for Quantum-DOM. r=froydnj
--HG--
extra : rebase_source : f05d3a31543ea8ed35a756a1721adc272c792a08
2017-03-30 09:23:36 -04:00
Bevis Tseng eb452e8278 Bug 1350177 - Part 1: Define ExpirationTrackerImpl as a Thread-Safe Tracker. r=froydnj
1. Define ExpirationTrackerImpl which requires AutoLock before calling Tracker APIs.
2. Move expiration logic from nsExpirationTracker to ExpirationTrackerImpl.
3. Keep nsExprationTracker un-thread-safe with fake Lock acquired.

--HG--
extra : rebase_source : 536876ce2c64240f5470180aa633264d8e5de664
2017-03-27 19:37:29 +08:00
L. David Baron 443904b36a Bug 1352888 - Don't set the collision flag when adding to PLDHashTable if we've already found the entry we're going to add. r=njn
PLDHashTable's entry store has two types of unoccupied entries:  free
entries and removed entries.  The search of a chain of entries
(determined by the hash value) in the entry store to search for an entry
can stop at free entries, but it continues across removed entries,
because removed entries are entries that may have been skipped over when
we were adding the value we're searching for to the hash, but have since
been removed.  For live entries, we also maintain this distinction by
using one bit of storage for a collision flag, which notes that if the
hashtable entry is removed, its place in the entry store must become a
removed entry rather than a free entry.

When we add a new entry to the table, Add's semantics require that we
return an existing entry if there is one, and only create a new entry if
no existing entry exists.  (Bug 1352198 suggests the possibility of a
faster alternative Add API where the caller guarantees that the key is
not already in the hashtable.)  When we search for the existing entry,
we must thus continue the search across removed entries, even though we
record the first removed entry found to return if the search for an
existing entry fails.

The existing code adds the collision flag through the entire table
search during an Add.  This patch changes that behavior so that we only
add the collision flag prior to finding the first removed entry.  Adding
it after we find the first removed entry is unnecessary, since we are
not making that entry part of a path to a new entry.  If it is part of a
path to an existing entry, it will already have the collision flag set.

This patch effectively puts an if (!firstRemoved) around the else branch
of the if (MOZ_UNLIKELY(EntryIsRemoved(entry))), and then refactors that
condition outwards since it is now around the contents of both the if
and else branches.

MozReview-Commit-ID: CsXnMYttHVy

--HG--
extra : transplant_source : W4%B8%BA%D5p%102%1B%8D%83%23%E0s%B3%B0f%0D%05%AE
2017-04-04 20:59:21 -07:00
Nathan Froyd 564e8d046e Bug 1353660 - proxy destruction of nsHashPropertyBag's hash table to the main thread; r=mccr8
We need this because the stored values in the hash table may themselves
be main-thread only objects, and destroying them off the main thread
will cause crashes.
2017-04-05 15:31:20 -04:00
Carsten "Tomcat" Book 92b960417c Backed out changeset 8f8e8cd713ad (bug 1352888) 2017-04-04 09:54:55 +02:00
Carsten "Tomcat" Book 6fa4a7de2c Backed out changeset dfdb5742823a (bug 1352889) 2017-04-04 09:54:53 +02:00
L. David Baron 4d700b54f1 Bug 1352889 - Ensure that PLDHashTable's second hash doesn't have padding with 0 bits for tables with capacity larger than 2^16. r=njn
PLDHashTable takes the result of the hash function and multiplies it by
kGoldenRatio to ensure that it has a good distribution of bits across
the 32-bit hash value, and then zeroes out the low bit so that it can be
used for the collision flag.  This result is called hash0.  From hash0
it computes two different numbers used to find entries in the table
storage:  hash1 is used to find an initial position in the table to
begin searching for an entry; hash2 is then used to repeatedly offset
that position (mod the size of the table) to build a chain of positions
to search.

In a table with capacity 2^c entries, hash1 is simply the upper c bits
of hash0.  This patch does not change this.

Prior to this patch, hash2 was the c bits below hash1, padded at the low
end with zeroes when c > 16.  (Note that bug 927705, changeset
1a02bec165e16f370cace3da21bb2b377a0a7242, increased the maximum capacity
from 2^23 to 2^26 since 2^23 was sometimes insufficient!)  This manner
of computing hash2 is problematic because it increases the risk of long
chains for very large tables, since there is less variation in the hash2
result due to the zero padding.

So this patch changes the hash2 computation by using the low bits of
hash0 instead of shifting it around, thus avoiding 0 bits in parts of
the hash2 value that are significant.

Note that this changes what hash2 is in all cases except when the table
capacity is exactly 2^16, so it does change our hashing characteristics.
For tables with capacity less than 2^16, it should be using a different
second hash, but with the same amount of random-ish data.  For tables
with capacity greater than 2^16, it should be using more random-ish
data.

MozReview-Commit-ID: JvnxAMBY711

--HG--
extra : transplant_source : %8A%25%FB%E3H%B8_%F1G%F6%3E%0B%29%DF%20%FF%D8%E1%AEw
2017-04-03 20:43:30 -07:00
L. David Baron db2f1da78f Bug 1352888 - Don't set the collision flag when adding to PLDHashTable if we've already found the entry we're going to add. r=njn
PLDHashTable's entry store has two types of unoccupied entries:  free
entries and removed entries.  The search of a chain of entries
(determined by the hash value) in the entry store to search for an entry
can stop at free entries, but it continues across removed entries,
because removed entries are entries that may have been skipped over when
we were adding the value we're searching for to the hash, but have since
been removed.  For live entries, we also maintain this distinction by
using one bit of storage for a collision flag, which notes that if the
hashtable entry is removed, its place in the entry store must become a
removed entry rather than a free entry.

When we add a new entry to the table, Add's semantics require that we
return an existing entry if there is one, and only create a new entry if
no existing entry exists.  (Bug 1352198 suggests the possibility of a
faster alternative Add API where the caller guarantees that the key is
not already in the hashtable.)  When we search for the existing entry,
we must thus continue the search across removed entries, even though we
record the first removed entry found to return if the search for an
existing entry fails.

The existing code adds the collision flag through the entire table
search during an Add.  This patch changes that behavior so that we only
add the collision flag prior to finding the first removed entry.  Adding
it after we find the first removed entry is unnecessary, since we are
not making that entry part of a path to a new entry.  If it is part of a
path to an existing entry, it will already have the collision flag set.

This patch effectively puts an if (!firstRemoved) around the else branch
of the if (MOZ_UNLIKELY(EntryIsRemoved(entry))), and then refactors that
condition outwards since it is now around the contents of both the if
and else branches.

MozReview-Commit-ID: CsXnMYttHVy

--HG--
extra : transplant_source : 0T%B0%FA%C0%85v%8B%16%E7%81%03p%F5K%97%B1%9E%92%27
2017-04-03 20:43:29 -07:00
Olli Pettay 98fff73826 Bug 1351303, add main thread only cache for nsIAtoms to speed up atomization, r=froydnj
--HG--
extra : rebase_source : 9c67cd71c0721329eaeaaa96a295e90abc480042
2017-04-03 23:13:18 +03:00
Olli Pettay ac0ae74439 Bug 1352734, use memcmp for nsIAtom Equals to improve performance, r=hsivonen
--HG--
extra : rebase_source : 1a78863c52f088609a6edcb6b32bf16bc02a4118
2017-04-02 22:40:06 +03:00
Henri Sivonen c514501f1a Bug 1295611 - Add mozilla::Span. r=froydnj,gerv.
MozReview-Commit-ID: HGNDClVctbE
2017-03-31 13:32:18 +03:00
Eric Rahm 478755933a Bug 1351732 - Part 2: Replace use of PLArena with ArenaAllocator in xpcom. r=froydnj
This swaps xpcom's plarena usage to ArenaAllocator. The new ArenaStrdup
extensions are used as well.

MozReview-Commit-ID: DHDfl6IkGJL
2017-03-30 16:46:58 -07:00
Eric Rahm f4d91001fe Bug 1351732 - Part 1: Add an ArenaAllocator strdup extension. r=froydnj
This adds an extension to ArenaAllocator that provides strdup-like
functionality for various string types.

MozReview-Commit-ID: 87SHTs6flHY
2017-03-30 16:46:56 -07:00
Eric Rahm 131c4c002f Bug 943156 - Add a templated ArenaAllocator. r=froydnj
This adds an arena allocator that can be used as a drop-in replacement for
NSPR's PLArena. Example usage for defining an 8-byte aligned allocator that
uses a 4K arena size:

mozilla::ArenaAllocator<4096,8> a;
void* memory = a.Allocate(200);
2017-03-30 16:46:55 -07:00
Eric Rahm 9379e75d2f Bug 1350423 - Remove unused PL_ARENA macro in nsStaticNameTable. r=froydnj
MozReview-Commit-ID: 48qPrN7IOnf
2017-03-27 09:15:38 -07:00
Eric Rahm b8b8dd4a0c Bug 1348123 - Add release bounds checking when inserting and replacing. r=froydnj
This adds release bounds checking to ReplaceElementsAt, InsertElementAt, and
InsertElementsAt to make sure the insertion point is within the current array
bounds.

MozReview-Commit-ID: 1pFr8LuOROI
2017-03-17 16:40:53 -07:00
Xidorn Quan cf27123d34 Bug 1345804 part 1 - Constify several stuff in nsIAtom. r=erahm
MozReview-Commit-ID: Izzu0MpcKMr

--HG--
extra : rebase_source : 4c44fc79f5d0c4fd34f77c8c14e0888186e2a4f0
2017-03-10 11:38:49 +11:00
Eric Rahm 3bec954d62 Bug 792209 - Remove nsISupportsArray. r=froydnj
MozReview-Commit-ID: G28VUoYj9Wj
2016-11-17 11:45:41 -08:00
Andrew McCreight 2971fabfd4 Bug 1344848 - Don't check for atom leaks unless we're checking for other leaks. r=erahm
MozReview-Commit-ID: H5x8cLv0YGk
2017-03-06 22:27:08 -05:00
Xidorn Quan 01addcd50e Bug 1342303 part 6 - Remove nsCOMArray::Enumerate{Forwards,Backwards}. r=erahm
MozReview-Commit-ID: GLappWGZdtz

--HG--
extra : rebase_source : 0c191193ff5a6040a809d17ac234b5e9e733656e
2017-02-24 21:37:07 +11:00
Xidorn Quan 5068cf4922 Bug 1342303 part 2 - Add range-based for loop support to nsCOMArray. r=erahm
MozReview-Commit-ID: 7T8Z0PVg2ex

--HG--
extra : rebase_source : 8108344d6607145b231e20d82cf2b3792ce5a4bd
2017-02-24 21:31:15 +11:00
Xidorn Quan 63753595c2 Bug 1342303 part 1 - Make nsTArrayIterator an independent class. r=erahm
MozReview-Commit-ID: LbkIGEH0Irl

--HG--
extra : rebase_source : d5782ab4cc9c0f0570ecba490bec989ce55bb654
2017-02-24 16:14:06 +11:00
Wes Kocher 5bb9a497ef Backed out 6 changesets (bug 1342303) for build bustage a=backout
Backed out changeset 89137679a68c (bug 1342303)
Backed out changeset 20a1bcb47c33 (bug 1342303)
Backed out changeset bc3b2e7a383b (bug 1342303)
Backed out changeset bdc491b9ebde (bug 1342303)
Backed out changeset 5c6042dee665 (bug 1342303)
Backed out changeset b5de1dfff82f (bug 1342303)

MozReview-Commit-ID: BjlVAX480jI
2017-03-02 16:35:43 -08:00
Xidorn Quan 1297589623 Bug 1342303 part 6 - Remove nsCOMArray::Enumerate{Forwards,Backwards}. r=erahm
MozReview-Commit-ID: GLappWGZdtz

--HG--
extra : rebase_source : 72ebafcbf89b8fce123101d23c3d65bbc8c3bdff
2017-02-24 21:37:07 +11:00
Xidorn Quan 9fba97cea0 Bug 1342303 part 2 - Add range-based for loop support to nsCOMArray. r=erahm
MozReview-Commit-ID: 7T8Z0PVg2ex

--HG--
extra : rebase_source : 8108344d6607145b231e20d82cf2b3792ce5a4bd
2017-02-24 21:31:15 +11:00
Xidorn Quan d21a17fac7 Bug 1342303 part 1 - Make nsTArrayIterator an independent class. r=erahm
MozReview-Commit-ID: LbkIGEH0Irl

--HG--
extra : rebase_source : d5782ab4cc9c0f0570ecba490bec989ce55bb654
2017-02-24 16:14:06 +11:00
Ehsan Akhgari 116c304388 Bug 1342560 - Guarantee that the empty string atom is always static; r=froydnj 2017-02-27 10:51:43 -05:00
Honza Bambas 5aaba51ccb Bug 1340581 - Add some release-grade assertions to mozilla::Tokenizer to catch string overflows. r=froydnj
--HG--
extra : rebase_source : 2c2553e08061c5b3db915b2edcb19716aeac1cce
2017-02-22 06:53:00 -05:00
Emanuel Hoogeveen 23c68657e0 Bug 1338574 - Part 7: Use MOZ_CRASH_UNSAFE_PRINTF in XPCOM. r=froydnj
--HG--
extra : rebase_source : 472e0aa151692bda55b7bf3f8d98cf7bb4488481
2017-02-21 18:02:03 +01:00
Honza Bambas 5d95d03e70 Bug 1340260 - Fix potentially wrong string returned from Tokenizer::ReadUntil, keep Record/Claim work after ReadUntil. r=froydnj
--HG--
extra : rebase_source : 1029f9b6743085b7865554fdedc1c96e9239b13a
2017-02-17 08:13:00 -05:00
Boris Zbarsky 9d04143631 Bug 1330699 part 1. Add a ClearElementAt API to nsTArray. r=froydnj 2017-02-14 23:59:59 -05:00
Carsten "Tomcat" Book 092e5dc5f1 merge mozilla-inbound to mozilla-central a=merge 2017-02-07 14:08:46 +01:00
Honza Bambas 3a39b6dbee Bug 1322825 - Incremental tokenizer. r=froydnj 2017-02-06 10:49:00 -05:00
Gerald Squelart 213ba5c515 Bug 1336215 - Optimize iterator if nsDeque is const - r=froydnj
Handling potential nsDeque size changes means a bit of extra work.

But if the nsDeque is const, we can assume that it shouldn't get modified, so
we can provide a more optimized iterator that doesn't need to handle size
changes.

Optimizing a range-for loop in which the deque is not modified, can be done
by writing: `for (void* item : const_cast<const nsDeque&>(deque)) {...}`

MozReview-Commit-ID: AFupjoTsoH3

--HG--
extra : rebase_source : a71b09c9cb73787ce686c7c762f92ef0c208e76a
2017-02-03 13:08:10 +11:00
Gerald Squelart dade4b9e6e Bug 1336215 - Make nsDeque::ConstIterator resistant to size changes - r=froydnj
Note that iterators stay at the same index if the deque size changes
(including end-iterators staying at the end).
This means that after front operations, iterators will effectively point at
different elements! (Possibly skipping or re-visiting some.)
But this is consistent with ForEach and hand-crafted index-based for loops.

MozReview-Commit-ID: 5IvazJR68dG

--HG--
extra : rebase_source : c574fd2d2642d784482698c0fc861269200d1059
2017-02-03 09:19:47 +11:00
Gerald Squelart d109b21181 Bug 1336215 - More complete and consistent nsDeque doc, deleted special copy members - r=froydnj
MozReview-Commit-ID: GvjFPiX6lii

--HG--
extra : rebase_source : 1ffc8392106757743f0718aa5cf68d03aa16e384
2017-02-03 12:43:13 +11:00
Gerald Squelart d5ce43788f Bug 1322700 - Enable range-for with nsDeque - r=froydnj
It's now possible to write:
  for (void* item : deque) { ... }

MozReview-Commit-ID: FLoczCZd77y

--HG--
extra : rebase_source : 237293e94b478beb2bf352c1179d42c289dda145
2017-02-02 12:28:35 +11:00
Jorg K 22cddce9af Bug 1335854 - Tone down non-zero refcount message for dynamic atoms. r=froydnj
--HG--
extra : rebase_source : 31bef82b308fc5f7bd4eebbf898820e0b10640c0
2017-02-01 11:47:00 -05:00
Nathan Froyd f5c90c28e1 Bug 1276669 - part 11 - strengthen assertions for atom table shutdown GC; r=erahm
This could have been done more simply, but the small amount of
refactoring that takes place in this comment enables better error
messages in the case where something does go wrong.
2017-01-26 16:43:38 -04:00
Nathan Froyd ad51ed8360 Bug 1276669 - part 10 - remove dynamic->static atom transmutation code; r=erahm
Good riddance to some sketchy code.
2017-01-26 15:43:38 -05:00
Nathan Froyd 141f9b249d Bug 1276669 - part 9 - forbid transmutation of dynamic atoms; r=erahm
We can do this now that we've shuffled static atom initialization around
appropriately.
2017-01-26 15:43:38 -05:00
Nathan Froyd b9192afdae Bug 1276669 - part 7 - don't register static atoms after the table has been sealed; r=erahm
This change seems like an obvious thing we should have been doing, but
we weren't.
2017-01-26 15:43:38 -05:00
Julian Seward 8a908912d3 Bug 1232696 - Remove NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW as it causes segfaulting for GCC 6 builds (5 of 5, fixes for docshell/). r=bzbarsky. 2017-01-24 17:12:10 +01:00
Benjamin Smedberg 2b3617b084 Bug 1332631 part C - file moves from xpcom/glue to xpcom/ds, r=froydnj
MozReview-Commit-ID: 9ZhC5bROWdO

--HG--
rename : xpcom/glue/Observer.h => xpcom/ds/Observer.h
rename : xpcom/glue/PLDHashTable.cpp => xpcom/ds/PLDHashTable.cpp
rename : xpcom/glue/PLDHashTable.h => xpcom/ds/PLDHashTable.h
rename : xpcom/glue/nsArrayEnumerator.cpp => xpcom/ds/nsArrayEnumerator.cpp
rename : xpcom/glue/nsArrayEnumerator.h => xpcom/ds/nsArrayEnumerator.h
rename : xpcom/glue/nsArrayUtils.cpp => xpcom/ds/nsArrayUtils.cpp
rename : xpcom/glue/nsArrayUtils.h => xpcom/ds/nsArrayUtils.h
rename : xpcom/glue/nsBaseHashtable.h => xpcom/ds/nsBaseHashtable.h
rename : xpcom/glue/nsCOMArray.cpp => xpcom/ds/nsCOMArray.cpp
rename : xpcom/glue/nsCOMArray.h => xpcom/ds/nsCOMArray.h
rename : xpcom/glue/nsClassHashtable.h => xpcom/ds/nsClassHashtable.h
rename : xpcom/glue/nsDataHashtable.h => xpcom/ds/nsDataHashtable.h
rename : xpcom/glue/nsDeque.cpp => xpcom/ds/nsDeque.cpp
rename : xpcom/glue/nsDeque.h => xpcom/ds/nsDeque.h
rename : xpcom/glue/nsEnumeratorUtils.cpp => xpcom/ds/nsEnumeratorUtils.cpp
rename : xpcom/glue/nsEnumeratorUtils.h => xpcom/ds/nsEnumeratorUtils.h
rename : xpcom/glue/nsHashKeys.h => xpcom/ds/nsHashKeys.h
rename : xpcom/glue/nsInterfaceHashtable.h => xpcom/ds/nsInterfaceHashtable.h
rename : xpcom/glue/nsJSThingHashtable.h => xpcom/ds/nsJSThingHashtable.h
rename : xpcom/glue/nsPointerHashKeys.h => xpcom/ds/nsPointerHashKeys.h
rename : xpcom/glue/nsQuickSort.cpp => xpcom/ds/nsQuickSort.cpp
rename : xpcom/glue/nsQuickSort.h => xpcom/ds/nsQuickSort.h
rename : xpcom/glue/nsRefPtrHashtable.h => xpcom/ds/nsRefPtrHashtable.h
rename : xpcom/glue/nsTArray-inl.h => xpcom/ds/nsTArray-inl.h
rename : xpcom/glue/nsTArray.cpp => xpcom/ds/nsTArray.cpp
rename : xpcom/glue/nsTArray.h => xpcom/ds/nsTArray.h
rename : xpcom/glue/nsTArrayForwardDeclare.h => xpcom/ds/nsTArrayForwardDeclare.h
rename : xpcom/glue/nsTHashtable.h => xpcom/ds/nsTHashtable.h
rename : xpcom/glue/nsTObserverArray.cpp => xpcom/ds/nsTObserverArray.cpp
rename : xpcom/glue/nsTObserverArray.h => xpcom/ds/nsTObserverArray.h
rename : xpcom/glue/nsTPriorityQueue.h => xpcom/ds/nsTPriorityQueue.h
extra : rebase_source : 5f0638e3268acb932e1a8d3f499d283bc1922acd
extra : histedit_source : dcea9485885877bb02f95a1ecc627465a507f757
2017-01-20 13:59:21 -05:00
Nathan Froyd ec503a0996 Bug 1329718 - remove nsISupportsVoid and associated machinery; r=erahm
Nothing uses it, it's virtually impossible to use from script, and there
are better ways to pass a |void*| around in C++.
2017-01-10 16:31:48 -05:00
Sebastian Hengst 22179cd574 Backed out changeset 491237dbcb5d (bug 1323207) 2016-12-16 20:06:43 +01:00
Andrew McCreight d8103c4981 Bug 1323207, part 2 - Assert early if we're painting at various points we enter JS. r=billm
nsContentUtils::IsPatternMatching is the most common by far, but the
other two are generic locations that may cover a number of issues.

MozReview-Commit-ID: Kli39btsqdd

--HG--
extra : rebase_source : 1a7eda2a711f079978b54012d9c7466bbd6de36f
2016-12-14 16:28:57 -08:00
Eric Rahm 5ae299f0d8 Bug 1315812 - Mark nsISupportsArray, nsICollection, nsIEnumerator as deprecated. r=froydnj
This marks the idl classes as deprecated, removes an unnecessary include that
was triggering deprecation warnings and wraps a necessary include in
XPCOMInit.cpp that is used for registering the component in deprecation
disabling pragmas.

MozReview-Commit-ID: BbNU5q8O4Q4
2016-11-10 13:15:33 -08:00
Eric Rahm ea799cdb96 Bug 1311191 - Part 1: Add nsISupportsArray-like iteration to nsArray. r=froydnj
This adds an intermediate interface, nsIArrayExtensions, that inherits from
nsIArray. This is necessary as nsISupportsArray implements nsIArray as well
so the methods could not just be addded to nsIArray. nsIMutableArray inherits
from nsIArrayExtensions and so any interface that works with an nsIMutableArray
can be updated to return an nsIArrayExtensions.

This will allow interfaces that currently return an nsISupportsArray to instead
return an nsIArrayExtensions and internally work with an nsIMutableArray.
Consumers of these functions will continue to be able to use
nsISupportsArray-like iteration even though they're now working with an
nsIArray.

MozReview-Commit-ID: 9uRjsJbg9Jp
2016-10-24 13:24:26 -07:00
Eric Rahm f17e00d7f9 No Bug - Add include to fix unified bustage. r=me 2016-10-18 12:10:35 -07:00
Eric Rahm 3ee733ccd7 Bug 1310040 - Make nsSupportsArray implement nsIArray. r=froydnj
This makes nsSupportsArray implement the |nsIArray| interface. This will allow
us to replace references to nsISupportsArray as a param in our gecko interfaces
with nsIArray instead.

The goal is to remove this adapter (and nsISupportsArray) after a full release
cycle.

MozReview-Commit-ID: If7RiO5muIk
2016-10-18 11:52:08 -07:00
Eric Rahm ac6647aa97 Bug 1308317 - Part 10: Just use an nsCOMArray. r=froydnj
This switches over from using a half-baked auto array to nsCOMArray.

MozReview-Commit-ID: 6FR2SjOhoZR
2016-10-18 11:36:41 -07:00
Eric Rahm 5b5f49eb80 Bug 1308317 - Part 9: Remove nsSupportsArray::Compact. r=froydnj
This removes the scriptable method |Compact| which is unused in
our codebase and turns up no references in the plugins repo.

MozReview-Commit-ID: 5sJtO5COJpB
2016-10-18 11:36:39 -07:00
Eric Rahm 7fde5ad2f6 Bug 1308317 - Part 8: Remove nsSupportsArray::LastIndexOf. r=froydnj
This removes the scriptable method |GetLastIndexOf| which is unused in
our codebase and turns up no references in the plugins repo. This allows to
remove the non-scriptable |LastIndexOf|.

MozReview-Commit-ID: 54Ux7yZMh4F
2016-10-18 11:36:38 -07:00
Eric Rahm 7292673607 Bug 1308317 - Part 7: Remove nsSupportsArray::RemoveElementsAt. r=froydnj
MozReview-Commit-ID: H3A3gxckw5o
2016-10-18 11:36:37 -07:00
Eric Rahm d4f6772880 Bug 1308317 - Part 6: Remove nsSupportsArray::GetIndexOfStartingAt. r=froydnj
This removes the scriptable method |GetIndexOfStartingAt| which is unused in
our codebase and turns up no references in the plugins repo. This allows to
remove the non-scriptable |IndexOfStartingAt| which is folded into |IndexOf|.

MozReview-Commit-ID: 2ADz5mLIvMU
2016-10-18 11:36:36 -07:00
Eric Rahm 1cd7bbde2c Bug 1308317 - Part 5: Remove nsSupportsArray::DeleteLastElement. r=froydnj
|DeleteLastElement| is scriptable, but a search of our add-on repo turned up
no hits and there were no references in gecko code. This also allows us to
remove the non-scriptable |RemoveLastElement| which was only called by
|DeleteLastElement|.

MozReview-Commit-ID: 20FXBrosacA
2016-10-18 11:36:35 -07:00
Eric Rahm 15057c80cb Bug 1308317 - Part 4: Remove nsSupportsArray::Equals. r=froydnj
|Equals| is not scriptable and unused in our codebase.

MozReview-Commit-ID: BsbJIuR9fSk
2016-10-18 11:36:33 -07:00
Eric Rahm 5eb6276d7f Bug 1308317 - Part 3: Remove nsSupportsArray::SizeTo. r=froydnj
|SizeTo| is not scriptable and unused in our codebase.

MozReview-Commit-ID: 1DrTm46qbar
2016-10-18 11:36:32 -07:00
Eric Rahm 9be4258264 Bug 1308317 - Part 2: Remove nsSupportsArray::MoveElement. r=froydnj
|MoveElement| is not scriptable and unused in our codebase.

MozReview-Commit-ID: CBe8WZHG1JG
2016-10-18 11:36:31 -07:00
Eric Rahm f89a684018 Bug 1308317 - Part 1: Remove debug code. r=froydnj
MozReview-Commit-ID: 7TQG7flcJkj
2016-10-18 11:36:30 -07:00
Carsten "Tomcat" Book 98c8a7a746 Backed out changeset ea82808b9abd (bug 1308317) 2016-10-14 14:58:49 +02:00
Carsten "Tomcat" Book 46b2fe93c0 Backed out changeset 63208c26bfc3 (bug 1308317) 2016-10-14 14:58:46 +02:00
Carsten "Tomcat" Book 638c43c71b Backed out changeset 8d8a0f01f28c (bug 1308317) 2016-10-14 14:58:44 +02:00
Carsten "Tomcat" Book 8f39dfed93 Backed out changeset bb30697071b2 (bug 1308317) 2016-10-14 14:58:42 +02:00
Carsten "Tomcat" Book ac6a598542 Backed out changeset 476a831ca87e (bug 1308317) 2016-10-14 14:58:40 +02:00
Carsten "Tomcat" Book b79e4e00cc Backed out changeset 8c2984643f74 (bug 1308317) 2016-10-14 14:58:38 +02:00
Carsten "Tomcat" Book 3470d6dfe0 Backed out changeset 928ad5e93372 (bug 1308317) 2016-10-14 14:58:35 +02:00
Carsten "Tomcat" Book b6187e2b2e Backed out changeset 96d1b7238832 (bug 1308317) 2016-10-14 14:58:33 +02:00
Eric Rahm 9aeecd32b2 Bug 1308317 - Part 8: Just use an nsTAutoArray. r=froydnj
This switches over from using a half-baked auto array to nsTAutoArray.

MozReview-Commit-ID: 6FR2SjOhoZR
2016-10-13 22:04:42 -07:00
Eric Rahm 5e0a57ef2e Bug 1308317 - Part 7: Remove nsSupportsArray::RemoveElementsAt. r=froydnj
MozReview-Commit-ID: H3A3gxckw5o
2016-10-13 22:04:41 -07:00
Eric Rahm b3bce28ad5 Bug 1308317 - Part 6: Remove nsSupportsArray::GetIndexOfStartingAt. r=froydnj
This removes the scriptable method |GetIndexOfStartingAt| which is unused in
our codebase and turns up no references in the plugins repo. This allows to
remove the non-scriptable |IndexOfStartingAt| which is folded into |IndexOf|.

MozReview-Commit-ID: 2ADz5mLIvMU
2016-10-13 22:04:39 -07:00
Eric Rahm 08e653d2cf Bug 1308317 - Part 5: Remove nsSupportsArray::DeleteLastElement. r=froydnj
|DeleteLastElement| is scriptable, but a search of our add-on repo turned up
no hits and there were no references in gecko code. This also allows us to
remove the non-scriptable |RemoveLastElement| which was only called by
|DeleteLastElement|.

MozReview-Commit-ID: 20FXBrosacA
2016-10-13 22:04:38 -07:00
Eric Rahm b8014cf9d8 Bug 1308317 - Part 4: Remove nsSupportsArray::Equals. r=froydnj
|Equals| is not scriptable and unused in our codebase.

MozReview-Commit-ID: BsbJIuR9fSk
2016-10-13 22:04:37 -07:00
Eric Rahm 23dd90cee5 Bug 1308317 - Part 3: Remove nsSupportsArray::SizeTo. r=froydnj
|SizeTo| is not scriptable and unused in our codebase.

MozReview-Commit-ID: 1DrTm46qbar
2016-10-13 22:04:35 -07:00
Eric Rahm a3599628c0 Bug 1308317 - Part 2: Remove nsSupportsArray::MoveElement. r=froydnj
|MoveElement| is not scriptable and unused in our codebase.

MozReview-Commit-ID: CBe8WZHG1JG
2016-10-13 22:04:34 -07:00
Eric Rahm f4bf8c3f70 Bug 1308317 - Part 1: Remove debug code. r=froydnj
MozReview-Commit-ID: 7TQG7flcJkj
2016-10-13 22:04:33 -07:00
Eric Rahm 11d01803a8 Bug 1308036 - Check sizes when growing nsISupportsArray. r=froydnj
This adds size checks when growing the nsISupportsArray. It also removes
|InsertElementsAt| and |AppendElements| which are unused notxpcom interfaces
that would need similar modifications.

MozReview-Commit-ID: ET32q0OCrLU
2016-10-07 09:55:32 -07:00
Nathan Froyd d50eeaffb6 Bug 1305422 - followup - use correct check for memory allocation failure in nsWindowsRegKey.cpp; r=bustage 2016-09-30 01:56:28 -04:00
Nathan Froyd d59bcecbbd Bug 1305422 - part 2 - don't call size_forward on ns*String::iterators to check for SetLength failure; r=erahm
We have better ways of checking for SetLength failure nowadays, and even
if these SetLength calls did fail, the program would crash anyway.
2016-09-29 22:33:58 -04:00
Thomas Wisniewski ba6cb5196e Bug 1305202 - Use NullString() more and remove superfluous Truncates(). r=smaug 2016-09-23 21:10:01 -04:00
David Anderson f80736e0c8 Shutdown XPCOM-dependent resources in ImageBridgeChild at the appropriate time. (bug 1298938 part 3.1, r=mattwoodrow)
--HG--
extra : rebase_source : 9579e1ca6ec1af2fac7cd0fc4574b849cc8b8e12
2016-09-13 16:30:57 -07:00
Nicholas Nethercote c2306345d5 Bug 1297658 - Avoid unnecessary checking in memory reporters. r=erahm.
This patch removes checking of all the callback calls in memory reporter
CollectReport() functions, because it's not useful.

The patch also does some associated clean-up.

- Replaces some uses of nsIMemoryReporterCallback with the preferred
  nsIHandleReportCallback typedef.

- Replaces aCallback/aCb/aClosure with aHandleRepor/aData for CollectReports()
  parameter names, for consistency.

- Adds MOZ_MUST_USE/[must_use] in a few places in nsIMemoryReporter.idl.

- Uses the MOZ_COLLECT_REPORT macro in all suitable places.

Overall the patch reduces code size by ~300 lines and reduces the size of
libxul by about 37 KiB on my Linux64 builds.

--HG--
extra : rebase_source : e94323614bd10463a0c5134a7276238a7ca1cf23
2016-08-24 15:23:45 +10:00
Kan-Ru Chen b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
Nicholas Nethercote 3873d0c8f6 Bug 1295053 (part 4) - Don't use NS_METHOD for remaining xpcom functions. r=froydnj.
These don't need __stdcall on Win32.

--HG--
extra : rebase_source : 19e4bf0d67b7fe25f53c0cff24471ef23d26dcf0
2016-08-15 14:49:26 +10:00
Igor 175543fda8 Bug 1293384 - Part 2: Rename Snprintf.h header to Sprintf.h. r=froydnj 2016-08-14 23:43:21 -07:00
Igor a57972337d Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj 2016-08-14 23:44:00 -07:00
Nicholas Nethercote 3b0485fcdb Bug 1294645 - Don't use NS_CALLBACK for callbacks in nsI{Input,Output,UnicharInput},Stream.idl. r=froydnj.
Slightly less than half (93 / 210) of the NS_METHOD instances in the codebase
are because of the use of NS_CALLBACK in
nsI{Input,Output,UnicharInput},Stream.idl. The use of __stdcall on Win32 isn't
important for these callbacks because they are only used as arguments to
[noscript] methods.

This patch converts them to vanilla |nsresult| functions. It increases the size
of xul.dll by about ~600 bytes, which is about 0.001%.

--HG--
extra : rebase_source : c15d85298e0975fd030cd8f8f8e54501f453959b
2016-08-12 17:36:22 +10:00
Igor 4878f6bf37 Bug 1289890 - Change nsCOMArray::ReplaceObjectAt() return type from "bool" to "void", since it always succeeds. r=froyndnj 2016-08-02 16:20:00 +02:00
Matthew Wein 33de9c036e Bug 1285063 - Part 1: Add a helper to XPCOMUtils to iterate over entries in a category. r=kmag
MozReview-Commit-ID: 3mjrPrRuLej

--HG--
extra : rebase_source : 7b7dad1a4bab958a590c24d97f564e34b3355633
2016-07-11 17:33:06 -07:00
Tom Tromey 5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Chris Peterson d634a99cad Bug 1277106 - Part 4: Remove MOZ_UTF16() macro. r=Waldo 2016-07-19 21:07:53 -07:00
Ralph Giles 956493cd6e Bug 1275744 - Reference MOZ_LOG in xpcom comments. r=erahm
NSPR_LOG_MODULES is deprecated.

MozReview-Commit-ID: Cel3JCLXLmp

--HG--
extra : rebase_source : da100ece62fd571d19a07455f8c256f5cd39f62b
2016-05-25 15:26:10 -07:00
Jarda Snajdr a8fa0feb87 Bug 1269765 - Notify http-on-opening-request in content process. r=valentin 2016-05-30 01:24:00 +02:00