Commit Graph

19498 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
785ebbeab9 Bug 1594275 - Parse the exportparts attribute. r=bzbarsky
But don't hook it into style yet, that'll be a follow-up patch.

I had this patch in my local queue for a bit and there was no point in not
landing it I guess.

The value of this attribute could be stored only in the shadow root (as this
only applies to shadow hosts), but that would make invalidation harder, I think,
so do the obvious thing for now.

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

--HG--
extra : moz-landing-system : lando
2019-11-06 18:03:51 +00:00
Nicholas Nethercote
af281df032 Bug 1587176 - Fix UBSAN complaints about nsCOMArray. r=erahm
nsCOMArray currently casts a function that takes two `void` pointers into a
function that takes two `nsISupports` pointers. UBSAN doesn't like this.

This commit introduces an extra level of casting machinery. As a result, each
comparison done while sorting goes through an extra level, to get from `(T*,
T*)` comparisons to `(nsISupports*, nsISupports*)` comparisons to `(void*,
void*)` comparisons, as required by `NS_QuickSort()`. It's a bit annoying but I
can't see how else to solve this within the constraint imposed by the existing
`nsCOMArray_base`/`nsCOMArray` split.

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

--HG--
extra : moz-landing-system : lando
2019-11-05 00:14:10 +00:00
Nicholas Nethercote
aa1586413a Bug 1587176 - Rename some nsCOMArray internal stuff. r=erahm
This makes the subsequent commit easier to understand.

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

--HG--
extra : moz-landing-system : lando
2019-11-05 00:12:06 +00:00
Nathan Froyd
892767cef9 Bug 1593802 - don't drop dispatch flags in TaskQueue's EventTargetWrapper; r=erahm
`TaskQueue` wraps an `nsIEventTarget` to provide "one runnable at a
time" execution policies regardless of the underlying implementation of
the wrapped `nsIEventTarget` (e.g. a thread pool).  `TaskQueue` also
provides a `nsISerialEventTarget` wrapper, `EventTargetWrapper`, around
itself (!) for consumers who want to continue to provide a more
XPCOM-ish API.

One would think that dispatching tasks to `EventTargetWrapper` with a
given set of flags would pass that set of flags through, unchanged, to
the underlying event target of the wrapped `TaskQueue`.

This pass-through is not the case.  `TaskQueue` supports a "tail
dispatch" mode of operation that is somewhat underdocumented.  Roughly,
tail dispatch to a `TaskQueue` says (with several other conditions) that
dispatched tasks are held separately and not passed through to the
underlying event target.  If a given `TaskQueue` supports tail dispatch
and the dispatcher also supports tail dispatch, any tasks dispatched to
said `TaskQueue` are silently converted to tail dispatched tasks.  Since
tail dispatched tasks can't meaningfully have flags associated with
them, the current implementation simply drops any passed flags on the floor.

These flags, however, might be meaningful, and we should attempt to
honor them in the cases we're not doing tail dispatch.  (And when we are
doing tail dispatch, we can verify that the requested flags are not
asking for peculiar things.)

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

--HG--
extra : moz-landing-system : lando
2019-11-05 16:59:30 +00:00
Nathan Froyd
f64f04d6ef Bug 1593803 - rename NS_DispatchToBackgroundThread to NS_DispatchBackgroundTask; r=KrisWright
The current API name is bad: we want it to be read "some background
thread", but it could just as easily be read "a singular background
thread", which would lead people to assume that for:

```
NS_DispatchToBackgroundThread(...);
NS_DispatchToBackgroundThread(...);
```

the dispatched tasks will necessarily run in the order they are
dispatched, which is not the case.

Let's try to head off that interpretation by renaming this function.

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

--HG--
extra : moz-landing-system : lando
2019-11-05 21:19:18 +00:00
Andrew McCreight
634c8dd169 Bug 1591174 - Fix some references to nsIDOMWindow. r=bzbarsky
nsIDOMWindow is now an empty interface. There are two references to
nsIDOMWindow::openDialog in comments which needed to be updated. There
were also a few forward declarations of nsIDOMWindow that were unused.

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

--HG--
extra : moz-landing-system : lando
2019-11-05 04:52:53 +00:00
Bob Owen
71c23a88fd Bug 1593007: Allow for moz_log suffix in sandbox policy rules. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D51431

--HG--
extra : moz-landing-system : lando
2019-11-05 13:05:36 +00:00
Edgar Chen
6e2bd552ea Bug 1578241 - Get rid of dom.promise_rejection_events.enabled; r=mccr8
promise rejection event was enabled by default on 69 (bug 1525554).
We could get rid of this preference.

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

--HG--
extra : moz-landing-system : lando
2019-11-04 18:08:54 +00:00
Jan de Mooij
96cc0b5247 Bug 1579367 - Initialize XPCJSContext explicitly, after loading user prefs. r=kmag
This way we get the correct values for start-up prefs in the parent process.

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

