Details
- Reviewers
• sg - Group Reviewers
Restricted Project - Commits
- rMOZILLACENTRAL6e1e8bfee8a1: Bug 1507180 - Make copy of list before iterating over it. r=sg, a=RyanVM
rMOZILLACENTRAL6ec402c01d73: Bug 1507180 - Make copy of list before iterating over it. r=sg, a=RyanVM
rMOZILLACENTRALcdf525897bff: Bug 1507180 - Make copy of list before iterating over it r=dom-workers-and… - Bugzilla Bug ID
- 1507180
Diff Detail
- Repository
- rMOZILLACENTRAL mozilla-central
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
dom/cache/StreamControl.cpp | ||
---|---|---|
60–61 | I had a look into the bug today and I am not sure if this change completely addresses the underlying issue. IIUC, the problem is that the StreamControl object is destroyed when the last stream closes. One consequence of that is that mReadStreamList is destroyed as well and the iterator can no longer be used. But isn't the deletion of the object while we are in one of its member functions bad more generally and should be changed? At least a comment should be added (maybe in a patch to land later) that explains why this is necessary (and maybe that further changes are necessary to address this better). It is a change that could easily be reverted in a later cleanup, since it is not at all obvious. |
dom/cache/StreamControl.cpp | ||
---|---|---|
60–61 | The strange lifecycle management of StreamControl is currently baked into the class such that changing it would be a bigger refactoring. Since I can't reproduce the error and have no test for this, I think a more conservative fix is better for the time being. |
dom/cache/StreamControl.cpp | ||
---|---|---|
60–61 | Ok, I understand that. Please still add a patch to add a comment on the reason for the copy, and maybe add a comment or open another bug to refactor the lifecycle management. |
I opened bug 1600570 to address the lifecycle issue, and D55424 to add a comment explaining the necessity of the copy here.