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

111 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky dd6deca547 Bug 1575204. Fix crash when trying to run worker runnables on a not-ready-for-it worker thread. r=baku
We're getting crashes because either there's no CycleCollectedJSContext or it
has a null JSContext.  Hard to tell which, and whether this is happening
because our runnable comes really early in thread setup or really late in
thread teardown.  In either case, this is restoring the null-check that used to
be there in this code.

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

--HG--
extra : moz-landing-system : lando
2019-08-29 07:40:58 +00:00
Boris Zbarsky bb28e110f5 Bug 1573589. Be more explicit about propagating the "current runnable's global" through nested event loops in workers. r=baku
Some worker debugger runnables (the ones that want to evaluate script against a
debugger sandbox) depend on the JSContext being in a particular Realm before
they run, but don't really store which Realm that should be.  Instead of
propagating that state via the current Realm of the JSContext across nested
event loops, we want to propagate it explicitly.

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

--HG--
extra : moz-landing-system : lando
2019-08-15 12:51:58 +00:00
Boris Zbarsky 356eb6dfd9 Bug 1547923 part 5. Start using nsIGlobalObject::GetGlobalJSObjectPreserveColor where possible. r=mccr8,jonco
Differential Revision: https://phabricator.services.mozilla.com/D29706

--HG--
extra : moz-landing-system : lando
2019-05-03 15:15:31 +00:00
Olli Pettay 1b790f3246 Bug 1522316, use medium high priority queue for worker->main thread control messages, r=baku
If main thread is busy handling runnables in the normal priority queue, control-type of messages from
workers are possibly postponed to run after those. That can lead to bad performance, if the page
expects workers to be able to proceed simultanously with the main thread.
This patch makes the control messages to use medium high priority queue in order to try to
ensure they are handled in timely manner.
Pref dom.worker.use_medium_high_event_queue can be set to false to disable this new behavior.

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

--HG--
extra : rebase_source : 447dec6dbcccaa0206a1815c21ccf713c523fc91
2019-03-05 18:47:05 +02:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Jim Blandy 7ec799b8fc Bug 1426467: Part 4: Segregate WorkerDebuggeeRunnables into their own queues. r=baku
Remove WorkerPrivate::mQueuedRunnables and its associated functions. The
approach they implement can never be correct, as the parent window gets
'resumed' whenever the debugger resumes execution after a breakpoint. The
interrupted JavaScript invocation has not yet completed, so it is not yet time
to run mQueuedRunnables. Simply re-enqueing them at that point can cause
messages from the worker to arrive out of order.

Instead, we create a separate ThrottledEventQueue,
WorkerPrivate::mMainThreadDebuggeeEventTarget especially for
WorkerDebuggeeRunnables, runnables sent from the worker to the main thread that
should not be delivered to a paused or frozen content window. This queue is
paused and resumed by WorkerPrivate::Freeze, WorkerPrivate::Thaw,
WorkerPrivate::ParentWindowPaused, and WorkerPrivate::ParentWindowResumed.

Since this affects when WorkerDebuggeeRunnables are delivered relative to other
administrative worker runnables, WorkerDebuggeeRunnable must use a
ThreadSafeWorkerRef to ensure that the WorkerPrivate sticks around long enough
for them to run properly.

Depends on D9219

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

--HG--
extra : moz-landing-system : lando
2018-10-23 06:30:30 +00:00
Jan de Mooij 01fa47134b Bug 1479363 part 4 - Use JSAutoRealm instead of JSAutoRealmAllowCCW in dom/workers and dom/worklet. r=baku 2018-07-31 08:37:17 +02:00
Jan de Mooij 80adc67aba Bug 1478955 part 1 - Rename JSAutoRealm to JSAutoRealmAllowCCW. r=luke 2018-07-28 12:12:26 +02:00
Andrea Marchesini 037d3a703f Bug 1455256 - Port more components to WorkerRef - part 1 - WorkerProxyToMainThreadRunnable, r=asuth 2018-06-18 16:37:21 -04:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Jan de Mooij 80e44e8003 Bug 1461292 part 1 - Rename JSAutoCompartment to JSAutoRealm. r=bz,luke 2018-05-16 10:53:16 +02:00
Boris Zbarsky 9bdcffc985 Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8
The change to RootAccessible.cpp fixes an obvious bug introduced in bug 741707.

