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

45 Коммитов

Автор SHA1 Сообщение Дата
Daniel Varga 8edab673d8 Backed out changeset d15b968aa6d1 (bug 1615297) for causing build bustage
CLOSED TREE

--HG--
extra : rebase_source : 4e525e82fb7f194d9b7eac0020932ed09ac005b7
2020-03-11 05:41:51 +02:00
Sebastian Streich 1f23aca56c Bug 1615297 - Move Localstorage Keygen into Principal r=ckerschb,baku
Differential Revision: https://phabricator.services.mozilla.com/D62757

--HG--
extra : moz-landing-system : lando
2020-03-10 18:10:08 +00:00
Eric Rahm e61be8e54e Bug 1617653 - Remove nsAutoPtr usage from localstorage, quota, storage, simpledb. r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D63913

--HG--
extra : moz-landing-system : lando
2020-02-25 23:14:57 +00:00
Simon Giesecke fa114fcf6f Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/localstorage. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D62556

--HG--
extra : moz-landing-system : lando
2020-02-12 10:24:28 +00:00
Boris Zbarsky 75124bdd98 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067

--HG--
extra : moz-landing-system : lando
2019-12-05 04:44:32 +00:00
Jan Varga 458afbbe35 Bug 1586315 - LSNG: Finish RequestHelper when LSRequestChild actor is unexpectedly destroyed; r=asuth
If LSRequestChild actor is unexpectedly destroyed, the nested event loop runs
until the timer fires. This patch improves that by calling the callback in
LSRequestChild::ActorDestroyed which immediatelly finishes RequestHelper and
finishes the nested event loop in the end too.

Differential Revision: https://phabricator.services.mozilla.com/D48194

--HG--
extra : moz-landing-system : lando
2019-10-06 21:05:45 +00:00
Jan Varga dc66b57d8b Bug 1574569 - Don't abort LocalStorage requests when a sync message from parent is detected; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D42796

--HG--
extra : moz-landing-system : lando
2019-08-21 20:24:00 +00:00
Jan Varga fe813f031d Bug 1534431 - Part 2: Disallow LS requests with undefined client id; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D33595
2019-06-03 15:32:59 +02:00
Jan Varga 67c1136dd9 Bug 1556217 - LSNG: Add a test for large items; r=asuth, smaug
Differential Revision: https://phabricator.services.mozilla.com/D33417
2019-06-02 08:00:25 +02:00
Ehsan Akhgari 98960a9c41 Bug 1554361 - Move the high-level storage access check APIs to mozilla/StorageAccess.h; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D32556

--HG--
extra : moz-landing-system : lando
2019-05-27 14:06:49 +00:00
Andrea Marchesini dc7545548e Bug 1551055 - StoragePrincipal should be supported by localStorage - part 1, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D30801

--HG--
extra : moz-landing-system : lando
2019-05-14 05:49:46 +00:00
Ciure Andrei f1dd75ca22 Backed out 3 changesets (bug 1551055) for causing xpcshell localStorage perma failures CLOSED TREE
Backed out changeset 21e44ad9c6df (bug 1551055)
Backed out changeset 8727e61ab69b (bug 1551055)
Backed out changeset d99a6769beb4 (bug 1551055)

--HG--
extra : rebase_source : 56f7fe5c54cd7e4109acce5074be1aba12e91086
2019-05-13 22:40:22 +03:00
Andrea Marchesini e1b74991fb Bug 1551055 - StoragePrincipal should be supported by localStorage - part 1, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D30801

--HG--
extra : moz-landing-system : lando
2019-05-13 18:42:36 +00:00
Ciure Andrei ec1fe36f87 Backed out changeset 97d88752079f (bug 1540401) for causing a nightly startup crash a=backout 2019-04-04 04:45:08 +03:00
Jan Varga 8838c839de Bug 1540401 - LSNG: Convert most of MOZ_ASSERT to MOZ_DIAGNOSTIC_ASSERT; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D25549
2019-04-01 01:18:10 +02:00
Jan Varga 1ce29b4c3b Bug 1535221 - Add infrastructure for hang debugging; r=asuth
This patch adds a timer for synchronous local storage requests. Once the timer
fires the request is canceled. The parent reports debugging information upon receiving cancellation.

