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

Unified Diff: webrtc/base/pathutils.h

Issue 2533213005: Add File::Open / Create functions to take an rtc::Pathname (Closed)
Patch Set: Resolve review comments Created 4 years 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 | « webrtc/base/flags.h ('k') | webrtc/base/pathutils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/pathutils.h
diff --git a/webrtc/base/pathutils.h b/webrtc/base/pathutils.h
index 2a0efa9763f8a0604482ae2556243b5de23b55d4..5a5fd1e1fa2e531362bd77e772c326c90c78fb75 100644
--- a/webrtc/base/pathutils.h
+++ b/webrtc/base/pathutils.h
@@ -12,8 +12,8 @@
#define WEBRTC_BASE_PATHUTILS_H__
#include <string>
-// Temporary, until deprecated helpers are removed.
-#include "webrtc/base/fileutils.h"
+
+#include "webrtc/base/checks.h"
namespace rtc {
@@ -108,63 +108,6 @@ private:
char folder_delimiter_;
};
-///////////////////////////////////////////////////////////////////////////////
-// Global Helpers (deprecated)
-///////////////////////////////////////////////////////////////////////////////
-
-inline void SetOrganizationName(const std::string& organization) {
- Filesystem::SetOrganizationName(organization);
-}
-inline void SetApplicationName(const std::string& application) {
- Filesystem::SetApplicationName(application);
-}
-inline void GetOrganizationName(std::string* organization) {
- Filesystem::GetOrganizationName(organization);
-}
-inline void GetApplicationName(std::string* application) {
- Filesystem::GetApplicationName(application);
-}
-inline bool CreateFolder(const Pathname& path) {
- return Filesystem::CreateFolder(path);
-}
-inline bool FinishPath(Pathname& path, bool create, const std::string& append) {
- if (!append.empty())
- path.AppendFolder(append);
- return !create || CreateFolder(path);
-}
-// Note: this method uses the convention of <temp>/<appname> for the temporary
-// folder. Filesystem uses <temp>/<exename>. We will be migrating exclusively
-// to <temp>/<orgname>/<appname> eventually. Since these are temp folders,
-// it's probably ok to orphan them during the transition.
-inline bool GetTemporaryFolder(Pathname& path, bool create,
- const std::string& append) {
- std::string application_name;
- Filesystem::GetApplicationName(&application_name);
- ASSERT(!application_name.empty());
- return Filesystem::GetTemporaryFolder(path, create, &application_name)
- && FinishPath(path, create, append);
-}
-inline bool GetAppDataFolder(Pathname& path, bool create,
- const std::string& append) {
- ASSERT(!create); // TODO: Support create flag on Filesystem::GetAppDataFolder.
- return Filesystem::GetAppDataFolder(&path, true)
- && FinishPath(path, create, append);
-}
-inline bool CleanupTemporaryFolder() {
- Pathname path;
- if (!GetTemporaryFolder(path, false, ""))
- return false;
- if (Filesystem::IsAbsent(path))
- return true;
- if (!Filesystem::IsTemporaryPath(path)) {
- ASSERT(false);
- return false;
- }
- return Filesystem::DeleteFolderContents(path);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
} // namespace rtc
#endif // WEBRTC_BASE_PATHUTILS_H__
« no previous file with comments | « webrtc/base/flags.h ('k') | webrtc/base/pathutils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698