The visibility changes in gfx/thebes are because NS_DECL_ISUPPORTS has a
trailing "public:" that those classes were relying on to have public
constructors.

MozReview-Commit-ID: IeB8KIJCGhU
2018-02-12 15:44:40 -05:00
Andrea Marchesini dce09604e1 Bug 1436744 - Get rid of WorkerCheckAPIExposureOnMainThreadRunnable, r=catalinb 2018-02-12 21:02:22 +01:00
Andrea Marchesini f6957bfded Bug 1435196 - Move the webidl binding interfaces out of WorkerPrivate - part 1 - WebIDL bindings, r=bkelly 2018-02-08 08:26:05 +01:00
Andrea Marchesini 8cdf705535 Bug 1435174 - Remove the renaming 'using namespace workers', r=bkelly 2018-02-05 19:55:07 +01:00
Andrea Marchesini 2c7c69af24 Bug 1432963 - Fixing workers headers - part 14 - WorkerPrivate without workers namespace, r=smaug 2018-01-31 08:24:08 +01:00
Andrea Marchesini 063723a1f0 Bug 1432963 - Fixing workers headers - part 13 - WorkerHolder without workers namespace, r=smaug 2018-01-31 08:23:44 +01:00
Andrea Marchesini c4b257cdc6 Bug 1432963 - Fixing workers headers - part 12 - WorkerRunnable without workers namespace, r=smaug 2018-01-31 08:22:56 +01:00
Andrea Marchesini 9774cec092 Bug 1413112 - Fixing includes in dom/workers, r=bkelly 2018-01-30 10:14:00 +01:00
Andrea Marchesini 73712f7d05 Bug 1405290 - Improve logging of workers when shutting down - part 3 - WorkerHolder with names, r=asuth 2017-11-15 07:58:38 +01:00
Nika Layzell 3409141758 Bug 1414974 - Part 2: Switch many consumers to nsGlobalWindow{Inner,Outer}, r=smaug
This is a large patch which tries to switch many of the external consumers of
nsGlobalWindow to instead use the new Inner or Outer variants.

MozReview-Commit-ID: 99648Lm46T5
2017-11-09 10:44:47 -05:00
Bill McCloskey f115503a0b Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-26 14:19:58 -07:00
Carsten "Tomcat" Book 8a1350b5a6 Backed out changeset 4f6302a98ae4 (bug 1372405)
--HG--
extra : rebase_source : 41632f3158e88e692809731394a683d065a73dfb
2017-06-21 13:59:26 +02:00
Bill McCloskey 6b3e84ed5f Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-20 21:44:11 -07:00
Carsten "Tomcat" Book ea1b86680c Backed out changeset 9846de3bd954 (bug 1372405)
--HG--
extra : rebase_source : 5d4a48e8ec394c329994689d938d2a6e9b2752b0
2017-06-20 08:27:02 +02:00
Bill McCloskey 4592152411 Bug 1372405 - Provide names for all runnables in the tree (r=froydnj)
MozReview-Commit-ID: DKR6ROiHRS7
2017-06-19 22:25:47 -07:00
Andrea Marchesini 31b48170ed Bug 1368296 - Renaming WorkerProxyToMainThreadRunnable::RunBackOnWorkerThread to RunBackOnWorkerThreadForCleanup and improving the description for this method, r=asuth 2017-06-02 11:05:27 +02:00
Michael Layzell 67c4d0b3c1 Bug 1331434 - Part 7: Handle custom cleanup after throwing in /dom/workers, r=baku
MozReview-Commit-ID: 1hKUDi9Oxg7
2017-03-07 19:06:48 -05:00
Andrea Marchesini 94547f20bb Bug 604026 - Sync event loops in workers should be created only if compatible with the worker shutdown status, r=bkelly 2017-01-05 10:05:32 +01:00
Ben Kelly d48deb5760 Bug 1300659 P4 Use ThrottledEventQueue in workers. r=baku 2016-11-07 12:30:17 -08:00
Andrea Marchesini a9fedb7608 Bug 1272066 - Add telemetry for sync worker runnables, r=bkelly 2016-10-25 15:39:30 +02:00
Ben Kelly e5c5dd65ac Bug 1300658 P2 Make WorkerRunnable's destined for main thread use the MainThreadTaskQueue. r=baku 2016-09-13 20:14:02 -07:00
Wes Kocher 17b9381e0b Backed out 6 changesets (bug 1300658) for frequent Windows VM Xpcshell failures a=backout
Backed out changeset 6cf3a60640cf (bug 1300658)
Backed out changeset c74062a27462 (bug 1300658)
Backed out changeset 39fbc61739ef (bug 1300658)
Backed out changeset 0b9d70b040a2 (bug 1300658)
Backed out changeset 4e921d61f036 (bug 1300658)
Backed out changeset 56496fad6494 (bug 1300658)
2016-09-12 16:34:08 -07:00
Ben Kelly a10ca84838 Bug 1300658 P2 Make WorkerRunnable's destined for main thread use the MainThreadTaskQueue. r=baku 2016-09-12 12:32:21 -07:00
Ben Kelly a8a4ae3c4f Backout rev 5c7368370ff9 to 980659720b86 (bug 1300118 and bug 1300658) for incorrect bug number in commit message. r=me 2016-09-12 12:29:17 -07:00
Ben Kelly 7bb3320bdd Bug 1300658 P2 Make WorkerRunnable's destined for main thread use the MainThreadTaskQueue. r=baku 2016-09-12 11:21:01 -07:00
Nicholas Nethercote 34dcc7b852 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");

