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

19500 Коммитов

Автор SHA1 Сообщение Дата
Kershaw Chang 60f6486027 Bug 1579049 - P1: Map Http error response codes to gecko error codes r=mayhemer,valentin
Differential Revision: https://phabricator.services.mozilla.com/D49903

--HG--
extra : moz-landing-system : lando
2019-11-21 14:24:36 +00:00
Boris Zbarsky 73fb775116 Bug 1597158 part 4. Stop unlocking the provided mutex in IdlePeriodState methods. r=smaug
The basic idea, suggested by Olli, is that we can try to get a runnable in
ThreadEventQueue::GetEvent, and if that does not produce anything unlock our
mutex, do whatever idle state updates we need to do, re-lock our mutex.  Then
always we need to try getting a runnable again, because a non-idle runnable
might have gotten queued while we had the lock unlocked.  So we can't sleep on
our mutex, in the mayWait case, unless we try to get a runnable again first.

My notes on the current (pre this patch) unlocking setup follow.
------------------------------------------------------------

There are four places where we currently unlock:

1) IdlePeriodState::GetIdleDeadlineInternal.  Needed only when !aIsPeek, to
RequestIdleToken, which can do IPC.  The only caller, via
GetDeadlineForIdleTask, is PrioritizedEventQueue::GetEvent and only when we
selected the idle or deferred queue.  We need this to set the proper deadline
on the idle event.  In the cases when this unlock happens we currently _never_
return an idle event, because if we got here that means that we do not have an
idle token.

2) IdlePeriodState::GetLocalIdleDeadline.  Needs to unlock to get the idle
period hint.  The can get called from GetIdleDeadlineInternal in _both_ cases:
peek and get.  The callstack for the get case is covered above.  The peek case
is called from PrioritizedEventQueue::HasReadyEvent which is called from
ThreadEventQueue::HasPendingEvent.

3) IdlePeriodState::SetPaused, because it sends an IPC message.  This is only
called from EnsureIsPaused, which is called from:
  - IdlePeriodState::GetIdleDeadlineInternal.  Only in the !aIsPeek case.
  - IdlePeriodState::RanOutOfTasks called from:
    - PrioritizedEventQueue::GetEvent if we fell into the idle case and our
      queues are empty.
    - PrioritizedEventQueue::DidRunEvent if we are empty.

4) IdlePeriodState::ClearIdleToken because it sends an IPC message.  This is
called from:
    - IdlePeriodState::RanOutOfTasks; see SetPaused.
    - IdlePeriodState::GetIdleDeadlineInternal like EnsureIsPaused.
    - IdlePeriodState::GetIdleToken if token is in the past.  This is only
      called from GetIdleDeadlineInternal, both cases.
    - IdlePeriodState::FlagNotIdle called from PrioritizedEventQueue::GetEvent
      if we find an event in a non-idle queue.

Or rewriting in terms of API entrypoints on IdlePeriodState that might need to
unlock:

* Anything to do with getting deadlines, whether we are peeking or getting.
  Basically, if we need an updated deadline we need to unlock.
* When we have detected we are completely out of tasks (idle or not) to run.
  Right now we do that when either we're asked for an event and don't have one
  or if we run an event and are empty after that (before unlocking!).  But the
  unlocking or not happens in nsThreadEventQueue::DidRunEvent, so separately
  from the getting of the event.  In particular, we are unlocked before we
  enter DidRunEvent, and unlock again before we return from it, so we can do
  whatever updates we want there.
* When we have detected that we have a non-idle event to run; this calls
  FlagNotIdle.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 14:06:17 +00:00
Boris Zbarsky e2ef656e02 Bug 1597158 part 3. Expose whether there are any idle runnables on PrioritizedEventQueue. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D53629

--HG--
extra : moz-landing-system : lando
2019-11-22 14:06:29 +00:00
Boris Zbarsky b5c22f1dda Bug 1597158 part 2. Expose the IdlePeriodState of a PrioritizedEventQueue to its consumers. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D53628

--HG--
extra : moz-landing-system : lando
2019-11-22 14:05:30 +00:00
Boris Zbarsky 093002cffe Bug 1597158 part 1. Change the GetEvent signature on PrioritizedEventQueue to return whether we considered running idle runnables. r=smaug
The caller will need to know this to properly update idle state.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 14:03:23 +00:00
Andreas Tolfsen 4a8b5c26b8 bug 1543115: remote: expose nsIRemoteAgent as XPCOM service; r=remote-protocol-reviewers,maja_zf,nika
This change makes it possible to access the remote agent service
from C++ and Rust.

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

