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

73 Коммитов

Автор SHA1 Сообщение Дата
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
Benoit Jacob 2e685fd274 Bug 1028383 - Make ITopLevelProtocol assert to enforce its assumptions that things happen on the main thread - r=bent 2014-07-03 14:53:35 -04:00
Benoit Jacob 4a8e65915b Bug 974356 - 1/4 - Initialize mOtherProcess to an invalid handle value - r=bent 2014-02-25 08:12:49 -05:00
Ted Clancy c895425120 Bug 962344 - Log messages in IPDL should contain from/to information; Log message should go to logcat on Gonk devices. r=bent 2014-02-03 14:11:50 +01:00
Thinker Lee ext:(%2C%20Cervantes%20Yu%20%3Ccyu%40mozilla.com%3E) 42fe4d9b7d Bug 771765 - Support template content process, part 3: IPC glue and IPDL codegen to support protocol cloning. r=bent 2013-05-31 21:16:57 +08:00
David Anderson fd2cf49aa1 Combine AsyncChannel, SyncChannel, and RPCChannel into one class (bug 901789, r=cjones,bent).
--HG--
rename : ipc/glue/RPCChannel.cpp => ipc/glue/MessageChannel.cpp
rename : ipc/glue/RPCChannel.h => ipc/glue/MessageChannel.h
2013-09-27 18:42:08 -07:00
Nathan Froyd 05b3cb417a Bug 908208 - part 3 - move guts of FatalError out-of-line to ProtocolUtils.cpp; r=bent 2013-08-22 10:39:32 -04:00
David Zbarsky 9117aef526 Bug 879475 - Rename the MsgStart messages to MsgStartChild for child protocols r=jlebar 2013-08-20 15:46:41 -04:00
Nathan Froyd dbc0a775d9 Bug 897539 - uninline ProtocolErrorBreakpoint to avoid code and string bloat; r=bent 2013-07-24 12:38:24 -04:00
David Anderson 2d21f2b922 Remove unused run-to-completion feature in IPDL (bug 876989, r=cjones). 2013-07-02 11:22:18 -07:00
David Anderson 7957b611c2 Bug 868919 - Confirm that the child process has received fd handles on OSX before releasing them. r=bent 2013-06-21 09:32:02 +12:00
Chris Jones 7eb129ce82 Bug 831307: Log breakpoint-level IPC errors always. r=dougt,jdm,jst a=blocking-b2g 2013-01-16 19:47:21 -08:00
Ms2ger 711f1fd480 Bug 787933 - Stop using stdin types in IPC code; r=bsmedberg+cjones sr=cjones 2012-09-17 10:37:20 +02:00
Chris Jones 97fdaf5406 Bug 788396: Centralize usage of ipc::LoggingEnabled() and ensure it goes to logcat on bionic OSes. r=bent 2012-09-05 10:11:05 -07:00
Ben Turner 4b09919a18 Bug 781256 - 'Share FileDescriptors across processes in preparation for OS-level sandbox'. r=khuey+cjones.
--HG--
rename : netwerk/base/public/nsIIPCSerializable.idl => netwerk/base/public/nsIIPCSerializableObsolete.idl
extra : transplant_source : %EB%18%9D%E6%B1%C6%26%A2%16%F3%85g%1A%25%B1%8E%A1%E72e
2012-08-16 00:02:32 -04:00
Chris Jones f8279ab4fc Bug 775867: Implement ProtocolErrorBreakpoint() for easier debugging of IPC errors. r=bent 2012-07-23 10:24:29 -07:00
Gervase Markham 82ff7027aa Bug 716478 - update licence to MPL 2. 2012-05-21 12:12:37 +01:00