Commit Graph

300 Commits

Author SHA1 Message Date
Chris Peterson
73037a0f6a Bug 1412048 - Replace NS_RUNTIMEABORT(var) with MOZ_CRASH_UNSAFE_OOL(var). r=froydnj data-review=francois
And remove unreachable code after MOZ_CRASH_UNSAFE_OOL().

MOZ_CRASH_UNSAFE_OOL causes data collection because crash strings are annotated to crash-stats and are publicly visible. Firefox data stewards must do data review on usages of this macro. However, all the crash strings this patch collects with MOZ_CRASH_UNSAFE_OOL are already collected with NS_RUNTIMEABORT.

MozReview-Commit-ID: IHmJfuxXSqw

--HG--
extra : rebase_source : 031f30934b58a7b87f960e57179641d44aefe5c5
extra : source : fe9f638a56a53c8721eecc4273dcc074c988546e
2017-10-24 23:38:38 -07:00
Kan-Ru Chen
9016ef6cef Bug 1397456 - Always use static name for ipc messages r=billm
Never store names in Message. One can get string names from
Message::name() or use IPC::StringFromIPCMessageType() when only
message id is available.

MozReview-Commit-ID: 15ksx6SE90c

--HG--
extra : rebase_source : 1a041dc365b7f42edd540d8c7a4dfd8912e48921
2017-09-14 16:08:57 +08:00
Ryan Hunt
83e90232cc Don't crash in SendBuildID when MessageChannel isn't connected. (bug 1333056, r=dvander)
xpcshell can sometimes create and then almost immediately kill the GPU process. This can
cause the connection state of GPUParent's message channel to be in error or closed
when it attempts to send its build ID. In this case we should ignore the request
because the process will soon close.

MozReview-Commit-ID: EAupU844iFo

--HG--
extra : histedit_source : df05a01df5ad095b4e3c91e0e038d4e145da5f9d
2017-09-22 16:15:21 -05:00
Bevis Tseng
da72a5478c Bug 1399707 - Make entries in TabChild::sActiveTabs and EventLoopActivation::mEventGroups unique. r=billm
--HG--
extra : rebase_source : ffccc53b6b1055d7cfeb281ee145b897807a7810
2017-09-13 11:59:35 +08:00
Bill McCloskey
061f254d6e Bug 1398070 - Convert WillDestroyCurrentMessageLoop assertion to a safe no-op (r=dvander)
MozReview-Commit-ID: HZvW6nsvrj9
2017-09-25 15:45:24 -07:00
Nathan Froyd
5e23bf9dc1 Bug 1328634 - part 2 - use UniquePtr to manage messages inside of MessageChannel; r=billm
Using them for replies in various places would be a much larger task.
This is nice and simple.
2017-09-21 14:52:37 -05:00
Nathan Froyd
98a84baac9 Bug 1328634 - part 1 - use UniquePtr in AutoEnterTransaction; r=billm
One less use of nsAutoPtr!
2017-09-21 14:52:37 -05:00
Nathan Froyd
a697f87d36 Bug 1397823 - part 3 - do a better job setting IPC::Message flags; r=kanru
The current IPC::Message constructor takes a large number of arguments,
three of which--the nesting level, the priority, and the
compression--are almost always constant by virtue of the vast majority
of Message construction being done by auto-generated IPDL code.  But
then we take these constant values into the Message constructor, we
check them for various values, and then based on those values, we
perform a bunch of bitfield operations to store flags based on those
values.  This is wasted work.

Furthermore, for replies to IPDL messages, we'll construct a Message
object, and then call mutating setters on the Message object that will
perform even more bitfield manipulations.  Again, these operations are
performing tasks at runtime that are the same every single time, and use
information we already have at compile time.

The impact of these extra operations is not large, maybe 15-30K of extra
code, depending on platform.  Nonetheless, we can easily make them go
away, and make everything cleaner to boot.