--HG--
extra : moz-landing-system : lando
2019-11-05 06:29:13 +00:00
Emilio Cobos Álvarez
fe10c35ad2 Bug 1591191 - Move compare and EqualsIgnoreAsciiCase to nsTStringRepr. r=erahm
Zibi is working on replacing some string based APIs with some things that return
substrings, so we could use this.

Alternatively he'd have to do something like:

  Compare(myCSubstring, nsDependentCSubstring(aTag, strlen(aTag)))

or something of that sort, which looks a bit uglier.

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

--HG--
extra : moz-landing-system : lando
2019-11-04 11:27:05 +00:00
Dorel Luca
d8264bf6a7 Backed out changeset eb3d67637a9b (bug 1591191) for build bustage on build/src/xpcom/string/precompiled_templates.cpp. CLOSED TREE 2019-11-04 12:40:57 +02:00
Emilio Cobos Álvarez
7d302de427 Bug 1591191 - Move compare and EqualsIgnoreAsciiCase to nsTStringRepr. r=erahm
Zibi is working on replacing some string based APIs with some things that return
substrings, so we could use this.

Alternatively he'd have to do something like:

  Compare(myCSubstring, nsDependentCSubstring(aTag, strlen(aTag)))

or something of that sort, which looks a bit uglier.

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

--HG--
extra : moz-landing-system : lando
2019-10-29 20:09:00 +00:00
Noemi Erli
35873cfc31 Backed out changeset 9fccb38453a4 (bug 1586236) for causing mass devtools failures 2019-11-03 05:17:02 +02:00
Gijs Kruitbosch
608f3e7539 Bug 1545123 - simplify how we get directory information for plugins, r=handyman,mconley
In this change we:
- stop treating the nsPluginDirServiceProvider as a directory provider, as its
  GetFile implementation was a no-op anyway - registering it didn't make any
  difference.
- stop treating it as a class entirely, because the PLID getters were already
  static, so instantiating it also didn't do anything.
- move IO from the plugin directory list provider and the Windows-only PLID
  getters into nsPluginHost. This enables us to move it off of the main thread
  later - the directory getting has to happen on the main thread, but we can
  postpone further checks on the nsIFile instances.
- in the process, stop doing exists() calls on files because we can fail more
  lazily. This allows us to remove more allowlist entries from
  browser_startup_mainthreadio, though the `isDirectory` calls will actually
  still cause IO - they don't seem to create IO markers in the profiler.
  We will move this IO away from the main thread in subsequent commits.

Depends on D48328

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

--HG--
extra : moz-landing-system : lando
2019-11-02 22:33:42 +00:00
Ciure Andrei
fdfd0105e6 Backed out 5 changesets (bug 1545123) for causing nsPluginTags.cpp build bustages CLOSED TREE
Backed out changeset 91313cceae8c (bug 1545123)
Backed out changeset d91549e68229 (bug 1545123)
Backed out changeset 269d89e09fbb (bug 1545123)
Backed out changeset a139ee115519 (bug 1545123)
Backed out changeset eb454f238f45 (bug 1545123)
2019-11-02 14:00:38 +02:00
Gijs Kruitbosch
c04f0a7345 Bug 1545123 - simplify how we get directory information for plugins, r=handyman,mconley
In this change we:
- stop treating the nsPluginDirServiceProvider as a directory provider, as its
  GetFile implementation was a no-op anyway - registering it didn't make any
  difference.
- stop treating it as a class entirely, because the PLID getters were already
  static, so instantiating it also didn't do anything.
- move IO from the plugin directory list provider and the Windows-only PLID
  getters into nsPluginHost. This enables us to move it off of the main thread
  later - the directory getting has to happen on the main thread, but we can
  postpone further checks on the nsIFile instances.
- in the process, stop doing exists() calls on files because we can fail more
  lazily. This allows us to remove more allowlist entries from
  browser_startup_mainthreadio, though the `isDirectory` calls will actually
  still cause IO - they don't seem to create IO markers in the profiler.
  We will move this IO away from the main thread in subsequent commits.

Depends on D48328

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

--HG--
extra : moz-landing-system : lando
2019-10-29 05:30:29 +00:00
Gabriele Svelto
f34ffda7e2 Bug 1586236 - Use memory resource notifications to detect low memory scenarios on Windows; r=dmajor
This patch uses the low memory resource notification facility to detect
scenarios where physical memory is running low without polling. This is a
significant change compared to the previous behavior which measured both
available virtual memory (only on 32-bit builds) and available commit space.

Since we're not trying to avoid OOMs anymore we don't save memory reports
anymore when hitting a low-memory condition.

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

--HG--
extra : moz-landing-system : lando
2019-11-01 23:08:59 +00:00
Dragana Damjanovic
b47c2dc48a Bug 1581637 - Part 2 - Add NS_ERROR_NET_HTTP3_PROTOCOL_ERROR error. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D46647

