Commit Graph

350 Commits

Author SHA1 Message Date
Doug Thayer
86601b48c5 Bug 1602646 - Remove vestigial references to cooperative scheduling r=froydnj
GetCurrentPhysicalThread and GetCurrentVirtualThread are, in practice,
identical, as the TLS override that GetCurrentVirtualThread depends on
is never actually set. This simply removes that and renames some things/
deletes some comments.

Rebased across https://hg.mozilla.org/mozilla-central/rev/3f0b4e206853
by Karl Tomlinson <karlt+@karlt.net>.

Differential Revision: https://phabricator.services.mozilla.com/D41247

--HG--
extra : moz-landing-system : lando
2019-12-12 00:56:53 +00:00
Gabriele Svelto
69790bc62e Bug 1600545 - Remove useless inclusions of header files generated from IDL files in accessible/, browser/, caps/, chrome/, devtools/, docshell/, editor/, extensions/, gfx/, hal/, image/, intl/, ipc/, js/, layout/, and media/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55443

--HG--
extra : moz-landing-system : lando
2019-12-06 09:16:44 +00:00
Jim Porter
9354dfda4a Bug 1557447 - Profiler support for IPC information; r=nika,smaug
This adds the ability to add profile markers for both the sender and recipient
sides of IPC messages. These can then be correlated with one another in the
profile visualization. For the UI component of this patch, see
<https://github.com/firefox-devtools/profiler/pull/2172>.

Differential Revision: https://phabricator.services.mozilla.com/D42226

--HG--
extra : moz-landing-system : lando
2019-10-21 20:51:07 +00:00
Daniel Varga
8fdca46bc7 Backed out changeset 2923afce519a (bug 1557447) for browser chrome failure at tools/profiler/tests/browser/browser_test_feature_preferencereads.js. On a CLOSED TREE 2019-10-18 07:54:09 +03:00
Jim Porter
80bfcd6e57 Bug 1557447 - Profiler support for IPC information; r=nika
This adds the ability to add profile markers for both the sender and recipient
sides of IPC messages. These can then be correlated with one another in the
profile visualization. For the UI component of this patch, see
<https://github.com/firefox-devtools/profiler/pull/2172>.

Differential Revision: https://phabricator.services.mozilla.com/D42226

--HG--
extra : moz-landing-system : lando
2019-10-18 02:56:02 +00:00
Dorel Luca
efd52379da Backed out changeset cd4dc0ae3364 (bug 1557447) for Browser-chrome failures in build/src/obj-firefox/dist/include/mozilla/BlocksRingBuffer.h 2019-10-18 03:59:06 +03:00
Jim Porter
641b95fb72 Bug 1557447 - Profiler support for IPC information; r=nika
This adds the ability to add profile markers for both the sender and recipient
sides of IPC messages. These can then be correlated with one another in the
profile visualization. For the UI component of this patch, see
<https://github.com/firefox-devtools/profiler/pull/2172>.

Differential Revision: https://phabricator.services.mozilla.com/D42226

--HG--
extra : moz-landing-system : lando
2019-10-17 23:39:42 +00:00
Bobby Holley
1aac000114 Bug 1244247 - Remove racey sScriptSettingsTLSInitialized. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D49213

--HG--
extra : moz-landing-system : lando
2019-10-15 02:10:02 +00:00
Mihai Alexandru Michis
4e1448e7e6 Backed out 2 changesets (bug 1510226) for causing xpcshell crashes and xpcshell failures in test_TelemetrySession.js CLOSED TREE
Backed out changeset cb739de6606d (bug 1510226)
Backed out changeset b6f670610dc3 (bug 1510226)
2019-09-25 04:25:07 +03:00
Doug Thayer
65be2b22c1 Bug 1510226 - Remove vestigial references to cooperative scheduling r=froydnj
GetCurrentPhysicalThread and GetCurrentVirtualThread are, in practice,
identical, as the TLS override that GetCurrentVirtualThread depends on
is never actually set. This simply removes that and renames some things/
deletes some comments.

Differential Revision: https://phabricator.services.mozilla.com/D41247

--HG--
extra : moz-landing-system : lando
2019-08-20 18:03:11 +00:00
Olli Pettay
42aa5f2e5c Bug 1578394 - MessageTask::GetType should actually return the message type, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D44471

