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

1974 Коммитов

Автор SHA1 Сообщение Дата
Valentin Gosu 84b31379ce Bug 1503725 - Do not deallocate nsThreadShutdownContext when leaking thread. r=erahm
Sometimes when we call ShutdownWithTimeout on a thread pool, the unresponsive
thread that we leak will actually complete before the main thread is done.
In that case, the thread will dereference the thread shutdown context, so
we must intentionally leak it too.

Differential Revision: https://phabricator.services.mozilla.com/D10645
2018-11-02 17:38:37 -04:00
Valentin Gosu 412446f4bc Bug 1500861 - Add shutdownWithTimeout method to nsIThreadPool r=froydnj,erahm
This method is necessary because some threads might be stuck making blocking
calls. This means the thread is not processing any events, and we're unable
to safely terminate it. Our solution here is to leak the stuck threads
instead of waiting for them and potentially causing a shutdown hang.

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

--HG--
extra : moz-landing-system : lando
2018-10-26 18:46:00 +00:00
Jim Blandy a78e7a516e Bug 1499534: Add Pause, Resume, and IsPaused methods to ThrottledEventQueue. r=froydnj
Depends on D8913

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

--HG--
extra : moz-landing-system : lando
2018-10-23 06:21:10 +00:00
Jim Blandy 208e7e94c1 Bug 1499534: Add GTests for ThrottledEventQueue. r=froydnj
This was already reviewed and approved in bug 1426467.

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

--HG--
extra : moz-landing-system : lando
2018-10-22 14:47:44 +00:00
Gurzau Raul 8e9ffaaf06 Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-10-20 01:09:52 +03:00
Andrea Marchesini 2ed3dd4f7d Bug 1500370 - MemoryBlobImpl and TestNonBlockingAsyncInputStream must expose nsITellableInterface, r=mayhemer 2018-10-19 15:31:36 +02:00
Mark Banner ceaeb93550 Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D8389

--HG--
extra : moz-landing-system : lando
2018-10-19 12:55:39 +00:00
Andrea Marchesini 4ebf5b4364 Bug 1496581 - Split nsISeekableStream in 2 classes: nsISeekableStream and nsITellableStream, f=mayhemer, r=froydnj
In the current code there are 3 main issues:

1. nsFileStream is not really thread-safe. There is nothing to protect the
internal members and we see crashes.

2. nsPipeInputStream doesn't implement ::Seek() method and that caused issues
in devtools when a nsHttpChannel sends POST data using a pipe. In order to fix
this, bug 1494176 added a check in nsHttpChannel: if the stream doesn't
implement ::Seek(), let's clone it. This was an hack around nsPipeInputStream,
and it's bad.

3. When nsHttpChannel sends POST data using a file stream, nsFileStream does
I/O on main-thread because of the issue 2. Plus, ::Seek() is called on the
main-thread causing issue 1.

Note that nsPipeInputStream implements only ::Tell(), of the nsISeekableStream
methods. It doesn't implement ::Seek() and it doesn't implement ::SetEOF().

With this patch I want to fix point 2 and point 3 (and consequentially issue 1
- but we need a separate fix for it - follow up). The patch does:

1. it splits nsISeekableStream in 2 interfaces: nsITellableStream and
nsISeekableStream.
2. nsPipeInputStream implements only nsITellableStream.  Doing this, we don't
need the ::Seek() check for point 2 in nsHttpChannel: a simple QI check is
enough.
3. Because we don't call ::Seek() in nsHttpChannel, nsFileStream doesn't do I/O
on the main-thread, and we don't crash doing so.
2018-10-18 13:35:35 +02:00
Andrew McCreight 2df0136940 Bug 1498404 - Fix some errors in manifests r=froydnj
In FxAccountsComponents.manifest, the previous line registers the
component CID, but only for the main process. This means we hit an
error while parsing the manifest in the child process, because the CID
is not recognized. The fix is simply to not try to use the CID to
register the contract in the child process.

As for the rest of the changes, since bug 1438688, XPT information is
compiled into the Firefox binary, so the interfaces manifest entry is
no longer needed. This patch removes instances of this line from
manifest files. This makes some manifest files empty, so the patch
also removes the now-empty files.

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

