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

fix double borrowing of image request #17120

Merged

Conversation

@gterzian
Copy link
Member

gterzian commented Jun 1, 2017

@jdm I couldn't reproduce the crashes, but looking at the code, I can tell that if we hit the cache inside fetch_image, we go straight to process_image_response, so we're still in the same scope as that where the borrowing occurs in prepare_image_request. When there is no cache hit, process_image_response is executed as part of a task...

This should fix the issue, while retaining the original logic.

All tests in the-img-element are passing...


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #17109 (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

highfive commented Jun 1, 2017

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/htmlimageelement.rs
  • @KiChjang: components/script/dom/htmlimageelement.rs
@highfive
Copy link

highfive commented Jun 1, 2017

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@jdm
Copy link
Member

jdm commented Jun 1, 2017

@bors-servo: r+
Makes sense. Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Jun 1, 2017

📌 Commit 5bf1105 has been approved by jdm

@highfive highfive assigned jdm and unassigned metajack Jun 1, 2017
@bors-servo
Copy link
Contributor

bors-servo commented Jun 1, 2017

Testing commit 5bf1105 with merge 6a63887...

bors-servo added a commit that referenced this pull request Jun 1, 2017
…, r=jdm

fix double borrowing of image request

<!-- Please describe your changes on the following line: -->

@jdm I couldn't reproduce the crashes, but looking at the code, I can tell that if we hit the cache inside `fetch_image`, we go straight to `process_image_response`, so we're still in the same scope as that where the borrowing occurs in `prepare_image_request`. When there is no cache hit, `process_image_response` is executed as part of a task...

This should fix the issue, while retaining the original logic.

All tests in `the-img-element` are passing...

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #17109 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- 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. -->

<!-- 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/17120)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 1, 2017

@bors-servo bors-servo merged commit 5bf1105 into servo:master Jun 1, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@gterzian gterzian deleted the gterzian:fix_double_borrowing_of_image_request branch Jun 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.