--HG--
extra : moz-landing-system : lando
2019-11-01 14:55:54 +00:00
Gurzau Raul
ce19d94b67 Backed out changeset 60cccadbeaf0 (bug 1586236) for failures at test_memoryReporters.xul on a CLOSED TREE. 2019-11-01 10:21:05 +02:00
Gabriele Svelto
0d648247a1 Bug 1586236 - Use memory resource notifications to detect low memory scenarios on Windows; r=dmajor
This patch uses the low memory resource notification facility to detect
scenarios where physical memory is running low without polling. This is a
significant change compared to the previous behavior which measured both
available virtual memory (only on 32-bit builds) and available commit space.

Since we're not trying to avoid OOMs anymore we don't save memory reports
anymore when hitting a low-memory condition.

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

--HG--
extra : moz-landing-system : lando
2019-10-31 13:55:42 +00:00
Jon Coppeard
902b013ad7 Bug 1592598 - Ensure CC selected zones are scheduled for GC r=sfink,mccr8
The problem is that a GC can be triggered in a number of ways, so scheduling zones in nsJSContext::GarbageCollectNow is not effective. This patch schedules these zones in the GC callback, which is always called at the start of GC. This means we have to change the internal logic slightly to allow the GC callback to schedule addional zones; previously this state was saved and restored before/after running the callback.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 21:39:07 +00:00
Christoph Kerschbaumer
e8e2dc31b7 Bug 1584998: Make x-frame-options work with fission enabled. r=jkt,farre,johannh,flod
Differential Revision: https://phabricator.services.mozilla.com/D50588

--HG--
extra : moz-landing-system : lando
2019-10-31 08:28:35 +00:00
Andreea Pavel
8846cf3d21 Backed out 13 changesets (bug 1581637) for xpchell failures at test_anonymous-coalescing.js on a CLOSED TREE
Backed out changeset 3a458217248d (bug 1581637)
Backed out changeset a5df33ec7393 (bug 1581637)
Backed out changeset c5d8950b4a4b (bug 1581637)
Backed out changeset 97ff4a06c2da (bug 1581637)
Backed out changeset 496ec0c5a60f (bug 1581637)
Backed out changeset 63b7f1ff1714 (bug 1581637)
Backed out changeset 6b80553abc74 (bug 1581637)
Backed out changeset 6b6b75fbec7f (bug 1581637)
Backed out changeset f09b9a4ba633 (bug 1581637)
Backed out changeset 21b721e37d39 (bug 1581637)
Backed out changeset 58ca75a25253 (bug 1581637)
Backed out changeset c28174eaccbe (bug 1581637)
Backed out changeset e6ff3db0a421 (bug 1581637)
2019-10-31 02:45:42 +02:00
Dragana Damjanovic
7595affeb8 Bug 1581637 - Part 2 - Add NS_ERROR_NET_HTTP3_PROTOCOL_ERROR error. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D46647

--HG--
extra : moz-landing-system : lando
2019-10-30 20:52:36 +00:00
Razvan Maries
dc147d06b0 Backed out changeset 5f185a11889b (bug 1584998) for perma fails on browser_bug593387.js. CLOSED TREE 2019-10-30 23:26:01 +02:00
Gerald Squelart
3b6a065df5 Bug 1592496 - nsProxyRelease.h clean-up - r=froydnj
Small changes:
- Ordered #includes.
- Fixed some comments (obsolete remarks, or typos).
- Set `nsMainThreadPtrHolder::mRawPtr` from constructor initializers.
- Modernized `nsMainThreadPtrHolder` copy-prevention.
- Default-initialize `nsMainThreadPtrHolder` members, for extra safety.
- Made `nsMainThreadPtrHandle::get()` `const` (consistent with others).
- Moved nsMainThreadPtrHandle private member to the end.
- Removed now-unused `mozilla::PtrHolder` and `mozilla::PtrHandle` aliases.

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

--HG--
extra : moz-landing-system : lando
2019-10-30 20:33:47 +00:00
Gerald Squelart
86d527a38c Bug 1592496 - Add move constructor and assignment to nsMainThreadPtrHandle - r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D51055

--HG--
extra : moz-landing-system : lando
2019-10-30 20:33:31 +00:00
Christoph Kerschbaumer
36376205fb Bug 1584998: Make x-frame-options work with fission enabled. r=jkt,farre,johannh
Differential Revision: https://phabricator.services.mozilla.com/D50588

--HG--
extra : moz-landing-system : lando
2019-10-30 17:54:36 +00:00
Daniel Varga
617d42c7ed Backed out changeset ac8f6632f7e0 (bug 1584998) on request by dev. On a CLOSED TREE 2019-10-30 19:33:29 +02:00
Christoph Kerschbaumer
9c55479432 Bug 1584998: Make x-frame-options work with fission enabled. r=jkt,farre,johannh
Differential Revision: https://phabricator.services.mozilla.com/D50588

--HG--
extra : moz-landing-system : lando
2019-10-30 14:47:19 +00:00
Kirk Steuber
9b781e6983 Bug 1448807 - Remove showWindowResizer from browser Custom Element r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D50274

--HG--
extra : moz-landing-system : lando
2019-10-30 13:46:55 +00:00
Boris Zbarsky
40d45356a8 Bug 1591481 part 1. Make NormalizeUSVString fallible. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D50691

--HG--
extra : moz-landing-system : lando
2019-10-29 00:24:10 +00:00
Emma Malysz
1fe0cf5758 Bug 1434087, remove [moz-collapsed=true] attribute from minimal-xul.css and static atom r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D51015

--HG--
extra : moz-landing-system : lando
2019-10-29 23:05:31 +00:00
Martin Stransky
b9873d666a Bug 1583466 - [Linux] Load policies per user from system, r=mkaply,mossop
Differential Revision: https://phabricator.services.mozilla.com/D46921

--HG--
extra : moz-landing-system : lando
2019-10-29 08:58:29 +00:00
Emilio Cobos Álvarez
e8cae1b5d0 Bug 1591132 - Use an atomic bool for Checker::mIsWritable. r=froydnj
It's a bool, should use a bool.

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

--HG--
extra : moz-landing-system : lando
2019-10-28 23:27:37 +00:00
Emilio Cobos Álvarez
30240152f3 Bug 1591132 - Make it easy to switch on and off these assertions in different build configurations. r=froydnj
Put them behind a MOZ_HASH_TABLE_CHECKS_ENABLED define, which right now is only
defined in DEBUG builds, preserving behavior.

MakeImmutable becomes an empty inline function when disabled, which should be
zero-cost.

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

--HG--
extra : moz-landing-system : lando
2019-10-28 23:27:30 +00:00
Emilio Cobos Álvarez
9d4e6eee54 Bug 1591132 - Remove some useless ifdefs. r=froydnj
Default constructors of members run if not specified there, and these ifdefs
are ugly.

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

--HG--
extra : moz-landing-system : lando
2019-10-28 23:27:28 +00:00
Emilio Cobos Álvarez
4c1606c97c Bug 1591132 - Make hashtable checker use MOZ_RELEASE_ASSERT. r=froydnj
I want to maybe enable some of these checks in DIAGNOSTIC_ASSERT builds.

The whole type is compiled out in release builds at the moment.

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

--HG--
extra : moz-landing-system : lando
2019-10-28 23:27:26 +00:00
Jan de Mooij
f88317334f Bug 1591923 - Remove some dead code for cooperative contexts from XPConnect, XPCOM and JSAPI. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D50802

--HG--
extra : moz-landing-system : lando
2019-10-28 14:38:03 +00:00
Ehsan Akhgari
58d62a023a Bug 1591823 - Part 2: Switch nsIComponentRegistrar.enumerateContractIDs away from using nsISimpleEnumerator; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D50757

--HG--
extra : moz-landing-system : lando
2019-10-28 13:26:50 +00:00
Ehsan Akhgari
0fa91b9aa8 Bug 1591823 - Part 1: Remove the unused nsIComponentRegistrar.enumerateCIDs() method; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D50756

--HG--
extra : moz-landing-system : lando
2019-10-28 13:26:17 +00:00
Andreea Pavel
a561dfcb8a Backed out changeset 6ac8599ebee3 (bug 1583466) for android build bustage at nsXREDirProvider.cpp on a CLOSED TREE 2019-10-26 01:50:06 +03:00
Martin Stransky
4334dfa913 Bug 1583466 - [Linux] Load policies per user from system, r=mkaply,mossop
Differential Revision: https://phabricator.services.mozilla.com/D46921

--HG--
extra : moz-landing-system : lando
2019-10-24 12:16:48 +00:00
Jon Coppeard
e9bd719e91 Bug 1591338 - Add a JS API to call a object's finalizer r=mccr8
This replaces a direct call of an object's finalizer with a more formal API. This adds some assertions and passes a valid FreeOp pointer to the finalizer rather than null.

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

--HG--
extra : moz-landing-system : lando
2019-10-25 15:33:52 +00:00
Alex Henrie
599d6a6962 Bug 1589786 - Handle surrogate pairs in nsFind. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D49822

--HG--
extra : moz-landing-system : lando
2019-10-25 01:15:07 +00:00
Mihai Alexandru Michis
a5cac4d597 Backed out changeset 0063a5b2f5b3 (bug 1589786) for causing bustages in TestDLLBlocklist.obj and sandboxBroker.i_o CLOSED TREE 2019-10-24 19:41:56 +03:00
Alex Henrie
26a3356957 Bug 1589786 - Handle surrogate pairs in nsFind. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D49822

--HG--
extra : moz-landing-system : lando
2019-10-24 13:38:32 +00:00
Tim Nguyen
a791699efb Bug 1590897 - Remove support for XUL <spring> element. r=mats
Differential Revision: https://phabricator.services.mozilla.com/D50440

--HG--
extra : moz-landing-system : lando
2019-10-24 14:55:25 +00:00
Narcis Beleuzu
d7b145656a Backed out changeset 6dde6dcea46a (bug 1583466) for bustages on nsXREDirProvider.cpp . CLOSED TREE 2019-10-24 15:10:12 +03:00
Martin Stransky
8197c0c37c Bug 1583466 - [Linux] Load policies per user from system, r=mkaply,mossop
Differential Revision: https://phabricator.services.mozilla.com/D46921

