diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-11-18 21:41:21 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-18 21:41:21 -0500 |
commit | d553158e95cd5988eeb3e32310c11971c0450449 (patch) | |
tree | db49d8c1bfbd6fe3dc814f393a3c16c9cc1a5108 /components/script/dom | |
parent | 18ab860f4cac5520306b09f8ab6b0e2f1539a2cf (diff) | |
parent | 2d995ba41a73e42c9710e1fec132b5d3b501581e (diff) | |
download | servo-d553158e95cd5988eeb3e32310c11971c0450449.tar.gz servo-d553158e95cd5988eeb3e32310c11971c0450449.zip |
Auto merge of #24685 - shnmorimoto:fix_revoke_blob_url, r=jdm
Fix revoke blob url
<!-- Please describe your changes on the following line: -->
fix #24290
---
<!-- 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 #24290 (GitHub issue number if applicable)
<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because ___
<!-- 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. -->
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/url.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs index 9952739243b..cc6c83e2c18 100644 --- a/components/script/dom/url.rs +++ b/components/script/dom/url.rs @@ -129,13 +129,15 @@ impl URL { let origin = get_blob_origin(&global.get_url()); if let Ok(url) = ServoUrl::parse(&url) { - if let Ok((id, _)) = parse_blob_url(&url) { - let resource_threads = global.resource_threads(); - let (tx, rx) = ipc::channel(global.time_profiler_chan().clone()).unwrap(); - let msg = FileManagerThreadMsg::RevokeBlobURL(id, origin, tx); - let _ = resource_threads.send(CoreResourceMsg::ToFileManager(msg)); - - let _ = rx.recv().unwrap(); + if url.fragment().is_none() && origin == get_blob_origin(&url) { + if let Ok((id, _)) = parse_blob_url(&url) { + let resource_threads = global.resource_threads(); + let (tx, rx) = ipc::channel(global.time_profiler_chan().clone()).unwrap(); + let msg = FileManagerThreadMsg::RevokeBlobURL(id, origin, tx); + let _ = resource_threads.send(CoreResourceMsg::ToFileManager(msg)); + + let _ = rx.recv().unwrap(); + } } } } |