This patch adds a HeaderFlags class that encapsulates all the knowledge
about the various kinds of flags Message needs to know about.  We can
construct HeaderFlags objects with strongly-typed enum arguments for the
various kinds of flags, and the compiler can take care of folding all of
those flags together into a constant when possible (and it is possible
for all the IPDL-generated code that instantiates Messages).  The upshot
is that we do no unnecessary work in the Message constructor itself.  We
can also remove various mutating operations on Message, as those
operations were only there to support post-constructor flag twiddling,
which is no longer necessary.
2017-09-15 08:06:11 -04:00
Bill McCloskey
505889dbf4 Bug 1396155 - Change MessageChannel ordering assertion (r=froydnj)
MozReview-Commit-ID: 9MS9svUAeYR
2017-09-07 22:31:34 -07:00
Bill McCloskey
677102393e Bug 1395330 - Release IPC lifetime assertions (r=mccr8)
MozReview-Commit-ID: 3CGjEofjojc
2017-09-06 15:28:41 -07:00
Bill McCloskey
587e22d043 Bug 1333962 - Add nsILabelableRunnable to label runnables like vsync (r=kanru)
MozReview-Commit-ID: FdvqV0LfFsz
2017-08-25 10:28:23 -07:00
Stone Shih
de7f705042 Bug 1351148 Part2: Add a priority queue for input events. r=smaug.
MozReview-Commit-ID: 5ud1Ex9UNVo
2017-03-21 15:44:12 +08:00
Stone Shih
7de447a25a Backed out changeset 46d8f42863af (bug 1351148) 2017-08-11 15:19:44 +08:00
Stone Shih
9d1d77d849 Bug 1351148 Part2: Add a priority queue for input events. r=smaug.
MozReview-Commit-ID: 5ud1Ex9UNVo
2017-03-21 15:44:12 +08:00
Eric Rahm
fe18bf0131 Bug 1386825 - Part 4: Remove remaining instances of MOZ_B2G. r=froydnj
MozReview-Commit-ID: 8r4eMwiZ4Vg
2017-08-08 14:41:09 -07:00
Jan Varga
72d235da4a Bug 1283609 - Part 1: Add an IToplevelProtocol::Open overload that takes an nsIEventTarget; r=billm 2017-08-03 11:21:44 +02:00
Carsten "Tomcat" Book
de369deb98 Backed out changeset 284af26c1b53 (bug 1351148) 2017-07-28 09:20:27 +02:00
Kartikaya Gupta
ba4b3b9101 Bug 1384233 - Remove SizePrintfMacros.h. r=froydnj
We have a minimum requirement of VS 2015 for Windows builds, which supports
the z length modifier for format specifiers. So we don't need SizePrintfMacros.h
any more, and can just use %zu and friends directly everywhere.

MozReview-Commit-ID: 6s78RvPFMzv

--HG--
extra : rebase_source : 009ea39eb4dac1c927aa03e4f97d8ab673de8a0e
2017-07-26 16:03:57 -04:00
Stone Shih
9573b6e439 Bug 1351148 Part2: Add a priority queue for input events. r=smaug.
MozReview-Commit-ID: 5ud1Ex9UNVo
2017-03-21 15:44:12 +08:00
Bill McCloskey
f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
David Anderson
aa1457713c Allow IPDL message sends to be deferred and re-sent as needed. (bug 1369529 part 2, r=billm)
--HG--
extra : rebase_source : 46d2af94da6b38e8c2fe70fd4566650d8cec8fe4
2017-06-21 13:40:18 -07:00
Carsten "Tomcat" Book
8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey
6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book
ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey
4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Bill McCloskey
82fe51e95f Bug 1366072 - Remove MessageLoopAbstractThreadWrapper (r=kanru)
MozReview-Commit-ID: 8i9QTIRbP3j
2017-06-13 14:51:09 -07:00
Bill McCloskey
13b3dd836a Bug 1371079 - Use PRThread for IPC thread safety checking (r=dvander)
MozReview-Commit-ID: 9qRiC43LuVP
2017-06-12 20:21:43 -07:00
Michael Layzell
b0485183ce Bug 1365719 - Add a IPC_SYNC_RECEIVE_MS probe to record time taken to process sync IPC messages in the target process, dr=bsmedberg, r=ehsan
MozReview-Commit-ID: 4TOlSFX68Vn
2017-05-26 16:18:28 -04:00
Bill McCloskey
b71d032b99 Bug 1363877 - Label IPC shmem messages as SystemGroup (r=dvander)
MozReview-Commit-ID: 3I5ny0wxVHI
2017-05-19 16:38:12 -07:00
Henry Chang
8091c86b7e Bug 1364857 - Reject pending promises for actor when it's going to be destroyed. r=kanru
The lifetime of async IPDL returned promise may be longer than its actor.
That is, the handler (receiver) may have not resolve/reject the promise when the actor
is destroyed. In this case, we have to reject all the pending promises before
ActorDestroy() is called on the "sender" side.

