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

3509 Коммитов

Автор SHA1 Сообщение Дата
Nathan Froyd 499fc0976b Bug 1297804 - part 4 - avoid array bounds checks in DestroySubtree loops; r=billm
The IPDL compiler generates code like this in DestroySubtree methods:

    // Recursively shutting down PAPZ kids
    nsTArray<PAPZChild*> kids((mManagedPAPZChild).Count());
    // Accumulate kids into a stable structure to iterate over
    ManagedPAPZChild(kids);
    for (uint32_t i = 0; (i) < ((kids).Length()); (++(i))) {
        // Guarding against a child removing a sibling from the list during the iteration.
        if ((mManagedPAPZChild).Contains(kids[i])) {
            (kids[i])->DestroySubtree(subtreewhy);
        }
    }

There are three problems with this code:

1) We initialize |kids| with a capacity, which is wasted work;
   ManagedPAPZChild() is going to resize the array for us anyway.
2) We're constantly reading from |kids.Length()| in the loop, when we
   only really need to read from it once.
3) We're repeatedly accessing kids[i], and doing needless bounds checks.

Let's fix those three problems.
2016-09-02 16:14:28 -04:00
Nathan Froyd 2d2dec7fe4 Bug 1297804 - part 3 - avoid array bounds checking when writing nsTArray<T> to messages; r=billm
We know we're not going to perform out-of bounds accesses here.
2016-09-02 16:14:28 -04:00
Nathan Froyd 4de7ea1914 Bug 1297804 - part 2 - eschew array bounds checking in nsTArray IPDL-generated code, writer-side; r=billm
For better or worse, the IPDL compiler, for protocols that send or
receive arrays, generates Write methods for transferring those arrays,
rather than going through the standard ParamTraits specializations.
These generated methods perform unnecessary bounds checks when accessing
elements; such checks can be safely bypassed because we know the exact
length of all the arrays involved.  (Some compilers are not smart enough
to eliminate the bounds checks on their own.)
2016-09-02 16:14:28 -04:00
Nathan Froyd b086521c81 Bug 1297804 - part 1 - eschew array bounds checking in nsTArray IPDL-generated code, reader-side; r=billm
For better or worse, the IPDL compiler, for protocols that send or
receive arrays, generates Read methods for transferring those arrays,
rather than going through the standard ParamTraits specializations.
These generated methods perform unnecessary bounds checks when accessing
elements; such checks can be safely bypassed because we know the exact
length of all the arrays involved.  (Some compilers are not smart enough
to eliminate the bounds checks on their own.)
2016-09-02 16:14:28 -04:00
Nathan Froyd 25c7ca2c50 Bug 1297804 - part 0 - add a RangedFor stament type to IPDL's code generator; r=billm
This addition makes many of the upcoming patches significantly easier to
write, and enables us to avoid unpleasantness trying to fiddle with
ipdl.py's notions of C++ types.  (For instance, there's no good way,
when you have a type in-hand, to say the moral equivalent of
std::add_pointer<T>::type.)
2016-09-02 16:14:28 -04:00
Nathan Froyd 9d05d5014b Bug 1299594 - part 3 - remove gProtocolMutex; r=billm
It no longer protects any global state, and is therefore pure overhead.
2016-09-02 16:13:50 -04: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
Nicholas Nethercote b71747b2ac Bug 1299727 - Rename NS_WARN_IF_FALSE as NS_WARNING_ASSERTION. r=erahm.
The new name makes the sense of the condition much clearer. E.g. compare:

  NS_WARN_IF_FALSE(!rv.Failed());

with:

  NS_WARNING_ASSERTION(!rv.Failed());

The new name also makes it clearer that it only has effect in debug builds,
because that's standard for assertions.

--HG--
extra : rebase_source : 886e57a9e433e0cb6ed635cc075b34b7ebf81853
2016-09-01 15:01:16 +10:00
Kan-Ru Chen 99748028a6 Bug 1051567 - Make sure we resend file descriptors for the first chunk of a message. r=billm
Check if the buffers iterator was never consumed. This is a regression
introduced when converting ipc to use BufferList in bug 1262671.

MozReview-Commit-ID: LWAoVlI5CKJ

--HG--
extra : rebase_source : c4f16f4f90f56153c10cf1d9113c4c55748595f0
2016-08-30 18:26:59 +08:00
Nathan Froyd 40d6f37643 Bug 1298462 - tidy ipc/mscom/ files to avoid warnings from clang-cl; r=aklotz
Changing classes to `final` avoids complaints about deleting a class with
virtual functions.  Making destructors private avoids static_asserts from
XPCOM code about refcounted classes with public destructors.

