Skip to content

Commit a83eb54

Browse files
committed
Fix nwjs#5208: Helper to remove temp dir in renderer
Actual work is done in Chromium repo
1 parent 5e9461e commit a83eb54

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/browser/nw_extensions_browser_hooks.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ void LoadNWAppAsExtensionHook(base::DictionaryValue* manifest,
272272

273273
if (NWContentVerifierDelegate::GetDefaultMode() == ContentVerifierDelegate::ENFORCE_STRICT)
274274
manifest->SetBoolean(manifest_keys::kNWJSContentVerifyFlag, true);
275+
276+
if (package->temp_dir().IsValid()) {
277+
// need to remove the dir in renderer process
278+
manifest->SetString("nw-temp-dir", package->temp_dir().GetPath().AsUTF8Unsafe());
279+
}
275280
}
276281

277282
void CalcNewWinParams(content::WebContents* new_contents, void* params,

src/nw_package.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ class NW_EXPORT Package {
8282
std::string package_string() { return package_string_; }
8383

8484
std::string cached_error_content() { return cached_error_content_; }
85+
base::ScopedTempDir& temp_dir() { return scoped_temp_dir_; }
8586

8687
private:
8788
bool InitFromPath(const base::FilePath&);

0 commit comments

Comments
 (0)