--HG--
extra : moz-landing-system : lando
2018-10-16 13:26:23 +00:00
Andrew McCreight 877213ca74 Bug 1493791 - Fix trivial calls to do_QueryInterface in XPCOM unit tests r=froydnj
In TestEventTargetQI.cpp, nsIThreadPool is a subclass of
nsIEventTarget, so we cannot QI from the former to the latter once
trivial QIs are banned. However, we still want to check if a QI to
nsIEventTarget does something, so I added an intermediate cast up to
nsISupports, and then QI from there. I wrapped that all up in a
templated function, because the code is a bit ugly, and used it
everywhere for uniformity, even though it is not always needed.

I fixed TestCOMPtr.cpp in the same way, by casting up to nsISupports.

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

--HG--
extra : moz-landing-system : lando
2018-09-27 18:41:42 +00:00
Andrew McCreight 5a1eb609f9 Bug 1493276 - Statically prevent CallQueryInterface to a base class r=froydnj
If a class A is derived from a class B, then an instance of A can be
converted to an instance of class B via a static cast, so QI is not
needed. QIs are slower than static casts.

TestCallTemplates seems to be testing that CallQueryInterface compiles
even if the first argument's class is only ambiguously castable to
nsISupports, so I changed the second argument to be a class unrelated
to the concrete class.

I also removed some useless null checks on the return value of new.

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

--HG--
extra : moz-landing-system : lando
2018-09-27 14:59:55 +00:00
Henri Sivonen 33a649ee4c Bug 1484938 - Make XPCOM string appends and copying assignments write the terminator after writing content. r=froydnj
MozReview-Commit-ID: DOmAitH5YDh

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

--HG--
extra : moz-landing-system : lando
2018-09-24 14:23:35 +00:00
Kris Maglione 1c20e8cbbb Bug 1486147: Part 2 - Update JS string enumerator callers to use JS iteration. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D4270

--HG--
extra : rebase_source : 2adadcc8e51a7bce1da02f4bee1333b77bfa9944
extra : histedit_source : 9df920fd186f8c96a5d8b9cbff53ea9529f26ee0
2018-08-24 16:22:40 -07:00
Ehsan Akhgari 5d9d4af0cd Bug 1491574 - Part 2: Remove the XPCOM registration for nsPersistentProperties; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5950
2018-09-18 00:58:52 -04:00
Coroiu Cristina 40028657f0 Backed out 3 changesets (bug 1491574) for build bustage at builds/worker/workspace/build/src/netwerk/base/nsNetUtil.cpp on a CLOSED TREE
Backed out changeset 5390b485f7e4 (bug 1491574)
Backed out changeset 3d11b69de826 (bug 1491574)
Backed out changeset e7e8f3f70f8b (bug 1491574)
2018-09-18 07:10:20 +03:00
Ehsan Akhgari 9b9060a876 Bug 1491574 - Part 2: Remove the XPCOM registration for nsPersistentProperties; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5950
2018-09-17 22:05:34 -04:00
Eric Rahm b9e8fd399e Bug 1491151 - Part 1: Add MruCache. r=smaug,froydnj
This adds a most recently used cache that can be used as a quick lookup table
for frequently used entries.

--HG--
extra : rebase_source : 571c32f75e985e299113f73b959809d208aad5f3
2018-09-10 14:45:55 -07:00
Henri Sivonen 89ca07c012 Bug 1487341 - Make Truncate(), SetLength() and Capacity() more efficient by keeping memcpying to the minimum. r=froydnj
MozReview-Commit-ID: 2LeRrWcN8vF

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

--HG--
extra : moz-landing-system : lando
2018-09-17 09:45:02 +00:00
Ehsan Akhgari 8b5f37d34a Bug 1491558 follow-up: Address mats' review comments 2018-09-17 02:23:06 -04:00
Ehsan Akhgari fa81a39327 Bug 1491558 - Remove the XPCOM registration for nsThreadPool; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5943
2018-09-15 12:13:57 -04:00
Jan de Mooij cbb67627a3 Bug 722345 part 3 - Remove request API. r=luke
Differential Revision: https://phabricator.services.mozilla.com/D4424

--HG--
extra : rebase_source : 1842588c00dbc8fb4294ce5436cdb787190909b4
2018-08-28 09:53:30 +02:00
Henri Sivonen c62a32ebf1 Bug 1487606 - Make AppendLiteral() not undo the effect of SetCapacity(). r=froydnj
MozReview-Commit-ID: I2QSXbQhOUH

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

