Commit Graph

10 Commits

Author SHA1 Message Date
Kris Maglione
ee30da7682 Bug 1370752: Part 3 - Use structured clone rather than JSON to sanitize storage values. r=aswan
This gives us performance wins in sevaral areas:

- Creating a structured clone blob of storage data directly from the source
  compartment allows us to avoid X-ray and JSON serialization overhead when
  storing new values.

- Storing the intermediate StructuredCloneBlob, rather than JSON values,
  in-memory saves us additional JSON and structured clone overhead when
  passing the values to listeners and API callers, and saves us a fair amount
  of memory to boot.

- Serializing storage values before sending them over a message manager allows
  us to deserialize them directly into an extension scope on the other side,
  saving us a lot of additional structured clone overhead and intermediate
  garbage generation.

- Using JSONFile.jsm for storage lets us consolidate multiple storage file
  write operations, rather than performing a separate JSON serialization for
  each individual storage write.

- Additionally, this paves the way for us to transition to IndexedDB as a
  storage backend, with full support for arbitrary structured-clone-compatible
  data structures.

MozReview-Commit-ID: JiRE7EFMYxn
2017-07-10 18:24:11 -07:00
Wes Kocher
a0b015fa22 Backed out 2 changesets (bug 1370752) for failures in test_ext_storage.js a=backout
Backed out changeset 42d3c1599af5 (bug 1370752)
Backed out changeset 9c4bf59ab966 (bug 1370752)

MozReview-Commit-ID: 4M6DsJvJ6RI
2017-07-10 14:34:56 -07:00
Kris Maglione
5c0bb13dcc Bug 1370752: Part 3 - Use structured clone rather than JSON to sanitize storage values. r=aswan
This gives us performance wins in sevaral areas:

- Creating a structured clone blob of storage data directly from the source
  compartment allows us to avoid X-ray and JSON serialization overhead when
  storing new values.

- Storing the intermediate StructuredCloneBlob, rather than JSON values,
  in-memory saves us additional JSON and structured clone overhead when
  passing the values to listeners and API callers, and saves us a fair amount
  of memory to boot.

- Serializing storage values before sending them over a message manager allows
  us to deserialize them directly into an extension scope on the other side,
  saving us a lot of additional structured clone overhead and intermediate
  garbage generation.

- Using JSONFile.jsm for storage lets us consolidate multiple storage file
  write operations, rather than performing a separate JSON serialization for
  each individual storage write.

- Additionally, this paves the way for us to transition to IndexedDB as a
  storage backend, with full support for arbitrary structured-clone-compatible
  data structures.

MozReview-Commit-ID: JiRE7EFMYxn
2017-06-29 14:11:05 -07:00
Bob Silverberg
cf196e9e1f Bug 1371398 - Add telemetry for time spent getting and setting browser.storage.local, r=bsmedberg,kmag
MozReview-Commit-ID: L5HyFkTQtRR
2017-06-19 13:00:19 -04:00
Kris Maglione
884009911d Bug 1350522: Part 2 - Convert toolkit APIs to lazy loading. r=aswan
MozReview-Commit-ID: 8TbTIM4WX2d
2017-03-31 19:36:00 -07:00
Michiel de Jong
f4b60082d3 Bug 1253740 - Implement storage.sync, r=bsilverberg,kmag
MozReview-Commit-ID: 5v9nYBTgekj
2016-08-11 18:16:37 -04:00
Wes Kocher
f17d46cc2b Backed out 9 changesets (bug 1253740) for xpcshell failures a=backout
Backed out changeset 903890f218dd (bug 1253740)
Backed out changeset 1b13fe394b66 (bug 1253740)
Backed out changeset e1312ab53299 (bug 1253740)
Backed out changeset 5b5338a2baeb (bug 1253740)
Backed out changeset d3d89d4e2d87 (bug 1253740)
Backed out changeset 96da5e6944b8 (bug 1253740)
Backed out changeset 4fbff333994f (bug 1253740)
Backed out changeset 653788e146f2 (bug 1253740)
Backed out changeset b98fa03d8c15 (bug 1253740)
2016-11-11 18:59:24 -08:00
Michiel de Jong
a1fdb6f3ff Bug 1253740 - Implement storage.sync, r=bsilverberg,kmag
MozReview-Commit-ID: 5v9nYBTgekj
2016-08-11 18:16:37 -04:00
Kris Maglione
51b8b8e0b6 Remove stray debugging statement (no bug). r=aswan
MozReview-Commit-ID: 5ZJ9Aw5A9HY
2016-11-04 09:17:41 -07:00
Rob Wu
ab47bf4a5d Bug 1287007 - Fix cross-process browser.storage.local serialization r=billm
- Lazily initialize file IO-specific stuff in ExtensionStorage.jsm,
  and limit this work to the main process.

- Add local versions of the `storage.local.get` and `storage.local.set`
  implementations that perform sanitization (without the change, values
  are improperly serialized over IPC).

- Copied the `backgroundScript` test from xpcshell/test_ext_storage.js
  to mochitest/test_ext_storage_content.html because they should behave
  identical. Before this patch the test failed due to IPC serialization
  issues, now the test passes.
  Note that the old test also passes with the changes.

MozReview-Commit-ID: 8J8CCdwMACN
2016-09-04 19:19:17 -07:00