Commit Graph

2669 Commits

Author SHA1 Message Date
Tomislav Jurin
348bfffc19 Bug 1296189 - Replace NS_RUNTIMEABORT("some string literal message") with MOZ_CRASH(). r=froydnj 2016-12-02 13:46:53 -08:00
Bill McCloskey
972fbd3fdf Bug 1320753 - Add nsINamed and have Runnable implement it (r=ehsan)
MozReview-Commit-ID: 6Vuw3aJ3860
2016-11-30 18:01:59 -08:00
Nathan Froyd
2ebbd09068 Bug 1320752 - remove mozilla/Function.h; r=gerald
We have std::function available now, which is likely to be somewhat more
efficient.
2016-11-28 11:03:53 -05:00
Gerald Squelart
25ced2b192 Bug 1313497 - Expose Is/RemoveSmartPointer - r=froydnj
Moved IsRefcountedSmartPointer and StripSmartPointer from ::detail to
::mozilla, to permit their use from other files.
Renamed StripSmartPointer to RemoveSmartPointer, for consistency with the
usual 'Remove...' type traits.

MozReview-Commit-ID: GMEbWCGfdpc

--HG--
extra : rebase_source : 3139cef1e18625b751e7d90ebfc0db5ef5bfec6b
2016-11-17 14:34:24 +11:00
Matt Woodrow
0b2b7a78b7 Bug 1319626 - Part 1: Add new nsTArray append method for mozilla::Array. r=froydnj
--HG--
extra : rebase_source : ceb2bfc4275c200262e23b7cef8383de21e46e68
2016-11-24 18:11:30 +13:00
Carsten "Tomcat" Book
9a3ab17838 Backed out changeset 65178b7ee6da (bug 1319626) for bustage after merge 2016-11-24 17:04:13 +01:00
Matt Woodrow
631fc26c6d Bug 1319626 - Part 1: Add new nsTArray append method for mozilla::Array. r=froydnj 2016-11-24 18:11:30 +13:00
Gerald Squelart
b3fb2f5bf4 Bug 1318228 - NewRunnable defaults to StoreCopyPassByConstLRef - r=froydnj
MozReview-Commit-ID: LmQHthMLUd3

--HG--
extra : rebase_source : 84ab099977d6ab32c6f0afb354569bdcec5ce0a5
2016-11-17 17:07:02 +11:00
Andi-Bogdan Postelnicu
a6f9209af4 Bug 1317954 - Use C++11's override and remove virtual where applicable in xpcom/. r=froydnj
MozReview-Commit-ID: 2XXoxNHYCKm

--HG--
extra : rebase_source : f4a144b706aa467a1cf713db57adcbefa40b8b96
2016-11-16 14:27:07 +02:00
Andi-Bogdan Postelnicu
60bb054c02 Bug 1317954 - Replace default bodies of special member functions with = default; in xpcom/. r=froydnj
MozReview-Commit-ID: 5GXchMr0VvV

--HG--
extra : rebase_source : ac32605ef643f67ffd0f0894f31eed8f01804e2f
2016-11-16 14:25:31 +02:00
Andi-Bogdan Postelnicu
42effb5bbf Bug 1317954 - Use auto type specifier where aplicable for variable declarations to improve code readability and maintainability in xpcom/. r=froydnj
MozReview-Commit-ID: EZZrYF1W81B

--HG--
extra : rebase_source : 30eea607d07ac819a0e55a2c4b0f8c359c156705
2016-11-16 14:24:59 +02:00
Andi-Bogdan Postelnicu
d7f83a7ea6 Bug 1317954 - Converts for(...; ...; ...) loops to use the new range-based loops in C++11 in xpcom/. r=froydnj
MozReview-Commit-ID: 9mKXvXyYa6U