--HG--
extra : moz-landing-system : lando
2019-10-23 17:35:11 +00:00
Andrea Marchesini
af392c3e5b Bug 1584898 - Free nsPipe memory on a separate thread, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D50278

--HG--
extra : moz-landing-system : lando
2019-10-24 11:08:43 +00:00
Jan de Mooij
7b85f15477 Bug 1590776 - Store the external-string-sizeOf callback with the finalize callback instead of per-runtime. r=jwalden,bzbarsky
This renames the JSStringFinalizer struct to JSExternalStringCallbacks,
makes it a virtual class, and adds a size-of callback to it (to replace
the per-runtime callback).

This will make it possible to implement this callback easily for the
NewExternalString testing function (which we want for bug 1590641)
without having to move this testing function to shell/js.cpp

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

--HG--
extra : moz-landing-system : lando
2019-10-24 08:49:39 +00:00
Sebastian Hengst
a5193f0aaa Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-11-06 15:00:06 +01:00
Emilio Cobos Álvarez
3961b37711 Bug 1594401 - Enable hashtable assertions on fuzzing builds. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D51996

--HG--
extra : moz-landing-system : lando
2019-11-06 13:37:56 +00:00
Kirk Steuber
047d40ee73 Bug 1584283 - Stop using xul:wizard as a root element and migrate consumers to xul:window[role=dialog] with the wizard as the only child r=surkov. On a CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D48922

--HG--
extra : source : 01007f3333ea182c83bced4ff750c96b22925e80
extra : amend_source : 3b06af7be6009d6bd94798e14f30a2550f1c4c4f
extra : histedit_source : be50ba403a84dda5af1c902438c918c17a971578
2019-10-17 21:25:53 +00:00
Dorel Luca
659e2d2335 Backed out changeset 01007f3333ea (bug 1584283) for Browser-chrome failures in widget/tests/browser/browser_test_procinfo.js 2019-10-23 03:23:24 +03:00
Boris Zbarsky
17b508795a Bug 1589285 part 2. Add Span<const char> overloads of some XPCOM string methods. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D49532

--HG--
extra : moz-landing-system : lando
2019-10-17 22:09:46 +00:00
Kirk Steuber
e937081418 Bug 1584283 - Stop using xul:wizard as a root element and migrate consumers to xul:window[role=dialog] with the wizard as the only child r=surkov
Differential Revision: https://phabricator.services.mozilla.com/D48922

--HG--
extra : moz-landing-system : lando
2019-10-17 21:25:53 +00:00
ffxbld
7b3edc3d02 Update configs. IGNORE BROKEN CHANGESETS CLOSED TREE NO BUG a=release ba=release 2019-10-21 18:00:38 +00:00
Boris Zbarsky
3ae961a2da Bug 1589561. Factor out idle handling from PrioritizedEventQueue. r=smaug
We could try to move the EnforcePendingTaskGuarantee() bit into
PeekIdleDeadline, but then we'd need to check HasReadyEvent() on
mDeferredTimersQueue and mIdleQueue before we possibly unlock the mutex under
PeekIdleDeadline, and it's not clear that that state cannot change once the
mutex is unlocked...

The EnsureIsActive() call at the end of GetIdleDeadlineInternal in the !aIsPeek
case only makes sense if there are in fact idle tasks available to run when
GetDeadlineForIdleTask is called, because otherwise it would incorrectly set us
active when we are not running any tasks.

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

--HG--
rename : xpcom/threads/PrioritizedEventQueue.cpp => xpcom/threads/IdlePeriodState.cpp
rename : xpcom/threads/PrioritizedEventQueue.h => xpcom/threads/IdlePeriodState.h
extra : moz-landing-system : lando
2019-10-20 15:08:44 +00:00
Cosmin Sabou
68c31e0e43 Backed out changeset 798bab343a0a (bug 1589561) for turning bug 1586420 into permafail. CLOSED TREE
--HG--
extra : amend_source : 1c548e9a10e27ff6a50d98f15a701dcd1c717544
2019-10-18 23:04:26 +03:00
Emilio Cobos Álvarez
f9f0e4b318 Bug 1589738 - nsACString::as_str_unchecked should actually check in debug builds. r=nika
Today I reviewed wrong usage of this API.

It'd be good if it crashed in debug builds when misused.

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

--HG--
extra : moz-landing-system : lando
2019-10-18 19:09:55 +00:00
Boris Zbarsky
4a394c3f69 Bug 1589561. Factor out idle handling from PrioritizedEventQueue. r=smaug
We could try to move the EnforcePendingTaskGuarantee() bit into PeekIdleDeadline, but
then we'd need to check HasReadyEvent() on mDeferredTimersQueue and mIdleQueue
before we unlock the mutex and PeekIdleDeadline, and it's not clear that that
state cannot change once the mutex is unlocked...

