Skip to content

Add file handling functionality to Blob object #10851

Description

@izgzhen

NOTE: This is an issue assigned to myself

Spec: https://w3c.github.io/FileAPI/#blob

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.

Working at branching here

Activity

  1. added
    A-content/dom
    C-assigned
    on Apr 26, 2016
  2. added a commit that references this issue on Apr 27, 2016
  3. Manishearth commented on Apr 29, 2016

    @Manishearth
    Member

    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.

  4. izgzhen commented on Apr 29, 2016

    @izgzhen
    ContributorAuthor

    @Manishearth Thanks for guidance, I will see what I can do here

  5. added a commit that references this issue on May 2, 2016
  6. izgzhen commented on May 2, 2016

    @izgzhen
    ContributorAuthor

    @Manishearth Can we reopen this? ...

  7. added 6 commits that reference this issue on May 26, 2016
    af3bd27
    56d8c81
    e83fb45
    decbabd
    7293702
    3d7b176
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/domC-assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions