servo/components
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
..
allocator cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
atoms Introduce rejectionhandled event 2018-11-13 22:29:45 +08:00
bluetooth Get the magicleap build to work in CI 2018-11-09 16:24:09 -06:00
bluetooth_traits cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
canvas Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
canvas_traits Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
channel Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
compositing Use keyboard-types::webdriver::send_keys 2018-11-11 21:57:45 +01:00
config Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
constellation Use keyboard-types::webdriver::send_keys 2018-11-11 21:57:45 +01:00
debugger Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
deny_public_fields Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
devtools Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
devtools_traits cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
dom_struct cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
domobject_derive Format remaining files 2018-11-06 22:30:31 +01:00
embedder_traits Use keyboard-types::webdriver::send_keys 2018-11-11 21:57:45 +01:00
fallible Reorder imports 2018-11-06 22:35:07 +01:00
geometry cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
gfx Enable old glyph assertion 2018-11-10 13:27:49 +01:00
gfx_traits cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
hashglobe cargo fix --edition 2018-11-10 17:47:28 +01:00
jstraceable_derive Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
layout Auto merge of #22167 - emilio:gecko-sync, r=emilio 2018-11-10 15:43:20 -05:00
layout_thread cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
layout_traits Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
malloc_size_of Introduce rejectionhandled event 2018-11-13 22:29:45 +08:00
malloc_size_of_derive Format remaining files 2018-11-06 22:30:31 +01:00
metrics cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
msg Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
net Update uuid 2018-11-09 21:04:31 +01:00
net_traits Update uuid 2018-11-09 21:04:31 +01:00
pixels cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
profile Implement TaskSource for HistoryTraversal 2018-11-13 14:18:51 -05:00
profile_traits Implement TaskSource for HistoryTraversal 2018-11-13 14:18:51 -05:00
rand Update uuid 2018-11-09 21:04:31 +01:00
range cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
remutex cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
script Auto merge of #21804 - AgustinCB:unify-task-source-canceller-api, r=gterzian 2018-11-16 09:54:40 -05:00
script_layout_interface Remove useless use crate_name; imports. 2018-11-08 09:29:52 +01:00
script_plugins Reorder imports 2018-11-06 22:35:07 +01:00
script_traits Use keyboard-types::webdriver::send_keys 2018-11-11 21:57:45 +01:00
selectors cargo fix --edition 2018-11-10 17:47:28 +01:00
servo Get the magicleap build to work in CI 2018-11-09 16:24:09 -06:00
servo_arc cargo fix --edition 2018-11-10 17:47:28 +01:00
size_of_test Format component size_of_test 2018-09-10 21:31:38 +09:00
std_test_override Make mach test-unit not recompile components after mach build 2018-10-07 13:27:23 +02:00
style Fix wrong spec link 2018-11-11 14:26:06 +08:00
style_derive cargo fix --edition 2018-11-10 17:47:28 +01:00
style_traits style: Revert try -> r#try change. 2018-11-10 21:42:17 +01:00
url Update uuid 2018-11-09 21:04:31 +01:00
webdriver_server Use keyboard-types::webdriver::send_keys 2018-11-11 21:57:45 +01:00
webvr cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
webvr_traits cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00