--HG--
extra : moz-landing-system : lando
2019-09-03 14:52:53 +00:00
Nathan Froyd
7509b5e08a Bug 1577831 - remove using namespace std; from IPC glue code; r=jld
Just some minor prefixing needs to be done to enable this.

Differential Revision: https://phabricator.services.mozilla.com/D44220

--HG--
extra : moz-landing-system : lando
2019-08-31 00:00:12 +00:00
Brian Hackett
3725f222ae Bug 1566294 - Use distinct sequence numbers for messages sent from middleman processes, r=nika.
Differential Revision: https://phabricator.services.mozilla.com/D38359

--HG--
extra : rebase_source : a7c9072d996eabc94e453267448eb2a35c89d1a1
2019-07-17 05:47:35 -10:00
Olli Pettay
5474e37783 Bug 1566459, add a way to check underlying IPC message type from runnable, r=nika
Differential Revision: https://phabricator.services.mozilla.com/D38215

--HG--
extra : moz-landing-system : lando
2019-07-16 19:21:40 +00:00
Jed Davis
ded11c124c Bug 1554244 - Tolerate multiple calls to MessageChannel::Close. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D34804

--HG--
extra : moz-landing-system : lando
2019-06-13 15:40:58 +00:00
Nika Layzell
c293c9007f Bug 1540731 - Part 1: Manage actor object lifecycles within IPC, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D28572

--HG--
extra : moz-landing-system : lando
2019-05-21 17:04:14 +00:00
Ryan Hunt
5e72855054 Bug 1523969 part 12 - Move method definition inline comments to new line in 'ipc/'. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D21112

--HG--
extra : rebase_source : f7e1461efb6f9e190dd4d9b161e2fb898aeb203a
2019-02-25 16:08:36 -06:00
Chris Peterson
8e1848413c Bug 1507049 - Rename MOZ_CRASH_UNSAFE_OOL MOZ_CRASH_UNSAFE. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D18515

--HG--
extra : rebase_source : e8ef6eec0f7542bb381e2da81ae6431b2828aabc
extra : source : a8c262b4a2579e6def1b3a5a8220f5197b443e34
2019-02-03 00:09:37 -08:00
Nathan Froyd
6bab6786bf Bug 1525031 - part 2 - remove nsILabelableRunnable::GetAffectedSchedulerGroups; r=mccr8
The previous patch removed the only caller of this method, so we can now
remove the method itself.
2019-02-04 15:33:49 -05:00
Ehsan Akhgari
e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
James Willcox
f4b85965af Bug 1354200 - Exit instead of MOZ_CRASH on channel error in child process r=jld
Android mercilessly kills the parent in low memory situations, and we
don't want that to trigger a crash when the child is abruptly
disconnected.

Differential Revision: https://phabricator.services.mozilla.com/D16234

--HG--
extra : moz-landing-system : lando
2019-01-10 22:45:44 +00:00
Nika Layzell
54f24a9804 Bug 1487249 - Part 1: Allow MessageChannel objects to be created within a thread, r=mccr8
To create a more generic interface for interacting both within the main thread
of the parent process and between the parent and child processes, it would be
nice to support IPDL actors within the main thread of the parent process. This
requires the underlying MessageChannel actor to support intra-thread links.

This change adds support for intra-thread links to the underlying MessageChannel
object using ThreadLink, and an extra boolean flag.

Differential Revision: https://phabricator.services.mozilla.com/D4620
2018-12-05 10:18:28 -05:00
Jan Varga
811dea257a Bug 1511468 - make OnChannelReceivedMessage unconditionally defined; r=froydnj 2018-11-30 22:23:30 +01:00
Tooru Fujisawa
7983faeb5d Bug 1511393 - Use c-basic-offset: 2 in Emacs mode line for C/C++ code. r=nbp 2018-12-01 04:52:05 +09:00
Benjamin Bouvier
a7f1d173a0 Bug 1511383: Update vim modelines after clang-format; r=sylvestre
- modify line wrap up to 80 chars; (tw=80)
- modify size of tab to 2 chars everywhere; (sts=2, sw=2)

