Repository navigation
Add blob loader - #11536
Add blob loader#11536
Conversation
|
Heads up! This PR modifies the following files:
|
|
cc @Manishearth. BTW, I have not plug the loader into the |
|
New code was committed to pull request. |
|
r? @Manishearth |
| } | ||
| Some((uuid, _fragment)) => { | ||
| let (tx, rx) = ipc::channel().unwrap(); | ||
| let _ = blob_url_store.send(BlobURLStoreMsg::Request(uuid, tx)).unwrap(); |
There was a problem hiding this comment.
Should this be messaging the blob store or directly accessing it?
Direct access means that you may have to put synchronization primitives on your blob store, so perhaps this is better.
There was a problem hiding this comment.
As I observe, it is more natural to let threads in net task to handle the requests (instead of directly consume it inside script), so I need to somehow message script thread to fetch the content of blob. Not sure if it makes a lot of sense
There was a problem hiding this comment.
(we discussed this and fixing it will be done in a future PR)
|
New code was committed to pull request. |
| pub fn load(load_data: LoadData, consumer: LoadConsumer, | ||
| blob_url_store: Arc<RwLock<BlobURLStore>>, | ||
| classifier: Arc<MIMEClassifier>) { // XXX: Move it into net process later | ||
|
|
There was a problem hiding this comment.
@Manishearth Regarding factory, it is totally gone here. And load is just a function that will be called with the extended FileManager's attributes.
|
New code was committed to pull request. |
| /// Size of content in bytes | ||
| pub size: u64, | ||
| /// Content of blob | ||
| pub bytes: Vec<u8>, |
There was a problem hiding this comment.
This will eventually become an enum between bytes, on-disk file name, and slice, right?
There was a problem hiding this comment.
Yes, the Optioned filename looks awkward itself :P
|
@bors-servo r+ This looks good to me! Next up we need to add ways for script to insert blobs into the store, and make script smart as to when it stores blobs locally and when it forwards them to net (though I recommend talking with the gecko folks first) |
|
📌 Commit 679cf0a has been approved by |
|
⌛ Testing commit 679cf0a with merge 3977128... |
Add blob loader Add a blob loader to implement [Blob URL](https://w3c.github.io/FileAPI/#url). The related interfaces to script thread are also declared. Progressing in parallel with PR #11534. Related to #11131. <!-- Please describe your changes on the following line: --> --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix part of #10539 <!-- Either: --> - [x] These changes do not require tests because not integrated yet. <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- 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/11536) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows |
Add a blob loader to implement Blob URL. The related interfaces to script thread are also declared.
Progressing in parallel with PR #11534. Related to #11131.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is