netwerk/base/nsIPackagedAppService.idl
author Atul Kumar <atkr.oss@gmail.com>
Wed, 10 Jun 2015 09:46:16 -0700
changeset 248115 fcfdee109765d38d65a680307975620173f5007c
parent 246865 b62f0a6064182751ce465db4444befb4394e10e7
child 256978 ca1510a96cc66300e01798b376da2884d1ddca6f
permissions -rw-r--r--
Bug 1136301 - Null check for mCert->slot added in destructorSafeDestroyNSSReference & MarkForPermDeletion. Formatting update in MarkForPermDeletion. r=keeler

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"

interface nsIURI;
interface nsILoadContextInfo;
interface nsICacheEntryOpenCallback;

%{C++
  #define PACKAGED_APP_TOKEN "!//"
%}

/**
 * nsIPackagedAppService
 */
[scriptable, builtinclass, uuid(77f9a34d-d082-43f1-9f83-e852d0173cd5)]
interface nsIPackagedAppService : nsISupports
{
  /**
   * @aURI is a URL to a packaged resource
   *   - format:  package_url + PACKAGED_APP_TOKEN + resource_path
   *   - example: http://test.com/path/to/package!//resource.html
   * @aCallback is an object implementing nsICacheEntryOpenCallback
   *   - this is the target of the async result of the operation
   *   - aCallback->OnCacheEntryCheck() is called to verify the entry is valid
   *   - aCallback->OnCacheEntryAvailable() is called with a pointer to the
   *     the cached entry, if one exists, or an error code otherwise
   *   - aCallback is kept alive using an nsCOMPtr until OnCacheEntryAvailable
   *     is called
   * @aInfo is an object used to determine the cache jar this resource goes in.
   *   - usually created by calling GetLoadContextInfo(requestingChannel)
   *
   * Calling this method will either download the package containing the given
   * resource URI, store it in the cache and pass the cache entry to aCallback,
   * or if that resource has already been downloaded it will be served from
   * the cache.
   */
  void requestURI(in nsIURI aURI, in nsILoadContextInfo aInfo, in nsICacheEntryOpenCallback aCallback);
};