--HG--
extra : moz-landing-system : lando
2019-11-22 08:03:19 +00:00
Randell Jesup 6835880244 Bug 1597728: Make EventQueue support templatization for queue page size r=froydnj
Most event queues don't ever get many events queued at one time, but the
MainThread Input and Normal queues may.

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

--HG--
extra : moz-landing-system : lando
2019-11-21 03:47:19 +00:00
Randell Jesup ede385148e Bug 1597601: Make event Queues use the first buffer as a circular buffer r=froydnj
This should avoid freeing and reallocating the buffer every N events, and
make it simpler to use smaller buffers, especially for non-MainThread queues.

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

--HG--
extra : moz-landing-system : lando
2019-11-21 03:47:09 +00:00
Randell Jesup 64e6884811 Bug 1595707: don't record event submission times when the profiler isn't running r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D53910

--HG--
extra : moz-landing-system : lando
2019-11-21 03:46:59 +00:00
Aaron Klotz 72c46c09e0 Bug 1598098: Eradicate "using namespace mozilla;" from xpcom/build; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D54020

--HG--
extra : moz-landing-system : lando
2019-11-20 19:58:05 +00:00
Daniel Varga 420bc7e3b5 Backed out 9 changesets (bug 1543115) for build bustage with fatal error: 'nsIRemoteAgent.h' file not found. On a CLOSED TREE
Backed out changeset df184d5f766a (bug 1543115)
Backed out changeset 0316a7fa9d37 (bug 1543115)
Backed out changeset 99ae1cdbaa69 (bug 1543115)
Backed out changeset 825f6b55865a (bug 1543115)
Backed out changeset 6480cdbd004c (bug 1543115)
Backed out changeset 4ecb2e70e855 (bug 1543115)
Backed out changeset 76ebc0f74bff (bug 1543115)
Backed out changeset 8a931eb7b0c8 (bug 1543115)
Backed out changeset 72c162fff80c (bug 1543115)

--HG--
rename : remote/components.conf => remote/RemoteAgent.conf
2019-11-19 15:54:15 +02:00
Andreas Tolfsen 2cb1328cc1 bug 1543115: remote: expose nsIRemoteAgent as XPCOM service; r=remote-protocol-reviewers,maja_zf,nika
This change makes it possible to access the remote agent service
from C++ and Rust.

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

--HG--
extra : moz-landing-system : lando
2019-11-19 12:32:51 +00:00
Boris Zbarsky 6fe40421c1 Bug 1597157. Remove unused mNextIdleDeadline bits. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D53626

--HG--
extra : moz-landing-system : lando
2019-11-18 17:05:30 +00:00
Andrew McCreight da44f8664a Bug 1595629 - Note intentional crashes in NS_DEBUG_ABORT and nsTerminator. r=froydnj
This will prevent the leak checker from reporting a missing log for
that process, which results in incorrect starring on TreeHerder. Both
of these failures should be detected as a failure.

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

--HG--
extra : moz-landing-system : lando
2019-11-16 01:38:22 +00:00
Sylvestre Ledru 980fe73a9f Bug 1594350 - Fix two python pycompat warnings r=ahal
Differential Revision: https://phabricator.services.mozilla.com/D52250

--HG--
extra : moz-landing-system : lando
2019-11-15 20:52:59 +00:00
Paul Bone 93489fe04d Bug 1596198 - Remove the canary from nsStringBuffer r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D52961

--HG--
extra : moz-landing-system : lando
2019-11-14 22:50:31 +00:00
Toshihito Kikuchi 4d2777385a Bug 1588975 - Replace ShellExecuteExW with mozilla::ShellExecuteByExplorer. r=aklotz,asuth
The launcher process turns on the `PreferSystem32Images` mitigation policy for
the browser process.  Since the mitigation policy is inherited, a process launched
by the browser process also has `PreferSystem32Images`.  If an application which
does not support `PreferSystem32Images`, such as Skype for Business, is launched
via a hyperlink, a custom uri, or a downloaded file, it would fail to launch.

Bug 1567614 fixed this issue by introducing `mozilla::ShellExecuteByExplorer` to
`nsMIMEInfoWin::LoadUriInternal`.  This patch introduces
`mozilla::ShellExecuteByExplorer` to two more places.

1. xul!nsLocalFile::Launch
This is invoked when a user opens a file from the Download Library, or a user
opens a downloaded file with the default application without saving it.

2. xul!nsMIMEInfoWin::LaunchWithFile
This is invoked when a user opens a downloaded file with a custom application
(configured in about:preference) without saving it.

*Why does this patch change worker.js?*

