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

2702 Коммитов

Автор SHA1 Сообщение Дата
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
Benjamin Smedberg 15891ffef0 Bug 1306329 - Don't build the dependent XPCOM glue. r=glandium
MozReview-Commit-ID: jdOYo4Zv1l

--HG--
extra : rebase_source : 60eae5f77acdd588664b6997f800da0861e52bc5
extra : source : 6bb17b9a62d8ebeeaed80e87c14449b1d7dc6bb6
2016-10-26 13:55:51 -04: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
Nathan Froyd 3d1192cadc Bug 1271751 - part 6 - make ShiftData actually move its elements rather than copying; r=erahm
This change eliminates the last use of the Copy* family of functions.
2016-07-08 16:59:05 -04:00
Nathan Froyd 0dc761e84b Bug 1271751 - part 5 - use MoveNonOverlappingRegion instead of CopyNonOverlappingRegion; r=erahm
In all of the calls to CopyNonOverlappingRegion from within nsTArray, we
don't care about the contents of the source afterwards.  So we can use
moves instead of copies to potentially make things more efficient.
2016-07-08 16:59:05 -04:00
Nathan Froyd 315612a443 Bug 1271751 - part 4 - rename CopyNonOverlappingRegionWithHeader to MoveNonOverlappingRegionWithHeader; r=erahm
Whenever we're copying the header, we can be guaranteed that we're never
going to use the elements from the old array afterward, so can move (in
the C++ sense) the elements rather than copying them.
2016-07-08 16:59:05 -04:00
Nathan Froyd 5dd30fe964 Bug 1271751 - part 3 - add Move{Non,}OverlappingRegion; r=erahm
We'll need these for future patches as we transition nsTArray to use
moves for most of its operations rather than copies.  The implementation
of these functions are essentially cut-and-paste versions of the Copy*
functions, but using moves.
2016-07-08 16:59:05 -04:00
Nathan Froyd 6e9fa45637 Bug 1271751 - part 2 - rename {Copy,Move}Elements to something more accurate; r=erahm
The names {Copy,Move}Elements are based on the use of mem{cpy,move},
respectively.  However, I submit that we really want the names to
reflect the C++ operations being done, rather than the underlying
implementation details.  So let's rename these to reflect that we are
always copying the elements, and discriminate between the two cases
based on whether the regions being copied overlap or not.

