Index: webrtc/base/proxydetect.cc |
diff --git a/webrtc/base/proxydetect.cc b/webrtc/base/proxydetect.cc |
index 111cf4b020df642ed9386c592c7d7beb4799e312..e19a914f7bff6a660b7e233caa54224ce55fa770 100644 |
--- a/webrtc/base/proxydetect.cc |
+++ b/webrtc/base/proxydetect.cc |
@@ -21,6 +21,7 @@ |
#include <CoreServices/CoreServices.h> |
#include <Security/Security.h> |
#include "macconversion.h" |
+#include "webrtc/base/unixfilesystem.h" |
#endif |
#ifdef WEBRTC_IOS |
@@ -392,20 +393,11 @@ bool GetFirefoxProfilePath(Pathname* path) { |
path->AppendFolder("Mozilla"); |
path->AppendFolder("Firefox"); |
#elif defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) |
- FSRef fr; |
- if (0 != FSFindFolder(kUserDomain, kApplicationSupportFolderType, |
- kCreateFolder, &fr)) { |
- LOG(LS_ERROR) << "FSFindFolder failed"; |
+ rtc::UnixFilesystem filesystem; |
+ filesystem.SetApplicationName("Firefox"); |
+ bool result = filesystem.GetAppDataFolder(path, true); |
+ if (!result) |
magjed_webrtc
2016/10/05 13:08:15
nit: just 'return result;' here.
erikchen
2016/10/05 16:53:59
Done.
|
return false; |
- } |
- char buffer[NAME_MAX + 1]; |
- if (0 != FSRefMakePath(&fr, reinterpret_cast<uint8_t*>(buffer), |
- arraysize(buffer))) { |
- LOG(LS_ERROR) << "FSRefMakePath failed"; |
- return false; |
- } |
- path->SetFolder(std::string(buffer)); |
- path->AppendFolder("Firefox"); |
#else |
char* user_home = getenv("HOME"); |
if (user_home == NULL) { |