--HG--
extra : rebase_source : 55f74f93829b52b2c347a62520a79ab867adca35
2016-11-16 14:24:21 +02:00
Trevor Saunders
617126f910 bug 1316119 - add a GetOrInsert to nsBaseHashtable that returns a reference to the value r=froydnj
This intends to expose basically the same functionality as operator[] on
unordered_map.
2016-11-16 23:46:45 -05:00
Wes Kocher
dcbb82b42b Backed out changeset 0e27121698e4 (bug 1316119) for a11y failures a=backout CLOSED TREE 2016-11-16 16:16:32 -08:00
Trevor Saunders
93e1959ffb bug 1316119 - add a GetOrInsert to nsBaseHashtable that returns a reference to the value r=froydnj
This intends to expose basically the same functionality as operator[] on
unordered_map.
2016-11-16 18:15:20 -05:00
Gerald Squelart
33ea8d877d Bug 1316978 - Suppress nullptr-to-bool cast warning - r=froydnj
MozReview-Commit-ID: BweUO5stduw

--HG--
extra : rebase_source : 9f61f969007dc5680cbc0f8edc4f15d5f119cd4f
2016-11-12 09:53:39 +11:00
Carsten "Tomcat" Book
cc5d30c616 Merge mozilla-central to mozilla-inbound
--HG--
extra : rebase_source : 658b3ffdfa71afff2d44129f50e50e2fbecbd06e
2016-11-11 16:43:07 +01:00
Gerald Squelart
10f1b864f2 Bug 1316432 - nsCOMPtr construction/assignment from nullptr - r=froydnj
MozReview-Commit-ID: 4KW3g2WSJaC

--HG--
extra : rebase_source : de8fc2f900abbf7f0bf763ffac8f23f9cde298b4
2016-11-11 07:57:38 +11:00
Gerald Squelart
47f1821983 Bug 1316432 - Replace 0's with nullptr in nsCOMPtr.* - r=froydnj
Just a mechanical find/replace of all zero pointers, before the next patch.

MozReview-Commit-ID: DSzSZunAXWu

--HG--
extra : rebase_source : a5a9a064335254a7456a7ec48805c4ec08fd18af
2016-11-10 14:19:56 +11: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
Gerald Squelart
06c4e95cd0 Bug 1316206 - Make RefPtr(decltype(nullptr)) MOZ_IMPLICIT - r=froydnj
Making this constructor non-explicit will permit automatic conversions from
'nullptr' into RefPtr types, which I think are not dangerous.

The one spot that this affects is in 'UserDataType nsBaseHashtable::Get(KeyType)',
which does a 'return 0;' into the UserDataType, which could be a bool, an int, a
RefPtr or other. I'm changing that into a C++11 "value initialization", which
falls back to "zero initialization" for PODs: 'return UserDataType{};'.

Also fixed the comment to clarify not-found return values, as Get(KeyType) was
not only used for pointers anyway.

MozReview-Commit-ID: F41VlvTNOZU

--HG--
extra : rebase_source : 71d5dacac75ca188e5c55d45f48a5fca76d953c6
2016-11-08 15:12:33 +11:00
Andreas Farre
3aecf57375 Bug 1198381 - Implement the requestIdleCallback feature, r=froydnj,mattwoodrow,smaug
Expose requestIdleCallback on Window and implement running callbacks
in idle periods by posting rICs to the main threads idle queue.

MozReview-Commit-ID: KSYQsyaZ6is

--HG--
extra : rebase_source : 6abd41c2de96b39004f1b2c3c740e81de570970c
2016-08-22 14:52:45 +02:00
Andreas Farre
d87b4d239b Bug 1198381 - Extend nsIThread with idleDispatch, r=froydnj,smaug
The intent of idleDispatch is the possibility to have a runnable
executed when the thread is idle. This is accomplished by adding an
event queue for idle tasks that will only be considered when the main
event queue is empty and the caller of ProcessNextEvent doesn't
require that we wait until there is an event on the main event queue.

MozReview-Commit-ID: IDWQfzZqWpZ