--HG--
extra : rebase_source : 7eedce0311b340c9a5a1265dc42d3121cc0f32a0
extra : amend_source : 9cb4ffdd5005f5c4c14172390dd00b04b2066cd7
2018-11-30 16:39:55 +01:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Ehsan Akhgari
ca162bee20 Bug 1508472 - Part 4: Fourth batch of comment fix-ups in preparation for the tree reformat r=sylvestre
This is a best effort attempt at ensuring that the adverse impact of
reformatting the entire tree over the comments would be minimal.  I've used a
combination of strategies including disabling of formatting, some manual
formatting and some changes to formatting to work around some clang-format
limitations.

Differential Revision: https://phabricator.services.mozilla.com/D13193

--HG--
extra : moz-landing-system : lando
2018-11-28 09:16:55 +00:00
Brian Hackett
579aa6d5df Bug 1503639 Part 7 - Remove instrumentation used to avoid taking locks after diverging from the recording, r=mccr8.
--HG--
extra : rebase_source : 4e08b46ebbe78ab175fd5a6b3e13da19b756f673
2018-10-31 10:23:23 -10:00
Jed Davis
859f503587 Bug 1498765 - Clean up ContentParent::KillHard handling. r=mccr8
MessageChannel shouldn't need to care about PContent-specific details.
2018-10-19 15:29:34 -06:00
Brian Hackett
c1fc84be7c Bug 1488808 Part 16 - Avoid deadlocking in a few places after diverging from the recording, r=froydnj.
--HG--
extra : rebase_source : 2327cd9632cdc9ace793f9e9fea666d95f305201
2018-10-17 10:15:41 -06:00
Brian Hackett
1561d566c9 Bug 1486609 - Ignore message priorities in recording/replaying processes, r=mccr8.
--HG--
extra : rebase_source : 1d74a58a6bf8ef02497bf778b0c428499a9f40d8
2018-08-31 05:34:18 -10:00
Brian Hackett
9444619b6c Bug 1481346 - Fix problems when forwarding sync messages in the middleman, r=mccr8.
--HG--
extra : rebase_source : 38dfeca916baf25166fea246b94c26a14bf24827
2018-08-14 00:30:09 +00:00
Gabriele Svelto
15adf94f4d Bug 1348273 - Convert crash annotations into a machine-readable list of constants; r=ted.mielczarek,njn,dholbert,mak,cpearce,mcmanus,froydnj,Dexter,jrmuizel,jchen,jimm,bz,surkov
This introduces the machinery needed to generate crash annotations from a YAML
file. The relevant C++ functions are updated to take a typed enum. JavaScript
calls are unaffected but they will throw if the string argument does not
correspond to one of the known entries in the C++ enum. The existing whitelists
and blacklists of annotations are also generated from the YAML file and all
duplicate code related to them has been consolidated. Once written out to the
.extra file the annotations are converted in string form and are no different
than the existing ones.

All existing annotations have been included in the list (and some obsolete ones
have been removed) and all call sites have been updated including tests where
appropriate.

--HG--
extra : source : 4f6c43f2830701ec5552e08e3f1b06fe6d045860
2018-07-05 15:42:11 +02:00
Jed Davis
dc17388589 Bug 1462168 - Report number of IPC channels in about:memory. r=mccr8
This adds an about:memory branch, "ipc-channels", which counts
cross-process IPC channels (ProcessLink, IPC::Channel) broken down by
the top-level IPDL actor name; these use OS resources which may be
limited (file descriptors on Linux and Mac).  Intra-process use of IPC
(ThreadLink) is not counted.

The maximum channel count for each actor type is reported in another
branch, "ipc-channels-peak".  This might be useful if there are
conditions that cause transient fd exhaustion, for example.

This patch also works around a problem where MessageChannel was trying
to register reporters too early in child processes, and failing.

MozReview-Commit-ID: CGEwny2ipcu

--HG--
extra : rebase_source : ad526f03bbef891f4474225a8e36a7ed9e3acdab
2018-07-19 17:48:05 -06:00
Emilio Cobos Álvarez
fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Eric Rahm
4e0fc495d6 Bug 1364624 - Part 1: Manually manage locks in MessageChannel::Close. r=froydnj
This switches over to manually managing the locking in MessageChannel::Close
in order to avoid a deadlock on msvc opt builds. It has the added benefit of
avoid a superfluous lock/unlock pair.

