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

652 Коммитов

Автор SHA1 Сообщение Дата
Jed Davis 7e91f65f43 Bug 1191452 - Limit IPDL-generated Move()s to Recv methods. r=billm
Specifically, it's important not to try to use Move() in the
Alloc+SendConstructor convenience method, because that Move()s the same
value twice (as discovered in bug 1186706), and neither callee
requires rvalue references in that case anyway.

This also removes the previous feature of calling makeCxxArgs with
params=0 to omit the message's input parameters, because it's not being
used and doesn't appear to have ever been used; it could be restored
(e.g., as paramsems=None) if needed.
2016-05-11 09:37:00 +02:00
Kyle Huey c1f8ae3c88 Bug 1268313: Fix up IPDL tests. r=billm 2016-05-09 11:00:31 -07:00
Kyle Huey b15d2f593c Bug 1266595: Followup to fix IPDL tests. r=billm
--HG--
extra : rebase_source : a0142b175ef1e0d46a6139dccdbdb8b7debda1c9
2016-05-03 22:36:50 -07:00
Andrew McCreight a1f8b0904f Bug 1269365, part 3 - Use infallible array allocation in implementSpecialArrayPickling. r=froydnj
As with part 2, this will turn some allocation failures during
deserialization from IPC FatalError crashes into OOM crashes.
2016-05-03 09:29:39 -07:00
Nicholas Nethercote 2511b2c327 Bug 1267550 (part 2) - Rename MOZ_WARN_UNUSED_RESULT as MOZ_MUST_USE. r=froydnj.
It's an annotation that is used a lot, and should be used even more, so a
shorter name is better.

MozReview-Commit-ID: 1VS4Dney4WX

--HG--
extra : rebase_source : b26919c1b0fcb32e5339adeef5be5becae6032cf
2016-04-27 14:16:50 +10:00
Andrea Marchesini a9b65ecfb0 Bug 1261094 - Improve how MessageChannel::mInterruptStack is used in IPC code, r=jld 2016-04-28 07:21:49 +08:00
Nathan Froyd 840ebe5f59 Bug 1264661 - remove EMIT_LOGGING_CODE constant from IPDL compiler; r=jld
It's not needed anymore (hasn't been for a while, apparently).
2016-04-14 14:58:17 -04: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 b8099db36d Bug 1262463 - part 1 - turn NS_RUNTIMEABORTs in protocols into FatalErrors; r=jld
NS_RUNTIMEABORT generates rather a lot of code, since we have to load up
five arguments, two of which are strings, and then call NS_DebugBreak.
Instead of doing this, let's just call each protocol's FatalError, which
only requires loading one string argument.  Each protocol's FatalError
calls mozilla::ipc::FatalError, which communicates exactly the same
information as the inlined NS_RUNTIMEABORT would (e.g. crash reporter
annotations), but at a significant code savings: this patch reduces
.text by ~80K on Linux x86-64.
2016-04-06 10:21:32 -04:00
Nathan Froyd 87311fb554 Bug 1262458 - rename {msg,reply}Class-related things to reflect new functional reality; r=jld
In bug 1259428, we changes a bunch of things that were previously
classes to refer to functions instead.  Jed suggested in bug 1259428
comment 10 that we might want to rename things to reflect the new world
order as a followup.  Consider it done.
2016-04-06 09:42:40 -04:00
Nathan Froyd 697425fd51 Bug 1259428 - part 6 - remove unneeded MessageDecl methods; r=jld
msgCast and replyCast were only used for the dodgy casts we removed in
part 2; the msgCxxType was only called by msgCast.
2016-03-28 11:43:54 -04:00
Nathan Froyd ebe8d01895 Bug 1259428 - part 5 - convert Message subclasses to constructor functions; r=jld
All we use our Message subclasses for nowadays is the constructor, so we
might as well strip the class away and just have functions that perform
the construction for us.  This change eliminates unnecessary vtables as
well as making the included headers somewhat smaller, which is always
nice.
2016-03-28 11:42:47 -04:00
Nathan Froyd 4d7242a2c4 Bug 1259428 - part 4 - remove prtime.h from generated protocol headers; r=jld
This include was only needed for PR_Now(), which is no longer called by
the headers.
2016-03-25 18:27:11 -04:00
Nathan Froyd 9cbbaad4ad Bug 1259428 - part 3 - remove Log() methods from generated message subclasses; r=jld
These are no longer called by anything.  The generated Message
subclasses now have no behavior of their own, and can be removed in
subsequent patches.
2016-03-25 17:09:41 -04:00
Nathan Froyd 4a4de50da7 Bug 1259428 - part 2 - remove dodgy static_cast downcasts from logging statements; r=jld
Various bits of IPDL code would do something like:

  Message* m = ...;
  if (m.type() == particular message type) {
    static_cast<ParticularMessageType*>(m)->name();
  }

