mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Remove unused part of the return value of parse_blob_url().
This commit is contained in:
parent
3e1bc8dcfe
commit
f4ab3ac54d
3 changed files with 4 additions and 5 deletions
|
@ -22,7 +22,7 @@ pub fn load_blob_sync
|
||||||
filemanager: FileManager)
|
filemanager: FileManager)
|
||||||
-> Result<(Headers, Vec<u8>), NetworkError> {
|
-> Result<(Headers, Vec<u8>), NetworkError> {
|
||||||
let (id, origin) = match parse_blob_url(&url) {
|
let (id, origin) = match parse_blob_url(&url) {
|
||||||
Ok((id, origin, _fragment)) => (id, origin),
|
Ok((id, origin)) => (id, origin),
|
||||||
Err(()) => {
|
Err(()) => {
|
||||||
let e = format!("Invalid blob URL format {:?}", url);
|
let e = format!("Invalid blob URL format {:?}", url);
|
||||||
return Err(NetworkError::Internal(e));
|
return Err(NetworkError::Internal(e));
|
||||||
|
|
|
@ -35,15 +35,14 @@ pub struct BlobBuf {
|
||||||
|
|
||||||
/// Parse URL as Blob URL scheme's definition
|
/// Parse URL as Blob URL scheme's definition
|
||||||
/// https://w3c.github.io/FileAPI/#DefinitionOfScheme
|
/// https://w3c.github.io/FileAPI/#DefinitionOfScheme
|
||||||
pub fn parse_blob_url(url: &ServoUrl) -> Result<(Uuid, FileOrigin, Option<String>), ()> {
|
pub fn parse_blob_url(url: &ServoUrl) -> Result<(Uuid, FileOrigin), ()> {
|
||||||
let url_inner = try!(Url::parse(url.path()).map_err(|_| ()));
|
let url_inner = try!(Url::parse(url.path()).map_err(|_| ()));
|
||||||
let fragment = url_inner.fragment().map(|s| s.to_string());
|
|
||||||
let id = {
|
let id = {
|
||||||
let mut segs = try!(url_inner.path_segments().ok_or(()));
|
let mut segs = try!(url_inner.path_segments().ok_or(()));
|
||||||
let id = try!(segs.nth(0).ok_or(()));
|
let id = try!(segs.nth(0).ok_or(()));
|
||||||
try!(Uuid::from_str(id).map_err(|_| ()))
|
try!(Uuid::from_str(id).map_err(|_| ()))
|
||||||
};
|
};
|
||||||
Ok((id, get_blob_origin(&ServoUrl::from_url(url_inner)), fragment))
|
Ok((id, get_blob_origin(&ServoUrl::from_url(url_inner))))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Given an URL, returning the Origin that a Blob created under this
|
/// Given an URL, returning the Origin that a Blob created under this
|
||||||
|
|
|
@ -126,7 +126,7 @@ impl URL {
|
||||||
let origin = get_blob_origin(&global.get_url());
|
let origin = get_blob_origin(&global.get_url());
|
||||||
|
|
||||||
if let Ok(url) = ServoUrl::parse(&url) {
|
if let Ok(url) = ServoUrl::parse(&url) {
|
||||||
if let Ok((id, _, _)) = parse_blob_url(&url) {
|
if let Ok((id, _)) = parse_blob_url(&url) {
|
||||||
let resource_threads = global.resource_threads();
|
let resource_threads = global.resource_threads();
|
||||||
let (tx, rx) = ipc::channel().unwrap();
|
let (tx, rx) = ipc::channel().unwrap();
|
||||||
let msg = FileManagerThreadMsg::RevokeBlobURL(id, origin, tx);
|
let msg = FileManagerThreadMsg::RevokeBlobURL(id, origin, tx);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue