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

Unified Diff: webkit/fileapi/isolated_context.cc

Issue 12717014: Launch packaged app with files on Drive on Chrome OS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 7 years, 9 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 | « webkit/fileapi/isolated_context.h ('k') | webkit/fileapi/mount_points.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/fileapi/isolated_context.cc
diff --git a/webkit/fileapi/isolated_context.cc b/webkit/fileapi/isolated_context.cc
index 56ba1c00dfa50150d9d453195283a124817dc943..79cdddd514980fe3cabdf655594fd432983bbd94 100644
--- a/webkit/fileapi/isolated_context.cc
+++ b/webkit/fileapi/isolated_context.cc
@@ -301,26 +301,14 @@ FileSystemURL IsolatedContext::CrackURL(const GURL& url) const {
FileSystemURL filesystem_url = FileSystemURL(url);
if (!filesystem_url.is_valid())
return FileSystemURL();
- return CreateCrackedFileSystemURL(filesystem_url.origin(),
- filesystem_url.mount_type(),
- filesystem_url.path());
+ return CrackFileSystemURL(filesystem_url);
}
FileSystemURL IsolatedContext::CreateCrackedFileSystemURL(
const GURL& origin,
FileSystemType type,
const base::FilePath& path) const {
- if (!HandlesFileSystemMountType(type))
- return FileSystemURL();
-
- std::string mount_name;
- FileSystemType cracked_type;
- base::FilePath cracked_path;
- if (!CrackVirtualPath(path, &mount_name, &cracked_type, &cracked_path))
- return FileSystemURL();
-
- return FileSystemURL(origin, type, path,
- mount_name, cracked_type, cracked_path);
+ return CrackFileSystemURL(FileSystemURL(origin, type, path));
}
void IsolatedContext::RevokeFileSystemByPath(const base::FilePath& path_in) {
@@ -390,6 +378,23 @@ IsolatedContext::~IsolatedContext() {
instance_map_.end());
}
+FileSystemURL IsolatedContext::CrackFileSystemURL(
+ const FileSystemURL& url) const {
+ if (!HandlesFileSystemMountType(url.type()))
+ return FileSystemURL();
+
+ std::string mount_name;
+ FileSystemType cracked_type;
+ base::FilePath cracked_path;
+ if (!CrackVirtualPath(url.path(), &mount_name, &cracked_type, &cracked_path))
+ return FileSystemURL();
+
+ return FileSystemURL(
+ url.origin(), url.mount_type(), url.virtual_path(),
+ !url.filesystem_id().empty() ? url.filesystem_id() : mount_name,
+ cracked_type, cracked_path, mount_name);
+}
+
bool IsolatedContext::UnregisterFileSystem(const std::string& filesystem_id) {
lock_.AssertAcquired();
IDToInstance::iterator found = instance_map_.find(filesystem_id);
« no previous file with comments | « webkit/fileapi/isolated_context.h ('k') | webkit/fileapi/mount_points.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698