You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add file handling functionality to Blob object #10851
As noted before, current Blob object can only refer to in-memory data (DataSlice), and the FileReader will also only operate in this way. In order to support reading from file system, another internal data structure might need to be added to the Blob. It might be a file handler created at the time of object construction.
About snapshot state:
If a File object is a reference to a byte sequence originating from a file on disk, then its snapshot state should be set to the state of the file on disk at the time the File object is created.
Note: This is a non-trivial requirement to implement for user agents, and is thus not a must but a should [RFC2119]. User agents should endeavor to have a File object’s snapshot state set to the state of the underlying storage on disk at the time the reference is taken. If the file is modified on disk following the time a reference has been taken, the File's snapshot state will differ from the state of the underlying storage. User agents may use modification time stamps and other mechanisms to maintain snapshot state, but this is left as an implementation detail.
As mentioned in email, we need to be careful about process isolation here. The script task should never be reading files directly, nor should it be possible for the script task to ask another process to read an arbitrary file for it. Instead, the script task should ask the resource task to spawn a file dialog, and the resource task should return some handle through which the script task can refer to the file.
Activity
Auto merge of #10873 - izgzhen:blob, r=<try>
Manishearth commentedon Apr 29, 2016
As mentioned in email, we need to be careful about process isolation here. The script task should never be reading files directly, nor should it be possible for the script task to ask another process to read an arbitrary file for it. Instead, the script task should ask the resource task to spawn a file dialog, and the resource task should return some handle through which the script task can refer to the file.
izgzhen commentedon Apr 29, 2016
@Manishearth Thanks for guidance, I will see what I can do here
Auto merge of #10873 - izgzhen:blob, r=Manishearth
izgzhen commentedon May 2, 2016
@Manishearth Can we reopen this? ...
Auto merge of #11221 - izgzhen:blob-file-backend, r=Manishearth
Auto merge of #11221 - izgzhen:blob-file-backend, r=Manishearth
Auto merge of #11221 - izgzhen:blob-file-backend, r=Manishearth
Auto merge of #11221 - izgzhen:blob-file-backend, r=<try>
Auto merge of #11221 - izgzhen:blob-file-backend, r=Manishearth
Auto merge of #11221 - izgzhen:blob-file-backend, r=Manishearth
servo: Merge #10873 - Fixes related to File API (from izgzhen:blob); …
servo: Merge #10873 - Fixes related to File API (from izgzhen:blob); …
servo: Merge #10873 - Fixes related to File API (from izgzhen:blob); …