tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

PBackgroundStorage.ipdl (2578B)


      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/. */
      6 
      7 include protocol PBackground;
      8 
      9 include "mozilla/dom/quota/SerializationHelpers.h";
     10 
     11 using mozilla::OriginAttributesPattern
     12   from "mozilla/OriginAttributes.h";
     13 
     14 namespace mozilla {
     15 namespace dom {
     16 
     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 [ManualDealloc, ChildImpl=virtual, ParentImpl=virtual]
     21 sync protocol PBackgroundStorage
     22 {
     23   manager PBackground;
     24 
     25 parent:
     26   async DeleteMe();
     27 
     28   sync Preload(nsCString originSuffix,
     29                nsCString originNoSuffix,
     30                uint32_t alreadyLoadedCount)
     31     returns (nsString[] keys, nsString[] values, nsresult rv);
     32 
     33   async AsyncPreload(nsCString originSuffix, nsCString originNoSuffix,
     34                      bool priority);
     35   async AsyncGetUsage(nsCString scope);
     36   async AsyncAddItem(nsCString originSuffix, nsCString originNoSuffix,
     37                      nsString key, nsString value);
     38   async AsyncUpdateItem(nsCString originSuffix, nsCString originNoSuffix,
     39                         nsString key, nsString value);
     40   async AsyncRemoveItem(nsCString originSuffix, nsCString originNoSuffix,
     41                         nsString key);
     42   async AsyncClear(nsCString originSuffix, nsCString originNoSuffix);
     43   async AsyncFlush();
     44 
     45   // These are privileged operations for use only by the observer API for
     46   // delayed initialization and clearing origins and will never be used from
     47   // content process children.  Ideally these would be guarded by checks or
     48   // exist on a separate, privileged interface, but PBackgroundStorage is
     49   // already insecure.
     50   async Startup();
     51   async ClearAll();
     52   async ClearMatchingOrigin(nsCString originNoSuffix);
     53   async ClearMatchingOriginAttributes(OriginAttributesPattern pattern);
     54 
     55 child:
     56   async __delete__();
     57 
     58   async Observe(nsCString topic,
     59                 nsString originAttributesPattern,
     60                 nsCString originScope);
     61   async OriginsHavingData(nsCString[] origins);
     62   async LoadItem(nsCString originSuffix, nsCString originNoSuffix, nsString key,
     63                  nsString value);
     64   async LoadDone(nsCString originSuffix, nsCString originNoSuffix, nsresult rv);
     65   async LoadUsage(nsCString scope, int64_t usage);
     66   async Error(nsresult rv);
     67 };
     68 
     69 }
     70 }