--HG--
extra : rebase_source : 0d5bfeebd08e01597c2cd8b76e8e848d9f9c58f0
2016-08-24 16:18:06 +02:00
Carsten "Tomcat" Book
e42af6918c Backed out changeset 333a899fb5e6 (bug 1198381) 2016-10-25 12:32:56 +02:00
Carsten "Tomcat" Book
1895ce466b Backed out changeset eb2606332cb8 (bug 1198381) 2016-10-25 12:32:54 +02:00
Andreas Farre
1380385c69 Bug 1198381 - Implement the requestIdleCallback feature, r=froydnj,mattwoodrow,smaug
Expose requestIdleCallback on Window and implement running callbacks
in idle periods by posting rICs to the main threads idle queue.

MozReview-Commit-ID: KSYQsyaZ6is

--HG--
extra : rebase_source : 4bdd578b654d05cab600489d30d859452d1bc888
2016-08-22 14:52:45 +02:00
Andreas Farre
60a3a10742 Bug 1198381 - Extend nsIThread with idleDispatch, r=froydnj,smaug
The intent of idleDispatch is the possibility to have a runnable
executed when the thread is idle. This is accomplished by adding an
event queue for idle tasks that will only be considered when the main
event queue is empty and the caller of ProcessNextEvent doesn't
require that we wait until there is an event on the main event queue.

MozReview-Commit-ID: IDWQfzZqWpZ

--HG--
extra : rebase_source : b16ff65d7a9b2fa16216a9ce8756358014d7ad96
2016-08-24 16:18:06 +02:00
Nathan Froyd
d1108c1e52 Bug 1311068 - remove InitializerList.h; r=botond
We needed this polyfill for <initializer_list> when some of our C++
standard libraries did not support said header.  They all do now, so the
polyfill is redundant.
2016-10-19 00:33:14 -04: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
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
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
b474cb6353 merge mozilla-inbound to mozilla-central a=merge 2016-10-14 11:59:12 +02: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
Xidorn Quan
320a08b33e Bug 1309794 - Make RefCnt types non-copyable. r=froydnj
MozReview-Commit-ID: Lx344xrXDZT

--HG--
extra : rebase_source : 31ef46add0b2b4b2e62b425d0740199f0e4d4f85
2016-10-13 16:52:54 +11:00
Sebastian Hengst
cdcc9e20da Bug 1304829 - rename RELEASE_BUILD to RELEASE_OR_BETA: main part. r=ted,Mossop
MozReview-Commit-ID: 1lCt0xTMV5O
2016-10-08 11:14:49 +02:00
Phil Ringnalda
0e26fa186a Backed out changeset 3851e5f51530 (bug 1299489) for unfathomable bustage of Linux32 debug test_peerConnection_capturedVideo.html
CLOSED TREE

MozReview-Commit-ID: I6HSmVRtucs
2016-10-05 19:25:24 -07:00
Michael Layzell
025811ca63 Bug 1299489 - Change nsTArray to use a custom iterator based on index instead of pointers to improve iterator invalidation safety of ranged for loops, r=froydnj
MozReview-Commit-ID: CahPOcRYvES
2016-10-05 11:54:51 -04:00
Tom Schuster
774a8bf34d Bug 1302163 - Change code to use SprintfLiteral instead of snprintf. r=ehsan 2016-10-04 17:57:51 +02:00
Dylan Roeh
fc0297ebcf Bug 1307858 - Use a copy of the list of observers to broadcast. r=froydnj 2016-12-16 14:49:25 -06:00
Nils Ohlmeier [:drno]
565956109b Bug 1305159: replace NSAddImage with dlopen on OSX. r=froydnj
MozReview-Commit-ID: FHZthgRxPha

--HG--
extra : rebase_source : a6f7f61a4016b515ea96073f943aec06fea224b7
2016-09-23 15:31:39 -07:00
Andrew McCreight
5b9c57b7a2 Bug 1301301, part 1 - Unify NoteJSObject and NoteJSScript into NoteJSChild. r=smaug
This will let my next patch pass in other GC things.

This should not change behavior in any important way.

