servo/components/script
bors-servo c9480c8e07
Auto merge of #23661 - julientregoat:i-21289, r=jdm
Refactor ImageCache::find_image_or_metadata -> ImageCache::{get_image, track_image}

<!-- Please describe your changes on the following line: -->
Updated the `ImageCache` trait to replace `find_image_or_metadata` with two new functions `track_image` and `get_image`, as well as a new enum (`ImageCacheResult`).

As a result, I was able to refactor the functions that previously called `find_image_or_metadata` pretty cleanly. For a list of these functions, please see the commit information.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #21289  (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because tests already exist for these components. I ran `cargo test` in `net`, `net_traits`, `layout`, and `script` successfully.

<!-- 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/23661)
<!-- Reviewable:end -->
2020-04-17 15:56:30 -04:00
..
docs
dom Auto merge of #23661 - julientregoat:i-21289, r=jdm 2020-04-17 15:56:30 -04:00
task_source remove unnecessary thread in filereader, add stream TODO 2019-12-10 14:55:22 +08:00
body.rs Implement Blob methods (text/arraybuffer) and async file read method 2020-01-28 14:38:32 +05:30
build.rs
canvas_state.rs Refactor ImageCache::find_image_or_metadata API. 2020-04-17 11:58:18 -04:00
Cargo.toml Remove WebVR 2020-04-08 20:23:41 -05:00
clipboard_provider.rs
devtools.rs Don't go through the layout thread to retrieve a node's primary style 2020-04-07 14:34:47 +02:00
document_loader.rs Use #![register_tool] instead of #![register_attr] 2019-11-15 17:24:42 +01:00
euclidext.rs Update euclid 2020-04-07 08:51:08 -07:00
fetch.rs let integrity_metadata survive IPC sending 2020-01-30 10:34:29 -05:00
image_listener.rs Refactor ImageCache::find_image_or_metadata API. 2020-04-17 11:58:18 -04:00
init.rs allow for a service worker manager per origin 2020-04-05 22:43:40 +08:00
layout_image.rs
lib.rs Replace a transmute with .to_ne_bytes() + constructor 2020-04-15 17:54:04 +02:00
mem.rs
microtask.rs Propagate user interacting flag to timers and promises 2020-03-26 08:36:57 +01:00
network_listener.rs #24468 Performance::queue_entries return the index of the added performance entry 2019-12-13 13:41:47 -05:00
realms.rs rename compartment to realm 2020-01-24 20:52:36 +05:30
script_module.rs Add InRealm argument to Callback trait 2020-04-05 19:54:30 +02:00
script_runtime.rs Remove WebVR 2020-04-08 20:23:41 -05:00
script_thread.rs Auto merge of #26071 - servo:rustup, r=nox 2020-04-10 00:37:54 -04:00
serviceworker_manager.rs allow for a service worker manager per origin 2020-04-05 22:43:40 +08:00
serviceworkerjob.rs Use #![register_tool] instead of #![register_attr] 2019-11-15 17:24:42 +01:00
stylesheet_loader.rs Modify script to prevent further violations of snake_case 2020-01-18 14:22:15 +05:30
stylesheet_set.rs
task.rs
task_manager.rs impl timer-task-source, dedicated time-out mechanism for service-worker 2019-11-19 14:32:21 +08:00
task_queue.rs
test.rs Modify script to prevent further violations of snake_case 2020-01-18 14:22:15 +05:30
textinput.rs Form constraints validation 2020-04-02 10:16:46 +02:00
timers.rs Propagate user interacting flag to timers and promises 2020-03-26 08:36:57 +01:00
unpremultiplytable.rs
webdriver_handlers.rs Update SpiderMonkey 2020-03-06 11:13:28 +01:00