Bug 1572460 - Refactor `selection` out of the `InspectorFront`. r=yulia
[gecko.git] / dom / storage / PBackgroundStorage.ipdl
blob9b84f0e7956acf4ab327a2fb855e7c86869639d2
1 /* -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*- */
2 /* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this
5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 include protocol PBackground;
9 include "mozilla/dom/quota/SerializationHelpers.h";
11 using mozilla::OriginAttributesPattern
12   from "mozilla/OriginAttributes.h";
14 namespace mozilla {
15 namespace dom {
17 /* This protocol bridges async access to the database thread running on the
18  * parent process and caches running on the child process.
19  */
20 sync protocol PBackgroundStorage
22   manager PBackground;
24 parent:
25   async DeleteMe();
27   sync Preload(nsCString originSuffix,
28                nsCString originNoSuffix,
29                uint32_t alreadyLoadedCount)
30     returns (nsString[] keys, nsString[] values, nsresult rv);
32   async AsyncPreload(nsCString originSuffix, nsCString originNoSuffix,
33                      bool priority);
34   async AsyncGetUsage(nsCString scope);
35   async AsyncAddItem(nsCString originSuffix, nsCString originNoSuffix,
36                      nsString key, nsString value);
37   async AsyncUpdateItem(nsCString originSuffix, nsCString originNoSuffix,
38                         nsString key, nsString value);
39   async AsyncRemoveItem(nsCString originSuffix, nsCString originNoSuffix,
40                         nsString key);
41   async AsyncClear(nsCString originSuffix, nsCString originNoSuffix);
42   async AsyncFlush();
44   // These are privileged operations for use only by the observer API for
45   // delayed initialization and clearing origins and will never be used from
46   // content process children.  Ideally these would be guarded by checks or
47   // exist on a separate, privileged interface, but PBackgroundStorage is
48   // already insecure.
49   async Startup();
50   async ClearAll();
51   async ClearMatchingOrigin(nsCString originNoSuffix);
52   async ClearMatchingOriginAttributes(OriginAttributesPattern pattern);
54 child:
55   async __delete__();
57   async Observe(nsCString topic,
58                 nsString originAttributesPattern,
59                 nsCString originScope);
60   async OriginsHavingData(nsCString[] origins);
61   async LoadItem(nsCString originSuffix, nsCString originNoSuffix, nsString key,
62                  nsString value);
63   async LoadDone(nsCString originSuffix, nsCString originNoSuffix, nsresult rv);
64   async LoadUsage(nsCString scope, int64_t usage);
65   async Error(nsresult rv);