MozReview-Commit-ID: FykviKKvQzI
2016-09-23 15:42:13 -07:00
Michael Layzell
030fcbd018 Bug 1303472 - Add a move constructor to nsCOMPtr, r=froydnj
MozReview-Commit-ID: 6ECLDmA9Ol
2016-09-20 11:36:14 -04:00
Xidorn Quan
7d4ca9c88b Bug 1303302 - Add IsDestructible trait in TypeTraits and use it for refcounted type static check. r=froydnj
MozReview-Commit-ID: G3YFhrJngq0

--HG--
extra : rebase_source : da0aa325eb7772c1a156440ed46be9d0d429c91e
2016-09-16 17:23:55 +10:00
Jan de Mooij
a53986bf29 Bug 1302448 part 1 - Rename CycleCollectedJSRuntime to CycleCollectedJSContext. r=mccr8
--HG--
rename : xpcom/base/CycleCollectedJSRuntime.cpp => xpcom/base/CycleCollectedJSContext.cpp
rename : xpcom/base/CycleCollectedJSRuntime.h => xpcom/base/CycleCollectedJSContext.h
extra : rebase_source : 075214b5057f151520926715b6154e99ae80a0b3
2016-09-14 15:47:32 +02:00
Nicholas Nethercote
34dcc7b852 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");

--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
2016-09-02 17:12:24 +10:00
Nicholas Nethercote
b71747b2ac Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.

--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
2016-09-01 15:01:16 +10:00
Nicholas Nethercote
819433bae0 Bug 1299389 - Replace some raw pointers in nsThreadManager. r=froydnj.
nsThreadManager::get() can return a reference. This lets us remove some
redundant assertions.

nsThreadArray elements can be NotNull<>s.

--HG--
extra : rebase_source : fd49010167101bc15f7f6d01bf95fd63b81d60fb
2016-06-10 16:04:49 +10:00
Honza Bambas
e4eacf065d Bug 956338 - Add checks to WeakPtr/nsWeakReference and related classes to assert single-thread usage. r=nfroyd
--HG--
extra : rebase_source : 140fa149eb94f027e9319a44be0bbee34648222a
2016-08-01 13:16:16 +02:00
Gerald Squelart
fb84b054bc Bug 1295763 - Allow ThreadSafeAutoRefCnt with XPCOM_GLUE - r=froydnj
Removed '#ifndef XPCOM_GLUE' that blocked usage of thread-safe ref-counting
from XPCOM_GLUE code.

MozReview-Commit-ID: Hm0rdTKK46l

--HG--
extra : rebase_source : cd2779d0b39c5319cfdb5d12e8f4ac6f38945e7b
2016-08-16 14:07:16 +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
Andrew McCreight
edbb47a7d7 Bug 1288870, part 1 - Add NS_INLINE_DECL_REFCOUNTING_WITH_DESTROY. r=froydnj
This is the same basic idea as NS_IMPL_RELEASE_WITH_DESTROY. I need
this because I am making XPCNativeInterface refcounted, and it uses
some weird placement new stuff requiring a special function to
deallocate the object. (It does this to store an array of arbitrary
length inline, presumably for some sort of time or space reason.)

MozReview-Commit-ID: 5I7BgY6YlLl
2016-08-23 05:59:56 -07:00
Xidorn Quan
fab96c1410 Bug 1291707 part 2 - Add GetAndRemove to nsDataHashtable. r=froydnj
MozReview-Commit-ID: 24zlYwsRGsF

