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

Unified Diff: chrome/browser/chromeos/gdata/gdata_util.h

Issue 10116044: gdata: Support mounting archive files in GData cache. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: gdata: Support mounting archive files in GData cache. Created 8 years, 8 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/chromeos/gdata/gdata_files.h ('k') | chrome/browser/chromeos/gdata/gdata_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/gdata/gdata_util.h
diff --git a/chrome/browser/chromeos/gdata/gdata_util.h b/chrome/browser/chromeos/gdata/gdata_util.h
index a7f5cd86ebc68d9ae30d359f96764de67a8f10cd..7829a1b9ffee61bf7433fbccaf9b8b58f1961a3a 100644
--- a/chrome/browser/chromeos/gdata/gdata_util.h
+++ b/chrome/browser/chromeos/gdata/gdata_util.h
@@ -62,6 +62,29 @@ void SetPermissionsForGDataCacheFiles(Profile* profile,
// Returns true if gdata is currently active with the specified profile.
bool IsGDataAvailable(Profile* profile);
+
+// Escapes a file name in GData cache.
+// Replaces percent ('%'), period ('.') and slash ('/') with %XX (hex)
+std::string EscapeCacheFileName(const std::string& filename);
+
+// Unescapes a file path in GData cache.
+// This is the inverse of EscapeCacheFileName.
+std::string UnescapeCacheFileName(const std::string& filename);
+
+// Extracts resource_id, md5, and extra_extension from cache path.
+// Case 1: Pinned and outgoing symlinks only have resource_id.
+// Example: path="/user/GCache/v1/pinned/pdf:a1b2" =>
+// resource_id="pdf:a1b2", md5="", extra_extension="";
+// Case 2: Normal files have both resource_id and md5.
+// Example: path="/user/GCache/v1/tmp/pdf:a1b2.01234567" =>
+// resource_id="pdf:a1b2", md5="01234567", extra_extension="";
+// Case 3: Mounted files have all three parts.
+// Example: path="/user/GCache/v1/persistent/pdf:a1b2.01234567.mounted" =>
+// resource_id="pdf:a1b2", md5="01234567", extra_extension="mounted".
+void ParseCacheFilePath(const FilePath& path,
+ std::string* resource_id,
+ std::string* md5,
+ std::string* extra_extension);
} // namespace util
} // namespace gdata
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_files.h ('k') | chrome/browser/chromeos/gdata/gdata_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698