Bring CopyHeaderAndElements along for the ride, as well.
2016-07-08 16:59:05 -04:00
Nathan Froyd e458be747b Bug 1271751 - part 1 - provide out-of-class definitions for some nsTArray functions; r=erahm
This change enables some of the methods in nsTArray to be lazily
instantiated, particularly the ones that care about whether the element
type is copyable.  Since we have a number of places where nsTArray is
used with move-only types, we need to ensure that unless methods
requiring copyability are actually called, those methods are not
instantiated.
2016-07-08 16:59:05 -04:00
Nathan Froyd 09a852e8b4 Bug 1271751 - part 0 - remove heap functions from nsTArray; r=erahm
They are unused, except for tests.
2016-07-08 16:59:05 -04:00
Chris Peterson 2b3b60f7b1 Bug 1277155 - Part 1: Remove snprintf() polyfills for VS2013 in Sprintf.h and #defines. r=froydnj r=mhowell 2016-06-27 20:45:03 -07:00
Jan de Mooij 96da4695c8 Bug 1283855 part 25 - Make JS_GC take JSContext instead of JSRuntime. r=terrence 2016-07-06 11:40:20 +02:00
Andrew McCreight d2ec8127e0 Bug 1279609 - nsRunnableMethodImpl should use a non-public destructor. r=froydnj 2016-07-05 12:03:18 -07:00
Jan de Mooij 4ba1239131 Bug 1283855 part 11 - Make some GC callback APIs take JSContext instead of JSRuntime. r=terrence,mccr8 2016-07-05 14:35:19 +02:00
Nathan Froyd 1363127e17 Bug 1283524 - remove unnecessary NS_ASSERT_OWNINGTHREAD checks in Release method macros; r=mccr8
The definitions of these Release methods already include
NS_ASSERT_OWNINGTHREAD checks earlier, so these second checks are
redundant.
2016-06-30 23:55:36 -04:00
Aidin Gharibnavaz 523608513b Bug 1247972 - specialize NS_ProxyRelease for nsISupports to be out-of-line; r=erahm
NS_ProxyRelease's current implementation requires a lot of code.  We can
reduce the impact of this by providing an out-of-line implementation for
classes based on nsISupports.  This change reduces codesize by ~60K on
a Linux x86-64 build.
2016-06-29 18:56:41 -04:00
Nathan Froyd f7ee3c3dbf Bug 1281626 - part 5 - move nsRunnableFunction into mozilla::detail and rename it; r=khuey
We do this for similar reasons as nsRunnableMethod*: less prefixing and
a more obvious signal that this is a private implementation class.
2016-06-28 22:24:54 -04:00
Nathan Froyd 65715152b1 Bug 1281626 - part 4 - change NS_NewRunnableFunction to return already_AddRefed; r=khuey
This change makes it more consistent with NS_NewRunnableMethod and also
opens up optimization opportunities for later.
2016-06-28 22:24:54 -04:00
Nathan Froyd f624e16333 Bug 1281626 - part 2 - make RunnableMethod* internals final classes; r=khuey
This step is mostly tidiness.
2016-06-28 22:24:54 -04:00
Nathan Froyd bcf3920031 Bug 1281626 - part 1 - move nsRunnableMethod* into mozilla::detail and rename them; r=khuey
Less ns-prefixing is more better.  Also, this renaming makes clearer
that these classes are private implementation details, which is good,
because we're going to take advantage of that fact in a bit.
2016-06-28 22:24:54 -04:00
Kyle Huey 6baa905da7 Bug 1282527: Remove remaining PR_ASSERTs outside of NSPR/NSS. r=dbaron
--HG--
extra : rebase_source : a9dd69c772ef2641ee300d57d2a4d4c83003726c
2016-06-28 10:47:22 -07:00
Jan de Mooij fb0436ba41 Bug 1279295 - Create the runtime's JSContext when we create the runtime. r=luke 2016-06-22 09:47:52 +02:00
Nathan Froyd ddc458bf9e Bug 1281227 - clarify comments in PLDHashTable.cpp; r=njn
Comments for SearchTable and FindFreeEntry refer to parameters that no
longer exist, now that we do things with template arguments.  Let's fix
that.
2016-06-22 02:44:40 -04:00
Nathan Froyd 150bcb573b Bug 1278925 - micro-optimize nsCOMArray appending with already_AddRefed AppendElement; r=erahm
In all of the places touched by this patch, the smart pointer we're
appending is about to become unused, so simply .forget()'ing its
reference into the appropriate nsCOMArray works just fine.
2016-06-20 18:38:10 -04:00
Nomis101 083b9ba519 Bug 1279734 - "Fix two comment typos in nsTextFormatter.cpp". r=nfroyd 2016-06-11 10:41:45 +02:00
Gerald Squelart e8513ef5ee Bug 1271593 - NS_NewRunnableFunction should forward its arg - r=froydnj
By perfect-forwarding its argument, we can automatically gain move semantics
optimization when storing the given function object into nsRunnableFunction.
Also it allows movable-only function objects.

Note that any reference is removed from the type to be stored, so that the
runnable always contain a concrete function object.

MozReview-Commit-ID: 9EZK84ZhMvR

--HG--
extra : rebase_source : e1f87c3284fda4df6d13839ea6a0b0c2ce196833
2016-06-02 01:21:36 +02:00
Nicholas Nethercote 829225e78d Bug 1278452 - Remove a redundant null check in xpcom/glue/. r=froydnj.
There's another null check just a little earlier.

--HG--
extra : rebase_source : 24968e6bc5f12c3aa5d53711ebbb7f849c4501c3
2016-06-07 16:13:17 +10:00
Nathan Froyd 2be85aa542 Bug 1277890 - part 0 - add "append already_AddRefed element" API to nsCOMArray; r=erahm 2016-06-07 04:10:25 -04:00
Jan de Mooij b0f9749010 Bug 1278223 part 1 - Stop using multiple contexts per runtime in gtests. r=fitzgen 2016-06-06 19:45:06 +02:00
L. David Baron fc6592bdbc Bug 1271182 - Add some deleted assignment operators and copy constructors. r=khuey
These are generally good practice for reference-counted objects; they
catch cases where these operations are used by accident, breaking
reference-counting.

This doesn't show any existing problems, though.

