Tue, 06 Jan 2015 21:39:09 +0100
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: 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 /**
7 * Defines the property names for directories available from
8 * nsIDirectoryService. These dirs are always available even if no
9 * nsIDirectoryServiceProviders have been registered with the service.
10 * Application level keys are defined in nsAppDirectoryServiceDefs.h.
11 *
12 * Keys whose definition ends in "DIR" or "FILE" return a single nsIFile (or
13 * subclass). Keys whose definition ends in "LIST" return an nsISimpleEnumerator
14 * which enumerates a list of file objects.
15 *
16 * Defines listed in this file are FROZEN. This list may grow.
17 */
19 #ifndef nsDirectoryServiceDefs_h___
20 #define nsDirectoryServiceDefs_h___
22 /* General OS specific locations */
24 #define NS_OS_HOME_DIR "Home"
25 #define NS_OS_TEMP_DIR "TmpD"
26 #define NS_OS_CURRENT_WORKING_DIR "CurWorkD"
27 /* Files stored in this directory will appear on the user's desktop,
28 * if there is one, otherwise it's just the same as "Home"
29 */
30 #define NS_OS_DESKTOP_DIR "Desk"
32 /* Property returns the directory in which the procces was started from.
33 * On Unix this will be the path in the MOZILLA_FIVE_HOME env var and if
34 * unset will be the current working directory.
35 */
36 #define NS_OS_CURRENT_PROCESS_DIR "CurProcD"
38 /* This location is similar to NS_OS_CURRENT_PROCESS_DIR, however,
39 * NS_XPCOM_CURRENT_PROCESS_DIR can be overriden by passing a "bin
40 * directory" to NS_InitXPCOM2().
41 */
42 #define NS_XPCOM_CURRENT_PROCESS_DIR "XCurProcD"
44 /* Property will return the location of the the XPCOM Shared Library.
45 */
46 #define NS_XPCOM_LIBRARY_FILE "XpcomLib"
48 /* Property will return the current location of the the GRE directory.
49 * If no GRE is used, this propery will behave like
50 * NS_XPCOM_CURRENT_PROCESS_DIR.
51 */
52 #define NS_GRE_DIR "GreD"
54 /* Platform Specific Locations */
56 #if !defined (XP_UNIX) || defined(MOZ_WIDGET_COCOA)
57 #define NS_OS_SYSTEM_DIR "SysD"
58 #endif
60 #if defined (MOZ_WIDGET_COCOA)
61 #define NS_MAC_DESKTOP_DIR NS_OS_DESKTOP_DIR
62 #define NS_MAC_TRASH_DIR "Trsh"
63 #define NS_MAC_STARTUP_DIR "Strt"
64 #define NS_MAC_SHUTDOWN_DIR "Shdwn"
65 #define NS_MAC_APPLE_MENU_DIR "ApplMenu"
66 #define NS_MAC_CONTROL_PANELS_DIR "CntlPnl"
67 #define NS_MAC_EXTENSIONS_DIR "Exts"
68 #define NS_MAC_FONTS_DIR "Fnts"
69 #define NS_MAC_PREFS_DIR "Prfs"
70 #define NS_MAC_DOCUMENTS_DIR "Docs"
71 #define NS_MAC_INTERNET_SEARCH_DIR "ISrch"
72 #define NS_OSX_HOME_DIR NS_OS_HOME_DIR
73 #define NS_MAC_HOME_DIR NS_OS_HOME_DIR
74 #define NS_MAC_DEFAULT_DOWNLOAD_DIR "DfltDwnld"
75 #define NS_MAC_USER_LIB_DIR "ULibDir" // Only available under OS X
76 #define NS_OSX_DEFAULT_DOWNLOAD_DIR NS_MAC_DEFAULT_DOWNLOAD_DIR
77 #define NS_OSX_USER_DESKTOP_DIR "UsrDsk"
78 #define NS_OSX_LOCAL_DESKTOP_DIR "LocDsk"
79 #define NS_OSX_USER_APPLICATIONS_DIR "UsrApp"
80 #define NS_OSX_LOCAL_APPLICATIONS_DIR "LocApp"
81 #define NS_OSX_USER_DOCUMENTS_DIR "UsrDocs"
82 #define NS_OSX_LOCAL_DOCUMENTS_DIR "LocDocs"
83 #define NS_OSX_USER_INTERNET_PLUGIN_DIR "UsrIntrntPlgn"
84 #define NS_OSX_LOCAL_INTERNET_PLUGIN_DIR "LoclIntrntPlgn"
85 #define NS_OSX_USER_FRAMEWORKS_DIR "UsrFrmwrks"
86 #define NS_OSX_LOCAL_FRAMEWORKS_DIR "LocFrmwrks"
87 #define NS_OSX_USER_PREFERENCES_DIR "UsrPrfs"
88 #define NS_OSX_LOCAL_PREFERENCES_DIR "LocPrfs"
89 #define NS_OSX_PICTURE_DOCUMENTS_DIR "Pct"
90 #define NS_OSX_MOVIE_DOCUMENTS_DIR "Mov"
91 #define NS_OSX_MUSIC_DOCUMENTS_DIR "Music"
92 #define NS_OSX_INTERNET_SITES_DIR "IntrntSts"
93 #elif defined (XP_WIN)
94 #define NS_WIN_WINDOWS_DIR "WinD"
95 #define NS_WIN_PROGRAM_FILES_DIR "ProgF"
96 #define NS_WIN_HOME_DIR NS_OS_HOME_DIR
97 #define NS_WIN_DESKTOP_DIR "DeskV" // virtual folder at the root of the namespace
98 #define NS_WIN_PROGRAMS_DIR "Progs" // User start menu programs directory!
99 #define NS_WIN_CONTROLS_DIR "Cntls"
100 #define NS_WIN_PRINTERS_DIR "Prnts"
101 #define NS_WIN_PERSONAL_DIR "Pers"
102 #define NS_WIN_FAVORITES_DIR "Favs"
103 #define NS_WIN_STARTUP_DIR "Strt"
104 #define NS_WIN_RECENT_DIR "Rcnt"
105 #define NS_WIN_SEND_TO_DIR "SndTo"
106 #define NS_WIN_BITBUCKET_DIR "Buckt"
107 #define NS_WIN_STARTMENU_DIR "Strt"
108 // This gives the same thing as NS_OS_DESKTOP_DIR
109 #define NS_WIN_DESKTOP_DIRECTORY "DeskP" // file sys dir which physically stores objects on desktop
110 #define NS_WIN_DRIVES_DIR "Drivs"
111 #define NS_WIN_NETWORK_DIR "NetW"
112 #define NS_WIN_NETHOOD_DIR "netH"
113 #define NS_WIN_FONTS_DIR "Fnts"
114 #define NS_WIN_TEMPLATES_DIR "Tmpls"
115 #define NS_WIN_COMMON_STARTMENU_DIR "CmStrt"
116 #define NS_WIN_COMMON_PROGRAMS_DIR "CmPrgs"
117 #define NS_WIN_COMMON_STARTUP_DIR "CmStrt"
118 #define NS_WIN_COMMON_DESKTOP_DIRECTORY "CmDeskP"
119 #define NS_WIN_COMMON_APPDATA_DIR "CmAppData"
120 #define NS_WIN_APPDATA_DIR "AppData"
121 #define NS_WIN_LOCAL_APPDATA_DIR "LocalAppData"
122 #define NS_WIN_PRINTHOOD "PrntHd"
123 #define NS_WIN_COOKIES_DIR "CookD"
124 #define NS_WIN_DEFAULT_DOWNLOAD_DIR "DfltDwnld"
125 // On Win7 and up these ids will return the default save-to location for
126 // Windows Libraries associated with the specific content type. For other
127 // os they return the local user folder. Note these can return network file
128 // paths which can jank the ui thread so be careful how you access them.
129 #define NS_WIN_DOCUMENTS_DIR "Docs"
130 #define NS_WIN_PICTURES_DIR "Pict"
131 #define NS_WIN_MUSIC_DIR "Music"
132 #define NS_WIN_VIDEOS_DIR "Vids"
133 #elif defined (XP_UNIX)
134 #define NS_UNIX_LOCAL_DIR "Locl"
135 #define NS_UNIX_LIB_DIR "LibD"
136 #define NS_UNIX_HOME_DIR NS_OS_HOME_DIR
137 #define NS_UNIX_XDG_DESKTOP_DIR "XDGDesk"
138 #define NS_UNIX_XDG_DOCUMENTS_DIR "XDGDocs"
139 #define NS_UNIX_XDG_DOWNLOAD_DIR "XDGDwnld"
140 #define NS_UNIX_XDG_MUSIC_DIR "XDGMusic"
141 #define NS_UNIX_XDG_PICTURES_DIR "XDGPict"
142 #define NS_UNIX_XDG_PUBLIC_SHARE_DIR "XDGPubSh"
143 #define NS_UNIX_XDG_TEMPLATES_DIR "XDGTempl"
144 #define NS_UNIX_XDG_VIDEOS_DIR "XDGVids"
145 #define NS_UNIX_DEFAULT_DOWNLOAD_DIR "DfltDwnld"
146 #endif
148 /* Deprecated */
150 #define NS_OS_DRIVE_DIR "DrvD"
154 #endif