The EnsureIsActive() call at the end of GetIdleDeadlineInternal in the !aIsPeek
case only makes sense if there are in fact idle tasks available to run when
GetDeadlineForIdleTask is called, because otherwise it would incorrectly set us
active when we are not running any tasks.

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

--HG--
rename : xpcom/threads/PrioritizedEventQueue.cpp => xpcom/threads/IdlePeriodState.cpp
rename : xpcom/threads/PrioritizedEventQueue.h => xpcom/threads/IdlePeriodState.h
extra : moz-landing-system : lando
2019-10-18 17:28:50 +00:00
Olli Pettay
80527a72bf Bug 1589345 - Fix a leftover comment to tell what PrioritizedEventQueue::mActive actually does, r=farre
EnsureIsActive is called in two places, one is for non-idle tasks, the other for idle tasks
https://searchfox.org/mozilla-central/rev/97976753a21c1731e18177de9e5ce78ea3b3da2d/xpcom/threads/PrioritizedEventQueue.cpp#212-214,286,288,303

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

--HG--
extra : moz-landing-system : lando
2019-10-18 10:35:47 +00:00
Emilio Cobos Álvarez
a9f43b38fb Bug 1585068 - Cleanup rejections even if errors are muted. r=edgar,smaug
Differential Revision: https://phabricator.services.mozilla.com/D49057

--HG--
extra : moz-landing-system : lando
2019-10-15 14:16:16 +00:00
Jan de Mooij
6febd292ea Bug 1586683 - Remove flat strings from JSAPI. r=jwalden,bzbarsky
We want to remove flat strings (JSFlatString). With this patch we only expose
linear strings (JSLinearString) to API consumers.

This is very mechanical for the most part, because code typically only cares
about linear strings and not the null-termination aspect.

CTypes's Library.cpp has some Windows-specific code where we relied on null-terminated
strings. This patch adds JS_CopyStringCharsZ for that use case.

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

--HG--
extra : moz-landing-system : lando
2019-10-14 09:32:07 +00:00
Andrew Halberstadt
2b0d90e3ad Bug 1587206 - [lint.flake8] Enable F632 across the tree, r=sylvestre
This ensures we use ==/!= to strings and ints (instead of is/is not).

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

--HG--
extra : moz-landing-system : lando
2019-10-10 18:50:33 +00:00
Jon Coppeard
58e4c9be34 Bug 1587378 - Remove TraceCallbacks method that takes raw JSObject pointers r=mccr8
This method turned out to only be used for tracing wrapper cached things. The wrapper cache has its own way of implementing barriers and contains a raw JSObject pointer. Changing this trace method to take an nsWrapperCache pointer (effectively a JSObjct**) enforces correct use of Heap<T> for other TraceCallbacks callers.

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

--HG--
extra : moz-landing-system : lando
2019-10-09 14:34:16 +00:00
Tom Ritter
ff95dca4e6 Bug 1585373 - Re-enable PoisonIOInterposer for the mingw build r=dmajor
This was disabled in Bug 1441558 because it broke the mingw-gcc build.
But it doesn't break the mingw-clang build, and we don't support mingw-gcc
anymore, so we can re-enable it.

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

