Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions chrome/common/chrome_paths_linux.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,13 @@ bool GetDefaultUserDataDirectory(base::FilePath* result) {
#elif 0 //BUILDFLAG(GOOGLE_CHROME_BRANDING)
std::string data_dir_basename = "google-chrome";
#else
std::string data_dir_basename = nw::package()->GetName();
// Headless mode asks for this path from ChromeMain(), before
// ChromeMainDelegate::BasicStartupComplete() has loaded the package.
nw::Package* package = nw::package();
std::string data_dir_basename = package ? package->GetName() : "nwjs";
#endif

*result = config_dir.Append(nw::package()->GetName());
*result = config_dir.Append(data_dir_basename);
//*result = config_dir.Append(data_dir_basename + GetChannelSuffixForDataDir());
return true;
}
Expand Down
6 changes: 5 additions & 1 deletion chrome/common/chrome_paths_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ bool GetDefaultUserDataDirectoryForProduct(const std::string& product_dir,
namespace chrome {

bool GetDefaultUserDataDirectory(base::FilePath* result) {
return GetDefaultUserDataDirectoryForProduct(nw::package()->GetName(), result);
// Headless mode asks for this path from ChromeMain(), before
// ChromeMainDelegate::BasicStartupComplete() has loaded the package.
nw::Package* package = nw::package();
return GetDefaultUserDataDirectoryForProduct(
package ? package->GetName() : "nwjs", result);
}

bool GetUserDocumentsDirectory(base::FilePath* result) {
Expand Down
Loading