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. -->
This commit is contained in:
bors-servo 2019-11-18 21:41:21 -05:00 committed by GitHub
commit d553158e95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 47 deletions

View file

@ -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));
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();
let _ = rx.recv().unwrap();
}
}
}
}