Name Description Size
ActorsChild.cpp LSDatabaseChild **************************************************************************** 7820
ActorsChild.h Minimal glue actor with standard IPC-managed new/delete existence that exists primarily to track the continued existence of the LSDatabase in the child. Most of the interesting bits happen via PBackgroundLSSnapshot. Mutual raw pointers are maintained between LSDatabase and this class that are cleared at either (expected) when the child starts the deletion process (SendDeleteMeInternal) or unexpected actor death (ActorDestroy). See `PBackgroundLSDatabase.ipdl` for more information. ## Low-Level Lifecycle ## - Created by LSObject::EnsureDatabase if it had to create a database. - Deletion begun by LSDatabase's destructor invoking SendDeleteMeInternal which will result in the parent sending __delete__ which destroys the actor. 7901
ActorsParent.cpp Constants **************************************************************************** 273480
ActorsParent.h 2722
LocalStorageCommon.cpp 3394
LocalStorageCommon.h 11181
LocalStorageManager2.cpp The AsyncRequestHelper has been created and dispatched to the DOM File Thread. 15327
LocalStorageManager2.h Under LSNG this exposes nsILocalStorageManager::Preload to ContentParent to trigger preloading. Otherwise, this is basically just a place for test logic that doesn't make sense to put directly on the Storage WebIDL interface. Previously, the nsIDOMStorageManager XPCOM interface was also used by nsGlobalWindowInner to interact with LocalStorage, but in these de-XPCOM days, we've moved to just directly reference the relevant concrete classes (ex: LSObject) directly. Note that testing methods are now also directly exposed on the Storage WebIDL interface for simplicity/sanity. 2330
LSDatabase.cpp 9224
LSDatabase.h 2379
LSObject.cpp Automatically cancel and abort synchronous LocalStorage requests (for example datastore preparation) if they take this long. We've chosen a value that is long enough that it is unlikely for the problem to be falsely triggered by slow system I/O. We've also chosen a value long enough so that automated tests should time out and fail if LocalStorage hangs. Also, this value is long enough so that testers can notice the (content process) hang; we want to know about the hangs, not hide them. On the other hand this value is less than 60 seconds which is used by nsTerminator to crash a hung main process. 38611
LSObject.h Backs the WebIDL `Storage` binding; all content LocalStorage calls are handled by this class. ## Semantics under e10s / multi-process ## A snapshot mechanism used in conjuction with stable points ensures that JS run-to-completion semantics are experienced even if the same origin is concurrently accessing LocalStorage across multiple content processes. ### Snapshot Consistency ### An LSSnapshot is created locally whenever the contents of LocalStorage are about to be read or written (including length). This synchronously establishes a corresponding Snapshot in PBackground in the parent process. An effort is made to send as much data from the parent process as possible, so sites using a small/reasonable amount of LocalStorage data will have it sent to the content process for immediate access. Sites with greater LocalStorage usage may only have some of the information relayed. In that case, the parent Snapshot will ensure that it retains the exact state of the parent Datastore at the moment the Snapshot was created. 8401
LSObserver.cpp 1688
LSObserver.h Effectively just a refcounted life-cycle management wrapper around LSObserverChild which exists to receive "storage" event information from other processes. (Same-process events are handled within the process, see `LSObject::OnChange`.) ## Lifecycle ## - Created by LSObject::EnsureObserver via synchronous LSRequest idiom whenever the first window's origin adds a "storage" event. Placed in the gLSObservers LSObserverHashtable for subsequent LSObject's via LSObserver::Get lookup. - The LSObserverChild directly handles "Observe" messages, shunting them directly to Storage::NotifyChange which does all the legwork of notifying windows about "storage" events. - Destroyed when refcount goes to zero due to all owning LSObjects being destroyed or having their `LSObject::DropObserver` methods invoked due to the last "storage" event listener being removed from the owning window. 2079
LSSnapshot.cpp Coalescing manipulation queue used by `LSSnapshot`. Used by `LSSnapshot` to buffer and coalesce manipulations before they are sent to the parent process, when a Snapshot Checkpoints. (This can only be done when there are no observers for other content processes.) 24463
LSSnapshot.h The LoadState expresses what subset of information a snapshot has from the authoritative Datastore in the parent process. The initial snapshot is populated heuristically based on the size of the keys and size of the items (inclusive of the key value; item is key+value, not just value) of the entire datastore relative to the configured prefill limit (via pref "dom.storage.snapshot_prefill" exposed as gSnapshotPrefill in bytes). If there's less data than the limit, we send both keys and values and end up as AllOrderedItems. If there's enough room for all the keys but not all the values, we end up as AllOrderedKeys with as many values present as would fit. If there's not enough room for all the keys, then we end up as Partial with as many key-value pairs as will fit. The state AllUnorderedItems can only be reached by code getting items one by one. 4728
LSValue.cpp 1932
LSValue.h Represents a LocalStorage value. From content's perspective, values (if present) are always DOMStrings. This is also true from a quota-tracking perspective. However, for memory and disk efficiency it's preferable to store the value in alternate compressed or utf-8 encoding representations. The LSValue type exists to support these alternate representations, dynamically decompressing/re-encoding to utf-16 while still tracking value size on a utf-16 basis for quota purposes. 3501
LSWriteOptimizer.cpp aUpdateWithMove 3844
LSWriteOptimizer.h Base class for coalescing manipulation queue. 4696
moz.build 1798
nsILocalStorageManager.idl Methods specific to LocalStorage, see nsIDOMStorageManager for methods shared with SessionStorage. Methods may migrate there as SessionStorage is overhauled. 1286
PBackgroundLSDatabase.ipdl Initial LSSnapshot state as produced by Datastore::GetSnapshotLoadInfo. See `LSSnapshot::LoadState` for more details about the possible states and a high level overview. 6677
PBackgroundLSObserver.ipdl The observer protocol sends "storage" event notifications for changes to LocalStorage that take place in other processes as their Snapshots are Checkpointed to the canonical Datastore in the parent process. Same-process notifications are generated as mutations happen. Note that mutations are never generated for redundant mutations. Setting the key "foo" to have value "bar" when it already has value "bar" will never result in a "storage" event. 1984
PBackgroundLSRequest.ipdl Discriminated union which can contain an error code (`nsresult`) or particular request response. 3772
PBackgroundLSSharedTypes.ipdlh LocalStorage key/value pair wire representations. `value` may be void in cases where there is a value but it is not being sent for memory/bandwidth conservation purposes. (It's not possible to have a null/undefined `value` as Storage is defined explicitly as a String store.) 1572
PBackgroundLSSimpleRequest.ipdl Response to a `LSSimpleRequestPreloadedParams` request indicating whether the origin was preloaded. 1477
PBackgroundLSSnapshot.ipdl Union of LocalStorage mutation types. 4159
ReportInternalError.cpp Internal errors are chrome context only 1043
ReportInternalError.h 1193
SerializationHelpers.h 1677
SnappyUtils.cpp 1769
SnappyUtils.h 692
test 9