Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd file handling functionality to Blob object #10851
Closed
Labels
Comments
bors-servo
added a commit
that referenced
this issue
Apr 27, 2016
Fixing TODOs related to file input and File API Fixing problems I met when trying to resolve #10851, but most of changes here are simple fixes. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10873) <!-- Reviewable:end -->
|
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. |
|
@Manishearth Thanks for guidance, I will see what I can do here |
bors-servo
added a commit
that referenced
this issue
May 2, 2016
Fixes related to File API Fixing problems I met when trying to resolve #10851, but most of changes here are simple fixes. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10873) <!-- Reviewable:end -->
|
@Manishearth Can we reopen this? ... |
Merged
bors-servo
added a commit
that referenced
this issue
May 26, 2016
Add file backend support for Blob and related - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy --faster` does not report any errors - [x] These changes fix #10851, related to #11131 - [x] These changes do not require tests because the implementation is partial and can't work alone 1. Add new backend to `Blob` and a `BlobImpl` struct to abstract multiple backends 2. Rewrite most interfaces of `Blob` to accommodate the change 3. Change the `read` behaviour of `FileReader`, considering the case when blob is file-backed and not cached The design is still immature, welcome comments! - [x] I used `DOMRefCell` to cache the bytes in `BlobImpl`, is it sound? - [x] The interfaces (like `BlobImpl::get_bytes`) handle requests in a default-to-empty way when the inner `DataSlice` is not cached. It might be possible to handle this condition better. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11221) <!-- Reviewable:end -->
bors-servo
added a commit
that referenced
this issue
May 26, 2016
Add file backend support for Blob and related - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy --faster` does not report any errors - [x] These changes fix #10851, related to #11131 - [x] These changes do not require tests because the implementation is partial and can't work alone 1. Add new backend to `Blob` and a `BlobImpl` struct to abstract multiple backends 2. Rewrite most interfaces of `Blob` to accommodate the change 3. Change the `read` behaviour of `FileReader`, considering the case when blob is file-backed and not cached The design is still immature, welcome comments! - [x] I used `DOMRefCell` to cache the bytes in `BlobImpl`, is it sound? - [x] The interfaces (like `BlobImpl::get_bytes`) handle requests in a default-to-empty way when the inner `DataSlice` is not cached. It might be possible to handle this condition better. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11221) <!-- Reviewable:end -->
bors-servo
added a commit
that referenced
this issue
Jun 1, 2016
Add file backend support for Blob and related - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy --faster` does not report any errors - [x] These changes fix #10851, related to #11131 - [x] These changes do not require tests because the implementation is partial and can't work alone 1. Add new backend to `Blob` and a `BlobImpl` struct to abstract multiple backends 2. Rewrite most interfaces of `Blob` to accommodate the change 3. Change the `read` behaviour of `FileReader`, considering the case when blob is file-backed and not cached The design is still immature, welcome comments! - [x] I used `DOMRefCell` to cache the bytes in `BlobImpl`, is it sound? - [x] The interfaces (like `BlobImpl::get_bytes`) handle requests in a default-to-empty way when the inner `DataSlice` is not cached. It might be possible to handle this condition better. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11221) <!-- Reviewable:end -->
bors-servo
added a commit
that referenced
this issue
Jun 1, 2016
Add file backend support for Blob and related - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy --faster` does not report any errors - [x] These changes fix #10851, related to #11131 - [x] These changes do not require tests because the implementation is partial and can't work alone 1. Add new backend to `Blob` and a `BlobImpl` struct to abstract multiple backends 2. Rewrite most interfaces of `Blob` to accommodate the change 3. Change the `read` behaviour of `FileReader`, considering the case when blob is file-backed and not cached The design is still immature, welcome comments! - [x] I used `DOMRefCell` to cache the bytes in `BlobImpl`, is it sound? - [x] The interfaces (like `BlobImpl::get_bytes`) handle requests in a default-to-empty way when the inner `DataSlice` is not cached. It might be possible to handle this condition better. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11221) <!-- Reviewable:end -->
bors-servo
added a commit
that referenced
this issue
Jun 1, 2016
Add file backend support for Blob and related - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy --faster` does not report any errors - [x] These changes fix #10851, related to #11131 - [x] These changes do not require tests because the implementation is partial and can't work alone 1. Add new backend to `Blob` and a `BlobImpl` struct to abstract multiple backends 2. Rewrite most interfaces of `Blob` to accommodate the change 3. Change the `read` behaviour of `FileReader`, considering the case when blob is file-backed and not cached The design is still immature, welcome comments! - [x] I used `DOMRefCell` to cache the bytes in `BlobImpl`, is it sound? - [x] The interfaces (like `BlobImpl::get_bytes`) handle requests in a default-to-empty way when the inner `DataSlice` is not cached. It might be possible to handle this condition better. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11221) <!-- Reviewable:end -->
bors-servo
added a commit
that referenced
this issue
Jun 1, 2016
Add file backend support for Blob and related - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy --faster` does not report any errors - [x] These changes fix #10851, related to #11131 - [x] These changes do not require tests because the implementation is partial and can't work alone 1. Add new backend to `Blob` and a `BlobImpl` struct to abstract multiple backends 2. Rewrite most interfaces of `Blob` to accommodate the change 3. Change the `read` behaviour of `FileReader`, considering the case when blob is file-backed and not cached The design is still immature, welcome comments! - [x] I used `DOMRefCell` to cache the bytes in `BlobImpl`, is it sound? - [x] The interfaces (like `BlobImpl::get_bytes`) handle requests in a default-to-empty way when the inner `DataSlice` is not cached. It might be possible to handle this condition better. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11221) <!-- Reviewable:end -->
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-comments-removed
that referenced
this issue
Oct 1, 2019
…r=Manishearth Fixing problems I met when trying to resolve servo/servo#10851, but most of changes here are simple fixes. Source-Repo: https://github.com/servo/servo Source-Revision: 14926529c9f38a014140d75ca06cc46d1a2b72ba UltraBlame original commit: 47b37dd10751427a6b693cf5848fe8c0b56a6ad9
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified-and-comments-removed
that referenced
this issue
Oct 1, 2019
…r=Manishearth Fixing problems I met when trying to resolve servo/servo#10851, but most of changes here are simple fixes. Source-Repo: https://github.com/servo/servo Source-Revision: 14926529c9f38a014140d75ca06cc46d1a2b72ba UltraBlame original commit: 47b37dd10751427a6b693cf5848fe8c0b56a6ad9
gecko-dev-updater
pushed a commit
to marco-c/gecko-dev-wordified
that referenced
this issue
Oct 1, 2019
…r=Manishearth Fixing problems I met when trying to resolve servo/servo#10851, but most of changes here are simple fixes. Source-Repo: https://github.com/servo/servo Source-Revision: 14926529c9f38a014140d75ca06cc46d1a2b72ba UltraBlame original commit: 47b37dd10751427a6b693cf5848fe8c0b56a6ad9
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 theFileReaderwill also only operate in this way. In order to support reading from file system, another internal data structure might need to be added to theBlob. It might be a file handler created at the time of object construction.About snapshot state:
Working at branching here