--HG--
extra : rebase_source : 904c62cd779133666904d3167cb7e7c31f95a412
extra : source : 6c1df15aad607e70547b51011bd352d8a8bf826d
2016-08-23 10:31:26 +10:00
Kan-Ru Chen
b4cf4bec61 Bug 1264642 - Part 6. Mark JSStructuredCloneData as MOZ_NON_MEMMOVABLE and add specializations in nsTArray.h. r=froydnj
MozReview-Commit-ID: HltgzBnxMsn
2016-08-23 00:40:47 +08:00
Nathan Froyd
e255fd3842 Bug 1262826 - specialize nsTHashtable<nsPtrHashKey<T>> to share a common implementation; r=erahm
We have a number of nsTHashtable<nsPtrHashKey<T>> instantiations, mostly
from IPDL-generated code.  There's no reason in principle that all of
these instantiations couldn't share code, since they're all storing POD
entries of the same size.  Let's specialize nsTHashtable for such types,
providing a thin layer over a hashtable that stores void pointers.  This
change saves about 90K of space (!) on x86-64 Linux.
2016-08-22 18:45:47 -04:00
Nathan Froyd
41ba39b3b0 Bug 1295197 - use non-null-checked operator new in xpcom/; r=erahm
The standard placement new function is declared to not throw, which
means that, per spec, a null check on its result is required. There are
a number of places throughout xpcom/ where we know that we are passing
non-null pointers to placement new (and receiving them as a return
value), and we are therefore doing useless work performing these null
checks.

Therefore, we should be using an operator new overload that doesn't
require the null check. MFBT has just such an overload, so use that.
2016-08-22 18:40:10 -04:00
Emilio Cobos Álvarez
00ab304ee2 Bug 1292618: Add Gecko_ClearPODTArray to clear arrays of types without destructors. r=heycam
MozReview-Commit-ID: 3RRvrXn6ZTD
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>
2016-08-19 20:24:24 -07:00
Wes Kocher
02f300c352 Backed out 4 changesets (bug 1292618) because it was making merging things difficult a=backout
Backed out changeset 14733a383b4c (bug 1292618)
Backed out changeset 17dfe8bc5f76 (bug 1292618)
Backed out changeset d04597bd1109 (bug 1292618)
Backed out changeset 30f7696fea2d (bug 1292618)
2016-08-19 18:37:09 -07:00
Emilio Cobos Álvarez
c043a5d5c5 Bug 1292618: Add Gecko_ClearPODTArray to clear arrays of types without destructors. r=heycam
MozReview-Commit-ID: 3RRvrXn6ZTD
Signed-off-by: Emilio Cobos Álvarez <ecoal95@gmail.com>
2016-08-19 18:26:35 -07:00
Ryan VanderMeulen
01c4e8cc1b Merge inbound to m-c. a=merge 2016-08-19 09:52:53 -04:00
Phil Ringnalda
b4f23026ee Backed out 5 changesets (bug 1292618) for !mImageTracked assertion failures
CLOSED TREE

Backed out changeset 1d767147e160 (bug 1292618)
Backed out changeset e6034e58efe4 (bug 1292618)
Backed out changeset 928dd363efa0 (bug 1292618)
Backed out changeset 8e274c66ae7f (bug 1292618)
Backed out changeset 6c347701d343 (bug 1292618)
2016-08-19 00:23:42 -07:00
Emilio Cobos Álvarez
242a6e6bcf Bug 1292618: Add Gecko_ClearPODTArray to clear arrays of types without destructors. r=heycam
MozReview-Commit-ID: 3RRvrXn6ZTD
2016-08-18 22:16:16 -07:00
Wes Kocher
55897634c1 Backed out 3 changesets (bug 1288870) for hazards a=backout
Backed out changeset 83bbd356da97 (bug 1288870)
Backed out changeset 4f0ab1a0d8dd (bug 1288870)
Backed out changeset 8d71aba5c1e7 (bug 1288870)
2016-08-18 16:50:13 -07:00
Andrew McCreight
f68a2b0443 Bug 1288870, part 1 - Add NS_INLINE_DECL_REFCOUNTING_WITH_DESTROY. r=froydnj
This is the same basic idea as NS_IMPL_RELEASE_WITH_DESTROY. I need
this because I am making XPCNativeInterface refcounted, and it uses
some weird placement new stuff requiring a special function to
deallocate the object. (It does this to store an array of arbitrary
length inline, presumably for some sort of time or space reason.)

MozReview-Commit-ID: 5I7BgY6YlLl
2016-08-18 15:20:48 -07:00
Emilio Cobos Álvarez
11d1b4e283 Bug 1295818: Templatize nsTArray::RemoveElementsBy to avoid a spurious allocation. r=froydnj
mozilla::function involves an allocation of the FunctionImpl type, that we can
avoid rather easily in this case.

This commit is completely optional, I guess, though the code we're using
RemoveElementsBy with the previous patch is sort of hot.

MozReview-Commit-ID: 2LoQs4cB28X
2016-08-18 10:02:39 -07:00
Sylvestre Ledru
4a4e53fe19 Bug 1296231 - Fix some missing "Missing varargs cleanup" and "Resource leaks" r=froydnj
MozReview-Commit-ID: AT1L351PjF6

--HG--
extra : rebase_source : f9c0cb1a8b478c2ad5a52f679eb5feb603e85d2e
2016-08-18 10:46:05 +02:00
Nicholas Nethercote
e0229c761e Bug 1295053 (part 5) - Remove an unnecessary use of NS_CALLBACK in ClassInfoData. r=froydnj.
--HG--
extra : rebase_source : 6b14b91e8cd4c056e40148064b396a55c6f451a3
2016-08-16 07:56:26 +10:00
Nicholas Nethercote
060123c88a Bug 1295053 (part 1) - Don't use NS_METHOD for xpcom thread utility functions. r=froydnj.
These don't need __stdcall on Win32.

--HG--
extra : rebase_source : 9af47c64571a2c7459f95c46e737c5ef50d47909
2016-08-15 14:29:43 +10:00
Wes Kocher
f378fa54b1 Backed out changeset f8d33a975228 (bug 1295197) for being a possible cause of crashtest assertions CLOSED TREE 2016-08-16 11:22:23 -07:00
Nathan Froyd
da3e07b555 Bug 1295197 - use non-null-checked operator new in xpcom/; r=erahm
The standard placement new function is declared to not throw, which
means that, per spec, a null check on its result is required.  There are
a number of places throughout xpcom/ where we know that we are passing
non-null pointers to placement new (and receiving them as a return
value), and we are therefore doing useless work performing these null
checks.

Therefore, we should be using an operator new overload that doesn't
require the null check.  MFBT has just such an overload, so use that.
2016-08-16 17:05:39 -04:00
Michael Layzell
e1fc3b1773 Bug 1159244 - Add release mode bounds checking with custom annotations to nsTArray, r=froydnj
MozReview-Commit-ID: Ljx9PwBCyTT
2016-08-15 13:29:45 -04: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
Wes Kocher
e9097643d5 Merge inbound to central, a=merge 2016-08-12 13:44:29 -07:00
Jan de Mooij
0ad12515f4 Bug 1292892 part 1 - Stop using JSRuntime outside SpiderMonkey. r=bz,terrence,fitzgen,kanru 2016-08-11 14:39:22 +02:00
Nicholas Nethercote
e7f10a07fd Bug 1293603 (part 2) - Make Run() declarations consistent. r=erahm.
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.

As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.

--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
2016-08-08 12:18:10 +10:00
Andrew McCreight
18b7a1fc2f Bug 1293666 - Add initializer_list ctor to AutoTArray. r=froydnj
MozReview-Commit-ID: 8ORBttWN2Rj

--HG--
extra : rebase_source : 9ad6ae8aff9cbc81c773297d0bb2f7478fb3516e
2016-08-09 07:21:26 -07: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
Chris Peterson
6ae2ecbc02 Backed out changeset 3b1cf7c28eb7 (bug 1290646) for possibly breaking OS X debug mochitests. 2016-08-03 01:11:06 -07:00
Chris Peterson
1eccabf8d3 Bug 1290646 - Remove VS2012 crash workaround in nsTArray. r=jimm 2016-07-28 11:51:25 -07:00
Cameron McCormack
e6a3498cde Bug 1288038 - Make fallible nsBaseHashtable::Put use fallible nsTHashtable::PutEntry. r=froydnj r=sfink
MozReview-Commit-ID: 8N32oU4V5zh
2016-08-03 09:18:35 +08:00
Carsten "Tomcat" Book
bd81ddd0b0 merge mozilla-inbound to mozilla-central a=merge 2016-08-02 17:09:31 +02:00
Andrew McCreight
e5fea6eaa1 Bug 1279998 - Remove NSCAP_FEATURE_TEST_NONNULL_QUERY_SUCCEEDS. r=froydnj
MozReview-Commit-ID: LbT6922qlHQ

