Skip to content

Put Blob URL online - #12440

Merged
bors-servo merged 1 commit into
servo:masterfrom
izgzhen:blob-online
Jul 15, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
izgzhen:blob-online

Conversation

@izgzhen

@izgzhen izgzhen commented Jul 14, 2016 •

Copy link
Copy Markdown
Contributor

This PR connects the resource requests with file manager thread, including:

  • script_thread load request
  • image_cache_thread load request
  • XHR load request (the responding part code yet not implemented due to unfamiliarity with fetch standard, but the infra is here)

One notable change is the introduction of "long-live validity", to handle the case specified in WPT test FileAPI/blob/Blob-XHR-revoke.html.

r? @Manishearth


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix Implement Blob URLs #10539
  • There are tests for these changes

This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @KiChjang: components/net/filemanager_thread.rs, components/net_traits/blob_url_store.rs, components/net_traits/blob_url_store.rs, components/script/dom/url.rs, components/script/dom/xmlhttprequest.rs, components/net/blob_loader.rs, components/net_traits/filemanager_thread.rs, components/net_traits/filemanager_thread.rs, components/script/script_thread.rs, components/script/dom/htmlinputelement.rs, components/script/dom/blob.rs, components/net/image_cache_thread.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 14, 2016
@izgzhen

izgzhen commented Jul 14, 2016 •

Copy link
Copy Markdown
Contributor Author

Still WIP, welcome comments! (esp. about "long-live")

Comment thread components/net/filemanager_thread.rs Outdated
let _ = sender.send(Err(BlobURLStoreError::InvalidOrigin));
}
// Check origin format correctness
if Url::parse(&origin).is_ok() || origin == "file://" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we have a separate check for file://?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because Url::parse is not happy with an origin equal to file://. It is kinda a hack (related to get_blob_origin, parse_blob_url etc. as well)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see.

@Manishearth

Copy link
Copy Markdown
Member

One small issue, then update test expectations, and should be good to go.

@Manishearth

Copy link
Copy Markdown
Member

@bors-servo try

There should be some new tests passing

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 932a2a8 with merge a7ec87c...

bors-servo pushed a commit that referenced this pull request Jul 15, 2016
Put Blob URL online

This PR connects the resource requests with file manager thread, including:

+ `script_thread` load request
+ `image_cache_thread` load request
+ XHR load request (the responding part code yet not implemented due to unfamiliarity with fetch standard, but the infra is here)

One notable change is the introduction of "long-live validity", to handle the case specified in WPT test FileAPI/blob/Blob-XHR-revoke.html.

r? @Manishearth

<!-- 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 #10539
- [x] There are tests for these changes

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12440)
<!-- Reviewable:end -->
@izgzhen

izgzhen commented Jul 15, 2016

Copy link
Copy Markdown
Contributor Author

@Manishearth Actually I first thought it will send the Payload for me and didn't write that line code. Should I file an issue on this potentially misleading naming?

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-dev

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 15, 2016
@izgzhen

izgzhen commented Jul 15, 2016 •

Copy link
Copy Markdown
Contributor Author

@bors-servo try

I fixed up the test-unit

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit a364a37 with merge c961e71...

bors-servo pushed a commit that referenced this pull request Jul 15, 2016
Put Blob URL online

This PR connects the resource requests with file manager thread, including:

+ `script_thread` load request
+ `image_cache_thread` load request
+ XHR load request (the responding part code yet not implemented due to unfamiliarity with fetch standard, but the infra is here)

One notable change is the introduction of "long-live validity", to handle the case specified in WPT test FileAPI/blob/Blob-XHR-revoke.html.

r? @Manishearth

<!-- 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 #10539
- [x] There are tests for these changes

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12440)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-dev

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 15, 2016
@izgzhen

izgzhen commented Jul 15, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo try

Fixed tidy (Feeling like homu would come to GMT 0800 and bite me)

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 60b116b with merge 4cc4bc3...

bors-servo pushed a commit that referenced this pull request Jul 15, 2016
Put Blob URL online

This PR connects the resource requests with file manager thread, including:

+ `script_thread` load request
+ `image_cache_thread` load request
+ XHR load request (the responding part code yet not implemented due to unfamiliarity with fetch standard, but the infra is here)

One notable change is the introduction of "long-live validity", to handle the case specified in WPT test FileAPI/blob/Blob-XHR-revoke.html.

r? @Manishearth

<!-- 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 #10539
- [x] There are tests for these changes

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12440)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-rel

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 15, 2016
@highfive

Copy link
Copy Markdown
  ▶ PASS [expected FAIL] /FileAPI/url/url_xmlhttprequest_img.html

  ▶ OK [expected TIMEOUT] /workers/constructors/Worker/Blob-url.html

  ▶ Unexpected subtest result in /workers/constructors/Worker/Blob-url.html:
  └ PASS [expected TIMEOUT] Worker supports Blob url

@highfive highfive removed the S-tests-failed The changes caused existing tests to fail. label Jul 15, 2016
@izgzhen

izgzhen commented Jul 15, 2016

Copy link
Copy Markdown
Contributor Author

@bors-servo try

WPT tests updated

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit fdc3a8e with merge db547d0...

bors-servo pushed a commit that referenced this pull request Jul 15, 2016
Put Blob URL online

This PR connects the resource requests with file manager thread, including:

+ `script_thread` load request
+ `image_cache_thread` load request
+ XHR load request (the responding part code yet not implemented due to unfamiliarity with fetch standard, but the infra is here)

One notable change is the introduction of "long-live validity", to handle the case specified in WPT test FileAPI/blob/Blob-XHR-revoke.html.

r? @Manishearth

<!-- 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 #10539
- [x] There are tests for these changes

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12440)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows

@Manishearth

Copy link
Copy Markdown
Member

@bors-servo r+

Now that most of the functionality exists, could you go through the list of tests that still fail and ensure that there aren't any tests there that shouldn't be (tests which should pass in Servo but fail)? I'm a bit concerned by the small number of fixed tests in each PR, but it looks like WPT has very few File tests to begin with 😄 so I don't think that's due to imperfections in your changes.

Perhaps we should add more.

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit fdc3a8e has been approved by Manishearth

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 15, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit fdc3a8e with merge 0e5893d...

bors-servo pushed a commit that referenced this pull request Jul 15, 2016
Put Blob URL online

This PR connects the resource requests with file manager thread, including:

+ `script_thread` load request
+ `image_cache_thread` load request
+ XHR load request (the responding part code yet not implemented due to unfamiliarity with fetch standard, but the infra is here)

One notable change is the introduction of "long-live validity", to handle the case specified in WPT test FileAPI/blob/Blob-XHR-revoke.html.

r? @Manishearth

<!-- 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 #10539
- [x] There are tests for these changes

<!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/12440)
<!-- Reviewable:end -->
@izgzhen

izgzhen commented Jul 15, 2016

Copy link
Copy Markdown
Contributor Author

@Manishearth as I peeked a few days ago, most of the failed tests are due to ArrayBuffer. But yes, I should really consider adding more tests :)

@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows

@bors-servo
bors-servo merged commit fdc3a8e into servo:master Jul 15, 2016
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 15, 2016
@nox

nox commented Jul 18, 2016

Copy link
Copy Markdown
Contributor

Would be great to explain why the file manager now needs to be passed to new_core_resource_thread, this isn't made clear in the corresponding commit.

@izgzhen

izgzhen commented Jul 18, 2016

Copy link
Copy Markdown
Contributor Author

@nox Because the ResourceManager will be responsible to forward the blob URL loading request to file manager as here. So we need to grab a reference to it in the initialisation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Blob URLs

5 participants