Differential Revision: https://phabricator.services.mozilla.com/D24006
2019-03-19 12:23:16 +01:00
Sylvestre Ledru 4aa92e3091 Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D22514
2019-03-13 10:19:06 +01:00
Jan Varga 559e8234e4 Bug 1534208 - LSNG: DOM File thread and PBackground child for it must be created as soon as possible; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D22976
2019-03-11 15:35:04 +01:00
Jan Varga f150c82b06 Bug 1517089 - Part 14: Use ClientManagerService for client validation; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D19208
2019-02-08 21:02:14 +01:00
Jan Varga 2e11851013 Bug 1517089 - Part 13: Use separate IPC params and response for datastore preloading; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D19207
2019-02-08 21:02:11 +01:00
Jan Varga 993ecafb04 Bug 1517089 - Part 11: Verify principalInfo before creating any parent actors; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D19205
2019-02-08 21:02:03 +01:00
Jan Varga 7fa5c4663a Bug 1517089 - Part 7: Pass originKey through IPC and get privateBrowsingId directly from ContentPrincipalInfo; r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D19201
2019-02-08 21:01:31 +01:00
Yaron Tausky 43054fe975 Bug 1516277 - Add local execution mode to nsThread r=janv,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D21241

--HG--
extra : moz-landing-system : lando
2019-03-06 16:26:07 +00:00
Gurzau Raul d5392415e2 Backed out changeset 44d83d32e254 (bug 1516277) for failing at /test/unit/test_eviction.js on a CLOSED TREE. 2019-03-06 17:50:28 +02:00
Yaron Tausky 3aa9896ebc Bug 1516277 - Add local execution mode to nsThread r=janv,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D21241

--HG--
extra : moz-landing-system : lando
2019-03-06 13:53:16 +00:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru cccdda3c2a Bug 1516555 - Reformat everything to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D15426

--HG--
extra : moz-landing-system : lando
2018-12-28 15:48:06 +00:00
Jan Varga 849998a8e0 Bug 1513859 - CPOWs can still cause a hang with LSNG enabled; r=asuth 2018-12-19 12:38:23 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Andrew Sutherland 6c6e230a77 Bug 1286798 - Part 53: Review code comments; r=janv,mrbkap,mccr8 2018-11-05 14:04:39 -05:00
Jan Varga 06d1c01932 Bug 1286798 - Part 33: Restrict localStorage from being available on some pages; r=asuth
This matches the old implementation. localStorage shouldn't be available on some pages, for example about:home.
2018-11-29 21:49:01 +01:00
Jan Varga d87888fe25 Bug 1286798 - Part 31: Support for lazy loading of items; r=asuth,mrbkap,mccr8
There's now an upper limit for snapshot prefilling. The value is configurable and is currently set to 4096 bytes.
Snapshots can operate in multiple modes depending on if all items have been loaded or all keys have been received. This should provide the best performance for each specific state.
This patch also adds support for creating explicit snapshots which can be used for testing.
2018-11-29 21:48:54 +01:00
Jan Varga c4f55013cf Bug 1286798 - Part 29: Implement implicit snapshotting of databases; r=asuth,mccr8
This improves performance a lot in cases when multiple operations are invoked by a single JS function (number of sync IPC calls is reduced to a minimum). It also improves correctness since changes are not visible to other content processes until a JS function finishes.
The patch implements core infrastructure, all items are sent to content when a snapshot is initialized and everything is fully working. However, sending of all items at once is not optimal for bigger databases. Support for lazy loading of items is implemented in a following patch.
2018-11-29 21:48:47 +01:00
Jan Varga 1812608353 Bug 1286798 - Part 27: Share database actors; r=asuth
If a database actor already exists for given origin, reuse it instead of creating a new one. This improves memory footprint a bit and also eliminates some round trips to the parent process.
2018-11-29 21:48:41 +01:00
Jan Varga 0649224345 Bug 1286798 - Part 26: Implement a lazy data migration from old webappsstore.sqlite; r=asuth,janv
This patch was enhanced by asuth to bind attached database path.
Places has shown that argument binding is necessary.  (Profiles may include usernames in their path which can have cool emoji and such.)
2018-11-29 21:48:38 +01:00
Jan Varga 6e40a9dccb Bug 1286798 - Part 22: Add support for preloading of datastores; r=asuth
Datastores are preloaded only for content principals. The preloading is triggered as soon as possible to lower the chance of blocking the main thread in content process. If there is no physical database on disk for given origin, datastore is not created. Preloaded datastores are kept alive for 20 seconds.
2018-11-29 21:48:25 +01:00
Jan Varga b968ceb813 Bug 1286798 - Part 18: Verify that data is persisted on disk; r=asuth,mrbkap
New methods open() and close() are added to the Storage WebIDL interface. They are only available when a pref is set and are only intended for testing. There's also a new method resetStoragesForPrincipal() which is used as a callback for close() since datastores don't release directory locks immediately. resetStoragesForPrincipal() requests an exclusive lock for given origin, so it must wait for any exising shared locks to be released.
2018-11-29 21:48:11 +01:00
Jan Varga 944443d481 Bug 1286798 - Part 16: Adjust ClearDataService for new local storage implementation; r=asuth
This patch also adds support for creating LSObjects from chrome for any given origin which can be used for example by xpcshell tests.
2018-11-29 21:48:05 +01:00
Jan Varga 65acbea52d Bug 1286798 - Part 13: Preparation for quota checks; r=asuth 2018-11-29 21:47:55 +01:00
Jan Varga ae769dcc6b Bug 1286798 - Part 12: Honor the storage preference and cookie settings in all LocalStorage API methods; r=asuth 2018-11-29 21:47:52 +01:00
Jan Varga be167c5e0b Bug 1286798 - Part 10: Support for storage events; r=asuth,janv
Storage events are fired either directly after getting response from synchronous SetItem call or through observers. When a new onstorage event listener is added, we sycnhronously register an observer in the parent process. There's always only one observer actor per content process.
PBackgroundLSDatabase is now managed by a new PBackgroundLSObject protocol. PBackgroundLSObject is needed to eliminate the need to pass the principal info and document URI everytime a write operation occurs.
Preparation of an observer shares some states with preparation of a datastore, so common stuff now lives in LSRequestBase and preparation of a datastore now implements a nested state machine.