--HG--
extra : moz-landing-system : lando
2018-08-31 14:57:26 +00:00
Margareta Eliza Balazs 2fe43133db Merge inbound to mozilla-central. a=merge 2018-08-29 12:43:37 +03:00
Gerald Squelart bad49db9b0 Bug 1479996 - Combine nsTArray::IndexOf and element access into lambda-friendly functions - r=froydnj
In many places, nsTArray::IndexOf is followed by accessing that element
(hopefully with `Elements() + index`, which skips unnecessary bounds checks.)
But this pattern introduces operations that could be avoided:
- IndexOf converts the address of the found element into an index,
- The caller must test for a special `NoIndex` value,
- On success, accesses convert that index back into the original address.

This patch introduces new 'ApplyIf...' functions that combine all these
operations in a more efficient ensemble: If the sought element is found, it is
passed by reference to a given callable object (usually a lambda); if not
found, another callable is invoked.
Depending on what they need, the first callable may take one of these parameter
lists: (), (size_t), (maybe-const elem_type&), (size_t, maybe-const elem_type&).
On top of removing the pointer->index->pointer operations in most cases,
invoking callables directly from ApplyIf is safer, as the array is guaranteed to
be untouched at this time.
Also, being templates taking function objects, in most cases the compiler should
be able to inline and optimize the search and its callables' code.

This patch gives example uses in nsTArray::Contains, and in
FrameProperties::GetInternal, SetInternal.
And FrameProperties::Has now calls Contains, which is more efficient because
the former code would compute an index (or NoIndex), and then convert that index
to a bool; whereas the new code directly produces a bool from within the search
algorithm.

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

--HG--
extra : moz-landing-system : lando
2018-08-28 22:04:09 +00:00
Henri Sivonen 876f7ad09f Bug 1482828 - Introduce C++ analogs of Rust's nsA[C]StringBulkWriteHandle. r=froydnj
MozReview-Commit-ID: BZyHd4VzNur

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

--HG--
extra : moz-landing-system : lando
2018-08-28 16:42:26 +00:00
Ciure Andrei 9aabc73223 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-08-29 01:31:20 +03:00
Kris Maglione 53f96aa226 Bug 1486182: Part 2a - Add Services.catMan getter for the category manager. r=mossop
This makes it much easier to update existing consumers of
XPCOMUtils.enumerateCategoryEntries to use the category manager directly.

It also, unfortunately, requires updating existing category manager consumers
to use the Services getter in order to avoid ESLint errors.

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

--HG--
extra : rebase_source : fb9fd9b21db80af472ff6250a2e9a35e8d538147
2018-08-24 22:13:57 -07:00
aceman 77d5a7fd81 Bug 1486311 - convert remaining nsIFile::GetDirectoryEntries() callers to pass in a nsIDirectoryEnumerator. r=kmag 2018-08-26 14:15:00 +03:00
Kris Maglione 3a5c05e76f Bug 1484496: Part 5e - Convert remaining nsISimpleEnumerator users to use JS iteration. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D3733

--HG--
extra : rebase_source : c0fac176d7b3d840c4dbb14f8d95ccfc7f83a5a8
extra : histedit_source : a92c40117d0808a3ad68c972f622a7a42c9ae8ba
2018-08-18 18:13:14 -07:00
Dave Townsend 204fe23163 Bug 1484844: Make nsINIParser mutable. r=froydnj
In order to implement profile-per-install we need a mutable INI parser in early
startup. The current one is implemented in JavaScript and thus not available.
This makes the current read-only C++ INI parser mutable and removes the
JavaScript implementation.

It turns out that the two different implementations of nsIINIParserFactory and
nsIINIParser behaved slightly differently but only in ways that the single test
cared about so I've adjusted things a little to make it work.

The existing C++ implementation did not do validity checks on arguments, this
adds that making empty sections and values illegal.

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

--HG--
rename : xpcom/tests/unit/test_iniProcessor.js => xpcom/tests/unit/test_iniParser.js
extra : source : 524941c8ed0e048ee51be1bd11082b41428ef490
extra : amend_source : 2de6cef5be97448a41733bedda29d6af34aed27a
2017-10-12 14:20:57 -07:00
Henri Sivonen 3edc601325 Bug 1402247 - Use encoding_rs for XPCOM string encoding conversions. r=Nika,erahm,froydnj.
Correctness improvements:

 * UTF errors are handled safely per spec instead of dangerously truncating
   strings.

 * There are fewer converter implementations.