The mochitest dom/tests/browser/browser_test_new_window_from_content.js failed
if it was executed after dom/serviceworkers/test/browser_download.js in the
same batch.  This was because browser_download.js launched Notepad to open
fake_download.bin.txt, preventing a new window from being opened in the
foreground in browser_test_new_window_from_content.js.

The test browser_download.js can verify downloaded data without opening an
associated application.  So this patch adds the content-type to the response
header in order not to open Notepad on Windows.

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

--HG--
extra : moz-landing-system : lando
2019-11-14 19:47:29 +00:00
Andrew McCreight 04c213c0b4 Bug 1596244 - Report a fake leak instead of crashing if NSS fails to shut down. r=froydnj,keeler
Some kinds of leaks prevent NSS to not shut down properly, and right
now if that happens we crash. This interferes with our existing leak
checking code, so in this patch I make it not crash if we are already
leak checking. The failure is reported as a fake leak, so the test
should still fail when testing.

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

--HG--
extra : moz-landing-system : lando
2019-11-14 14:51:53 +00:00
Doug Thayer 97c5d40384 Bug 1586920 - Sometimes include dynamic string of label frames in BHR r=nika
This adds two AUTO_PROFILER_LABEL_DYNAMIC_... macros and updates select
usages of the old macros to use the new ones. These new macros cause
the dynamic string of the label to be included in BHR stacks.

We don't want to do this all of the time, as in many cases we may not
be interested enough in the dynamic string or it may be sensitive
information, but it is rather important information for certain cases.

This uses the same buffer that we use for the strings for JS frames,
and if we fail to fit into that buffer we just append the raw label.

If the string is too long for our static buffer (128 bytes), we just
leave it truncated, as it should be stable and we may be able to infer
from the truncated form what the full form would be.

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

--HG--
extra : moz-landing-system : lando
2019-11-11 20:27:44 +00:00
Emilio Cobos Álvarez ad56e58826 Bug 1595212 - Use MaybeUninit in nsString tests. r=SimonSapin
Differential Revision: https://phabricator.services.mozilla.com/D52824

--HG--
extra : moz-landing-system : lando
2019-11-13 12:39:23 +00:00
Simon Giesecke 28f1dd4c5b Bug 1595750 - Add MakeBackInserter function to create a back-inserting output iterator for nsTArray. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D52685

--HG--
extra : moz-landing-system : lando
2019-11-13 09:06:42 +00:00
Mirko Brodesser 9997183bdd Bug 1591417: part 3) Add `nsTStringRepr<T>::EqualsLatin1`. r=froydnj
Needed to compare with `nsTextFragment::Get1b()` which returns latin1-encoded
characters. Used in a subsequent review.

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

--HG--
extra : moz-landing-system : lando
2019-11-12 15:20:25 +00:00
Noemi Erli 985bd5675a Backed out changeset 9b131da7e0cc (bug 1595750) for causing Windows build bustages CLOSED TREE 2019-11-12 20:08:09 +02:00
Andrew McCreight f922f43922 Bug 1595828 - Fix some include guards. r=froydnj
The formatting change presumably happens because clang-format treats
include guards differently.

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

--HG--
extra : moz-landing-system : lando
2019-11-12 17:27:20 +00:00
Andrew McCreight b6345fe53d Bug 1595812 - Fix include guard in IntentionalCrash.h. r=froydnj
The include guard needs to happen before any non-trivial tokens.

I guess this change made clang-format decide the other ifdefs aren't
actually nested, so it dropped the indents.

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

--HG--
extra : moz-landing-system : lando
2019-11-12 16:13:14 +00:00
Simon Giesecke e0f8b73760 Bug 1595750 - Add MakeBackInserter function to create a back-inserting output iterator for nsTArray. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D52685

--HG--
extra : moz-landing-system : lando
2019-11-12 15:52:24 +00:00
John Dai 790ed5a490 Bug 1552313 - Implement disableShadow; r=smaug,edgar
Differential Revision: https://phabricator.services.mozilla.com/D52157

--HG--
extra : moz-landing-system : lando
2019-11-12 11:27:52 +00:00
John Dai 128e81de25 Bug 1552313 - Implement custom element disabledFeatures and disableInternals; r=smaug,edgar
- Introduce `dom.webcomponents.elementInternals.enabled` for custom element's elementInternals.
- Implement disabledFeatures static field and disableInternals.
- Refactor get observedAttributes sequence.

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

--HG--
extra : moz-landing-system : lando
2019-11-12 11:27:45 +00:00
Sylvestre Ledru d2eabf8906 Bug 1562642 - add missing license in xpcom/ r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D52579

