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

573 Коммитов

Автор SHA1 Сообщение Дата
Boris Zbarsky 5a8005ef1e Bug 1252189. Remove the unnecessary JSContext argument from WorkerPrivate::FreezeInternal/ThawInternal. r=khuey 2016-02-29 14:52:43 -05:00
Boris Zbarsky 27c76101f3 Bug 1252185. Remove the dead "target" variable from CloseEventRunnable::WorkerRun. r=khuey 2016-02-29 14:52:43 -05:00
Boris Zbarsky 69924c14ce Bug 1252123. Remove some unnecessary JSContext arguments from worker ScriptLoader methods. r=khuey 2016-02-29 14:52:42 -05:00
Boris Zbarsky 663b9bd562 Bug 1252091. Add/RemoveFeature don't need a JSContext argument. r=khuey 2016-02-29 14:52:42 -05:00
Boris Zbarsky e24a128e22 Bug 1251380. Change things so that WorkerPrivate::NotifyInternal (hopefully) never throws. r=khuey 2016-02-26 21:15:56 -05:00
Boris Zbarsky 35d98f4893 Bug 1251276 part 2. Remove the JSContext argument of WorkerPrivate::CancelAllTimeouts. r=khuey 2016-02-26 21:15:56 -05:00
Boris Zbarsky 7dc5bbf023 Bug 1251276 part 1. Change WorkerPrivate::CancelAllTimeouts to no longer call RunExpiredTimeouts. r=khuey
If you walk through what RunExpiredTimeouts used to when called from here do
carefully, it used to do the following:

1)  If mRunningExpiredTimeouts, no-op.
2)  Not run anything, because everything is canceled.
3)  Remove everything from mTimeouts, since everything is canceled.
4)  Since mTimeouts is now empty, modify the busy count and set mTimerRunning to false.

None of this could report a JS exception, so the JS_ReportPendingException call
in CancelAllTimouts was dead code.  Note that the return value of
RunExpiredTimeouts only affected whether JS_ReportPendingException is called, so
we don't even need to worry about ModifyBusyCountFromWorker failing: that
failure used to be silently swallowed.
2016-02-26 21:15:56 -05:00
Boris Zbarsky 7413f2bf46 Bug 1251369. Use an AutoJSAPI that reports its own exceptions around the main runloop in workers. r=khuey
The silly leading ": " on the error messages is due to bug 1251518.
2016-02-26 15:23:13 -05:00
Boris Zbarsky d3cc781844 Bug 1251275. Switch to using an AutoEntryScript in WorkerPrivate::RunExpiredTimeouts. r=khuey 2016-02-26 15:23:13 -05:00
Boris Zbarsky 7d27e1dd3d Bug 1251272. Remove the dead code in ReportErrorRunnable::ReportError that could fail, and make it infallible. r=khuey 2016-02-26 15:23:12 -05:00
Boris Zbarsky 94e6475a9c Bug 1251045 part 7. Remove the JSContext argument from some worker methods that no longer need it. r=khuey 2016-02-26 15:23:12 -05:00
Boris Zbarsky 60b1a3f005 Bug 1251045 part 6. Remove the JSContext argument from some worker debugger methods that no longer need it. r=khuey 2016-02-26 15:23:12 -05:00
Boris Zbarsky 886e3a27d5 Bug 1251045 part 5. Remove the JSContext argument from WorkerPrivateParent::Freeze/Thaw. r=khuey 2016-02-26 15:23:12 -05:00
Boris Zbarsky 7345c5edb1 Bug 1251045 part 4. Remove the JSContext argument of WorkerRunnable::Dispatch. r=khuey 2016-02-26 15:23:12 -05:00
Boris Zbarsky 878fd26e89 Bug 1251045 part 3. Remove the JSContext argument of WorkerRunnable::PostDispatch and its overrides. r=khuey 2016-02-26 15:23:12 -05:00
Boris Zbarsky d0b2f4eeda Bug 1251045 part 2. Remove the JSContext argument of ModifyBusyCountFromWorker. r=khuey 2016-02-26 15:23:12 -05:00
Boris Zbarsky 757ffe77e7 Bug 1251045 part 1. Make it possible to dispatch a ModifyBusyCountRunnable without a JSContext. r=khuey 2016-02-26 15:23:11 -05:00
Eddy Bruel 350b7f0b05 Bug 1241841 - Clear the worker's debugger event queue before destroying its context;r=khuey 2016-02-26 17:32:28 +01:00
Boris Zbarsky cc6606ed0d Bug 1250975. Stop passing a JSContext argument to WorkerRunnable::PreDispatch and its overrides. r=khuey 2016-02-25 16:05:39 -05:00
Boris Zbarsky f0afee106b Bug 1250963 part 2. Remove the unused JSContext argument of WorkerPrivate::ModifyBusyCount. r=khuey 2016-02-25 16:05:39 -05:00
Boris Zbarsky 239833a69f Bug 1250963 part 1. Change NotifyRunnable::Dispatch to not require a JSContext. r=khuey
The only reason NotifyRunnable::Dispatch needs a JSContext is so that it can call
ModifyBusyCount in Pre/PostDispatch.  The only reason that needs a JSContext is
to call Cancel(), which only needs it to call Notify(), which only needs it to
call NotifyPrivate, which only needs it to dispatch a NotifyRunnable.
2016-02-25 16:05:39 -05:00
Wes Kocher 56ccaea947 Backed out 2 changesets (bug 1250963) for build bustage CLOSED TREE
Backed out changeset 257324c2ae17 (bug 1250963)
Backed out changeset 0e868ee89abc (bug 1250963)