MozReview-Commit-ID: IiPrZln1wvj

--HG--
extra : rebase_source : 5d70eea909e9d8c7f191c465b700b778b7ff564c
2016-08-26 14:26:29 -04:00
Wes Kocher 6c4583e52f Merge m-c to inbound, a=merge 2016-08-29 17:54:53 -07:00
Wes Kocher ecea29f6a3 Backed out changeset 0f53bc1a9aea (bug 1290619) a=merge 2016-08-29 17:40:59 -07:00
Aaron Klotz 63a3869bb8 Bug 1298412: Fix Interceptor construction to use Move semantics for STAUniquePtr instead of pass-by-reference; r=jimm
MozReview-Commit-ID: 8DzeT35Ao4O

--HG--
extra : rebase_source : 14a94903843e54c1c4a4b6c980805ed37d878911
2016-08-26 10:03:17 -06:00
Haik Aftandilian 3c44a5f111 Bug 1290619 - Content sandbox rules should use actual profile directory, not Profiles/*/ regexes. r=jimm
Passes the profile dir to the content process as a -profile CLI option so
that the correct profile dir can be used in the OS X content sandbox rules.
Only enabled on OS X for now.

On Nightly, profile directories will now be read/write protected from the
content process (apart from a few profile subdirectories) even when they
don't reside in ~/Library.

MozReview-Commit-ID: rrTcQwTNdT

--HG--
extra : rebase_source : d91d8939cabb0eed36b640766756548a790a301c
2016-08-25 15:19:52 -07:00
Nathan Froyd ed976e566d Bug 1298882 - ensure mozilla/mscom/Utils.h is included with uniform casing; r=aklotz
We install mozilla/mscom/Utils.h, but include it with an all-lowercased
path in some places.  clang-cl warns about this, and even though this is
Windows-only code and will therefore work, it's better to make
everything consistent.
2016-08-29 21:55:37 -04:00
Nathan Froyd 6d0ffbfa26 Bug 1298840 - declare dependent type with typename in ParamTraits<COMPtrHolder<Interface, _IID>>; r=aklotz
MSVC lets this slide, but clang-cl complains about the missing typename.
2016-08-29 21:47:03 -04:00
Ryan VanderMeulen 1c0c6ec5d4 Merge m-c to inbound. a=merge 2016-08-29 12:56:19 -04:00
Nathan Froyd 286887898c Bug 1297801 - part 4 - use non-null-checked operator new in IPDL code; r=billm
The standard placement new function requires a null check, implicitly
generated by the compiler, on its returned value.  For places we know
don't deal with null pointers, such as all the generated methods of IPDL
code, we can use an overloaded operator new that doesn't require the
null check.
2016-08-29 20:41:22 -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 fda65898ab Bug 1297801 - part 2 - make IPDL Transition functions take an inout parameter for State; r=billm
The calls to IPDL Transition() functions consistently look like:

  Transition(VAR, ..., &VAR);

We can save space by only passing &VAR and deriving the state we're
coming from by loading VAR in Transition itself.  It's not great using
inout parameters here, but we call Transition enough times that this
change saves a reasonable amount of space: about 10K on x86-64 Linux.
The unsightliness of inout parameters here is lessened by the only
callers of Transition being generated code.
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
Kan-Ru Chen c49f09db99 Bug 1297981 - Delete BufferList::FlattenBytes and Pickle::FlattenBytes. r=billm
MozReview-Commit-ID: G3a4DN4Lovi

--HG--
extra : rebase_source : 17818efb7578117b708636d06e6a2f5d14532c94
2016-08-25 17:15:38 +08:00
Makoto Kato 92eed83142 Bug 1288625 - Part 1. Allow compiling of ipc/chromium for Android 64-bit. r=billm
MozReview-Commit-ID: Fyv21xmrGXl

--HG--
extra : rebase_source : 5b1248ee9e9c2ca003c06bd6ef889d632acfea50
2016-07-22 15:28:53 +09:00
Nicholas Nethercote c2306345d5 Bug 1297658 - Avoid unnecessary checking in memory reporters. r=erahm.
This patch removes checking of all the callback calls in memory reporter
CollectReport() functions, because it's not useful.

The patch also does some associated clean-up.

- Replaces some uses of nsIMemoryReporterCallback with the preferred
  nsIHandleReportCallback typedef.

- Replaces aCallback/aCb/aClosure with aHandleRepor/aData for CollectReports()
  parameter names, for consistency.

- Adds MOZ_MUST_USE/[must_use] in a few places in nsIMemoryReporter.idl.

- Uses the MOZ_COLLECT_REPORT macro in all suitable places.

Overall the patch reduces code size by ~300 lines and reduces the size of
libxul by about 37 KiB on my Linux64 builds.

--HG--
extra : rebase_source : e94323614bd10463a0c5134a7276238a7ca1cf23
2016-08-24 15:23:45 +10:00
Wes Kocher 3343f6c576 Backed out changeset b357fab2feb4 (bug 1290619) for osx e10s crashes a=backout CLOSED TREE 2016-08-24 10:59:04 -07:00
Haik Aftandilian d1e8cf113e Bug 1290619 - Content sandbox rules should use actual profile directory, not Profiles/*/ regex's. r=jimm
Passes the profile dir to the content process as a -profile CLI option so
that the correct profile dir can be used in the OS X content sandbox rules.
Only enabled on OS X for now.

