Bug 1899500 - Implement explicit resource management in Baseline compiler. r=arai
[gecko.git] / dom / localstorage / PBackgroundLSSharedTypes.ipdlh
blobd71b0e61116144b02a14141f240516434be6071a
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;
6 include ProtocolTypes;
8 include "mozilla/dom/localstorage/SerializationHelpers.h";
10 using mozilla::dom::LSValue
11   from "mozilla/dom/LSValue.h";
13 namespace mozilla {
14 namespace dom {
16 struct LSRequestCommonParams
18   PrincipalInfo principalInfo;
19   PrincipalInfo storagePrincipalInfo;
20   nsCString originKey;
23 struct LSRequestPreloadDatastoreParams
25   LSRequestCommonParams commonParams;
28 struct LSRequestPrepareDatastoreParams
30   LSRequestCommonParams commonParams;
31   nsID? clientId;
32   PrincipalInfo? clientPrincipalInfo;
35 /**
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.
41  *
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.
49  */
50 struct LSRequestPrepareObserverParams
52   PrincipalInfo principalInfo;
53   PrincipalInfo storagePrincipalInfo;
54   nsID? clientId;
55   PrincipalInfo? clientPrincipalInfo;
58 union LSRequestParams
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;
83 /**
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.)
88  */
89 struct LSItemInfo
91   nsString key;
92   LSValue value;
95 } // namespace dom
96 } // namespace mozilla