Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add consume stream callback #24653

Conversation

@ridhimrastogi
Copy link
Contributor

ridhimrastogi commented Nov 4, 2019

Added the consume stream callback function as per the steps mentioned here


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #21476
@highfive
Copy link

highfive commented Nov 4, 2019

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @ferjm (or someone else) soon.

@highfive
Copy link

highfive commented Nov 4, 2019

Heads up! This PR modifies the following files:

@highfive
Copy link

highfive commented Nov 4, 2019

warning Warning warning

  • These commits modify unsafe code. Please review it carefully!
  • These commits modify script code, but no tests are modified. Please consider adding a test!
Copy link
Member

jdm left a comment

Good start! We should add the call to InitStreamConsumerCallback as part of this pull request.

components/script/script_runtime.rs Outdated Show resolved Hide resolved
components/script/script_runtime.rs Outdated Show resolved Hide resolved
components/script/script_runtime.rs Outdated Show resolved Hide resolved
components/script/script_runtime.rs Outdated Show resolved Hide resolved
components/script/script_runtime.rs Outdated Show resolved Hide resolved
components/script/script_runtime.rs Outdated Show resolved Hide resolved
components/script/script_runtime.rs Outdated Show resolved Hide resolved
components/script/script_runtime.rs Outdated Show resolved Hide resolved
@jdm jdm assigned jdm and unassigned ferjm Nov 4, 2019
Copy link
Member

jdm left a comment

Almost there!

components/script/script_runtime.rs Outdated Show resolved Hide resolved
components/script/script_runtime.rs Outdated Show resolved Hide resolved
@jdm
Copy link
Member

jdm commented Nov 5, 2019

If you add a call to InitStreamConsumerCallback that makes use of consume_stream and report_stream_error, then we can run the automated tests and see if any of these changes are observable!

@jdm
Copy link
Member

jdm commented Nov 7, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Nov 7, 2019

Trying commit a377f9c with merge 1ae4d15...

bors-servo added a commit that referenced this pull request Nov 7, 2019
…nitial-2, r=<try>

Add consume stream callback

<!-- Please describe your changes on the following line: -->
Added the consume stream callback function. Completed steps 1, 2(1-5) and 3 mentioned [here](https://webassembly.github.io/spec/web-api/index.html#compile-a-potential-webassembly-response)

---
<!-- 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 #21476

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@jdm
Copy link
Member

jdm commented Nov 7, 2019

I did a little poking around in this branch on my own machine and discovered that if you add the following:

    unsafe extern "C" fn dispatch_to_event_loop(_closure: *mut c_void, _dispatchable: *mut Dispatchable) -> bool {
        false
    }
    InitDispatchToEventLoop(cx, Some(dispatch_to_event_loop), ptr::null_mut());

Then you will start getting meaningful test results by running ./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi. In particular, a bunch of tests in contenttype.any.js will start timing out because there is an == instead of an != in the new code :)

@ridhimrastogi
Copy link
Contributor Author

ridhimrastogi commented Nov 7, 2019

@jdm Can you give a little more detail on where to invoke the InitDispatchToEventLoop method. On adding it to the new_rt_and_cx_with_parent() I see no change in behaviour in the test results from ./mach test-wpt tests/wpt/web-platform-tests/wasm/webapi

@jdm
Copy link
Member

jdm commented Nov 12, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Nov 12, 2019

Testing commit 5639618 with merge 5b9d3db...

bors-servo added a commit that referenced this pull request Nov 12, 2019
…nitial-2, r=jdm

Add consume stream callback

<!-- Please describe your changes on the following line: -->
Added the consume stream callback function as per the steps mentioned [here](https://webassembly.github.io/spec/web-api/index.html#compile-a-potential-webassembly-response)

---
<!-- 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 #21476

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 12, 2019

💔 Test failed - status-taskcluster

@CYBAI
Copy link
Collaborator

CYBAI commented Nov 12, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Nov 12, 2019

💣 Failed to start rebuilding: 405 Not Allowed

@bors-servo
Copy link
Contributor

bors-servo commented Nov 12, 2019

Testing commit 5639618 with merge efa7a42...

bors-servo added a commit that referenced this pull request Nov 12, 2019
…nitial-2, r=jdm

Add consume stream callback

<!-- Please describe your changes on the following line: -->
Added the consume stream callback function as per the steps mentioned [here](https://webassembly.github.io/spec/web-api/index.html#compile-a-potential-webassembly-response)

---
<!-- 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 #21476

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 12, 2019

💔 Test failed - status-taskcluster

@CYBAI
Copy link
Collaborator

CYBAI commented Nov 12, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Nov 12, 2019

💣 Failed to start rebuilding: 405 Not Allowed

@bors-servo
Copy link
Contributor

bors-servo commented Nov 12, 2019

Testing commit 5639618 with merge 944c1e9...

bors-servo added a commit that referenced this pull request Nov 12, 2019
…nitial-2, r=jdm

Add consume stream callback

<!-- Please describe your changes on the following line: -->
Added the consume stream callback function as per the steps mentioned [here](https://webassembly.github.io/spec/web-api/index.html#compile-a-potential-webassembly-response)

---
<!-- 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 #21476

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@bors-servo
Copy link
Contributor

bors-servo commented Nov 12, 2019

💔 Test failed - linux-rel-wpt

@CYBAI
Copy link
Collaborator

CYBAI commented Nov 12, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Nov 12, 2019

Previous build results for linux-rel-css, status-taskcluster are reusable. Rebuilding only linux-rel-wpt...

@bors-servo
Copy link
Contributor

bors-servo commented Nov 12, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jdm
Pushing 944c1e9 to master...

@bors-servo bors-servo merged commit 5639618 into servo:master Nov 12, 2019
2 checks passed
2 checks passed
Community-TC (pull_request) TaskGroup: success
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

7 participants
You can’t perform that action at this time.