--HG--
extra : commitid : HglxXI0Tb1b
2016-02-25 13:41:42 -08:00
Wes Kocher d66f0ad3fc Backed out changeset bb404647f14c (bug 1250975) for build bustage CLOSED TREE
--HG--
extra : commitid : KyFNIQ1ugVq
2016-02-25 13:41:09 -08:00
Boris Zbarsky 683b099eb9 Bug 1250975. Stop passing a JSContext argument to WorkerRunnable::PreDispatch and its overrides. r=khuey 2016-02-25 16:05:39 -05:00
Boris Zbarsky 47ec3963e4 Bug 1250963 part 2. Remove the unused JSContext argument of WorkerPrivate::ModifyBusyCount. r=khuey 2016-02-25 16:05:39 -05:00
Boris Zbarsky 51c7f27d3a Bug 1250963 part 1. Change NotifyRunnable::Dispatch to not require a JSContext. r=khuey
The only reason NotifyRunnable::Dispatch needs a JSContext is so that it can call
ModifyBusyCount in Pre/PostDispatch.  The only reason that needs a JSContext is
to call Cancel(), which only needs it to call Notify(), which only needs it to
call NotifyPrivate, which only needs it to dispatch a NotifyRunnable.
2016-02-25 16:05:39 -05:00
Daniel Holbert a192831f74 backout c42ff6847631 (bug 1250572) for causing aborts during startup 2016-02-24 11:54:35 -08:00
Andrea Marchesini 53c0f726fe Bug 1250572 - Force a parent object in MessagePort/Channel and in StructuredCloneHolder, r=smaug 2016-02-24 20:04:37 +01:00
Boris Zbarsky bb7c756f0e Bug 1249652 part 3. Simplify way we handle canceling when ScriptLoaderRunnable::RunInternal fails by canceling things with its actual failure code, so we don't have to guess which failed loads are actual failures and which are just canceled via this mechanism. r=baku,khuey
There is a bit of subtlety here with NS_BINDING_ABORTED.  Before these changes,
we would land in ReportLoadError, not do anything with NS_BINDING_ABORTED, and
just return.  If called from WorkerPrivate::Constructor we'd then go ahead and
throw it on the ErrorResult, but I'm pretty sure we never ended up with
NS_BINDING_ABORTED there.  If called from ScriptExecutorRunnable::WorkerRun, we
would proceed on to ScriptExecutorRunnable::PostRun and hence
ShutdownScriptLoader where we would throw on the ErrorResult but NOT on the
JSContext.  Then we would unwind to our consumer and if that consumer was a
toplevel script load we would suppress the exception on the ErrorResult.
Otherwise we'd go ahead and throw the exception we ended up with to the caller.

The upshot is that we used to not fire error events on a worker whose main
script load was canceled with NS_BINDING_ABORTED.  So we try to preserve that
behavior explicitly for toplevel scripts.
2016-02-24 10:38:31 -05:00
Boris Zbarsky 2ac6ce9202 Bug 1249652 part 2. ScriptExecutorRunnable::WorkerRun should immediately move JS exceptions to its ErrorResult instead of allowing them to linger on the JSContext. r=baku,khuey 2016-02-24 10:38:31 -05:00
Eddy Bruel dae2755a45 Bug 1119490 - Expose the URL constructor to WorkerDebuggerGlobalScope;r=khuey 2016-02-22 10:41:09 +01:00
Boris Zbarsky 13359b10de Bug 1249102. Make overrides of WorkerRunnable::PostRun a bit more consistent. r=khuey
Specifically we make the following changes:

1)  Remove WorkerSameThreadRunnable::PostRun, because it does exactly the same
things as WorkerRunnable::PostRun.

2)  Always treat ModifyBusyCountFromWorker as infallible in terms of throwing
JS exceptions.

3)  Change ExtendableFunctionalEventWorkerRunnable::PostRun to properly call
its superclass PostRun so we will correctly decrement the busy count our
PreDispatch incremented.

