зеркало из https://github.com/mozilla/gecko-dev.git
servo: Merge #15300 - Remove unused part of the return value of parse_blob_url() (from servo:blob-fragment); r=Wafflespeanut
Source-Repo: https://github.com/servo/servo Source-Revision: 81712560cafbb6a5ed12c5306522a6ea0cbe09f7
This commit is contained in:
Родитель
85ae16bd1b
Коммит
dad28235a4
|
@ -22,7 +22,7 @@ pub fn load_blob_sync
|
|||
filemanager: FileManager)
|
||||
-> Result<(Headers, Vec<u8>), NetworkError> {
|
||||
let (id, origin) = match parse_blob_url(&url) {
|
||||
Ok((id, origin, _fragment)) => (id, origin),
|
||||
Ok((id, origin)) => (id, origin),
|
||||
Err(()) => {
|
||||
let e = format!("Invalid blob URL format {:?}", url);
|
||||
return Err(NetworkError::Internal(e));
|
||||
|
|
|
@ -35,15 +35,14 @@ pub struct BlobBuf {
|
|||
|
||||
/// Parse URL as Blob URL scheme's definition
|
||||
/// 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 fragment = url_inner.fragment().map(|s| s.to_string());
|
||||
let id = {
|
||||
let mut segs = try!(url_inner.path_segments().ok_or(()));
|
||||
let id = try!(segs.nth(0).ok_or(()));
|
||||
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
|
||||
|
|
|
@ -126,7 +126,7 @@ 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) {
|
||||
if let Ok((id, _)) = parse_blob_url(&url) {
|
||||
let resource_threads = global.resource_threads();
|
||||
let (tx, rx) = ipc::channel().unwrap();
|
||||
let msg = FileManagerThreadMsg::RevokeBlobURL(id, origin, tx);
|
||||
|
|
Загрузка…
Ссылка в новой задаче