--HG--
extra : moz-landing-system : lando
2019-10-09 14:53:36 +00:00
Ricky Stewart
c010710916 Bug 1586358 - Replace existing instances of GENERATED_FILES with references to the GeneratedFile template r=firefox-build-system-reviewers,mshal
(Same content as bad revision https://phabricator.services.mozilla.com/D48230, but with a very small change to config/external/icu/data/moz.build to fix the build breakage.)

Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=833f6a69fcac689488a640b43e8e0bdaa086a56c

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

--HG--
extra : moz-landing-system : lando
2019-10-07 21:15:19 +00:00
Daniel Varga
052ef806b5 Backed out changeset 8d95f2c8867b (bug 1586358) for build bustage with FATAL ERROR PROCESSING MOZBUILD FILE. On a CLOSED TREE
--HG--
extra : rebase_source : 325fbad2455afc7f693087e75fa57dba79f4d86b
2019-10-07 20:22:08 +03:00
Ricky Stewart
940d91af38 Bug 1586358 - Replace existing instances of GENERATED_FILES with references to the GeneratedFile template r=nalexander
This patch doesn't remove all references to GENERATED_FILES, but does remove most of them, leaving only those which can't be trivially translated to the new template.

Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=e4a25230c3992b9c5519ceb351fb37f6b2bf605e

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

--HG--
extra : moz-landing-system : lando
2019-10-07 15:31:05 +00:00
Sylvestre Ledru
f12b9fa5c3 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2019-10-06 18:29:55 +00:00
Paul Bone
03339e515d Bug 1530251 - Remove nursery size parameter from GCRuntime::init r=jonco
Callers should use JS_SetGCParameter() instead.

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

--HG--
extra : moz-landing-system : lando
2019-10-03 05:52:54 +00:00
Simon Giesecke
f613089077 Bug 1168606 - Do not use memutils for nsTArray of IndexCursorResponse. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D43460

--HG--
extra : moz-landing-system : lando
2019-10-03 07:57:04 +00:00
Tim Nguyen
016c4ccd5b Bug 1514926 - Followup: remove now unused arrowscrollbox check from MayNeedToLoadXBLBinding. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D48023

--HG--
extra : moz-landing-system : lando
2019-10-03 04:49:15 +00:00
Emilio Cobos Álvarez
d4d8e98bd6 Bug 1585819 - Restrict loading XBL bindings from WrapObject to the little amount of XUL elements that remain with bindings. r=bzbarsky
People keep shooting themselves in the feet because of this codepath and writing
slow code.

There are just a few elements with bindings left, so just check those.

Also simplify a bit the code. The XUL element + tagname check should be pretty
fast now, and ComputedStyle objects no longer keep weak pointers to pres
contexts and such, so can be safely kept on a RefPtr across an style flush.

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

--HG--
extra : moz-landing-system : lando
2019-10-03 02:31:16 +00:00
Bogdan Tara
f9d30e06a7 Backed out 2 changesets (bug 1530251) for rust failures CLOSED TREE
Backed out changeset e03401a358a6 (bug 1530251)
Backed out changeset 42913778b66a (bug 1530251)
2019-10-02 14:49:23 +03:00
Paul Bone
846d70ee89 Bug 1530251 - Remove nursery size parameter from GCRuntime::init r=jonco
Callers should use JS_SetGCParameter() instead.

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

--HG--
extra : moz-landing-system : lando
2019-10-02 11:23:58 +00:00
Steve Fink
feb7552f85 Bug 1560667 - Annotate more callers. r=jonco
This includes some annotations to isOverridableField() that are only necessary at this point in the patch stack; the entire function will be removed shortly.

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

--HG--
extra : moz-landing-system : lando
2019-10-02 03:19:58 +00:00
Steve Fink
91b1ffaac3 Bug 1560667 - Collection of fixes for things uncovered by improvements to the hazard analysis. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D46534

--HG--
extra : moz-landing-system : lando
2019-10-02 03:20:33 +00:00
Oana Pop Rus
cb31d323be Backed out 5 changesets (bug 1168606) for xpcshell failures in dom/indexedDB/test/unit/test_temporary_storage.js on a CLOSED TREE
Backed out changeset fc5e1bee1332 (bug 1168606)
Backed out changeset 63cf0966cb41 (bug 1168606)
Backed out changeset f844afbebc6a (bug 1168606)
Backed out changeset 9e7a90dcc429 (bug 1168606)
Backed out changeset e493a6b5f125 (bug 1168606)
2019-10-02 02:28:15 +03:00
Simon Giesecke
0a2cfcff38 Bug 1168606 - Do not use memutils for nsTArray of IndexCursorResponse. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D43460

--HG--
extra : moz-landing-system : lando
2019-10-01 09:15:47 +00:00
Gabriele Svelto
3e93e048a8 Bug 1584969 - Use nsMaybeWeakPtr to simplify the nsIProcess implementation r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D47601

--HG--
extra : moz-landing-system : lando
2019-09-30 18:28:31 +00:00
Steve Fink
50cb5abc66 Bug 1583684 - Fix some rooting hazards in DOM bindings r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D47020

--HG--
extra : moz-landing-system : lando
2019-09-26 23:50:14 +00:00
Dorel Luca
fd7b19e2eb Backed out changeset 9364cff86a7e (bug 1584568) by dev's request
--HG--
extra : rebase_source : 2e7ac1ee673380994328df1d6436235895d5b5e3
2019-09-27 23:54:11 +03:00
Nathan Froyd
e284917829 Bug 1584568 - add a way to get the background event target; r=KrisWright
This function is needed for people whose needs don't map cleanly to
`NS_DispatchToBackgroundThread`, usually because they're using the event
target to do thread consistency checks.  Once we have this function, we
can start converting singleton threads/thread pools that want to use
functionality like the above.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 17:16:40 +00:00
Nathan Froyd
580e41da6a Bug 1584339 - move background event target logic into a separate class; r=KrisWright
Eventually, we're going to want to hand out an `nsIEventTarget*` to people
wanting to dispatch to background threads, but for whatever reason not
wanting to use the `NS_DispatchToBackgroundThread` API (probably because
they want to verify correctness by checking that certain methods are, in
fact, running on the background event target).  And because we're going to
want to have some sort of division between CPU-bound and IO-bound tasks, we
can't just hand out references to a single thread pool.  We need some sort
of intermediate object for both of these goals, and that is what the added
`BackgroundEventTarget` class is.

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

--HG--
extra : moz-landing-system : lando
2019-09-27 15:30:34 +00:00
Brian Hackett
7a471baa7e Bug 1483398 - Disable idle scheduler when recording/replaying, r=smaug.
Differential Revision: https://phabricator.services.mozilla.com/D47257

--HG--
extra : moz-landing-system : lando
2019-09-26 20:20:11 +00:00
Nathan Froyd
5a3128b973 Bug 1583964 - make IsOnCurrentThread for thread pools constant-time; r=KrisWright
It's fairly common for clients to hold a pointer to some private thread
and then inquire about `IsOnCurrentThread` in debug checks.  As we
migrate these private threads into some `nsIEventTarget` implementation
that might be running on thread pools, we need to ensure that those
`IsOnCurrentThread` continues to be relatively cheap.  The current
implementation for thread pools is not particularly efficient.

The inefficiency comes from having to iterate over all the threads in
the pool.  But there's no need to do this; we can just have each thread
set a particular thread-local variable to the thread pool it's running
on, and check the value of that thread-local variable instead.

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

--HG--
extra : moz-landing-system : lando
2019-09-25 22:02:08 +00:00
Josh Aas
ec1207f341 Bug 1450059 - part 1 - add a NS_DispatchToBackgroundThread function; r=KrisWright
We have a number of people starting up singleton threads for the sole
purpose of running a single runnable on them.  These consumers often
leave the thread running until some point close to shutdown, or they
never shut it down at all.  Let's add a helper function to do the thing
they actually want to do, and then we can modify the implementation of
that function as necessary as we merge singleton threads (and even
thread pools) together.

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

--HG--
extra : moz-landing-system : lando
2019-09-25 04:03:28 +00:00
Mihai Alexandru Michis
4e1448e7e6 Backed out 2 changesets (bug 1510226) for causing xpcshell crashes and xpcshell failures in test_TelemetrySession.js CLOSED TREE
Backed out changeset cb739de6606d (bug 1510226)
Backed out changeset b6f670610dc3 (bug 1510226)
2019-09-25 04:25:07 +03:00
Doug Thayer
ecdf4c1ca3 Bug 1510226 - Do not block main thread in nsThread::Init r=froydnj
To remove the blocking inside nsThread::Init, two things needed
to happen:

- Switch the ThreadInitData value passed as the argument for
  ThreadFunc to a heap allocation, so that it can outlive the call
  to nsThread::Init.
- Initialize mThread and mEventTarget->mThread to the return
  value of PR_CreateThread, so that to the callers, checks which
  depend on these values being set can continue to function.

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

--HG--
extra : moz-landing-system : lando
2019-09-23 21:07:04 +00:00
Doug Thayer
65be2b22c1 Bug 1510226 - Remove vestigial references to cooperative scheduling r=froydnj
GetCurrentPhysicalThread and GetCurrentVirtualThread are, in practice,
identical, as the TLS override that GetCurrentVirtualThread depends on
is never actually set. This simply removes that and renames some things/
deletes some comments.

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

--HG--
extra : moz-landing-system : lando
2019-08-20 18:03:11 +00:00
kriswright
ddd0133b2a Bug 1572238 - Dump assertion stacks using __android_log_print. r=Ehsan
Defines an android-only version of nsTraceRefcnt::WalkTheStack that takes a function callback, which outputs the stack frame buffer to `__android_log_print`. Also uses `__wrap_dladdr` in MozDescribeCodeAddress, which outputs slightly more informative data for the stack trace (instead of instances of '???/??? [???]').

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

--HG--
extra : moz-landing-system : lando
2019-09-24 20:50:41 +00:00
Bogdan Tara
e4913f5aeb Backed out changeset 88334e3a605e (bug 1572238) for causing windows 2012 bustages CLOSED TREE 2019-09-24 21:57:56 +03:00
kriswright
9ac396cf78 Bug 1572238 - Dump assertion stacks using __android_log_print. r=Ehsan
Defines an android-only version of nsTraceRefcnt::WalkTheStack that takes a function callback, which outputs the stack frame buffer to `__android_log_print`. Also uses `__wrap_dladdr` in MozDescribeCodeAddress, which outputs slightly more informative data for the stack trace (instead of instances of '???/??? [???]').

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

--HG--
extra : moz-landing-system : lando
2019-09-24 12:14:24 +00:00
Boris Zbarsky
12c0fbe48a Bug 927610 part 3. Stop using NS_ERROR_TYPE_ERR in serviceworker code. r=smaug
NS_ERROR_DOM_TYPE_ERR is not much better, but this at least allows us to get
rid of NS_ERROR_TYPE_ERR completely...

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

--HG--
extra : moz-landing-system : lando
2019-09-24 16:53:28 +00:00
Andrew Halberstadt
898dfb96b4 Bug 1567642 - [lint.flake8] Fix misc flake8 under Python 3 lint issues r=gbrown
Differential Revision: https://phabricator.services.mozilla.com/D45417

--HG--
extra : moz-landing-system : lando
2019-09-24 14:44:01 +00:00
Olli Pettay
1d1349d4bf Bug 1563063 - Cross-process idle handling, r=farre
This is to get initial feedback/review.
PIdleScheduler.ipdl has the documentation about the basic architecture.
(v15)

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

--HG--
extra : moz-landing-system : lando
2019-09-24 14:33:57 +00:00