This patch was enhanced by asuth to drop observers only when the last storage listener is removed.
EventListenerRemoved is invoked on any removal, not just the final removal, so we need to make sure it's the final removal before dropping observer.
2018-11-29 21:47:45 +01:00
Jan Varga c934ad618d Bug 1286798 - Part 6: Fix a dead lock in the single process case; r=asuth,janv
Expose the nested main event target, so it can be used in the single process case by the parent side to process runnables which need to run on the main thread.
After this change we don't have use hacks like getting profile directory path on the child side and sending it to the parent. The parent side can now do it freely even in the single process case.

This patch was enhanced by asuth to not tunnel the nested main event target through IPC.
2018-11-29 21:47:30 +01:00
Jan Varga c5676a58c7 Bug 1286798 - Part 5: More integration with QuotaManager; r=asuth
Preparation of datastores now creates real database files on disk. The LocalStorage directory is protected by a directory lock.
Infrastructure for database schema upgrades is in place too.
Database actors are now explicitely tracked by the datastore. When the last actor finishes the directory lock is released.
Added also implementation for QuotaClient::GetUsageForOrigin() and QuotaClient::AbortOperations().
2018-11-29 21:47:27 +01:00
Jan Varga 9f71846e2a Bug 1286798 - Part 4: Basic integration with QuotaManager; r=asuth
This adds a new quota client implementation, but only implements ShutdownWorkThreads.
At shutdown we wait for all running operations to finish including database actors which are closed by using an extra IPC message which avoids races between the parent and child.
Databases are dropped on the child side as soon as they are not used (e.g. after unlinking by the cycle collector).
2018-11-29 21:47:24 +01:00
Jan Varga 60831f2e38 Bug 1286798 - Part 3: New basic (memory only) implementation of LocalStorage; r=asuth,mccr8
The implementation is based on a cache (datastore) living in the parent process and sync IPC calls initiated from content processes.
IPC communication is done using per principal/origin database actors which connect to the datastore.
The synchronous blocking of the main thread is done by creating a nested event target and spinning the event loop.
2018-11-29 21:47:20 +01:00