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, |