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

89 Коммитов

Автор SHA1 Сообщение Дата
Bill McCloskey 5dee271cac Bug 792652 - IToplevelProtocol refactoring (r=dvander)
Currently toplevel protocols inherit from both IProtocolManager<IProtocol>
and IToplevelProtocol. This change makes IToplevelProtocol inherit from
IProtocol, so now toplevel protocols only inherit from
IToplevelProtocol.
2016-11-08 11:32:25 -08:00
Bill McCloskey 2dc5f495db Bug 792652 - Simplify IPDL type hierarchy (r=dvander)
Currently all our protocols inherit from IProtocolManager<IProtocol>. I have
no idea why. This patch switches everything over to IProtocol, without any
templates. I had to move ReadActor to the .cpp file to avoid redefinition
errors.
2016-11-08 11:32:24 -08:00
Bill McCloskey 1a00da8679 Bug 792652 - Get rid of CloneProtocol (r=dvander)
CloneProtocol is leftover code from Nuwa. We can remove it now.
2016-11-08 11:32:23 -08:00
Kan-Ru Chen 4364802eff Bug 1309799 - Generate StringFromIPCMessageType and use it in MessageChannel::MaybeHandleError. r=billm
MozReview-Commit-ID: HSuAAM0JdjS

--HG--
extra : rebase_source : 0181275a9631f343aedd5a683911d7909fcb5866
2016-10-13 14:18:45 +08:00
Matt Woodrow a8c2c8fb5b Bug 1297826 - Make FatalError virtual on IPDL generated classes, and propagate calls up to top-level protocols. r=billm 2016-10-04 21:31:25 +13:00
David Anderson df6a78744b Allow passing an empty Endpoint over IPDL. (bug 1302009, r=billm) 2016-09-19 19:18:20 -07:00
Nathan Froyd 29e8bfeb34 Bug 1299594 - part 2 - remove opened actor tracking from IToplevelProtocol; r=billm
The only thing we needed opened actor tracking for was the ability to
clone all the actors.  But now that we no longer have support for
cloning actors, we no longer need to track the actors that we've cloned,
which makes a number of things significantly simpler.
2016-09-02 16:13:50 -04:00
Nathan Froyd fff9bd3854 Bug 1299594 - part 1 - remove CloneManagees/CloneToplevel code from IPDL; r=billm
CloneOpenedToplevels, which is never called, is the only interesting
caller of CloneToplevel.  And CloneToplevel, in turn, is the only
interesting caller of CloneManagees.  Which means we can ditch all this
code for a decent amount of space savings, both in code and writable
static data (no more useless virtual function entries in vtables).
2016-09-02 16:13:50 -04:00
Nathan Froyd 72439d5587 Bug 1297801 - part 3 - make mozilla::ipc::Trigger 4 bytes instead of 8; r=billm
We construct Trigger structures for every IPDL send and recv to run
the (currently defunct) IPDL state machine for each protocol.  These
structures are 64 bits to hold an enum that could be represented in 1
bit and an IPDL message enum that can easily be represented in 31 bits.
Therefore, we can make the Trigger structure smaller by storing the
members as bitfields, rather than full-width integers.  (The message
enums are formed from a 16-bit protocol enum and a 16-bit
protocol-specific message enum; since the protocol enum goes in the
upper bits, we'd need 32768 protocols to overflow the bitfield we're
using in Trigger...a number that we're not going to hit anytime soon.)

This change saves ~15K of space on x86-64 Linux.
2016-08-29 20:41:22 -04:00
Nathan Froyd a8474a5f11 Bug 1297801 - part 1 - commonize the managee->array functions in IPDL generated code; r=billm
There's no reason to generate identical code for every kind of managed
protocol; we can have a single instance that operates on void* and cast
our way to victory.  This change saves ~60K of text on x86-64 Linux.
2016-08-29 20:41:22 -04:00
David Anderson a8c8bf4196 Add crash-report instrumentation to diagnose bug 1293580. r=billm 2016-08-22 22:52:04 -07:00
Cervantes Yu 8a084acd4c Bug 1266440 - Remove diagnostic funciton mozilla::ipc::AnnotateProcessInformation() that contains PII. r=krizsa
MozReview-Commit-ID: AJyNT68zJlF
2016-08-01 18:41:09 +08:00
David Anderson 6aca1d9865 Use Endpoints for content-process ImageBridges. (bug 1287366 part 2, r=billm)
--HG--
extra : rebase_source : 388c44e8df0ff45eb32e12d2b98c654cb0592bf0
2016-07-20 00:18:30 -07:00
David Anderson e6a98dc91b Clean up Transport memory management in IPDL. (bug 1283744, r=billm) 2016-07-06 18:51:20 -07:00
Cervantes Yu 3115f628a1 Bug 1272018 - Use shared memory to transfer drag image data. r=nical
MozReview-Commit-ID: K5r9LBQ1FO0
2016-06-15 13:49:13 +01:00
Bill McCloskey 291c555f34 Bug 1262671 - void** -> PickleIterator (r=froydnj) 2016-05-27 09:57:38 -07:00
Nathan Froyd a5f42fc63a Bug 1262937 - part 8 - factor out array length deserialization errors; r=jld 2016-05-21 04:07:56 -04:00
Nathan Froyd 647562c2d2 Bug 1262937 - part 7 - factor out union type deserialization errors; r=jld 2016-05-21 04:07:56 -04:00
Nathan Froyd dcc74a62c9 Bug 1262937 - part 5 - factor out actor reading code to a common base class; r=jld
Actor reading from IPC message is codegen'd with a lot of repeated code.
We can improve that by moving the core actor reading code out of
subclasses into IProtocolmanager.  While we still need to codegen a bit
of code to cast the read actor to the proper type, the code overall is
smaller.  The lone downside is that if we do encounter an error reading
the actor id out of the message, the precision of our crash messages is
reduced somewhat: we no longer have the protocol name doing the reading,
nor do we get crash report annotations, since we can't tell whether
we're in the parent or child process.
2016-05-21 04:07:56 -04:00
Nathan Froyd bdd874023f Bug 1262937 - part 4 - publically inherit from MessageListener in IProtocol; r=jld
IProtocolManager is templated over some listener type.  In our IPDL
code, that type is always IProtocol, which is a subclass of
MessageListener.  It's also important to note that IProtocol uses
protected inheritance from MessageListener; the generated code takes
advantage of this inheritance structure when it reads actors:

  // ChannelListener is typedef'd to MessageListener
  // Lookup here is IProtocolManager::Lookup
  ChannelListener* listener = Lookup(id);

Lookup returns a pointer to the type over which IProtocolManager is
templated.  As mentioned above, that type is always IProtocol.  But
thanks to the containing class inheriting from *both* IProtocolManager
and IProtocol, the returned pointer can be silently upcasted to
MessageListener thanks to C++ visibility rules.

It's not clear that this restricted inheritance structure is actually
benefitting anybody, or that the inheritance hierarchy of protocol
classes is the best way to do things.  This particular implementation
detail is getting in the way for the next improvement, so let's make the
protected inheritance public instead.
2016-05-21 04:07:56 -04:00
Cervantes Yu a7ec2e32a7 Bug 1258317 - Part 1: Annotate the crash report with process information on failure to transfer an IPC transport to another process. r=krizsa
MozReview-Commit-ID: LE2FnrQgzze

--HG--
extra : rebase_source : ff891052985ae8411725f7df7c21eaacae84732f
2016-04-19 19:08:55 +08:00
Nathan Froyd 8d0d4b9bbd Bug 1262463 - part 3 - out-of-line NS_RUNTIMEABORT calls in IPDL-generated code; r=jld
We do this for the same reasons outlined in part 1: calls to
NS_RUNTIMEABORT are rather large and we generate a lot of them (~1000
left after part 1).  This patch reduces .text size by ~20K on x86-64
Linux.
2016-04-06 10:53:06 -04:00
Nathan Froyd a21ccf2f8e Bug 1262463 - part 2 - don't pass the other process pid into FatalError; r=jld
We don't do anything with it in terms of error reporting, we pass in 0
in the child process, and if you're in a debugger, presumably you can
figure out the other process's PID yourself.
2016-04-06 10:31:21 -04:00
Nathan Froyd 63fe89bd2e Bug 1259428 - part 1 - don't call Log methods of generated method classes; r=jld
The first step to eliminating all the generated Message subclasses the
IPDL compiler spits out is to move the functionality of their Log
methods someplace else.  In addition to eliminating the need for the Log
methods, this change has the welcome effect of moving a bunch of code
that would be generated hundreds of times into a single place, which
should reduce code size a bit (debug builds only).  We don't actually
remove the generation of the Log methods; that change will be done for a
future patch.
2016-03-25 17:02:38 -04:00
Cervantes Yu f77c0e8c25 Bug 1258663 - Crash annotate system call failures in the IPC transport. r=gabor 2016-04-01 14:33:52 +08:00
Lee Salzman f5674ca6c2 Bug 1245241 - part 3 - remove unused AdoptShmem from IPDL. r=billm 2016-02-18 10:56:15 -05:00
Bill McCloskey 7372bc6dda Bug 1236635 - Fix compile error in IPC unit tests (r=jld) 2016-01-05 21:59:46 -08:00
Bill McCloskey 87cc880767 Bug 1223240 - Make it easier to set up top-level protocols (r=jld) 2015-12-23 12:29:39 -08:00
Randell Jesup f955d91200 Bug 1226200: Don't assume a TCPSocket has only one managee (and rename LoneManagedOrNull) r=jdm 2015-12-22 10:14:23 -05:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Nathan Froyd fe57e31ffe Bug 1212027 - part 7 - modify IPDL codegen to store sub-protocols in a hashtable rather than an array; r=jld,nical,cpearce,billm 2015-10-07 14:30:33 -04:00
Nathan Froyd 835e1550cb Bug 1212027 - part 5 - add LoneManagedOrNull for simplifying a lot of upcoming code; r=jld
A lot of existing code has variations on:

  if (ManagedPFooChild().Length()) {
    ...(ManagedPFooChild()[0])...
  }
  // Do something with nullptr, or some other action.

It's pretty reasonable to repeat this code when the managed protocols
are stored in an array; the code gets much less nice when managed
protocols are stored in a hashtable.  Let's write a small utility
function to handle those details for us.  Then when we change the
underlying storage, we only need to update this function, rather than a
bunch of callsites.

ProtocolUtils.h is included by all the generated IPDL headers, so
LoneManagedOrNull should be available everywhere the above pattern would
be encountered.
2015-10-07 20:15:56 -04:00
Cervantes Yu 3c09a9761d Bug 1166207 - Load preload.js in the Nuwa process. r=khuey
--HG--
extra : rebase_source : 292c5e5dbee5fa49a78fd1997d97094ef2190143
2015-08-28 17:57:44 +08:00
Birunthan Mohanathas a8939590de Bug 1182996 - Fix and add missing namespace comments. rs=ehsan
The bulk of this commit was generated by running:

  run-clang-tidy.py \
    -checks='-*,llvm-namespace-comment' \
    -header-filter=^/.../mozilla-central/.* \
    -fix
2015-07-13 08:25:42 -07:00
Jim Mathies 9a5c8328b9 Bug 1128454 - Add crash report annotations for plugin bridge operation failures. r=billm 2015-07-09 19:07:49 -05:00
Bill McCloskey 64b777ec3f Bug 1177013 - CancelCurrentTransaction IPC support (r=dvander) 2015-07-06 19:58:44 -07:00
Phil Ringnalda 166cfe8460 Back out 12 changesets (bug 1177013) on suspicion of causing b2g emulator debug test bustage
CLOSED TREE

Backed out changeset 912aae0815f8 (bug 1177013)
Backed out changeset 3b6448172e50 (bug 1177013)
Backed out changeset 2af18bef5703 (bug 1177013)
Backed out changeset e6bf35115c11 (bug 1177013)
Backed out changeset 4d7f5205b60b (bug 1177013)
Backed out changeset f7de893911bc (bug 1177013)
Backed out changeset de79eba232f0 (bug 1177013)
Backed out changeset 978a77b60f2a (bug 1177013)
Backed out changeset f5b52fa19511 (bug 1177013)
Backed out changeset e14a7b70b6fa (bug 1177013)
Backed out changeset d0f5a3474659 (bug 1177013)
Backed out changeset bff9f07dad52 (bug 1177013)
2015-07-02 22:08:54 -07:00
Bill McCloskey 44dfabe655 Bug 1177013 - CancelCurrentTransaction IPC support (r=dvander) 2015-07-02 17:18:10 -07:00
Andrew McCreight 470cef59ea Bug 1169382 - Don't generate commented out NS_INTERFACE_CLASS or NS_ABSTRACT_CLASS in IPDL. r=billm 2015-06-06 14:37:59 -07:00
Michael Layzell 4dc87f0a9b Bug 1167396 - Make ProtocolCloneContext::mContentParent a smart pointer. r=bent 2015-05-22 10:10:00 -04:00
Bob Owen 283c8df550 Bug 1149971 Part 2: Cet rid of kCurrentProcessId as it makes lots of static initializers. r=dvander 2015-04-01 13:59:20 +01:00
Bob Owen e4f543bb58 Bug 1119878 Part 2: Change IPC code to hold ProcessID instead of ProcessHandle. r=billm, r=dvander, r=aklotz, r=cpearce 2015-04-01 09:40:35 +01:00
Bill McCloskey e26a687773 Bug 1121676 - Use a lock to protect the list of top-level actors (r=bent) 2015-03-20 12:02:41 -07:00
Bill McCloskey 4cedc603cb Bug 1050604 - Get IPDL tests passing again (r=bent) 2014-08-20 12:49:11 -07:00
Bill McCloskey be42be0ea4 Bug 1051128 - Allow filtering the IPC log by toplevel protocol name (r=bent) 2014-08-20 12:49:11 -07:00
Ehsan Akhgari c8380d74dd Bug 1045067 - Fix some bad implicit constructors in dom/content/ipc; r=smaug 2014-07-28 13:17:51 -04:00
Benoit Jacob fed8dee123 Bug 1028383 - Make ITopLevelProtocol assert to enforce its assumptions that things happen on the main thread - r=bent 2014-07-04 14:04:13 -04:00
Benoit Jacob 15eb88c866 back out bug 774388 and bug 1028383 for intermittent e10s mochitest-2 crashes 2014-07-04 21:24:32 -04:00
Benoit Jacob cf08ba484c Bug 1028383 - Make ITopLevelProtocol assert to enforce its assumptions that things happen on the main thread - r=bent 2014-07-04 14:04:13 -04:00
Ryan VanderMeulen 6d9424856d Backed out 10 changesets (bug 1033358, bug 774388, bug 1028383) for causing frequent shutdown crashes on a CLOSED TREE.
Backed out changeset a54b05c9e4a1 (bug 1028383)
Backed out changeset 37985f79e0c2 (bug 774388)
Backed out changeset d07521729077 (bug 774388)
Backed out changeset 9f14b17f358c (bug 774388)
Backed out changeset 2d347d6aa9bc (bug 774388)
Backed out changeset 99581dfb5ec4 (bug 774388)
Backed out changeset 2532e22d6135 (bug 774388)
Backed out changeset 719844108f1a (bug 774388)
Backed out changeset 7829c78348a4 (bug 1033358)
Backed out changeset c571df9a85de (bug 1033358)
2014-07-03 20:37:05 -04:00