MozReview-Commit-ID: EvRkNCymOqT
2016-05-25 18:04:35 -07:00
Andrew McCreight 35eaf64b42 Bug 1273190, part 3 - Fix some modelines in xpcom/. r=froydnj
Autogenerated by modeline.py.
2016-05-24 14:45:44 -07:00
Andrew McCreight 21bb33df87 Bug 1273190, part 1 - Fix indentation and mode lines for various xpcom/ files. r=froydnj 2016-05-24 14:45:44 -07:00
Eric Rahm 3e3b6c7f4d Bug 1270938 - Add stack traces for blocking resource base warnings. r=froydnj 2016-05-23 14:59:30 -07:00
Cameron McCormack 2af45ab23d Bug 1273838 - Part 2: Add stylo bindings glue for refcounting nsIPrincipals and nsIURIs. r=bholley
--HG--
extra : rebase_source : 3feef1315c4c8716952f630a38a4802e118b44ed
2016-05-21 10:02:54 +10:00
Cameron McCormack a5b7829d71 Bug 1273838 - Part 0.9: Add Ptr{Holder,Handle} typedefs for nsMainThreadPtr{Holder,Handle}. r=bholley
--HG--
extra : rebase_source : 12d60b4f31c3aa9183bcd8455357be4179f9a954
2016-05-21 10:02:54 +10:00
Cameron McCormack e0b47504da Bug 1273838 - Part 0.8: Add nsMainThreadPtr{Handle,Holder} constructors that take already_AddRefed pointers. r=bholley
--HG--
extra : rebase_source : bbdd9945e4621a54510f0259fc01454cc8642b17
2016-05-21 10:02:54 +10:00
Ting-Yu Lin 316b3d93b6 Bug 1272831 - Add AutoRestore::SavedValue() to retrieve the saved value. r=froydnj
MozReview-Commit-ID: eZCWmTpvXi

--HG--
extra : rebase_source : fc43e8b43edaad362971e7c7f91895759f47bf8f
2016-05-14 09:47:14 +08:00
Bob Owen e809e9f918 Bug 1035125 Part 9: Link Chromium sandbox into firefox.exe instead of having a separate DLL. r=aklotz,glandium
MozReview-Commit-ID: 1vgDPjpcwz3

--HG--
extra : rebase_source : 40966d98ca6c37f30884639d648907b4760ae240
2016-05-15 16:41:40 +01:00
Chris Peterson 8a9e2d2bd4 Bug 1272513 - Part 2: Remove redundant -Wshadow CXXFLAGS from moz.build files. r=glandium 2016-05-14 00:54:55 -07:00
Chris Peterson 353ee65255 Bug 1272513 - Part 1: Suppress -Wshadow warnings-as-errors in some directories. r=glandium 2016-05-11 00:00:01 -07:00
Andrew McCreight 1dc278fe13 Bug 1271848, part 1 - Add ClassName() method to the CC participant. r=smaug
This will let us report better information about participants at runtime.
2016-05-12 10:54:33 -07:00
Kyle Huey 941ab1f522 Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
Kyle Huey 7c2af31504 Bug 1268313: Part 5 - Make NS_NewRunnableMethod able to call const functions. r=froydnj 2016-05-05 01:44:59 -07:00
Kyle Huey 156b8c1933 Bug 1268313: Part 4 - Replace NewCancelableRunnableMethod with NS_NewCancelableRunnableMethod. r=froydnj 2016-05-05 01:44:59 -07:00
Kyle Huey 7f54121b91 Bug 1268313: Part 3 - Replace some NewCancelableRunnableMethod with NS_NewNonOwningCancelableRunnableMethod. r=froydnj 2016-05-05 01:44:59 -07:00
Aryeh Gregor 32bf86a025 Bug 1193762 part 9 - Delete nsCOMPtr<T>::operator T*()&&; r=froydnj 2016-05-01 21:29:23 +03:00
Carsten "Tomcat" Book 5d43a44ec6 Backed out changeset 3f2f3fcac66b (bug 1268313)
--HG--
extra : rebase_source : 438e7d7077b900ef252bd628f4559424eebd211f
2016-04-29 14:21:23 +02:00
Carsten "Tomcat" Book 4bb6f48de3 Backed out changeset 6a8d57e8fa8e (bug 1268313)
--HG--
extra : rebase_source : 8690897fd41073f22c8b25db5e8ce88df76a2bb7
2016-04-29 14:21:22 +02:00
Carsten "Tomcat" Book 894326b653 Backed out changeset 726f7361e0b8 (bug 1268313)
--HG--
extra : rebase_source : 3e04a6751a1cce2be7692763b4520dcca053f210
2016-04-29 14:21:20 +02:00
Carsten "Tomcat" Book ba3fe0975c Backed out changeset 85ce8cb0639a (bug 1268313)
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02:00
Nicholas Nethercote 2511b2c327 Bug 1267550 (part 2) - Rename MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE. r=froydnj.
It's an annotation that is used a lot, and should be used even more, so a
shorter name is better.

MozReview-Commit-ID: 1VS4Dney4WX

--HG--
extra : rebase_source : b26919c1b0fcb32e5339adeef5be5becae6032cf
2016-04-27 14:16:50 +10:00
Kyle Huey 48a594a09e Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-04-28 14:08:25 -07:00
Kyle Huey 732a15e600 Bug 1268313: Part 5 - Make NS_NewRunnableMethod able to call const functions. r=froydnj 2016-04-28 14:08:24 -07:00
Kyle Huey c724d0c867 Bug 1268313: Part 4 - Replace NewCancelableRunnableMethod with NS_NewCancelableRunnableMethod. r=froydnj 2016-04-28 14:08:24 -07:00
Kyle Huey a13954d079 Bug 1268313: Part 3 - Replace some NewCancelableRunnableMethod with NS_NewNonOwningCancelableRunnableMethod. r=froydnj 2016-04-28 14:08:24 -07:00
Jean-Yves Avenard b9ddae6e51 Bug 1264199: P0. Fix nsDequeue/MediaQueue methods constness. r=jwwang
MozReview-Commit-ID: BiOedq3IHt

