Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(603)

Unified Diff: chrome/browser/file_select_helper_mac.mm

Issue 2724733002: Revert of Allow $TMPDIR to set temporary directory on OS X. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/files/file_util_mac.mm ('k') | remoting/host/mac/me2me_preference_pane.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/file_select_helper_mac.mm
diff --git a/chrome/browser/file_select_helper_mac.mm b/chrome/browser/file_select_helper_mac.mm
index 18b65c73fc4462cc27f5a1eab253ce9873a819cd..2fdc57923d89d5f85f3039c61731c152fd150145 100644
--- a/chrome/browser/file_select_helper_mac.mm
+++ b/chrome/browser/file_select_helper_mac.mm
@@ -20,24 +20,18 @@
// Given the |path| of a package, returns the destination that the package
// should be zipped to. Returns an empty path on any errors.
base::FilePath ZipDestination(const base::FilePath& path) {
- base::FilePath dest;
+ NSMutableString* dest =
+ [NSMutableString stringWithString:NSTemporaryDirectory()];
- if (!base::GetTempDir(&dest)) {
- // Couldn't get the temporary directory.
+ // Couldn't get the temporary directory.
+ if (!dest)
return base::FilePath();
- }
- // TMPDIR/<bundleID>/zip_cache/<guid>
+ [dest appendFormat:@"%@/zip_cache/%@",
+ [[NSBundle mainBundle] bundleIdentifier],
+ [[NSProcessInfo processInfo] globallyUniqueString]];
- NSString* bundleID = [[NSBundle mainBundle] bundleIdentifier];
- dest = dest.Append([bundleID fileSystemRepresentation]);
-
- dest = dest.Append("zip_cache");
-
- NSString* guid = [[NSProcessInfo processInfo] globallyUniqueString];
- dest = dest.Append([guid fileSystemRepresentation]);
-
- return dest;
+ return base::mac::NSStringToFilePath(dest);
}
// Returns the path of the package and its components relative to the package's
« no previous file with comments | « base/files/file_util_mac.mm ('k') | remoting/host/mac/me2me_preference_pane.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698