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

Unified Diff: remoting/host/mac/me2me_preference_pane.mm

Issue 2713293002: Allow $TMPDIR to set temporary directory on OS X. (Closed)
Patch Set: Fix typo 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 | « chrome/browser/file_select_helper_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/mac/me2me_preference_pane.mm
diff --git a/remoting/host/mac/me2me_preference_pane.mm b/remoting/host/mac/me2me_preference_pane.mm
index cc17b670e0b73d70ee3800dbb198c69f8044a5de..6f240a853e8c6a85cbef435dc2bc82c158cc62e4 100644
--- a/remoting/host/mac/me2me_preference_pane.mm
+++ b/remoting/host/mac/me2me_preference_pane.mm
@@ -17,6 +17,7 @@
#include <fstream>
#include <memory>
+#include "base/files/file_util.h"
#include "base/mac/authorization_util.h"
#include "base/mac/launchd.h"
#include "base/mac/mac_logging.h"
@@ -33,12 +34,16 @@
namespace {
bool GetTemporaryConfigFilePath(std::string* path) {
- NSString* filename = NSTemporaryDirectory();
- if (filename == nil)
+ base::FilePath ret;
+
+ if (!base::GetTempDir(&ret)) {
return false;
+ }
+
+ ret = ret.Append(remoting::kHostConfigFileName);
- *path = [[NSString stringWithFormat:@"%@/%s",
- filename, remoting::kHostConfigFileName] UTF8String];
+ // This should be safe on OS X because utf8 is always supported.
+ *path = ret.AsUTF8Unsafe();
return true;
}
« no previous file with comments | « chrome/browser/file_select_helper_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698