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

163 Коммитов

Автор SHA1 Сообщение Дата
Nika Layzell 8c139d50a6 Bug 1418048 - Part 2: Pass callbacks by rvalue reference when possible, a=bustage
MozReview-Commit-ID: 4KsbRJ9AEdB
2017-11-20 18:12:21 -05:00
Nika Layzell a7666fd8fe Bug 1418048 - Add a callback-based Send API to async returning IPDL methods, r=billm
Currently if you write an async IPDL method which has a return value, we expose
a SendXXX method which returns a MozPromise. This MozPromise can then be
->Then-ed to run code when it is resolved or rejected.

Unfortunately, using this API loses ordering guarantees which IPDL provides.
MozPromise::Then takes an event target, which the resolve runnable is dispatched
to. This means that the resolve callback's code doesn't have any ordering
guarantees relative to the processing of other IPC messages coming over the same
protocol.

This adds a new overload to SendXXX with two additional arguments, a lambda
callback which is called if the call succeeds, and a lambda callback which is
called if the call fails. These will be called in order with other IPC messages
sent over the same protocol.

MozReview-Commit-ID: FZHJJaSDoZy
2017-11-20 17:55:32 -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
Wes Kocher 68149d6a59 Merge inbound to central, a=merge
MozReview-Commit-ID: 3N9jinnrmjb
2017-08-25 16:21:57 -07:00
Gabriele Svelto 7387dc791b Bug 1393435 - Remove unnecessary inclusions of the crash reporter header files; r=mconley
MozReview-Commit-ID: 3tdFDrTYql8

--HG--
extra : rebase_source : cc862688f19afb8a5cf8c7cf915a5d3d45f041b5
2017-08-07 14:10:02 +02: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
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
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
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
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
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
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
Sebastian Hengst 45fe002ab2 Backed out changeset 325bf1bf5a1f (bug 1313200) for Android and reftest bustage. r=backout
--HG--
rename : ipc/ipdl/test/ipdl/ok/AsyncReturn.ipdl => ipc/ipdl/test/ipdl/error/AsyncReturn.ipdl
2017-04-18 18:24:56 +02:00
Kan-Ru Chen 625b54086e 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 : 55c4f68a3f8b7d0df5ca9f9c45b9a205b337282d
2017-03-16 17:36:15 +08: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 4af4d4de77 Bug 1349699 - Assert when destroying a MessageLoop that a live MessageChannel is attached to (r=dvander)
MozReview-Commit-ID: GGr5UqJl3ui
2017-04-07 14:26:28 -07:00
Phil Ringnalda 3c97553fda Backed out 2 changesets (bug 1349699) for Win8 opt xpcshell crashes at mozilla::ipc::MessageChannel::WillDestroyCurrentMessageLoop
Backed out changeset 5cc766c0864e (bug 1349699)
Backed out changeset 13f1d3918fe5 (bug 1349699)
2017-04-03 22:54:59 -07:00
Bill McCloskey 754aae1913 Bug 1349699 - Assert when destroying a MessageLoop that a live MessageChannel is attached to (r=dvander)
MozReview-Commit-ID: GGr5UqJl3ui
2017-04-03 21:54:19 -07:00
Phil Ringnalda 884bc64271 Backed out 3 changesets (bug 1349699) for Android mozilla::ipc::MessageChannel::WillDestroyCurrentMessageLoop crashes
Backed out changeset 8a50c2d76afc (bug 1349699)
Backed out changeset 3b9eadd61e26 (bug 1349699)
Backed out changeset 16e000b3fe0c (bug 1349699)
2017-04-03 21:07:49 -07:00
Bill McCloskey c3bd8c6e5b Bug 1349699 - Assert when destroying a MessageLoop that a live MessageChannel is attached to (r=dvander)
MozReview-Commit-ID: GGr5UqJl3ui
2017-04-03 19:41:13 -07:00
Andrew McCreight b46bfc918b Bug 1345978, part 2 - Check build ids early in content startup. r=billm
If Firefox is updated while it is running, the content process can end
up being a different version than the parent process. This can cause
odd crashes, that will happen repeatedly until the user restarts
Firefox. To handle this better, this patch adds a special build ID
message that is sent early in content process startup. The parent
process intentionally crashes if the build ID for the child process
does not match that of the parent process.

MozReview-Commit-ID: 7D3ggkaLxNS

--HG--
extra : rebase_source : 1f8d917ce01919524f949dd5bedfbbbd557f7ed3
2017-03-10 17:01:38 -08:00
Andrew McCreight 555143e1cb Bug 1334228 - Add separate assertions for message channels that haven't been opened. r=kanru
MozReview-Commit-ID: KqNdMEPieCk

--HG--
extra : rebase_source : af4918008ac447bb577bf69f1a0b087ea4f27481
2017-01-26 11:48:54 -08:00
Bill McCloskey ef3d0f1c2e Bug 1331804 - Add more runnable names (r=ehsan)
MozReview-Commit-ID: 1QBmqfgY6WI
2017-01-24 16:34:37 -08:00
Wes Kocher f7ccafcb58 Backed out 8 changesets (bug 1331804, bug 1332100) for windows vm debug dt5 failures a=backout
Backed out changeset 8bf7f0e27c6c (bug 1331804)
Backed out changeset 600c0b9026c2 (bug 1331804)
Backed out changeset 3a5b5b9ecace (bug 1331804)
Backed out changeset c76432c9954e (bug 1331804)
Backed out changeset 46a9096745e7 (bug 1332100)
Backed out changeset 8b751230fa23 (bug 1331804)
Backed out changeset 2810212347fd (bug 1331804)
Backed out changeset be72b7763910 (bug 1331804)

