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

Unified Diff: chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h

Issue 2580303002: mediaview: Mount ARC documents provider file system volumes. (Closed)
Patch Set: Consistently use GetGlobalService(). Created 3 years, 11 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
Index: chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h
index 38ae3c862f013b4c615109d9af815893af89dd85..1ba3583e6a37d3d1238ebbf65f38d0feeead89ba 100644
--- a/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h
+++ b/chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h
@@ -29,7 +29,28 @@ extern const base::FilePath::CharType kDocumentsProviderMountPointPath[];
// Defined as DocumentsContract.Document.MIME_TYPE_DIR in Android.
extern const char kAndroidDirectoryMimeType[];
+// Escapes a string so it can be used as a file/directory name.
+// [%/.] are escaped with percent-encoding.
+// NOTE: This function is visible only for unit testing. Usually you should not
+// call this function directly.
+std::string EscapePathComponent(const std::string& name);
+
+// Unescapes a string escaped by EscapePathComponent().
+// NOTE: This function is visible only for unit testing. Usually you should not
+// call this function directly.
+std::string UnescapePathComponent(const std::string& escaped);
+
+// Returns the path of a directory where the specified DocumentsProvider is
+// mounted.
+// Appropriate escaping is done to embed |authority| and |root_document_id| in
+// a file path.
+base::FilePath GetDocumentsProviderMountPath(
+ const std::string& authority,
+ const std::string& root_document_id);
+
// Parses a FileSystemURL pointing to ARC documents provider file system.
+// Appropriate unescaping is done to extract |authority| and |root_document_id|
+// from |url|.
// On success, true is returned. All arguments must not be nullptr.
bool ParseDocumentsProviderUrl(const storage::FileSystemURL& url,
std::string* authority,
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698