Performance improvements:

 * The old code did exact buffer length math, which meant doing UTF math twice
   on each input string (once for length calculation and another time for
   conversion). Exact length math is more complicated when handling errors
   properly, which the old code didn't do. The new code does UTF math on the
   string content only once (when converting) but risks allocating more than
   once. There are heuristics in place to lower the probability of
   reallocation in cases where the double math avoidance isn't enough of a
   saving to absorb an allocation and memcpy.

 * Previously, in UTF-16 <-> UTF-8 conversions, an ASCII prefix was optimized
   but a single non-ASCII code point pessimized the rest of the string. The
   new code tries to get back on the fast ASCII path.

 * UTF-16 to Latin1 conversion guarantees less about handling of out-of-range
   input to eliminate an operation from the inner loop on x86/x86_64.

 * When assigning to a pre-existing string, the new code tries to reuse the
   old buffer instead of first releasing the old buffer and then allocating a
   new one.

 * When reallocating from the new code, the memcpy covers only the data that
   is part of the logical length of the old string instead of memcpying the
   whole capacity. (For old callers old excess memcpy behavior is preserved
   due to bogus callers. See bug 1472113.)

 * UTF-8 strings in XPConnect that are in the Latin1 range are passed to
   SpiderMonkey as Latin1.

New features:

 * Conversion between UTF-8 and Latin1 is added in order to enable faster
   future interop between Rust code (or otherwise UTF-8-using code) and text
   node and SpiderMonkey code that uses Latin1.

MozReview-Commit-ID: JaJuExfILM9
2018-08-14 14:43:42 +03:00
Nika Layzell 7a9f60fafb Bug 1479484 - Part 1: Add make_dafsa.py to the virtualenv's python path, r=froydnj
Summary:
The plan is to also expose perfecthash.py from this module on the python path.
This also allows us to stop using explicit module loading to load make_dafsa.py.

make_dafsa.py was moved into tools/ to avoid any extra python files from
accidentally ending up on the python path.

Reviewers: froydnj!

Tags: #secure-revision

Bug #: 1479484

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


--HG--
rename : xpcom/ds/make_dafsa.py => xpcom/ds/tools/make_dafsa.py
2018-08-01 17:54:41 -04:00
Nika Layzell 24cf25ae22 Bug 1461450 - Part 2: Add tests for AutoTArray move constructors, r=erahm 2018-07-31 17:52:59 -04:00
Cosmin Sabou e748fd8968 Backed out 15 changesets (bug 1475409, bug 1461450, bug 1474369, bug 1471726) for causing rooting hazards and browser chrome failures. CLOSED TREE
Backed out changeset 7ce27aa3ce68 (bug 1474369)
Backed out changeset a8a4e2414daa (bug 1474369)
Backed out changeset 13c9626970e2 (bug 1474369)
Backed out changeset 9817819b7765 (bug 1475409)
Backed out changeset 39fcebfe6529 (bug 1475409)
Backed out changeset c19ca740d3d1 (bug 1475409)
Backed out changeset b26c90518fca (bug 1474369)
Backed out changeset cbdde0474521 (bug 1474369)
Backed out changeset ccea3049fe0f (bug 1474369)
Backed out changeset e9f6d2544a82 (bug 1474369)
Backed out changeset 99c4d07d4b88 (bug 1474369)
Backed out changeset c721ada8a6d6 (bug 1461450)
Backed out changeset 961379be0f5e (bug 1461450)
Backed out changeset cf2448b2635f (bug 1471726)
Backed out changeset 408961783c95 (bug 1471726)
2018-07-30 20:31:24 +03:00
Nika Layzell 9c66afc10b Bug 1461450 - Part 2: Add tests for AutoTArray move constructors, r=erahm 2018-07-30 11:27:58 -04:00
Calixte Denizet cfaea27109 Bug 1473531 -- Disable gtest storage_DeadlockDetectorTest.storage_Sanity5DeathTest for macosx ccov build.
Summary: GTest is permafailing because of this test (GTest is always running over 1200s).

Reviewers: froydnj

Reviewed By: froydnj

Bug #: 1473531

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

--HG--
extra : rebase_source : 07413c4d7ba4eb6bd1439f292bd489a775dab61b
2018-07-17 21:24:12 +03:00
Emilio Cobos Álvarez 6b1dec4b78 Bug 1473804: Don't lie to AutoTArray::EnsureCapacity. r=erahm
Differential Revision: https://phabricator.services.mozilla.com/D1995