On Nightly, profile directories will now be read/write protected from the
content process (apart from a few profile subdirectories) even when they
don't reside in ~/Library.

--HG--
extra : rebase_source : 7bf426f14f31b35c8b541e6d21183226db9836c7
2016-08-22 11:58:18 -07:00
Ryan VanderMeulen 69113163cf Merge m-c to inbound. a=merge 2016-08-24 09:09:05 -04:00
Cykesiopka a16f7b0f6a Bug 1296316 - Convert nsNSSShutDownObject::CalledFromType to an enum class. r=mgoodwin
enum classes are in general safer than plain enums, and as such should be
preferred.

MozReview-Commit-ID: 1FK89SNhdk4

--HG--
extra : rebase_source : 764c4855026c02d8c9e33ca33637fec54ea5ca31
2016-08-20 23:00:19 +08:00
David Anderson 44a97e25c9 Make BackgroundImpl optional in the GPU process. (bug 1294350 part 7, r=billm) 2016-08-22 22:57:36 -07:00
David Anderson a8c8bf4196 Add crash-report instrumentation to diagnose bug 1293580. r=billm 2016-08-22 22:52:04 -07:00
Kan-Ru Chen 506dfe6ea3 Bug 1264642 - Part 4. Use BufferList to replace raw buffers in StructuredClone. r=baku r=billm r=jorendorff
In JS StructuredClone BufferList<SystemAllocPolicy> is typedef'd to
JSStructuredCloneData and use everywhere in gecko that stores structured
clone data.

This patch changed some raw pointers to UniquePtr<JSStructuredCloneData>
and some to stack allocated JSStructuredCloneData for better life time
management. Some parameters or methods are deleted because of changing
to the new data structure.

MessagePortMessage now has the exactly same structure with
ClonedMessageData. Maybe in the future they can be consolidated.

MozReview-Commit-ID: 1IY9p5eKLgv
2016-08-23 00:40:46 +08:00
Kan-Ru Chen 6f3e6b1234 Bug 1264642 - Part 2. Add BufferList::Extract and Pickle::ExtractBuffers. r=billm
These methods allow us to move some buffers out of a pickle with minimum
copying. It's useful when the IPC deserialized type uses BufferList to
store data and we want to take the buffers from IPC directly.

Borrowing is not suitable to use for IPC to hand out data because we
often want to store the data somewhere for processing after IPC has
released the underlying buffers.

MozReview-Commit-ID: F1K2ZMkACqq
2016-08-23 00:40:45 +08:00
Ryan VanderMeulen 833833b8c5 Merge inbound to m-c. a=merge 2016-08-22 09:40:41 -04:00
Cervantes Yu ade760040e Bug 1295544 - Typo fix of MOZ_CRASHREPORTER build config. r=krizsa
MozReview-Commit-ID: 73DSJTef14E

