xpcom/io/nsAppFileLocationProvider.h

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: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     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 #ifndef nsAppFileLocationProvider_h
     7 #define nsAppFileLocationProvider_h
     9 #include "nsIDirectoryService.h"
    10 #include "nsIFile.h"
    11 #include "mozilla/Attributes.h"
    13 class nsIFile;
    15 //*****************************************************************************
    16 // class nsAppFileLocationProvider
    17 //*****************************************************************************   
    19 class nsAppFileLocationProvider MOZ_FINAL : public nsIDirectoryServiceProvider2
    20 {
    21 public:
    22                         nsAppFileLocationProvider();
    24    NS_DECL_THREADSAFE_ISUPPORTS
    25    NS_DECL_NSIDIRECTORYSERVICEPROVIDER
    26    NS_DECL_NSIDIRECTORYSERVICEPROVIDER2
    28 private:
    29                         ~nsAppFileLocationProvider() {}
    31 protected:
    32    NS_METHOD            CloneMozBinDirectory(nsIFile **aLocalFile);
    33    /**
    34     * Get the product directory. This is a user-specific directory for storing
    35     * application settings (e.g. the Application Data directory on windows
    36     * systems).
    37     * @param aLocal If true, should try to get a directory that is only stored
    38     *               locally (ie not transferred with roaming profiles)
    39     */
    40    NS_METHOD            GetProductDirectory(nsIFile **aLocalFile,
    41                                             bool aLocal = false);
    42    NS_METHOD            GetDefaultUserProfileRoot(nsIFile **aLocalFile,
    43                                                   bool aLocal = false);
    45 #if defined(MOZ_WIDGET_COCOA)
    46    static bool          IsOSXLeopard();
    47 #endif
    49    nsCOMPtr<nsIFile> mMozBinDirectory;
    50 };
    52 #endif

mercurial