--HG--
extra : moz-landing-system : lando
2019-11-11 21:44:32 +00:00
Dorel Luca cbf2994b14 Backed out 3 changesets (bug 1552313) for WPT failures in custom-elements/CustomElementRegistry.html. CLOSED TREE
Backed out changeset 27a01989152a (bug 1552313)
Backed out changeset 5f8c6c9f2d36 (bug 1552313)
Backed out changeset f26d61e06a9d (bug 1552313)
2019-11-11 20:55:58 +02:00
John Dai 708988da6b Bug 1552313 - Implement disableShadow; r=smaug,edgar
Differential Revision: https://phabricator.services.mozilla.com/D52157

--HG--
extra : moz-landing-system : lando
2019-11-11 15:42:58 +00:00
John Dai e95dd01125 Bug 1552313 - Implement custom element disabledFeatures and disableInternals; r=smaug,edgar
- Introduce `dom.webcomponents.elementInternals.enabled` for custom element's elementInternals.
- Implement disabledFeatures static field and disableInternals.
- Refactor get observedAttributes sequence.

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

--HG--
extra : moz-landing-system : lando
2019-11-11 15:42:56 +00:00
Ehsan Akhgari 4e7fddabcb Bug 1542885 - Make some event related atoms static in order to reduce content process memory usage; r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D51488

--HG--
extra : moz-landing-system : lando
2019-11-04 18:04:14 +00:00
Bogdan Tara 80377e90ee Backed out 6 changesets (bug 1552176) for causing Hazard bustages CLOSED TREE
Backed out changeset c79b90bae420 (bug 1552176)
Backed out changeset 4b970cc771ca (bug 1552176)
Backed out changeset de7aa0eaf4c8 (bug 1552176)
Backed out changeset c8e692a40cd3 (bug 1552176)
Backed out changeset 68882d1eccac (bug 1552176)
Backed out changeset 692e5e51e19e (bug 1552176)
2019-11-11 12:11:36 +02:00
Valentin Gosu 0680f64f28 Bug 1552176 - Generate rust methods from cenum idl r=nika
This patch changes the xpidl parser to generate the rust trait code for
methods that take or return a cenum value.
Previously this would return an error, which means that adding a method
that uses cenums to an existing interface could cause rust code that
implements that interface to fail to build.

The generated methods take or return u8/u16/u32 depending on the width of the
enum. While this is not optimal (the parameter could contain values that are
not actually part of the enum), this is similar to what we do for nsLoadFlags.
In the future it would be nice to generate code that actually checks the
values are present in the enum, and to use a typedef instead of a plain
unsigned int.

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

--HG--
extra : moz-landing-system : lando
2019-11-10 17:12:32 +00:00
Randell Jesup 4be7858359 Bug 1572337: Make GetRunningEventDelay handle threadpools r=froydnj
Threadpools run an event that then runs other events, so we need to tweak
things for GetRunningEventDelay()

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

--HG--
extra : moz-landing-system : lando
2019-11-08 21:07:45 +00:00
Randell Jesup 6cc1163786 Bug 1572337: Monitor running event delays and start times r=froydnj
This lets us determine the time that an event has been running, and the time
that the event spent queued - which can be used to figure out 'jank' at the
time the event was queued. For PrioritizedEventQueues, only if such queuing
would delay an input event then the queuing delay is reported.

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

--HG--
extra : moz-landing-system : lando
2019-11-08 21:07:36 +00:00
Randell Jesup 48ca7ca3d8 Bug 1572337: ensure MainThread is registered with the profiler properly r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D41619

--HG--
extra : moz-landing-system : lando
2019-11-08 21:07:29 +00:00
Bogdan Tara 8f38f4a3fb Backed out 6 changesets (bug 1552176) for bustages complaining about ServiceWorkerManager.cpp CLOSED TREE
Backed out changeset bff9110e434e (bug 1552176)
Backed out changeset ac8f8a6dbd98 (bug 1552176)
Backed out changeset 8dd630e7534a (bug 1552176)
Backed out changeset 7ce9e220cdb9 (bug 1552176)
Backed out changeset ee9911acfcd4 (bug 1552176)
Backed out changeset 652b3bd6848d (bug 1552176)
2019-11-08 22:18:05 +02:00
Valentin Gosu b5ca94720e Bug 1552176 - Generate rust methods from cenum idl r=nika
This patch changes the xpidl parser to generate the rust trait code for
methods that take or return a cenum value.
Previously this would return an error, which means that adding a method
that uses cenums to an existing interface could cause rust code that
implements that interface to fail to build.

