mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Chunked ReadFile from file manager
This commit is contained in:
parent
2de3b119a9
commit
9c8ebd3ce1
7 changed files with 163 additions and 57 deletions
|
@ -127,9 +127,8 @@ pub enum FileManagerThreadMsg {
|
|||
/// Select multiple files, return a vector of triples
|
||||
SelectFiles(Vec<FilterPattern>, IpcSender<FileManagerResult<Vec<SelectedFile>>>, FileOrigin, Option<Vec<String>>),
|
||||
|
||||
/// Read file by FileID, optionally check URL validity based on
|
||||
/// third flag, return the blob buffer object
|
||||
ReadFile(IpcSender<FileManagerResult<BlobBuf>>, SelectedFileId, bool, FileOrigin),
|
||||
/// Read file in chunks by FileID, optionally check URL validity based on fourth flag
|
||||
ReadFile(IpcSender<FileManagerResult<ReadFileProgress>>, SelectedFileId, bool, FileOrigin),
|
||||
|
||||
/// Add an entry as promoted memory-based blob and send back the associated FileID
|
||||
/// as part of a valid/invalid Blob URL depending on the second bool flag
|
||||
|
@ -155,6 +154,13 @@ pub enum FileManagerThreadMsg {
|
|||
Exit,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
pub enum ReadFileProgress {
|
||||
Meta(BlobBuf),
|
||||
Partial(Vec<u8>),
|
||||
EOF
|
||||
}
|
||||
|
||||
pub type FileManagerResult<T> = Result<T, FileManagerThreadError>;
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue