mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Integration and improvements of File API backends
1. More complete origin check in FileManagerThreadMsg 2. Add reference counting logic to file manage store and script API 3. Integrate the support of slicing
This commit is contained in:
parent
212aa4437e
commit
14d68968ed
14 changed files with 543 additions and 244 deletions
|
@ -1151,6 +1151,7 @@ impl Activatable for HTMLInputElement {
|
|||
},
|
||||
InputType::InputFile => {
|
||||
let window = window_from_node(self);
|
||||
let origin = window.get_url().origin().unicode_serialization();
|
||||
let filemanager = window.resource_threads().sender();
|
||||
|
||||
let mut files: Vec<Root<File>> = vec![];
|
||||
|
@ -1160,7 +1161,7 @@ impl Activatable for HTMLInputElement {
|
|||
|
||||
if self.Multiple() {
|
||||
let (chan, recv) = ipc::channel().expect("Error initializing channel");
|
||||
let msg = FileManagerThreadMsg::SelectFiles(filter, chan);
|
||||
let msg = FileManagerThreadMsg::SelectFiles(filter, chan, origin);
|
||||
let _ = filemanager.send(msg).unwrap();
|
||||
|
||||
match recv.recv().expect("IpcSender side error") {
|
||||
|
@ -1173,7 +1174,7 @@ impl Activatable for HTMLInputElement {
|
|||
};
|
||||
} else {
|
||||
let (chan, recv) = ipc::channel().expect("Error initializing channel");
|
||||
let msg = FileManagerThreadMsg::SelectFile(filter, chan);
|
||||
let msg = FileManagerThreadMsg::SelectFile(filter, chan, origin);
|
||||
let _ = filemanager.send(msg).unwrap();
|
||||
|
||||
match recv.recv().expect("IpcSender side error") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue