1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 include PBackgroundSharedTypes;
8 include "mozilla/dom/localstorage/SerializationHelpers.h";
10 using mozilla::dom::LSValue
11 from "mozilla/dom/LSValue.h";
16 struct LSRequestCommonParams
18 PrincipalInfo principalInfo;
19 PrincipalInfo storagePrincipalInfo;
23 struct LSRequestPreloadDatastoreParams
25 LSRequestCommonParams commonParams;
28 struct LSRequestPrepareDatastoreParams
30 LSRequestCommonParams commonParams;
32 PrincipalInfo? clientPrincipalInfo;
36 * In order to validate the principal with the client, we need to provide an
37 * additional principalInfo for the client. The client is using the foreign
38 * principal, see StoragePrincipalHelper.h for details, which is different from
39 * the principalInfo. So, we need to pass the principalInfo from the client So
40 * that we can verify it with the given client Id.
42 * Note that the storagePrincipalInfo is used to access the right cookie jar
43 * according to the Storage Access. This is passed in order to access the
44 * correct local storage. Essentially, the storage principal and the client
45 * principal are using the PartitionKey in their OriginAttributes. But, the
46 * existence of the PartitionKey between them is depending on different
47 * conditions. Namely, the storage principal depends on the Storage Access but
48 * the client principal depends on whether it's in a third party.
50 struct LSRequestPrepareObserverParams
52 PrincipalInfo principalInfo;
53 PrincipalInfo storagePrincipalInfo;
55 PrincipalInfo? clientPrincipalInfo;
60 LSRequestPreloadDatastoreParams;
61 LSRequestPrepareDatastoreParams;
62 LSRequestPrepareObserverParams;
65 struct LSSimpleRequestPreloadedParams
67 PrincipalInfo principalInfo;
68 PrincipalInfo storagePrincipalInfo;
71 struct LSSimpleRequestGetStateParams
73 PrincipalInfo principalInfo;
74 PrincipalInfo storagePrincipalInfo;
77 union LSSimpleRequestParams
79 LSSimpleRequestPreloadedParams;
80 LSSimpleRequestGetStateParams;
84 * LocalStorage key/value pair wire representations. `value` may be void in
85 * cases where there is a value but it is not being sent for memory/bandwidth
86 * conservation purposes. (It's not possible to have a null/undefined `value`
87 * as Storage is defined explicitly as a String store.)
96 } // namespace mozilla