The generated methods take or return u8/u16/u32 depending on the width of the
enum. While this is not optimal (the parameter could contain values that are
not actually part of the enum), this is similar to what we do for nsLoadFlags.
In the future it would be nice to generate code that actually checks the
values are present in the enum, and to use a typedef instead of a plain
unsigned int.

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

--HG--
extra : moz-landing-system : lando
2019-11-08 17:13:59 +00:00
Nathan Froyd bc5cca4b95 Bug 1594730 - fix silly bug for the background event target; r=KrisWright
The static analysis caught this for me in Bug 1593812, I was just to
dumb to actually apply this change prior to commit.

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

--HG--
extra : moz-landing-system : lando
2019-11-07 16:04:45 +00:00
Matt Woodrow 1ec616f192 Bug 1593560 - Only return false from NS_InputStreamIsBuffered if the underlying object doesn't implement ReadSegments. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D51549

--HG--
extra : moz-landing-system : lando
2019-11-06 22:37:07 +00:00
Razvan Maries cb87085ec4 Backed out 3 changesets (bug 1572337) ford perma fails. CLOSED TREE
Backed out changeset 00da7156d3fa (bug 1572337)
Backed out changeset 4eda65e054d8 (bug 1572337)
Backed out changeset ea6d5b4b038b (bug 1572337)
2019-11-07 17:29:46 +02:00
Randell Jesup 95192d13e3 Bug 1572337: Make GetRunningEventDelay handle threadpools r=froydnj
Threadpools run an event that then runs other events, so we need to tweak
things for GetRunningEventDelay()

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

--HG--
extra : moz-landing-system : lando
2019-11-07 12:53:32 +00:00
Randell Jesup 0be1d80429 Bug 1572337: ensure MainThread is registered with the profiler properly r=gerald
Differential Revision: https://phabricator.services.mozilla.com/D41619

--HG--
extra : moz-landing-system : lando
2019-11-07 12:53:26 +00:00
Randell Jesup 10353eba91 Bug 1572337: Monitor running event delays and start times r=froydnj
This lets us determine the time that an event has been running, and the time
that the event spent queued - which can be used to figure out 'jank' at the
time the event was queued. For PrioritizedEventQueues, only if such queuing
would delay an input event then the queuing delay is reported.

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

--HG--
extra : moz-landing-system : lando
2019-11-07 12:53:28 +00:00
Nathan Froyd 1b72ad9705 Bug 1593812 - add I/O awareness for the background thread target; r=KrisWright
We need some way of differentiating "tasks that just consume CPU"
vs. "tasks that block on some external resource" like reading from a
socket or a file.  If we didn't have this, we'd either a) have a thread
pool sized for the number of CPUs where having all the threads blocked
on I/O--and therefore no new tasks are able to run--or b) have a thread
pool that tries to increase the number of working threads based on the
number of submitted tasks and winds up having too many tasks running
with not enough CPUs to run them on.

This flag enables us to theoretically get the best of both worlds: we
can set aside `~#CPUs` threads for CPU-intensive work, and
`$SOME_NUMBER` threads for I/O work.  The latter number can be adjusted
up if the I/O load on the system is particularly heavy.

The implementation strategy of this patch is to use two separate thread
pools for the two different kinds of work.  It's entirely possible that
we'll want to use a single thread pool to coordinate thread create
between the two kinds of work, or even migrate threads from one kind of
work to the other, but such improvements can be future work.  The focus
right now is providing the rest of Gecko with a common funnel to put
tasks into, and we can adjust what's at the end of the funnel at a later
point.

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

--HG--
extra : moz-landing-system : lando
2019-11-05 18:33:25 +00:00
Coroiu Cristina cbdbc8bc4b Backed out 7 changesets (bug 1593560) for crashtest failures at tests/layout/base/crashtests/446328.html on a CLOSED TREE
Backed out changeset 7dfae085a4cb (bug 1593560)
Backed out changeset 9842c80c98d8 (bug 1593560)
Backed out changeset d67a10437af7 (bug 1593560)
Backed out changeset 3e3948e9531c (bug 1593560)
Backed out changeset a7d04e276b44 (bug 1593560)
Backed out changeset 9f52c9f6dc54 (bug 1593560)
Backed out changeset 90572c49d464 (bug 1593560)
2019-11-07 00:32:53 +02:00
Dorel Luca 819a6c47e8 Merge mozilla-central to autoland. CLOSED TREE 2019-11-07 00:08:31 +02:00
Dorel Luca a0370f2bc4 Backed out changeset 955256297d6d (bug 1579367) for causing a top crash in Bug 1594404. a=backout 2019-11-06 23:19:09 +02:00