MozReview-Commit-ID: 350uWaD49tS
2018-07-17 10:23:47 +02:00
Emilio Cobos Álvarez 09e04b0f0f Bug 1475980: A moved table should be empty. r=froydnj
MozReview-Commit-ID: 7K9wNGhIhaD
2018-07-16 18:06:37 +02:00
Valentin Gosu 5bd326c5f5 Bug 1412081 - Add ability to blacklist file paths on Unix platforms r=mayhemer
--HG--
extra : rebase_source : 6894f5c3df745519e5e9db5b7bf6f004922152d1
2018-06-20 02:52:12 +02:00
Tarek Ziadé 0538cd57e2 Bug 1472668 - Don't reset performance counters when reading their values - r=baku
We're changing the counters behavior since they are not notifications anymore.
In the new behavior they don't get reset when they are retrieved,
so we can have several consumers via the promise.

If the values overflow, we let the wrapping occur (unsigned values).

MozReview-Commit-ID: 1adkszScYo4

--HG--
extra : rebase_source : cd554ad4cfa643b09f75bb07e38b5d35e08cf470
2018-07-10 10:06:41 +02:00
Kris Maglione 94f26a6578 Bug 1457728: Support tri-state comparators in nsTArray. r=erahm
MozReview-Commit-ID: FC9GPsJJ03K

--HG--
extra : source : e2d3d7bb9d1f7150ec3be7f8507977f7378ec541
extra : amend_source : 23fe2a504342c2b548e1f01fc80b662ee16443dd
2018-04-28 15:15:04 -07:00
Andreea Pavel be1d77cb98 Backed out changeset e2d3d7bb9d1f (bug 1457728) for build bustages at build\build\src\xpcom\ds\nsTArray.h(807) on a CLOSED TREE 2018-07-07 22:55:25 +03:00
Kris Maglione cd92626ded Bug 1457728: Support tri-state comparators in nsTArray. r=erahm
MozReview-Commit-ID: FC9GPsJJ03K

--HG--
extra : rebase_source : e2384e8f98b76a55aece2358528e9d9cf0272e80
extra : histedit_source : 6d0d89de11127fafd62dda2b860a50ccbbfb583d
2018-04-28 15:15:04 -07:00
Ciure Andrei f61df5dc45 Backed out 4 changesets (bug 1461450, bug 1471726) for linting failure xpidl.py CLOSED TREE
Backed out changeset 6e8148c1ca7f (bug 1461450)
Backed out changeset 2a02d86bc113 (bug 1461450)
Backed out changeset 1907567a85c5 (bug 1471726)
Backed out changeset c4df8eab6d1c (bug 1471726)
2018-07-07 03:12:10 +03:00
Nika Layzell c1f2b81149 Bug 1461450 - Part 2: Add tests for AutoTArray move constructors, r=erahm 2018-07-06 19:53:07 -04:00
Chris Peterson 2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Nicholas Nethercote 60b1f563cb Bug 1447951 - Store nsDynamicAtom's chars after the end of the object. r=froydnj
This reduces memory usage because we only need one allocation instead of two
for the dynamic atom and its chars, and because we don't need to store a
refcount and a size. It precludes sharing of chars between dynamic atoms, but
we weren't benefiting much from that anyway.

This reduces per-process memory usage by up to several hundred KiB on my
Linux64 box.

One consequence of this change is that we need to allocate + copy in
DOMString::SetKnownLiveAtom(), which could make some things slower.

--HG--
extra : rebase_source : ba4065ea31e509dd985c003614199f73def0596c
2018-06-22 09:38:42 +10:00
Andreea Pavel f85f162e83 Merge mozilla-central to mozilla-inbound. a=merge on a CLOSED TREE 2018-06-20 14:31:42 +03:00
Tarek Ziadé a895a7efea Bug 1464571 - fixes DOM Worker performance counters - r=baku,froydnj
Now uses StaticPrefs instead of DOMPrefs, and how we count dispatches for Workers.

MozReview-Commit-ID: DTumwcI5bG

--HG--
extra : rebase_source : 0cf5312e714fb260c01df647b2cd1fcc28ffc415
2018-06-19 16:14:06 +02:00
Valentin Gosu 4cade1b2b5 Bug 1389251 - Add esc_Spaces that may be used to force escaping of spaces r=bz,jdescottes
MozReview-Commit-ID: 4tahH3IOKW

--HG--
extra : rebase_source : 12057b98c87d7d3c57e90888082f540c49c5a9a9
2018-06-18 15:06:25 +02:00