Besides, the handler (receiver) can reject with reason "ActorDestroyed" to silently
cancel the promise without trying to reply to the remote actor which may
have died. The sender-side promise is responsible for rejecting the pending promises,
which will be done in MessageChannel::RejectPendingPromisesForActor().

MozReview-Commit-ID: 4XjmquZzDBO

--HG--
extra : rebase_source : 48539e35e4587e09be1d66497b1ea32d1a95ee9a
2017-05-17 16:59:48 +08:00
Kan-Ru Chen
89fee9ade2 Bug 1362732 - Only delete AbstractThread wrapper when MessageLoop is about to destroy. r=billm
The wrapper should have the same liftime as the underlying
MessageLoop. This patch use the MessageLoop's DestructionObserver to
manage the lifetime of the wrapper.

MozReview-Commit-ID: 44ps4TKl3yQ
2017-05-11 12:22:47 +08:00
Iris Hsiao
84c8672878 Backed out changeset 690fcdc70b82 (bug 1362732) for build bustage at MessageChannel.cpp: bad implicit conversion constructor for 'AbstractThreadWrapperCleanup'
CLOSED TREE
2017-05-11 11:54:56 +08:00
Kan-Ru Chen
9fe44a8f68 Bug 1362732 - Only delete AbstractThread wrapper when MessageLoop is about to destroy. r=billm
The wrapper should have the same liftime as the underlying
MessageLoop. This patch use the MessageLoop's DestructionObserver to
manage the lifetime of the wrapper.

MozReview-Commit-ID: 44ps4TKl3yQ
2017-05-11 11:21:48 +08:00
Henry Chang
3f6c2504c6 Bug 1353159 - Use IPC_MESSAGE_SIZE2 to unify the expired IPC_MESSAGE_SIZE and MESSAGE_MANAGER_MESSAGE_SIZE2 r=billm
The new telemetry tag is for probing the best IPC message pre-allocate size to avoid
realloc overhead. We only count those message size which is greater than 4096.
This tag integrates IPC_MESSAGE_SIZE and MESSAGE_MANAGER_MESSAGE_SIZE2 which
have both expired.

MozReview-Commit-ID: GjvuidGJ7pz

--HG--
extra : rebase_source : 1da13b3f2b5b042d0445abd6051993e2fb317f93
2017-05-04 16:34:20 +08:00
Andreas Farre
7cd708c02f Bug 1322184 - Measure time spent in content JS that causes delay in paint. r=billm, data-r=bsmedberg
MozReview-Commit-ID: Iz31CKSnDdc

--HG--
extra : rebase_source : e0db2419ee2ef868d2f4d1b47d45547e55bd2036
2017-05-02 08:10:00 -04:00
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
Bill McCloskey
001f17e543 Bug 1334097 - Avoid busy waiting caused by MaybeUndeferIncall (r=aklotz)
In order to avoid a busy wait where we defer and then immediately un-defer a message,
we need to ensure that we only un-defer a message if it's actually ready to be processed.
This patch uses the same condition in MaybeUndeferIncall as we use in
DispatchInterruptMessage.