4)  Document why some overrides of PreDispatch/PostDispatch are needed and
don't call into the superclass
2016-02-18 18:02:51 -05:00
Kyle Huey 31dabb4558 Bug 1247117: De-namespace much of IndexedDB. r=baku 2016-02-16 13:46:08 -08:00
Aidin Gharibnavaz 686438c658 Bug 1164581 - Adding an overload for NS_ProxyRelease that accepts already_AddRefed, and removing all the others. r=bobbyholley 2016-02-10 08:23:00 +01:00
Carsten "Tomcat" Book 5b358688b7 Backed out changeset c18e29c1b369 (bug 1164581) for cpp unit tests test failures
--HG--
extra : rebase_source : fb6fd434c8e3f4b5fa53ea645a54c07cab207894
2016-02-08 11:17:38 +01:00
Aidin Gharibnavaz 69cf7e035f Bug 1164581 - Adding an overload for NS_ProxyRelease that accepts already_AddRefed, and removing all the others. r=bobbyholley
--HG--
extra : rebase_source : 3c6bba6613a14e48239d302bdd0f7fe2e322265d
2016-02-07 10:56:00 +01:00
Birunthan Mohanathas d7371d07d0 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Andrea Marchesini 75115ed2f7 Bug 1243881 - patch 2 - unship performance.translateTime, r=bz 2016-02-01 21:48:04 +00:00
Phil Ringnalda d381b4bca6 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas 373593275e Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Kyle Huey 91efc5a86c Bug 1241764: Replace nsPIDOMWindow with nsPIDOMWindowInner/Outer. r=mrbkap,smaug 2016-01-30 09:05:36 -08:00
Luke Wagner 72ea23c63e Bug 1239601 - improve the UniquePtr situation (r=jandem)
--HG--
extra : commitid : JegWAoGsuQ9
extra : rebase_source : 995c1b6ab8e4fd3b83c44741cd84a2d7b0d934d7
2016-01-15 18:26:20 -06:00
Andrea Marchesini 7167daa292 summary: Bug 1231378 - part 5 - Fix uninitialized members of classes in dom/{workers,events,media,canvas}, r=smaug 2016-01-12 18:16:59 +00:00
Carsten "Tomcat" Book 00abd66130 Backed out changeset 6d08ab04a77c (bug 1231378) 2016-01-12 15:48:53 +01:00
Andrea Marchesini 98f16784c5 Bug 1231378 - part 5 - Fix uninitialized members of classes in dom/{workers,events,media,canvas}, r=smaug 2016-01-12 13:57:37 +00:00
Andrea Marchesini 1e9d936689 Bug 1228456 - add 'override' to the Cancel() method of a nsICancelableRunnable, rs=me 2016-01-07 18:45:09 +00:00
Andrea Marchesini 7ac7825383 Bug 1228456 - SharedWorker should close the MessagePort in case the connecting runnable is not dispatched, r=smaug 2016-01-07 18:01:56 +00:00
Eddy Bruel 4a221d8be9 Bug 1211903 - WorkerDebugger should live on the main thread;r=khuey 2016-01-07 13:35:31 +01:00
Kyle Huey 1ab13f2322 Bug 1059469: Part 2 - When rescheduling the interval timer, cancel it first, and refactor things so that actually does something. r=bent
RunExpiredTimeouts has "fudging" code to always ensure that we execute at least one timeout.  This is intended to cover cases where an nsITimer fires slightly early, but it means we must be careful not to fire a timer more times than we intend to or we'll execute a timeout prematurely.

Consider a sequences of setTimeout calls alternating in delay between 0ms and 1000ms.  When the 1000ms timeout fires, it schedules a 0ms timeout.  The setTimeout call itself calls RescheduleTimeoutTimer, which schedules the timer for a 0 ms delay.  And once we unwind the 1000ms timeout RunExpiredTimeouts will also schedule the timer for a 0 ms delay.  If the timer has fired (remember, it's processed on a completely different thread) in the meantime, we ultimately will get two callbacks from nsITimer for our 0 ms timeout.  The first will run the 0 ms timeout and schedule a 1000 ms timeout, and the second will run the 1000 ms timeout (remember, RunExpiredTimeouts always runs at least one timeout!) ~999 ms ahead of schedule.

The solution is to cancel the timer in RescheduleTimeoutTimer, so that when we call it the second time it will cause any pending events from the first scheduling to be canceled.  But this actually doesn't work at all, because of how we use nsITimer.  Before worker threads were capable of accepting arbitrary runnables we created TimerThreadEventTarget, which translates the timer firing to the special worker event queue when the timer thread attempts to *dispatch* a runnable to the worker.  We still need this for some of the other types of timers (which use control runnables that interrupt JS, and not the regular event queue).  But setTimeout can simply run like a normal nsITimer callback now.  We need that here, or calling nsITimer::Cancel won't actually do anything, because the timer's event was ignored and TimerThreadEventTarget created its own event.
2016-01-06 13:18:29 -08:00
Carsten "Tomcat" Book 1b186ddd18 Backed out changeset 9441286007c4 (bug 1211903) for assertion failures/crashes 2015-12-22 14:11:27 +01:00