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

Unified Diff: webrtc/base/proxydetect.cc

Issue 2395593002: Remove deprecated FSRef-manipulation methods. (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | webrtc/base/unixfilesystem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | webrtc/base/unixfilesystem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698