Closed
Bug 1248447
Opened 8 years ago
Closed 8 years ago
Stop grafting prototypes in storage.js::patchMetadataMapsAndProtos()
Categories
(DevTools :: Storage Inspector, defect, P3)
DevTools
Storage Inspector
Tracking
(firefox48 fixed)
RESOLVED
FIXED
Firefox 48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: miker, Unassigned)
Details
(Whiteboard: [btpp-backlog])
Attachments
(1 file)
When the object store moves from one process to another it has been through JSON.stringify() and JSON.parse() so it loses it's important methods and Maps are changed from Maps to arrays of arrays. To work around this issue we graft the __proto__ object and change the arrays of arrays back to patches but this is bad practice and has a negative effect on JavaScript performance. It seems like there must be a better way to do this... maybe there are properties here that we don't need and maybe we are better not to use Maps. We should check which values we *need* and see if we can provide them. Here is the offending method: patchMetadataMapsAndProtos: function(metadata) { for (let [, store] of metadata._objectStores) { store.__proto__ = ObjectStoreMetadata.prototype; if (typeof store._indexes.length !== "undefined") { store._indexes = new Map(store._indexes); } for (let [, value] of store._indexes) { value.__proto__ = IndexMetadata.prototype; } } metadata._objectStores = new Map(metadata._objectStores); metadata.__proto__ = DatabaseMetadata.prototype; }
Comment 1•8 years ago
|
||
Doing bug triage with Emma. Filter on LOBSTER-THERMADOR
Priority: -- → P3
Whiteboard: [btpp-backlog]
Reporter | ||
Comment 2•8 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/40795/diff/#index_header See other reviews: https://reviewboard.mozilla.org/r/40795/
Reporter | ||
Updated•8 years ago
|
Attachment #8731727 -
Flags: review?(pbrosset)
Comment 3•8 years ago
|
||
Comment on attachment 8731727 [details] MozReview Request: Bug 1248447 - Stop grafting prototypes in storage.js::patchMetadataMapsAndProtos() r?pbrosset https://reviewboard.mozilla.org/r/40795/#review37851 I was not familiar with this part of the code before, and I'm not too sure what some of DatabaseMetadata does, but this looks like a simple change that helps with performance and gets rid of `__proto__`, which is good.
Attachment #8731727 -
Flags: review?(pbrosset) → review+
Reporter | ||
Comment 5•8 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/297bb754e23135fefc9683024bd33b7503427ee8 Bug 1248447 - Stop grafting prototypes in storage.js::patchMetadataMapsAndProtos() r+pbro
Reporter | ||
Comment 6•8 years ago
|
||
https://hg.mozilla.org/integration/fx-team/rev/297bb754e231
Comment 7•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/297bb754e231
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Comment 8•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/4fba702c0a22
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•