Skip to content

Commit

Permalink
Linux: Update user data path docs (see issue chromiumembedded#3149)
Browse files Browse the repository at this point in the history
  • Loading branch information
magreenblatt committed Aug 11, 2021
1 parent 6422125 commit b4cf6e5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
28 changes: 14 additions & 14 deletions include/internal/cef_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,14 @@ typedef struct _cef_settings_t {
cef_string_t root_cache_path;

///
// The location where user data such as spell checking dictionary files will
// be stored on disk. If this value is empty then the default
// platform-specific user data directory will be used ("~/.cef_user_data"
// directory on Linux, "~/Library/Application Support/CEF/User Data" directory
// on Mac OS X, "AppData\Local\CEF\User Data" directory under the user profile
// directory on Windows). If this value is non-empty then it must be an
// absolute path. When using the Chrome runtime this value will be ignored in
// favor of the |root_cache_path| value.
// The location where user data such as the Widevine CDM module and spell
// checking dictionary files will be stored on disk. If this value is empty
// then the default platform-specific user data directory will be used
// ("~/.config/cef_user_data" directory on Linux, "~/Library/Application
// Support/CEF/User Data" directory on MacOS, "AppData\Local\CEF\User Data"
// directory under the user profile directory on Windows). If this value is
// non-empty then it must be an absolute path. When using the Chrome runtime
// this value will be ignored in favor of the |root_cache_path| value.
///
cef_string_t user_data_path;

Expand Down Expand Up @@ -320,7 +320,7 @@ typedef struct _cef_settings_t {
///
// The directory and file name to use for the debug log. If empty a default
// log file name and location will be used. On Windows and Linux a "debug.log"
// file will be written in the main executable directory. On Mac OS X a
// file will be written in the main executable directory. On MacOS a
// "~/Library/Logs/<app name>_debug.log" file will be written where <app name>
// is the name of the main app executable. Also configurable using the
// "log-file" command-line switch.
Expand All @@ -346,7 +346,7 @@ typedef struct _cef_settings_t {
///
// The fully qualified path for the resources directory. If this value is
// empty the *.pak files must be located in the module directory on
// Windows/Linux or the app bundle Resources directory on Mac OS X. If this
// Windows/Linux or the app bundle Resources directory on MacOS. If this
// value is non-empty then it must be an absolute path. Also configurable
// using the "resources-dir-path" command-line switch.
///
Expand All @@ -356,9 +356,9 @@ typedef struct _cef_settings_t {
// The fully qualified path for the locales directory. If this value is empty
// the locales directory must be located in the module directory. If this
// value is non-empty then it must be an absolute path. This value is ignored
// on Mac OS X where pack files are always loaded from the app bundle
// Resources directory. Also configurable using the "locales-dir-path"
// command-line switch.
// on MacOS where pack files are always loaded from the app bundle Resources
// directory. Also configurable using the "locales-dir-path" command-line
// switch.
///
cef_string_t locales_dir_path;

Expand Down Expand Up @@ -918,7 +918,7 @@ typedef enum {

///
// "Application Data" directory under the user profile directory on Windows
// and "~/Library/Application Support" directory on Mac OS X.
// and "~/Library/Application Support" directory on MacOS.
///
PK_USER_DATA,

Expand Down
9 changes: 4 additions & 5 deletions libcef/common/resource_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,8 @@ namespace {

// Based on chrome/common/chrome_paths_linux.cc.
// See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
// for a spec on where config files go. The net effect for most
// systems is we use ~/.config/chromium/ for Chromium and
// ~/.config/google-chrome/ for official builds.
// (This also helps us sidestep issues with other apps grabbing ~/.chromium .)
// for a spec on where config files go. The net result on most systems is that
// we use "~/.config/cef_user_data".
bool GetDefaultUserDataDirectory(base::FilePath* result) {
std::unique_ptr<base::Environment> env(base::Environment::Create());
base::FilePath config_dir(base::nix::GetXDGDirectory(
Expand Down Expand Up @@ -214,7 +212,8 @@ void OverrideUserDataDir(CefSettings* settings,

// Path used for spell checking dictionary files.
base::PathService::OverrideAndCreateIfNeeded(
chrome::DIR_APP_DICTIONARIES, user_data_path.AppendASCII("Dictionaries"),
chrome::DIR_APP_DICTIONARIES,
user_data_path.Append(FILE_PATH_LITERAL("Dictionaries")),
false, // May not be an absolute path.
true); // Create if necessary.
}
Expand Down

0 comments on commit b4cf6e5

Please sign in to comment.