aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/url.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-07-11 00:13:45 -0700
committerGitHub <noreply@github.com>2016-07-11 00:13:45 -0700
commit42e90f7db9d5ee7c6176e35e600cd27fe9c6748c (patch)
tree6c7156fe3e563f03e8512692e0aed69163c227d5 /components/script/dom/url.rs
parent2239e827bd0ac4f23f9e15a2b2a79685b0f6d422 (diff)
parent0ff6f313e881279c75daa0d6c974e726ef2759f3 (diff)
downloadservo-42e90f7db9d5ee7c6176e35e600cd27fe9c6748c.tar.gz
servo-42e90f7db9d5ee7c6176e35e600cd27fe9c6748c.zip
Auto merge of #12378 - izgzhen:blob-url-revocation-fix, r=Manishearth
Add FileID validity setting/checking logic to Blob URL implementation r? @Manishearth --- <!-- 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 <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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/12378) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/url.rs')
-rw-r--r--components/script/dom/url.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/components/script/dom/url.rs b/components/script/dom/url.rs
index c2d7516dd6f..961d3c2fd29 100644
--- a/components/script/dom/url.rs
+++ b/components/script/dom/url.rs
@@ -16,7 +16,7 @@ use dom::urlsearchparams::URLSearchParams;
use ipc_channel::ipc;
use net_traits::IpcSend;
use net_traits::blob_url_store::parse_blob_url;
-use net_traits::filemanager_thread::{SelectedFileId, FileManagerThreadMsg};
+use net_traits::filemanager_thread::{FileOrigin, SelectedFileId, FileManagerThreadMsg};
use std::borrow::ToOwned;
use std::default::Default;
use url::quirks::domain_to_unicode;
@@ -125,7 +125,7 @@ impl URL {
return DOMString::from(URL::unicode_serialization_blob_url(&origin, &id));
}
- let id = blob.get_id();
+ let id = blob.get_blob_url_id();
DOMString::from(URL::unicode_serialization_blob_url(&origin, &id.0))
}
@@ -148,7 +148,7 @@ impl URL {
let filemanager = global.resource_threads().sender();
let id = SelectedFileId(id.simple().to_string());
let (tx, rx) = ipc::channel().unwrap();
- let msg = FileManagerThreadMsg::DecRef(id, origin, tx);
+ let msg = FileManagerThreadMsg::RevokeBlobURL(id, origin, tx);
let _ = filemanager.send(msg);
let _ = rx.recv().unwrap();
@@ -173,12 +173,11 @@ impl URL {
result
}
- // XXX: change String to FileOrigin
/* NOTE(izgzhen): WebKit will return things like blob:file:///XXX
while Chrome will return blob:null/XXX
This is not well-specified, and I prefer the WebKit way here
*/
- fn get_blob_origin(url: &Url) -> String {
+ fn get_blob_origin(url: &Url) -> FileOrigin {
if url.scheme() == "file" {
"file://".to_string()
} else {