--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
2016-09-02 17:12:24 +10:00
Andrea Marchesini 4dedbcc6f2 Bug 1300655 - part 2 - WorkerProxyToMainThreadRunnable::PostDispatchOnMainThread::ReleaseRunnable should implement Cancel() correctly, r=me 2016-09-06 04:48:11 +02:00
Andrea Marchesini f4227c1a5c Bug 1300655 - WorkerProxyToMainThreadRunnable::PostDispatchOnMainThread::ReleaseRunnable should implement Cancel() correctly, r=bkelly 2016-09-06 04:35:49 +02: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
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
Andrea Marchesini 0ba6bcc1bb Bug 1286487 - WorkerProxyToMainThreadRunnable must keep alive workers using WorkerHolder, r=bkelly 2016-07-23 08:31:31 +02:00
Andrea Marchesini 8d82d10366 Bug 1288033 - Decease the busyCount when Cancel() is called in WorkerRunnable, r=khuey 2016-07-21 19:18:51 +02:00
Carsten "Tomcat" Book 35905db38d Backed out changeset 512f176d3de6 (bug 1288033) to fix a incomplete backout 2016-07-21 12:36:38 +02:00
Iris Hsiao 5743985035 Backed out changeset 90c6741cda5d (bug 1288033) for web platform e10s failure
--HG--
extra : rebase_source : ac45da19b7ef5649729d44c0046c73711ec3f702
2016-07-21 17:52:56 +08:00
Andrea Marchesini 00b39908d5 Bug 1288033 - part 2 - fixed a compilation error, r=me 2016-07-21 09:56:11 +02:00
Andrea Marchesini f7d06c7a06 Bug 1288033 - Decease the busyCount when Cancel() is called in WorkerRunnable, r=khuey 2016-07-21 09:17:41 +02:00
Andrea Marchesini f8eb805f14 Bug 1286615 - Wrong use of ModifyBusyCountFromWorker in WorkerProxyToMainThreadRunnable, r=khuey 2016-07-18 09:17:21 +02:00
Boris Zbarsky eb139d85bf Bug 1279313 part 1. Simplify AutoEntryScript to not make callers pass in a JSContext. r=bholley 2016-07-07 20:08:25 -04:00
Andrea Marchesini 43868a9da7 Bug 1282366 - Improve WorkerHolder use in Runnables, r=khuey 2016-07-04 08:19:10 +02:00