servo/components/script
bors-servo a2937d9488
Auto merge of #21804 - AgustinCB:unify-task-source-canceller-api, r=gterzian
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 -->
2018-11-16 09:54:40 -05:00
..
docs Replace http with https in docs 2018-11-06 11:39:09 +01:00
dom Unify the task source and task canceller API 2018-11-14 06:36:44 -05:00
task_source Unify the task source and task canceller API 2018-11-14 06:36:44 -05:00
body.rs Format remaining files 2018-11-06 22:30:31 +01:00
build.rs Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
Cargo.toml Introduce rejectionhandled event 2018-11-13 22:29:45 +08:00
clipboard_provider.rs Reorder imports 2018-11-06 22:35:07 +01:00
CMakeLists.txt build(cmake): detect python binary for specified version 2018-03-13 09:25:06 -07:00
devtools.rs Reorder imports 2018-11-06 22:35:07 +01:00
document_loader.rs Reorder imports 2018-11-06 22:35:07 +01:00
fetch.rs Reorder imports 2018-11-06 22:35:07 +01:00
layout_image.rs Unify the task source and task canceller API 2018-11-14 06:36:44 -05:00
lib.rs Unify the task source and task canceller API 2018-11-14 06:36:44 -05:00
mem.rs Format script component 2018-09-19 17:40:47 -04:00
microtask.rs Sort use statements 2018-11-06 15:26:02 +01:00
network_listener.rs Reorder imports 2018-11-06 22:35:07 +01:00
script_runtime.rs Auto merge of #21804 - AgustinCB:unify-task-source-canceller-api, r=gterzian 2018-11-16 09:54:40 -05:00
script_thread.rs Unify the task source and task canceller API 2018-11-14 06:36:44 -05:00
serviceworker_manager.rs Reorder imports 2018-11-06 22:35:07 +01:00
serviceworkerjob.rs Reorder imports 2018-11-06 22:35:07 +01:00
stylesheet_loader.rs Unify the task source and task canceller API 2018-11-14 06:36:44 -05:00
task.rs cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
task_manager.rs Unify the task source and task canceller API 2018-11-14 06:36:44 -05:00
task_queue.rs cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
test.rs Reorder imports 2018-11-06 22:35:07 +01:00
textinput.rs Correct select all 2018-11-07 18:58:51 +01:00
timers.rs Reorder imports 2018-11-06 22:35:07 +01:00
unpremultiplytable.rs Format script component 2018-09-19 17:40:47 -04:00
webdriver_handlers.rs cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00