netwerk/base/public/nsIApplicationCacheService.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsIApplicationCacheService.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,118 @@
     1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#include "nsISupports.idl"
    1.11 +
    1.12 +interface nsIApplicationCache;
    1.13 +interface nsIFile;
    1.14 +interface nsIURI;
    1.15 +interface nsILoadContextInfo;
    1.16 +
    1.17 +/**
    1.18 + * The application cache service manages the set of application cache
    1.19 + * groups.
    1.20 + */
    1.21 +[scriptable, uuid(03b41c3d-0816-4134-8b2e-4f5afbdb1f06)]
    1.22 +interface nsIApplicationCacheService : nsISupports
    1.23 +{
    1.24 +    /**
    1.25 +     * Create group string identifying cache group according the manifest
    1.26 +     * URL and the given load context.
    1.27 +     */
    1.28 +    ACString buildGroupID(in nsIURI aManifestURL,
    1.29 +                          in nsILoadContextInfo aLoadContextInfo);
    1.30 +
    1.31 +    /**
    1.32 +     * Same as buildGroupID method, just doesn't require load context.
    1.33 +     */
    1.34 +    ACString buildGroupIDForApp(in nsIURI aManifestURL,
    1.35 +                                in unsigned long aAppID,
    1.36 +                                in boolean aInBrowser);
    1.37 +
    1.38 +    /**
    1.39 +     * Create a new, empty application cache for the given cache
    1.40 +     * group.
    1.41 +     */
    1.42 +    nsIApplicationCache createApplicationCache(in ACString group);
    1.43 +
    1.44 +    /**
    1.45 +     * Create a new, empty application cache for the given cache
    1.46 +     * group residing in a custom directory with a custom quota.
    1.47 +     *
    1.48 +     * @param group
    1.49 +     *    URL of the manifest
    1.50 +     * @param directory
    1.51 +     *    Actually a reference to a profile directory where to
    1.52 +     *    create the OfflineCache sub-dir.
    1.53 +     * @param quota
    1.54 +     *    Optional override of the default quota.
    1.55 +     */
    1.56 +    nsIApplicationCache createCustomApplicationCache(in ACString group,
    1.57 +                                                     in nsIFile profileDir,
    1.58 +                                                     in int32_t quota);
    1.59 +
    1.60 +    /**
    1.61 +     * Get an application cache object for the given client ID.
    1.62 +     */
    1.63 +    nsIApplicationCache getApplicationCache(in ACString clientID);
    1.64 +
    1.65 +    /**
    1.66 +     * Get the currently active cache object for a cache group.
    1.67 +     */
    1.68 +    nsIApplicationCache getActiveCache(in ACString group);
    1.69 +
    1.70 +    /**
    1.71 +     * Deactivate the currently-active cache object for a cache group.
    1.72 +     */
    1.73 +    void deactivateGroup(in ACString group);
    1.74 +
    1.75 +    /**
    1.76 +     * Deletes some or all of an application's cache entries.  
    1.77 +     *
    1.78 +     * @param appId
    1.79 +     *    The mozIApplication.localId of the application.
    1.80 +     * 
    1.81 +     * @param discardOnlyBrowserEntries 
    1.82 +     *    If true, only entries marked as 'inBrowserElement' are deleted 
    1.83 +     *    (this is used by browser applications to delete user browsing 
    1.84 +     *    data/history.).  If false, *all* entries for the given appId are
    1.85 +     *    deleted (this is used for application uninstallation).
    1.86 +     */
    1.87 +    void discardByAppId(in int32_t appID, in boolean discardOnlyBrowserEntries);
    1.88 +
    1.89 +    /**
    1.90 +     * Try to find the best application cache to serve a resource.
    1.91 +     */
    1.92 +    nsIApplicationCache chooseApplicationCache(in ACString key,
    1.93 +                                               [optional] in nsILoadContextInfo aLoadContextInfo);
    1.94 +
    1.95 +    /**
    1.96 +     * Flags the key as being opportunistically cached.
    1.97 +     *
    1.98 +     * This method should also propagate the entry to other
    1.99 +     * application caches with the same opportunistic namespace, but
   1.100 +     * this is not currently implemented.
   1.101 +     *
   1.102 +     * @param cache
   1.103 +     *        The cache in which the entry is cached now.
   1.104 +     * @param key
   1.105 +     *        The cache entry key.
   1.106 +     */
   1.107 +    void cacheOpportunistically(in nsIApplicationCache cache, in ACString key);
   1.108 +
   1.109 +    /**
   1.110 +     * Get the list of application cache groups.
   1.111 +     */
   1.112 +    void getGroups([optional] out unsigned long count,
   1.113 +                   [array, size_is(count), retval] out string groupIDs);
   1.114 +
   1.115 +    /**
   1.116 +     * Get the list of application cache groups in the order of
   1.117 +     * activating time.
   1.118 +     */
   1.119 +    void getGroupsTimeOrdered([optional] out unsigned long count,
   1.120 +                              [array, size_is(count), retval] out string groupIDs);
   1.121 +};

mercurial