check same-origin and url against the blob beign revoked

This commit is contained in:
Shinichi Morimoto 2019-11-13 15:37:53 +09:00
parent dfa78986a6
commit 2d995ba41a
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();
}
}
}
}