Skip to main content

browser_protocol/storage/
mod.rs

1use serde::{Serialize, Deserialize};
2use serde_json::Value as JsonValue;
3
4
5pub type SerializedStorageKey = String;
6
7/// Enum of possible storage types.
8
9#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
10pub enum StorageType {
11    #[default]
12    Cookies,
13    FileSystems,
14    Indexeddb,
15    LocalStorage,
16    ShaderCache,
17    Websql,
18    ServiceWorkers,
19    CacheStorage,
20    InterestGroups,
21    SharedStorage,
22    StorageBuckets,
23    All,
24    Other,
25}
26
27/// Usage for a storage type.
28
29#[derive(Debug, Clone, Serialize, Deserialize, Default)]
30#[serde(rename_all = "camelCase")]
31pub struct UsageForType {
32    /// Name of storage type.
33
34    pub storageType: StorageType,
35    /// Storage usage (bytes).
36
37    pub usage: f64,
38}
39
40/// Pair of issuer origin and number of available (signed, but not used) Trust
41/// Tokens from that issuer.
42
43#[derive(Debug, Clone, Serialize, Deserialize, Default)]
44#[serde(rename_all = "camelCase")]
45pub struct TrustTokens {
46
47    pub issuerOrigin: String,
48
49    pub count: f64,
50}
51
52/// Protected audience interest group auction identifier.
53
54pub type InterestGroupAuctionId = String;
55
56/// Enum of interest group access types.
57
58#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
59pub enum InterestGroupAccessType {
60    #[default]
61    Join,
62    Leave,
63    Update,
64    Loaded,
65    Bid,
66    Win,
67    AdditionalBid,
68    AdditionalBidWin,
69    TopLevelBid,
70    TopLevelAdditionalBid,
71    Clear,
72}
73
74/// Enum of auction events.
75
76#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
77pub enum InterestGroupAuctionEventType {
78    #[default]
79    Started,
80    ConfigResolved,
81}
82
83/// Enum of network fetches auctions can do.
84
85#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
86pub enum InterestGroupAuctionFetchType {
87    #[default]
88    BidderJs,
89    BidderWasm,
90    SellerJs,
91    BidderTrustedSignals,
92    SellerTrustedSignals,
93}
94
95/// Enum of shared storage access scopes.
96
97#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
98pub enum SharedStorageAccessScope {
99    #[default]
100    Window,
101    SharedStorageWorklet,
102    ProtectedAudienceWorklet,
103    Header,
104}
105
106/// Enum of shared storage access methods.
107
108#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
109pub enum SharedStorageAccessMethod {
110    #[default]
111    AddModule,
112    CreateWorklet,
113    SelectURL,
114    Run,
115    BatchUpdate,
116    Set,
117    Append,
118    Delete,
119    Clear,
120    Get,
121    Keys,
122    Values,
123    Entries,
124    Length,
125    RemainingBudget,
126}
127
128/// Struct for a single key-value pair in an origin's shared storage.
129
130#[derive(Debug, Clone, Serialize, Deserialize, Default)]
131#[serde(rename_all = "camelCase")]
132pub struct SharedStorageEntry {
133
134    pub key: String,
135
136    pub value: String,
137}
138
139/// Details for an origin's shared storage.
140
141#[derive(Debug, Clone, Serialize, Deserialize, Default)]
142#[serde(rename_all = "camelCase")]
143pub struct SharedStorageMetadata {
144    /// Time when the origin's shared storage was last created.
145
146    pub creationTime: crate::network::TimeSinceEpoch,
147    /// Number of key-value pairs stored in origin's shared storage.
148
149    pub length: u64,
150    /// Current amount of bits of entropy remaining in the navigation budget.
151
152    pub remainingBudget: f64,
153    /// Total number of bytes stored as key-value pairs in origin's shared
154    /// storage.
155
156    pub bytesUsed: i64,
157}
158
159/// Represents a dictionary object passed in as privateAggregationConfig to
160/// run or selectURL.
161
162#[derive(Debug, Clone, Serialize, Deserialize, Default)]
163#[serde(rename_all = "camelCase")]
164pub struct SharedStoragePrivateAggregationConfig {
165    /// The chosen aggregation service deployment.
166
167    #[serde(skip_serializing_if = "Option::is_none")]
168    pub aggregationCoordinatorOrigin: Option<String>,
169    /// The context ID provided.
170
171    #[serde(skip_serializing_if = "Option::is_none")]
172    pub contextId: Option<String>,
173    /// Configures the maximum size allowed for filtering IDs.
174
175    pub filteringIdMaxBytes: u64,
176    /// The limit on the number of contributions in the final report.
177
178    #[serde(skip_serializing_if = "Option::is_none")]
179    pub maxContributions: Option<i64>,
180}
181
182/// Pair of reporting metadata details for a candidate URL for 'selectURL()'.
183
184#[derive(Debug, Clone, Serialize, Deserialize, Default)]
185#[serde(rename_all = "camelCase")]
186pub struct SharedStorageReportingMetadata {
187
188    pub eventType: String,
189
190    pub reportingUrl: String,
191}
192
193/// Bundles a candidate URL with its reporting metadata.
194
195#[derive(Debug, Clone, Serialize, Deserialize, Default)]
196#[serde(rename_all = "camelCase")]
197pub struct SharedStorageUrlWithMetadata {
198    /// Spec of candidate URL.
199
200    pub url: String,
201    /// Any associated reporting metadata.
202
203    pub reportingMetadata: Vec<SharedStorageReportingMetadata>,
204}
205
206/// Bundles the parameters for shared storage access events whose
207/// presence/absence can vary according to SharedStorageAccessType.
208
209#[derive(Debug, Clone, Serialize, Deserialize, Default)]
210#[serde(rename_all = "camelCase")]
211pub struct SharedStorageAccessParams {
212    /// Spec of the module script URL.
213    /// Present only for SharedStorageAccessMethods: addModule and
214    /// createWorklet.
215
216    #[serde(skip_serializing_if = "Option::is_none")]
217    pub scriptSourceUrl: Option<String>,
218    /// String denoting "context-origin", "script-origin", or a custom
219    /// origin to be used as the worklet's data origin.
220    /// Present only for SharedStorageAccessMethod: createWorklet.
221
222    #[serde(skip_serializing_if = "Option::is_none")]
223    pub dataOrigin: Option<String>,
224    /// Name of the registered operation to be run.
225    /// Present only for SharedStorageAccessMethods: run and selectURL.
226
227    #[serde(skip_serializing_if = "Option::is_none")]
228    pub operationName: Option<String>,
229    /// ID of the operation call.
230    /// Present only for SharedStorageAccessMethods: run and selectURL.
231
232    #[serde(skip_serializing_if = "Option::is_none")]
233    pub operationId: Option<String>,
234    /// Whether or not to keep the worket alive for future run or selectURL
235    /// calls.
236    /// Present only for SharedStorageAccessMethods: run and selectURL.
237
238    #[serde(skip_serializing_if = "Option::is_none")]
239    pub keepAlive: Option<bool>,
240    /// Configures the private aggregation options.
241    /// Present only for SharedStorageAccessMethods: run and selectURL.
242
243    #[serde(skip_serializing_if = "Option::is_none")]
244    pub privateAggregationConfig: Option<SharedStoragePrivateAggregationConfig>,
245    /// The operation's serialized data in bytes (converted to a string).
246    /// Present only for SharedStorageAccessMethods: run and selectURL.
247    /// TODO(crbug.com/401011862): Consider updating this parameter to binary.
248
249    #[serde(skip_serializing_if = "Option::is_none")]
250    pub serializedData: Option<String>,
251    /// Array of candidate URLs' specs, along with any associated metadata.
252    /// Present only for SharedStorageAccessMethod: selectURL.
253
254    #[serde(skip_serializing_if = "Option::is_none")]
255    pub urlsWithMetadata: Option<Vec<SharedStorageUrlWithMetadata>>,
256    /// Spec of the URN:UUID generated for a selectURL call.
257    /// Present only for SharedStorageAccessMethod: selectURL.
258
259    #[serde(skip_serializing_if = "Option::is_none")]
260    pub urnUuid: Option<String>,
261    /// Key for a specific entry in an origin's shared storage.
262    /// Present only for SharedStorageAccessMethods: set, append, delete, and
263    /// get.
264
265    #[serde(skip_serializing_if = "Option::is_none")]
266    pub key: Option<String>,
267    /// Value for a specific entry in an origin's shared storage.
268    /// Present only for SharedStorageAccessMethods: set and append.
269
270    #[serde(skip_serializing_if = "Option::is_none")]
271    pub value: Option<String>,
272    /// Whether or not to set an entry for a key if that key is already present.
273    /// Present only for SharedStorageAccessMethod: set.
274
275    #[serde(skip_serializing_if = "Option::is_none")]
276    pub ignoreIfPresent: Option<bool>,
277    /// A number denoting the (0-based) order of the worklet's
278    /// creation relative to all other shared storage worklets created by
279    /// documents using the current storage partition.
280    /// Present only for SharedStorageAccessMethods: addModule, createWorklet.
281
282    #[serde(skip_serializing_if = "Option::is_none")]
283    pub workletOrdinal: Option<i64>,
284    /// Hex representation of the DevTools token used as the TargetID for the
285    /// associated shared storage worklet.
286    /// Present only for SharedStorageAccessMethods: addModule, createWorklet,
287    /// run, selectURL, and any other SharedStorageAccessMethod when the
288    /// SharedStorageAccessScope is sharedStorageWorklet.
289
290    #[serde(skip_serializing_if = "Option::is_none")]
291    pub workletTargetId: Option<crate::target::TargetID>,
292    /// Name of the lock to be acquired, if present.
293    /// Optionally present only for SharedStorageAccessMethods: batchUpdate,
294    /// set, append, delete, and clear.
295
296    #[serde(skip_serializing_if = "Option::is_none")]
297    pub withLock: Option<String>,
298    /// If the method has been called as part of a batchUpdate, then this
299    /// number identifies the batch to which it belongs.
300    /// Optionally present only for SharedStorageAccessMethods:
301    /// batchUpdate (required), set, append, delete, and clear.
302
303    #[serde(skip_serializing_if = "Option::is_none")]
304    pub batchUpdateId: Option<String>,
305    /// Number of modifier methods sent in batch.
306    /// Present only for SharedStorageAccessMethod: batchUpdate.
307
308    #[serde(skip_serializing_if = "Option::is_none")]
309    pub batchSize: Option<u64>,
310}
311
312
313#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Default)]
314pub enum StorageBucketsDurability {
315    #[default]
316    Relaxed,
317    Strict,
318}
319
320
321#[derive(Debug, Clone, Serialize, Deserialize, Default)]
322#[serde(rename_all = "camelCase")]
323pub struct StorageBucket {
324
325    pub storageKey: SerializedStorageKey,
326    /// If not specified, it is the default bucket of the storageKey.
327
328    #[serde(skip_serializing_if = "Option::is_none")]
329    pub name: Option<String>,
330}
331
332
333#[derive(Debug, Clone, Serialize, Deserialize, Default)]
334#[serde(rename_all = "camelCase")]
335pub struct StorageBucketInfo {
336
337    pub bucket: StorageBucket,
338
339    pub id: String,
340
341    pub expiration: crate::network::TimeSinceEpoch,
342    /// Storage quota (bytes).
343
344    pub quota: f64,
345
346    pub persistent: bool,
347
348    pub durability: StorageBucketsDurability,
349}
350
351/// A single Related Website Set object.
352
353#[derive(Debug, Clone, Serialize, Deserialize, Default)]
354#[serde(rename_all = "camelCase")]
355pub struct RelatedWebsiteSet {
356    /// The primary site of this set, along with the ccTLDs if there is any.
357
358    pub primarySites: Vec<String>,
359    /// The associated sites of this set, along with the ccTLDs if there is any.
360
361    pub associatedSites: Vec<String>,
362    /// The service sites of this set, along with the ccTLDs if there is any.
363
364    pub serviceSites: Vec<String>,
365}
366
367/// Returns a storage key given a frame id.
368/// Deprecated. Please use Storage.getStorageKey instead.
369
370#[derive(Debug, Clone, Serialize, Deserialize, Default)]
371#[serde(rename_all = "camelCase")]
372pub struct GetStorageKeyForFrameParams {
373
374    pub frameId: crate::page::FrameId,
375}
376
377/// Returns a storage key given a frame id.
378/// Deprecated. Please use Storage.getStorageKey instead.
379
380#[derive(Debug, Clone, Serialize, Deserialize, Default)]
381#[serde(rename_all = "camelCase")]
382pub struct GetStorageKeyForFrameReturns {
383
384    pub storageKey: SerializedStorageKey,
385}
386
387/// Returns storage key for the given frame. If no frame ID is provided,
388/// the storage key of the target executing this command is returned.
389
390#[derive(Debug, Clone, Serialize, Deserialize, Default)]
391#[serde(rename_all = "camelCase")]
392pub struct GetStorageKeyParams {
393
394    #[serde(skip_serializing_if = "Option::is_none")]
395    pub frameId: Option<crate::page::FrameId>,
396}
397
398/// Returns storage key for the given frame. If no frame ID is provided,
399/// the storage key of the target executing this command is returned.
400
401#[derive(Debug, Clone, Serialize, Deserialize, Default)]
402#[serde(rename_all = "camelCase")]
403pub struct GetStorageKeyReturns {
404
405    pub storageKey: SerializedStorageKey,
406}
407
408/// Clears storage for origin.
409
410#[derive(Debug, Clone, Serialize, Deserialize, Default)]
411#[serde(rename_all = "camelCase")]
412pub struct ClearDataForOriginParams {
413    /// Security origin.
414
415    pub origin: String,
416    /// Comma separated list of StorageType to clear.
417
418    pub storageTypes: String,
419}
420
421/// Clears storage for storage key.
422
423#[derive(Debug, Clone, Serialize, Deserialize, Default)]
424#[serde(rename_all = "camelCase")]
425pub struct ClearDataForStorageKeyParams {
426    /// Storage key.
427
428    pub storageKey: String,
429    /// Comma separated list of StorageType to clear.
430
431    pub storageTypes: String,
432}
433
434/// Returns all browser cookies.
435
436#[derive(Debug, Clone, Serialize, Deserialize, Default)]
437#[serde(rename_all = "camelCase")]
438pub struct GetCookiesParams {
439    /// Browser context to use when called on the browser endpoint.
440
441    #[serde(skip_serializing_if = "Option::is_none")]
442    pub browserContextId: Option<crate::browser::BrowserContextID>,
443}
444
445/// Returns all browser cookies.
446
447#[derive(Debug, Clone, Serialize, Deserialize, Default)]
448#[serde(rename_all = "camelCase")]
449pub struct GetCookiesReturns {
450    /// Array of cookie objects.
451
452    pub cookies: Vec<crate::network::Cookie>,
453}
454
455/// Sets given cookies.
456
457#[derive(Debug, Clone, Serialize, Deserialize, Default)]
458#[serde(rename_all = "camelCase")]
459pub struct SetCookiesParams {
460    /// Cookies to be set.
461
462    pub cookies: Vec<crate::network::CookieParam>,
463    /// Browser context to use when called on the browser endpoint.
464
465    #[serde(skip_serializing_if = "Option::is_none")]
466    pub browserContextId: Option<crate::browser::BrowserContextID>,
467}
468
469/// Clears cookies.
470
471#[derive(Debug, Clone, Serialize, Deserialize, Default)]
472#[serde(rename_all = "camelCase")]
473pub struct ClearCookiesParams {
474    /// Browser context to use when called on the browser endpoint.
475
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub browserContextId: Option<crate::browser::BrowserContextID>,
478}
479
480/// Returns usage and quota in bytes.
481
482#[derive(Debug, Clone, Serialize, Deserialize, Default)]
483#[serde(rename_all = "camelCase")]
484pub struct GetUsageAndQuotaParams {
485    /// Security origin.
486
487    pub origin: String,
488}
489
490/// Returns usage and quota in bytes.
491
492#[derive(Debug, Clone, Serialize, Deserialize, Default)]
493#[serde(rename_all = "camelCase")]
494pub struct GetUsageAndQuotaReturns {
495    /// Storage usage (bytes).
496
497    pub usage: f64,
498    /// Storage quota (bytes).
499
500    pub quota: f64,
501    /// Whether or not the origin has an active storage quota override
502
503    pub overrideActive: bool,
504    /// Storage usage per type (bytes).
505
506    pub usageBreakdown: Vec<UsageForType>,
507}
508
509/// Override quota for the specified origin
510
511#[derive(Debug, Clone, Serialize, Deserialize, Default)]
512#[serde(rename_all = "camelCase")]
513pub struct OverrideQuotaForOriginParams {
514    /// Security origin.
515
516    pub origin: String,
517    /// The quota size (in bytes) to override the original quota with.
518    /// If this is called multiple times, the overridden quota will be equal to
519    /// the quotaSize provided in the final call. If this is called without
520    /// specifying a quotaSize, the quota will be reset to the default value for
521    /// the specified origin. If this is called multiple times with different
522    /// origins, the override will be maintained for each origin until it is
523    /// disabled (called without a quotaSize).
524
525    #[serde(skip_serializing_if = "Option::is_none")]
526    pub quotaSize: Option<f64>,
527}
528
529/// Registers origin to be notified when an update occurs to its cache storage list.
530
531#[derive(Debug, Clone, Serialize, Deserialize, Default)]
532#[serde(rename_all = "camelCase")]
533pub struct TrackCacheStorageForOriginParams {
534    /// Security origin.
535
536    pub origin: String,
537}
538
539/// Registers storage key to be notified when an update occurs to its cache storage list.
540
541#[derive(Debug, Clone, Serialize, Deserialize, Default)]
542#[serde(rename_all = "camelCase")]
543pub struct TrackCacheStorageForStorageKeyParams {
544    /// Storage key.
545
546    pub storageKey: String,
547}
548
549/// Registers origin to be notified when an update occurs to its IndexedDB.
550
551#[derive(Debug, Clone, Serialize, Deserialize, Default)]
552#[serde(rename_all = "camelCase")]
553pub struct TrackIndexedDBForOriginParams {
554    /// Security origin.
555
556    pub origin: String,
557}
558
559/// Registers storage key to be notified when an update occurs to its IndexedDB.
560
561#[derive(Debug, Clone, Serialize, Deserialize, Default)]
562#[serde(rename_all = "camelCase")]
563pub struct TrackIndexedDBForStorageKeyParams {
564    /// Storage key.
565
566    pub storageKey: String,
567}
568
569/// Unregisters origin from receiving notifications for cache storage.
570
571#[derive(Debug, Clone, Serialize, Deserialize, Default)]
572#[serde(rename_all = "camelCase")]
573pub struct UntrackCacheStorageForOriginParams {
574    /// Security origin.
575
576    pub origin: String,
577}
578
579/// Unregisters storage key from receiving notifications for cache storage.
580
581#[derive(Debug, Clone, Serialize, Deserialize, Default)]
582#[serde(rename_all = "camelCase")]
583pub struct UntrackCacheStorageForStorageKeyParams {
584    /// Storage key.
585
586    pub storageKey: String,
587}
588
589/// Unregisters origin from receiving notifications for IndexedDB.
590
591#[derive(Debug, Clone, Serialize, Deserialize, Default)]
592#[serde(rename_all = "camelCase")]
593pub struct UntrackIndexedDBForOriginParams {
594    /// Security origin.
595
596    pub origin: String,
597}
598
599/// Unregisters storage key from receiving notifications for IndexedDB.
600
601#[derive(Debug, Clone, Serialize, Deserialize, Default)]
602#[serde(rename_all = "camelCase")]
603pub struct UntrackIndexedDBForStorageKeyParams {
604    /// Storage key.
605
606    pub storageKey: String,
607}
608
609/// Returns the number of stored Trust Tokens per issuer for the
610/// current browsing context.
611
612#[derive(Debug, Clone, Serialize, Deserialize, Default)]
613#[serde(rename_all = "camelCase")]
614pub struct GetTrustTokensReturns {
615
616    pub tokens: Vec<TrustTokens>,
617}
618
619/// Removes all Trust Tokens issued by the provided issuerOrigin.
620/// Leaves other stored data, including the issuer's Redemption Records, intact.
621
622#[derive(Debug, Clone, Serialize, Deserialize, Default)]
623#[serde(rename_all = "camelCase")]
624pub struct ClearTrustTokensParams {
625
626    pub issuerOrigin: String,
627}
628
629/// Removes all Trust Tokens issued by the provided issuerOrigin.
630/// Leaves other stored data, including the issuer's Redemption Records, intact.
631
632#[derive(Debug, Clone, Serialize, Deserialize, Default)]
633#[serde(rename_all = "camelCase")]
634pub struct ClearTrustTokensReturns {
635    /// True if any tokens were deleted, false otherwise.
636
637    pub didDeleteTokens: bool,
638}
639
640/// Gets details for a named interest group.
641
642#[derive(Debug, Clone, Serialize, Deserialize, Default)]
643#[serde(rename_all = "camelCase")]
644pub struct GetInterestGroupDetailsParams {
645
646    pub ownerOrigin: String,
647
648    pub name: String,
649}
650
651/// Gets details for a named interest group.
652
653#[derive(Debug, Clone, Serialize, Deserialize, Default)]
654#[serde(rename_all = "camelCase")]
655pub struct GetInterestGroupDetailsReturns {
656    /// This largely corresponds to:
657    /// <https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup>
658    /// but has absolute expirationTime instead of relative lifetimeMs and
659    /// also adds joiningOrigin.
660
661    pub details: serde_json::Map<String, JsonValue>,
662}
663
664/// Enables/Disables issuing of interestGroupAccessed events.
665
666#[derive(Debug, Clone, Serialize, Deserialize, Default)]
667#[serde(rename_all = "camelCase")]
668pub struct SetInterestGroupTrackingParams {
669
670    pub enable: bool,
671}
672
673/// Enables/Disables issuing of interestGroupAuctionEventOccurred and
674/// interestGroupAuctionNetworkRequestCreated.
675
676#[derive(Debug, Clone, Serialize, Deserialize, Default)]
677#[serde(rename_all = "camelCase")]
678pub struct SetInterestGroupAuctionTrackingParams {
679
680    pub enable: bool,
681}
682
683/// Gets metadata for an origin's shared storage.
684
685#[derive(Debug, Clone, Serialize, Deserialize, Default)]
686#[serde(rename_all = "camelCase")]
687pub struct GetSharedStorageMetadataParams {
688
689    pub ownerOrigin: String,
690}
691
692/// Gets metadata for an origin's shared storage.
693
694#[derive(Debug, Clone, Serialize, Deserialize, Default)]
695#[serde(rename_all = "camelCase")]
696pub struct GetSharedStorageMetadataReturns {
697
698    pub metadata: SharedStorageMetadata,
699}
700
701/// Gets the entries in an given origin's shared storage.
702
703#[derive(Debug, Clone, Serialize, Deserialize, Default)]
704#[serde(rename_all = "camelCase")]
705pub struct GetSharedStorageEntriesParams {
706
707    pub ownerOrigin: String,
708}
709
710/// Gets the entries in an given origin's shared storage.
711
712#[derive(Debug, Clone, Serialize, Deserialize, Default)]
713#[serde(rename_all = "camelCase")]
714pub struct GetSharedStorageEntriesReturns {
715
716    pub entries: Vec<SharedStorageEntry>,
717}
718
719/// Sets entry with 'key' and 'value' for a given origin's shared storage.
720
721#[derive(Debug, Clone, Serialize, Deserialize, Default)]
722#[serde(rename_all = "camelCase")]
723pub struct SetSharedStorageEntryParams {
724
725    pub ownerOrigin: String,
726
727    pub key: String,
728
729    pub value: String,
730    /// If 'ignoreIfPresent' is included and true, then only sets the entry if
731    /// 'key' doesn't already exist.
732
733    #[serde(skip_serializing_if = "Option::is_none")]
734    pub ignoreIfPresent: Option<bool>,
735}
736
737/// Deletes entry for 'key' (if it exists) for a given origin's shared storage.
738
739#[derive(Debug, Clone, Serialize, Deserialize, Default)]
740#[serde(rename_all = "camelCase")]
741pub struct DeleteSharedStorageEntryParams {
742
743    pub ownerOrigin: String,
744
745    pub key: String,
746}
747
748/// Clears all entries for a given origin's shared storage.
749
750#[derive(Debug, Clone, Serialize, Deserialize, Default)]
751#[serde(rename_all = "camelCase")]
752pub struct ClearSharedStorageEntriesParams {
753
754    pub ownerOrigin: String,
755}
756
757/// Resets the budget for 'ownerOrigin' by clearing all budget withdrawals.
758
759#[derive(Debug, Clone, Serialize, Deserialize, Default)]
760#[serde(rename_all = "camelCase")]
761pub struct ResetSharedStorageBudgetParams {
762
763    pub ownerOrigin: String,
764}
765
766/// Enables/disables issuing of sharedStorageAccessed events.
767
768#[derive(Debug, Clone, Serialize, Deserialize, Default)]
769#[serde(rename_all = "camelCase")]
770pub struct SetSharedStorageTrackingParams {
771
772    pub enable: bool,
773}
774
775/// Set tracking for a storage key's buckets.
776
777#[derive(Debug, Clone, Serialize, Deserialize, Default)]
778#[serde(rename_all = "camelCase")]
779pub struct SetStorageBucketTrackingParams {
780
781    pub storageKey: String,
782
783    pub enable: bool,
784}
785
786/// Deletes the Storage Bucket with the given storage key and bucket name.
787
788#[derive(Debug, Clone, Serialize, Deserialize, Default)]
789#[serde(rename_all = "camelCase")]
790pub struct DeleteStorageBucketParams {
791
792    pub bucket: StorageBucket,
793}
794
795/// Deletes state for sites identified as potential bounce trackers, immediately.
796
797#[derive(Debug, Clone, Serialize, Deserialize, Default)]
798#[serde(rename_all = "camelCase")]
799pub struct RunBounceTrackingMitigationsReturns {
800
801    pub deletedSites: Vec<String>,
802}
803
804/// Returns the effective Related Website Sets in use by this profile for the browser
805/// session. The effective Related Website Sets will not change during a browser session.
806
807#[derive(Debug, Clone, Serialize, Deserialize, Default)]
808#[serde(rename_all = "camelCase")]
809pub struct GetRelatedWebsiteSetsReturns {
810
811    pub sets: Vec<RelatedWebsiteSet>,
812}
813
814
815#[derive(Debug, Clone, Serialize, Deserialize, Default)]
816#[serde(rename_all = "camelCase")]
817pub struct SetProtectedAudienceKAnonymityParams {
818
819    pub owner: String,
820
821    pub name: String,
822
823    pub hashes: Vec<String>,
824}