From 45c26e0e5ad8ca6c841bbb250e7790b23fb18d9f Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 17:11:27 -0800 Subject: [PATCH 01/11] Add app.setDataPath API --- atom/browser/api/atom_api_app.cc | 23 ++++++++--------------- atom/browser/api/atom_api_app.h | 1 + vendor/brightray | 2 +- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 98d46f895a7e..9a9ce028fdff 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -16,6 +16,7 @@ #include "base/environment.h" #include "base/files/file_path.h" #include "base/path_service.h" +#include "brightray/browser/brightray_paths.h" #include "native_mate/callback.h" #include "native_mate/dictionary.h" #include "native_mate/object_template_builder.h" @@ -26,10 +27,6 @@ #include "atom/common/node_includes.h" -#if defined(OS_LINUX) -#include "base/nix/xdg_util.h" -#endif - using atom::Browser; namespace mate { @@ -142,19 +139,14 @@ void App::OnFinishLaunching() { Emit("ready"); } +void App::SetDataPath(const base::FilePath& path) { + PathService::Override(brightray::DIR_USER_DATA, path); +} + base::FilePath App::GetDataPath() { base::FilePath path; -#if defined(OS_LINUX) - scoped_ptr env(base::Environment::Create()); - path = base::nix::GetXDGDirectory(env.get(), - base::nix::kXdgConfigHomeEnvVar, - base::nix::kDotConfigDir); -#else - PathService::Get(base::DIR_APP_DATA, &path); -#endif - - return path.Append(base::FilePath::FromUTF8Unsafe( - Browser::Get()->GetName())); + PathService::Get(brightray::DIR_USER_DATA, &path); + return path; } void App::ResolveProxy(const GURL& url, ResolveProxyCallback callback) { @@ -187,6 +179,7 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder( .SetMethod("setUserTasks", base::Bind(&Browser::SetUserTasks, browser)) #endif + .SetMethod("setDataPath", &App::SetDataPath) .SetMethod("getDataPath", &App::GetDataPath) .SetMethod("resolveProxy", &App::ResolveProxy) .SetMethod("setDesktopName", &App::SetDesktopName); diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index a9e2a17a13dd..61d061569dae 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -48,6 +48,7 @@ class App : public mate::EventEmitter, v8::Isolate* isolate) override; private: + void SetDataPath(const base::FilePath& path); base::FilePath GetDataPath(); void ResolveProxy(const GURL& url, ResolveProxyCallback callback); void SetDesktopName(const std::string& desktop_name); diff --git a/vendor/brightray b/vendor/brightray index 09dc5f11e9c8..395b3359cb5e 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 09dc5f11e9c83e6ff3c2b6b1b58ceb2b8eae35c4 +Subproject commit 395b3359cb5e8209fa740b9c678fd60709789106 From 2d1afbf51b989a0c85ae37d775e320e73dc21bb7 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 17:24:02 -0800 Subject: [PATCH 02/11] Call app.getDataPath after app is ready It is possible for users to override the data path. --- atom/browser/lib/chrome-extension.coffee | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/atom/browser/lib/chrome-extension.coffee b/atom/browser/lib/chrome-extension.coffee index e62ad5250de4..1b987187c46a 100644 --- a/atom/browser/lib/chrome-extension.coffee +++ b/atom/browser/lib/chrome-extension.coffee @@ -34,15 +34,9 @@ getExtensionInfoFromPath = (srcDirectory) -> srcDirectory: srcDirectory extensionInfoMap[manifest.name] -# Load persistented extensions. -loadedExtensionsPath = path.join app.getDataPath(), 'DevTools Extensions' - -try - loadedExtensions = JSON.parse fs.readFileSync(loadedExtensionsPath) - loadedExtensions = [] unless Array.isArray loadedExtensions - # Preheat the extensionInfo cache. - getExtensionInfoFromPath srcDirectory for srcDirectory in loadedExtensions -catch e +# The loaded extensions cache and its persistent path. +loadedExtensions = null +loadedExtensionsPath = null # Persistent loaded extensions. app.on 'will-quit', -> @@ -59,6 +53,16 @@ app.once 'ready', -> protocol = require 'protocol' BrowserWindow = require 'browser-window' + # Load persistented extensions. + loadedExtensionsPath = path.join app.getDataPath(), 'DevTools Extensions' + + try + loadedExtensions = JSON.parse fs.readFileSync(loadedExtensionsPath) + loadedExtensions = [] unless Array.isArray loadedExtensions + # Preheat the extensionInfo cache. + getExtensionInfoFromPath srcDirectory for srcDirectory in loadedExtensions + catch e + # The chrome-extension: can map a extension URL request to real file path. protocol.registerProtocol 'chrome-extension', (request) -> parsed = url.parse request.url From 06da5f254a05ec5c1eb32b738f3ed441815e2c1a Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 17:52:15 -0800 Subject: [PATCH 03/11] Add app.setPath and app.getPath APIs They can be used to set/get any path defined in PathService --- atom/browser/api/atom_api_app.cc | 30 ++++++++++++++++++++++-------- atom/browser/api/atom_api_app.h | 4 ++++ atom/browser/api/lib/app.coffee | 6 ++++++ vendor/brightray | 2 +- 4 files changed, 33 insertions(+), 9 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 9a9ce028fdff..d5c688352980 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -61,6 +61,16 @@ namespace api { namespace { +// Return the path constant from string. +int GetPathConstant(const std::string& name) { + if (name == "appData") + return brightray::DIR_APP_DATA; + else if (name == "userData") + return brightray::DIR_USER_DATA; + else + return -1; +} + class ResolveProxyHelper { public: ResolveProxyHelper(const GURL& url, App::ResolveProxyCallback callback) @@ -139,14 +149,18 @@ void App::OnFinishLaunching() { Emit("ready"); } -void App::SetDataPath(const base::FilePath& path) { - PathService::Override(brightray::DIR_USER_DATA, path); +base::FilePath App::GetPath(const std::string& name) { + base::FilePath path; + int key = GetPathConstant(name); + if (key >= 0) + PathService::Get(key, &path); + return path; } -base::FilePath App::GetDataPath() { - base::FilePath path; - PathService::Get(brightray::DIR_USER_DATA, &path); - return path; +void App::SetPath(const std::string& name, const base::FilePath& path) { + int key = GetPathConstant(name); + if (key >= 0) + PathService::Override(key, path); } void App::ResolveProxy(const GURL& url, ResolveProxyCallback callback) { @@ -179,8 +193,8 @@ mate::ObjectTemplateBuilder App::GetObjectTemplateBuilder( .SetMethod("setUserTasks", base::Bind(&Browser::SetUserTasks, browser)) #endif - .SetMethod("setDataPath", &App::SetDataPath) - .SetMethod("getDataPath", &App::GetDataPath) + .SetMethod("setPath", &App::SetPath) + .SetMethod("getPath", &App::GetPath) .SetMethod("resolveProxy", &App::ResolveProxy) .SetMethod("setDesktopName", &App::SetDesktopName); } diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index 61d061569dae..9b67cb5b7173 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -48,6 +48,10 @@ class App : public mate::EventEmitter, v8::Isolate* isolate) override; private: + // Get/Set the pre-defined path in PathService. + base::FilePath GetPath(const std::string& name); + void SetPath(const std::string& name, const base::FilePath& path); + void SetDataPath(const base::FilePath& path); base::FilePath GetDataPath(); void ResolveProxy(const GURL& url, ResolveProxyCallback callback); diff --git a/atom/browser/api/lib/app.coffee b/atom/browser/api/lib/app.coffee index 51fd66098ac0..5ac0d719f4c9 100644 --- a/atom/browser/api/lib/app.coffee +++ b/atom/browser/api/lib/app.coffee @@ -8,6 +8,12 @@ app.__proto__ = EventEmitter.prototype app.getHomeDir = -> process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME'] +app.getDataPath = -> + app.getPath 'userData' + +app.setDataPath = (path) -> + app.setPath 'userData', path + app.setApplicationMenu = (menu) -> require('menu').setApplicationMenu menu diff --git a/vendor/brightray b/vendor/brightray index 395b3359cb5e..8eb714dac77e 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 395b3359cb5e8209fa740b9c678fd60709789106 +Subproject commit 8eb714dac77e3d3fd43fba76c835d29b838cc8be From d31df439c3191f2d86bc043124fd174ba2b60bcc Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 17:58:17 -0800 Subject: [PATCH 04/11] Override default userData according to app's name --- atom/browser/default_app/main.js | 1 + atom/browser/lib/init.coffee | 3 +++ 2 files changed, 4 insertions(+) diff --git a/atom/browser/default_app/main.js b/atom/browser/default_app/main.js index 8f6e38740312..c7ea581cefa6 100644 --- a/atom/browser/default_app/main.js +++ b/atom/browser/default_app/main.js @@ -41,6 +41,7 @@ if (option.file && !option.webdriver) { app.setName(packageJson.productName); else if (packageJson.name) app.setName(packageJson.name); + app.setPath('userData', path.join(app.getPath('appData'), app.getName())); } // Run the app. diff --git a/atom/browser/lib/init.coffee b/atom/browser/lib/init.coffee index ae2419b2199b..b0cee6badf47 100644 --- a/atom/browser/lib/init.coffee +++ b/atom/browser/lib/init.coffee @@ -90,6 +90,9 @@ process.once 'BIND_DONE', -> else app.setDesktopName '#{app.getName()}.desktop' + # Set the user data path according to application's name. + app.setPath 'userData', path.join(app.getPath('appData'), app.getName()) + # Load the chrome extension support. require './chrome-extension.js' From a988b48016a24d18435f5a7ba46caeb5e6c53608 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 18:01:58 -0800 Subject: [PATCH 05/11] Implement app.getHomeDir with app.getPath --- atom/browser/api/atom_api_app.cc | 2 ++ atom/browser/api/lib/app.coffee | 12 +++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index d5c688352980..884c3d90a0ce 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -67,6 +67,8 @@ int GetPathConstant(const std::string& name) { return brightray::DIR_APP_DATA; else if (name == "userData") return brightray::DIR_USER_DATA; + else if (name == "home") + return base::DIR_HOME; else return -1; } diff --git a/atom/browser/api/lib/app.coffee b/atom/browser/api/lib/app.coffee index 5ac0d719f4c9..aad56fd91238 100644 --- a/atom/browser/api/lib/app.coffee +++ b/atom/browser/api/lib/app.coffee @@ -5,15 +5,6 @@ bindings = process.atomBinding 'app' app = bindings.app app.__proto__ = EventEmitter.prototype -app.getHomeDir = -> - process.env[if process.platform is 'win32' then 'USERPROFILE' else 'HOME'] - -app.getDataPath = -> - app.getPath 'userData' - -app.setDataPath = (path) -> - app.setPath 'userData', path - app.setApplicationMenu = (menu) -> require('menu').setApplicationMenu menu @@ -38,6 +29,9 @@ if process.platform is 'darwin' app.once 'ready', -> app.emit 'finish-launching' app.terminate = app.quit app.exit = process.exit +app.getHomeDir = -> app.getPath 'home' +app.getDataPath = -> app.getPath 'userData' +app.setDataPath = (path) -> app.setPath 'userData', path # Only one App object pemitted. module.exports = app From dec3e3768364da76b95c2a149c1971d82bb647f9 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 18:25:31 -0800 Subject: [PATCH 06/11] docs: Document app.getPath/app.setPath --- docs/api/app.md | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/docs/api/app.md b/docs/api/app.md index b7cb5f35aa08..4620dcf8cf20 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -91,13 +91,33 @@ executed. It is possible that a window cancels the quitting by returning Quit the application directly, it will not try to close all windows so cleanup code will not run. -## app.getDataPath() +## app.getPath(name) -Returns the path for storing configuration files, with app name appended. +* `name` String - * `%APPDATA%\MyAppName` on Windows - * `~/.config/MyAppName` on Linux - * `~/Library/Application Support/MyAppName` on OS X +Retrieves a path to a special directory or file associated with `name`. On +failure an `Error` would throw. + +You can request following paths by the names: + +* `home`: User's home directory +* `appData`: Per-user application data directory, by default it is pointed to: + * `%APPDATA%` on Windows + * `~/.config` on Linux + * `~/Library/Application Support` on OS X +* `userData`: The directory for storing your app's configuration files, by + default it is the `appData` directory appended with your app's name. + +## app.setPath(name, path) + +* `name` String +* `path` String + +Overrides the `path` to a special directory or file associated with `name`. if +the path specifies a directory that does not exist, the directory will be +created by this method. On failure an `Error` would throw. + +You can only override paths of `name`s defined in `app.getPath`. ## app.getVersion() From 3d398458a8d4cf76fba821893cd4be7e8912dd01 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 20:24:58 -0800 Subject: [PATCH 07/11] Throw error when PathService call failed --- atom/browser/api/atom_api_app.cc | 16 ++++++++++++---- atom/browser/api/atom_api_app.h | 12 ++++++++---- vendor/brightray | 2 +- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 884c3d90a0ce..440795831ae4 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -151,18 +151,26 @@ void App::OnFinishLaunching() { Emit("ready"); } -base::FilePath App::GetPath(const std::string& name) { +base::FilePath App::GetPath(mate::Arguments* args, const std::string& name) { + bool succeed = false; base::FilePath path; int key = GetPathConstant(name); if (key >= 0) - PathService::Get(key, &path); + succeed = PathService::Get(key, &path); + if (!succeed) + args->ThrowError("Failed to get path"); return path; } -void App::SetPath(const std::string& name, const base::FilePath& path) { +void App::SetPath(mate::Arguments* args, + const std::string& name, + const base::FilePath& path) { + bool succeed = false; int key = GetPathConstant(name); if (key >= 0) - PathService::Override(key, path); + succeed = PathService::Override(key, path); + if (!succeed) + args->ThrowError("Failed to set path"); } void App::ResolveProxy(const GURL& url, ResolveProxyCallback callback) { diff --git a/atom/browser/api/atom_api_app.h b/atom/browser/api/atom_api_app.h index 9b67cb5b7173..41a820b7a765 100644 --- a/atom/browser/api/atom_api_app.h +++ b/atom/browser/api/atom_api_app.h @@ -18,6 +18,10 @@ namespace base { class FilePath; } +namespace mate { +class Arguments; +} + namespace atom { namespace api { @@ -49,11 +53,11 @@ class App : public mate::EventEmitter, private: // Get/Set the pre-defined path in PathService. - base::FilePath GetPath(const std::string& name); - void SetPath(const std::string& name, const base::FilePath& path); + base::FilePath GetPath(mate::Arguments* args, const std::string& name); + void SetPath(mate::Arguments* args, + const std::string& name, + const base::FilePath& path); - void SetDataPath(const base::FilePath& path); - base::FilePath GetDataPath(); void ResolveProxy(const GURL& url, ResolveProxyCallback callback); void SetDesktopName(const std::string& desktop_name); diff --git a/vendor/brightray b/vendor/brightray index 8eb714dac77e..f19c269ab974 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit 8eb714dac77e3d3fd43fba76c835d29b838cc8be +Subproject commit f19c269ab974f22f31782c0c395119130fb59b15 From 9a04f67c0a89f042be0dec3d0d24143bf57edd26 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 20:39:38 -0800 Subject: [PATCH 08/11] docs: Mention when to override userData path --- docs/api/app.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/api/app.md b/docs/api/app.md index 4620dcf8cf20..b32032924782 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -119,6 +119,10 @@ created by this method. On failure an `Error` would throw. You can only override paths of `name`s defined in `app.getPath`. +By default web pages' cookies and caches will be stored under `userData` +directory, if you want to change this location, you have to override the +`userData` path before the `ready` event of `app` module gets emitted. + ## app.getVersion() Returns the version of loaded application, if no version is found in From ce52a87477d11a98fd91652537a7c3223d2805b5 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 21:09:42 -0800 Subject: [PATCH 09/11] Add "cache" and "userCache" directories --- atom/browser/api/atom_api_app.cc | 4 ++++ atom/browser/default_app/main.js | 1 + atom/browser/lib/init.coffee | 3 ++- docs/api/app.md | 6 ++++++ vendor/brightray | 2 +- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index 440795831ae4..ae2228ff941d 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -67,6 +67,10 @@ int GetPathConstant(const std::string& name) { return brightray::DIR_APP_DATA; else if (name == "userData") return brightray::DIR_USER_DATA; + else if (name == "cache") + return brightray::DIR_CACHE; + else if (name == "userCache") + return brightray::DIR_USER_CACHE; else if (name == "home") return base::DIR_HOME; else diff --git a/atom/browser/default_app/main.js b/atom/browser/default_app/main.js index c7ea581cefa6..103c05cc1129 100644 --- a/atom/browser/default_app/main.js +++ b/atom/browser/default_app/main.js @@ -42,6 +42,7 @@ if (option.file && !option.webdriver) { else if (packageJson.name) app.setName(packageJson.name); app.setPath('userData', path.join(app.getPath('appData'), app.getName())); + app.setPath('userCache', path.join(app.getPath('cache'), app.getName())); } // Run the app. diff --git a/atom/browser/lib/init.coffee b/atom/browser/lib/init.coffee index b0cee6badf47..d3234db757a0 100644 --- a/atom/browser/lib/init.coffee +++ b/atom/browser/lib/init.coffee @@ -90,8 +90,9 @@ process.once 'BIND_DONE', -> else app.setDesktopName '#{app.getName()}.desktop' - # Set the user data path according to application's name. + # Set the user path according to application's name. app.setPath 'userData', path.join(app.getPath('appData'), app.getName()) + app.setPath 'userCache', path.join(app.getPath('cache'), app.getName()) # Load the chrome extension support. require './chrome-extension.js' diff --git a/docs/api/app.md b/docs/api/app.md index b32032924782..9bc5c8b24ae6 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -107,6 +107,12 @@ You can request following paths by the names: * `~/Library/Application Support` on OS X * `userData`: The directory for storing your app's configuration files, by default it is the `appData` directory appended with your app's name. +* `cache`: Per-user application cache directory, by default it is pointed to: + * `%APPDATA%` on Window, which doesn't has a universal place for cache + * `$XDG_CACHE_HOME` on Linux + * `~/Library/Caches` on OS X +* `userCache`: The directory for placing your app's caches, by default it is the + `cache` directory appended with your app's name. ## app.setPath(name, path) diff --git a/vendor/brightray b/vendor/brightray index f19c269ab974..ad17292154dd 160000 --- a/vendor/brightray +++ b/vendor/brightray @@ -1 +1 @@ -Subproject commit f19c269ab974f22f31782c0c395119130fb59b15 +Subproject commit ad17292154ddd2436c377bbe2d10fa213338f4fa From 8aa5b97c614994c07335e823854ab6a702a96228 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 21:10:42 -0800 Subject: [PATCH 10/11] docs: Say more about Linux's behavior --- docs/api/app.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/app.md b/docs/api/app.md index 9bc5c8b24ae6..9462584d32bb 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -103,13 +103,13 @@ You can request following paths by the names: * `home`: User's home directory * `appData`: Per-user application data directory, by default it is pointed to: * `%APPDATA%` on Windows - * `~/.config` on Linux + * `$XDG_CONFIG_HOME` or `~/.config` on Linux * `~/Library/Application Support` on OS X * `userData`: The directory for storing your app's configuration files, by default it is the `appData` directory appended with your app's name. * `cache`: Per-user application cache directory, by default it is pointed to: * `%APPDATA%` on Window, which doesn't has a universal place for cache - * `$XDG_CACHE_HOME` on Linux + * `$XDG_CACHE_HOME` or `~/.cache` on Linux * `~/Library/Caches` on OS X * `userCache`: The directory for placing your app's caches, by default it is the `cache` directory appended with your app's name. From 4604c9bb0e417c26990886fc0e64b405c7c9d1d2 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Sun, 18 Jan 2015 21:31:09 -0800 Subject: [PATCH 11/11] Add a few more paths for app.getPath --- atom/browser/api/atom_api_app.cc | 8 ++++++++ docs/api/app.md | 8 ++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/atom/browser/api/atom_api_app.cc b/atom/browser/api/atom_api_app.cc index ae2228ff941d..c7a2a542d1d8 100644 --- a/atom/browser/api/atom_api_app.cc +++ b/atom/browser/api/atom_api_app.cc @@ -73,6 +73,14 @@ int GetPathConstant(const std::string& name) { return brightray::DIR_USER_CACHE; else if (name == "home") return base::DIR_HOME; + else if (name == "temp") + return base::DIR_TEMP; + else if (name == "userDesktop") + return base::DIR_USER_DESKTOP; + else if (name == "exe") + return base::FILE_EXE; + else if (name == "module") + return base::FILE_MODULE; else return -1; } diff --git a/docs/api/app.md b/docs/api/app.md index 9462584d32bb..4ac377692622 100644 --- a/docs/api/app.md +++ b/docs/api/app.md @@ -106,13 +106,17 @@ You can request following paths by the names: * `$XDG_CONFIG_HOME` or `~/.config` on Linux * `~/Library/Application Support` on OS X * `userData`: The directory for storing your app's configuration files, by - default it is the `appData` directory appended with your app's name. + default it is the `appData` directory appended with your app's name * `cache`: Per-user application cache directory, by default it is pointed to: * `%APPDATA%` on Window, which doesn't has a universal place for cache * `$XDG_CACHE_HOME` or `~/.cache` on Linux * `~/Library/Caches` on OS X * `userCache`: The directory for placing your app's caches, by default it is the - `cache` directory appended with your app's name. + `cache` directory appended with your app's name +* `temp`: Temporary directory +* `userDesktop`: The current user's Desktop directory +* `exe`: The current executable file +* `module`: The `libchromiumcontent` library ## app.setPath(name, path)