MozReview-Commit-ID: Ywdsr4GZ4a
2017-01-24 15:12:21 -08:00
Bill McCloskey 80aaeed2fc Bug 1331804 - Add more runnable names (r=ehsan)
MozReview-Commit-ID: 1QBmqfgY6WI
2017-01-24 10:04:55 -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
Kan-Ru Chen f8100451db Bug 1314254 - Add mozilla::ipc::IPCResult type and convert IPDL handlers to use new return type. r=billm
We will use the new type for the generated IPDL message handler
prototype to make sure correct error handling method is called.

MozReview-Commit-ID: AzVbApxFGZ0
2016-11-15 04:26:00 +01:00
Bill McCloskey 81c169c2a9 Bug 792652 - Remove methods from MessageListener (r=dvander)
With this change, MessageChannel stores mListener as an IToplevelProtocol
rather than a MessageListener (which isn't really a useful concept on
its own). The MessageListener methods are split out to IProtocol and
IToplevelProtocol. MessageListener gets deleted. Some of the inline
functions in MessageChannel had to be moved to MessageChannel.cpp since
IToplevelProtocol isn't defined in MessageChannel.h.
2016-11-08 15:22:36 -08:00
Wes Kocher 4b3d16605a Backed out 18 changesets (bug 792652) for build bustage on linux64 a=backout CLOSED TREE
Backed out changeset 90eaf6aec002 (bug 792652)
Backed out changeset ddd915ab4a48 (bug 792652)
Backed out changeset 95eff6c45cae (bug 792652)
Backed out changeset 75855b5a9ab9 (bug 792652)
Backed out changeset b658ebaad5d7 (bug 792652)
Backed out changeset 2ba36b8ac60c (bug 792652)
Backed out changeset 94fcd3bf3f34 (bug 792652)
Backed out changeset cf9c4164eb43 (bug 792652)
Backed out changeset 59e6d0a4f35b (bug 792652)
Backed out changeset bdf86b8b9c43 (bug 792652)
Backed out changeset 8edf4b247250 (bug 792652)
Backed out changeset 63a3c8e4016e (bug 792652)
Backed out changeset e3e496eab991 (bug 792652)
Backed out changeset 5a1e3136323a (bug 792652)
Backed out changeset dbbe3a8c00e7 (bug 792652)
Backed out changeset 1829d5358808 (bug 792652)
Backed out changeset 004cd692ba6d (bug 792652)
Backed out changeset 92e7fee81fa2 (bug 792652)
2016-11-08 12:05:28 -08:00
Bill McCloskey 1f23e3694d Bug 792652 - Remove methods from MessageListener (r=dvander)
With this change, MessageChannel stores mListener as an IToplevelProtocol
rather than a MessageListener (which isn't really a useful concept on
its own). The MessageListener methods are split out to IProtocol and
IToplevelProtocol. MessageListener gets deleted. Some of the inline
functions in MessageChannel had to be moved to MessageChannel.cpp since
IToplevelProtocol isn't defined in MessageChannel.h.
2016-11-08 11:32:26 -08:00
Olli Pettay cb803253a5 bug 1306591, add secondary event queue to let high priority messages to be processed sooner, r=billm
--HG--
extra : rebase_source : 2ce6e06783e399e787d0445943f9f39bcef1cc22
2016-11-08 14:05:45 +02:00
Bill McCloskey 50e4d05346 Bug 1312960 - Associate each message in IPC queue with the runnable that will run it (r=dvander) 2016-10-30 22:04:03 -07:00
Bill McCloskey a054d4a461 Bug 1312960 - Remove FlushPendingInterruptQueue (r=dvander) 2016-10-30 22:04:02 -07:00
Bill McCloskey 9244a5787d Bug 1312960 - Use CancelableRunnable for mOnChannelConnectedTask (r=dvander) 2016-10-30 22:04:02 -07:00
Ting-Yu Chou 8b0030d0e6 Bug 1312326 - Use StringFromIPCMessageType() instead for better crash annotation. r=kanru
MozReview-Commit-ID: 1kElBr0X6W

--HG--
extra : rebase_source : 0c4ba3a1345ab4c0165b69b28591e4cedf8249ff
2016-10-24 12:35:19 +08:00
Ting-Yu Chou 7d65559dd1 Bug 1301022 - Add an API for annotating pending IPC messages. r=ted
MozReview-Commit-ID: GiAMUnjYjvI

--HG--
extra : rebase_source : a40f81a4878205b5edb71ca8ec2f24dc35c677eb
2016-09-20 14:10:43 +08:00
Ting-Yu Chou 35c5bba61c Bug 1301022 - Back out crash annotations which doesn't work in child process. r=me
MozReview-Commit-ID: BMq1lxwDO2u
2016-10-03 10:08:11 +08:00
Bill McCloskey f478d1188c Bug 1306708 - Rename prio to nested in IPDL (r=dvander) 2016-10-04 20:34:54 -07:00
Bill McCloskey b83db28a45 Revert "Bug 1306708 - Rename prio to nested in IPDL (r=dvander)" on a CLOSED TREE
This reverts commit b1460c626078afbb9290e7d9ecaf3af605d5e893.
2016-10-04 15:55:19 -07:00
Bill McCloskey eddd80027c Bug 1306708 - Rename prio to nested in IPDL (r=dvander) 2016-10-04 15:28:14 -07:00