MozReview-Commit-ID: L2xZfSO0Yrk
2017-04-25 15:45:58 -07:00
Kan-Ru Chen
6c2259f717 Bug 1358697 - Don't capture the Promise raw pointer and make static analysis happy. r=billm
MozReview-Commit-ID: 7lMVMcNBDHJ

--HG--
extra : rebase_source : 3526408144e9d0486e0c212151682bc98275c8e5
2017-04-22 10:38:52 +08:00
Iris Hsiao
d838010e1d Backed out changeset 2f0e513820c0 (bug 1358697) for build bustage 2017-04-25 10:04:11 +08:00
Kan-Ru Chen
3d7756c274 Bug 1358697 - Don't capture the Promise raw pointer and make static analysis happy. r=billm
MozReview-Commit-ID: 7lMVMcNBDHJ

--HG--
extra : rebase_source : 4ea2e25c3a7e1f49a79b9b994024c00494f78047
2017-04-22 10:38:52 +08:00
Wes Kocher
cb8ce82cca Merge inbound to m-c a=merge 2017-04-19 17:10:04 -07:00
Bill McCloskey
f55aa04abd Bug 1355178 - Don't call MessageChannel::ProcessPendingRequests if we don't expect it to do anything (r=kanru)
MozReview-Commit-ID: BJBBkhaNKki
2017-04-19 11:51:14 -07:00
Bill McCloskey
fb57ac5b38 Bug 1355178 - Remove unnecessary refcounting from MessageChannel::mPending (r=froydnj)
MozReview-Commit-ID: DWEF1ObNmMa
2017-04-19 11:51:14 -07:00
Kan-Ru Chen
ffab50c6f8 Bug 1313200 - Allow IPC messages to async return MozPromises. r=billm,jwwang
This patch implements async returns for IPDL using MozPromises. There
are following changes:

* Initialize AbstractThreads for MessageLoops
* Record promises and their reject functions
  * When async message returns, call their resolve functions
  * When send error or channel close, call their reject functions
* Implement "unresolved-ipc-promises" count for about:memory
* Test cases

See bug attachment for generated code from test cases

MozReview-Commit-ID: 7xmg8gwDGaW

--HG--
rename : ipc/ipdl/test/ipdl/error/AsyncReturn.ipdl => ipc/ipdl/test/ipdl/ok/AsyncReturn.ipdl
extra : rebase_source : 9a5821d6c0e5f7152b8152a17a409b94e8258dc3
2017-03-16 17:36:15 +08:00
Bill McCloskey
a5aa8f775e Bug 1356365 - Make MessageChannel::WillDestroyCurrentMessageLoop assertion DEBUG-only (r=mccr8)
MozReview-Commit-ID: CDFEu08a9mv
2017-04-18 15:12:39 -07:00
Bill McCloskey
80a625cd1d Bug 1349699 - Assert that the Chromium channel is closed when MessageLoop is destroyed (r=dvander)
MozReview-Commit-ID: I7HyjVanlxJ
2017-04-11 13:15:09 -07:00
Bill McCloskey
cd7be5521e Bug 1349699 - Assert when destroying a MessageLoop that a live MessageChannel is attached to (r=dvander)
MozReview-Commit-ID: GGr5UqJl3ui
2017-04-11 13:15:07 -07:00
Bill McCloskey
1d90cfecff Revert "Bug 1349699 - Assert when destroying a MessageLoop that a live MessageChannel is attached to (r=dvander)"
This reverts commit 9e65608a6214fc500dd4af4822700fd1ad6e000c.
2017-04-07 16:45:02 -07:00
Bill McCloskey
ad31aeafdd Revert "Bug 1349699 - Assert that the Chromium channel is closed when MessageLoop is destroyed (r=dvander)"
This reverts commit b72a0148dd4a3e633559760c6f0394c851799073.
2017-04-07 16:44:59 -07:00
Bill McCloskey
85cf9b13c7 Bug 1349699 - Assert that the Chromium channel is closed when MessageLoop is destroyed (r=dvander)
MozReview-Commit-ID: I7HyjVanlxJ
2017-04-07 14:26:28 -07:00