--HG--
extra : rebase_source : f3b0ee5499bd75bc75b3d1fe44c0c7efd3063aee
2018-04-26 17:14:22 -07:00
Stephen A Pohl
860c14b396 Bug 1366808: Properly detect buildID mismatches between parent and child processes and display about:restartrequired to prompt the user to restart Firefox before proceeding. r=jimm,felipe,bz 2018-05-08 10:31:44 -04:00
Chris Peterson
71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
Nathan Froyd
9eac324691 Bug 1451363 - part 3 - make OnChannelReceivedMessage defined in early beta only; r=mccr8
This function is only overriden in two places, both of which go away
after early beta is done.  We shouldn't be paying for its vtable entry
after that point.
2018-04-23 14:13:37 -04:00
Stephen A Pohl
484e9fd139 Bug 1423261: Skip intentionally crashing the browser during KillHard shutdowns. r=jimm 2018-04-17 21:38:22 -04:00
Nika Layzell
0c3ba13e4c Bug 1437167 - Part 1: Stop using PRIntervalTime as the argument to CondVar::Wait and Monitor::Wait, r=mstange, r=froydnj 2018-04-10 17:49:47 -04:00
Andreea Pavel
26f640b36b Backed out 4 changesets (bug 1366808) for Windows GPU leakchecks on a CLOSED TREE
Backed out changeset 23f60e5acaa2 (bug 1366808)
Backed out changeset bf2262b6aca8 (bug 1366808)
Backed out changeset 1fc82af3a155 (bug 1366808)
Backed out changeset 0649f0d9884b (bug 1366808)
2018-04-10 05:11:36 +03:00
Stephen A Pohl
b40a23754c Bug 1366808: Properly detect buildID mismatches between parent and child processes and display about:restartrequired to prompt the user to restart Firefox before proceeding. r=jimm,felipe,bz 2018-04-09 20:16:31 -04:00
Nathan Froyd
94df69d8f2 Bug 1448053 - be more efficient in MessageChannel::RepostAllMessages; r=jld
Once we've figured out that some task needs to be reposted, there's no
reason to continue scanning the list to find other tasks that need to be
reposted, since the logic in this function just requires one task that
needs to be reposted.
2018-03-23 09:40:53 -04:00
Stephen A Pohl
b495992a03 Bug 1423261: Submit IPC protocol names in shutdown crash reports in a way that Socorro is able to display. r=jimm 2018-03-12 11:11:44 -04:00
Stephen A Pohl
562c70ab11 Bug 1423261: Diagnostics patch to obtain more info about the IPC channel state when we expect it to be closed. r=jimm 2018-03-01 11:41:34 -05:00
Gabriele Svelto
ef3b2f88cc Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm
MozReview-Commit-ID: 4mDW7cJqHDn

--HG--
extra : rebase_source : 17c51ed796733d4a512e1d6f47273318dcc26b11
2017-10-10 12:06:35 +02:00
shindli
fb855aa7ba Backed out 16 changesets (bug 1402519) for conflicts during merge r=backout on a CLOSED TREE
Backed out changeset 07fcf163241a (bug 1402519)
Backed out changeset c6d2ad45d8e2 (bug 1402519)
Backed out changeset 8a3caca61294 (bug 1402519)
Backed out changeset 01425eae2c48 (bug 1402519)
Backed out changeset cf298d3815de (bug 1402519)
Backed out changeset e1964f4389cd (bug 1402519)
Backed out changeset f405337f3569 (bug 1402519)
Backed out changeset a76356fd3359 (bug 1402519)
Backed out changeset d3bb350d1c34 (bug 1402519)
Backed out changeset 9d3bfd9f932c (bug 1402519)
Backed out changeset e3dd6e5b073f (bug 1402519)
Backed out changeset e801b0c00134 (bug 1402519)
Backed out changeset 8a4139fa5dca (bug 1402519)
Backed out changeset 8d01c14ac1ca (bug 1402519)
Backed out changeset 24e0dcd01898 (bug 1402519)
Backed out changeset f8fdf450613f (bug 1402519)
2017-11-23 00:11:44 +02:00
Gabriele Svelto
f0b9eb9ff9 Bug 1402519 - Remove MOZ_CRASHREPORTER directives from ipc; r=billm
MozReview-Commit-ID: 4mDW7cJqHDn

--HG--
extra : rebase_source : a13301f4faea301cd528179790f2430171f59a48
2017-10-10 12:06:35 +02: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