--HG--
extra : rebase_source : 9d96e86754c455d8cda9d6042d4536f06a676c3a
2016-08-16 19:32:30 +08:00
Nathan Froyd 9c219dbf17 Bug 1296642 - avoid compiling {Read,Write}Sentinel calls in non-sentinel checking builds; r=billm
Pickle::{Read,Write}Sentinel were introduced as a way of catching
problems with corrupted IPDL messages at the point of message
serialization, rather than the point of use of the bad data.  The
checking itself is only done on debug or non-release builds, but the
calls to the functions are compiled in regardless of whether checking is
done.  While LTO could plausibly optimize away all the calls, we don't
have LTO on all of our platforms, particularly mobile.  Therefore, we
should move the non-checking versions of the calls inline, so the
compiler can eliminate those calls entirely, even in non-LTO builds.
2016-08-19 21:22:28 -04:00
Sebastian Hengst 1ab23ac869 Backed out changeset dd26b9ddef2c (bug 1292452) 2016-08-19 10:02:02 +02:00
Wes Kocher a58f8b89a0 Merge m-c to inbound, a=merge 2016-08-18 16:32:58 -07:00
Wes Kocher 66098b3d43 Merge m-c to autoland, a=merge 2016-08-17 17:25:57 -07:00
Aaron Klotz 2745382e59 Bug 1293486: Add tearoff IDispatch handler to mscom interceptor; r=jimm
MozReview-Commit-ID: 9PSbpkNcOOh

--HG--
extra : rebase_source : 13ba9a670a43dc68b7760410fd808e03e1ac6d9c
2016-08-12 12:12:48 -06:00
Aaron Klotz cf36a3119b Bug 1292452: MainThreadHandoff enhancements to support array outparams in IA2; r=jimm
MozReview-Commit-ID: LTxj7fHEoAb
2016-08-08 18:06:51 -06:00
Aaron Klotz 54e228e02f Bug 1296333: Ensure better handling of nullptr and IUnknown in ipc::mscom; r=jimm
MozReview-Commit-ID: H1PvH3PIWdK

--HG--
extra : amend_source : 7d41fb7bfcd2576d316900361d23f966b478e277
2016-08-18 09:48:48 -06:00
Ben Kelly 9d7b33a00b Bug 1293690 P2 Set explicit status levels to fail at when calling WorkerHolder::HoldWorker. r=baku 2016-08-18 07:11:04 -07:00
Aaron Klotz a8b5e5f85f Bug 1273635: Follow-up - ensure that MessageChannel's event is reset when signalled; r=jimm, billm
--HG--
extra : amend_source : ea92d0cfce457517bdc0ce5ca81bede4ec936f89
2016-08-14 15:23:12 -06:00
Nicholas Nethercote ca40b738e4 Bug 1294620 - Use infallible XPIDL attribute getters more. r=erahm.
This makes a lot of code more compact, and also avoids some redundant nsresult
checks.

The patch also removes a handful of redundant checks on infallible setters.

--HG--
extra : rebase_source : f82426e7584d0d5cddf7c2524356f0f318fbea7d
2016-08-12 15:19:29 +10:00
Jonathan Chan 9c62a2c11c Bug 1293739 - Part 1: Rename nsCSSProperty to nsCSSPropertyID. r=dholbert
This patch is generated by the following commands (note: if you're running
using OS X's sed, which accepts slightly different flags, you'll have to
specify an actual backup suffix in -i, or use gsed from Homebrew):

  hg stat -c \
  | cut -c 3-  \
  | tr '\n' '\0' \
  | xargs -0 -P 8 gsed --follow-symlinks 's/\bnsCSSProperty\b/nsCSSPropertyID/g' -i''

Then:

  hg mv layout/style/nsCSSProperty.h layout/style/nsCSSPropertyID.h

... and finally, manually renaming nsCSSProperty in the include guard in
nsCSSProperty.h.

MozReview-Commit-ID: ZV6jyvmLfA

--HG--
rename : layout/style/nsCSSProperty.h => layout/style/nsCSSPropertyID.h
2016-08-09 16:28:19 -07:00
Igor 175543fda8 Bug 1293384 - Part 2: Rename Snprintf.h header to Sprintf.h. r=froydnj 2016-08-14 23:43:21 -07:00
Igor a57972337d Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj 2016-08-14 23:44:00 -07:00
Kan-Ru Chen b6d880aca1 Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj
The patch is generated from following command:

  rgrep -l unused.h|xargs sed -i -e s,mozilla/unused.h,mozilla/Unused.h,

MozReview-Commit-ID: AtLcWApZfES


--HG--
rename : mfbt/unused.h => mfbt/Unused.h
2016-08-24 14:47:04 +08:00
Wes Kocher 37a02d441d Backed out 6 changesets (bug 1264642) for marionette failures a=backout CLOSED TREE
Backed out changeset f0067001c059 (bug 1264642)
Backed out changeset 078e5c447f21 (bug 1264642)
Backed out changeset 7c60fc4144fb (bug 1264642)
Backed out changeset 9f434697ef2e (bug 1264642)
Backed out changeset 06fc278fcedf (bug 1264642)
Backed out changeset 162098402acc (bug 1264642)
2016-08-17 10:49:25 -07:00