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

Webworker in iframe #819

Merged
merged 9 commits into from
Jun 7, 2019
Merged

Webworker in iframe #819

merged 9 commits into from
Jun 7, 2019

Conversation

AquiGorka
Copy link
Contributor

Adds extra sandboxing to webworkers by executing them in iframe.

@bpierre
Copy link
Contributor

bpierre commented Jun 4, 2019

Looking good! We should also provide a way to clean the things created by this class (event listener and injected element). Did you notice any change in terms of performances?

@AquiGorka AquiGorka force-pushed the feature/webworker-in-iframe branch from 0ae8b16 to 8644019 Compare June 5, 2019 09:19
@AquiGorka
Copy link
Contributor Author

We should also provide a way to clean the things created by this class (event listener and injected element).

Done. 😄

Did you notice any change in terms of performances?

Did not do any benchmark nor profiling, locally feels the same, did load anv and it worked fast. We should ask @sohkai to perform the tests he was doing in the experiments here to see if this affects performance.

src/iframe-worker.js Outdated Show resolved Hide resolved
Copy link
Contributor

@2color 2color left a comment

Choose a reason for hiding this comment

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

LGTM. I tested and there were no noticeable performance regressions.

@2color
Copy link
Contributor

2color commented Jun 7, 2019

@AquiGorka One last question, who calls terminate?

@AquiGorka
Copy link
Contributor Author

AquiGorka commented Jun 7, 2019

@2color :

Update, this is the correct one: https://github.com/aragon/aragon/blob/ee6853f3c159d40e51611830454586663fd080ae/src/worker-utils.js#L61

@bpierre
Copy link
Contributor

bpierre commented Jun 7, 2019

@AquiGorka One last question, who calls terminate?

We should call it from here: https://github.com/aragon/aragon/blob/feature/webworker-in-iframe/src/aragonjs-wrapper.js#L405

So that it gets cleaned when needed: https://github.com/aragon/aragon/blob/feature/webworker-in-iframe/src/App.js#L199

Loading another DAO probably doesn’t work in the current state?

Edit: oh right, I missed that @AquiGorka

Copy link
Contributor

@bpierre bpierre left a comment

Choose a reason for hiding this comment

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

💯

@AquiGorka AquiGorka merged commit e9a6b24 into master Jun 7, 2019
@delete-merged-branch delete-merged-branch bot deleted the feature/webworker-in-iframe branch June 7, 2019 14:09
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.

3 participants