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

Unified Diff: chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.cc

Issue 2464333003: arc: Add utility functions to implement ARC content file system (Closed)
Patch Set: Created 4 years, 1 month 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_content_file_system_url_util.cc
diff --git a/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.cc b/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.cc
index 91747997b911eaab2939a56e2bd4f001bedf4f69..bd118871d7836caca026e1ff37d1b8e11819c2ba 100644
--- a/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.cc
+++ b/chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.cc
@@ -7,6 +7,7 @@
#include "base/files/file_path.h"
#include "chrome/browser/chromeos/fileapi/external_file_url_util.h"
#include "net/base/escape.h"
+#include "storage/browser/fileapi/file_system_url.h"
namespace arc {
@@ -38,4 +39,14 @@ GURL ExternalFileUrlToArcUrl(const GURL& external_file_url) {
net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS));
}
+GURL FileSystemUrlToArcUrl(const storage::FileSystemURL& url) {
hidehiko 2016/11/04 17:19:49 Could you share the "path_after_root" and later co
hashimoto 2016/11/07 05:34:15 You mean sharing the code with ExternalFileUrlToAr
hidehiko 2016/11/07 18:07:54 My question was; Why FileSystemUrlToArcUrl passes
hashimoto 2016/11/08 01:34:16 That makes sense. Done.
+ base::FilePath virtual_path = base::FilePath::FromUTF8Unsafe(kMountPointName);
+ if (!base::FilePath(kMountPointPath)
+ .AppendRelativePath(url.path(), &virtual_path)) {
+ return GURL();
+ }
+ return ExternalFileUrlToArcUrl(
+ chromeos::VirtualPathToExternalFileURL(virtual_path));
+}
+
} // namespace arc

Powered by Google App Engine
This is Rietveld 408576698