content/base/public/nsIDOMFile.idl

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.

     1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #include "nsISupports.idl"
     8 %{C++
     9 namespace mozilla {
    10 namespace dom {
    11 namespace indexedDB {
    12 class FileInfo;
    13 class FileManager;
    14 }
    15 }
    16 }
    18 %}
    20 [ptr] native FileInfo(mozilla::dom::indexedDB::FileInfo);
    21 [ptr] native FileManager(mozilla::dom::indexedDB::FileManager);
    23 interface nsIDOMFileError;
    24 interface nsIInputStream;
    25 interface nsIURI;
    26 interface nsIPrincipal;
    27 interface nsIDOMBlob;
    29 [scriptable, builtinclass, uuid(b1723fac-4814-4429-82cb-dc54ba0d46d6)]
    30 interface nsIDOMBlob : nsISupports
    31 {
    32   readonly attribute unsigned long long size;
    33   readonly attribute DOMString type;
    35   [noscript] readonly attribute nsIInputStream internalStream;
    36   // The caller is responsible for releasing the internalUrl from the
    37   // blob: protocol handler
    38   [noscript] DOMString getInternalUrl(in nsIPrincipal principal);
    40   [optional_argc] nsIDOMBlob slice([optional] in long long start,
    41                                    [optional] in long long end,
    42                                    [optional] in DOMString contentType);
    44   // Get internal id of stored file. Returns -1 if it is not a stored file.
    45   // Intended only for testing. It can be called on any thread.
    46   [notxpcom] long long getFileId();
    48   // Called when the blob was successfully stored in a database or when
    49   // the blob is initialized from a database. It can be called on any thread.
    50   [notxpcom] void addFileInfo(in FileInfo aFileInfo);
    52   // Called before the blob is stored in a database to decide if it can be
    53   // shared or needs to be copied. It can be called on any thread.
    54   [notxpcom] FileInfo getFileInfo(in FileManager aFileManager);
    56   // Return true if this blob is a memory file.
    57   [notxpcom] bool isMemoryFile();
    58 };
    60 [scriptable, builtinclass, uuid(4e7d1a8b-e2d5-4304-a753-4affb731660c)]
    61 interface nsIDOMFile : nsIDOMBlob
    62 {
    63   readonly attribute DOMString name;
    65   readonly attribute DOMString path;
    67   [implicit_jscontext]
    68   readonly attribute jsval lastModifiedDate;
    70   readonly attribute DOMString mozFullPath;
    72   // This performs no security checks!
    73   [noscript] readonly attribute DOMString mozFullPathInternal;
    75   [noscript] readonly attribute uint64_t mozLastModifiedDate;
    76 };

mercurial