The static_cast is a remnant of having to do the downcast to access the
Log() method on the concrete subclass.  Since name() is defined on
Message, there's no need for these casts anymore, so let's remove them.
2016-03-25 17:07:26 -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
Aaron Klotz 1a8c9407a8 Bug 1254373: Make TestDemon build on Windows; r=billm
MozReview-Commit-ID: GtgAVfDYhtk

--HG--
extra : rebase_source : 64c1bc26fa4501742c51edc8296837ef6b6590d1
2016-03-10 17:32:16 -07:00
Bill McCloskey b70d78b809 Bug 1248750 - Eliminate intentional IPC crashes (r=dvander) 2016-03-06 14:38:07 -08:00
Bill McCloskey f8784ed28b Back out bug 1248750 on a CLOSED TREE 2016-03-04 16:04:41 -08:00
Bill McCloskey 816b25e191 Bug 1248750 - Eliminate intentional IPC crashes (r=dvander) 2016-03-04 14:51:08 -08:00
Bill McCloskey 70bb5a0c46 Bug 1240985 - IPC fuzzer (r=gabor) 2016-03-04 14:51:08 -08:00
Lee Salzman f5674ca6c2 Bug 1245241 - part 3 - remove unused AdoptShmem from IPDL. r=billm 2016-02-18 10:56:15 -05:00
Lee Salzman d4c87aeb45 Bug 1245241 - part 2 - remove TYPE_SYSV Shmems from IPDL. r=billm 2016-02-18 10:56:15 -05:00
Bill McCloskey c08caf0331 Bug 1210099 - Use diagnostic assert for union discriminator checks (r=jld) 2016-02-04 22:30:06 -08:00
Nicolas Silva cd021cdc29 Bug 1208226 - Don't crash when failing to map a segment of shared memory. r=sotaro, billm 2016-02-01 16:11:00 +01:00
Bill McCloskey c663839ade Bug 1240871 - Don't allow implicit "async" in IPDL (r=mccr8,billm) 2016-01-28 20:56:37 -08:00
Nicholas Nethercote 26360d6c45 Bug 1239864 (part 9) - Use the new rect iterators in layout/ and ipc/. r=dholbert.
--HG--
extra : rebase_source : d5558c39bd3cfe85ee6f247eea8bab33f2f5027f
2016-01-18 17:20:59 -08:00
Gregory Szorc 86a9f976ba Bug 1239207 - Don't process IPDL when not compiling; r=glandium
IPDL processing takes ~9.4s on my i7-6700K and is the long pole in the
"export" tier for clobber --disable-compile-environment builds. IPDL
shouldn't be needed for these builds.

Disabling IPDL makes artifact builds ~4s faster on my machine.

