aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_runtime.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove use of deprecated language construct.Josh Matthews2019-11-261-1/+1
|
* script: Ensure JS engine is initialized and deinitialized on the same thread.Josh Matthews2019-11-261-4/+26
|
* Bind runnable dispatching in script_runtimeAkash-Pateria2019-11-191-13/+52
|
* Add consume stream callbackRidhim Rastogi2019-11-111-1/+108
|
* Add StreamConsumer wrapper and ReportStreamErrorCallback fnRidhim Rastogi2019-11-031-0/+56
|
* begin messageport, transferable objects, implKeith Yeung2019-10-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Accept transfer argument for StructuredCloneData::write Allow structured clone reads to return a boolean Add Transferable trait Add basic skeletons to MessagePort Implement transfer and transfer-receiving steps on MessagePort Use transfer and transfer_receive in StructuredClone callbacks Implement MessageChannel Freeze the array object for the MessageEvent ports attribute Implement transfer argument on window.postMessage Use ReentrantMutex instead for MessagePortInternal Accept origin as a parameter in dispatch_jsval Fix BorrowMut crash with pending_port_message Detach port on closure and check for detached during transfer Enable webmessaging tests fix webidl fix
* Work around crash on Windows when returning JS::Value by value.Josh Matthews2019-08-301-3/+6
|
* Auto merge of #23930 - CYBAI:incumbent-global-assertion, r=jdmbors-servo2019-08-091-1/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assert incumbent global is always some in get_incumbent_global hook While working on module script, I'd like to use Promise with a custom callback with type `Box<dyn TaskBox>` which means we didn't use web API callbacks as native handlers. However, we'll get a panic from `enqueue_promise_job` and the panic says we have a `null` incumbent global. The main problem here is, the Promise API is strongly tied to JS engine and it always assumes there's a meaningful answer for "what specific global is this promise associated with". So, when I don't use the Promise for a specific web API, our engine cannot find a proper incumbent global for us so that we get the `null` incumbent global panic. To make us catch this case easier in the future, we should add the assertion inside `get_incumbent_global` hook so that we can know this quickly next time. Ref: https://mozilla.logbot.info/servo/20190807#c16525481 --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes do not require tests because it should just add assertion inside the hook <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23930) <!-- Reviewable:end -->
| * Assert incumbent global is always some in get_incumbent_global hookCYBAI2019-08-081-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While working on module script, I'd like to use Promise with a custom callback with type `Box<dyn TaskBox>` which means we didn't use web API callbacks as native handlers. However, we'll get a panic from `enqueue_promise_job` and the panic says we have a `null` incumbent global. The main problem here is, the Promise API is strongly tied to JS engine and it always assumes there's a meaningful answer for "what specific global is this promise associated with". So, when I don't use the Promise for a specific web API, our engine cannot find a proper incumbent global for us so that we get the `null` incumbent global panic. To make us catch this case easier in the future, we should add the assertion inside `get_incumbent_global` hook so that we can know this quickly next time. Ref: https://mozilla.logbot.info/servo/20190807#c16525481
* | Use safe JSContext in MicrotaskQueuemarmeladema2019-08-091-1/+2
| |
* | Remove some usage of unsafe code in Promisemarmeladema2019-08-091-2/+3
|/
* Modify *::get_cx methods to return a safe JSContext instead of a raw onemarmeladema2019-07-241-5/+4
|
* Callbacks now uses safe JSContext instead of raw JSContextmarmeladema2019-07-241-1/+1
|
* Add safe JSontext wrapper around unsafe RawJSContextmarmeladema2019-07-241-0/+19
|
* Rename JSContext from js::jsapi to RawJSContextmarmeladema2019-07-241-10/+10
|
* Upgrade to Spidermonkey 67.Josh Matthews2019-06-261-18/+66
|
* Update to SpiderMonkey 66.Josh Matthews2019-05-101-6/+8
|
* Fix debugmozjs build #23074Alan Jeffrey2019-05-061-2/+2
|
* #8539 Config preferences backend restructurePeter Hall2019-03-201-179/+126
|
* Reintroduce parent runtimes for worker threads.Josh Matthews2019-01-151-2/+17
|
* Update to new JS runtime creation APIs.Josh Matthews2019-01-151-1/+7
|
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-1/+3
|
* Update MPL license to https (part 3)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* Auto merge of #21804 - AgustinCB:unify-task-source-canceller-api, r=gterzianbors-servo2018-11-161-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unify the task source and task canceller API To do so, I created a struct `TaskManagement(TaskSource, TaskCanceller)` and made `*_task_source` return that instead of just the task source. Next, I refactored all places in which `task_canceller` by basically removing them in favour of a previously called `*_task_source`. I tried to make `task_canceller` a private method in `Window`, with the hope of enforcing the use of `*_task_source`. However, it's used in components/script/dom/globalscope.rs:575 in such a way that will make it harder to avoid. I decided to leave it that way. It'd be possible to unify `*_task_source` in such a way that we would have only one method. However, I decided not to do it because one of the `TaskSource` implementations is special: `history_traversal_task_source`. Not wanting to over complicate things, I decided to leave the structure this way. --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #21154 (github issue number if applicable). - [x] These changes do not require tests because it's refactoring code that should already be tested. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21804) <!-- Reviewable:end -->
| * Implement TaskSource for HistoryTraversalAgustin Chiappe Berrini2018-11-131-0/+1
| | | | | | | | | | And remove the method in window that returns it, because it isn't used so far.
* | Introduce rejectionhandled eventCYBAI2018-11-131-12/+33
|/
* `cargo fix --edition-idioms`Simon Sapin2018-11-081-3/+3
|
* Reorder importsPyfisch2018-11-061-9/+11
|
* Format remaining filesPyfisch2018-11-061-30/+43
|
* Sort `use` statementsSimon Sapin2018-11-061-4/+4
|
* `cargo fix --edition`Simon Sapin2018-11-061-20/+20
|
* Auto merge of #21988 - CYBAI:drop-promises, r=jdmbors-servo2018-10-291-1/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clear refcounted promise before dropping JSRuntime Not sure if this is the right solution? I also tried to `impl Drop for LiveDOMReferences` but it's still executed after dropping JSRuntime. So, maybe we should clear it before dropping the JSRuntime? cc @jdm @asajeffrey --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #21331 . - [x] There are tests for these changes; the status of `fetch/cross-origin-resource-policy/fetch-in-iframe.html` will be `OK` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21988) <!-- Reviewable:end -->
| * Drop `TrustedPromise` before dropping JSRuntimeCYBAI2018-10-211-1/+4
| |
* | Clear consumed rejections and add FIXME commentsCYBAI2018-10-181-0/+7
| |
* | Make first argument of DOMManipulationTaskSource as a Box<ScriptChan +CYBAI2018-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | Send> We don't have `window` for `workers`. So, if we use `global.as_window()` to get the DOMManipulationTaskSource, it will make worker panic. Instead, we should get the DOMManipulationTaskSource from each own thread. Ref: https://github.com/servo/servo/pull/20755#discussion_r193557746
* | Implement unhandledrejection eventCYBAI2018-10-181-4/+124
|/
* Format script componentchansuke2018-09-191-104/+166
|
* Add the TaskSourceName to CommonScriptMsg::TaskAgustin Chiappe Berrini2018-09-041-2/+3
| | | | Update QueuedTaskConversion and the TaskQueue to use it
* Upgraded to SM 60Alan Jeffrey2018-08-201-50/+75
|
* Pass new method in CollectServoSizes for accurate DOM heap use reportingAnthony Weston2018-03-271-1/+22
|
* Remove js.mem.gc.refresh_frame_slices.enabled prefAdrian Wielgosik2018-01-061-1/+0
| | | | Clean up after gecko bug 1421358
* Bump bitflags to 1.0 in every servo crateBastien Orivel2017-10-301-3/+3
|
* added time to interactive metrics, refactored metrics to use traitsddh2017-10-241-2/+3
| | | | changed task macro to take pipeline info
* Do not trace Rust values when thread is shutting down.Josh Matthews2017-10-201-4/+28
|
* Move script_runtime::StackRootTLS to root::ThreadLocalStackRootsAnthony Ramine2017-09-271-20/+2
|
* Rename dom::bindings::js to dom::bindings::rootAnthony Ramine2017-09-261-1/+1
|
* Rename Task to TaskBoxAnthony Ramine2017-09-201-2/+2
|
* Make Task require SendAnthony Ramine2017-09-201-1/+1
|
* Move Task to its own moduleAnthony Ramine2017-09-181-1/+2
|
* Rename Runnable to TaskAnthony Ramine2017-09-161-4/+4
| | | | | | | | | | | | The changes are: * `*Runnable` -> `*Task`; * `RunnableMsg` -> `Task`; * `RunnableWrapper` -> `TaskCanceller`; * `MainThreadRunnable` -> `MainThreadTask`; * `wrap_runnable` -> `wrap_task`; * `get_runnable_wrapper` -> `task_canceller`; * `handler` -> `run`; * `main_thread_handler` -> `run_with_script_thread`.