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

Unified Diff: chrome/browser/chromeos/fileapi/file_system_backend.cc

Issue 2580303002: mediaview: Mount ARC documents provider file system volumes. (Closed)
Patch Set: Add a getter of ArcFileSystemService to ArcServiceManager so that VolumeManager can subscribe to AF… 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/fileapi/file_system_backend.cc
diff --git a/chrome/browser/chromeos/fileapi/file_system_backend.cc b/chrome/browser/chromeos/fileapi/file_system_backend.cc
index 9992f284d652bc2040afdbfd20f34c188142c04f..0a77c063f164c80349f549eefeeda2a09c889e9d 100644
--- a/chrome/browser/chromeos/fileapi/file_system_backend.cc
+++ b/chrome/browser/chromeos/fileapi/file_system_backend.cc
@@ -11,6 +11,7 @@
#include "base/command_line.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
+#include "chrome/browser/chromeos/arc/fileapi/arc_documents_provider_util.h"
#include "chrome/browser/chromeos/fileapi/file_access_permissions.h"
#include "chrome/browser/chromeos/fileapi/file_system_backend_delegate.h"
#include "chrome/browser/media_galleries/fileapi/media_file_system_backend.h"
@@ -156,6 +157,21 @@ void FileSystemBackend::ResolveURL(const storage::FileSystemURL& url,
std::string inner_mount_name = components[1];
root_url += inner_mount_name + "/";
name = inner_mount_name;
+ } else if (id == arc::kDocumentsProviderMountPointName) {
+ // For ARC documents provider file system, volumes are mounted per document
+ // provider root, so we need to fix up |root_url| to point to an individual
+ // root.
+ std::string authority;
+ std::string root_document_id;
+ base::FilePath unused_path;
+ if (!arc::ParseDocumentsProviderUrl(url, &authority, &root_document_id,
+ &unused_path)) {
+ callback.Run(GURL(root_url), std::string(),
+ base::File::FILE_ERROR_SECURITY);
+ return;
+ }
+ root_url += authority + "/" + root_document_id + "/";
mtomasz 2017/01/11 09:35:22 Does root_document_id need to be escaped?
Shuhei Takahashi 2017/01/12 08:20:28 You're right. Done.
+ name = authority + ":" + root_document_id;
} else {
name = id;
}

Powered by Google App Engine
This is Rietveld 408576698