--HG--
extra : rebase_source : f59298236c3905c4c92d261ffe93847584d24bb6
2016-08-01 11:16:19 -07:00
Emilio Cobos Álvarez
4d812b8ba1 Bug 1290524: Allow nsClassHashTable::LookupOrAdd to provide arguments to construct the new object.
MozReview-Commit-ID: 1s1ZaFWLrri
2016-07-30 15:03:11 -07:00
Xidorn Quan
5b8c16a02b Bug 1287706 part 5 - Add RemoveElementsBy method to nsTArray and nsTObserverArray to allow filtering elements by predicate function. r=froydnj
MozReview-Commit-ID: LjUXYsIuaFL

--HG--
extra : source : e0654f189aad7399dd69a920995e8b87f590da79
2016-07-28 12:00:06 +10:00
Seth Fowler
5748c4da8c Bug 1291019 - Take the value of |aDoomed| in NS_ReleaseOnMainThread() if we're going to leak anyway. r=froydnj 2016-08-01 17:51:01 -07:00
Emilio Cobos Álvarez
1a1438ccb5 Bug 1288578: Make public nsClassHashTable::IsEmpty. r=froydnj
MozReview-Commit-ID: JSjT17kWYcQ
2016-07-22 13:27:52 -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
Chris Peterson
b175c9fdd5 Bug 1277106 - Part 2: Expand MOZ_UTF16() strings to u"" string literals. r=Waldo 2016-07-20 22:03:25 -07:00
Thomas Zimmermann
16e1b1c5eb Bug 1288077: Merge implementations of |nsTArrayFallibleAllocator|, r=froydnj
The two implemenations of |nsTArrayFallibleAllocator| in 'nsTArray' are
equivalent. This patch merges both.

MozReview-Commit-ID: 3G9pHSQRzKz
2016-07-20 17:29:36 +02:00
Thomas Zimmermann
5528947546 Bug 1288077: Cleanup forward declarations of array types, r=froydnj
MozReview-Commit-ID: 59XzOnREb6I
2016-07-20 17:29:36 +02:00
Thomas Zimmermann
c9844397ea Bug 1288077: Whitespace fixes, r=froydnj
MozReview-Commit-ID: DpKAsid5O3k
2016-07-20 17:29:36 +02:00
Manish Goregaokar
4d3c9798eb Bug 1285235 - Add bindings for growing nsTArrays; r=bholley 2016-07-14 14:29:37 +05:30
Chris Peterson
43c2748f66 Bug 1277775 - Replace MOZ_CONSTEXPR{_VAR,_TMPL} with constexpr. r=froydnj 2016-07-08 14:39:53 -07:00
Nathan Froyd
5dba0130cc Bug 1271751 - part 8 - fix bug in nsTArray_CopyWithConstructors; r=erahm
The backwards copying case in MoveOverlappingRegion had a bug: rather
than destroying each element from the source range as we moved it, we
would always destroy the element at the beginning of the source range.
Fortunately, none of the existing types that were copied via
constructors seem to trigger the problematic code.
2016-07-08 16:59:04 -04:00
Nathan Froyd
229ede80e2 Bug 1271751 - part 7 - remove nsTArray_CopyWith*::Copy*; r=erahm
After all the previous patches, we never call these functions.  Any
copying required by nsTArray is taken care of by other means.
2016-07-08 16:59:05 -04:00