--HG--
extra : rebase_source : 87175a92efdcfea864256482ced7eeee61301690
2016-04-25 12:13:55 +10:00
Kyle Huey c73656947b Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07:00
Chris Peterson c2fe3cc9ea Bug 1266295 - Remove unnecessary compiler version checks for gcc <= 4.8.0 in xpcom. r=froydnj 2016-04-17 17:10:00 -07:00
Andreas Pehrson 7386c22521 Bug 1262970 - Allow nsMainThreadPtrHandle to be constructed by and compared to nullptr. r=froydnj
MozReview-Commit-ID: HQgRhJc9AwG

--HG--
extra : rebase_source : e97c55229e0043d838d5dcb3e343bba2281c1e36
2016-04-14 11:38:04 +02:00
Nathan Froyd b0e24f4d55 Bug 1262400 - remove outer pointers from nsCreateInstance* classes; r=erahm
Outer pointers for object aggregation never get used.  Having these
always-null pointers around means extra space to store them and extra
instructions to deal with them.  Let's just remove them.
2016-04-14 11:30:59 -04:00
Nicholas Nethercote 60dcde7875 Bug 1261723 (part 2) - Separate class ops from js::Class. code=njn,h4writer. r=efaust,bz.
js::Class op are often all null. And when they're not all null, they're often
duplicated among classes. By pulling them out into their own struct, and using a
(possibly null) pointer in js::Class, we can save 114 KiB per process on
64-bit, and half that on 32-bit.
* * *
imported patch separate-ClassOps-2

--HG--
extra : rebase_source : bd751bf247e9491c1966a123dbeffa573657dfb1
2016-04-01 11:00:01 +11:00
Kyle Huey 2709afd167 Bug 1263311: Part 3 - s/nsCancelableRunnable/CancelableRunnable/g. r=froydnj 2016-04-11 11:40:06 -07:00
Kyle Huey 1cc02aa8c6 Bug 1263311: Part 1 - Change the nsICancelableRunnable interface. r=froydnj 2016-04-11 11:40:06 -07:00
Jonathan Watt 2dbf3449f8 Bug 1263764 - Make the external string API's Truncate compatible with the internal API's Truncate. r=froydnj 2016-04-01 16:17:35 +01:00
Wes Kocher 7d2cebe912 Backed out 3 changesets (bug 1263311) for Windows build failures in ServiceWorkerPrivate.cpp CLOSED TREE
Backed out changeset 0434a548e1fe (bug 1263311)
Backed out changeset 60b1be29446c (bug 1263311)
Backed out changeset 18132498bc40 (bug 1263311)

MozReview-Commit-ID: LPEa05QobdQ
2016-04-11 12:50:56 -07:00
Kyle Huey d200ed89d0 Bug 1263311: Part 3 - s/nsCancelableRunnable/CancelableRunnable/g. r=froydnj 2016-04-11 11:40:06 -07:00
Kyle Huey f13a6fc866 Bug 1263311: Part 1 - Change the nsICancelableRunnable interface. r=froydnj 2016-04-11 11:40:06 -07:00
Botond Ballo 5a57a5b196 Bug 1163320 - Variadic implementation of nsRunnableMethodArguments. r=froydnj
MozReview-Commit-ID: 13YyOyiionD

--HG--
extra : rebase_source : 89a0ad0877ed3290a41288523fe9b13d9c5bac7d
extra : source : ed761807105b30069d5a7412f8dacf75429eeeb6
2015-05-11 17:24:21 -04:00
Andreas Pehrson dfc6d94fe7 Bug 1208371 - Implement operator!= for nsMainThreadPtrHandle. r=bholley
MozReview-Commit-ID: EjlvLi9VsFA

--HG--
extra : rebase_source : 0e58b99b3c03a4abc4dfbcd57662f761f701615e
2016-02-04 00:24:52 +08:00
Jean-Yves Avenard da166b0f2c Bug 1259706: Add NS_INLINE_DECL_THREADSAFE_VIRTUAL_REFCOUNTING macro. r=froydnj
Allow to generate virtual AddRef/Release methods.

MozReview-Commit-ID: I7xPupDEtr4

--HG--
extra : rebase_source : b4d0e2b2a254e0402bbe6543c5263da359efb640
2016-03-25 23:01:58 +11:00