--HG--
extra : rebase_source : 60aeec636e18380c3258f054e90d1b6c3a16fadf
2016-01-14 23:11:12 -08:00
Nicholas Nethercote ec89bbf7f2 Bug 1237151 (part 3) - Remove ignored qualifiers in all remaining code. r=froydnj. 2016-01-05 17:08:45 -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
Birunthan Mohanathas 9985829ecc Bug 1219392 - Capitalize mozilla::unused to avoid conflicts. r=froydnj 2015-11-02 07:53:26 +02:00
Aaron Klotz ad79787f87 Bug 1217250 - Fix some IPDL tests that were broken by bug 1212027; r=froydnj 2015-10-21 20:44:34 -04: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 cba63c94d7 Bug 1212027 - part 4 - use class interfaces when destroying managees; r=jld
Similar to the last patch, we copy any sub-protocols a protocol owns
before destroying the sub-protocols.  We do this to ensure a stable
iteration over the sub-protocols, as destroying a sub-protocol may
trigger other sub-protocol deletions.  Let's permit an existing
interface method to do the copying for us, so if the details of how we
store sub-protocols change, this call site is insulated from the
details.
2015-10-07 00:02:27 -04:00
Nathan Froyd 405aa9e2df Bug 1212027 - part 3 - use class interfaces when cloning managees; r=jld
In $PROTOCOL::CloneManages, we reach directly into the other protocol's
sub-protocol arrays to copy them.  It would be better, from a
fewer-places-to-modify-when-things-change point of view if we used the
$PROTOCOL::Managed$SUBPROTOCOL array getter that already exists for this
purpose.  A good compiler should be able to remove the function call
overhead...but cloning managees is probably expensive anyway, so a
function call here doesn't matter much.

It's not immediately obvious to me why we clone and then iterate over
the clone, rather than iterating directly, but perhaps there are subtle
IPDL dragons lurking hereabouts.
2015-10-06 23:59:32 -04:00
Nathan Froyd 8065270d99 Bug 1212027 - part 2 - add a C++ AST type for 'auto'; r=jld
This type will come in handy when we have to add iteration over
hashtables, since it would be a pain to write out the iterator type.
2015-10-06 21:33:13 -04:00
Nathan Froyd 278e9ff8b1 Bug 1212027 - part 1 - rename ipdl lowering helpers to reflect intent, not function; r=jld
The functions:

- _callCxxArrayInsertSorted
- _callCxxArrayRemoveSorted
- _callCxxArrayClear
- _cxxArrayHasElementSorted

are only ever used to touch the managed sub-protocol arrays of a
protocol.  It would be better if they reflected the *intent* of what
they were doing, rather than what C++ function they were calling, since
we're about to change that.
2015-10-06 21:20:07 -04:00
George Wright c229949556 Bug 1207921 - Call makeReply before dtorEpilogue so that we don't end up with a nullptr deref r=billm 2015-09-28 09:17:05 -04:00
Chris Peterson 71920a9550 Bug 1207030 - Enable -Wshadow flag in more directories that have no -Wshadow warnings. r=glandium 2015-09-22 21:39:03 -07:00
Andrea Marchesini cd4473d62f Bug 1203426 - Rename StructuredCloneIPCHelper to StructuredCloneData, r=smaug
--HG--
rename : dom/ipc/StructuredCloneIPCHelper.cpp => dom/ipc/StructuredCloneData.cpp
rename : dom/ipc/StructuredCloneIPCHelper.h => dom/ipc/StructuredCloneData.h
2015-09-10 21:50:58 +01:00
Jed Davis c2c83b8933 Bug 1201329 - Use AlignedStorage2 instead of char[] for IPDL union members. r=billm
In addition to fixing the alignment, this helps our static analysis
reason about them; see bug for more info.
2015-09-03 21:56:59 -07:00
Nicholas Nethercote f44287005f Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.

--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
2015-08-27 20:44:53 -07:00
Bobby Holley 97b9240b34 Bug 1188696 - Hoist nsRefPtr.h into MFBT. r=froydnj 2015-07-29 10:44:59 -07:00
David Anderson c722fa544d Add default initializers for primitive fields in IPDL structs. (bug 1154522, r=billm) 2015-07-28 00:02:10 -07:00
Jeff Muizelaar 88a9b35787 Bug 1186025. Optimize the usage of regions. r=mstange
This eliminates a bad idiom in some places.

--HG--
extra : rebase_source : 362b6e88e074888ded8a02f930d5ffbf1e31ec86
2015-07-21 10:54:44 -04:00
Bill McCloskey 2f9787183c Bug 1128454 - Fix IPDL test (r=jimm) 2015-07-15 14:30:05 -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