CacheTypes.ipdlh (4576B)
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 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 include protocol PCache; 6 include protocol PCacheStreamControl; 7 include IPCStream; 8 include PBackgroundSharedTypes; 9 10 include "mozilla/dom/cache/IPCUtils.h"; 11 include "mozilla/dom/FetchIPCTypes.h"; 12 include "mozilla/ipc/TransportSecurityInfoUtils.h"; 13 14 using mozilla::dom::HeadersGuardEnum from "mozilla/dom/HeadersBinding.h"; 15 using mozilla::dom::cache::Namespace from "mozilla/dom/cache/Types.h"; 16 using mozilla::dom::cache::OpenMode from "mozilla/dom/cache/Types.h"; 17 using mozilla::dom::ReferrerPolicy from "mozilla/dom/ReferrerPolicyBinding.h"; 18 using mozilla::dom::RequestCredentials from "mozilla/dom/RequestBinding.h"; 19 using mozilla::dom::RequestMode from "mozilla/dom/RequestBinding.h"; 20 using mozilla::dom::RequestCache from "mozilla/dom/RequestBinding.h"; 21 using mozilla::dom::RequestRedirect from "mozilla/dom/RequestBinding.h"; 22 using mozilla::dom::ResponseType from "mozilla/dom/ResponseBinding.h"; 23 using mozilla::void_t from "mozilla/ipc/IPCCore.h"; 24 using nsContentPolicyType from "nsIContentPolicy.h"; 25 using struct nsID from "nsID.h"; 26 using nsILoadInfo::CrossOriginEmbedderPolicy from "nsILoadInfo.h"; 27 [RefCounted] using class nsITransportSecurityInfo from "nsITransportSecurityInfo.h"; 28 29 namespace mozilla { 30 namespace dom { 31 namespace cache { 32 33 struct CacheQueryParams 34 { 35 bool ignoreSearch; 36 bool ignoreMethod; 37 bool ignoreVary; 38 bool cacheNameSet; 39 nsString cacheName; 40 }; 41 42 struct CacheReadStream 43 { 44 nsID id; 45 nullable PCacheStreamControl control; 46 IPCStream? stream; 47 }; 48 49 struct HeadersEntry 50 { 51 nsCString name; 52 nsCString value; 53 }; 54 struct CacheRequest 55 { 56 nsCString method; 57 nsCString urlWithoutQuery; 58 nsCString urlQuery; 59 nsCString urlFragment; 60 HeadersEntry[] headers; 61 HeadersGuardEnum headersGuard; 62 nsCString referrer; 63 ReferrerPolicy referrerPolicy; 64 RequestMode mode; 65 RequestCredentials credentials; 66 CacheReadStream? body; 67 int64_t bodyDiskSize; 68 nsContentPolicyType contentPolicyType; 69 RequestCache requestCache; 70 RequestRedirect requestRedirect; 71 nsString integrity; 72 CrossOriginEmbedderPolicy loadingEmbedderPolicy; 73 PrincipalInfo? principalInfo; 74 }; 75 76 struct CacheResponse 77 { 78 ResponseType type; 79 nsCString[] urlList; 80 uint32_t status; 81 nsCString statusText; 82 HeadersEntry[] headers; 83 HeadersGuardEnum headersGuard; 84 CacheReadStream? body; 85 int64_t bodyDiskSize; 86 nullable nsITransportSecurityInfo securityInfo; 87 PrincipalInfo? principalInfo; 88 uint32_t paddingInfo; 89 int64_t paddingSize; 90 RequestCredentials credentials; 91 }; 92 93 struct CacheRequestResponse 94 { 95 CacheRequest request; 96 CacheResponse response; 97 }; 98 99 struct CacheMatchArgs 100 { 101 CacheRequest request; 102 CacheQueryParams params; 103 OpenMode openMode; 104 }; 105 106 struct CacheMatchAllArgs 107 { 108 CacheRequest? maybeRequest; 109 CacheQueryParams params; 110 OpenMode openMode; 111 }; 112 113 struct CachePutAllArgs 114 { 115 CacheRequestResponse[] requestResponseList; 116 }; 117 118 struct CacheDeleteArgs 119 { 120 CacheRequest request; 121 CacheQueryParams params; 122 }; 123 124 struct CacheKeysArgs 125 { 126 CacheRequest? maybeRequest; 127 CacheQueryParams params; 128 OpenMode openMode; 129 }; 130 131 struct StorageMatchArgs 132 { 133 CacheRequest request; 134 CacheQueryParams params; 135 OpenMode openMode; 136 }; 137 138 struct StorageHasArgs 139 { 140 nsString key; 141 }; 142 143 struct StorageOpenArgs 144 { 145 nsString key; 146 }; 147 148 struct StorageDeleteArgs 149 { 150 nsString key; 151 }; 152 153 struct StorageKeysArgs 154 { 155 }; 156 157 union CacheOpArgs 158 { 159 CacheMatchArgs; 160 CacheMatchAllArgs; 161 CachePutAllArgs; 162 CacheDeleteArgs; 163 CacheKeysArgs; 164 StorageMatchArgs; 165 StorageHasArgs; 166 StorageOpenArgs; 167 StorageDeleteArgs; 168 StorageKeysArgs; 169 }; 170 171 struct CacheMatchResult 172 { 173 CacheResponse? maybeResponse; 174 }; 175 176 struct CacheMatchAllResult 177 { 178 CacheResponse[] responseList; 179 }; 180 181 struct CachePutAllResult 182 { 183 }; 184 185 struct CacheDeleteResult 186 { 187 bool success; 188 }; 189 190 struct CacheKeysResult 191 { 192 CacheRequest[] requestList; 193 }; 194 195 struct StorageMatchResult 196 { 197 CacheResponse? maybeResponse; 198 }; 199 200 struct StorageHasResult 201 { 202 bool success; 203 }; 204 205 struct StorageOpenResult 206 { 207 nullable PCache actor; 208 Namespace ns; 209 }; 210 211 struct StorageDeleteResult 212 { 213 bool success; 214 }; 215 216 struct StorageKeysResult 217 { 218 nsString[] keyList; 219 }; 220 221 union CacheOpResult 222 { 223 void_t; 224 CacheMatchResult; 225 CacheMatchAllResult; 226 CachePutAllResult; 227 CacheDeleteResult; 228 CacheKeysResult; 229 StorageMatchResult; 230 StorageHasResult; 231 StorageOpenResult; 232 StorageDeleteResult; 233 StorageKeysResult; 234 }; 235 236 } // namespace cache 237 } // namespace dom 238 } // namespace mozilla