Граф коммитов

13 Коммитов

Автор SHA1 Сообщение Дата
Kris Maglione e86d905625 Bug 1370752: Part 2 - Allow fallback serializer when JSON.serialize fails. r=aswan
Currently, we need to be able to handle serializing non-JSON-compatible
objects without catastrophically failing to save the storage file. Ideally, we
would ensure this in the ordinary toJSON method. However, that would require
a unnecessary extra calls to JSON.stringify for each object that needs to be
sanitized before returning a JSON-safe value, which is more expensive than we
can afford.

The fallback toJSONSafe method allows us to do this only when necessary, due
to an initial failed JSON serialization.

MozReview-Commit-ID: JXQ001dOGtW

--HG--
extra : rebase_source : ae52bdab81b03bb4c31edbe4b78584fd15c982a3
extra : source : 9c4bf59ab966a8ec17181d85cc1fc4be7450cca3
2017-06-09 18:19:11 -07:00
Wes Kocher 8185294d28 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 45acce829f Bug 1370752: Part 2 - Allow fallback serializer when JSON.serialize fails. r=aswan
Currently, we need to be able to handle serializing non-JSON-compatible
objects without catastrophically failing to save the storage file. Ideally, we
would ensure this in the ordinary toJSON method. However, that would require
a unnecessary extra calls to JSON.stringify for each object that needs to be
sanitized before returning a JSON-safe value, which is more expensive than we
can afford.

The fallback toJSONSafe method allows us to do this only when necessary, due
to an initial failed JSON serialization.

MozReview-Commit-ID: JXQ001dOGtW

--HG--
extra : rebase_source : 0b7b388316fdc464b47cdd4f7d8c70bc906a9c27
2017-06-09 18:19:11 -07:00
Kris Maglione 074f5a19ce Bug 1358846: Part 2 - Allow using file compression with JSONFile.jsm. r=rhelmer
MozReview-Commit-ID: 5lHsZqBGq3E

--HG--
extra : rebase_source : 1df59152becd11bd95b97fc94ebca83392c17027
extra : source : cb2518673c56cf3b45e4d4a8f2959191290c00d8
2017-04-22 18:23:22 -07:00
Florian Quèze 1d0e28a791 Bug 1353542 - script-generated patch to remove .bind(this) calls we no longer need now that generator functions have been replaced with async functions, r=Mossop. 2017-05-12 14:47:41 +02:00
Florian Quèze 5e3539e504 Bug 1353542 - massive script-generated patch converting Task.async and Task.spawn calls, and generators clearly identifiable as tasks, rs=Mossop. 2017-05-12 14:42:39 +02:00
Kit Cambridge c8df401c3d Bug 1332024 - Add a method to explicitly finalize `JSONFile` objects. r=Paolo
MozReview-Commit-ID: QaRqLBGEft

--HG--
extra : rebase_source : 60eebe06afc5795463780eb99e4e6c42372d7e8b
2017-01-24 17:38:35 -08:00
Kit Cambridge a509364284 Bug 1319175 - Add a `data` setter and `beforeSave` hook to `JSONFile`. r=MattN
* The `data` setter sets the backing data object to a new value, and
  flips `dataReady` so that `ensureDataReady` and `load` don't read
  stale data from disk. This can be used to clear existing data.
* The `beforeSave` hook is called from `_save`, as part of the deferred
  task. This can be used to create intermediate directories containing
  the file, or run other pre-save tasks that shouldn't be interrupted
  by shutdown.

MozReview-Commit-ID: AzOx7u2Rali

--HG--
extra : rebase_source : 42c0235774ca34e097e858b6ef796c4d1bd4f122
2016-12-19 08:32:29 -08:00
Dave Townsend c5bb304fd9 Bug 1316882: Turn on space-before-function-paren eslint rule (toolkit). r=jaws
MozReview-Commit-ID: FGFwg6TYkvm

--HG--
extra : rebase_source : 4073cebbef1694393efe312aaafbdb803adbd304
2016-11-11 15:22:34 -08:00
Jared Wein 87b2d4c295 Bug 1315013 - part 1, remove unnecessary double-slash comments that don't add value and look out of place with the spaced-comment eslint rule. r=mossop
MozReview-Commit-ID: HIUTSdkXxbY

--HG--
extra : rebase_source : 2f05e2f275ac7f293f9c650bdec8943189e3ce01
2016-11-03 14:42:06 -04:00
Jared Wein 5040f17e00 Bug 1312486 - Enable no-extra-boolean-cast, no-new-object, no-shadow-restricted-names, and spaced-comment rules for eslint. r=standard8
MozReview-Commit-ID: 7Gx90a5y8t6

--HG--
extra : rebase_source : 9c8a6b15c19982d720b0163fbbf19d465da786fe
2016-10-24 13:14:19 -04:00
Luke Chang aa29135011 Bug 1309481 - Remove leftover code specific to Logins from JSONFile.jsm and add tests; r=Paolo
MozReview-Commit-ID: DjEPCN2PXA1

--HG--
extra : rebase_source : d1150d6a0cbc94282d6120f38c094fb58eed9d5e
2016-10-17 18:26:35 +08:00
Luke Chang e55158ff06 Bug 1304322 - Refactor LoginStore.jsm to make it reusable for Form Autofill; r=MattN
MozReview-Commit-ID: Kx8aALU7fu2

--HG--
rename : toolkit/components/passwordmgr/LoginStore.jsm => toolkit/modules/JSONFile.jsm
extra : rebase_source : c22f5e8d79e0727ebe562e746fa1f8232600f8aa
2016-09-21 17:29:48 +08:00